/* =========================================================================
   Kasteller design system
   Spacing scale (8px base): 4 8 12 16 24 32 40 48 64
   Type scale: 12 13 14 16 18 20 24 32 44
   ========================================================================= */
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/fonts/poppins-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('/static/fonts/poppins-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('/static/fonts/poppins-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 700; font-display: swap; src: url('/static/fonts/poppins-latin-700-normal.woff2') format('woff2'); }

:root {
  --bg: #C9CDE3;
  --bg-soft: #DADDEE;
  --surface: #FFFFFF;
  --surface-2: #F6F6FB;
  --surface-3: #EEEFF7;
  --line: #E6E7F1;
  --ink: #2E2F4D;
  --ink-2: #55577A;
  --muted: #8A8CA8;        /* AA on white for >=14px semibold; body copy uses --ink-2 */
  --primary: #6E5BB8;
  --primary-dark: #5B4A9F;
  --primary-ink: #4E3F8C;
  --primary-soft: #EEEBFA;
  --pink: #F2719B;
  --pink-2: #F48AAE;
  --pink-soft: #FDE3EC;
  --pink-ink: #C93B66;      /* darker than #E2557F for AA text contrast on pink-soft */
  --green: #22B35E;
  --amber: #E8A23A;
  --amber-soft: #FDF1DC;
  --amber-ink: #8A5A08;
  --green-soft: #DDF5E7;
  --green-ink: #137A3E;
  --danger: #D64545;
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-xl: 32px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 40px; --s8: 48px; --s9: 64px;
  --shadow-card: 0 10px 30px -12px rgba(62, 56, 120, .22), 0 2px 6px rgba(62, 56, 120, .06);
  --shadow-shell: 0 40px 80px -30px rgba(58, 54, 110, .35), 0 0 0 10px rgba(255, 255, 255, .35);
  --shadow-purple: 0 18px 36px -14px rgba(91, 74, 159, .65);
  --shadow-pink: 0 18px 36px -14px rgba(226, 85, 127, .6);
  --grad-primary: linear-gradient(160deg, #7564C2 0%, #6E5BB8 40%, #5B4A9F 100%);
  --grad-pink: linear-gradient(160deg, #F48AAE 0%, #F2719B 100%);
  --focus: 0 0 0 3px #fff, 0 0 0 5px #6E5BB8;
  --font: 'Poppins', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.55; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img, svg { display: block; }
a { color: var(--primary-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 16px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
.stack > * + * { margin-top: var(--s4); }
.row { display: flex; align-items: center; gap: var(--s3); }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Buttons & form controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font: 600 14px/1 var(--font); cursor: pointer; text-decoration: none !important; transition: transform .12s ease, box-shadow .12s ease, background .12s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad-primary); color: #fff; box-shadow: var(--shadow-purple); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-pink { background: var(--grad-pink); color: #fff; box-shadow: var(--shadow-pink); }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: var(--primary-soft); color: var(--primary-ink); }
.btn-danger { background: #fff; color: var(--danger); border-color: #F2C9C9; }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 16px; border-radius: 16px; }
.btn-icon { width: 40px; padding: 0; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--primary-ink); font: 600 13px var(--font); cursor: pointer; }

label { display: block; font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 6px; }
.field { margin-bottom: var(--s4); }
.field .hint { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.field .err { font-size: 12px; color: var(--danger); margin-top: 4px; font-weight: 500; }
.input, select.input, textarea.input { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); font: 400 14px/1.4 var(--font); transition: border-color .12s, background .12s; }
textarea.input { min-height: 110px; resize: vertical; }
.input:hover { border-color: #D3D5E6; }
.input:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(110, 91, 184, .15); }
.input[aria-invalid="true"] { border-color: var(--danger); }
input[type="file"].input { padding: 9px 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 var(--s4); }

.alert { padding: 12px 16px; border-radius: 14px; font-weight: 500; margin-bottom: var(--s4); display: flex; gap: 10px; align-items: flex-start; }
.alert svg { flex: none; margin-top: 2px; }
.alert-success { background: var(--green-soft); color: var(--green-ink); }
.alert-error { background: #FBE4E4; color: #9E2B2B; }
.alert-info { background: var(--primary-soft); color: var(--primary-ink); }
.secret { font: 600 16px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; background: #fff; padding: 6px 10px; border-radius: 8px; display: inline-block; margin-top: 6px; letter-spacing: .04em; user-select: all; }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-pink { background: var(--pink-soft); color: var(--pink-ink); }
.pill-purple { background: var(--primary-soft); color: var(--primary-ink); }
.pill-green { background: var(--green-soft); color: var(--green-ink); }
.pill-amber { background: var(--amber-soft); color: var(--amber-ink); }
.pill-gray { background: var(--surface-3); color: var(--ink-2); }
.band-high { background: var(--pink-soft); color: var(--pink-ink); }
.band-medium { background: var(--amber-soft); color: var(--amber-ink); }
.band-low { background: var(--green-soft); color: var(--green-ink); }

.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: var(--s5); }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: var(--s4); display: flex; align-items: center; gap: 10px; }
.badge-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--grad-primary); color: #fff; box-shadow: var(--shadow-purple); flex: none; }
.badge-icon.sm { width: 36px; height: 36px; border-radius: 11px; box-shadow: none; }
.badge-icon.pink { background: var(--grad-pink); box-shadow: var(--shadow-pink); }

/* =========================================================================
   App shell (client + admin)
   ========================================================================= */
.app-body { min-height: 100vh; padding: 40px; background: radial-gradient(1200px 600px at 20% -10%, #D7DAEC 0%, transparent 60%), var(--bg); }
.shell { max-width: 1440px; margin: 0 auto; background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-shell); display: grid; grid-template-columns: 112px minmax(0, 1fr); min-height: calc(100vh - 80px); overflow: hidden; }
.shell.has-aside { grid-template-columns: 112px minmax(0, 1fr) 320px; }

.rail { padding: 24px 0 24px 24px; }
.rail-inner { position: sticky; top: 24px; height: calc(100vh - 128px); min-height: 520px; max-height: 760px; background: var(--grad-primary); border-radius: 28px; display: flex; flex-direction: column; align-items: center; padding: 20px 0; box-shadow: var(--shadow-purple); }
.rail-logo { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .3); color: #fff; font-weight: 700; font-size: 20px; }
.rail-sep { width: 48px; height: 1px; background: rgba(255, 255, 255, .22); margin: 18px 0; }
.rail nav { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.rail a, .rail button { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: rgba(255, 255, 255, .78); background: transparent; border: 0; cursor: pointer; position: relative; text-decoration: none; }
.rail a:hover, .rail button:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.rail a.active { color: #fff; background: rgba(255, 255, 255, .2); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 8px 18px -8px rgba(30, 20, 80, .5); }
.rail .tip { position: absolute; left: 62px; background: var(--ink); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 5; }
.rail a:hover .tip, .rail a:focus-visible .tip, .rail button:hover .tip { opacity: 1; }
.rail-bottom { margin-top: auto; }
.rail .dot { position: absolute; top: 12px; right: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--pink-2); box-shadow: 0 0 0 2px var(--primary); }

.main { padding: 32px 32px 40px; min-width: 0; }
.topbar { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s5); }
.crumb .eyebrow { font-size: 13px; color: var(--ink-2); }
.crumb h1 { font-size: 24px; font-weight: 600; }
.search { position: relative; width: 260px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-2); }
.search input { width: 100%; height: 44px; border-radius: 14px; border: 1px solid transparent; background: var(--surface-3); padding: 0 14px 0 42px; font: 400 13px var(--font); color: var(--ink); }
.search input:focus { outline: none; background: #fff; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(110, 91, 184, .15); }
.avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-weight: 600; color: #fff; background: var(--grad-primary); flex: none; box-shadow: 0 6px 14px -6px rgba(91, 74, 159, .6); }
.avatar.round { border-radius: 50%; width: 40px; height: 40px; font-size: 13px; box-shadow: none; }

.aside { background: #FBFBFE; border-left: 1px solid var(--line); padding: 32px 24px; min-width: 0; }
.aside-head { display: flex; align-items: center; gap: 10px; margin-bottom: var(--s5); }
.aside-head h2 { font-size: 18px; font-weight: 600; }
.aside-head a { margin-left: auto; font-size: 12px; font-weight: 600; }
.tabs { display: flex; background: var(--surface-3); border-radius: 16px; padding: 6px; margin-bottom: var(--s5); }
.tabs a { flex: 1; text-align: center; padding: 8px 0; border-radius: 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.tabs a.active { background: var(--grad-primary); color: #fff; box-shadow: var(--shadow-purple); }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.people .who { min-width: 0; flex: 1; }
.people .who strong { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.people .who span { display: block; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.people .who em { display: block; font-style: normal; font-size: 11px; color: var(--muted); }
.people .score { font-size: 12px; font-weight: 700; color: var(--pink-ink); background: var(--pink-soft); border-radius: 10px; padding: 4px 8px; }
.aside-sep { height: 1px; background: var(--line); margin: var(--s5) 0; }
.drivers { list-style: none; padding: 0; margin: 0; }
.drivers li { margin-bottom: 12px; }
.drivers .lbl { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; gap: 8px; }
.drivers .lbl b { color: var(--ink); font-weight: 600; }
.drivers .bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.drivers .bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #8F7FD6, var(--primary)); }

/* ---------- Dashboard ---------- */
.dash-top { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(220px, 1fr); gap: var(--s5); }
.overview { background: var(--grad-primary); color: #fff; border-radius: 28px; padding: 24px 24px 20px; box-shadow: var(--shadow-purple); position: relative; overflow: hidden; }
.overview::before { content: ''; position: absolute; inset: -40% -20% auto auto; width: 70%; height: 120%; background: radial-gradient(closest-side, rgba(255, 255, 255, .10), transparent); pointer-events: none; }
.ov-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; position: relative; }
.ov-head h2 { font-size: 18px; font-weight: 600; }
.ov-head .sub { font-size: 12px; color: rgba(255, 255, 255, .72); font-weight: 400; display: block; margin-top: 2px; }
.ov-select { appearance: none; -webkit-appearance: none; background: rgba(255, 255, 255, .08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center; color: #fff; border: 1px solid rgba(255, 255, 255, .45); border-radius: 12px; height: 36px; padding: 0 34px 0 14px; font: 500 12px var(--font); cursor: pointer; }
.ov-select option { color: var(--ink); }
.ov-chart { position: relative; background: linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04)); border: 1px solid rgba(255, 255, 255, .14); border-radius: 22px; padding: 4px 0 0; backdrop-filter: blur(6px); }
.ov-chart svg { width: 100%; height: auto; }
.ov-months { display: flex; justify-content: space-around; padding: 6px 12px 14px; }
.ov-months a, .ov-months span { font-size: 12px; color: rgba(255, 255, 255, .75); padding: 2px 10px; border-radius: 999px; text-decoration: none; }
.ov-months a:hover { color: #fff; background: rgba(255, 255, 255, .12); }
.ov-months .active { background: #fff; color: var(--primary-ink); font-weight: 700; }
.ov-stats { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 12px; margin-top: -10px; position: relative; }
.ov-stat { text-align: center; padding: 22px 8px 6px; }
.ov-stat .k { font-size: 12px; color: rgba(255, 255, 255, .72); }
.ov-stat .v { font-size: 26px; font-weight: 600; line-height: 1.15; margin: 2px 0; letter-spacing: -.01em; }
.ov-stat .d { font-size: 12px; color: rgba(255, 255, 255, .8); }
.ov-stat.center { background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .07)); border: 1px solid rgba(255, 255, 255, .22); border-radius: 22px; padding: 18px 8px 16px; box-shadow: 0 16px 30px -18px rgba(20, 10, 60, .6); }
.ov-stat.center .v { font-size: 30px; font-weight: 700; }
.ov-empty { padding: 48px 16px; text-align: center; color: rgba(255, 255, 255, .85); }

.tiles { display: grid; grid-template-rows: auto 1fr; gap: var(--s5); }
.tile { border-radius: 28px; color: #fff; padding: 20px; position: relative; overflow: hidden; text-decoration: none !important; display: block; }
.tile-purple { background: linear-gradient(160deg, #7D6BCB 0%, #6A57B5 100%); box-shadow: var(--shadow-purple); }
.tile-pink { background: var(--grad-pink); box-shadow: var(--shadow-pink); display: flex; flex-direction: column; }
.tile .glass { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); box-shadow: 0 10px 20px -10px rgba(30, 20, 80, .45); flex: none; }
.tile-row { display: flex; align-items: center; gap: 16px; }
.tile h3 { font-size: 17px; font-weight: 600; }
.tile .tsub { font-size: 12px; color: rgba(255, 255, 255, .85); margin-top: 2px; }
.tile-pink .tile-row { background: rgba(255, 255, 255, .08); margin: -20px -20px 0; padding: 20px; border-radius: 28px 28px 22px 22px; }
.tile-pink .big { margin-top: auto; padding-top: 24px; position: relative; z-index: 1; }
.tile-pink .big .k { font-size: 12px; color: rgba(255, 255, 255, .85); }
.tile-pink .big .v { font-size: 32px; font-weight: 700; line-height: 1.1; }
.tile-pink .big .d { font-size: 13px; color: rgba(255, 255, 255, .9); }
.tile-pink .go { position: absolute; right: 18px; bottom: 18px; z-index: 1; color: #fff; }
.tile-pink .wave { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 55%; opacity: .5; }

.projects { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s5); margin-top: 56px; }
.pcard { background: var(--surface); border-radius: 26px; box-shadow: var(--shadow-card); padding: 0 20px 18px; text-align: center; position: relative; text-decoration: none !important; color: var(--ink); display: block; transition: transform .15s ease, box-shadow .15s ease; }
.pcard:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -16px rgba(62, 56, 120, .3); }
.pcard.selected { box-shadow: 0 0 0 2px var(--primary), var(--shadow-card); }
.pcard .badge-icon { width: 64px; height: 64px; border-radius: 18px; margin: -32px auto 0; }
.pcard .more { position: absolute; right: 14px; top: 14px; color: var(--muted); }
.pcard h3 { font-size: 16px; font-weight: 600; margin-top: 14px; }
.pcard .psub { font-size: 12px; color: var(--ink-2); margin-top: 2px; min-height: 18px; }
.progress-lbl { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; margin: 18px 0 8px; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 99px; background: var(--green); }
.pfoot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; font-size: 11px; color: var(--ink-2); gap: 8px; }

/* ---------- Tables ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; margin-bottom: var(--s4); }
.toolbar .input { width: auto; min-height: 40px; padding: 8px 12px; }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 12px; padding: 4px; }
.seg a { padding: 6px 12px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.seg a.active { background: #fff; color: var(--primary-ink); box-shadow: 0 2px 6px rgba(62, 56, 120, .12); }
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-card); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-transform: capitalize; text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 14px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover { background: #FAFAFD; }
.scorebar { display: flex; align-items: center; gap: 10px; min-width: 130px; }
.scorebar .track { flex: 1; height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; max-width: 90px; }
.scorebar .track i { display: block; height: 100%; border-radius: 99px; }
.scorebar b { font-variant-numeric: tabular-nums; width: 42px; }
.reasons { display: flex; flex-wrap: wrap; gap: 6px; min-width: 380px; max-width: 560px; }
.reasons span { white-space: nowrap; font-size: 12px; background: var(--surface-3); color: var(--ink-2); padding: 3px 9px; border-radius: 8px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: var(--s4); flex-wrap: wrap; }
.pager .pages { display: flex; gap: 6px; }
.pager a, .pager span.cur { min-width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-weight: 600; font-size: 13px; background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; padding: 0 10px; }
.pager span.cur { background: var(--grad-primary); color: #fff; border-color: transparent; }
.toggle-contact { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 10px; height: 30px; padding: 0 10px; font: 600 12px var(--font); color: var(--ink-2); cursor: pointer; }
.toggle-contact.on { background: var(--green-soft); color: var(--green-ink); border-color: transparent; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s4); margin-bottom: var(--s5); }
.stat-card { background: var(--surface); border-radius: 20px; padding: 18px; box-shadow: var(--shadow-card); display: flex; gap: 14px; align-items: center; }
.stat-card .v { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-card .k { font-size: 12px; color: var(--ink-2); }
.section-h { display: flex; align-items: center; justify-content: space-between; margin: var(--s6) 0 var(--s4); gap: 12px; }
.section-h h2 { font-size: 18px; font-weight: 600; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s5); }
.dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 13px; }
.dl dt { color: var(--ink-2); }
.dl dd { margin: 0; font-weight: 500; word-break: break-word; }
.empty { text-align: center; padding: 48px 24px; color: var(--ink-2); }
.empty .badge-icon { margin: 0 auto 16px; }
.dropzone { border: 2px dashed #CFCBE8; border-radius: 20px; padding: 28px; text-align: center; background: var(--primary-soft); }
.dropzone.drag { border-color: var(--primary); background: #E5E0F8; }
details.disclose summary { cursor: pointer; font-weight: 600; color: var(--primary-ink); }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 440px; background: #fff; border-radius: var(--r-xl); box-shadow: var(--shadow-shell); padding: 40px; }
.auth-card h1 { font-size: 24px; font-weight: 600; margin: 20px 0 6px; }
.auth-card .lead { color: var(--ink-2); margin-bottom: var(--s5); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none !important; }
.brand .mark { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-primary); color: #fff; font-size: 16px; box-shadow: var(--shadow-purple); }

/* =========================================================================
   Responsive: rail becomes a bottom bar
   ========================================================================= */
@media (max-width: 1280px) {
  .shell.has-aside { grid-template-columns: 112px minmax(0, 1fr); }
  .shell.has-aside .aside { grid-column: 2; border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; padding: 24px 32px 40px; }
  .shell.has-aside .aside .aside-sep { display: none; }
}
@media (max-width: 900px) {
  .app-body { padding: 0; }
  .shell, .shell.has-aside { grid-template-columns: 1fr; border-radius: 0; min-height: 100vh; box-shadow: none; padding-bottom: 88px; }
  .shell.has-aside .aside { grid-column: 1; grid-template-columns: 1fr; padding: 24px 16px 32px; }
  .rail { position: fixed; left: 0; right: 0; bottom: 0; padding: 0 12px calc(10px + env(safe-area-inset-bottom)); z-index: 50; }
  .rail-inner { position: static; height: 68px; min-height: 0; flex-direction: row; justify-content: space-around; padding: 0 8px; border-radius: 22px; }
  .rail .rail-logo, .rail-sep, .rail .tip { display: none; }
  .rail nav { flex-direction: row; gap: 4px; }
  .rail-bottom { margin-top: 0; }
  .rail a, .rail button { width: 48px; height: 48px; border-radius: 14px; }
  .main { padding: 20px 16px 24px; }
  .topbar { flex-wrap: wrap; }
  .topbar .search { order: 3; width: 100%; }
  .dash-top { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .tile-pink .big .v { font-size: 24px; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .two-col, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .crumb h1 { font-size: 20px; }
}
@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr; }
  .ov-stat .v { font-size: 20px; }
  .ov-stat .k, .ov-stat .d { font-size: 11px; line-height: 1.35; }
  .ov-stats { gap: 6px; grid-template-columns: 1fr 1.1fr 1fr; }
  .ov-head .sub { display: none; }
  .ov-stat.center .v { font-size: 22px; }
  .ov-months a, .ov-months span { padding: 2px 6px; font-size: 11px; }
  .overview { padding: 18px 14px 16px; }
  .auth-card { padding: 28px 22px; }
  .dl { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
svg.inline { display: inline-block; vertical-align: -2px; }
