/* ============================================================
   Chillinz Admin
   A calm, light ledger for a naira exchange: cool green-grey
   canvas, white panels, naira-green as the single accent.
   Light by default, dark via [data-theme="dark"].
   ============================================================ */

:root {
    --canvas: #F2F5F3;
    --surface: #FFFFFF;
    --surface-2: #F8FAF9;
    --line: #E1E7E3;
    --line-strong: #CCD5D0;

    --ink: #17221C;
    --ink-2: #3D4B44;
    --mute: #66766D;

    --brand: #0A7A52;
    --brand-deep: #075C3E;
    --brand-wash: #E2F2EA;
    --brand-ring: rgba(10, 122, 82, .26);

    --amber: #A5620A;
    --amber-wash: #FBEFD9;
    --red: #B3372A;
    --red-wash: #FBE8E5;
    --slate-wash: #E9EEEB;

    --font-body: "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: "Bricolage Grotesque", "Hanken Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

    --sidebar-w: 252px;
    --rail-w: 68px;
    --r-sm: 8px;
    --r-md: 12px;

    /* old names some pages still use inline */
    --text: var(--ink); --text-mute: var(--mute);
    --accent: var(--brand); --accent-dark: var(--brand-deep); --accent-tint: var(--brand-wash);
    --danger: var(--red); --warn: var(--amber);
    --paper: var(--canvas); --card: var(--surface); --radius: var(--r-md);

    color-scheme: light;
}

[data-theme="dark"] {
    --canvas: #0E1411;
    --surface: #151D19;
    --surface-2: #1A241F;
    --line: #25322B;
    --line-strong: #33433A;

    --ink: #E8EFEA;
    --ink-2: #BAC8BF;
    --mute: #8B9B91;

    --brand: #2FB37E;
    --brand-deep: #5CD0A0;
    --brand-wash: #14302A;
    --brand-ring: rgba(47, 179, 126, .35);

    --amber: #E3A453;
    --amber-wash: #33260F;
    --red: #EF7C6E;
    --red-wash: #35191A;
    --slate-wash: #212D27;

    color-scheme: dark;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--canvas);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 14.5px;
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-deep); text-underline-offset: 3px; }
a:hover { color: var(--brand); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.015em; margin: 0; }

code { font-family: ui-monospace, "SF Mono", Consolas, Menlo, monospace; font-size: .88em; background: var(--slate-wash); padding: 1px 6px; border-radius: 5px; }

/* ---------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .2s ease; }
body.rail .shell { grid-template-columns: var(--rail-w) minmax(0, 1fr); }

.sidebar {
    position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; overflow-x: hidden;
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 18px 12px 14px;
    display: flex; flex-direction: column;
    scrollbar-width: thin;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 32px; height: 32px; flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; line-height: 1; }
.brand-name small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 12px; color: var(--mute); letter-spacing: 0; margin-top: 4px; }

.nav { flex: 1; }
.nav-group + .nav-group { margin-top: 16px; }
.nav-group-title { font-size: 12px; font-weight: 600; color: var(--mute); padding: 0 10px 6px; }

.nav-item {
    position: relative;
    display: flex; align-items: center; gap: 11px;
    padding: 8px 10px; margin-bottom: 1px;
    border-radius: var(--r-sm);
    color: var(--ink-2); text-decoration: none;
    font-weight: 500; font-size: 14px;
    transition: background .12s ease, color .12s ease;
}
.nav-item svg { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--brand-wash); color: var(--brand-deep); font-weight: 600; }
.nav-item.active svg { opacity: 1; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.nav-badge.soft { background: var(--amber-wash); color: var(--amber); }

.sidebar-foot { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--brand-wash); color: var(--brand-deep); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.who { min-width: 0; line-height: 1.25; }
.who strong { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who span { font-size: 12px; color: var(--mute); }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; flex: none;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
    border-radius: var(--r-sm); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-foot .icon-btn { margin-left: auto; border-color: transparent; background: transparent; }

/* theme toggle shows the icon for the theme you would switch TO */
.icon-btn .i-sun { display: none; }
[data-theme="dark"] .icon-btn .i-sun { display: block; }
[data-theme="dark"] .icon-btn .i-moon { display: none; }

