:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-2: #f5f4f2;
  --border: #e8e6e1;
  --border-strong: #d6d3cc;
  --text: #1a1a1a;
  --text-muted: #6b6660;
  --text-subtle: #9a9590;
  --accent: #1f6f4a;
  --accent-soft: #e3efe8;
  --danger: #a8301a;
  --danger-soft: #f5e5e2;
  --warn: #b5721e;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 2px rgba(20, 18, 14, 0.04);
  --shadow-md: 0 8px 24px rgba(20, 18, 14, 0.08);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  font-feature-settings: "cv11", "ss01", "tnum";
  -webkit-font-smoothing: antialiased;
  height: 100%;
}

body {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

button { font-family: inherit; font-size: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 16px; font-weight: 600; }
h3 { font-size: 13px; font-weight: 600; }

.num { font-variant-numeric: tabular-nums; text-align: right; }
.subtle { color: var(--text-subtle); font-size: 12px; }
.positive { color: var(--accent); }
.negative { color: var(--danger); }
.muted { color: var(--text-muted); }

/* ---------- SIDEBAR ---------- */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 24px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px; }
.privacy-toggle {
  margin-left: auto;
  width: 30px; height: 30px;
  border-radius: var(--radius);
  display: grid; place-items: center;
  color: var(--text-muted);
  transition: all 0.1s;
}
.privacy-toggle:hover { background: var(--surface-2); color: var(--text); }
.privacy-toggle .eye-closed { display: none; }
body.hide-money .privacy-toggle .eye-open { display: none; }
body.hide-money .privacy-toggle .eye-closed { display: block; }
body.hide-money .privacy-toggle { color: var(--text); background: var(--surface-2); }

/* Privacy mode — only blur ACCOUNT BALANCES, not budget numbers or transactions */
body.hide-money .sidebar-account .balance,
body.hide-money .account-card .balance,
body.hide-money .view[data-view="accounts"] .summary-value,
body.hide-money .balance-inline,
body.hide-money #report-networth svg {
  filter: blur(7px);
  transition: filter 0.15s;
  user-select: none;
}
body.hide-money .sidebar-account:hover .balance,
body.hide-money .account-card:hover .balance,
body.hide-money .view[data-view="accounts"] .summary-card:hover .summary-value,
body.hide-money .balance-inline:hover,
body.hide-money #report-networth:hover svg {
  filter: blur(0);
}
.brand-mark {
  width: 28px; height: 28px;
  background: var(--text);
  color: var(--surface);
  border-radius: var(--radius);
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
}
.brand-name { font-weight: 600; letter-spacing: -0.01em; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-weight: 500;
  transition: background 0.1s, color 0.1s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--text); color: var(--surface); }

.sidebar-section { display: flex; flex-direction: column; gap: 6px; }
.sidebar-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  padding: 0 10px;
  font-weight: 600;
}
.sidebar-accounts { display: flex; flex-direction: column; gap: 2px; }
.sidebar-account {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
}
.sidebar-account:hover { background: var(--surface-2); }
.sidebar-account .name { color: var(--text-muted); }
.sidebar-account .balance { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--text); }
.sidebar-add {
  padding: 6px 10px;
  border-radius: var(--radius);
  text-align: left;
  color: var(--text-subtle);
  font-size: 12px;
}
.sidebar-add:hover { background: var(--surface-2); color: var(--text); }

