:root {
  --navy: #17324d;
  --navy-deep: #10263a;
  --navy-soft: #244b6b;
  --ink: #17222e;
  --ink-soft: #52606e;
  --ink-faint: #7b8794;
  --line: #d9e0e6;
  --line-soft: #e8edf1;
  --paper: #f5f6f3;
  --card: #ffffff;
  --gold: #ad7f24;
  --gold-soft: #f3e8cf;
  --green: #1f714c;
  --green-soft: #e5f2ea;
  --red: #a83737;
  --red-soft: #f7e7e5;
  --amber: #9a6410;
  --amber-soft: #fbf0da;
  --teal: #1f6f78;
  --plum: #6b4f7a;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(20, 40, 60, .08);
  --sidebar-w: 276px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.015em; color: var(--navy); }
h1 { font-size: 34px; font-weight: 750; }
h2 { font-size: 24px; font-weight: 720; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0 0 12px; }
small { font-size: 13.5px; color: var(--ink-faint); }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: .92em; }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--navy);
  color: #dbe6f0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  scrollbar-width: thin;
  z-index: 50;
}
.brand {
  padding: 24px 22px 18px;
  border-bottom: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; gap: 13px;
}
.brand-mark {
  width: 48px; height: 48px; flex: 0 0 48px;
  border: 1.5px solid rgba(255,255,255,.55);
  border-radius: 12px;
  display: grid; place-items: center;
  font-weight: 750; font-size: 15px; letter-spacing: .06em; color: #fff;
  background: rgba(255,255,255,.06);
}
.brand-text strong { display: block; color: #fff; font-size: 19px; letter-spacing: .04em; }
.brand-text span { display: block; font-size: 12.5px; color: #a9bdd1; margin-top: 2px; }
.nav { padding: 16px 12px 24px; flex: 1; }
.nav-group { margin-bottom: 6px; }
.nav-group > summary {
  list-style: none;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  color: #8fa7bd;
  padding: 12px 12px 7px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after { content: "›"; font-size: 17px; color: #6f89a1; transform: rotate(90deg); transition: transform .15s; }
.nav-group[open] > summary::after { transform: rotate(-90deg); }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border-radius: 9px;
  color: #c9d7e4;
  font-size: 15.5px;
  font-weight: 550;
  border-left: 3px solid transparent;
  margin: 1px 0;
}
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav-link.active {
  background: rgba(255,255,255,.12);
  color: #fff;
  border-left-color: var(--gold);
}
.nav-link svg { width: 20px; height: 20px; flex: 0 0 20px; opacity: .9; }
.nav-link .tag {
  margin-left: auto; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  background: var(--gold); color: #1b2733; padding: 2px 6px; border-radius: 5px;
}
.sidebar-foot {
  padding: 16px 22px 22px; border-top: 1px solid rgba(255,255,255,.12);
  font-size: 12.5px; color: #8fa7bd;
}
.sidebar-foot strong { color: #dbe6f0; display: block; font-size: 13px; }
.mode-pill { display: inline-flex; gap: 6px; align-items: center; margin-top: 8px; padding: 3px 9px; border: 1px solid rgba(255,255,255,.25); border-radius: 99px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #e3c98d; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 74px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 30px;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(8px);
}
.topbar-title { font-size: 15px; font-weight: 650; color: var(--ink-soft); letter-spacing: .02em; }
.topbar-title b { color: var(--navy); }
.topbar-spacer { flex: 1; }
.topbar-user { display: flex; align-items: center; gap: 11px; }
.topbar-user .who { text-align: right; line-height: 1.25; }
.topbar-user .who strong { display: block; font-size: 14.5px; color: var(--ink); }
.topbar-user .who span { font-size: 12.5px; color: var(--ink-faint); }
.avatar {
  border-radius: 50%;
  display: inline-grid; place-items: center;
  background: hsl(var(--hue, 210) 38% 90%);
  color: hsl(var(--hue, 210) 42% 28%);
  font-weight: 720;
  flex: 0 0 auto;
}
.avatar.sm { width: 38px; height: 38px; font-size: 13px; }
.avatar.md { width: 56px; height: 56px; font-size: 18px; }
.avatar.lg { width: 104px; height: 104px; font-size: 32px; }
.avatar.xl { width: 132px; height: 132px; font-size: 40px; }
.hamburger { display: none; background: transparent; border: 1px solid var(--line); border-radius: 9px; width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer; }
.hamburger svg { width: 22px; height: 22px; }
.logout-btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink-soft); font-size: 14px; font-weight: 600; }
.logout-btn:hover { border-color: var(--navy); color: var(--navy); text-decoration: none; }
.logout-btn svg { width: 17px; height: 17px; }
.notif-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink-soft); }
.notif-btn:hover { border-color: var(--navy); color: var(--navy); text-decoration: none; }
.notif-btn svg { width: 18px; height: 18px; }
.notif-count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }

