/* Chanel v2 — minimal luxury: black / ivory / gold, thin lines, generous space */

:root {
  --ink: #0a0a0a;
  --muted: #a8a39d;
  --subtle: #c4beb8;
  --line: #e8e4df;
  --line-strong: #0a0a0a;
  --bg: #faf9f7;
  --card: #ffffff;
  --gold: #b8976a;
  --gold-soft: #f5f0e8;
  --danger: #6b4440;
  --teal: #1a1a1a;
  --teal2: #f5f0e8;
  --red: #6b4440;
  --shadow: none;
  --radius: 2px;
  --radius-lg: 4px;
  --radius-card: 8px;
  --space: 24px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }

.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 20px 100px;
}

/* ── Header ── */
.app-header {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.app-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.brand h1 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink);
}

.brand .brand-sub {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.header-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.sync-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 0;
  background: none;
  border: none;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.sync-badge {
  padding: 0;
  background: none;
  border: none;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Navigation ── */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 32px;
  padding: 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  overflow: auto;
}

.tab {
  padding: 12px 20px;
  margin-bottom: -1px;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  box-shadow: none;
}

.tab.active {
  color: var(--ink);
  font-weight: 600;
  background: none;
  border-bottom: 2px solid var(--ink);
  box-shadow: none;
}

.tab:hover { color: var(--ink); }

/* ── Cards & sections ── */
.view { display: none; }
.view.active { display: block; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: none;
  margin-bottom: var(--space);
}

.view.active .card + .card { margin-top: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 28px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}

.note, .hint { color: var(--subtle); font-size: 12px; line-height: 1.6; }
.badge {
  padding: 0;
  background: none;
  border-radius: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Buttons ── */
.btn {
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.btn:hover {
  background: var(--ink);
  color: #fff;
  transform: none;
  box-shadow: none;
}

.btn.primary {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

.btn.primary:hover { background: #333; border-color: #333; }

.btn.danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--line);
}

.btn.danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.btn.save-success {
  background: var(--gold) !important;
  border-color: var(--gold) !important;
  color: #fff !important;
}

/* ── Forms ── */
.form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 24px;
  min-width: 0;
}

.field { min-width: 0; }

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
}

.field input,
.field select,
.field textarea,
.dashboard-controls select,
.dashboard-controls input[type="date"],
.history-toolbar input[type="month"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--ink);
  box-shadow: none;
}

.field textarea { min-height: 72px; resize: vertical; }
.full { grid-column: 1 / -1; }
.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* ── Store regions (entry) — v2.5 light zoning ── */
.store-region {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 24px;
  padding: 20px 20px 24px 23px !important;
  margin-top: 20px;
  background: #f7f5f2 !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-card) !important;
}

.miami-region {
  border-left: 3px solid #4a4a4a !important;
}

.xinhua-region {
  border-left: 3px solid #8a8078 !important;
}

.overall-region {
  grid-template-columns: 1fr;
  background: #fff !important;
  border-left: 3px solid var(--gold) !important;
}

.store-region > .store-title { grid-column: 1 / -1; }

.store-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0 0 16px;
  padding: 0 0 14px;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none !important;
  color: var(--ink) !important;
  text-transform: none;
}

.store-title-main {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.store-title-sub {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--subtle);
  text-transform: none;
}

.overall-title {
  margin: 0 0 16px;
  padding: 0 0 14px;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none !important;
  color: var(--ink) !important;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.currency-brl label,
.currency-gyd label,
.currency-pix label,
.miami-region .field label,
.xinhua-region .field label,
.miami-region .expense-head h3,
.xinhua-region .expense-head h3 {
  color: var(--subtle) !important;
  font-weight: 500 !important;
}

.currency-brl input,
.currency-gyd input,
.currency-pix input,
.miami-region .field input,
.xinhua-region .field input,
.miami-region .field select,
.xinhua-region .field select {
  border-color: var(--line) !important;
  background: #fff !important;
}

.expense-panel {
  border: 1px solid var(--line) !important;
  border-radius: 6px !important;
  background: #faf8f5 !important;
  padding: 16px !important;
  margin-top: 4px;
}

.miami-region .store-totals .total-box,
.xinhua-region .store-totals .total-box {
  padding: 12px 14px;
  background: #fff !important;
  border: 1px solid var(--line) !important;
  border-radius: 6px !important;
}

.miami-region .store-totals .total-box strong,
.xinhua-region .store-totals .total-box strong {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

.expense-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.expense-head h3 {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--subtle);
}

.expense-row {
  display: grid;
  grid-template-columns: 1.5fr 0.75fr 1fr auto;
  gap: 10px;
  align-items: center;
}

.expense-row select,
.expense-row input {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  background: #fff;
}

.expense-row .remove-expense {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.expense-empty { color: var(--subtle); font-size: 12px; }

.store-totals { grid-column: 1 / -1; }

.total-box {
  padding: 14px 0;
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: none !important;
}

.total-box small {
  display: block;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtle);
}

.total-box strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  grid-column: 1 / -1;
}

