:root {
  --ink: #10262f;
  --muted: #6f8188;
  --line: #dde7e8;
  --canvas: #f4f7f5;
  --card: #ffffff;
  --navy: #0b1f2a;
  --navy-2: #143746;
  --teal: #0c8f85;
  --teal-light: #e2f5f1;
  --orange: #f28b4b;
  --orange-light: #fff1e7;
  --red: #d85f5f;
  --red-light: #fdefef;
  --blue: #3b77d8;
  --blue-light: #eaf1ff;
  --shadow: 0 14px 40px rgba(15, 42, 50, .07);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--canvas);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button, input, select { outline: none; }
button:focus-visible, input:focus-visible, select:focus-visible { box-shadow: 0 0 0 3px rgba(12, 143, 133, .18); }
svg { width: 20px; height: 20px; fill: currentColor; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 238px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 20px 22px;
  background: var(--navy);
  color: #dce9e9;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -150px;
  top: 35%;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(255,255,255,.02), 0 0 0 80px rgba(255,255,255,.018);
  pointer-events: none;
}
.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  text-decoration: none;
  padding: 0 6px 30px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--orange);
  color: var(--navy);
  font-weight: 900;
  letter-spacing: -.04em;
  box-shadow: 0 8px 24px rgba(242, 139, 75, .22);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 17px; letter-spacing: .02em; }