/* collapsed rail */
body.rail .brand-name, body.rail .nav-group-title, body.rail .nav-item span, body.rail .nav-item .nav-badge, body.rail .who, body.rail .sidebar-foot .icon-btn { display: none; }
body.rail .nav-item { justify-content: center; padding: 10px 0; }
body.rail .nav-group + .nav-group { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
body.rail .brand { justify-content: center; padding-left: 0; padding-right: 0; }
body.rail .sidebar-foot { justify-content: center; }
body.rail .nav-item.has-badge::after { content: ""; position: absolute; top: 7px; right: 14px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); border: 2px solid var(--surface); }

/* ---------------------------------------------------------- main */
.main { min-width: 0; }

.topbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; gap: 10px;
    padding: 12px 36px;
    background: color-mix(in srgb, var(--canvas) 92%, transparent);
    backdrop-filter: saturate(1.2) blur(6px);
    border-bottom: 1px solid var(--line);
}
.topbar .grow { flex: 1; }
.menu-btn { display: none; }

.jump {
    display: inline-flex; align-items: center; gap: 10px;
    height: 34px; padding: 0 10px 0 12px;
    border: 1px solid var(--line); background: var(--surface); color: var(--mute);
    border-radius: var(--r-sm); font: inherit; font-size: 13.5px; cursor: pointer;
    min-width: 230px;
}
.jump:hover { border-color: var(--line-strong); color: var(--ink-2); }
.jump svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; }
.jump kbd { margin-left: auto; font: inherit; font-size: 11.5px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); color: var(--mute); }

.content { padding: 26px 36px 64px; max-width: 1280px; margin: 0 auto; }

.page-header { margin-bottom: 22px; }
.page-header h1 { font-size: 26px; font-weight: 700; line-height: 1.15; }
.page-header p { margin: 6px 0 0; color: var(--mute); font-size: 14.5px; max-width: 70ch; }

/* ---------------------------------------------------------- panels */
.grid { display: grid; gap: 16px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    padding: 18px 20px;
}
.stat-label { font-size: 13px; color: var(--mute); margin-bottom: 4px; }
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
.stat-sub { font-size: 13px; color: var(--mute); margin-top: 6px; }

.section-title { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin: 34px 0 12px; letter-spacing: -0.01em; }
.section-title:first-child { margin-top: 0; }

/* ---------------------------------------------------------- tables */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
    text-align: left; white-space: nowrap;
    background: var(--surface-2); color: var(--mute);
    font-weight: 600; font-size: 13px;
    padding: 11px 16px; border-bottom: 1px solid var(--line);
}
tbody td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .1s ease; }
tbody tr:hover { background: var(--surface-2); }

table.is-sortable thead th { cursor: pointer; user-select: none; }
table.is-sortable thead th:hover { color: var(--ink); }
table.is-sortable thead th .sort { display: inline-block; width: 10px; margin-left: 4px; color: var(--brand); }

.table-tools { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; }
.table-tools input[type=search] {
    width: 280px; max-width: 100%; margin: 0; height: 36px;
    padding: 0 12px 0 34px;
    border: 1px solid var(--line-strong); border-radius: var(--r-sm);
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2366766D' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E") no-repeat 11px center;
    color: var(--ink); font: inherit; font-size: 14px;
}
.table-tools .count { color: var(--mute); font-size: 13px; }
.no-match td { text-align: center; color: var(--mute); padding: 28px 16px; }

/* ---------------------------------------------------------- badges */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 2px 10px 2px 8px; border-radius: 999px;
    font-size: 12.5px; font-weight: 600; line-height: 1.5; white-space: nowrap;
    background: var(--slate-wash); color: var(--ink-2);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-completed, .badge-active, .badge-paid, .badge-approved { background: var(--brand-wash); color: var(--brand-deep); }
.badge-pending { background: var(--amber-wash); color: var(--amber); }
.badge-failed, .badge-blocked, .badge-rejected { background: var(--red-wash); color: var(--red); }
.badge-held, .badge-suspended, .badge-processing { background: var(--slate-wash); color: var(--ink-2); }