.sidebar-footer {
  margin-top: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ghost {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-muted);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.ghost:hover { background: var(--surface-2); color: var(--text); }
.ghost.danger:hover { color: var(--danger); border-color: var(--danger-soft); background: var(--danger-soft); }

/* ---------- MAIN ---------- */
.main {
  padding: 32px 40px;
  max-width: 1400px;
  width: 100%;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.month-nav { display: flex; align-items: center; gap: 12px; }
.month-nav h1 { min-width: 180px; }

.icon-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius);
  display: grid; place-items: center;
  color: var(--text-muted);
  font-size: 18px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  min-width: 120px;
}
.summary-card.rta { background: var(--text); color: var(--surface); border-color: var(--text); }
.summary-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  margin-bottom: 4px;
  font-weight: 500;
}
.summary-card.rta .summary-label { color: rgba(255,255,255,0.6); }
.summary-value { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

/* ---------- BUTTONS ---------- */
.btn {
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: all 0.1s;
}
.btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.btn.primary { background: var(--text); color: var(--surface); border-color: var(--text); }
.btn.primary:hover { background: #000; }

.budget-toolbar { display: flex; gap: 8px; margin-bottom: 12px; }

/* ---------- BUDGET TABLE ---------- */
.budget-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.budget-head, .budget-row, .budget-group-head {
  display: grid;
  grid-template-columns: 2fr 120px 120px 140px 40px;
  align-items: center;
}
.budget-head {
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  font-weight: 600;
}
.budget-group-head {
  padding: 10px 16px;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 13px;
}
.budget-group-head .name { display: flex; align-items: center; gap: 6px; }
.budget-group-head .chev { color: var(--text-subtle); font-size: 10px; }
.budget-row {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.budget-row:last-child { border-bottom: none; }
.budget-row:hover { background: var(--surface-2); }
.budget-row .cat-name { font-weight: 500; display: flex; align-items: center; gap: 8px; }
.budget-row .cat-goal { font-size: 11px; color: var(--text-subtle); margin-top: 2px; }
.cat-clickable {
  cursor: pointer;
  padding: 2px 6px;
  margin: -2px -6px;
  border-radius: var(--radius);
  transition: background 0.1s;
}
.cat-clickable:hover { background: var(--surface); }
.cat-click-hint {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-subtle);
  padding: 2px 6px;
  background: var(--surface-2);
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.1s;
}
.budget-row:hover .cat-click-hint { opacity: 1; }
.budget-row input.assigned-input {
  width: 100%;
  text-align: right;
  border: 1px solid transparent;
  background: transparent;
  padding: 4px 8px;
  border-radius: var(--radius);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}
.budget-row input.assigned-input:hover { border-color: var(--border); }
.budget-row input.assigned-input:focus { border-color: var(--text); outline: none; background: var(--surface); }
.available-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.available-pill.zero { background: var(--surface-2); color: var(--text-muted); }
.available-pill.pos { background: var(--accent-soft); color: var(--accent); }
.available-pill.neg { background: var(--danger-soft); color: var(--danger); }
.row-actions { display: flex; justify-content: flex-end; opacity: 0; transition: opacity 0.1s; }
.budget-row:hover .row-actions,
.budget-group-head:hover .row-actions { opacity: 1; }

/* ---------- ACCOUNTS ---------- */
.accounts-list { display: flex; flex-direction: column; gap: 10px; }
.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 20px;
  transition: border-color 0.1s;
}
.account-card:hover { border-color: var(--border-strong); }
.account-card .info { display: flex; flex-direction: column; gap: 2px; }
.account-card .name { font-weight: 600; font-size: 15px; }
.account-card .type {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  background: var(--surface-2);
  border-radius: 999px;
  text-transform: capitalize;
  color: var(--text-muted);
  align-self: flex-start;
  margin-top: 4px;
}
.account-card .balance {
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ---------- TRANSACTIONS ---------- */
.tx-actions { display: flex; gap: 8px; align-items: center; }
.tx-actions input[type="search"] {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  width: 260px;
  font-size: 13px;
}
.tx-actions input[type="search"]:focus { outline: none; border-color: var(--text); }

.tx-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.tx-head, .tx-row {
  display: grid;
  grid-template-columns: 70px 1fr 140px 1fr 1fr 110px 110px 30px 40px;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  font-size: 13px;
}
.tx-table.filtered .tx-head,
.tx-table.filtered .tx-row {
  grid-template-columns: 70px 1fr 140px 1fr 110px 110px 130px 30px 40px;
}
.tx-footer {
  background: var(--surface-2) !important;
  border-top: 1px solid var(--border-strong) !important;
  border-bottom: none !important;
}
.tx-head {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  font-weight: 600;
}
.tx-row { border-bottom: 1px solid var(--border); transition: background 0.1s; }
.tx-row:last-child { border-bottom: none; }
.tx-row:hover { background: var(--surface-2); }
.tx-row:hover .row-actions { opacity: 1; }
.tx-row .payee { font-weight: 500; }
.tx-row .cat, .tx-row .acct { color: var(--text-muted); }
.tx-row .memo { color: var(--text-subtle); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cleared-toggle {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  cursor: pointer;
  display: grid; place-items: center;
  font-size: 10px;
  color: transparent;
  transition: all 0.1s;
}
.cleared-toggle.cleared { background: var(--accent); border-color: var(--accent); color: white; }
.row-actions .del-btn {
  color: var(--text-subtle);
  padding: 2px 6px;
  border-radius: var(--radius);
  font-size: 12px;
}
.row-actions .del-btn:hover { color: var(--danger); background: var(--danger-soft); }

/* ---------- REPORTS ---------- */
.report-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 220px;
}
.report-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.report-sub {
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-subtle);
  font-weight: 400;
}
.report-card-wide { grid-column: 1 / -1; }

/* Financial statements (Balance Sheet, Income Statement, Cash Flow) */
.statement { font-size: 13px; }
.statement-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  font-weight: 700;
  margin-top: 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 4px;
}
.statement-section-title:first-child { margin-top: 0; }
.statement-row {
  display: grid;
  grid-template-columns: 1fr 140px;
  padding: 5px 0;
  align-items: baseline;
}
.statement-row .label { color: var(--text); }
.statement-row .label.indent { padding-left: 14px; color: var(--text-muted); }
.statement-row .val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.statement-row.subtotal {
  border-top: 1px solid var(--border);
  font-weight: 600;
  padding-top: 6px;
  margin-top: 4px;
}
.statement-row.total {
  border-top: 2px solid var(--text);
  border-bottom: 2px double var(--text);
  font-weight: 700;
  padding: 8px 0;
  margin-top: 6px;
  font-size: 14px;
}
.statement-row.negative-total { color: var(--danger); }
.statement-row.positive-total { color: var(--accent); }
.statement-empty { color: var(--text-subtle); font-style: italic; padding: 4px 0; font-size: 12px; }

