/* Sales Dashboard */
@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}
:root {
  --navy: #0e2240;
  --navy-2: #18335a;
  --ink: #101826;
  --ink-2: #465166;
  --muted: #6b7587;
  --line: #dfe4ec;
  --plane: #f1f3f7;
  --card: #ffffff;
  --blue: #2a78d6;
  --blue-deep: #1c5cab;
  --blue-soft: #e8f1fc;
  --orange: #eb6834;
  --track: #e4e8ef;
  --good-bg: #e2f3e2; --good-tx: #0a6410;
  --warn-bg: #fcefc9; --warn-tx: #765000;
  --crit-bg: #fbe2e2; --crit-tx: #a32626;
  --radius: 10px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--plane); color: var(--ink);
  font-family: var(--font); font-size: 14.5px; line-height: 1.45;
}
a { color: var(--blue-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, p { margin: 0; }
small { font-size: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
code { background: var(--track); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* ---------- frame ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--navy); color: #c9d4e4; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 18px; }
.brand-text strong { display: block; color: #fff; font-size: 16px; font-stretch: 88%; font-weight: 700; line-height: 1.15; }
.brand-text small { color: #93a5bf; }
.brand-mark { display: grid; gap: 3px; width: 26px; flex: none; position: relative; }
.brand-mark i { display: block; height: 5px; border-radius: 2px; background: #7db7ff; }
.brand-mark i:nth-child(1) { width: 100%; }
.brand-mark i:nth-child(2) { width: 62%; background: #fff; }
.brand-mark i:nth-child(3) { width: 82%; }
.brand-mark::after { content: ""; position: absolute; left: 74%; top: -3px; bottom: -3px; width: 2px; background: #fff; opacity: .55; }
.brand-mark.big { width: 54px; gap: 6px; }
.brand-mark.big i { height: 10px; border-radius: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { color: #c9d4e4; padding: 8px 10px; border-radius: 7px; font-weight: 500; border-left: 3px solid transparent; }
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.nav a.is-active { background: rgba(255,255,255,.11); color: #fff; border-left-color: #7db7ff; }
.nav-head { margin: 16px 0 4px 13px; font-size: 12px; color: #8497b3; }
.nav-user { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); display: flex; flex-direction: column; gap: 2px; }
.nav-user .who { padding: 4px 13px 8px; }
.nav-user .who strong { display: block; color: #fff; font-weight: 600; }
.nav-user .who small { color: #93a5bf; }
.nav-toggle { display: none; margin-left: auto; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 7px; padding: 6px 12px; font: inherit; }

.main { padding: 22px 28px 40px; min-width: 0; max-width: 1440px; }
.top { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.top h1 { font-size: 27px; font-stretch: 82%; font-weight: 700; letter-spacing: -.005em; line-height: 1.1; }
.top-title p { color: var(--muted); margin-top: 3px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; }
.filters label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); }
select, input[type=text], input[type=password], input[type=number], input[type=month], input[type=search], input[type=file] {
  font: inherit; color: var(--ink); background: #fff; border: 1px solid #c9d0db; border-radius: 7px; padding: 7px 10px; min-height: 36px; max-width: 100%;
}
.filters select { min-width: 150px; font-weight: 600; }
.filters select.sel-year { min-width: 92px; }
.filters select.sel-month { min-width: 132px; }
.foot { margin-top: 28px; color: var(--muted); font-size: 12px; }
.crumbs { margin-bottom: 12px; }
.crumbs a::before { content: "‹ "; }

/* ---------- surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; min-width: 0; }
.card.narrow { max-width: 420px; }
.narrow-text { max-width: 720px; }
.narrow-text h2 { font-size: 15px; margin-bottom: 6px; }
.block { margin-bottom: 16px; }
.block-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.block-head h2, .card h2 { font-size: 16px; font-weight: 700; font-stretch: 90%; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 { margin-bottom: 16px; }
.grid-users { grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search { width: 180px; }

/* ---------- scoreboard ---------- */
.score { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.score-main, .score-side { border-radius: var(--radius); padding: 20px 22px; min-width: 0; }
.score-main { background: var(--navy); color: #fff; }
.score-side { background: var(--card); border: 1px solid var(--line); }
.score h2 { font-size: 15px; font-weight: 600; }
.score-main h2 { color: #b9c8de; }
.score-side h2 { color: var(--ink-2); }
.figure { font-size: clamp(46px, 6.2vw, 76px); font-weight: 750; font-stretch: 70%; line-height: 1; margin: 6px 0 14px; letter-spacing: -.01em; }
.figure small { font-size: .38em; font-weight: 500; font-stretch: 85%; opacity: .75; }
.score-line { margin-top: 12px; font-size: 15.5px; }
.score-main .score-line { color: #dbe5f3; }
.score-main .score-line strong { color: #fff; }
.score-meta { margin-top: 4px; color: var(--muted); font-size: 13px; }
.score-main .score-meta { color: #a9bad3; }

/* ---------- bar that fills toward the target mark ---------- */
.bullet { position: relative; height: 8px; background: var(--track); border-radius: 4px; }
.bullet-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--blue); border-radius: 4px; min-width: 2px; }
.bullet-tick { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
.bullet-lg { height: 14px; border-radius: 5px; }
.bullet-lg .bullet-fill { border-radius: 5px; }
.bullet-lg .bullet-tick { top: -5px; bottom: -5px; width: 3px; }
.bullet.on-dark { background: rgba(255,255,255,.16); }
.bullet.on-dark .bullet-fill { background: #7db7ff; }
.bullet.on-dark .bullet-tick { background: #fff; }
.w-bar { white-space: nowrap; min-width: 170px; }
.w-bar .bullet { display: inline-block; width: 92px; vertical-align: middle; margin-right: 8px; }
.bar-pct { display: inline-block; min-width: 50px; font-variant-numeric: tabular-nums; font-weight: 600; font-stretch: 88%; vertical-align: middle; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tiles-4 { margin-bottom: 16px; }
.tile { display: grid; gap: 8px; align-content: start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--ink); }
a.tile:hover { border-color: #b8c3d4; text-decoration: none; }
.tile-name { font-weight: 600; color: var(--ink-2); font-size: 13.5px; }
.tile-name small { font-weight: 400; color: var(--muted); }
.tile-value { font-size: 28px; font-weight: 700; font-stretch: 76%; line-height: 1.05; }
.tile-value small { font-size: 14px; font-weight: 500; font-stretch: 90%; color: var(--muted); }
.tile-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; }

/* ---------- chips ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px 2px 6px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; vertical-align: middle; }
.chip .ico { flex: none; }
.chip-good { background: var(--good-bg); color: var(--good-tx); }
.chip-warn { background: var(--warn-bg); color: var(--warn-tx); }
.chip-crit { background: var(--crit-bg); color: var(--crit-tx); }
.chip-none { background: var(--track); color: var(--ink-2); }
.chip-new { background: var(--blue-soft); color: var(--blue-deep); }
.delta { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.delta-up { color: #0a7a14; }
.delta-down { color: #b93030; }
.score-main .delta-up { color: #8fe39a; }
.score-main .delta-down { color: #ffaaa5; }
.delta-none { font-weight: 400; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table thead th { font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; border-bottom: 1px solid #c9d0db; background: var(--card); }
.table thead th.grp { text-align: center; border-left: 1px solid var(--line); }
.table tbody th { font-weight: 600; min-width: 140px; }
.table td { white-space: nowrap; }
.table-compact tbody th { min-width: 0; white-space: nowrap; }
.table-compact .w-bar { min-width: 0; }
.table-compact .w-bar .bullet { width: 52px; margin-right: 6px; }
.table-compact .bar-pct { min-width: 44px; }
.table-compact th, .table-compact td { padding-left: 5px; padding-right: 5px; }
.table tbody th a { color: var(--ink); }
.table tbody th small, .table td > small { display: block; font-weight: 400; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; font-stretch: 90%; white-space: nowrap; }
.table td.num small { display: inline; }
.table td.num small[class^="pct-"] { display: block; }
.table tbody tr:hover { background: #f7f9fc; }
.table tr.is-picked { background: var(--blue-soft); }
.table tr.is-off { opacity: .55; }
.table tfoot th, .table tfoot td { border-top: 2px solid #c9d0db; border-bottom: 0; font-weight: 700; }
.table th[data-sort] { cursor: pointer; user-select: none; }
.table th[data-sort]:hover { color: var(--ink); }
.table th[aria-sort="ascending"]::after { content: " ▲"; font-size: 9px; }
.table th[aria-sort="descending"]::after { content: " ▼"; font-size: 9px; }
.pct-good { color: var(--good-tx); } .pct-warn { color: var(--warn-tx); } .pct-crit { color: var(--crit-tx); } .pct-none { color: var(--muted); }
.w-num { width: 80px; }

/* ---------- ranked lists ---------- */
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rank li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(70px, 1fr) 58px; gap: 12px; align-items: center; }
.rank-name { font-weight: 600; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rank-name small { display: block; font-weight: 400; color: var(--muted); }
.rank-pct { text-align: right; font-weight: 700; font-stretch: 85%; font-variant-numeric: tabular-nums; }
.rank-wide { margin-top: 14px; gap: 14px; }

/* ---------- SR status strip ---------- */
.strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.strip > div { padding: 14px 16px; border-left: 1px solid var(--line); display: grid; gap: 4px; }
.strip > div:first-child { border-left: 0; }
.strip-n { font-size: 28px; font-weight: 700; font-stretch: 76%; line-height: 1; }
.strip-l { font-size: 12.5px; color: var(--muted); }

/* ---------- tabs and segmented buttons ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid #c9d0db; margin-bottom: 16px; overflow-x: auto; }
.tabs a { padding: 9px 14px; color: var(--ink-2); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.is-active { color: var(--ink); border-bottom-color: var(--blue); }
.seg { display: inline-flex; border: 1px solid #c9d0db; border-radius: 7px; overflow: hidden; background: #fff; }
.seg button { font: inherit; font-size: 13px; border: 0; background: transparent; padding: 7px 11px; cursor: pointer; color: var(--ink-2); border-left: 1px solid #c9d0db; }
.seg button:first-child { border-left: 0; }
.seg button.is-on { background: var(--navy); color: #fff; }

/* ---------- quarter membership ---------- */
.move { display: flex; gap: 2px; margin-bottom: 10px; }
.move-seg { min-width: max-content; padding: 9px 12px; border-radius: 6px; font-size: 13px; white-space: nowrap; }
.move-seg strong { font-size: 17px; font-stretch: 80%; margin-right: 3px; }
.move-stay { background: #dbe3ef; color: var(--ink); }
.move-new { background: var(--blue); color: #fff; }
.move-left { background: #fff; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px #aab4c4; }
details summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "+"; font-weight: 700; width: 14px; }
details[open] summary::before { content: "−"; }
details[open] summary { margin-bottom: 12px; }

/* ---------- charts ---------- */
.chart-wrap { margin: 0; }
.chart { width: 100%; min-height: 250px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); font-size: 11.5px; fill: var(--muted); }
.chart .val { fill: var(--ink); font-weight: 700; font-size: 12px; }
.chart .grid { stroke: #e7eaf0; stroke-width: 1; }
.chart .base { stroke: #b9c1ce; stroke-width: 1; }
.chart .bar-1 { fill: var(--blue); } .chart .bar-2 { fill: var(--orange); }
.chart .tgt { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.chart .hit { fill: transparent; }
.chart g.col:hover .hit, .chart g.col:focus .hit { fill: rgba(16, 24, 38, .05); }
.chart g.col:focus { outline: none; }
.chart-lines { min-height: 290px; }
.chart .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .ln-now { stroke-width: 2.75; }
.chart .ln-1 { stroke: #86b6ef; } .chart .ln-2 { stroke: #3987e5; } .chart .ln-3 { stroke: #1c5cab; } .chart .ln-4 { stroke: #0d366b; }
.chart .dot { stroke: #fff; stroke-width: 2; }
.chart .dot-1 { fill: #86b6ef; } .chart .dot-2 { fill: #3987e5; } .chart .dot-3 { fill: #1c5cab; } .chart .dot-4 { fill: #0d366b; }
.chart .cross { stroke: #9aa6b8; stroke-width: 1; }
.chart rect.hit:focus { outline: none; }
.sw-line { width: 16px; height: 3px; border-radius: 2px; display: inline-block; }
.lk-1 { background: #86b6ef; } .lk-2 { background: #3987e5; } .lk-3 { background: #1c5cab; } .lk-4 { background: #0d366b; }
.tip .tip-row { display: flex; align-items: center; gap: 7px; color: #fff; }
.tip .tip-key { width: 12px; height: 3px; border-radius: 2px; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.tip .tip-row strong { font-variant-numeric: tabular-nums; }
.tip .tip-row em { font-style: normal; color: #c9d4e4; margin-left: auto; padding-left: 10px; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw-1 { background: var(--blue); } .sw-2 { background: var(--orange); }
.sw-tick { width: 14px; height: 2px; background: var(--ink); display: inline-block; border-radius: 1px; }
.tip { position: fixed; z-index: 50; background: var(--ink); color: #fff; padding: 8px 10px; border-radius: 7px; font-size: 12.5px; line-height: 1.4; pointer-events: none; max-width: 240px; box-shadow: 0 6px 18px rgba(16,24,38,.22); }
.tip b { display: block; margin-bottom: 2px; }
.tip span { display: block; color: #c9d4e4; }

/* ---------- forms, buttons, messages ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 600; font-size: 13.5px; padding: 7px 13px; min-height: 36px; border-radius: 7px; border: 1px solid #c9d0db; background: #fff; color: var(--ink); cursor: pointer; }
.btn:hover { border-color: #9aa6b8; text-decoration: none; }
.btn-primary { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }
.btn-primary:hover { background: #174e93; border-color: #174e93; }
.btn-quiet { min-height: 30px; padding: 4px 10px; font-weight: 500; }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-weight: 600; font-size: 13px; }
.form input, .form select { width: 100%; }
.inline { display: inline-flex; gap: 6px; align-items: center; }
.inline input[type=password] { width: 130px; min-height: 30px; padding: 4px 8px; }
.inline select { min-height: 30px; padding: 4px 8px; }
.flash { border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; border: 1px solid; }
.flash p { font-weight: 600; }
.flash ul { margin: 6px 0 0; padding-left: 18px; }
.flash-ok { background: var(--good-bg); border-color: #b5dcb5; color: var(--good-tx); }
.flash-warn { background: var(--warn-bg); border-color: #ecd691; color: var(--warn-tx); }
.flash-error { background: var(--crit-bg); border-color: #efbcbc; color: var(--crit-tx); }
.empty { background: var(--card); border: 1px dashed #b9c1ce; border-radius: var(--radius); padding: 36px 24px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.empty h2 { font-size: 19px; font-stretch: 88%; }
.empty p { max-width: 520px; color: var(--ink-2); }

/* ---------- upload page ---------- */
.upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.upload { margin-bottom: 0; display: grid; gap: 10px; align-content: start; }
.upload p { color: var(--ink-2); }
.upload .when { font-size: 12px; font-weight: 600; color: var(--blue-deep); background: var(--blue-soft); padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.upload-row { display: flex; flex-wrap: wrap; gap: 10px; }
.upload-row label { display: grid; gap: 4px; font-size: 12.5px; font-weight: 600; }
.upload-row .file { flex: 1; min-width: 220px; }
.upload-row input[type=number] { width: 96px; }
.upload-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ---------- sign in ---------- */
.auth-body { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--plane); }
.auth-split { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); width: min(860px, 100%); background: var(--card); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.auth-pitch { background: var(--navy); color: #fff; padding: 36px 32px; display: grid; gap: 14px; align-content: center; }
.pitch-area { color: #93a5bf; font-size: 13px; margin-top: 8px; }
.pitch-line { font-size: 25px; font-weight: 700; font-stretch: 80%; line-height: 1.18; max-width: 16em; }
.pitch-bars { display: grid; gap: 12px; margin-top: 12px; }
.pitch-row { display: grid; grid-template-columns: 58px 1fr; gap: 10px; align-items: center; font-size: 12.5px; color: #b9c8de; }
.auth-card { padding: 36px 32px; display: grid; gap: 14px; align-content: center; }
main.auth-card { width: min(440px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.auth-card h1 { font-size: 25px; font-stretch: 82%; font-weight: 700; line-height: 1.1; }

/* ---------- small screens ---------- */
@media (max-width: 1080px) {
  .grid-2, .score, .upload-grid, .grid-users { grid-template-columns: minmax(0, 1fr); }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip > div { border-left: 0; border-top: 1px solid var(--line); }
  .strip > div:nth-child(-n+2) { border-top: 0; }
}
@media (max-width: 820px) {
  .shell { display: block; }
  .side { position: static; height: auto; padding: 12px 16px; }
  .brand { padding: 0; }
  .nav-toggle { display: inline-block; }
  .nav { display: none; padding-top: 12px; }
  .nav.is-open { display: flex; }
  .nav-user { margin-top: 12px; }
  .main { padding: 16px 16px 32px; }
  .top h1 { font-size: 23px; }
  .filters { width: 100%; }
  .filters label { flex: 1; }
  .filters select, .filters select.sel-year, .filters select.sel-month { min-width: 0; width: 100%; }
  .auth-split { grid-template-columns: minmax(0, 1fr); }
  .auth-pitch { padding: 24px; }
  .pitch-bars { display: none; }
  .auth-card { padding: 24px; }
  .search { width: 100%; }
  .tools { width: 100%; }
}
@media print {
  .side, .filters, .tools, .foot, .nav-toggle { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; }
  body { background: #fff; }
  .score-main { background: #fff; color: var(--ink); border: 1px solid var(--line); }
  .score-main h2, .score-main .score-line, .score-main .score-meta, .score-main .score-line strong { color: var(--ink); }
  .bullet.on-dark { background: var(--track); }
  .bullet.on-dark .bullet-fill { background: var(--blue); }
  .bullet.on-dark .bullet-tick { background: var(--ink); }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
