/* ==========================================================================
   Unifour Portal - shared design system (Admin Portal + Client Portal)
   Brand: Unifour Consultancy (unifour.com.np) - blue #0274B3, green #50C878,
   Montserrat for display type, Inter for interface text.
   ========================================================================== */

@view-transition { navigation: auto; }

:root {
  --brand: #0274B3;
  --brand-hover: #015E92;
  --brand-deep: #0B3D66;
  --brand-soft: #E8F3FA;
  --brand-ring: rgba(2, 116, 179, .18);
  --accent: #50C878;
  --accent-deep: #2E9E5B;
  --accent-soft: #EAF8F0;

  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-2: #F2F5F9;
  --border: #E4E9F0;
  --border-strong: #CDD5E0;
  --text-1: #0F1B2D;
  --text-2: #4A5568;
  --text-3: #8A94A6;

  --success: #1F9D55; --success-soft: #E7F6EE;
  --warn: #C77700;    --warn-soft: #FFF4DE;
  --danger: #D93025;  --danger-soft: #FDECEA;

  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px;
  --shadow-xs: 0 1px 2px rgba(15, 27, 45, .05);
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .04), 0 4px 12px -2px rgba(15, 27, 45, .05);
  --shadow-md: 0 2px 6px rgba(15, 27, 45, .05), 0 18px 40px -12px rgba(15, 27, 45, .16);
  --ease: cubic-bezier(.2, 0, 0, 1);
  --dur: 200ms;

  --font-display: "Montserrat", "Inter", system-ui, sans-serif;
  --font-sans: "Inter", "Noto Sans Devanagari", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --skeleton-mid: #E9EEF4;
  --band-1: #FFFFFF; --band-2: #F1F7FC;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-sans); font-size: 15px; line-height: 1.5; color: var(--text-1);
  background:
    radial-gradient(1100px 420px at 0% -8%, rgba(2, 116, 179, .07), transparent 60%),
    radial-gradient(900px 380px at 100% -12%, rgba(80, 200, 120, .06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  font-feature-settings: "cv05" 1, "ss01" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
}
::selection { background: rgba(2, 116, 179, .16); }
a { color: var(--brand); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--brand-hover); }
[x-cloak] { display: none !important; }

h1, h2, h3 { font-family: var(--font-display); color: var(--text-1); }
h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; margin: 0 0 6px; }
h2 { font-size: 1.02rem; font-weight: 700; letter-spacing: -.012em; margin: 0 0 14px; }
h3 { font-size: .92rem; font-weight: 700; letter-spacing: -.005em; }
p { margin: 0 0 12px; }

.label, label { font-size: .78rem; font-weight: 600; color: var(--text-2); display: block; margin: 12px 0 6px; }
td, th, .kpi-value, .amount, input[type="number"] { font-variant-numeric: tabular-nums; }
.mono, .pan, .tran-no, .submission-no { font-family: var(--font-mono); font-size: .86em; letter-spacing: -.01em; }
.muted { color: var(--text-2); }

/* ---- Brand lockup ---------------------------------------------------- */
.brand-lockup { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-lockup img { width: 30px; height: auto; display: block; }
.brand-lockup .brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-lockup .brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem;
                            letter-spacing: -.02em; color: var(--brand); white-space: nowrap; }
.brand-lockup .brand-sub { font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
                           color: var(--text-3); margin-top: 3px; }

/* ---- Surfaces --------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
        padding: 22px 24px; margin-bottom: 18px; box-shadow: var(--shadow-sm); overflow-x: auto; }
.card > h2:first-child { margin-top: 0; }

.header-band { position: relative; overflow: hidden;
               background: linear-gradient(135deg, var(--band-1) 0%, var(--band-2) 62%, #EEF9F3 100%);
               border: 1px solid var(--border); border-radius: var(--r-xl); padding: 24px 28px; margin-bottom: 20px;
               box-shadow: var(--shadow-sm); }
.header-band::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
                       background: linear-gradient(90deg, var(--brand), var(--accent)); }
.header-band .top-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.header-band .meta-row { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: center; margin-top: 10px;
                         font-size: .82rem; color: var(--text-2); }
.sync-line { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: .82rem; margin-top: 14px;
             padding-top: 14px; border-top: 1px solid var(--border); }
.sync-line .item { display: flex; align-items: center; gap: 6px; }

/* ---- Company logo in page headers ----------------------------------- */
.co-head { display: flex; align-items: center; gap: 16px; }
.co-logo { height: 56px; max-width: 160px; object-fit: contain; background: #fff; border: 1px solid var(--border);
           border-radius: 14px; padding: 6px; flex-shrink: 0; box-shadow: var(--shadow-xs); }

