/* ============ Suntorn Accounts Portal – Design System (Suntorn Navy × Cream × Gold star) ============ */
:root {
  --royal: #1d4172; --royal-2: #2a5591; --royal-3: #3a6aad; --royal-deep: #132d52; --royal-ink: #0d2240;
  --cream: #f5efe0; --cream-2: #efe6d1; --cream-3: #e6dbc0; --cream-light: #fbf8f1; --paper: #fffdf8;
  --gold: #c9a961; --gold-2: #a98b45;
  --ink: #1b2340; --ink-2: #3b4566; --muted: #5a6382; --line: #e1d9c6; --line-2: #d2c8b0;
  --ok: #2f8f5b; --ok-bg: #e4f3ea; --warn: #c78a1e; --warn-bg: #fbf0d8; --bad: #b83b3b; --bad-bg: #f8e3e3; --info: #2c4fb5; --info-bg: #e5ebfa;
  --shadow: 0 1px 2px rgba(19,45,82,.06), 0 8px 24px -12px rgba(19,45,82,.18);
  --shadow-lg: 0 24px 60px -24px rgba(19,45,82,.35);
  --radius: 14px; --radius-sm: 9px;
  --font-display: 'Cormorant Garamond', Georgia, serif; --font-body: 'Manrope', system-ui, -apple-system, Segoe UI, sans-serif;
  --sidebar-w: 256px; --topbar-h: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body { font-family: var(--font-body); font-size: 15px; color: var(--ink); background: var(--cream); -webkit-font-smoothing: antialiased; }
a { color: var(--royal-2); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--royal-ink); margin: 0; font-weight: 600; letter-spacing: .01em; }
h1 { font-size: 34px; line-height: 1.1; } h2 { font-size: 24px; } h3 { font-size: 19px; } h4 { font-size: 16px; font-family: var(--font-body); font-weight: 700; }
p { margin: 0 0 8px; line-height: 1.55; }
small, .muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.right { text-align: right; } .center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; } .gap-sm { gap: 6px; } .gap-lg { gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .mt-sm { margin-top: 8px; } .mb-sm { margin-bottom: 8px; }
.grid { display: grid; gap: 16px; } .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- layout ---------- */
#app { min-height: 100%; }
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--royal-deep) 0%, var(--royal) 60%, var(--royal-2) 100%); color: #fff; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.sidebar .brand { padding: 20px 20px 14px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar .brand .logo { width: 44px; height: 44px; border-radius: 12px; background: var(--cream); display: grid; place-items: center; overflow: hidden; }
.sidebar .brand .logo img { width: 40px; height: 40px; object-fit: contain; }
.sidebar .brand .t1 { font-family: var(--font-display); font-size: 21px; font-weight: 700; line-height: 1; letter-spacing: .02em; }
.sidebar .brand .t2 { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; opacity: .7; margin-top: 3px; }
.sidebar nav { padding: 12px 12px; overflow-y: auto; flex: 1; }
.sidebar nav .sec { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; opacity: .75; padding: 14px 12px 6px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: #fff; font-weight: 600; font-size: 14px; transition: background .15s; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.sidebar nav a.active { background: var(--cream); color: var(--royal-deep); font-weight: 700; box-shadow: 0 6px 18px -8px rgba(0,0,0,.4); }
.sidebar nav a .ico { width: 20px; height: 20px; display: inline-grid; place-items: center; opacity: .9; }
.sidebar nav a .ico svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar nav a .pill { margin-left: auto; background: var(--gold); color: var(--royal-deep); font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 20px; }
.sidebar nav a.active .pill { background: var(--royal); color: #fff; }
.sidebar .user { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,.12); display: flex; align-items: center; gap: 10px; font-size: 13px; }
.sidebar .user .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--royal-deep); display: grid; place-items: center; font-weight: 800; }
.sidebar .user .role { font-size: 10.5px; opacity: .7; text-transform: uppercase; letter-spacing: .12em; }
.sidebar .user button { margin-left: auto; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 28px; background: rgba(245,239,224,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .crumbs { font-size: 13px; color: var(--muted); } .topbar .crumbs b { color: var(--ink); font-weight: 600; }
.topbar .search { flex: 1; max-width: 460px; }
.topbar .search input { width: 100%; }
.content { padding: 24px 28px 60px; flex: 1; }
.menu-btn { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-w); z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-flex; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
}

/* ---------- hero ---------- */
.hero { position: relative; border-radius: 18px; overflow: hidden; min-height: 210px; display: flex; align-items: flex-end; flex-wrap: wrap; gap: 14px; padding: 28px 32px; color: #fff; margin-bottom: 22px; box-shadow: var(--shadow-lg); background: var(--royal-deep); text-shadow: 0 2px 10px rgba(0,0,0,.55), 0 1px 2px rgba(0,0,0,.6); }
.hero img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; filter: saturate(1.05); }
.hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(13,34,64,.5) 0%, rgba(13,34,64,.8) 55%, rgba(9,24,46,.95) 100%), linear-gradient(90deg, rgba(13,34,64,.8) 0%, rgba(13,34,64,.5) 55%, rgba(13,34,64,.35) 100%); }
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: #fff; font-size: 44px; font-weight: 700; } .hero h1 em { font-style: italic; color: #e6c983; }
.hero .sub { color: #fff; max-width: 640px; font-size: 15.5px; font-weight: 600; margin-top: 8px; line-height: 1.5; }
.hero .kicker { font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: #e6c983; font-weight: 800; margin-bottom: 6px; }
.hero .actions { margin-left: auto; display: flex; gap: 10px; align-self: flex-end; flex-wrap: wrap; text-shadow: none; }
.hero.compact { min-height: 150px; padding: 20px 28px; } .hero.compact h1 { font-size: 34px; }
@media (max-width: 720px) { .hero { padding: 18px; min-height: 170px; } .hero h1 { font-size: 30px; } .hero .actions { margin-left: 0; margin-top: 4px; width: 100%; } .hero .actions .btn { flex: 1 1 auto; } }

/* ---------- cards & stats ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card .card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card .card-h h3 { flex: 1; } .card.flush .card-h { padding: 14px 18px 0; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat .lbl { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); font-weight: 800; }
.stat .val { font-family: var(--font-display); font-size: 34px; font-weight: 700; color: var(--royal-deep); line-height: 1.1; margin-top: 6px; }
.stat .sub { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.stat.accent { background: linear-gradient(135deg, var(--royal-deep), var(--royal-2)); color: #fff; border: 0; } .stat.accent .lbl, .stat.accent .sub { color: rgba(255,255,255,.92); } .stat.accent .val { color: #fff; }
.stat.warn .val { color: var(--warn); } .stat.bad .val { color: var(--bad); } .stat.ok .val { color: var(--ok); }
.stat .ico { position: absolute; right: 14px; top: 14px; opacity: .15; width: 44px; height: 44px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 15px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 700; font-size: 13px; cursor: pointer; background: var(--royal); color: #fff; transition: transform .08s, box-shadow .15s, background .15s; white-space: nowrap; line-height: 1.2; }
.btn:hover { background: var(--royal-2); box-shadow: 0 8px 20px -10px rgba(29,65,114,.6); text-decoration: none; } .btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--royal-deep); border-color: var(--line-2); } .btn.secondary:hover { background: var(--cream-light); }
.btn.ghost { background: transparent; color: var(--royal); } .btn.ghost:hover { background: rgba(29,65,114,.07); box-shadow: none; }
.btn.gold { background: var(--gold); color: var(--royal-deep); } .btn.gold:hover { background: #d8b86e; }
.btn.danger { background: var(--bad); } .btn.danger:hover { background: #9d2e2e; }
.btn.ok { background: var(--ok); }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; } .btn.xs { padding: 3px 8px; font-size: 11.5px; border-radius: 7px; }
.btn.light { background: rgba(255,255,255,.92); color: var(--royal-deep); border-color: rgba(255,255,255,.9); } .btn.light:hover { background: #fff; }
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line-2); background: #fff; display: inline-grid; place-items: center; cursor: pointer; color: var(--royal); position: relative; }
.iconbtn:hover { background: var(--cream-light); } .iconbtn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn .badge { position: absolute; top: -6px; right: -6px; background: var(--bad); color: #fff; font-size: 10px; font-weight: 800; border-radius: 20px; padding: 1px 5px; min-width: 17px; text-align: center; }

/* ---------- forms ---------- */
input, select, textarea { font: inherit; font-size: 13.5px; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 11px; outline: none; transition: border .15s, box-shadow .15s; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--royal-2); box-shadow: 0 0 0 3px rgba(42,85,145,.15); }
input[type=checkbox], input[type=radio] { width: auto; }
input.sm, select.sm { padding: 5px 8px; font-size: 12.5px; border-radius: 7px; }
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
label.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--ink); }
label.field span.req::after { content: ' *'; color: var(--bad); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; } .form-grid .span2 { grid-column: span 2; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .form-grid .span3 { grid-column: span 3; }
@media (max-width: 720px) { .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; } .form-grid .span2, .form-grid .span3 { grid-column: span 1; } }
.check { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px; cursor: pointer; }
.seg { display: inline-flex; background: var(--cream-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font: inherit; font-weight: 700; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.seg button.active { background: #fff; color: var(--royal); box-shadow: var(--shadow); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
thead th { text-align: left; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--royal-deep); font-weight: 800; padding: 11px 12px; background: var(--cream-light); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(29,65,114,.035); }
tbody tr.clickable { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tfoot td { padding: 10px 12px; font-weight: 700; background: var(--cream-light); border-top: 2px solid var(--line-2); }
.table-wrap.dense td, .table-wrap.dense th { padding: 6px 9px; font-size: 12.5px; }
.table-wrap.tall { max-height: 70vh; }

/* ---------- badges & chips ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: var(--cream-2); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); } .badge.warn { background: var(--warn-bg); color: var(--warn); } .badge.bad { background: var(--bad-bg); color: var(--bad); } .badge.info { background: var(--info-bg); color: var(--info); } .badge.royal { background: var(--royal); color: #fff; } .badge.gold { background: #f3e7c8; color: var(--gold-2); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--cream-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.flag { font-size: 16px; line-height: 1; }
.progress { height: 8px; background: var(--cream-3); border-radius: 10px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--royal-2), var(--royal-3)); border-radius: 10px; }
.progress.warn > i { background: var(--warn); } .progress.bad > i { background: var(--bad); } .progress.ok > i { background: var(--ok); }

/* ---------- modal, drawer, toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(13,34,64,.45); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s; }
.modal { background: var(--paper); border-radius: 18px; box-shadow: var(--shadow-lg); width: 100%; max-width: 640px; max-height: 92vh; display: flex; flex-direction: column; animation: pop .18s; }
.modal.lg { max-width: 960px; } .modal.xl { max-width: 1240px; }
.modal .m-h { padding: 18px 22px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; } .modal .m-h h3 { flex: 1; }
.modal .m-b { padding: 18px 22px; overflow: auto; }
.modal .m-f { padding: 12px 22px 18px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0 } } @keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98) } }
.drawer-bg { position: fixed; inset: 0; z-index: 90; background: rgba(13,34,64,.2); }
.drawer { position: fixed; right: 0; top: 0; height: 100vh; width: 400px; max-width: 95vw; background: var(--paper); box-shadow: var(--shadow-lg); z-index: 95; display: flex; flex-direction: column; animation: slide .2s; }
@keyframes slide { from { transform: translateX(30px); opacity: 0 } }
.drawer .d-h { padding: 18px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; } .drawer .d-h h3 { flex: 1; }
.drawer .d-b { overflow: auto; flex: 1; }
.notif { padding: 12px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; cursor: pointer; }
.notif:hover { background: var(--cream-light); } .notif.unread { background: #fff; } .notif .t { font-weight: 700; font-size: 13px; } .notif .b { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.4; } .notif .d { font-size: 11px; color: var(--muted); margin-top: 4px; }
.notif .sev { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--info); } .notif .sev.warning { background: var(--warn); } .notif .sev.critical { background: var(--bad); }
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--royal-deep); color: #fff; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 600; max-width: 380px; animation: pop .2s; display: flex; gap: 10px; align-items: flex-start; }
.toast.ok { background: var(--ok); } .toast.bad { background: var(--bad); } .toast.warn { background: var(--warn); }

/* ---------- misc ---------- */
.empty { padding: 40px 20px; text-align: center; color: var(--muted); } .empty h3 { color: var(--ink-2); margin-bottom: 6px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 13px; } .kv dt { color: var(--muted); font-weight: 600; } .kv dd { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0; } .timeline li { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; } .timeline li .when { color: var(--muted); font-size: 12px; white-space: nowrap; width: 120px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.steps .step { display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 20px; background: var(--cream-2); font-size: 12px; font-weight: 700; color: var(--muted); }
.steps .step.done { background: var(--ok-bg); color: var(--ok); } .steps .step.cur { background: var(--royal); color: #fff; }
.steps .step .n { width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.08); display: grid; place-items: center; font-size: 11px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 10px 14px; font: inherit; font-weight: 700; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs button.active { color: var(--royal); border-color: var(--royal); }
.md { line-height: 1.6; } .md h1, .md h2, .md h3 { margin: 18px 0 8px; } .md table { margin: 10px 0; border: 1px solid var(--line); } .md th, .md td { border: 1px solid var(--line); padding: 6px 9px; } .md ul { padding-left: 20px; } .md code { background: var(--cream-2); padding: 1px 5px; border-radius: 4px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--cream-3); border-top-color: var(--royal); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; } @keyframes spin { to { transform: rotate(360deg) } }
.loading { display: flex; align-items: center; gap: 10px; padding: 30px; color: var(--muted); justify-content: center; }
.sparkline { height: 34px; width: 110px; }
.ai-box { background: linear-gradient(135deg, #eef2ff, #fbf8f1); border: 1px solid #cdd7f5; border-radius: var(--radius); padding: 14px 16px; }
.ai-box .ai-tag { font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--royal-2); font-weight: 800; display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.ai-box .ai-tag::before { content: '✦'; color: var(--gold); }
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-page .art { position: relative; background: var(--royal-deep); overflow: hidden; } .login-page .art img { width: 100%; height: 100%; object-fit: cover; opacity: .9; }
.login-page .art .quote { position: absolute; left: 40px; bottom: 40px; right: 40px; color: #fff; } .login-page .art .quote { text-shadow: 0 2px 12px rgba(0,0,0,.6); } .login-page .art .quote h2 { color: #fff; font-size: 38px; font-weight: 600; } .login-page .art .quote p { color: #fff; font-weight: 600; }
.login-page .form { display: grid; place-items: center; padding: 30px; background: var(--cream); }
.login-page .box { width: 100%; max-width: 400px; }
.login-page .box .logo { width: 150px; margin-bottom: 20px; }
@media (max-width: 860px) { .login-page { grid-template-columns: 1fr; } .login-page .art { min-height: 220px; } }


/* =====================================================================
   Suntorn brand layer
   ===================================================================== */
.sidebar { background: linear-gradient(180deg, #0f2544 0%, var(--royal-deep) 45%, var(--royal) 100%); }
.sidebar .brand { flex-direction: column; align-items: flex-start; gap: 8px; padding: 22px 22px 16px; }
.sidebar .brand .wordmark { width: 176px; height: auto; display: block; }
.sidebar .brand .t2 { color: #e6c983; opacity: 1; font-weight: 800; letter-spacing: .24em; }
.sidebar nav a.active { background: var(--cream); color: var(--royal-deep); }
.sidebar nav a.active .ico { color: var(--gold-2); }

/* hero: navy panel with the Suntorn star instead of photography */
.hero { background: radial-gradient(1200px 400px at 85% -20%, rgba(230,201,131,.18), transparent 60%), linear-gradient(120deg, #0f2544 0%, var(--royal-deep) 45%, var(--royal) 100%); }
.hero::after { background: none; }
.hero .star { position: absolute; right: 26px; top: 14px; width: 150px; height: 150px; opacity: .22; z-index: 0; pointer-events: none; }
.hero .star.small { width: 110px; height: 110px; }
.hero.compact { min-height: 132px; }

/* login */
.login-page .art { background: radial-gradient(900px 500px at 80% 10%, rgba(230,201,131,.2), transparent 60%), linear-gradient(150deg, #0f2544, var(--royal-deep) 50%, var(--royal)); display: grid; place-items: center; }
.login-page .art img.mark { width: min(440px, 70%); height: auto; object-fit: contain; opacity: 1; margin-bottom: 120px; filter: drop-shadow(0 12px 30px rgba(0,0,0,.35)); }
.login-page .art .quote { text-shadow: none; }
.login-page .art .quote h2 { font-size: 32px; }
.login-page .box .logo { width: 230px; }

/* =====================================================================
   Accounts components
   ===================================================================== */
.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: 340px; } .chart-box.short { height: 220px; }
.legend-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2); margin: -4px 0 10px; }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.legend-row i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.horizon { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.horizon input[type=number] { width: 92px; }
.upload-card { border: 1.5px dashed var(--line-2); border-radius: var(--radius); padding: 18px; background: var(--paper); display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, background .15s; }
.upload-card.drag { border-color: var(--royal-2); background: #eef3fb; }
.upload-card h3 { display: flex; align-items: center; gap: 10px; }
.upload-card h3 .n { width: 26px; height: 26px; border-radius: 50%; background: var(--royal); color: #fff; font-family: var(--font-body); font-size: 12.5px; font-weight: 800; display: grid; place-items: center; }
.upload-card .hint { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.upload-card .result { font-size: 12.5px; background: var(--cream-light); border-radius: 10px; padding: 10px 12px; }
.amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt.neg { color: var(--bad); } .amt.pos { color: var(--ok); }
.conf { display: inline-block; width: 46px; height: 6px; border-radius: 6px; background: var(--cream-3); overflow: hidden; vertical-align: middle; }
.conf > i { display: block; height: 100%; background: var(--royal-2); }
.split { display: grid; grid-template-columns: 1.45fr 1fr; gap: 16px; } @media (max-width: 1100px) { .split { grid-template-columns: 1fr; } }
.kpi-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; } @media (max-width: 1250px) { .kpi-strip { grid-template-columns: repeat(3, 1fr); } } @media (max-width: 720px) { .kpi-strip { grid-template-columns: 1fr 1fr; } }
.row-click { cursor: pointer; } .row-click:hover td { background: #f3f6fb; }
tr.sel td { background: #eef3fb !important; }
.md h1, .md h2, .md h3 { margin: 14px 0 6px; } .md table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; } .md th, .md td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; } .md ul { padding-left: 20px; }
.chat-log { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow: auto; }
.chat-log .q { align-self: flex-end; background: var(--royal); color: #fff; padding: 8px 12px; border-radius: 12px 12px 2px 12px; max-width: 80%; font-size: 13.5px; }
.chat-log .a { align-self: flex-start; background: var(--cream-light); border: 1px solid var(--line); padding: 10px 14px; border-radius: 12px 12px 12px 2px; max-width: 92%; font-size: 13.5px; }
.pill-note { font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-bg); border-radius: 6px; padding: 2px 6px; }
.statement { background: #fff; padding: 28px 32px; max-width: 900px; margin: 0 auto; border: 1px solid var(--line); border-radius: 12px; }
.statement .hd { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 3px solid var(--royal); padding-bottom: 12px; margin-bottom: 14px; }
.statement .hd img { height: 56px; }

@media print { body { background: #fff; } .sidebar, .topbar, .no-print, #toasts, .hero .actions { display: none !important; } .shell { display: block; } .content { padding: 0; } .statement { border: 0; } .card, .stat, .table-wrap { box-shadow: none; } }