.content { padding: 28px 30px 52px; width: 100%; max-width: 1480px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 7px; }
.page-head p { margin: 7px 0 0; color: var(--ink-soft); font-size: 16px; max-width: 780px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.scope-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line); background: #fff; border-radius: 99px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.scope-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 17px;
  border-radius: 9px; border: 1px solid var(--line);
  background: #fff; color: var(--navy);
  font-size: 15px; font-weight: 650; cursor: pointer;
  text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { border-color: var(--navy); text-decoration: none; background: #f8fafb; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-soft); border-color: var(--navy-soft); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: #96701f; border-color: #96701f; color: #fff; }
.btn-danger { color: var(--red); border-color: #e4c5c1; }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn-sm { min-height: 36px; padding: 6px 11px; font-size: 13.5px; border-radius: 7px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Cards, grids ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.card-pad { padding: 22px 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 19px; }
.card-head p { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-faint); }
.card-body { padding: 20px 22px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); }
.grid-main-rev { grid-template-columns: minmax(300px, 1fr) minmax(0, 1.7fr); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.spacer { flex: 1; }

.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 19px 21px 18px; position: relative; overflow: hidden;
}
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent, var(--navy)); }
.stat-label { font-size: 13px; font-weight: 650; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); }
.stat-value { font-size: 31px; font-weight: 760; line-height: 1.15; margin-top: 8px; color: var(--navy); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 14px; font-weight: 600; color: var(--ink-faint); letter-spacing: 0; }
.stat-note { margin-top: 7px; font-size: 13px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.stat-note .up { color: var(--green); font-weight: 700; }
.stat-note .down { color: var(--red); font-weight: 700; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 15.5px; }
table.data th {
  text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-faint); padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fafbfb; white-space: nowrap;
}
table.data td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data tbody tr:hover { background: #f9fbfc; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.tight { white-space: nowrap; }
table.data .person { display: flex; align-items: center; gap: 11px; min-width: 200px; }
table.data .person strong { display: block; font-weight: 650; color: var(--ink); line-height: 1.3; }
table.data .person span { display: block; font-size: 12.5px; color: var(--ink-faint); }
.table-foot { padding: 14px 18px; border-top: 1px solid var(--line-soft); font-size: 13.5px; color: var(--ink-faint); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 99px; font-size: 12px; font-weight: 700; letter-spacing: .02em;
  white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { background: var(--green-soft); color: var(--green); }
.badge.warn { background: var(--amber-soft); color: var(--amber); }
.badge.bad { background: var(--red-soft); color: var(--red); }
.badge.muted { background: #edf0f2; color: #65717d; }
.badge.gold { background: var(--gold-soft); color: #7f5a12; }
.badge.navy { background: #e6edf4; color: var(--navy); }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 14px; font-weight: 650; color: var(--ink-soft); margin-bottom: 6px; }
.field .hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 4px; }
.input, .select, .textarea, .field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 10px 13px;
  border: 1px solid #cbd5dd; border-radius: 9px; background: #fff;
  font-size: 16px; color: var(--ink);
}
.textarea, .field textarea { min-height: 120px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus, .field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid rgba(23, 50, 77, .18); border-color: var(--navy);
}
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 14.5px; color: var(--ink-soft); }
.check input { width: 19px; height: 19px; margin-top: 2px; accent-color: var(--navy); }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 16px 18px; background: #fbfcfc; border-bottom: 1px solid var(--line-soft); }
.filter-bar .field { min-width: 160px; flex: 1 1 160px; }
.filter-bar .field.narrow { flex: 0 1 130px; }
.filter-bar .field.wide { flex: 2 1 240px; }
.filter-bar .btn { flex: 0 0 auto; }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--ink-faint); }
.search-wrap input { padding-left: 39px; }