/* ---- Tables ----------------------------------------------------------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .875rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--text-3); font-weight: 600; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
     background: transparent; }
tr:last-child > td { border-bottom: none; }
tbody tr, table tr { transition: background var(--dur) var(--ease); }
tbody tr:hover td, table tr:hover > td { background: #F7FAFD; }
tr.totals-row td, tr.totals-row th { font-weight: 700; background: var(--surface-2); border-top: 1px solid var(--border-strong); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.timestamp, th.timestamp { min-width: 150px; white-space: nowrap; }
@keyframes rowIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.stagger-rows tr { animation: rowIn 240ms var(--ease) both; }
.stagger-rows tr:nth-child(2) { animation-delay: 20ms; } .stagger-rows tr:nth-child(3) { animation-delay: 40ms; }
.stagger-rows tr:nth-child(4) { animation-delay: 60ms; } .stagger-rows tr:nth-child(5) { animation-delay: 80ms; }
.stagger-rows tr:nth-child(6) { animation-delay: 100ms; } .stagger-rows tr:nth-child(7) { animation-delay: 120ms; }
.stagger-rows tr:nth-child(8) { animation-delay: 140ms; } .stagger-rows tr:nth-child(9) { animation-delay: 160ms; }
.stagger-rows tr:nth-child(10) { animation-delay: 180ms; }

/* ---- Buttons ---------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; background: var(--brand); color: #fff;
       border: 1px solid transparent; padding: 9px 16px; border-radius: 10px; cursor: pointer; text-decoration: none;
       font-size: .86rem; font-weight: 600; font-family: inherit; letter-spacing: -.005em; line-height: 1.2;
       box-shadow: 0 1px 2px rgba(2, 116, 179, .18), inset 0 1px 0 rgba(255, 255, 255, .12);
       transition: background var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.btn:hover { background: var(--brand-hover); color: #fff; transform: translateY(-1px);
             box-shadow: 0 6px 16px -6px rgba(2, 116, 179, .55); }
.btn:active { transform: translateY(0) scale(.985); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-sm { padding: 6px 12px; font-size: .8rem; border-radius: 9px; }
.btn-outline { background: var(--surface); color: var(--brand); border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.btn-outline:hover { background: var(--brand-soft); color: var(--brand-hover); border-color: rgba(2, 116, 179, .35);
                     box-shadow: var(--shadow-xs); }
.btn-danger { background: var(--danger); box-shadow: 0 1px 2px rgba(217, 48, 37, .2); }
.btn-danger:hover { background: #B3261E; box-shadow: 0 6px 16px -6px rgba(217, 48, 37, .5); }
.btn-ghost { background: none; color: var(--text-2); border-color: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text-1); box-shadow: none; }

/* ---- Forms ------------------------------------------------------------ */
input, select, textarea {
  padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 10px; width: 100%;
  background: var(--surface); color: var(--text-1); font-family: inherit; font-size: .9rem; line-height: 1.35;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: #B8C3D1; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-ring); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--brand); box-shadow: none; }
input[type="file"] { padding: 7px; background: var(--surface-2); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A94A6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; }
form.inline { display: grid; gap: 6px 14px; grid-template-columns: 1fr 1fr; }
form.inline .full { grid-column: 1 / 3; }

/* ---- Badges ----------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
         font-size: .74rem; font-weight: 600; letter-spacing: .005em; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.badge-green { background: var(--success-soft); color: var(--success); } .badge-green .dot { background: var(--success); }
.badge-amber { background: var(--warn-soft); color: var(--warn); } .badge-amber .dot { background: var(--warn); }
.badge-red { background: var(--danger-soft); color: var(--danger); } .badge-red .dot { background: var(--danger); }
.badge-gray { background: var(--surface-2); color: var(--text-2); } .badge-gray .dot { background: var(--text-3); }
.badge-running .dot { animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(2, 116, 179, .45) } 50% { box-shadow: 0 0 0 5px rgba(2, 116, 179, 0) } }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; }
.pill.yes { background: var(--success-soft); color: var(--success); } .pill.no { background: var(--danger-soft); color: var(--danger); }

/* ---- Segmented controls & tabs (Apple-style) --------------------------- */
.segmented { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface-2);
             border: 1px solid var(--border); border-radius: 12px; }
