/* All Star BPO reports portal — one stylesheet for every page.
   Navy + gold "scoreboard": navy for structure and the primary action, gold for what is live or selected, green/red only for outcomes.
   Public Sans (self-hosted) with tabular figures everywhere numbers sit in columns.
   Nov 15 2026 (Hamza: "keep the theme, make it a bit modern — layouts, buttons, fit to width"): the page fills the window instead of a
   1440 px column, pill tabs and pill nav, grouped controls, KPI tiles with air between them, rounder cards, table headers on a tinted band. */
@font-face { font-family: "Public Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/PublicSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("fonts/PublicSans-Medium.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("fonts/PublicSans-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Public Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("fonts/PublicSans-Bold.woff2") format("woff2"); }

:root {
  --font: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --bg: #F2F4F8; --panel: #FFFFFF; --panel2: #F6F8FB; --fg: #1B2434; --muted: #5E6A80; --dim: #8C97AA;
  --line: #DFE4EC; --line2: #CBD3DF;
  --navy: #15213B; --navy2: #22345C; --navy-fg: #FFFFFF;
  --gold: #F2B134; --gold2: #FFC95C; --gold-ink: #7A5300;
  --good: #1F8A4C; --good2: #0F6B3A; --warn: #E06A1B; --bad: #D13B4B; --ok: #D98A0C; --blue: #2E6BD6; --purple: #7A5AC8; --teal: #1F8F8F;
  --primary: var(--navy); --primary-fg: #fff; --primary-hover: var(--navy2);
  --focus: #2E6BD6;
  --shadow: 0 1px 2px rgba(21,33,59,.06), 0 1px 1px rgba(21,33,59,.03);                      /* controls */
  --shadow-card: 0 1px 2px rgba(21,33,59,.04), 0 12px 32px -20px rgba(21,33,59,.28);          /* cards and KPI tiles: a soft lift, no grey halo */
  --r-lg: 18px; --r: 12px; --r-sm: 8px; --r-pill: 999px;
  --h: 40px;                         /* control height: thumb-sized */
  --gutter: clamp(16px, 2.2vw, 40px);  /* page side padding: the content fills the window ("fit to width") */
  --t: .16s;                         /* hover/press transition */
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0F1626; --panel: #171F33; --panel2: #1C2640; --fg: #E9EDF5; --muted: #A5AFC3; --dim: #7B869C;
  --line: #28334D; --line2: #36435F; --navy: #0B1122; --navy2: #182341;
  --primary: var(--gold); --primary-fg: #1B1300; --primary-hover: var(--gold2); --gold-ink: #FFC95C;
  --good: #3DBB72; --good2: #22A15E; --warn: #F58A3C; --bad: #F06570; --ok: #F0A82A; --blue: #6B9BFF; --purple: #A78BFA; --teal: #3CC4C4;
  --shadow: none; --shadow-card: none; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1626; --panel: #171F33; --panel2: #1C2640; --fg: #E9EDF5; --muted: #A5AFC3; --dim: #7B869C;
    --line: #28334D; --line2: #36435F; --navy: #0B1122; --navy2: #182341;
    --primary: var(--gold); --primary-fg: #1B1300; --primary-hover: var(--gold2); --gold-ink: #FFC95C;
    --good: #3DBB72; --good2: #22A15E; --warn: #F58A3C; --bad: #F06570; --ok: #F0A82A; --blue: #6B9BFF; --purple: #A78BFA; --teal: #3CC4C4;
    --shadow: none; --shadow-card: none; color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font); font-variant-numeric: tabular-nums; }
a { color: var(--blue); }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--gold) 45%, transparent); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---- app bar: the same on every page ---------------------------------------------------------------------- */
.appbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 40; box-shadow: 0 1px 0 rgba(255,255,255,.06), 0 2px 12px rgba(10,16,32,.28); }
.appbar-in { padding: 0 var(--gutter); display: flex; align-items: center; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-weight: 700; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.brand svg, .brand .mark { width: 30px; height: 30px; flex: none; }
.brand .mark { object-fit: contain; }
.brand small { font-weight: 500; color: rgba(255,255,255,.62); font-size: 13px; margin-left: 2px; }
.navlinks { display: flex; align-items: center; gap: 3px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; padding: 2px 0; }
.navlinks::-webkit-scrollbar { display: none; }
.navlinks.more, .tabs.more, .tdx-tabs.more, .seg.more { mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.navlinks a { color: rgba(255,255,255,.76); text-decoration: none; font-weight: 600; font-size: 14px; padding: 0 13px; height: 36px; display: inline-flex; align-items: center; white-space: nowrap; border-radius: var(--r-pill); transition: background var(--t), color var(--t); }
.navlinks a:hover { color: #fff; background: rgba(255,255,255,.08); }
.navlinks a.on { color: var(--gold2); background: rgba(255,255,255,.1); }
.navuser { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }
.navuser .who { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: #1B1300; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; letter-spacing: .02em; flex: none; cursor: default; }
.navuser a, .navuser button { color: #fff; text-decoration: none; font-weight: 600; font-size: 13px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: var(--r-pill); padding: 0 13px; height: 34px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; transition: background var(--t), border-color var(--t); }
.navuser a:hover, .navuser button:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.2); }
.navuser .theme { width: 34px; padding: 0; justify-content: center; font-size: 15px; }
.navlinks a.only-narrow { display: none; }
@media (max-width: 860px) {
  .appbar-in { flex-wrap: wrap; row-gap: 0; padding-bottom: 0; }
  .brand { min-height: 52px; }
  .navuser { min-height: 52px; }
  .navuser .pw { display: none; }
  .navlinks { order: 3; flex: 1 0 100%; margin: 0 calc(-1 * var(--gutter)); padding: 5px var(--gutter) 7px; border-top: 1px solid rgba(255,255,255,.08); }
  .navlinks a { height: 34px; font-size: 13.5px; padding: 0 12px; }
  .navlinks a.only-narrow { display: inline-flex; }
}

/* ---- page frame ------------------------------------------------------------------------------------------- */
.wrap { padding: 20px var(--gutter) 56px; }
.wrap.narrow { max-width: 1200px; margin: 0 auto; }
.pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead h1 { font-size: 27px; font-weight: 700; color: var(--fg); letter-spacing: -.02em; }
.pagehead .sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; max-width: 80ch; }
.pagehead .sub b { color: var(--fg); font-weight: 600; }
.pagehead .right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
@media (max-width: 700px) { .pagehead h1 { font-size: 24px; } .wrap { padding-top: 16px; } }

/* ---- controls --------------------------------------------------------------------------------------------- */
.bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0 0 16px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { font-size: 14px; font-weight: 600; height: calc(var(--h) - 8px); padding: 0 14px; border: 0; border-radius: var(--r-pill); background: none; color: var(--muted); cursor: pointer; white-space: nowrap; transition: background var(--t), color var(--t); }
.seg button:hover { color: var(--fg); background: var(--panel2); }
.seg button.on { background: var(--primary); color: var(--primary-fg); }
.seg.compact button { font-size: 13px; padding: 0 11px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 14px; font-weight: 600; height: var(--h); padding: 0 16px; border: 1px solid var(--line2); border-radius: var(--r); background: var(--panel); color: var(--fg); cursor: pointer; text-decoration: none; white-space: nowrap; box-shadow: var(--shadow); transition: background var(--t), border-color var(--t), color var(--t), box-shadow var(--t), transform var(--t); }
.btn:hover { border-color: var(--dim); background: var(--panel2); }
.btn:active:not(:disabled) { transform: translateY(1px); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.good { background: var(--good); color: #fff; border-color: var(--good); }
.btn.danger { background: var(--bad); color: #fff; border-color: var(--bad); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.link { border: 0; background: none; box-shadow: none; color: var(--blue); padding: 0 4px; height: auto; }
.btn.icon { width: var(--h); padding: 0; }
.bar input, .bar select, .bar textarea, .field { font-size: 14px; height: var(--h); padding: 0 12px; border: 1px solid var(--line2); border-radius: var(--r); background: var(--panel); color: var(--fg); box-shadow: var(--shadow); max-width: 100%; transition: border-color var(--t), box-shadow var(--t); }
.bar input[type=search] { min-width: 200px; }
.bar input::placeholder { color: var(--dim); }
.bar select { padding-right: 32px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238C97AA' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
.bar label.chk, label.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); height: var(--h); padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); cursor: pointer; white-space: nowrap; transition: border-color var(--t), background var(--t), color var(--t); }
.bar label.chk:has(input:checked), label.chk:has(input:checked) { color: var(--fg); border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--panel)); }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--navy); margin: 0; }
:root[data-theme="dark"] input[type=checkbox] { accent-color: var(--gold); }
.bar .sep { width: 1px; height: 28px; background: var(--line2); }
.bar .hint { color: var(--muted); font-size: 13px; }
@media (max-width: 700px) {
  /* phones: every option of a range picker stays visible (wrap, no hidden scroll); inputs and selects pair up in two columns */
  .seg { flex-wrap: wrap; max-width: 100%; border-radius: 16px; }
  .seg button { flex: 1 1 auto; padding: 0 12px; }
  .bar > input, .bar > select { flex: 1 1 calc(50% - 5px); min-width: 0; }
  .bar > input[type=search] { min-width: 0; }
  .bar > label.chk { flex: 1 1 auto; }
  .bar .sep { display: none; }
}