/* Receipt upload zone (transaction modal) */
.form-divider {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  font-weight: 600;
  margin: 18px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.check-label {
  display: flex !important; flex-direction: row !important;
  align-items: center; gap: 8px;
  cursor: pointer;
}
.check-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--text); cursor: pointer; }
.check-label span { font-size: 13px; color: var(--text); font-weight: 500; }

.receipt-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--surface-2);
}
.receipt-zone:hover { border-color: var(--text); background: var(--surface); }
.receipt-zone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.receipt-placeholder { text-align: center; color: var(--text-muted); font-size: 13px; }
.receipt-preview { display: flex; gap: 12px; align-items: center; }
.receipt-preview img {
  width: 80px; height: 80px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.receipt-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.receipt-actions .btn { padding: 5px 10px; font-size: 12px; }

.receipt-viewer img {
  width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
}

/* Tax badges in ledger rows */
.payee { display: flex !important; align-items: center; gap: 6px; flex-wrap: wrap; }
.badge-tag {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 1px 7px;
  background: var(--surface-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  text-transform: lowercase;
}
.badge-receipt {
  font-size: 12px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.1s;
}
.badge-receipt:hover { opacity: 1; }
.tax-other-tags { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }

/* Tag input in transaction modal */
.tag-input-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  background: var(--surface);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  position: relative;
  min-height: 38px;
  cursor: text;
  transition: border-color 0.1s;
}
.tag-input-wrap:focus-within { border-color: var(--text); }
.tag-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 4px 3px 10px;
  background: var(--text);
  color: var(--surface);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.tag-chip .tag-remove {
  background: rgba(255,255,255,0.15);
  color: var(--surface);
  width: 16px; height: 16px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  transition: background 0.1s;
}
.tag-chip .tag-remove:hover { background: rgba(255,255,255,0.3); }
#tag-input {
  flex: 1;
  min-width: 140px;
  border: none;
  background: transparent;
  padding: 3px 6px;
  font-size: 13px;
  outline: none;
}
.tag-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  z-index: 20;
  max-height: 200px;
  overflow-y: auto;
}
.tag-sugg {
  padding: 7px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
}
.tag-sugg:hover { background: var(--surface-2); color: var(--text); }