.totals .total-box + .total-box { border-left: 1px solid var(--line); padding-left: 20px; }

.net-total strong,
.overall-region .net-total,
.overall-region .net-total small,
.overall-region .net-total strong {
  color: var(--ink) !important;
}

.overall-region .net-total,
.total-box:has(#todayNetTotal) {
  background: none !important;
  border-color: var(--line) !important;
}

.expense-total,
.overall-region .expense-total,
.total-box:has(#todayExpenseGydTotal) {
  background: none !important;
  border-color: var(--line) !important;
}

/* ── Entry callout ── */
.entry-callout {
  display: none;
  margin: 0 0 20px;
  padding: 14px 0;
  border: none;
  border-bottom: 1px solid var(--gold);
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-size: 13px;
}

.entry-callout.show { display: block; }
.entry-callout strong { display: block; margin-bottom: 4px; font-weight: 600; }

/* ── Dashboard ── */
.dashboard-time-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 0 0 16px;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
}

.period-segments { display: flex; gap: 0; }

.period-seg {
  padding: 8px 14px;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.period-seg.active {
  color: var(--ink);
  background: none;
  border-bottom-color: var(--ink);
}

.time-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.time-nav .period-label {
  min-width: 140px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}

.time-nav .btn-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.dashboard-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.dashboard-controls.compact { grid-template-columns: repeat(3, 1fr); }

.dashboard-controls label {
  display: block;
  margin-bottom: 6px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtle);
}

#dashboard .grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-bottom: 0;
}

#dashboard .metric {
  padding: 24px 20px;
  border: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: #fff;
}

#dashboard .metric + .metric { border-left: none; }

#dashboard .metric strong {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink) !important;
}

#dashboard .metric.income strong {
  color: #0a0a0a !important;
}

#dashboard .metric.expense strong {
  color: #6b5048 !important;
}

#dashboard .metric.profit strong {
  color: #a8865a !important;
}

.legend .dot.income { background: #0a0a0a; }
.legend .dot.expense { background: #6b5048; }
.legend .dot.profit { background: #a8865a; }

#dashboard .metric small {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--subtle);
}

#dashboard .metric em { font-size: 11px; color: var(--subtle); }

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}

.metric small { display: block; color: var(--subtle); }
.metric strong { display: block; font-size: 22px; margin-top: 5px; font-weight: 600; color: var(--ink); }
.metric em { font-size: 12px; color: var(--subtle); font-style: normal; }

.report-card { margin-top: 0; }

.legend {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtle);
}

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 0;
  background: var(--ink);
  margin-right: 6px;
  vertical-align: middle;
}

.chart { height: 260px; width: 100%; display: block; }
.chart text { font-size: 11px; fill: var(--subtle); }

/* ── Tables ── */
.table-wrap { overflow: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

.table th,
.table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  font-size: 13px;
}

.table td {
  color: var(--ink);
  font-weight: 500;
}

.table th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subtle);
  background: none;
}

.table tbody tr.store-miami,
.table tbody tr.store-xinhua,
.history-store-row.miami,
.history-store-row.xinhua {
  background: #fff !important;
}

.expense-composition .bar {
  display: inline-block;
  height: 2px;
  border-radius: 0;
  background: var(--gold);
  min-width: 4px;
  vertical-align: middle;
  margin-right: 8px;
}

/* ── History ── */
.history-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.history-store-tabs {
  display: flex;
  gap: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
}

.history-store-tab {
  padding: 8px 16px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.history-store-tab.active {
  color: var(--ink);
  background: none;
  box-shadow: none;
  border-bottom-color: var(--ink);
}

.history-list { display: grid; gap: 12px; }

.history-day {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: #fff;
  overflow: hidden;
}

.history-day.expanded {
  box-shadow: 0 1px 0 rgba(26, 26, 26, 0.04);
}

.history-summary {
  width: 100%;
  display: grid;
  grid-template-columns: 108px 1fr 20px;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  background: #fff;
  text-align: left;
}

.history-summary:hover { background: #faf9f7; opacity: 1; }

.history-date {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.history-sum em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
}

.history-sum.miami strong,
.history-sum.xinhua strong,
.store-label.miami,
.store-label.xinhua {
  color: var(--ink) !important;
  font-weight: 600;
}

.history-exp-tag {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subtle);
  padding: 0;
  background: none;
  border-radius: 0;
}

.history-chevron { color: var(--subtle); font-size: 12px; }

.history-day-body {
  padding: 12px 16px 16px 32px;
  border-top: 1px solid var(--line);
  background: #faf9f7;
}

.history-store-row {
  margin-top: 16px;
  padding: 14px 0 0;
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent !important;
}

.history-store-row h3 {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--subtle);
}

