:root {
  color-scheme: light;
  --ink: #172321;
  --ink-soft: #59635f;
  --line: #d9dedb;
  --line-strong: #bcc6c1;
  --paper: #ffffff;
  --canvas: #f2f4f2;
  --forest: #143d3b;
  --forest-2: #245b52;
  --mint: #dcebe3;
  --income: #187554;
  --income-bg: #e3f3ea;
  --expense: #b44837;
  --expense-bg: #f9e9e5;
  --amber: #bb6b1b;
  --amber-bg: #fff0d8;
  --danger: #a7352b;
  --shadow: 0 10px 26px rgba(19, 38, 34, 0.08);
  --radius: 6px;
  --font: Inter, "SF Pro Text", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; color: var(--ink); background: var(--canvas); font-family: var(--font); font-size: 15px; line-height: 1.55; letter-spacing: 0; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.25; }
.hidden { display: none !important; }
.muted { color: var(--ink-soft); }
.mono { font-variant-numeric: tabular-nums; }
.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; }

.boot-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; color: var(--ink-soft); }
.brand-mark { width: 40px; height: 40px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 4px; padding: 8px; background: var(--forest); border-radius: 5px; }
.brand-mark span { display: block; background: #fff; border-radius: 1px 1px 0 0; }
.brand-mark span:nth-child(1) { height: 45%; opacity: .72; }
.brand-mark span:nth-child(2) { height: 82%; }
.brand-mark span:nth-child(3) { height: 62%; opacity: .86; }
.brand-lockup { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }
.brand-lockup .brand-mark { width: 34px; height: 34px; padding: 7px; flex: 0 0 auto; }
.brand-name { font-size: 17px; font-weight: 760; white-space: nowrap; }
.brand-note { display: block; color: #a9b9b4; font-size: 11px; font-weight: 500; }

.public-header { color: #fff; background: var(--forest); border-bottom: 5px solid #d47750; }
.public-nav { width: min(1180px, calc(100% - 32px)); height: 70px; margin: auto; display: flex; align-items: center; justify-content: space-between; }
.public-hero { width: min(1180px, calc(100% - 32px)); min-height: 235px; margin: auto; padding: 37px 0 42px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 72px; align-items: end; }
.public-hero h1 { margin-bottom: 12px; max-width: 680px; font-size: 38px; font-weight: 780; }
.public-hero p { margin: 0; color: #c9d6d1; font-size: 16px; }
.hero-balance { justify-self: end; min-width: 320px; border-left: 1px solid rgba(255,255,255,.2); padding-left: 32px; }
.hero-balance-label { display: block; margin-bottom: 4px; color: #b9cbc5; font-size: 13px; }
.hero-balance strong { display: block; font-size: 42px; line-height: 1.2; font-weight: 720; font-variant-numeric: tabular-nums; }
.hero-balance small { color: #b9cbc5; }
.nav-action { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 13px; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; text-decoration: none; }
.nav-action:hover { background: rgba(255,255,255,.1); }

.page-width { width: min(1180px, calc(100% - 32px)); margin: auto; }
.summary-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: -1px; background: var(--paper); border: 1px solid var(--line); border-top: 0; }
.summary-cell { min-height: 94px; padding: 21px 24px; border-right: 1px solid var(--line); }
.summary-cell:last-child { border-right: 0; }
.summary-label { display: block; margin-bottom: 4px; color: var(--ink-soft); font-size: 12px; }
.summary-value { font-size: 23px; font-weight: 700; font-variant-numeric: tabular-nums; }
.summary-cell.income .summary-value { color: var(--income); }
.summary-cell.expense .summary-value { color: var(--expense); }

.ledger-section { padding: 34px 0 56px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-heading h2 { margin-bottom: 4px; font-size: 21px; }
.section-heading p { margin-bottom: 0; color: var(--ink-soft); font-size: 13px; }
.filters { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.field-inline { position: relative; }
.field-inline input, .field-inline select { height: 38px; min-width: 132px; padding: 0 11px; color: var(--ink); background: var(--paper); border: 1px solid var(--line-strong); border-radius: 4px; outline: 0; }
.field-inline input { width: 190px; }
.field-inline input:focus, .field-inline select:focus, .form-control:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(36, 91, 82, .12); }

.ledger-table-wrap { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 3px 13px rgba(25, 43, 38, .04); }
.ledger-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ledger-table th { padding: 11px 16px; color: var(--ink-soft); background: #f7f8f7; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 650; text-align: left; }
.ledger-table td { padding: 16px; border-bottom: 1px solid #e7eae8; vertical-align: middle; }
.ledger-table tr:last-child td { border-bottom: 0; }
.ledger-table tbody tr:hover { background: #fafbfa; }
.ledger-table .date { width: 132px; }
.ledger-table .type { width: 82px; }
.ledger-table .amount, .ledger-table .balance { width: 140px; text-align: right; }
.ledger-table .voucher { width: 78px; text-align: center; }
.amount-text { font-weight: 700; font-variant-numeric: tabular-nums; }
.amount-text.income { color: var(--income); }
.amount-text.expense { color: var(--expense); }
.type-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; height: 25px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.type-pill.income { color: var(--income); background: var(--income-bg); }
.type-pill.expense { color: var(--expense); background: var(--expense-bg); }
.description-main { display: block; overflow-wrap: anywhere; }
.description-meta { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 12px; }
.voucher-button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; color: var(--forest-2); background: var(--mint); border: 0; border-radius: 4px; font-size: 17px; }
.voucher-button:hover { background: #cadfd5; }
.mobile-ledger { display: none; }
.empty-state { padding: 58px 24px; text-align: center; color: var(--ink-soft); background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.empty-state strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 17px; }
.pagination { min-height: 56px; display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-top: 1px solid var(--line); }
.pagination-info { color: var(--ink-soft); font-size: 12px; }
.pagination-actions { display: flex; gap: 6px; }

.btn { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; color: #fff; background: var(--forest-2); border: 1px solid var(--forest-2); border-radius: 4px; font-weight: 650; text-decoration: none; }
.btn:hover { background: var(--forest); border-color: var(--forest); }
.btn:disabled { cursor: not-allowed; opacity: .52; }
.btn-secondary { color: var(--ink); background: var(--paper); border-color: var(--line-strong); }
.btn-secondary:hover { background: #f4f6f4; border-color: #98a59f; }
.btn-danger { color: var(--danger); background: #fff; border-color: #d8aaa4; }
.btn-danger:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-warning { color: #76410d; background: var(--amber-bg); border-color: #dfbb86; }
.btn-warning:hover { color: #593007; background: #ffe4b8; border-color: #cb9651; }
.btn-small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.icon-text { font-size: 17px; line-height: 1; }

.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; color: #fff; background: var(--forest); }
.sidebar-brand { min-height: 74px; display: flex; align-items: center; padding: 0 22px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar-nav { display: grid; gap: 4px; padding: 20px 12px; }
.sidebar-link { width: 100%; min-height: 43px; display: flex; align-items: center; gap: 11px; padding: 0 12px; color: #c9d6d1; background: transparent; border: 0; border-radius: 4px; text-align: left; }
.sidebar-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.sidebar-link.active { color: #fff; background: #2d655b; box-shadow: inset 3px 0 #e29670; }
.sidebar-icon { width: 20px; text-align: center; font-size: 16px; }
.sidebar-bottom { margin-top: auto; padding: 15px 12px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-user { padding: 8px 12px 13px; }
.sidebar-user strong { display: block; font-size: 13px; }
.sidebar-user span { color: #a9b9b4; font-size: 11px; }
.admin-main { min-width: 0; }
.admin-topbar { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 30px; background: var(--paper); border-bottom: 1px solid var(--line); }
.admin-topbar h1 { margin: 0; font-size: 20px; }
.admin-top-actions { display: flex; align-items: center; gap: 8px; }
.menu-toggle { display: none; }
.admin-content { width: min(1240px, 100%); padding: 28px 30px 52px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); background: var(--paper); }
.stat { min-height: 112px; padding: 20px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat-label { display: flex; align-items: center; justify-content: space-between; color: var(--ink-soft); font-size: 12px; }
.stat-label i { width: 8px; height: 8px; display: block; background: var(--line-strong); border-radius: 50%; }
.stat.income i { background: var(--income); }
.stat.expense i { background: var(--expense); }
.stat.balance i { background: var(--forest-2); }
.stat.records i { background: var(--amber); }
.stat-value { display: block; margin-top: 16px; font-size: 25px; font-weight: 740; font-variant-numeric: tabular-nums; }
.work-section { margin-top: 28px; }
.work-section-header { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 12px; }
.work-section-header h2 { margin: 0; font-size: 18px; }
.work-section-header p { margin: 3px 0 0; color: var(--ink-soft); font-size: 12px; }
.data-panel { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px 14px; color: var(--ink-soft); background: #f7f8f7; border-bottom: 1px solid var(--line); font-size: 11px; text-align: left; white-space: nowrap; }
.data-table td { padding: 13px 14px; border-bottom: 1px solid #e7eae8; font-size: 13px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table .actions-cell { width: 132px; text-align: right; white-space: nowrap; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.status-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; }
.status-dot::before { width: 7px; height: 7px; content: ""; background: var(--line-strong); border-radius: 50%; }
.status-dot.active::before { background: var(--income); }
.admin-cards { display: none; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, .85fr) minmax(440px, 1.15fr); }
.auth-side { min-height: 100vh; display: flex; flex-direction: column; justify-content: space-between; padding: 38px 46px; color: #fff; background: var(--forest); border-right: 7px solid #d47750; }
.auth-side-copy { margin: auto 0; }
.auth-side h1 { max-width: 440px; margin-bottom: 15px; font-size: 42px; }
.auth-side p { max-width: 420px; color: #bdcec8; font-size: 16px; }
.auth-side-foot { color: #93aaa3; font-size: 12px; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; background: #f5f7f5; }
.auth-form-wrap { width: min(430px, 100%); }
.auth-form-wrap h2 { margin-bottom: 8px; font-size: 26px; }
.auth-form-wrap > p { margin-bottom: 28px; color: var(--ink-soft); }
.form-stack { display: grid; gap: 18px; }
.form-group { display: grid; gap: 7px; }
.form-group label { font-size: 13px; font-weight: 650; }
.form-control { width: 100%; min-height: 42px; padding: 9px 11px; color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 4px; outline: 0; }
textarea.form-control { min-height: 102px; resize: vertical; }
.form-help { color: var(--ink-soft); font-size: 11px; }
.form-error { min-height: 42px; padding: 10px 12px; color: #7b271f; background: var(--expense-bg); border-left: 3px solid var(--expense); font-size: 13px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 4px; }
.form-actions .btn-primary-wide { min-width: 130px; }
.checkbox-line { display: flex; align-items: flex-start; gap: 9px; color: var(--ink-soft); font-size: 13px; }
.checkbox-line input { margin-top: 4px; accent-color: var(--forest-2); }
.auth-back { display: inline-block; margin-top: 22px; color: var(--forest-2); font-size: 13px; text-decoration: none; }
.setup-environment { margin-bottom: 22px; }
.setup-loading { padding: 14px; color: var(--ink-soft); background: #f7f8f7; border: 1px solid var(--line); border-radius: 4px; font-size: 13px; }
.setup-check-card { display: grid; gap: 13px; padding: 16px; background: #f7f8f7; border: 1px solid var(--line); border-radius: 4px; }
.setup-check-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.setup-check-header h3 { margin: 0 0 3px; font-size: 15px; }
.setup-check-header p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.setup-check-row { min-height: 39px; display: flex; align-items: flex-start; gap: 10px; padding-top: 9px; border-top: 1px solid var(--line); }
.setup-check-icon { width: 19px; height: 19px; display: grid; place-items: center; flex: 0 0 auto; color: #fff; border-radius: 50%; font-size: 12px; font-weight: 800; }
.setup-check-icon.ok { background: var(--income); }
.setup-check-icon.bad { background: var(--expense); }
.setup-check-row strong, .setup-check-row span { display: block; }
.setup-check-row strong { font-size: 12px; }
.setup-check-row span { color: var(--ink-soft); font-size: 11px; overflow-wrap: anywhere; }
.setup-help { padding: 11px 12px; color: #6d461a; background: var(--amber-bg); border-left: 3px solid var(--amber); font-size: 11px; }
.setup-help strong { display: block; margin-bottom: 4px; font-size: 12px; }
.setup-help p { margin: 0 0 6px; }
.setup-help code { display: block; overflow-wrap: anywhere; color: #53340e; }
.setup-schema-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; padding: 12px; background: var(--mint); border: 1px solid #bfd7ca; border-radius: 4px; }
.setup-schema-form .btn { min-height: 42px; }
.setup-security-note { display: grid; gap: 2px; padding-top: 2px; color: var(--ink-soft); font-size: 11px; }
.setup-security-note strong { color: var(--ink); }
.setup-guide { padding-top: 11px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 11px; }
.setup-guide summary { cursor: pointer; color: var(--forest-2); font-weight: 650; }
.setup-guide div { display: grid; gap: 7px; padding-top: 10px; }
.setup-guide p { margin: 0; }
.setup-guide code { color: var(--ink); overflow-wrap: anywhere; }
.setup-variable-list { display: grid; gap: 6px; padding: 10px 0 3px; }
.setup-variable-list > strong { color: var(--ink); font-size: 12px; }
.setup-variable-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 8px; background: #fff; border: 1px solid var(--line); border-radius: 3px; }
.setup-variable-list > div code { font-size: 11px; font-weight: 700; }
.setup-variable-list > div span { color: var(--ink-soft); font-size: 10px; text-align: right; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(7, 18, 16, .72); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: var(--radius); box-shadow: 0 24px 80px rgba(0,0,0,.28); }
.modal-wide { width: min(720px, 100%); }
.modal-header { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 0; font-size: 18px; }
.modal-close { width: 34px; height: 34px; padding: 0; color: var(--ink-soft); background: transparent; border: 0; border-radius: 4px; font-size: 24px; line-height: 1; }
.modal-close:hover { color: var(--ink); background: #eef1ef; }
.modal-body { padding: 20px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 20px; background: #f7f8f7; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; }
.form-grid .full { grid-column: 1 / -1; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; background: #edf0ee; border-radius: 4px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { min-height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 3px; font-size: 13px; font-weight: 650; }
.segmented input:checked + span.income { color: var(--income); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.segmented input:checked + span.expense { color: var(--expense); background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.upload-zone { min-height: 94px; display: grid; place-items: center; padding: 14px; color: var(--ink-soft); background: #f8f9f8; border: 1px dashed var(--line-strong); border-radius: 4px; text-align: center; }
.upload-zone:hover, .upload-zone.dragging { color: var(--forest-2); background: #eef5f1; border-color: var(--forest-2); }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-zone strong { display: block; color: var(--ink); font-size: 13px; }
.upload-preview { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; padding: 9px 11px; background: var(--mint); border-radius: 4px; font-size: 12px; }
.danger-note { padding: 11px 12px; color: #78281f; background: var(--expense-bg); border-left: 3px solid var(--expense); font-size: 13px; }
.backup-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 22px; align-items: start; }
.backup-panel, .backup-notes { padding: 26px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.backup-panel { display: grid; justify-items: start; gap: 20px; }
.backup-panel h2, .backup-notes h3 { margin-bottom: 8px; font-size: 18px; }
.backup-panel p { max-width: 680px; margin-bottom: 0; color: var(--ink-soft); }
.backup-icon { width: 46px; height: 46px; display: grid; place-items: center; color: #fff; background: var(--forest-2); border-radius: 5px; font-size: 25px; font-weight: 700; }
.backup-progress { color: var(--forest-2); font-size: 12px; }
.backup-notes dl { margin: 18px 0 22px; }
.backup-notes dl div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.backup-notes dt { margin-bottom: 3px; color: var(--ink-soft); font-size: 11px; font-weight: 650; }
.backup-notes dd { margin: 0; font-size: 13px; }

.image-viewer { width: min(1000px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; }
.image-viewer-top { min-height: 42px; display: flex; align-items: center; justify-content: space-between; color: #fff; }
.image-viewer-top p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-viewer img { display: block; max-width: 100%; max-height: calc(100vh - 90px); margin: auto; object-fit: contain; background: #111; border-radius: 4px; }
.image-viewer .modal-close { color: #fff; }
.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 8px; }
.toast { min-width: 240px; max-width: 380px; padding: 11px 14px; color: #fff; background: #253631; border-left: 4px solid #79ad97; border-radius: 4px; box-shadow: var(--shadow); font-size: 13px; animation: toast-in .2s ease-out; }
.toast.error { border-left-color: #e27a6c; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } }

@media (max-width: 980px) {
  .public-hero { grid-template-columns: 1fr; gap: 28px; }
  .hero-balance { justify-self: start; min-width: 0; padding-left: 0; border-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .admin-layout { grid-template-columns: 204px minmax(0, 1fr); }
  .data-panel { overflow-x: auto; }
  .data-table { min-width: 850px; }
  .backup-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .public-nav, .page-width, .public-hero { width: min(100% - 24px, 1180px); }
  .public-nav { height: 60px; }
  .public-hero { min-height: 220px; padding: 28px 0 32px; }
  .public-hero h1 { font-size: 30px; }
  .hero-balance strong { font-size: 35px; }
  .summary-strip { grid-template-columns: 1fr 1fr; }
  .summary-cell { min-height: 82px; padding: 16px; }
  .summary-cell:nth-child(2) { border-right: 0; }
  .summary-cell:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .filters { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .field-inline input, .field-inline select { width: 100%; min-width: 0; }
  .field-inline:first-child { grid-column: 1 / -1; }
  .ledger-table { display: none; }
  .mobile-ledger { display: block; }
  .mobile-row { padding: 15px; border-bottom: 1px solid var(--line); }
  .mobile-row:last-child { border-bottom: 0; }
  .mobile-row-top, .mobile-row-bottom { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .mobile-row-title { margin: 10px 0 6px; font-weight: 650; overflow-wrap: anywhere; }
  .mobile-row-bottom { color: var(--ink-soft); font-size: 12px; }
  .mobile-row-balance { font-variant-numeric: tabular-nums; }
  .admin-layout { display: block; }
  .sidebar { position: fixed; z-index: 60; left: 0; width: 236px; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .admin-topbar { min-height: 62px; padding: 0 14px; }
  .menu-toggle { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 4px; }
  .admin-topbar h1 { font-size: 18px; }
  .admin-content { padding: 20px 12px 40px; }
  .work-section-header { align-items: flex-start; }
  .desktop-only { display: none !important; }
  .admin-cards { display: grid; }
  .admin-card { padding: 14px; border-bottom: 1px solid var(--line); }
  .admin-card:last-child { border-bottom: 0; }
  .admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .admin-card h3 { margin: 0; font-size: 15px; }
  .admin-card-body { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 13px 0; color: var(--ink-soft); font-size: 12px; }
  .admin-card-actions { display: flex; justify-content: flex-end; gap: 7px; }
  .auth-shell { display: block; }
  .auth-side { min-height: 210px; padding: 24px; border-right: 0; border-bottom: 5px solid #d47750; }
  .auth-side-copy { margin: 32px 0 15px; }
  .auth-side h1 { margin-bottom: 8px; font-size: 29px; }
  .auth-side p { margin-bottom: 0; font-size: 14px; }
  .auth-side-foot { display: none; }
  .auth-main { min-height: calc(100vh - 210px); padding: 32px 20px; place-items: start center; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .setup-schema-form { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .brand-note { display: none; }
  .nav-action span:first-child { display: none; }
  .filters { grid-template-columns: 1fr; }
  .field-inline:first-child { grid-column: auto; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat { min-height: 92px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stat:nth-child(3) { border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: 0; }
  .modal-backdrop { padding: 8px; }
  .modal { max-height: calc(100vh - 16px); }
  .modal-body { padding: 16px; }
  .work-section-header { flex-direction: column; }
  .work-section-header .btn { width: 100%; }
}