.segmented a, .segmented button { padding: 6px 13px; font-size: .8rem; font-weight: 600; background: transparent;
             color: var(--text-2); text-decoration: none; border: none; border-radius: 9px; cursor: pointer;
             font-family: inherit; display: inline-flex; align-items: center;
             transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.segmented a:hover, .segmented button:hover { color: var(--text-1); }
.segmented a.active, .segmented button.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.segmented button[disabled] { color: var(--text-3); cursor: not-allowed; opacity: .55; }
.segmented button .count { font-size: .66rem; opacity: .7; margin-left: 5px; }

.tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; margin: 0 0 20px; background: var(--surface-2);
        border: 1px solid var(--border); border-radius: 14px; width: fit-content; max-width: 100%; }
.tabs button { padding: 8px 15px; background: none; border: none; border-radius: 10px; font-family: inherit;
               font-size: .85rem; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap;
               transition: background var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.tabs button:hover { color: var(--text-1); }
.tabs button.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.tab-panel { animation: fadein 220ms var(--ease); }
@keyframes fadein { from { opacity: 0; transform: translateY(3px) } to { opacity: 1; transform: none } }

/* ---- KPI tiles -------------------------------------------------------- */
.kpi-group-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3);
                   margin: 22px 0 10px; }
.kpi-group-label:first-of-type { margin-top: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px;
            box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.kpi-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-tile.headline { background: linear-gradient(135deg, #0274B3 0%, #0B5E95 58%, #1F8F68 125%); color: #fff; border: none;
                     box-shadow: 0 16px 34px -14px rgba(2, 116, 179, .6); }
.kpi-tile.headline .kpi-label { color: rgba(255, 255, 255, .78); }
.kpi-label { font-size: .7rem; font-weight: 700; color: var(--text-3); margin-bottom: 8px; text-transform: uppercase; letter-spacing: .08em; }
.kpi-value { font-size: 1.6rem; font-weight: 700; letter-spacing: -.025em; line-height: 1.1; }
.kpi-value .cur { font-size: .56em; font-weight: 600; color: var(--text-3); margin-right: 3px; letter-spacing: 0; }
.kpi-tile.headline .kpi-value .cur { color: rgba(255, 255, 255, .7); }
.kpi-sub { font-size: .76rem; color: var(--text-3); margin-top: 6px; }
.kpi-tile.headline .kpi-sub { color: rgba(255, 255, 255, .75); }
/* Direction only, not good/bad - a rise in sales isn't inherently positive. */
.kpi-delta { font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--surface-2);
             color: var(--text-2); text-transform: none; letter-spacing: 0; }

/* ---- Filter bars ------------------------------------------------------ */
.topbar-filter, .filter-bar { display: flex; gap: 12px 14px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px;
                              background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
                              padding: 14px 16px; box-shadow: var(--shadow-xs); }
.filter-bar label { margin: 0 0 6px; }
.filter-bar .field { min-width: 160px; }

.status-strip { display: flex; gap: 14px; flex-wrap: wrap; }
.status-strip .item { display: flex; align-items: center; gap: 8px; font-size: .85rem; }

/* ---- Deadlines / heatmap (compliance dashboard) ----------------------- */
.deadline-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 18px; }
.deadline-card { border-radius: var(--r-lg); padding: 16px 18px; border: 1px solid var(--border); background: var(--surface);
                 box-shadow: var(--shadow-xs); }