/* ---------- Content bits ---------- */
.section-title { font-size: 12px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 10px; }
.divider { height: 1px; background: var(--line-soft); margin: 18px 0; }
.empty { padding: 42px 20px; text-align: center; color: var(--ink-faint); }
.empty svg { width: 40px; height: 40px; margin: 0 auto 10px; color: #b0bcc6; }
.notice { display: flex; gap: 12px; padding: 14px 16px; border-radius: 10px; border: 1px solid; font-size: 14.5px; line-height: 1.5; }
.notice svg { width: 20px; height: 20px; flex: 0 0 20px; margin-top: 1px; }
.notice.info { background: #eef4fa; border-color: #c9dceb; color: #1d4d70; }
.notice.warn { background: var(--amber-soft); border-color: #ecd9b4; color: #76500f; }
.notice.ok { background: var(--green-soft); border-color: #c5e2d2; color: #185c3e; }
.notice.bad { background: var(--red-soft); border-color: #ecc9c4; color: #8a2c2c; }
[hidden] { display: none !important; }
.kv { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr); gap: 8px 18px; font-size: 15px; }
.kv dt { color: var(--ink-faint); font-weight: 550; }
.kv dd { margin: 0; font-weight: 600; color: var(--ink); }
.kv dd .muted, .muted { color: var(--ink-faint); font-weight: 400; }
.pill-list { display: flex; gap: 8px; flex-wrap: wrap; }
.meta-line { font-size: 13.5px; color: var(--ink-faint); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.dot-sep { width: 3px; height: 3px; background: #b6c0c9; border-radius: 50%; display: inline-block; }
.thumb-proof { width: 52px; height: 38px; border: 1px solid var(--line); border-radius: 6px; object-fit: cover; background: #fff; }
.proof-preview { width: 100%; max-width: 420px; border: 1px solid var(--line); border-radius: 10px; }

.schedule-item { display: flex; gap: 16px; padding: 16px 22px; border-bottom: 1px solid var(--line-soft); align-items: flex-start; }
.schedule-item:last-child { border-bottom: 0; }
.schedule-date { flex: 0 0 64px; text-align: center; border-right: 1px solid var(--line-soft); padding-right: 14px; }
.schedule-date .d { font-size: 27px; font-weight: 760; color: var(--navy); line-height: 1; }
.schedule-date .m { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); margin-top: 4px; }
.schedule-main { min-width: 0; flex: 1; }
.schedule-main h4 { font-size: 16.5px; margin: 0 0 4px; }
.schedule-main .meta { font-size: 13.5px; color: var(--ink-soft); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.schedule-main .meta svg { width: 16px; height: 16px; flex: 0 0 16px; }
.schedule-main .meta .meta-item { display: inline-flex; align-items: center; gap: 6px; }
.schedule-side { text-align: right; font-size: 13px; color: var(--ink-faint); flex: 0 0 auto; }
.schedule-side .time { font-weight: 750; color: var(--navy); font-size: 15px; }
.schedule-main .people { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 7px; font-size: 13.5px; color: var(--ink-soft); }
.schedule-main .people b { color: var(--ink-faint); font-weight: 650; margin-right: 4px; }
.date-sep { padding: 12px 22px 8px; background: #f7f9fa; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); font-size: 12px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.task-row { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.task-row:first-of-type { padding-top: 4px; }
.task-row:last-of-type { border-bottom: 0; }
.task-date { flex: 0 0 46px; text-align: center; }
.task-date .d { font-size: 22px; font-weight: 760; color: var(--navy); line-height: 1; }
.task-date .m { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); margin-top: 3px; }
.copy-preview { margin: 0; padding: 12px 14px; background: #fbfcfc; border: 1px solid var(--line); border-radius: 9px; font-family: inherit; font-size: 13px; line-height: 1.55; color: var(--ink-soft); white-space: pre-wrap; max-height: 260px; overflow: auto; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }

/* ---------- Notifications/flash ---------- */
.flashes { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.flash { display: flex; gap: 11px; align-items: flex-start; padding: 13px 16px; border-radius: 10px; font-size: 14.5px; border: 1px solid; }
.flash svg { width: 19px; height: 19px; flex: 0 0 19px; margin-top: 1px; }
.flash.ok { background: var(--green-soft); border-color: #c5e2d2; color: #175a3c; }
.flash.warn { background: var(--amber-soft); border-color: #ecd9b4; color: #76500f; }
.flash.bad { background: var(--red-soft); border-color: #ecc9c4; color: #8a2c2c; }
.flash.info { background: #eef4fa; border-color: #c9dceb; color: #1d4d70; }

/* ---------- Charts ---------- */
.chart-frame { padding: 18px 22px 22px; }
.chart-frame h3 { font-size: 18px; }
.chart-frame .sub { font-size: 13px; color: var(--ink-faint); margin-top: 3px; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: 13.5px; color: var(--ink-soft); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-grid-line { stroke: #e6ebef; stroke-width: 1; }
.chart-axis-text { font-size: 11px; fill: #7b8794; font-family: inherit; }
.chart-value { font-size: 11px; fill: #33414e; font-weight: 600; font-family: inherit; }
.chart-center-num { font-size: 23px; font-weight: 760; fill: #17324d; font-family: inherit; }
.chart-center-label { font-size: 10.5px; fill: #7b8794; letter-spacing: .08em; text-transform: uppercase; font-family: inherit; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 1.1fr) minmax(0, 2.4fr); gap: 12px; align-items: center; padding: 8px 0; }
.bar-row .label { font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.bar-row .label small { display: block; font-weight: 400; color: var(--ink-faint); font-size: 12px; }
.bar-link { color: inherit; text-decoration: none; border-bottom: 1px dotted #9aa7b2; }
.bar-link:hover { color: var(--navy); border-bottom-color: var(--navy); }
.bar-track { height: 21px; border-radius: 6px; background: #eef1f3; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; min-width: 3px; }
.bar-row .value { font-size: 13px; color: var(--ink-faint); margin-top: 3px; text-align: right; }

.kpi-row { display: flex; gap: 10px; flex-wrap: wrap; }
.kpi-chip { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: #fff; min-width: 120px; }
.kpi-chip b { display: block; font-size: 21px; color: var(--navy); font-variant-numeric: tabular-nums; }
.kpi-chip span { font-size: 12px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .07em; font-weight: 650; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); background: var(--navy); }
.login-hero { padding: 54px 58px; color: #e6eef6; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-hero::after { content: ""; position: absolute; right: -160px; bottom: -200px; width: 520px; height: 520px; border: 1px solid rgba(255,255,255,.12); border-radius: 50%; }
.login-hero::before { content: ""; position: absolute; right: -60px; bottom: -100px; width: 300px; height: 300px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.login-kicker { font-size: 12.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #d9bd7e; }
.login-logo { width: 66px; height: 66px; border-radius: 50%; background: #fff; padding: 7px; object-fit: contain; margin-bottom: 18px; }
.login-hero h1 { color: #fff; font-size: 48px; line-height: 1.08; margin: 22px 0 18px; max-width: 620px; }
.login-hero p { color: #b9cadb; font-size: 17px; max-width: 560px; line-height: 1.6; }
.login-points { display: grid; gap: 12px; margin-top: 28px; max-width: 520px; }
.login-point { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: #cfdce8; }
.login-point svg { width: 21px; height: 21px; flex: 0 0 21px; color: #d9bd7e; margin-top: 1px; }
.login-foot { font-size: 12.5px; color: #829db6; position: relative; z-index: 1; }
.login-panel { background: var(--paper); display: flex; align-items: center; justify-content: center; padding: 34px 28px; overflow: auto; }
.login-card { width: 100%; max-width: 470px; }
.login-card h2 { font-size: 30px; margin-bottom: 6px; }
.login-card .lead { color: var(--ink-soft); font-size: 15.5px; margin-bottom: 22px; }
.role-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0 18px; }
.role-chip {
  text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 10px 11px; cursor: pointer; font-size: 13px; font-weight: 650; color: var(--ink-soft);
  display: flex; flex-direction: column; gap: 1px; line-height: 1.3;
}
.role-chip span { font-size: 11px; color: var(--ink-faint); font-weight: 500; }
.role-chip:hover { border-color: var(--navy); }
.role-chip.active { border-color: var(--navy); background: #eaf0f6; color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }
.login-error { margin-bottom: 14px; }
.login-note { margin-top: 16px; font-size: 12.5px; color: var(--ink-faint); line-height: 1.5; }

/* ---------- KAJ card ---------- */
.kaj {
  width: 340px; max-width: 100%; aspect-ratio: 85.6 / 54; border-radius: 11px; overflow: hidden;
  background: linear-gradient(135deg, #17324d 0%, #224b6b 100%); color: #fff; position: relative;
  padding: 17px 18px; display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 14px 30px rgba(16, 38, 58, .22);
}
.kaj::after { content: ""; position: absolute; right: -46px; top: -60px; width: 190px; height: 190px; border: 1px solid rgba(255,255,255,.16); border-radius: 50%; }
.kaj-head { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.kaj-logo { width: 31px; height: 31px; border: 1px solid rgba(255,255,255,.5); border-radius: 7px; display: grid; place-items: center; font-size: 10px; font-weight: 750; letter-spacing: .06em; }
.kaj-head .church { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; line-height: 1.3; }
.kaj-head .church small { display: block; font-size: 8.5px; letter-spacing: .12em; color: #b7c9da; font-weight: 500; }
.kaj-body { display: flex; gap: 12px; align-items: flex-end; position: relative; z-index: 1; }
.kaj-photo { width: 62px; height: 74px; border-radius: 7px; background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.3); display: grid; place-items: center; font-size: 22px; font-weight: 700; flex: 0 0 62px; overflow: hidden; }
.kaj-photo img { width: 100%; height: 100%; object-fit: cover; }
.kaj-info { min-width: 0; flex: 1; }
.kaj-name { font-size: 15px; font-weight: 750; line-height: 1.2; margin-bottom: 2px; }
.kaj-nij { font-size: 9.5px; letter-spacing: .1em; color: #d9bd7e; font-weight: 700; margin-bottom: 6px; }
.kaj-meta { font-size: 9.5px; color: #cfdce8; line-height: 1.45; }
.kaj-qr { width: 66px; height: 66px; background: #fff; border-radius: 6px; padding: 4px; flex: 0 0 66px; }
.kaj-qr svg { width: 100%; height: 100%; display: block; }
.kaj-foot { font-size: 7.5px; letter-spacing: .09em; color: #9fb5c9; text-transform: uppercase; position: relative; z-index: 1; }

.card-print-area { padding: 26px; display: flex; justify-content: center; background: #f3f5f6; border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- Misc ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 18px; flex-wrap: wrap; background: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.tab { padding: 14px 13px 12px; font-size: 14.5px; font-weight: 650; color: var(--ink-faint); border-bottom: 3px solid transparent; text-decoration: none; }
.tab:hover { color: var(--navy); text-decoration: none; }
.tab.active { color: var(--navy); border-bottom-color: var(--gold); }
.tab .count { display: inline-block; margin-left: 5px; background: #edf0f3; color: var(--ink-soft); border-radius: 99px; font-size: 11.5px; padding: 1px 7px; }
.tab.active .count { background: var(--gold-soft); color: #7f5a12; }
.month-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.month-cell { border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; background: #fff; font-size: 13.5px; }
.month-cell.paid { background: var(--green-soft); border-color: #bfe0cd; }
.month-cell.pending { background: var(--amber-soft); border-color: #ecd9b4; }
.month-cell strong { display: block; font-size: 14px; color: var(--navy); }
.month-cell span { font-size: 11.5px; color: var(--ink-faint); }
.month-cell.paid span { color: var(--green); font-weight: 650; }
.month-cell .m { font-size: 11.5px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-faint); }
.month-cell .amt { margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--navy); }
.month-cell .sub { margin-top: 2px; font-size: 11.5px; line-height: 1.4; color: var(--ink-faint); min-height: 32px; }
.month-cell.paid .m, .month-cell.paid .amt, .month-cell.paid .sub { color: var(--green); }
.month-cell .btn-block { margin-top: 2px; }
.timeline { position: relative; padding-left: 22px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--line); }
.timeline-item { position: relative; padding: 0 0 18px; }
.timeline-item::before { content: ""; position: absolute; left: -22px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--gold); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item strong { display: block; font-size: 15px; color: var(--ink); }
.timeline-item span { font-size: 13px; color: var(--ink-faint); }
.wa-bubble { background: #e7f6ec; border: 1px solid #c8e8d2; border-radius: 12px 12px 12px 3px; padding: 12px 15px; font-size: 14px; color: #17462e; max-width: 640px; white-space: pre-line; }
.lock-panel { display: flex; gap: 16px; align-items: flex-start; background: #fbf7ee; border: 1px solid #eadcc0; border-radius: var(--radius); padding: 20px 22px; }
.lock-panel svg { width: 30px; height: 30px; color: #a67c24; flex: 0 0 30px; }
.progress { height: 9px; background: #edf0f2; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--navy); }
.progress.gold > span { background: var(--gold); }
.progress.green > span { background: var(--green); }
.mobile-only { display: none; }
.desktop-only { display: initial; }
.print-only { display: none; }

.scrim { display: none; position: fixed; inset: 0; background: rgba(10, 22, 34, .5); z-index: 45; }

@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-main, .grid-main-rev { grid-template-columns: minmax(0, 1fr); }
  .login-hero h1 { font-size: 40px; }
}

@media (max-width: 980px) {
  .login-page { grid-template-columns: 1fr; }
  .login-hero { padding: 34px 30px 30px; }
  .login-hero h1 { font-size: 34px; margin: 16px 0 12px; }
  .login-points { display: none; }
  .login-foot { display: none; }
  .login-panel { padding: 26px 20px 40px; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    transform: translateX(-102%);
    transition: transform .2s ease;
    box-shadow: 20px 0 40px rgba(0,0,0,.2);
    height: 100%;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .scrim { display: block; }
  .hamburger { display: inline-flex; }
  .topbar { padding: 0 16px; height: 68px; gap: 12px; }
  .topbar-title { display: none; }
  .topbar-user .who { display: none; }
  .content { padding: 20px 16px 44px; }
  h1 { font-size: 27px; }
  h2 { font-size: 21px; }
  .page-head { margin-bottom: 18px; }
  .page-head p { font-size: 15px; }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid .full { grid-column: auto; }
  .month-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-value { font-size: 27px; }
  .kv { grid-template-columns: 130px minmax(0, 1fr); gap: 7px 12px; font-size: 14.5px; }
  .card-pad { padding: 18px; }
  .card-body { padding: 16px; }
  .desktop-only { display: none; }
  .mobile-only { display: initial; }
  .schedule-item { padding: 14px 16px; gap: 12px; }
  .schedule-date { flex-basis: 52px; padding-right: 10px; }
  .schedule-date .d { font-size: 23px; }
  .schedule-side { display: none; }
  .role-grid { grid-template-columns: minmax(0, 1fr); }
  .kaj { width: 100%; max-width: 360px; }
  .login-hero::after, .login-hero::before { display: none; }
  table.data .col-optional { display: none; }

  table.data.table-cards,
  table.data.table-cards tbody,
  table.data.table-cards tr,
  table.data.table-cards td { display: block; width: 100%; }
  table.data.table-cards thead { display: none; }
  table.data.table-cards tr { padding: 12px 16px; border-top: 1px solid var(--line); }
  table.data.table-cards tbody tr:first-child { border-top: 0; }
  table.data.table-cards td {
    border: 0; padding: 5px 0; text-align: left; white-space: normal;
    display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 4px 12px;
  }
  table.data.table-cards td::before {
    content: attr(data-label); font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
    text-transform: uppercase; color: var(--ink-faint); padding-top: 3px;
  }
  table.data.table-cards td.num { text-align: left; }
  table.data.table-cards td.wide { grid-template-columns: minmax(0, 1fr); }
  table.data.table-cards td[colspan] { display: block; padding: 8px 0; }
  table.data.table-cards td[colspan]::before { content: none; }
  table.data.table-cards td .person { min-width: 0; }
  table.data.table-cards td > form { display: inline-flex; flex-wrap: wrap; gap: 6px; }
}

@media (max-width: 480px) {
  .month-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .login-hero { padding: 28px 22px 26px; }
  .login-hero h1 { font-size: 30px; }
  .login-panel { padding: 22px 16px 34px; }
}

@media print {
  body { background: #fff; }
  .sidebar, .topbar, .scrim, .page-actions, .no-print, .flashes { display: none !important; }
  .main { display: block; }
  .content { padding: 0; max-width: none; }
  .card { border: 0; }
  .print-only { display: block; }
  a { color: #000; text-decoration: none; }
}
