/* Matched Partners portal, design v2 (5 Dec 2026).
   techmatched.pk brand: Poppins (self-hosted), #35286B main, white and #F4F3FA grounds, black headings on light,
   dark accent cards in near-black #13140F / #35286B, teal #17CCAF for gains, coral #F8765C for losses,
   yellow only inside the logo, #07C0E8 only for small icons. Scale: 14px body, 4/8px spacing grid. */
@font-face { font-family: Poppins; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/poppins-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 500; font-style: normal; font-display: swap; src: url(fonts/poppins-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/poppins-latin-600-normal.woff2) format("woff2"); }
@font-face { font-family: Poppins; font-weight: 700; font-style: normal; font-display: swap; src: url(fonts/poppins-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: Handlee; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/handlee-latin-400-normal.woff2) format("woff2"); }

:root {
  color-scheme: light;
  --brand: #35286B; --brand-600: #42337F; --brand-700: #2A1F5A; --brand-900: #241A4D;
  --brand-50: #F4F2FB; --brand-100: #E9E5F7; --brand-200: #D3CCEF; --brand-400: #8A79CB;
  --ink: #13140F; --head: #13140F; --body: #4A4857; --muted: #6B6878; --faint: #9A97A8;
  --ground: #F4F3FA; --white: #FFFFFF; --line: #E9E7F1; --line-soft: #F1EFF7; --input: #D8D4E6;
  --teal: #17CCAF; --teal-ink: #0A7A69; --teal-bg: #E6F8F4;
  --coral: #F8765C; --coral-ink: #C9381F; --coral-bg: #FEEDE9;
  --icon-blue: #07C0E8;
  --r-sm: 8px; --r-md: 10px; --r-lg: 12px; --r-xl: 16px; --r-card: 22px; --r-pill: 999px;
  --sh-card: 0 1px 2px rgba(21, 17, 43, .04), 0 8px 24px -16px rgba(53, 40, 107, .18);
  --sh-pop: 0 2px 6px rgba(21, 17, 43, .06), 0 24px 48px -20px rgba(53, 40, 107, .35);
  --side: 248px; --side-mini: 76px; --content: 1240px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--body); font: 400 14px/1.55 Poppins, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-600); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, h3 { color: var(--head); letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: 26px; font-weight: 600; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 600; margin: 32px 0 12px; }