/* ---- tabs: pills, with a hairline under the row ----------------------------------------------------------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin: 2px 0 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { font-size: 14.5px; font-weight: 600; height: 38px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: none; color: var(--muted); cursor: pointer; white-space: nowrap; transition: background var(--t), color var(--t); }
.tabs button:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 6%, transparent); }
.tabs button.on, .tabs button[aria-selected=true] { color: var(--primary-fg); background: var(--primary); }

/* ---- KPI tiles: separate tiles with air between them, the big figure does the talking ---------------------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpis:empty { display: none; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 16px 18px 14px; min-width: 0; display: flex; flex-direction: column; gap: 3px; position: relative; overflow: hidden; }
.kpi .l { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .v { font-size: 32px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; color: var(--fg); }
.kpi .s { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.kpi .v.txt { font-size: 20px; padding: 6px 0 4px; }
.kpi.main::before, .kpi.accent::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c, var(--gold)); }
.kpi.live .v::after { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); margin-left: 10px; vertical-align: 8px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 25%, transparent); }
@media (max-width: 700px) { .kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; } .kpi .v { font-size: 26px; } .kpi { padding: 13px 14px 12px; border-radius: 14px; } .kpi:last-child:nth-child(odd) { grid-column: span 2; } }

/* ---- cards ---------------------------------------------------------------------------------------------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow-card); }
.card h2 { font-size: 17px; font-weight: 700; }
.card .note, .card-head p { font-size: 13px; color: var(--muted); margin: 3px 0 14px; max-width: 110ch; }
.card-head { margin-bottom: 4px; }
.card-head h2 { font-size: 17px; font-weight: 700; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 18px; }
@media (max-width: 700px) { .card { padding: 14px; border-radius: 14px; } }

/* ---- tables: headers sit on a tinted band, rows breathe a little more ------------------------------------- */
.tw { overflow: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 9px 11px; background: var(--panel2); border-bottom: 1px solid var(--line2); white-space: nowrap; user-select: none; position: sticky; top: 0; z-index: 1; }
thead tr:first-child th:first-child { border-top-left-radius: 10px; } thead tr:first-child th:last-child { border-top-right-radius: 10px; }
td { padding: 10px 11px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th.num, td.num { text-align: right; }
tbody tr:hover > td { background: color-mix(in srgb, var(--navy) 4%, transparent); }
:root[data-theme="dark"] tbody tr:hover > td { background: color-mix(in srgb, #fff 4%, transparent); }
th.sortable { cursor: pointer; } th.sortable:hover { color: var(--fg); }
th.sortable::after { content: " ⇅"; opacity: .35; font-size: 10px; }
th.sort-desc::after { content: " ▼"; opacity: 1; color: var(--gold-ink); } th.sort-asc::after { content: " ▲"; opacity: 1; color: var(--gold-ink); }
tr.tot td, tr.total td { font-weight: 700; border-top: 2px solid var(--line2); background: var(--panel2); }
tr.click { cursor: pointer; }
tr.open td { background: color-mix(in srgb, var(--gold) 14%, transparent); font-weight: 600; }
tr.detail td { background: var(--panel2); padding: 12px 14px 16px; white-space: normal; }
tr.detail table { font-size: 12.5px; } tr.detail th { position: static; background: none; border-radius: 0; }
tr.risk td { background: color-mix(in srgb, var(--bad) 9%, transparent); }
tr.left td { color: var(--muted); }
.empty { color: var(--muted); padding: 28px; text-align: center; }
.foot { margin-top: 10px; font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--muted); }

/* ---- badges, tags, messages ----------------------------------------------------------------------------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 700; color: #fff; background: var(--good); white-space: nowrap; line-height: 1.3; }
.badge.ok { background: var(--ok); } .badge.bad { background: var(--bad); } .badge.none { background: var(--dim); } .badge.blue { background: var(--blue); }
.badge.good { background: var(--good); } .badge.excellent { background: var(--good2); } .badge.fair { background: var(--teal); } .badge.warn { background: var(--warn); }
.badge.teal { background: var(--teal); } .badge.purple { background: var(--purple); } .badge.gold { background: var(--gold); color: #1B1300; }
.badge.soft { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.tag { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 7px; vertical-align: -1px; background: var(--c, var(--dim)); }
.msg { padding: 13px 16px; border-radius: 14px; background: color-mix(in srgb, var(--gold) 16%, var(--panel)); border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); margin-bottom: 16px; font-size: 13.5px; }
.msg.err { background: color-mix(in srgb, var(--bad) 10%, var(--panel)); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.msg.good, .msg.ok { background: color-mix(in srgb, var(--good) 10%, var(--panel)); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .dim { color: var(--dim); }
.num { font-variant-numeric: tabular-nums; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; background: var(--panel2); padding: 1px 5px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
details > summary { cursor: pointer; }
.hide-narrow { }
@media (max-width: 700px) { .hide-narrow { display: none !important; } }

/* ---- forms (admin, account, CPA) ---------------------------------------------------------------------------- */
.form label, label.lbl { display: block; font-size: 13px; color: var(--muted); font-weight: 500; margin: 12px 0 5px; }
.form input[type=text], .form input[type=password], .form input[type=email], .form input[type=date], .form select, .form textarea,
input.field, select.field, textarea.field { width: 100%; font-size: 14px; padding: 0 12px; height: var(--h); border: 1px solid var(--line2); border-radius: var(--r); background: var(--panel); color: var(--fg); transition: border-color var(--t), box-shadow var(--t); }
.form textarea, textarea.field { height: auto; min-height: 120px; padding: 10px 12px; line-height: 1.45; }
.form input:focus, .form select:focus, .form textarea:focus, .bar input:focus, .bar select:focus { border-color: var(--focus); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
input[type=file] { font-size: 13.5px; color: var(--muted); max-width: 100%; }
input[type=file]::file-selector-button { font: inherit; font-size: 13.5px; font-weight: 600; color: var(--fg); background: var(--panel); border: 1px solid var(--line2); border-radius: var(--r); height: 36px; padding: 0 12px; margin-right: 10px; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--panel2); border-color: var(--dim); }

/* notification bell (Nov 10 2026) */
.navuser .bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border-radius: 50%; color: rgba(255,255,255,.82); text-decoration: none; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); }
.navuser .bell:hover, .navuser .bell.on { color: #fff; background: rgba(255,255,255,.16); }
.navuser .bell .bell-n { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px #14213a; }