/* Tax report card */
.inline-select {
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  margin-left: 8px;
  font-variant-numeric: tabular-nums;
}
.tax-summary {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: var(--radius);
  margin-bottom: 12px;
  font-size: 13px;
}
.tax-total { font-weight: 700; font-variant-numeric: tabular-nums; }
.tax-row {
  display: grid;
  grid-template-columns: 60px 1fr 120px 120px;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.tax-row:last-child { border-bottom: none; }
.tax-date { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.tax-payee { }
.tax-note { font-size: 11px; color: var(--text-subtle); margin-top: 2px; font-style: italic; }
.tax-receipt .btn { padding: 4px 10px; font-size: 11px; }
.report-bars { display: flex; flex-direction: column; gap: 8px; }
.report-bar-row { display: grid; grid-template-columns: 140px 1fr 80px; align-items: center; gap: 10px; font-size: 13px; }
.report-bar-row .label { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.report-bar-row .track { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.report-bar-row .fill { height: 100%; background: var(--text); border-radius: 999px; }
.report-bar-row .val { text-align: right; font-variant-numeric: tabular-nums; }

.report-columns { display: flex; align-items: flex-end; gap: 8px; height: 160px; padding-top: 20px; }
.report-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.report-col-bars { display: flex; gap: 2px; flex: 1; align-items: flex-end; width: 100%; justify-content: center; }
.report-col-bars .bar-in { width: 10px; background: var(--accent); border-radius: 2px 2px 0 0; }
.report-col-bars .bar-out { width: 10px; background: var(--danger); border-radius: 2px 2px 0 0; }
.report-col-label { font-size: 10px; color: var(--text-subtle); text-transform: uppercase; letter-spacing: 0.04em; }

.report-sparkline { position: relative; height: 160px; }
.report-sparkline svg { width: 100%; height: 100%; }

.report-big {
  font-size: 56px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px;
  flex-direction: column;
  gap: 4px;
}
.report-big .unit { font-size: 14px; color: var(--text-subtle); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- MODAL ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, 0.4);
  display: grid;
  place-items: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 440px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-body { padding: 20px; overflow-y: auto; }

.form-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-field label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.form-field input, .form-field select, .form-field textarea {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 13px;
  transition: border-color 0.1s;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none;
  border-color: var(--text);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ---------- ACCESS GATE ---------- */
.gate-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, 0.55);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 1000;
}
.gate-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 400px;
  max-width: 90vw;
  padding: 32px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gate-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.gate-mark {
  width: 32px; height: 32px;
  background: var(--text);
  color: var(--surface);
  border-radius: var(--radius);
  display: grid; place-items: center;
  font-weight: 700; font-size: 16px;
}
.gate-name { font-weight: 600; letter-spacing: -0.01em; font-size: 16px; }
.gate-title { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin-top: 4px; }
.gate-sub { color: var(--text-muted); font-size: 13px; line-height: 1.55; margin-bottom: 4px; }
.gate-card input[type="password"] {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.gate-card input[type="password"]:focus { outline: none; border-color: var(--text); }
.gate-err { color: var(--danger); font-size: 12px; margin-top: -4px; }
.gate-actions { display: flex; gap: 8px; margin-top: 4px; }
.gate-actions .btn { flex: 1; padding: 10px; }
.gate-foot { font-size: 12px; color: var(--text-subtle); text-align: center; margin-top: 8px; }
.gate-foot a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.gate-foot a:hover { border-color: var(--text); }

.demo-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--warn);
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}
.demo-banner button {
  background: rgba(255,255,255,0.2);
  color: #fff;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
}
.demo-banner button:hover { background: rgba(255,255,255,0.3); }

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--surface);
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  box-shadow: var(--shadow-md);
  z-index: 200;
  animation: toastIn 0.2s ease-out;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .main { padding: 20px; }
  .report-grid { grid-template-columns: 1fr; }
  .tx-head, .tx-row { grid-template-columns: 80px 1fr 1fr 90px 90px 30px; font-size: 12px; gap: 8px; }
  .tx-head .hide-mobile, .tx-row .hide-mobile { display: none; }
}
