/* =====================================================================
   Sawariya Seth Goat Farm — Design system
   Brand palette: midnight navy, temple gold, peacock green and warm cream.
   ===================================================================== */
:root {
    --ss-primary: #0b2239;
    --ss-primary-600: #071a2d;
    --ss-primary-700: #04111f;
    --ss-primary-50: #fff4d2;
    --ss-primary-100: #f2d68a;
    --ss-gold: #e1a91f;
    --ss-gold-dark: #a76b05;
    --ss-gold-soft: #fff4d2;
    --ss-green: #276b3a;
    --ss-green-dark: #174a2a;
    --ss-green-soft: #e8f2df;
    --ss-peacock: #087887;
    --ss-sage: #6d8b55;
    --ss-sage-100: #eef3df;
    --ss-bg: #f8f3e6;
    --ss-surface: #fffdf8;
    --ss-border: #e8dcc0;
    --ss-border-strong: #d6c59f;
    --ss-text: #102238;
    --ss-text-muted: #6d6a60;
    --ss-radius: 12px;
    --ss-radius-sm: 8px;
    --ss-shadow: 0 1px 2px rgba(7, 26, 45, .06), 0 2px 5px rgba(7, 26, 45, .07);
    --ss-shadow-lg: 0 12px 32px rgba(7, 26, 45, .14);
    --ss-sidebar-w: 264px;
    --ss-sidebar-w-collapsed: 76px;
    --ss-topbar-h: 64px;

    /* Bootstrap overrides */
    --bs-primary: #0b2239;
    --bs-primary-rgb: 11, 34, 57;
    --bs-link-color: #174a2a;
    --bs-link-color-rgb: 23, 74, 42;
    --bs-link-hover-color: #0b2239;
    --bs-body-color: #102238;
    --bs-body-bg: #f8f3e6;
    --bs-border-color: #e8dcc0;
    --bs-font-sans-serif: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
    --bs-body-font-size: .9375rem;
    --bs-border-radius: 8px;
    --bs-focus-ring-color: rgba(225, 169, 31, .3);
}