.deadline-card.urgent { border-color: rgba(217, 48, 37, .35); background: var(--danger-soft); }
.deadline-card.soon { border-color: rgba(199, 119, 0, .35); background: var(--warn-soft); }
.deadline-card .dl-label { font-size: .7rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.deadline-card .dl-date { font-family: var(--font-display); font-size: 1.05rem; font-weight: 700; margin: 6px 0 4px; }
.deadline-card .dl-countdown { font-size: .8rem; color: var(--text-2); }

.heatmap { display: grid; grid-template-columns: 70px repeat(12, 1fr); gap: 4px; font-size: .72rem; }
.heatmap .row-label { display: flex; align-items: center; color: var(--text-2); font-weight: 600; }
.heatmap .cell { aspect-ratio: 1; border-radius: 7px; display: flex; align-items: center; justify-content: center;
                 color: #fff; font-weight: 600; cursor: default; transition: transform var(--dur) var(--ease); }
.heatmap .cell:hover { transform: scale(1.08); }
.heatmap .cell.filed { background: var(--success); }
.heatmap .cell.late { background: var(--warn); }
.heatmap .cell.missing { background: var(--danger); }
.heatmap .cell.empty { background: var(--surface-2); color: var(--text-3); }
.heatmap .cell.na { background: transparent; color: var(--text-3); opacity: .35; }
.heatmap-scroll { overflow-x: auto; }

/* ---- Company switcher -------------------------------------------------- */
.company-switcher { position: relative; display: inline-block; margin-bottom: 16px; }
.switcher-trigger { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--border);
                    border-radius: 12px; padding: 9px 14px; cursor: pointer; font-family: inherit; font-size: .9rem;
                    color: var(--text-1); box-shadow: var(--shadow-sm); }
.switcher-trigger .name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.switcher-trigger .pan-chip { font-size: .76rem; color: var(--text-3); }
.switcher-trigger .chev { color: var(--text-3); transition: transform var(--dur) var(--ease); }
.switcher-trigger .chev.up { transform: rotate(180deg); }
.switcher-pop { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; min-width: 300px; background: var(--surface);
                border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-md); overflow: hidden; }
.switcher-search { width: 100%; border: none; border-bottom: 1px solid var(--border); border-radius: 0; padding: 12px 14px;
                   font-family: inherit; font-size: .88rem; }
.switcher-search:focus { box-shadow: none; }
.switcher-list { max-height: 300px; overflow-y: auto; padding: 4px; }
.switcher-item { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 9px 12px;
                 text-decoration: none; color: var(--text-1); font-size: .87rem; border-radius: 9px; }
.switcher-item:hover { background: var(--surface-2); color: var(--text-1); }
.switcher-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.switcher-item .pan { font-size: .76rem; flex-shrink: 0; }