h3 { font-size: 14px; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 12px; }
strong { color: var(--head); font-weight: 600; }
small { font-size: 12px; color: var(--muted); }
code { font-size: 12px; background: var(--brand-50); padding: 1px 6px; border-radius: 6px; color: var(--head); }
.muted { color: var(--muted); }
.lead { max-width: 72ch; color: var(--body); }
.eyebrow { font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.accent { font-family: Handlee, cursive; color: var(--brand); font-size: 1.15em; }
.tnum, td.num, th.num { font-variant-numeric: tabular-nums; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- app shell ---------- */
.side { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--white); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 40; transition: width .25s var(--ease), transform .25s var(--ease); }
.side-head { display: flex; align-items: center; gap: 8px; padding: 20px 16px 16px 20px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--brand); min-width: 0; }
.logo img { display: block; flex: none; }
.logo b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; line-height: 1.15; color: var(--brand); white-space: nowrap; }
.logo small { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; }
.logo.light b { color: #FFF; }
.logo.light small { color: rgba(255, 255, 255, .6); }
.icon-btn { margin-left: auto; width: 34px; height: 34px; border-radius: var(--r-md); display: inline-flex; align-items: center; justify-content: center; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 0; min-height: 0; flex: none; }
.icon-btn:hover { background: var(--ground); color: var(--head); }
.drawer-close { display: none; }
.side-nav { flex: 1; overflow-y: auto; padding: 4px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.side-group { font-size: 11px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin: 16px 8px 6px; white-space: nowrap; }
.side-group:first-child { margin-top: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; height: 38px; padding: 0 10px; border-radius: var(--r-md); color: var(--body); text-decoration: none; font-size: 13.5px; font-weight: 400; white-space: nowrap; }
.side-nav a .ico { color: var(--muted); }
.side-nav a:hover { background: var(--ground); color: var(--head); }
.side-nav a.on { background: var(--brand-50); color: var(--brand); font-weight: 500; }
.side-nav a.on .ico { color: var(--brand); }
.side-foot { border-top: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.who { display: flex; align-items: center; gap: 10px; padding: 6px 8px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.who-name { min-width: 0; }
.who-name b { display: block; font-size: 13px; font-weight: 500; color: var(--head); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who-name small { display: block; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.signout { display: flex; align-items: center; gap: 12px; height: 36px; padding: 0 10px; border-radius: var(--r-md); color: var(--muted); text-decoration: none; font-size: 13px; white-space: nowrap; }
.signout:hover { background: var(--ground); color: var(--head); }
.main-wrap { margin-left: var(--side); min-height: 100vh; display: flex; flex-direction: column; transition: margin .25s var(--ease); }
.main { flex: 1; width: 100%; max-width: calc(var(--content) + 80px); margin: 0 auto; padding: 32px 40px 48px; }
.foot { max-width: calc(var(--content) + 80px); width: 100%; margin: 0 auto; padding: 16px 40px 24px; display: flex; flex-wrap: wrap; gap: 4px 24px; justify-content: space-between; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.foot .risk { color: var(--head); font-weight: 500; }
.foot a { color: var(--muted); }
.mobile-bar, .scrim, .tabbar { display: none; }

/* collapsed sidebar (desktop) */
.nav-mini .side { width: var(--side-mini); }
.nav-mini .main-wrap { margin-left: var(--side-mini); }
.nav-mini .side .logo span, .nav-mini .side-nav a span, .nav-mini .who-name, .nav-mini .signout span { display: none; }
.nav-mini .side-head { flex-direction: column; padding: 20px 0 8px; gap: 12px; }
.nav-mini .side-head .icon-btn { margin: 0; }
.nav-mini .side-group { font-size: 0; height: 1px; background: var(--line); margin: 12px 10px; }
.nav-mini .side-nav a, .nav-mini .signout { justify-content: center; padding: 0; }
.nav-mini .who { justify-content: center; padding: 6px 0; }

/* ---------- page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 24px; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- grids ---------- */
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-hero { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto; }
.g-hero .hero { grid-row: span 2; }
.span-2 { grid-column: span 2; }
.stack-col { display: grid; gap: 16px; align-content: start; min-width: 0; }
.stack-col .kpi { min-height: 0; flex: 1; }

/* ---------- cards ---------- */
.card { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 22px; box-shadow: var(--sh-card); min-width: 0; color: var(--body); }
a.card { text-decoration: none; transition: box-shadow .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease); }
a.card:hover { border-color: var(--brand-200); box-shadow: var(--sh-pop); color: var(--body); }
.main > .card, .main > section.card, .main > form.approve { margin-bottom: 16px; }
.main > .grid + h2 { margin-top: 28px; }
form.grid button { justify-self: start; }
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: -.01em; }
.card-head .end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.tile { width: 30px; height: 30px; border-radius: 9px; background: var(--ground); color: var(--head); display: inline-grid; place-items: center; flex: none; }
.tile .ico { width: 16px; height: 16px; }
.label { font-size: 12px; color: var(--muted); font-weight: 400; margin: 0; }
.value { display: block; font-size: 28px; font-weight: 500; letter-spacing: -.025em; color: var(--head); font-variant-numeric: tabular-nums; line-height: 1.15; margin: 6px 0 4px; white-space: nowrap; }
.value.sm { font-size: 22px; }
.value .cur { font-size: .5em; font-weight: 400; color: var(--muted); margin-right: 4px; letter-spacing: 0; vertical-align: .35em; }
.meta { font-size: 12px; color: var(--muted); margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kpi { display: flex; flex-direction: column; justify-content: space-between; min-height: 132px; }
.kpi .top-line { display: flex; align-items: center; justify-content: space-between; gap: 6px 8px; flex-wrap: wrap; }
.kpi .go { color: var(--faint); }
a.kpi:hover .go { color: var(--brand); }

/* hero: brand purple with a soft glow */
.hero { background: radial-gradient(120% 120% at 100% 0%, rgba(138, 121, 203, .55) 0%, rgba(138, 121, 203, 0) 55%), radial-gradient(90% 90% at 0% 100%, rgba(23, 204, 175, .12) 0%, rgba(23, 204, 175, 0) 60%), linear-gradient(145deg, #3B2D78 0%, #35286B 45%, #241A4D 100%); border-color: transparent; color: #DCD8EE; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; min-height: 280px; padding: 24px 26px; }
.hero::after { content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 0 0 40px rgba(255, 255, 255, .025), 0 0 0 80px rgba(255, 255, 255, .02); pointer-events: none; }
.hero .label { color: rgba(255, 255, 255, .7); font-size: 13px; }
.hero .value { color: #FFF; font-size: 40px; font-weight: 500; margin: 8px 0 6px; }
.hero .value .cur { color: rgba(255, 255, 255, .6); }
.hero .meta { color: rgba(255, 255, 255, .65); }
.hero .tile { background: rgba(255, 255, 255, .1); color: #FFF; }
.hero-foot { display: flex; gap: 28px; flex-wrap: wrap; position: relative; z-index: 1; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 16px; }
.hero-foot div { display: flex; flex-direction: column; gap: 2px; }
.hero-foot span { font-size: 11px; color: rgba(255, 255, 255, .55); }
.hero-foot b { font-size: 14px; font-weight: 500; color: #FFF; font-variant-numeric: tabular-nums; }
.hero.compact { min-height: 0; }
.hero.compact .value { font-size: 32px; }
.g-4 > .hero .value { font-size: clamp(20px, 1.75vw, 30px); }

/* dark accent card (charts) */
.dark { background: radial-gradient(70% 90% at 85% 0%, rgba(83, 64, 154, .55) 0%, rgba(83, 64, 154, 0) 60%), radial-gradient(60% 80% at 0% 100%, rgba(53, 40, 107, .45) 0%, rgba(53, 40, 107, 0) 60%), #13140F; border-color: #13140F; color: rgba(255, 255, 255, .72); }
.dark .card-head h2, .dark .card-head h3, .dark strong { color: #FFF; }
.dark .tile { background: rgba(255, 255, 255, .08); color: #FFF; }
.dark .label, .dark .meta { color: rgba(255, 255, 255, .55); }
.dark .value { color: #FFF; }
.dark a { color: #FFF; }
.seg { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); font-size: 12px; }
.seg span { padding: 4px 12px; border-radius: var(--r-pill); color: rgba(255, 255, 255, .6); }
.seg span.on { background: rgba(255, 255, 255, .12); color: #FFF; }

/* chart (inline SVG, CSS-only tooltips) */
.chart { margin: 4px -6px -6px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart svg.sm { display: none; }
.chart text { font-family: Poppins, system-ui, sans-serif; font-size: 11px; fill: rgba(255, 255, 255, .45); }
.chart .grid-line { stroke: rgba(255, 255, 255, .08); stroke-dasharray: 3 5; }
.chart .zero { stroke: rgba(255, 255, 255, .22); }
.chart .bar.neg { fill: #F8765C; fill-opacity: .85; }
.chart .bar.cur { fill: #E9E5F7; }
.chart .bar.cur.neg { fill: #F8765C; fill-opacity: 1; }
.chart .hit { fill: #FFF; fill-opacity: 0; }
.chart .col:hover .hit { fill-opacity: .04; }
.chart .mlabel.cur-label { fill: #13140F; font-weight: 500; }
.chart .mpill { fill: #FFF; }
.chart .tip { opacity: 0; transition: opacity .15s var(--ease); pointer-events: none; }
.chart .tip.cur { opacity: 1; }
.chart svg:hover .tip.cur { opacity: 0; }
.chart svg:hover .col:hover .tip { opacity: 1; }
.chart .tip-box { fill: rgba(30, 26, 52, .82); stroke: rgba(255, 255, 255, .16); }
.chart .tip-month { fill: rgba(255, 255, 255, .6); font-size: 11px; }
.chart .tip-val { fill: #FFF; font-size: 15px; font-weight: 500; }
.chart .tip-chip { font-size: 10.5px; font-weight: 500; }
.chart .tip-chip.up { fill: #17CCAF; }
.chart .tip-chip.down { fill: #F8765C; }
.chart .tip-bar { fill: #8A79CB; }
.chart .tip-bar.down { fill: #F8765C; }

/* chips and pills */
.chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 6px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 500; line-height: 1.5; white-space: nowrap; font-variant-numeric: tabular-nums; background: var(--ground); color: var(--muted); }
.chip .ico { width: 12px; height: 12px; stroke-width: 2.2; }
.chip.up { background: var(--teal-bg); color: var(--teal-ink); }
.chip.down { background: var(--coral-bg); color: var(--coral-ink); }
.hero .chip, .dark .chip { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .8); }
.hero .chip.up, .dark .chip.up { background: rgba(23, 204, 175, .16); color: #5BE3CB; }
.hero .chip.down, .dark .chip.down { background: rgba(248, 118, 92, .18); color: #FF9F8A; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--r-pill); font-size: 11.5px; font-weight: 500; line-height: 1.6; white-space: nowrap; background: var(--brand-50); color: var(--brand); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .9; }
.pill.ok { background: var(--teal-bg); color: var(--teal-ink); }
.pill.wait { background: var(--brand-50); color: var(--brand); }
.pill.bad { background: var(--coral-bg); color: var(--coral-ink); }
.pill.off { background: var(--ground); color: var(--muted); }
.tag { display: inline-block; font-size: 11px; font-weight: 500; background: var(--brand-50); padding: 1px 8px; border-radius: var(--r-pill); color: var(--brand); vertical-align: middle; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); display: block; overflow-x: auto; margin-bottom: 16px; box-shadow: var(--sh-card); }
table > tbody { display: table; width: 100%; }
.card table, td table, details table { border: 0; box-shadow: none; border-radius: 0; margin: 0; }
.card table { margin: 0 -22px -20px; width: calc(100% + 44px); }
/* Tables fit their card: headers may wrap, long tokens (JSON, references) break, numbers stay on one line. */
th { white-space: normal !important; vertical-align: bottom; line-height: 1.35; }
td small, td pre, td code { overflow-wrap: anywhere; }
.mini { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; min-width: 104px; }
.mini li { display: flex; flex-direction: column; font-size: 12.5px; }
.mini b { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cell-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
td .chip.block { display: inline-flex; margin-top: 4px; }
td.num .chip.block { float: none; }
@media (max-width: 1480px) and (min-width: 641px) {
  th, td { padding-left: 10px; padding-right: 10px; }
  th:first-child, td:first-child { padding-left: 18px; }
  th:last-child, td:last-child { padding-right: 18px; }
  table { font-size: 13px; }
  th { font-size: 10.5px; letter-spacing: .03em; }
  .pill { padding: 2px 8px; }
}
td.num small { white-space: normal; display: inline-block; line-height: 1.3; }
.card .card-head + table { margin-top: -6px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 22px; }
th:last-child, td:last-child { padding-right: 22px; }
tr:last-child td { border-bottom: 0; }
th { font-size: 11px; color: var(--faint); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; background: none; padding-top: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
td { color: var(--head); }
td small { color: var(--muted); }
td.num, th.num { text-align: right; white-space: nowrap; }
td.neg { color: var(--coral-ink); }
table.stack-sm td:first-child { white-space: nowrap; }
tbody tr:hover td { background: #FBFAFE; }
tr.total td { font-weight: 600; background: var(--brand-50); }
table.summary { max-width: 100%; }
td .name { display: flex; align-items: center; gap: 10px; }
pre { font-size: 11.5px; white-space: pre-wrap; margin: 6px 0 0; background: var(--ground); padding: 10px 12px; border-radius: var(--r-lg); color: var(--head); max-width: 420px; }
details summary { cursor: pointer; color: var(--brand); font-weight: 500; font-size: 13px; }
details[open] summary { margin-bottom: 8px; }

/* summary list (label ... value) */
.rows { margin: 0; display: flex; flex-direction: column; }
.rows > div { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.rows > div:last-child { border-bottom: 0; }
.rows dt { color: var(--muted); font-size: 13px; }
.rows dd { margin: 0; color: var(--head); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.rows .strong dt, .rows .strong dd { color: var(--head); font-weight: 600; }
.rows.strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.rows.strip > div { flex-direction: column; align-items: flex-start; gap: 6px; padding: 4px 20px; border-bottom: 0; border-left: 1px solid var(--line-soft); }
.rows.strip > div:first-child { border-left: 0; padding-left: 0; }
.rows.strip dd { text-align: left; font-size: 15px; }
@media (max-width: 1000px) { .rows.strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 0; } .rows.strip > div { border-left: 0; padding: 0; } .rows.strip > div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line-soft); } }
.dark .rows > div { border-color: rgba(255, 255, 255, .08); }
.dark .rows dt { color: rgba(255, 255, 255, .55); }
.dark .rows dd { color: #FFF; }

/* attention list */
.alist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.alist li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px; color: var(--head); }
.alist li:last-child { border-bottom: 0; padding-bottom: 0; }
.alist li .end { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.alist .tile { width: 28px; height: 28px; }
.alist .tile.warn { background: var(--coral-bg); color: var(--coral-ink); }
.alist .tile.ok { background: var(--teal-bg); color: var(--teal-ink); }
.empty { color: var(--muted); font-size: 13px; margin: 0; }

/* ---------- forms and buttons ---------- */
form.stack { display: flex; flex-direction: column; gap: 14px; max-width: 440px; }
form.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 16px; align-items: end; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 22px; box-shadow: var(--sh-card); margin-bottom: 16px; }
.card form.grid { border: 0; box-shadow: none; padding: 0; margin: 0; background: none; }
form.grid .wide { grid-column: 1 / -1; }
form.grid.two { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); max-width: 760px; }
form.inline { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 4px 0; }
form.inline label { font-size: 11.5px; }
form.inline input { height: 34px; min-height: 34px; padding: 4px 10px; font-size: 13px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 500; color: var(--head); }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; color: var(--body); font-size: 13px; }
label.check input { width: 18px; height: 18px; margin: 1px 0 0; flex: none; }
input, select, textarea { font: inherit; font-size: 14px; font-weight: 400; height: 42px; padding: 8px 14px; border: 1px solid var(--input); border-radius: var(--r-lg); background: var(--white); color: var(--head); width: 100%; transition: border-color .15s, box-shadow .15s; }
input::placeholder { color: var(--faint); }
input:hover, select:hover { border-color: var(--brand-200); }
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
input[type=checkbox] { width: 16px; height: 16px; min-height: 0; padding: 0; accent-color: var(--brand); }
input[type=file] { height: auto; padding: 6px; font-size: 12.5px; background: var(--ground); border-style: dashed; }
input[type=file]::file-selector-button { font: inherit; font-weight: 500; font-size: 12px; border: 0; border-radius: var(--r-pill); background: var(--white); color: var(--brand); padding: 5px 12px; margin-right: 10px; cursor: pointer; box-shadow: 0 0 0 1px var(--line); }
button, .btn { font: inherit; font-size: 13.5px; font-weight: 500; height: 40px; padding: 0 20px; border: 1px solid var(--brand); border-radius: var(--r-pill); background: var(--brand); color: #FFF; cursor: pointer; align-self: flex-start; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s; white-space: nowrap; }
button:hover, .btn:hover { background: var(--brand-900); border-color: var(--brand-900); color: #FFF; box-shadow: 0 6px 16px -8px rgba(53, 40, 107, .6); }
button.secondary, .btn.secondary { background: var(--white); color: var(--brand); border-color: var(--brand-200); }
button.secondary:hover, .btn.secondary:hover { background: var(--brand-50); color: var(--brand); border-color: var(--brand); box-shadow: none; }
button.link { background: none; border: 0; color: var(--brand); padding: 0; height: auto; text-decoration: underline; font-weight: 500; }
button.link:hover { background: none; color: var(--brand-600); box-shadow: none; }
form.inline button { height: 34px; padding: 0 14px; font-size: 12.5px; }
.btn-light { background: #FFF; color: var(--brand); border-color: #FFF; }
.approve { display: flex; flex-direction: column; gap: 14px; background: var(--white); border: 1px solid var(--brand-200); border-radius: var(--r-card); padding: 20px 22px; max-width: 720px; margin: 16px 0; box-shadow: var(--sh-pop); }
.approve button { height: 44px; padding: 0 24px; }

/* messages */
.flash { padding: 10px 14px; border-radius: var(--r-lg); background: var(--teal-bg); color: var(--teal-ink); border: 1px solid #C6F0E7; margin: 0 0 16px; font-size: 13px; font-weight: 500; }
.flash.error { background: var(--coral-bg); color: var(--coral-ink); border-color: #FAD2C8; }
.flash.info { background: var(--brand-50); color: var(--head); border-color: var(--brand-100); font-weight: 400; }
.flash ul { margin: 6px 0 0; padding-left: 18px; font-weight: 400; }

/* bank details */
dl.bank { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px 22px; max-width: 620px; margin: 0 0 20px; box-shadow: var(--sh-card); }
dl.bank dt { color: var(--muted); font-size: 12.5px; }
dl.bank dd { margin: 0; font-weight: 500; color: var(--head); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

/* generic stat cards used on smaller pages */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin: 16px 0 24px; }
.cards .card { display: flex; flex-direction: column; gap: 2px; }
.cards .card span { font-size: 12px; color: var(--muted); }
.cards .card strong { font-size: 22px; font-weight: 500; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cards .card small { font-size: 11.5px; }

/* ---------- sign-in ---------- */
.passkey-alt { margin-top: 16px; }
.passkey-alt .or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 11.5px; margin-bottom: 14px; }
.passkey-alt .or::before, .passkey-alt .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.passkey-alt button { width: 100%; height: 44px; }
.passkey-alt .ico, .passkey-add .ico { width: 17px; height: 17px; }
.passkey-msg { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; text-align: center; }
.passkey-msg.bad { color: var(--coral-ink); }
.sub-h { font-size: 13.5px; font-weight: 600; margin: 20px 0 8px; }
.card table + .sub-h { margin-top: 36px; }
.passkey-add { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.passkey-add label { flex: 1 1 220px; }
.passkey-add .passkey-msg { flex-basis: 100%; text-align: left; margin: 0; }
[hidden] { display: none !important; }

.auth-page { background: var(--ground); }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(360px, 440px) 1fr; }
.auth-brand-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 32px 36px; color: rgba(255, 255, 255, .78); background: radial-gradient(90% 60% at 100% 0%, rgba(138, 121, 203, .5) 0%, rgba(138, 121, 203, 0) 60%), radial-gradient(70% 50% at 0% 100%, rgba(23, 204, 175, .12) 0%, rgba(23, 204, 175, 0) 60%), linear-gradient(160deg, #3B2D78 0%, #35286B 45%, #1D1540 100%); }
.auth-brand-panel::after { content: ""; position: absolute; right: -120px; bottom: 80px; width: 320px; height: 320px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .08); box-shadow: 0 0 0 48px rgba(255, 255, 255, .025), 0 0 0 96px rgba(255, 255, 255, .018); pointer-events: none; }
.auth-pitch { position: relative; z-index: 1; }
.auth-pitch .eyebrow { color: rgba(255, 255, 255, .55); }
.auth-claim { font-size: 24px; font-weight: 500; line-height: 1.3; letter-spacing: -.02em; color: #FFF; margin: 0; max-width: 18ch; }
.trust { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; font-size: 12.5px; position: relative; z-index: 1; }
.trust li { display: flex; gap: 12px; align-items: flex-start; }
.trust .ico { width: 16px; height: 16px; color: var(--icon-blue); margin-top: 2px; }
.auth-form { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; gap: 16px; }
.auth-logo-sm { display: none; }
.auth-card { width: 100%; max-width: 380px; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); padding: 28px 28px 24px; box-shadow: var(--sh-pop); }
.auth-card h1 { font-size: 20px; margin-bottom: 6px; }
.auth-card p { font-size: 13px; color: var(--muted); }
.auth-card form.stack { max-width: none; margin-top: 18px; }
.auth-card button { width: 100%; height: 44px; }
.auth-card .alt { text-align: center; font-size: 12.5px; margin: 14px 0 0; }
.auth-foot { text-align: center; font-size: 11.5px; color: var(--muted); margin: 0; max-width: 380px; }
.auth-foot a { color: var(--muted); }
.code-input { font-size: 20px; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; height: 50px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .g-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .g-hero .hero { grid-column: span 2; grid-row: auto; min-height: 220px; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: 1fr; }
  .main { padding: 28px 28px 40px; }
  .foot { padding: 16px 28px 24px; }
}
@media (max-width: 900px) {
  .side { transform: translateX(-100%); width: min(300px, 86vw); box-shadow: var(--sh-pop); }
  .nav-mini .side { width: min(300px, 86vw); }
  .nav-mini .side .logo span, .nav-mini .side-nav a span, .nav-mini .who-name, .nav-mini .signout span { display: revert; }
  .nav-mini .side-group { font-size: 11px; height: auto; background: none; margin: 16px 8px 6px; }
  .nav-mini .side-nav a, .nav-mini .signout { justify-content: flex-start; padding: 0 10px; }
  .nav-mini .side-head { flex-direction: row; padding: 20px 16px 16px 20px; }
  .collapse { display: none !important; }
  .drawer-close { display: inline-flex; }
  .nav-open:checked ~ .side { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(19, 20, 15, .35); z-index: 35; }
  .nav-open:checked ~ .scrim { display: block; }
  .main-wrap, .nav-mini .main-wrap { margin-left: 0; }
  .mobile-bar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30; background: rgba(244, 243, 250, .88); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); padding: 10px 16px; border-bottom: 1px solid var(--line); }
  .mobile-bar .logo b { font-size: 14px; }
  .main { padding: 20px 16px 32px; }
  .foot { padding: 16px; }
  body.has-tabbar .foot { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .tabbar { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 58px; color: var(--muted); text-decoration: none; font-size: 10.5px; }
  .tabbar a .ico { width: 20px; height: 20px; }
  .tabbar a.on { color: var(--brand); font-weight: 500; }
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand-panel { padding: 20px 20px 44px; gap: 18px; justify-content: flex-start; }
  .auth-form { margin-top: -28px; position: relative; z-index: 1; }
  .auth-brand-panel .auth-pitch { display: none; }
  .auth-brand-panel::after { display: none; }
  .trust { gap: 8px; font-size: 12px; }
}
@media (max-width: 640px) {
  h1 { font-size: 22px; }
  .page-head { margin-bottom: 16px; }
  .grid { gap: 12px; margin-bottom: 12px; }
  .g-4, .g-3, .g-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .g-3 > :nth-child(3):last-child { grid-column: span 2; }
  .g-4 > .hero { grid-column: span 2; order: -1; }
  .g-4 > .hero .value { font-size: 28px; }
  .g-4 > .hero ~ :nth-child(3), .g-4 > :nth-child(3):nth-last-child(2) { grid-column: span 2; }
  .g-hero .hero { padding: 20px; }
  .hero .value { font-size: 32px; }
  .card { padding: 16px; border-radius: 18px; }
  .card table { margin: 0 -16px -16px; width: calc(100% + 32px); }
  th:first-child, td:first-child { padding-left: 16px; }
  th:last-child, td:last-child { padding-right: 16px; }
  .kpi { min-height: 112px; }
  .value { font-size: 22px; }
  .value.sm { font-size: 18px; }
  .chart svg.lg { display: none; }
  .chart svg.sm { display: block; }
  form.grid { padding: 16px; }
  dl.bank { grid-template-columns: 1fr; gap: 2px; padding: 16px; }
  dl.bank dd { margin-bottom: 8px; }
  .auth-form { justify-content: flex-start; padding: 24px 16px 32px; }
  .auth-card { padding: 22px 20px 20px; }
  /* investor tables become one card per row */
  table.stack-sm, table.stack-sm > tbody, table.stack-sm tr, table.stack-sm td { display: block; width: 100%; }
  table.stack-sm { border: 0; background: none; box-shadow: none; overflow: visible; }
  .card table.stack-sm { margin: 0; width: 100%; }
  table.stack-sm tr.head { display: none; }
  table.stack-sm tr { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 4px 14px; margin-bottom: 8px; }
  .card table.stack-sm tr { border-color: var(--line-soft); }
  table.stack-sm td, table.stack-sm td:first-child, table.stack-sm td:last-child { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); text-align: right; }
  table.stack-sm td:last-child { border-bottom: 0; }
  table.stack-sm td::before { content: attr(data-label); color: var(--muted); font-size: 12px; text-align: left; }
  table.stack-sm td:first-child { font-weight: 500; }
  table.stack-sm tbody tr:hover td { background: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