/* ---------------------------------------------------------- forms */
label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=url], input[type=tel], input[type=date], input[type=search], select, textarea {
    width: 100%; height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line-strong); border-radius: var(--r-sm);
    font: inherit; font-size: 14.5px;
    background: var(--surface); color: var(--ink);
    margin-bottom: 14px;
    transition: border-color .12s ease, box-shadow .12s ease;
}
textarea { height: auto; padding: 10px 12px; min-height: 90px; }
select {
    appearance: none; padding-right: 34px;
    background-image: 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='%2366766D' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-ring); }
input::placeholder, textarea::placeholder { color: var(--mute); opacity: .8; }
input[type=checkbox], input[type=radio] { accent-color: var(--brand); width: 17px; height: 17px; vertical-align: -3px; margin: 0 6px 0 0; }
.help-text { font-size: 13px; color: var(--mute); margin-top: -8px; margin-bottom: 16px; max-width: 70ch; }

/* forms laid out in a row (filters, quick actions) */
.inline-form, form[style*="display:flex"], form[style*="display: flex"] { align-items: flex-end; }
.inline-form input, .inline-form select, form[style*="display:flex"] input, form[style*="display:flex"] select { margin-bottom: 0; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; padding: 0 16px;
    border-radius: var(--r-sm); border: 1px solid transparent;
    background: var(--brand); color: #fff;
    font: inherit; font-weight: 600; font-size: 14px;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: background .12s ease, border-color .12s ease, transform .06s ease;
}
.btn:hover { background: var(--brand-deep); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { background: var(--surface-2); color: var(--ink); border-color: var(--mute); }
.btn-danger { background: var(--red); }
.btn-danger:hover { background: #8F2A20; color: #fff; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn[disabled], .btn.is-busy { opacity: .65; pointer-events: none; }

/* ---------------------------------------------------------- flash */
.flash {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 14px 12px 16px; margin-bottom: 18px;
    border-radius: var(--r-sm); border: 1px solid transparent; border-left-width: 4px;
    font-size: 14px; white-space: pre-wrap; word-break: break-word;
}
.flash-success { background: var(--brand-wash); border-color: color-mix(in srgb, var(--brand) 30%, transparent); border-left-color: var(--brand); color: var(--brand-deep); }
.flash-error { background: var(--red-wash); border-color: color-mix(in srgb, var(--red) 30%, transparent); border-left-color: var(--red); color: var(--red); }
.flash a { color: inherit; font-weight: 600; }
.flash-close { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px; }
.flash-close:hover { opacity: 1; }

.text-mute { color: var(--mute); }
.sub { display: block; color: var(--mute); font-size: 12.5px; margin-top: 1px; }
.mono { font-family: ui-monospace, "SF Mono", Consolas, Menlo, monospace; font-size: 13px; }
.copyable { cursor: copy; }
.copyable:hover { color: var(--brand-deep); }

/* ---------------------------------------------------------- dashboard */
.ledger {
    display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 0.9fr); gap: 0;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
    margin-bottom: 22px; overflow: hidden;
}
.ledger > div { padding: 22px 24px; }
.ledger > div + div { border-left: 1px solid var(--line); }
.ledger-title { color: var(--mute); font-size: 14px; margin: 0 0 6px; }
.ledger-figure { font-family: var(--font-display); font-weight: 700; font-size: 46px; letter-spacing: -0.03em; line-height: 1.05; color: var(--ink); }
.ledger-split { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--slate-wash); color: var(--ink-2); font-size: 13px; }
.chip b { font-weight: 700; color: var(--ink); }

.spark-wrap { position: relative; }
.spark { width: 100%; height: 86px; display: block; overflow: visible; }
.spark .area { fill: var(--brand-wash); }
.spark .line { fill: none; stroke: var(--brand); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark-dot { position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--brand); border: 2.5px solid var(--surface); transform: translate(-50%, -50%); box-sizing: content-box; }
.spark-caption { display: flex; justify-content: space-between; color: var(--mute); font-size: 12.5px; margin-top: 8px; }