/* ---- Sync Center job list -------------------------------------------- */
.job-list { display: flex; flex-direction: column; gap: 1px; background: var(--border); border: 1px solid var(--border);
            border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.job-row { display: flex; align-items: center; gap: 14px; padding: 15px 18px; background: var(--surface); cursor: pointer;
           transition: background var(--dur) var(--ease); }
.job-row:hover { background: #F7FAFD; }
.job-row .job-icon { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand);
                     display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.job-row .job-info { flex: 1; min-width: 0; }
.job-row .job-name { font-weight: 600; font-size: .9rem; }
.job-row .job-desc { font-size: .8rem; color: var(--text-3); margin-top: 2px; }
.job-row .job-meta { text-align: right; font-size: .78rem; color: var(--text-3); flex-shrink: 0; }

/* ---- Drawers, modals, dialogs ---------------------------------------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(15, 27, 45, .42); backdrop-filter: blur(6px);
                   -webkit-backdrop-filter: blur(6px); z-index: 40; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(460px, 92vw); background: var(--surface);
          box-shadow: -12px 0 40px rgba(15, 27, 45, .16); z-index: 41; display: flex; flex-direction: column;
          border-radius: 18px 0 0 18px; }
.drawer-head { padding: 20px 22px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.drawer-body { padding: 22px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 16px 22px; border-top: 1px solid var(--border); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(15, 27, 45, .45); backdrop-filter: blur(6px);
                  -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-box { background: var(--surface); border-radius: var(--r-xl); padding: 26px; max-width: 660px; width: 92%;
             max-height: 84vh; overflow-y: auto; box-shadow: var(--shadow-md); }
.modal-box h3 { margin-top: 0; }

dialog.pdf-modal { border: none; border-radius: var(--r-xl); padding: 0; width: 90vw; height: 90vh; max-width: 1100px;
                   box-shadow: var(--shadow-md); }
dialog.pdf-modal::backdrop { background: rgba(15, 27, 45, .5); backdrop-filter: blur(6px); }
.pdf-modal-inner { display: flex; flex-direction: column; height: 100%; }
.pdf-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.pdf-modal-head .titles { display: flex; flex-direction: column; }
.pdf-modal-body { flex: 1; position: relative; background: var(--surface-2); }
.pdf-modal-body iframe { width: 100%; height: 100%; border: none; }
.pdf-nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(15, 27, 45, .55); color: #fff; border: none;
               width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; z-index: 2; }
.pdf-nav-btn.prev { left: 10px; } .pdf-nav-btn.next { right: 10px; }

details.section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: 14px;
                  box-shadow: var(--shadow-xs); }
details.section summary { padding: 15px 20px; cursor: pointer; font-weight: 700; font-size: .92rem; list-style: none;
                          display: flex; align-items: center; gap: 8px; font-family: var(--font-display); }
details.section summary::-webkit-details-marker { display: none; }
details.section summary .chevron { transition: transform var(--dur) var(--ease); flex-shrink: 0; }
details.section[open] summary .chevron { transform: rotate(90deg); }
details.section .acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur) var(--ease); }
details.section[open] .acc-body { grid-template-rows: 1fr; }
details.section .acc-body > div { overflow: hidden; }
details.section .section-body { padding: 0 20px 18px; }

.accordion-item { border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: 10px; overflow: hidden; background: var(--surface); }
.accordion-head { padding: 15px 18px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; background: var(--surface); }
.accordion-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 260ms var(--ease); }
.accordion-body.open { grid-template-rows: 1fr; }
.accordion-body > div { overflow: hidden; }
.schedule-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; padding: 16px 18px; }
.schedule-card { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; background: var(--surface-2); }
.actions-row { display: flex; gap: 6px; }

.warning-banner { position: sticky; top: 0; z-index: 5; background: var(--danger); color: #fff; padding: 11px 16px;
                  border-radius: var(--r-md); margin-bottom: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.wizard-steps { display: flex; gap: 6px; margin-bottom: 20px; padding: 4px; background: var(--surface-2); border-radius: 14px;
                border: 1px solid var(--border); }
.wizard-steps .step { flex: 1; text-align: center; padding: 9px; border-radius: 10px; font-size: .8rem; font-weight: 600;
                      color: var(--text-3); transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.wizard-steps .step.active { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.wizard-steps .step.done { background: var(--success-soft); color: var(--success); }

.toast-stack { position: fixed; bottom: 22px; right: 22px; z-index: 60; display: flex; flex-direction: column; gap: 8px; }
.toast { background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
         border: 1px solid var(--border); border-left: 4px solid var(--success); border-radius: 12px; padding: 13px 18px;
         box-shadow: var(--shadow-md); font-size: .86rem; font-weight: 500; min-width: 240px; }
.toast.error { border-left-color: var(--danger); }

.compliance-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 440px; }
.compliance-cell { padding: 14px 8px; border-radius: 10px; text-align: center; font-size: .82rem; font-weight: 600; cursor: pointer; }

.toggle { position: relative; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle input { display: none; }
.toggle .track { width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); position: relative;
                 transition: background var(--dur) var(--ease); flex-shrink: 0; }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
                        background: #fff; transition: transform var(--dur) var(--ease); box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.toggle input:checked + .track { background: var(--success); }
.toggle input:checked + .track::after { transform: translateX(16px); }
.toggle .toggle-label { font-size: .85rem; color: var(--text-2); }

.empty-state { text-align: center; padding: 56px 24px; color: var(--text-3); }
.empty-state svg { margin-bottom: 12px; opacity: .5; }
.empty-state h3 { color: var(--text-1); margin-bottom: 6px; font-size: 1.05rem; }
.empty-state p { font-size: .9rem; margin: 0 auto 16px; max-width: 520px; }
.empty-note { font-size: .84rem; color: var(--text-3); padding: 14px 4px; }

.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--skeleton-mid) 37%, var(--surface-2) 63%);
            background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--r-sm); }
@keyframes shimmer { 0% { background-position: 100% 0 } 100% { background-position: 0 0 } }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff;
           border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---- Server-rendered SVG charts ------------------------------------- */
.chart-wrap { position: relative; }
.chart-svg { width: 100%; height: auto; display: block; font-family: var(--font-sans); }
.chart-svg .bar, .chart-svg .hbar { transition: opacity var(--dur) var(--ease); cursor: default; }
.chart-svg:hover .bar, .chart-svg:hover .hbar { opacity: .55; }
.chart-svg .bar:hover, .chart-svg .hbar:hover { opacity: 1; }
.chart-tooltip { display: none; position: absolute; pointer-events: none; z-index: 5; white-space: nowrap;
                 background: rgba(15, 27, 45, .92); color: #fff; font-size: .78rem; font-weight: 600;
                 padding: 6px 10px; border-radius: 8px; box-shadow: var(--shadow-md); }

/* ---- Table pager (tables.js) ----------------------------------------- */
.pager-bar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 0 0 10px; font-size: .84rem; }
.pager-bar .pager-field { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: .8rem; }
.pager-bar .pager-field select { width: auto; min-width: 130px; padding: 6px 30px 6px 10px; }
.pager-bar .pager-spacer { flex: 1; }
.pager-bar .pager-nav { display: inline-flex; gap: 6px; }
.year-row td { font-weight: 700; background: var(--surface-2); cursor: pointer; }
.year-row td:first-child::before { content: "▸ "; color: var(--text-3); }
.year-row.open td:first-child::before { content: "▾ "; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: .74rem;
               font-weight: 600; white-space: nowrap; }
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-filed { background: var(--success-soft); color: var(--success); }
.st-overdue { background: var(--danger-soft); color: var(--danger); }
.st-due_soon { background: var(--warn-soft); color: var(--warn); }
.st-upcoming, .st-check, .st-na { background: var(--surface-2); color: var(--text-2); }
.st-marked { background: var(--brand-soft); color: var(--brand); }
.cat-chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 600;
            background: var(--brand-soft); color: var(--brand); }

/* ---- Portal footer ---------------------------------------------------- */
.portal-footer { text-align: center; font-size: .76rem; color: var(--text-3); padding: 28px 16px 36px; }
.portal-footer a { color: var(--text-2); }

/* ---- Small screens ---------------------------------------------------- */
@media (max-width: 720px) {
  body { font-size: 14px; }
  h1 { font-size: 1.35rem; }
  .card { padding: 16px; border-radius: 14px; }
  .header-band { padding: 18px; border-radius: 18px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi-value { font-size: 1.2rem; }
  table { font-size: .82rem; }
  th, td { padding: 9px 10px; }
  form.inline { grid-template-columns: 1fr; }
  form.inline .full { grid-column: 1; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex-shrink: 0; padding: 8px 12px; font-size: .82rem; }
  .heatmap { min-width: 560px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; justify-content: center; }
  .company-switcher { display: block; width: 100%; }
  .switcher-trigger { width: 100%; justify-content: space-between; }
  .switcher-trigger .pan-chip { display: none; }
  .switcher-pop { left: 0; right: 0; width: auto; min-width: 0; }
  .toast-stack { left: 16px; right: 16px; bottom: 16px; }
}