html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--ss-bg);
    color: var(--ss-text);
    font-family: var(--bs-font-sans-serif);
    font-size: var(--bs-body-font-size);
    line-height: 1.55;
    overflow-x: hidden;
}
a { color: var(--ss-green-dark); text-decoration: none; }
a:hover { color: var(--ss-primary-700); text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { color: var(--ss-text); font-weight: 650; letter-spacing: -.01em; }
.text-muted { color: var(--ss-text-muted) !important; }
.small, small { font-size: .84rem; }

.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 2000; background: #fff; padding: 8px 12px; border-radius: 8px; }
.skip-link:focus { left: 8px; }

/* ---------- Buttons ---------- */
.btn { font-weight: 550; border-radius: var(--ss-radius-sm); padding: .5rem 1rem; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; }
.btn-sm { padding: .3rem .65rem; font-size: .82rem; }
.btn-lg { padding: .7rem 1.3rem; }
.btn-primary { --bs-btn-bg: var(--ss-primary); --bs-btn-border-color: var(--ss-primary); --bs-btn-hover-bg: var(--ss-primary-600); --bs-btn-hover-border-color: var(--ss-primary-600); --bs-btn-active-bg: var(--ss-primary-700); --bs-btn-active-border-color: var(--ss-primary-700); --bs-btn-disabled-bg: var(--ss-primary); --bs-btn-disabled-border-color: var(--ss-primary); }
.btn-outline-primary { --bs-btn-color: var(--ss-primary); --bs-btn-border-color: var(--ss-primary-100); --bs-btn-hover-bg: var(--ss-primary-50); --bs-btn-hover-color: var(--ss-primary-700); --bs-btn-hover-border-color: var(--ss-primary); --bs-btn-active-bg: var(--ss-primary-100); --bs-btn-active-color: var(--ss-primary-700); --bs-btn-active-border-color: var(--ss-primary); }
.btn-light { --bs-btn-bg: var(--ss-surface); --bs-btn-border-color: var(--ss-border); --bs-btn-hover-bg: var(--ss-gold-soft); --bs-btn-hover-border-color: var(--ss-primary-100); }
.btn-sage { background: var(--ss-green-soft); color: var(--ss-green-dark); border: 1px solid #c8d9b9; }
.btn-sage:hover { background: var(--ss-gold-soft); color: var(--ss-primary); border-color: var(--ss-primary-100); }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 10px; color: var(--ss-text); background: transparent; border: 0; font-size: 1.2rem; }
.btn-icon:hover { background: var(--ss-gold-soft); }
.btn:hover { text-decoration: none; }
.btn.is-loading { pointer-events: none; opacity: .75; }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout shell ---------- */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; margin-left: var(--ss-sidebar-w); transition: margin-left .2s ease; }
.app-content { flex: 1; padding: 24px 28px 32px; width: 100%; max-width: 1600px; margin: 0 auto; }
.app-footer { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; padding: 14px 28px; font-size: .8rem; color: var(--ss-text-muted); border-top: 1px solid var(--ss-border); background: var(--ss-surface); }

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--ss-sidebar-w); z-index: 1040;
    background: linear-gradient(180deg, #07182b 0%, #0b2239 58%, #102d45 100%);
    color: #fff4d2; display: flex; flex-direction: column; transition: width .2s ease, transform .25s ease;
}
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; min-height: var(--ss-topbar-h); padding: 6px 14px; border-bottom: 1px solid rgba(225,169,31,.24); flex-shrink: 0; }
.brand-link { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; }
.brand-link:hover { color: #fff; text-decoration: none; }
.brand-logo { width: 48px; height: 48px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 2px 3px rgba(0,0,0,.28)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.brand-tag { font-size: .7rem; color: #e7c86d; text-transform: uppercase; letter-spacing: .08em; }
.sidebar-close { color: #fff; }
.sidebar-close:hover { background: rgba(255,255,255,.1); color: #fff; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px 20px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.2) transparent; }
.nav-list, .nav-sub { list-style: none; margin: 0; padding: 0; }
.nav-link-main {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; margin-bottom: 2px;
    border: 0; background: transparent; color: #f6ebce; border-radius: 10px; font-size: .9rem; font-weight: 500; text-align: left;
}
.nav-link-main i:first-child { font-size: 1.1rem; width: 22px; text-align: center; flex-shrink: 0; opacity: .9; }
.nav-link-main span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-link-main:hover { background: rgba(225,169,31,.14); color: #fff8e5; text-decoration: none; }
.nav-link-main.active { background: linear-gradient(90deg, #f5d77f, #fff4d2); color: var(--ss-primary); font-weight: 700; box-shadow: 0 3px 12px rgba(0,0,0,.18); }
.nav-link-main.active-group { color: #f5d77f; }
.nav-caret { font-size: .75rem; transition: transform .2s; opacity: .7; }
.nav-group.open .nav-caret { transform: rotate(180deg); }
.nav-sub { display: none; padding: 2px 0 6px 34px; position: relative; }
.nav-sub::before { content: ""; position: absolute; left: 22px; top: 4px; bottom: 8px; width: 1px; background: rgba(225,169,31,.3); }
.nav-group.open .nav-sub { display: block; }
.nav-link-sub { display: block; padding: 7px 12px; border-radius: 8px; color: #ddcfaa; font-size: .86rem; }
.nav-link-sub:hover { color: #fff8e5; background: rgba(225,169,31,.1); text-decoration: none; }
.nav-link-sub.active { color: #f7d979; background: rgba(225,169,31,.16); font-weight: 650; }
.sidebar-footer { padding: 10px 18px; color: #cbbd95; border-top: 1px solid rgba(225,169,31,.2); }

/* Desktop collapsed sidebar */
body.sidebar-collapsed .sidebar { width: var(--ss-sidebar-w-collapsed); }
body.sidebar-collapsed .app-main { margin-left: var(--ss-sidebar-w-collapsed); }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-link-main span,
body.sidebar-collapsed .nav-caret,
body.sidebar-collapsed .nav-sub,
body.sidebar-collapsed .sidebar-footer { display: none !important; }
body.sidebar-collapsed .nav-link-main { justify-content: center; padding: 11px 0; }
body.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0; }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 1030; height: var(--ss-topbar-h);
    display: flex; align-items: center; gap: 12px; padding: 0 20px;
    background: rgba(255,253,248,.94); backdrop-filter: saturate(180%) blur(8px);
    border-bottom: 1px solid var(--ss-border);
}
.topbar-title { font-weight: 650; font-size: 1.02rem; min-width: 0; flex-shrink: 1; }
.topbar-search { position: relative; margin-left: auto; width: 340px; max-width: 40vw; }
.topbar-search > .bi-search { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ss-text-muted); pointer-events: none; }
.topbar-search .form-control { padding-left: 36px; background: var(--ss-bg); border-color: transparent; border-radius: 10px; height: 40px; }
.topbar-search .form-control:focus { background: var(--ss-surface); border-color: var(--ss-gold); }
.topbar-logo { object-fit: contain; filter: drop-shadow(0 1px 2px rgba(7,26,45,.18)); }
.search-results { width: 100%; max-height: 360px; overflow-y: auto; margin-top: 4px; }
.search-results.show { display: block; }
.search-results .dropdown-item { white-space: normal; padding: 8px 12px; }
.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: 12px; }
.notif-dot { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #c0392b; color: #fff; font-size: .65rem; font-weight: 700; line-height: 18px; text-align: center; }
.notif-menu { width: 360px; max-width: calc(100vw - 24px); padding: 0; border-radius: var(--ss-radius); overflow: hidden; }
.notif-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--ss-border); }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif-item { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--ss-border); color: var(--ss-text); }
.notif-item:hover { background: var(--ss-bg); text-decoration: none; color: var(--ss-text); }
.notif-item.unread { background: var(--ss-gold-soft); }
.notif-item .notif-icon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--ss-green-soft); color: var(--ss-green-dark); flex-shrink: 0; }
.notif-item .notif-title { font-weight: 600; font-size: .86rem; }
.notif-item .notif-msg { font-size: .8rem; color: var(--ss-text-muted); }
.notif-item .notif-time { font-size: .72rem; color: var(--ss-text-muted); }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 24px; border: 1px solid var(--ss-border); background: var(--ss-surface); }
.user-chip:hover { background: var(--ss-bg); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ss-primary); color: #f5d77f; display: grid; place-items: center; font-weight: 700; font-size: .78rem; box-shadow: inset 0 0 0 1px rgba(225,169,31,.35); }
.user-chip-name { font-weight: 600; font-size: .86rem; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropdown-menu { border-color: var(--ss-border); border-radius: var(--ss-radius-sm); font-size: .9rem; }
.dropdown-item { padding: .5rem 1rem; }
.dropdown-item:active { background: var(--ss-primary); }

/* ---------- Page header ---------- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.page-title { font-size: 1.5rem; margin: 0; }
.page-subtitle { margin: 4px 0 0; color: var(--ss-text-muted); font-size: .9rem; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.breadcrumb { margin-bottom: 4px; font-size: .8rem; --bs-breadcrumb-divider-color: var(--ss-text-muted); }
.breadcrumb a { color: var(--ss-text-muted); }
.breadcrumb-item.active { color: var(--ss-text-muted); }

/* ---------- Cards ---------- */
.card { border: 1px solid var(--ss-border); border-radius: var(--ss-radius); box-shadow: var(--ss-shadow); background: var(--ss-surface); }
.card-header { background: transparent; border-bottom: 1px solid var(--ss-border); padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-header h2, .card-header h3, .card-header h5, .card-header .card-title { font-size: 1rem; margin: 0; font-weight: 650; }
.card-body { padding: 18px; }
.card-footer { background: #fcf8ec; border-top: 1px solid var(--ss-border); padding: 12px 18px; }
.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ss-text-muted); font-weight: 700; margin: 0 0 12px; }

/* KPI cards */
.kpi-link { display: block; color: inherit; height: 100%; }
.kpi-link:hover { text-decoration: none; color: inherit; }
.kpi-link:hover .kpi-card { border-color: var(--ss-gold); box-shadow: var(--ss-shadow-lg); transform: translateY(-1px); }
.kpi-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; height: 100%; background: var(--ss-surface); border: 1px solid var(--ss-border); border-radius: var(--ss-radius); box-shadow: var(--ss-shadow); transition: all .15s ease; }
.kpi-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.kpi-body { min-width: 0; }
.kpi-label { font-size: .78rem; color: var(--ss-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi-value { font-size: clamp(1.05rem, 1.2vw + .5rem, 1.45rem); font-weight: 750; line-height: 1.2; color: var(--ss-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-sub { font-size: .78rem; color: var(--ss-text-muted); }
.kpi-green .kpi-icon { background: var(--ss-green-soft); color: var(--ss-green-dark); }
.kpi-sage .kpi-icon { background: var(--ss-gold-soft); color: var(--ss-gold-dark); }
.kpi-amber .kpi-icon { background: #fff0bd; color: var(--ss-gold-dark); }
.kpi-red .kpi-icon { background: #fbe9e7; color: #b23a2b; }
.kpi-blue .kpi-icon { background: #e8edf2; color: var(--ss-primary); }
.kpi-pink .kpi-icon { background: #e5f3ef; color: var(--ss-peacock); }
.kpi-purple .kpi-icon { background: #edf1df; color: var(--ss-sage); }

/* ---------- Badges ---------- */
.badge-soft { font-weight: 600; font-size: .74rem; padding: .35em .65em; border-radius: 20px; letter-spacing: .01em; }
.badge-soft-success { background: var(--ss-green-soft); color: var(--ss-green-dark); }
.badge-soft-info { background: #e8edf2; color: var(--ss-primary); }
.badge-soft-dark { background: #dfe5e9; color: var(--ss-primary-700); }
.badge-soft-muted, .badge-soft-secondary { background: #f1ecdf; color: #655f52; }
.badge-soft-danger { background: #fbe4e1; color: #a52a1c; }
.badge-soft-warning { background: var(--ss-gold-soft); color: var(--ss-gold-dark); }
.badge-soft-pink { background: #e5f3ef; color: #09606d; }
.badge-soft-purple { background: #edf1df; color: #536c3d; }
.badge-soft-blue { background: #e8edf2; color: var(--ss-primary); }

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; margin-bottom: 0; font-size: .89rem; }
.table > :not(caption) > * > * { padding: .7rem .85rem; border-bottom-color: var(--ss-border); vertical-align: middle; }
.table thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ss-primary); font-weight: 700; background: #f8f1de; white-space: nowrap; border-bottom: 1px solid var(--ss-primary-100); }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #fff9e8; }
.table tfoot td, .table tfoot th { font-weight: 700; background: #f8f1de; }
.table-sortable thead th[data-sortable] { cursor: pointer; user-select: none; }
.table-sortable thead th[data-sortable]::after { content: " \2195"; opacity: .35; font-size: .8em; }
.table-sortable thead th.sort-asc::after { content: " \25B2"; opacity: .8; }
.table-sortable thead th.sort-desc::after { content: " \25BC"; opacity: .8; }
.sort-link { color: inherit; }
.sort-link:hover { color: var(--ss-primary); text-decoration: none; }
.table-card { overflow: hidden; }
.table-card .table-responsive { margin: 0; }
.goat-thumb { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--ss-sage-100); display: inline-grid; place-items: center; color: var(--ss-sage); flex-shrink: 0; }
.cell-title { font-weight: 600; color: var(--ss-text); }
.cell-sub { font-size: .78rem; color: var(--ss-text-muted); }
.actions-cell { white-space: nowrap; text-align: right; }
.actions-cell .btn, .actions-cell form { margin-left: 4px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Filters ---------- */
.filter-bar { background: var(--ss-surface); border: 1px solid var(--ss-border); border-radius: var(--ss-radius); padding: 14px; margin-bottom: 16px; box-shadow: var(--ss-shadow); }
.filter-bar .form-label { font-size: .75rem; margin-bottom: 4px; }
.pagination-bar { padding: 12px 18px; border-top: 1px solid var(--ss-border); }
.pagination { --bs-pagination-color: var(--ss-primary); --bs-pagination-active-bg: var(--ss-primary); --bs-pagination-active-border-color: var(--ss-gold); --bs-pagination-hover-color: var(--ss-primary-700); --bs-pagination-hover-bg: var(--ss-gold-soft); --bs-pagination-focus-box-shadow: 0 0 0 .2rem rgba(225,169,31,.22); }

/* ---------- Forms ---------- */
.form-label { font-weight: 600; font-size: .84rem; color: var(--ss-primary); margin-bottom: 6px; }
.form-label .req { color: #b23a2b; margin-left: 2px; }
.form-control, .form-select { border-color: var(--ss-border-strong); border-radius: var(--ss-radius-sm); padding: .55rem .8rem; font-size: .92rem; min-height: 42px; }
.form-control-sm, .form-select-sm { min-height: 34px; padding: .3rem .6rem; font-size: .85rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--ss-gold); box-shadow: 0 0 0 .2rem rgba(225,169,31,.18); }
.form-check-input:checked { background-color: var(--ss-green); border-color: var(--ss-green); }
.form-text { font-size: .78rem; color: var(--ss-text-muted); }
.input-group-text { background: var(--ss-bg); border-color: var(--ss-border-strong); }
.form-section { padding-bottom: 8px; margin-bottom: 18px; border-bottom: 1px dashed var(--ss-border); }
.form-section:last-child { border-bottom: 0; margin-bottom: 0; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; padding-top: 6px; }
.line-items .line-item { background: #fcf8ec; border: 1px solid var(--ss-border); border-radius: var(--ss-radius-sm); padding: 12px; margin-bottom: 10px; position: relative; }
.line-items .line-remove { position: absolute; top: 8px; right: 8px; }
.totals-box { background: var(--ss-primary-50); border: 1px solid var(--ss-primary-100); border-radius: var(--ss-radius); padding: 14px 16px; }
.totals-box .row-line { display: flex; justify-content: space-between; padding: 3px 0; }
.totals-box .grand { font-size: 1.15rem; font-weight: 750; border-top: 1px solid var(--ss-primary-100); margin-top: 6px; padding-top: 8px; }

/* ---------- Misc components ---------- */
.empty-state { text-align: center; padding: 40px 16px; }
.empty-state-icon { width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 18px; background: var(--ss-gold-soft); color: var(--ss-green-dark); display: grid; place-items: center; font-size: 1.7rem; }
.empty-state h6 { font-weight: 650; margin-bottom: 4px; }
.alert { border-radius: var(--ss-radius-sm); border-width: 1px; font-size: .9rem; }
.flash-alert { box-shadow: var(--ss-shadow); }
.detail-list { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 8px 14px; margin: 0; font-size: .9rem; }
.detail-list dt { color: var(--ss-text-muted); font-weight: 500; }
.detail-list dd { margin: 0; font-weight: 550; word-break: break-word; }
.profile-hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.profile-photo { width: 104px; height: 104px; border-radius: 18px; object-fit: cover; background: var(--ss-green-soft); display: grid; place-items: center; font-size: 2.6rem; color: var(--ss-green); border: 1px solid var(--ss-border); }
.profile-tag { font-size: 1.5rem; font-weight: 750; }
.nav-tabs-modern { border-bottom: 1px solid var(--ss-border); gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.nav-tabs-modern::-webkit-scrollbar { display: none; }
.nav-tabs-modern .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--ss-text-muted); font-weight: 600; padding: 10px 14px; white-space: nowrap; border-radius: 0; background: none; }
.nav-tabs-modern .nav-link:hover { color: var(--ss-primary); }
.nav-tabs-modern .nav-link.active { color: var(--ss-primary); border-bottom-color: var(--ss-primary); background: none; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 14px 22px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--ss-gold); box-shadow: 0 0 0 3px var(--ss-gold-soft); }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 18px; bottom: 0; width: 1px; background: var(--ss-border); }
.timeline li:last-child::after { display: none; }
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 220px; }
.list-compact { list-style: none; margin: 0; padding: 0; }
.list-compact li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--ss-border); }
.list-compact li:last-child { border-bottom: 0; }
.progress { background: var(--ss-gold-soft); border-radius: 20px; height: 8px; }
.progress-bar { background: linear-gradient(90deg, var(--ss-green), var(--ss-gold)); }
.stat-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; background: var(--ss-green-soft); font-size: .8rem; font-weight: 600; color: var(--ss-green-dark); }

/* Family tree */
.tree { display: flex; flex-direction: column; align-items: center; gap: 0; overflow-x: auto; padding-bottom: 10px; }
.tree-row { display: flex; gap: 14px; justify-content: center; position: relative; padding: 14px 0; }
.tree-node { min-width: 150px; background: var(--ss-surface); border: 1px solid var(--ss-border); border-radius: 10px; padding: 8px 12px; text-align: center; box-shadow: var(--ss-shadow); font-size: .85rem; }
.tree-node.self { border-color: var(--ss-primary); background: var(--ss-primary-50); }
.tree-node.unknown { color: var(--ss-text-muted); border-style: dashed; box-shadow: none; }
.tree-node .tn-role { font-size: .68rem; text-transform: uppercase; color: var(--ss-text-muted); letter-spacing: .06em; }
.tree-connector { width: 2px; height: 16px; background: var(--ss-border-strong); margin: 0 auto; }

/* Auth (login / installer) */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1100px 620px at 8% -8%, rgba(225,169,31,.22) 0%, transparent 60%), radial-gradient(900px 520px at 108% 108%, rgba(39,107,58,.17) 0%, transparent 60%), var(--ss-bg); }
.auth-card { width: 100%; max-width: 420px; background: var(--ss-surface); border: 1px solid var(--ss-primary-100); border-radius: 20px; box-shadow: var(--ss-shadow-lg); padding: 28px; }
.auth-card.wide { max-width: 640px; }
.auth-logo { width: 140px; height: 140px; object-fit: contain; display: block; margin: -8px auto 8px; filter: drop-shadow(0 6px 10px rgba(7,26,45,.16)); }
.auth-title { text-align: center; font-size: 1.35rem; margin-bottom: 4px; }
.auth-sub { text-align: center; color: var(--ss-text-muted); font-size: .9rem; margin-bottom: 24px; }

/* Error page */
.error-page { min-height: 100vh; display: grid; place-items: center; background: var(--ss-bg); padding: 20px; }
.error-box { text-align: center; max-width: 440px; background: var(--ss-surface); padding: 36px 28px; border-radius: 18px; border: 1px solid var(--ss-primary-100); box-shadow: var(--ss-shadow-lg); }
.error-code { font-size: 3rem; font-weight: 800; color: var(--ss-primary); line-height: 1; margin-bottom: 8px; }

/* Print */
.print-only { display: none; }
@media print {
    .sidebar, .topbar, .app-footer, .page-actions, .filter-bar, .no-print, .pagination-bar, .btn, .breadcrumb, .flash-alert { display: none !important; }
    .print-only { display: block !important; }
    .app-main { margin: 0 !important; }
    .app-content { padding: 0 !important; max-width: none; }
    body { background: #fff; font-size: 11pt; }
    .card { box-shadow: none; border-color: #ccc; break-inside: avoid; }
    .table thead th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a { color: inherit; text-decoration: none; }
    .chart-box { height: 240px; }
}