.facts { margin: 0; display: grid; gap: 12px; }
.facts div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.facts dt { color: var(--mute); font-size: 14px; }
.facts dd { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 18px; }
.facts dd small { font-family: var(--font-body); font-weight: 500; font-size: 12.5px; color: var(--mute); margin-left: 4px; }

.split-2 { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.35fr); gap: 16px; align-items: start; margin-bottom: 8px; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { font-size: 17px; font-weight: 600; }
.panel-head > a, .panel-head > span { font-size: 13px; color: var(--mute); }

.attention { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.attention li + li { border-top: 1px solid var(--line); }
.attention a { display: flex; align-items: center; gap: 12px; padding: 13px 16px; text-decoration: none; color: var(--ink); }
.attention a:hover { background: var(--surface-2); }
.attention li:first-child a { border-radius: var(--r-md) var(--r-md) 0 0; }
.attention li:last-child a { border-radius: 0 0 var(--r-md) var(--r-md); }
.attention .n { min-width: 30px; height: 26px; padding: 0 8px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13.5px; background: var(--slate-wash); color: var(--mute); }
.attention .hot .n { background: var(--red-wash); color: var(--red); }
.attention .warm .n { background: var(--amber-wash); color: var(--amber); }
.attention .text { flex: 1; min-width: 0; }
.attention .text small { display: block; color: var(--mute); font-size: 12.5px; }
.attention .go { color: var(--mute); width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.all-clear { display: flex; align-items: center; gap: 12px; padding: 22px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink-2); }
.all-clear svg { width: 26px; height: 26px; stroke: var(--brand); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------------------------------------------------------- price guard, controls, switches */
.guard { display: flex; align-items: center; gap: 16px; padding: 16px 18px; border-radius: var(--r-md); border: 1px solid; margin-bottom: 16px; }
.guard.on { background: var(--brand-wash); border-color: color-mix(in srgb, var(--brand) 28%, transparent); }
.guard.off { background: var(--red-wash); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.guard-icon { width: 40px; height: 40px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); }
.guard.on .guard-icon { color: var(--brand); }
.guard.off .guard-icon { color: var(--red); }
.guard-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.guard-text { flex: 1; min-width: 0; }
.guard-text strong { display: block; font-family: var(--font-display); font-size: 16px; }
.guard-text p { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; max-width: 80ch; }
.guard-note { margin-bottom: 16px; }
.guard-note ul { margin: 8px 0 6px; padding-left: 18px; }
.guard-note li { margin: 3px 0; }
.guard-note p { margin: 6px 0 0; font-size: 13px; }
.sub.guarded { color: var(--amber); font-weight: 600; white-space: nowrap; }

.controls { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.slider-wrap { min-width: 270px; }
.slider-wrap label { margin-bottom: 2px; }
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row output { font-family: var(--font-display); font-weight: 700; font-size: 18px; min-width: 56px; }
input[type=range] { width: 210px; height: 24px; margin: 0; padding: 0; border: 0; background: transparent; accent-color: var(--brand); box-shadow: none; }
.sug-lbl { color: var(--mute); font-size: 12.5px; margin-right: 4px; }
[data-copy] { cursor: copy; border-bottom: 1px dashed var(--line-strong); }
[data-copy]:hover { color: var(--brand-deep); border-color: var(--brand); }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; font-size: 14.5px; margin: 0 0 6px; position: relative; }
.switch input { position: absolute; opacity: 0; width: 40px; height: 22px; margin: 0; cursor: pointer; }
.switch .track { flex: none; width: 40px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .15s ease; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s ease; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--brand); outline-offset: 2px; }

.savebar { position: sticky; bottom: 0; z-index: 10; margin-top: 22px; padding: 14px 0; background: var(--canvas); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 14px; }

.secure-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--r-sm); color: var(--brand-deep); background: var(--brand-wash); font-size: 13px; font-weight: 600; cursor: default; }
.secure-chip svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.secure-note { display: flex; gap: 8px; align-items: flex-start; margin: 18px 0 0; color: var(--mute); font-size: 13px; }
.secure-note svg { width: 15px; height: 15px; flex: none; margin-top: 2px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------- command palette & toast */
.palette-scrim { position: fixed; inset: 0; z-index: 100; background: rgba(12, 20, 16, .42); display: none; align-items: flex-start; justify-content: center; padding-top: 12vh; }
.palette-scrim.open { display: flex; }
.palette { width: min(560px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; box-shadow: 0 24px 60px rgba(8, 20, 14, .28); overflow: hidden; }
.palette input { width: 100%; height: 52px; margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0 18px; font-size: 16px; background: transparent; }
.palette input:focus { box-shadow: none; }
.palette ul { list-style: none; margin: 0; padding: 6px; max-height: 340px; overflow-y: auto; }
.palette li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: var(--ink-2); }
.palette li svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.palette li small { margin-left: auto; color: var(--mute); font-size: 12.5px; }
.palette li.sel { background: var(--brand-wash); color: var(--brand-deep); }
.palette .empty { padding: 22px; text-align: center; color: var(--mute); cursor: default; justify-content: center; }
.palette .hint { display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--mute); background: var(--surface-2); }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--surface); padding: 9px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 500; box-shadow: 0 10px 28px rgba(0, 0, 0, .25); animation: toast-in .18s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.scrim { display: none; }