.history-fields {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.history-fields small {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subtle);
}

.history-fields strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.history-store-row.miami { border-left: 2px solid #4a4a4a; padding-left: 12px; margin-left: 0; }
.history-store-row.xinhua { border-left: 2px solid #8a8078; padding-left: 12px; margin-left: 0; }

.history-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.history-detail-actions .btn.danger {
  background: transparent;
  border: none;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 10px 4px;
}

.history-detail-actions .btn.danger:hover {
  background: transparent;
  color: var(--danger);
}

.expense-detail {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.expense-detail h4 {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--subtle);
}

.expense-detail ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.expense-detail li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.expense-detail li span { color: var(--subtle); font-weight: 400; }

/* ── Settings ── */
.rate-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* ── Auth ── */
#authGate {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--bg);
}

#authGate.hidden { display: none; }

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 40px 32px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.auth-card .sub { color: var(--muted); font-size: 13px; margin: 0 0 24px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card .form-footer { justify-content: stretch; border: none; padding: 0; margin: 0; }
.auth-card .form-footer .btn { width: 100%; }

.auth-error {
  display: none;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--danger);
  font-size: 13px;
}

.auth-error.show { display: block; }
.auth-error a { color: inherit; word-break: break-all; }

#appShell.locked { display: none; }

/* ── Data menu ── */
.data-menu { position: relative; }

.data-menu-panel {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 160px;
  padding: 4px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: none;
  z-index: 20;
}

.data-menu.open .data-menu-panel { display: grid; gap: 0; }
.data-menu-panel .btn {
  width: 100%;
  text-align: left;
  border: none;
  border-radius: 0;
}

.data-menu-panel .btn:hover { background: var(--bg); color: var(--ink); }

/* ── Misc ── */
.num { font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 13px; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 20px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius);
  font-size: 12px;
  letter-spacing: 0.04em;
  display: none;
  z-index: 100;
  box-shadow: none;
}

.toast.show { display: block; }

.dashboard-hidden { display: none !important; }

#dashboardPeriodNote { margin-bottom: 20px; }

.bar-list { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 65px 1fr 75px; gap: 8px; align-items: center; font-size: 13px; }
.bar { height: 2px; background: var(--line); border-radius: 0; overflow: hidden; }
.bar i { height: 100%; display: block; background: var(--ink); border-radius: 0; }

.warning { background: #fff; border: 1px solid var(--line); }
.warning strong { color: var(--ink); }

.brand p:not(.user-chip) { display: none !important; }

.date-field { min-width: 0; }

.date-input-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.date-input-wrap input[type="date"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
  -webkit-appearance: none;
  appearance: none;
}

.date-display {
  display: block;
  width: 100%;
  padding: 11px 36px 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.date-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--subtle);
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
  z-index: 1;
}

/* ── Bottom nav (mobile) ── */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: #fff;
  border-top: 1px solid var(--line);
  padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
}

.bottom-nav button, .bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
}

.bottom-nav button.active { color: var(--ink); }
.bottom-nav .nav-icon { font-size: 16px; line-height: 1; }

@media (max-width: 720px) {
  .app { padding: 20px 16px 96px; }
  .app-header-top { flex-direction: column; }
  .header-actions { width: 100%; justify-content: flex-start; }
  .tabs.desktop-tabs { display: none; }
  .bottom-nav { display: flex; }
  .form { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
  .store-region { grid-template-columns: 1fr; }
  .totals { grid-template-columns: 1fr; }
  .totals .total-box + .total-box { border-left: none; padding-left: 0; }
  .expense-row { grid-template-columns: 1fr 1fr; }
  .expense-row .remove-expense { grid-column: 1 / -1; }
  #dashboard .grid { grid-template-columns: 1fr; }
  #dashboard .metric + .metric { border-left: 1px solid var(--line); border-top: none; }
  .dashboard-controls,
  .dashboard-controls.compact { grid-template-columns: 1fr; }
  .history-fields { grid-template-columns: repeat(2, 1fr); }
  .history-summary { grid-template-columns: 1fr 20px; }
  .history-date { grid-column: 1 / -1; }
  .history-summary-main { grid-column: 1; }
  .time-nav { width: 100%; margin-left: 0; justify-content: space-between; }
  .card { padding: 20px 16px; }
  .data-menu-panel { left: 0; right: auto; }
}

@media (min-width: 721px) {
  .bottom-nav { display: none !important; }
}