.brand small { margin-top: 3px; font-size: 11px; color: #8eaab2; letter-spacing: .18em; }
.nav { position: relative; display: grid; gap: 7px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 47px;
  padding: 0 13px;
  border: 0;
  border-radius: 12px;
  color: #9eb4ba;
  background: transparent;
  text-align: left;
  transition: .2s ease;
}
.nav-item svg { width: 19px; height: 19px; opacity: .8; }
.nav-item:hover { background: rgba(255,255,255,.05); color: white; }
.nav-item.active { color: white; background: var(--navy-2); box-shadow: inset 3px 0 var(--orange); }
.nav-item.active svg { color: var(--orange); opacity: 1; }
.nav-badge {
  margin-left: auto;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(242,139,75,.17);
  color: #ffc49d;
  font-size: 11px;
  font-weight: 700;
}
.sidebar-foot { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid rgba(255,255,255,.07); }
.sync-note { display: flex; align-items: center; gap: 8px; color: #cfe0df; font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #53d4a8; box-shadow: 0 0 0 5px rgba(83,212,168,.1); }
.sidebar-foot p { margin: 9px 0 0; font-size: 11px; color: #718d95; }

.main { min-width: 0; padding: 30px 34px 46px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 24px; }
.topbar h1 { margin: 4px 0 0; font-size: 28px; letter-spacing: -.04em; }
.eyebrow, .section-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.user-chip {
  height: 42px;
  padding: 0 11px 0 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--ink);
  background: white;
}
.user-chip > span:first-child {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: white;
  background: var(--navy-2);
  font-size: 11px;
  font-weight: 800;
}
.user-chip > span:nth-child(2) { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.user-chip svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.global-search, .search-field {
  height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #8a9a9f;
}
.global-search input, .search-field input { width: 220px; border: 0; background: transparent; color: var(--ink); }
.global-search svg, .search-field svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
kbd { padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; color: #9aabad; background: #f7f9f8; font-size: 10px; }
.btn {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn-primary { color: white; background: var(--teal); box-shadow: 0 9px 22px rgba(12,143,133,.18); }
.btn-primary:hover { background: #087e75; }
.btn-secondary { color: var(--ink); background: white; border: 1px solid var(--line); }
.btn-ghost { color: var(--muted); background: transparent; }
.btn-danger { color: var(--red); background: var(--red-light); }
.btn-small { min-height: 37px; padding: 0 13px; font-size: 13px; }
.text-btn { padding: 6px; color: var(--teal); border: 0; background: none; font-size: 12px; font-weight: 700; }

.page { display: none; }
.page.active { display: block; opacity: 1; transform: none; }
.panel {
  background: var(--card);
  border: 1px solid rgba(221,231,232,.86);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-row { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, .9fr); gap: 18px; }
.hero-card {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  padding: 29px 32px;
  border-radius: 22px;
  color: white;
  background:
    radial-gradient(circle at 76% 18%, rgba(32,181,162,.22), transparent 26%),
    linear-gradient(125deg, #0c2733, #0b1f2a 63%, #143d46);
  box-shadow: 0 18px 45px rgba(11,31,42,.16);
}
.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to right, black, transparent 75%);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 2; }
.hero-card .section-kicker { color: #8ab0b5; }
.hero-number { margin: 12px 0 14px; font-size: clamp(38px, 4.5vw, 58px); font-weight: 800; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.hero-meta { display: flex; align-items: center; gap: 12px; color: #8fabaf; font-size: 12px; }
.trend-pill { padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.08); color: #d8f5ed; }
.trend-pill.down { color: #ffc5ae; }
.hero-visual { position: absolute; z-index: 1; width: 300px; height: 150px; right: 14px; bottom: 14px; opacity: .95; }
.road-line { position: absolute; width: 280px; height: 75px; right: 0; bottom: 10px; border-top: 2px dashed rgba(255,255,255,.15); border-radius: 50%; transform: rotate(-7deg); }
.truck { position: absolute; right: 80px; bottom: 54px; width: 132px; height: 68px; filter: drop-shadow(0 12px 10px rgba(0,0,0,.17)); }
.truck-box { position: absolute; left: 0; top: 9px; width: 88px; height: 45px; border-radius: 7px 4px 4px 4px; background: #e8eeeb; }
.truck-box::after { content: "磊优物流"; position: absolute; left: 10px; top: 14px; color: #1c3944; font-size: 12px; font-weight: 800; letter-spacing: .05em; }
.truck-cab { position: absolute; right: 0; top: 25px; width: 45px; height: 30px; border-radius: 5px 12px 5px 4px; background: var(--orange); }
.truck-cab::after { content: ""; position: absolute; width: 19px; height: 12px; left: 5px; top: 4px; border-radius: 2px; background: #193746; }
.truck i { position: absolute; bottom: 2px; width: 22px; height: 22px; border: 5px solid #19323b; border-radius: 50%; background: #9ca9aa; }
.truck i:nth-of-type(1) { left: 14px; }
.truck i:nth-of-type(2) { right: 15px; }
.route-dot { position: absolute; width: 7px; height: 7px; border: 2px solid var(--orange); border-radius: 50%; box-shadow: 0 0 0 5px rgba(242,139,75,.1); }
.dot-a { right: 230px; bottom: 33px; }
.dot-b { right: 20px; top: 40px; opacity: .4; }

.focus-card { background: white; border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: var(--shadow); }
.focus-head, .panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.focus-head h2, .panel-head h2 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.02em; }
.focus-count { padding: 5px 9px; border-radius: 999px; color: var(--red); background: var(--red-light); font-size: 11px; font-weight: 700; }
.focus-list { display: grid; gap: 8px; margin-top: 18px; }
.focus-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 10px; border-radius: 12px; background: #f7f9f8; }
.focus-item > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; color: var(--teal); background: var(--teal-light); font-size: 12px; font-weight: 800; }
.focus-item strong, .focus-item small { display: block; }
.focus-item strong { font-size: 12px; }
.focus-item small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.focus-item b { color: var(--ink); font-size: 12px; }
.focus-empty { padding: 20px 8px; color: var(--muted); font-size: 12px; text-align: center; }

.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.metric-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.metric-icon { flex: 0 0 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; font-size: 12px; font-weight: 800; }
.metric-card p { margin: 0 0 7px; color: var(--muted); font-size: 11px; }
.metric-card strong { display: block; font-size: 20px; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.metric-card small { display: block; margin-top: 5px; color: #94a1a4; font-size: 10px; }
.metric-card.income .metric-icon { color: var(--teal); background: var(--teal-light); }
.metric-card.expense .metric-icon { color: var(--orange); background: var(--orange-light); }
.metric-card.receivable .metric-icon { color: var(--blue); background: var(--blue-light); }
.metric-card.payable .metric-icon { color: var(--red); background: var(--red-light); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .8fr); gap: 18px; margin-bottom: 18px; }
.dashboard-grid > .panel, .report-grid > .panel { padding: 23px; }
.chart-wrap { min-height: 240px; margin-top: 12px; }
.chart-wrap.tall { min-height: 300px; }
.legend { display: flex; gap: 14px; padding-top: 5px; color: var(--muted); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 8px; height: 8px; border-radius: 3px; }
.legend-income { background: var(--teal); }
.legend-expense { background: var(--orange); }
.bar-chart { width: 100%; height: 244px; overflow: visible; }
.bar-chart text { fill: #96a5a8; font-size: 10px; }
.bar-chart .gridline { stroke: #edf1f0; stroke-width: 1; }
.bar-chart .income-bar { fill: var(--teal); }
.bar-chart .expense-bar { fill: #f5b188; }
.bar-chart .bar-value { fill: #5a6f75; font-size: 9px; opacity: 0; transition: opacity .15s; }
.bar-chart g:hover .bar-value { opacity: 1; }

.donut-layout { display: grid; grid-template-columns: 155px 1fr; gap: 20px; align-items: center; margin-top: 20px; }
.donut { position: relative; width: 155px; height: 155px; border-radius: 50%; background: conic-gradient(#e5eeec 0 100%); }
.donut::after { content: ""; position: absolute; inset: 23px; border-radius: 50%; background: white; }
.donut-center { position: absolute; z-index: 2; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center small { color: var(--muted); font-size: 10px; }
.donut-center strong { display: block; margin-top: 4px; font-size: 18px; }
.category-list { display: grid; gap: 10px; }
.category-item { display: grid; grid-template-columns: 9px 1fr auto; gap: 9px; align-items: center; font-size: 11px; }
.category-item i { width: 8px; height: 8px; border-radius: 3px; }
.category-item span { color: #60757b; }
.category-item strong { font-size: 11px; font-variant-numeric: tabular-nums; }
.category-list.roomy { gap: 15px; margin-top: 20px; }
.category-list.roomy .bar-back { grid-column: 2 / 4; height: 4px; background: #eef3f2; border-radius: 4px; overflow: hidden; }
.category-list.roomy .bar-fill { height: 100%; border-radius: inherit; }

.recent-panel { padding: 23px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { padding: 12px 10px; color: #8c9b9f; font-size: 10px; font-weight: 600; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 13px 10px; border-bottom: 1px solid #edf1f0; color: #43585e; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcfb; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.amount-income { color: var(--teal); font-weight: 700; }
.amount-expense { color: var(--ink); font-weight: 700; }
.table-scroll { overflow-x: auto; }

.toolbar { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 16px; margin-bottom: 16px; }
.segmented { display: inline-flex; gap: 4px; padding: 4px; border-radius: 11px; background: #eef3f2; }
.segmented button { min-height: 33px; padding: 0 12px; color: var(--muted); border: 0; border-radius: 8px; background: transparent; font-size: 11px; font-weight: 700; }
.segmented button.active { color: var(--ink); background: white; box-shadow: 0 3px 10px rgba(16,38,47,.07); }
.toolbar-fields { display: flex; align-items: end; gap: 9px; }
.field, .search-field { display: grid; gap: 6px; }
.field > span { color: var(--muted); font-size: 10px; }
.field input, .field select {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.field.compact { min-width: 128px; }
.search-field { display: flex; height: 40px; }
.search-field input { width: 150px; }
#page-ledger > .panel { padding: 22px; }
.ledger-head { align-items: center; margin-bottom: 12px; }
.ledger-head p, .panel-head > div > p:not(.section-kicker) { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.pill { display: inline-flex; height: 22px; align-items: center; padding: 0 8px; border-radius: 7px; font-size: 10px; font-weight: 700; }
.pill.income { color: var(--teal); background: var(--teal-light); }
.pill.expense { color: var(--orange); background: var(--orange-light); }
.pill.neutral { color: #718287; background: #f0f3f2; }
.cell-title { display: block; font-weight: 600; color: var(--ink); }
.cell-sub { display: block; margin-top: 3px; color: #95a3a6; font-size: 10px; }
.row-actions { display: flex; justify-content: flex-end; gap: 2px; }
.icon-btn { width: 30px; height: 30px; border: 0; border-radius: 8px; display: grid; place-items: center; color: #85969a; background: transparent; }
.icon-btn:hover { background: #eef3f2; color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; }
.empty-state { padding: 56px 20px; text-align: center; }
.empty-icon { width: 54px; height: 54px; margin: auto; display: grid; place-items: center; color: var(--teal); background: var(--teal-light); border-radius: 18px; font-size: 20px; font-weight: 800; }
.empty-state h3 { margin: 14px 0 5px; }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }
.hidden { display: none !important; }

.receivable-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.summary-strip { padding: 18px 20px; border: 1px solid var(--line); border-radius: 15px; background: white; }
.summary-strip span, .summary-strip small { display: block; color: var(--muted); font-size: 11px; }
.summary-strip strong { display: block; margin: 8px 0 5px; font-size: 24px; letter-spacing: -.035em; }
.summary-strip.receivable { border-top: 3px solid var(--blue); }
.summary-strip.payable { border-top: 3px solid var(--red); }
.summary-strip.overdue { border-top: 3px solid var(--orange); }
#page-receivables > .panel { padding: 22px; }
.invoice-tabs { display: flex; gap: 20px; margin: 20px 0 5px; border-bottom: 1px solid var(--line); }
.invoice-tabs button { position: relative; padding: 0 2px 11px; color: var(--muted); border: 0; background: none; font-size: 11px; font-weight: 700; }
.invoice-tabs button.active { color: var(--teal); }
.invoice-tabs button.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--teal); }

.report-controls { display: flex; align-items: center; gap: 24px; padding: 18px 22px; margin-bottom: 16px; }
.report-controls h2 { margin: 5px 0 0; font-size: 18px; }
.report-controls .segmented { margin-left: auto; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(260px, .7fr); gap: 18px; margin-bottom: 18px; }
.report-kpis { display: grid; gap: 11px; margin-top: 18px; }
.report-kpis > div { padding: 13px; border-radius: 12px; background: #f7f9f8; }
.report-kpis span { display: block; color: var(--muted); font-size: 10px; }
.report-kpis strong { display: block; margin-top: 5px; font-size: 18px; }
.rank-list { display: grid; gap: 12px; margin-top: 20px; }
.rank-row { display: grid; grid-template-columns: 24px 1fr auto; gap: 9px; align-items: center; }
.rank-row > b { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); background: #f1f4f3; font-size: 10px; }
.rank-row:first-child > b { color: #a86519; background: #fff1d8; }
.rank-row span { font-size: 12px; }
.rank-row strong { font-size: 12px; }

.settings-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; }
.settings-grid > .panel, .notes-panel { padding: 24px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 20px; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; }
.settings-actions { display: grid; gap: 1px; margin-top: 18px; background: var(--line); border-radius: 13px; overflow: hidden; }
.settings-actions > div { padding: 17px; background: white; }
.settings-actions strong { display: block; font-size: 12px; }
.settings-actions p { margin: 5px 0 12px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.settings-actions .danger-zone { background: #fffafa; }
.account-security { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.account-security-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.account-security-head strong { font-size: 13px; }
.account-security-head p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.security-badge { padding: 5px 9px; border-radius: 20px; color: var(--teal); background: var(--teal-light); font-size: 10px; font-weight: 700; }
.password-form { margin-top: 15px; }
.notes-panel { margin-top: 18px; }
.note-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 20px; }
.note-grid > div { padding: 16px; border-radius: 13px; background: #f7f9f8; }
.note-grid b { color: var(--orange); font-size: 10px; letter-spacing: .12em; }
.note-grid h3 { margin: 12px 0 7px; font-size: 13px; }
.note-grid p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }

.modal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  background: rgba(7, 25, 32, .52);
  backdrop-filter: blur(7px);
}
.modal {
  width: min(610px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 25px;
  border-radius: 22px;
  background: white;
  box-shadow: 0 30px 90px rgba(0,0,0,.26);
  animation: modalIn .22s ease both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2 { margin: 5px 0 0; }
.modal-head .close-modal { font-size: 24px; font-weight: 300; }
.type-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; margin-bottom: 18px; border-radius: 12px; background: #eef3f2; }
.type-switch label { position: relative; }
.type-switch input { position: absolute; opacity: 0; }
.type-switch span { height: 38px; display: grid; place-items: center; border-radius: 9px; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.type-switch input:checked + span { color: var(--ink); background: white; box-shadow: 0 3px 12px rgba(16,38,47,.08); }
.type-switch label:first-child input:checked + span { color: var(--orange); }
.type-switch label:last-child input:checked + span { color: var(--teal); }
.money-input { position: relative; }
.money-input i { position: absolute; left: 11px; top: 10px; color: var(--muted); font-style: normal; font-size: 13px; }
.money-input input { padding-left: 28px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; padding-top: 17px; border-top: 1px solid var(--line); }
.toast {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 24px;
  padding: 11px 16px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  color: white;
  background: var(--navy);
  border-radius: 11px;
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  font-size: 12px;
  transition: .22s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.auth-gate {
  position: fixed;
  z-index: 70;
  inset: 0;
  padding: 22px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 17% 12%, rgba(12,143,133,.18), transparent 32%),
    linear-gradient(145deg, rgba(7,24,31,.97), rgba(12,42,50,.96));
  backdrop-filter: blur(12px);
}
.auth-gate::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.auth-card {
  position: relative;
  width: min(410px, 100%);
  padding: 34px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 24px;
  color: white;
  background: rgba(14,42,51,.86);
  box-shadow: 0 28px 80px rgba(0,0,0,.28);
}
.auth-mark {
  width: 52px;
  height: 52px;
  margin-bottom: 24px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: var(--navy);
  background: var(--orange);
  font-weight: 900;
}
.auth-card .section-kicker { color: #84aaa9; }
.auth-card h2 { margin: 8px 0 12px; font-size: 25px; }
.auth-copy { margin: 0 0 24px; color: #9db7ba; font-size: 13px; line-height: 1.75; }
.auth-form { display: grid; gap: 15px; }
.auth-field { display: grid; gap: 7px; color: #bdd1d1; font-size: 11px; }
.auth-field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  color: white;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 11px;
  background: rgba(255,255,255,.06);
}
.auth-field input::placeholder { color: #6e8b8e; }
.phone-field, .code-field { display: flex; gap: 8px; align-items: center; }
.phone-field i {
  height: 44px;
  padding: 0 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 11px;
  color: #d4e5e3;
  background: rgba(255,255,255,.08);
  font-style: normal;
}
.phone-field input { flex: 1; }
.code-field input { min-width: 0; flex: 1; }
.code-field button {
  flex: 0 0 106px;
  height: 44px;
  border: 1px solid rgba(102,214,198,.28);
  border-radius: 11px;
  color: #8fe0d4;
  background: rgba(12,143,133,.16);
  font-size: 11px;
  font-weight: 700;
}
.code-field button:disabled { color: #6e8b8e; border-color: rgba(255,255,255,.1); background: rgba(255,255,255,.04); cursor: default; }
.auth-main { width: 100%; }
.auth-help { margin: 18px 0 0; color: #718e91; font-size: 10px; line-height: 1.6; text-align: center; }
.sync-note.offline .status-dot { background: var(--orange); box-shadow: 0 0 0 5px rgba(242,139,75,.1); }
.sync-note.saving .status-dot { background: #e2ba52; animation: pulse 1s ease infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.mobile-nav { display: none; }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 205px minmax(0, 1fr); }
  .main { padding: 25px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-row, .dashboard-grid, .report-grid { grid-template-columns: 1fr; }
  .focus-card { min-height: 190px; }
  .settings-grid { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-fields { flex-wrap: wrap; }
}

@media (max-width: 760px) {
  body { padding-bottom: 70px; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main { padding: 18px 15px 28px; }
  .topbar { align-items: flex-start; margin-bottom: 18px; }
  .topbar h1 { font-size: 23px; }
  .topbar-actions .global-search { display: none; }
  .user-chip > span:nth-child(2) { display: none; }
  .btn { padding: 0 13px; }
  .hero-card { min-height: 190px; padding: 24px; }
  .hero-number { font-size: 39px; }
  .hero-visual { width: 190px; opacity: .6; right: -15px; }
  .truck { transform: scale(.75); transform-origin: right bottom; right: 50px; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { padding: 15px; gap: 10px; }
  .metric-icon { flex-basis: 32px; height: 32px; }
  .metric-card strong { font-size: 16px; }
  .dashboard-grid { gap: 12px; }
  .dashboard-grid > .panel, .recent-panel, .settings-grid > .panel, .notes-panel { padding: 18px; }
  .donut-layout { grid-template-columns: 125px 1fr; gap: 12px; }
  .donut { width: 125px; height: 125px; }
  .donut::after { inset: 19px; }
  .receivable-summary { grid-template-columns: 1fr; }
  .toolbar-fields .field, .toolbar-fields .search-field { flex: 1 1 140px; }
  .toolbar-fields .search-field input { width: 100%; }
  .note-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .modal-backdrop { padding: 10px; align-items: end; }
  .modal { max-height: calc(100vh - 20px); border-radius: 20px 20px 12px 12px; padding: 20px; }
  .auth-card { padding: 27px 22px; border-radius: 20px; }
  .mobile-nav {
    position: fixed;
    z-index: 30;
    left: 10px;
    right: 10px;
    bottom: 9px;
    height: 57px;
    padding: 6px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: rgba(11,31,42,.96);
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0,0,0,.25);
    backdrop-filter: blur(12px);
  }
  .mobile-nav button { border: 0; border-radius: 10px; color: #8da7ad; background: none; font-size: 11px; }
  .mobile-nav button.active { color: white; background: rgba(255,255,255,.09); }
}

@media print {
  .sidebar, .topbar-actions, .mobile-nav, .btn, .text-btn { display: none !important; }
  .app-shell { display: block; }
  .main { padding: 0; }
  .page { display: none; }
  .page.active { display: block; }
  .panel, .hero-card { box-shadow: none; }
}