/* ---------------------------------------------------------- login */
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: var(--canvas); }
.login-art {
    position: relative; overflow: hidden;
    background: var(--brand-deep); color: #EAF6F0;
    padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-art .brand { color: #fff; padding: 0; }
.login-art .brand-name small { color: #A9D6C2; }
.login-art h2 { font-size: 36px; line-height: 1.12; font-weight: 700; max-width: 14ch; color: #fff; }
.login-art p { color: #BFE0D0; max-width: 38ch; margin: 14px 0 0; font-size: 15.5px; }
.login-art .ticks { position: absolute; right: -40px; bottom: -40px; width: 380px; opacity: .16; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 32px; }
.login-card { width: 100%; max-width: 360px; }
.login-card h1 { font-size: 26px; margin-bottom: 6px; }
.login-card .sub { color: var(--mute); margin: 0 0 24px; }
.pw { position: relative; }
.pw input { padding-right: 64px; }
.pw button { position: absolute; right: 8px; top: 7px; height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: var(--slate-wash); color: var(--ink-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.login-card .btn { width: 100%; height: 42px; }
.login-card .brand-mobile { display: none; }

/* ---------------------------------------------------------- responsive */
@media (max-width: 1100px) {
    .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ledger > div:nth-child(3) { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
    .split-2 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 960px) {
    .shell, body.rail .shell { grid-template-columns: minmax(0, 1fr); }
    .sidebar { position: fixed; z-index: 60; left: 0; top: 0; width: 280px; height: 100vh; height: 100dvh; transform: translateX(-102%); transition: transform .22s ease; }
    body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .18); }
    body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(12, 20, 16, .4); }
    body.rail .brand-name, body.rail .nav-group-title, body.rail .nav-item span, body.rail .nav-item .nav-badge, body.rail .who, body.rail .sidebar-foot .icon-btn { display: revert; }
    body.rail .nav-item { justify-content: flex-start; padding: 8px 10px; }
    .menu-btn { display: inline-flex; }
    .rail-btn { display: none; }
    .topbar { padding: 10px 16px; }
    .content { padding: 20px 16px 56px; }
    .jump { min-width: 0; flex: 1; }
    .jump span { flex: 1; text-align: left; }
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .login-shell { grid-template-columns: minmax(0, 1fr); }
    .login-art { display: none; }
    .login-card .brand-mobile { display: flex; margin-bottom: 26px; padding: 0; }
}

@media (max-width: 640px) {
    .grid-2, .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .ledger { grid-template-columns: minmax(0, 1fr); }
    .ledger > div + div { border-left: 0; border-top: 1px solid var(--line); }
    .ledger-figure { font-size: 38px; }
    .page-header h1 { font-size: 23px; }
    .jump kbd { display: none; }
    .secure-chip span { display: none; }
    .secure-chip { padding: 0 9px; }
    .guard { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
