/* Điểm Dừng Thu Chi — dashboard sáng (Sapo-like). 2026-08-31
   Rollback mint: style.mintb2-backup.css · Rollback glass: style.glass-backup.css */
:root {
  --bg: #f3f4f6;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #0d8f56;
  --accent-2: #22c55e;
  --accent-soft: #e6f7ee;
  --accent-ink: #ffffff;
  --danger: #ef4444;
  --ok: #12b76a;
  --warn: #f79009;
  --bg-glass: #ffffff;
  --border-glass: #e5e7eb;
  --color-ok: #12b76a;
  --color-bad: #f04438;
  --shadow: 0 4px 12px rgba(17, 24, 39, 0.05);
  --shadow-card: 0 1px 2px rgba(17, 24, 39, 0.04), 0 8px 24px rgba(17, 24, 39, 0.04);
  --radius: 16px;
  --nav-h: 64px;
  --blur: 12px;
  --safe-top: env(safe-area-inset-top, 0px);
  font-family: "Be Vietnam Pro", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  color-scheme: light;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
}

/* —— Desktop / Tablet frame —— */
@media (min-width: 520px) {
  html {
    background: #e9ecf2;
  }
  body {
    margin: 16px auto 0;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 16px 40px rgba(17, 24, 39, 0.1), 0 0 0 1px rgba(17, 24, 39, 0.04);
    min-height: calc(100vh - 16px);
    background: var(--bg);
  }
  .nav-dock {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    box-shadow: 0 -4px 16px rgba(17, 24, 39, 0.04);
  }
  .dash-top {
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
  }
  .modal-backdrop {
    align-items: center;
    padding: 24px;
  }
  .modal {
    border-radius: 20px;
    box-shadow: 0 20px 48px rgba(17, 24, 39, 0.2);
  }
  html[data-theme="national_day"] .theme-nd-strip {
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
  }
}
a, button, summary, .chart-hit { touch-action: manipulation; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

.card,
.glass {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}

.wrap { padding: 0 16px 16px; }

/* —— Header greeting —— */
.app-header,
.dash-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(12px + var(--safe-top)) 16px 8px;
  background: var(--bg);
}
@supports (padding-top: constant(safe-area-inset-top)) {
  :root { --safe-top: constant(safe-area-inset-top, 0px); }
}
.dash-hello {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.dash-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex: 0 0 auto;
  object-fit: contain;
  background: #e7f9ee;
  box-shadow: 0 1px 2px rgba(13, 143, 86, 0.12);
}
.dash-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background: #e7f9ee;
  color: #0d8f56;
  font-weight: 800;
  font-size: 18px;
}
.dash-hello-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: visible;
}
.dash-hi {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: #757575;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-brand {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.03em;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-brand:has(.theme-nd-brand-flag) { overflow: visible; }
.theme-nd-brand-flag {
  display: inline-flex;
  width: 18px;
  height: 12px;
  margin-left: 4px;
  vertical-align: -1px;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.08);
  overflow: hidden;
}
.theme-nd-brand-flag svg { display: block; width: 18px; height: 12px; }
.dash-shop {
  margin: 0;
  position: relative;
  z-index: 50;
  overflow: visible;
  font-size: 17px;
  color: #111827;
  font-weight: 800;
}
.dash-shop[open] { z-index: 60; }
.dash-shop summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
  font-size: 17px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.dash-shop summary .dash-brand {
  min-width: 0;
}
.dash-shop summary::-webkit-details-marker,
.dash-shop summary::marker { display: none; }
.bell {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  color: #374151;
  flex: 0 0 auto;
  list-style: none;
  cursor: pointer;
}
.bell::-webkit-details-marker,
.bell::marker { display: none; }
.bell svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.bell .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: #ef4444;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.userbar-menu { position: relative; z-index: 20; }
.userbar-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 168px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-card);
  display: grid;
  gap: 2px;
}
.userbar-menu-panel a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
}
.coso-picker-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-card);
  z-index: 40;
  display: grid;
}
.coso-picker-item {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
}
.coso-picker-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* —— Segmented period —— */
.dash-seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin: 4px 16px 14px;
  border-radius: 999px;
  background: #e8eaef;
}
.dash-seg-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #6b7280;
  white-space: nowrap;
}
.dash-seg-item.is-on {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.08);
}

/* —— Hero —— */
.dash-hero {
  position: relative;
  overflow: hidden;
  padding: 16px 16px 18px;
  margin-bottom: 10px;
  border-radius: 18px;
  border: 0;
  color: #fff;
  background:
    radial-gradient(420px 180px at 100% 0%, rgba(255,255,255,0.18), transparent 55%),
    linear-gradient(135deg, #34d399 0%, #0d8f56 55%, #047857 100%);
  box-shadow: 0 10px 24px rgba(13, 143, 86, 0.28);
}
.dash-hero.is-centered {
  text-align: center;
}
.dash-hero.is-centered .dash-hero-top {
  justify-content: center;
}
.dash-hero.is-centered .dash-hero-date,
.dash-hero.is-centered .dash-hero-date-pick {
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}
.dash-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
}
.dash-hero-top a { color: rgba(255,255,255,0.9); font-weight: 600; font-size: 13px; }
.dash-hero-date {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: rgba(255,255,255,0.82);
}
.dash-hero-date-pick {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s ease;
}
.dash-hero-date-pick:hover,
.dash-hero-date-pick:active {
  background: rgba(255, 255, 255, 0.28);
}
.dash-hero-date .bcd-month-form {
  display: inline-flex;
  margin: 0;
  padding: 0;
}
.dash-hero-date .dash-hero-date-pick {
  margin-top: 0;
  min-height: 32px;
  padding: 4px 2px;
}
.dash-hero-date-caret {
  font-size: 9px;
  opacity: 0.85;
}
.dash-hero-month {
  position: absolute;
  inset: 0;
  opacity: 0.01;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border: 0;
  font-size: 16px;
  background: transparent;
  color: transparent;
}
button.dash-hero-date-pick {
  font: inherit;
  color: inherit;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.period-sheet { padding: 16px 14px 14px; }
.period-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.period-chip,
.period-custom-btn {
  min-height: 44px;
  padding: 10px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  color: #111827;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.period-chip.is-on,
.period-custom-btn.is-on {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.period-custom-btn {
  width: 100%;
  margin-top: 10px;
}
.period-custom-wrap {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.period-custom-wrap.is-open { display: grid; }
.period-apply { margin-top: 12px; }
.more-list {
  display: grid;
  gap: 10px;
}
.more-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-card);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.more-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.more-copy strong { font-size: 15px; font-weight: 800; }
.more-copy span { font-size: 12px; color: var(--muted); font-weight: 600; }
.more-go { color: #9aa3af; font-size: 22px; line-height: 1; }
.trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.trend.down { background: #fee4e2; color: #d92d20; }
.trend.up { background: #d1fadf; color: #067647; }
.dash-hero .trend.down { background: rgba(254, 228, 226, 0.95); }
.dash-hero .trend.up { background: rgba(209, 250, 223, 0.95); }
.dash-hero-value {
  margin-top: 10px;
  font-size: clamp(24px, 8.2vw, 30px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.dash-hero-sub {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.82);
}

/* legacy aliases */
.hero-profit { /* unused in new snapshots; keep readable if mixed */ }
.hero-profit-value { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* —— Metric tiles —— */
.metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.metric-grid-3 { grid-template-columns: 1fr 1fr; }
.metric-tile {
  min-height: 88px;
  min-width: 0;
  padding: 14px;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}
.metric-tile.span-2 {
  grid-column: 1 / -1;
  align-items: center;
  text-align: center;
}
.metric-tile.span-2 .metric-k { justify-content: center; }
.metric-k {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.metric-v {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.metric-tile.tone-ok .metric-v { color: var(--color-ok); }
.metric-tile.tone-bad .metric-v { color: var(--color-bad); }
.metric-ico {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
}

/* —— Chart card —— */
.chart-card {
  margin-left: -16px;
  margin-right: -16px;
  padding: 12px 0 6px;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  overflow-x: hidden;
}
.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  margin-bottom: 4px;
  padding: 0 12px;
}
.chart-cmp {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  width: 100%;
  min-width: 0;
}
.chart-cmp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-height: 36px;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  min-width: 0;
}
.chart-cmp-btn.is-on {
  border-color: var(--accent);
  background: #ecfdf5;
  color: var(--accent);
}
.chart-legend {
  display: flex;
  gap: 14px;
  padding: 0;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.chart-legend i {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 99px;
  margin-right: 6px;
  vertical-align: middle;
}
.chart-legend .now i { background: var(--accent); }
.chart-legend .prev i {
  background: repeating-linear-gradient(90deg, #f79009 0 6px, transparent 6px 10px);
}
.chart-range {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 2px 10px 6px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
}
.chart-range-sep { color: #6b7280; font-weight: 700; }
.chart-svg {
  width: 100%;
  height: auto;
  aspect-ratio: 360 / 220;
  display: block;
}
.chart-plot {
  position: relative;
}
.chart-hits {
  position: absolute;
  top: 9%;
  bottom: 13%;
  display: flex;
  z-index: 1;
}
.chart-hit {
  flex: 1 1 0;
  min-width: 0;
  margin: 0 -6px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  z-index: 1;
}
.chart-hit.is-on { z-index: 2; }
.chart-tip {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, calc(-100% - 10px));
  min-width: 176px;
  max-width: min(240px, calc(100% - 16px));
  padding: 10px 12px 12px;
  border-radius: 12px;
  background: #2b2f36;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.28);
  pointer-events: none;
}
.chart-tip::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: #2b2f36;
}
.chart-tip-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  background: #0b3d2e;
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
}
.chart-tip-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
}
.chart-tip-time {
  margin: 8px 0 6px;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 500;
}
.chart-tip-kv {
  color: #fff;
  font-size: 12px;
  font-weight: 500;
}
.chart-tip-kv b {
  font-weight: 800;
}

/* —— Quick actions —— */
.dash-actions-head,
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 8px 2px 10px;
  font-size: 15px;
  font-weight: 800;
}
.section-head span,
.dash-actions-head span { font-size: 12px; font-weight: 600; color: var(--muted); }
.dash-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.dash-actions.cols-3 { grid-template-columns: repeat(3, 1fr); }
.dash-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: #374151;
  text-align: center;
}
.dash-action-ico {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}
.ico-a { background: #0d8f56; }
.ico-b { background: #22c55e; }
.ico-c { background: #0d8f56; }
.ico-d { background: #12b76a; }
.ico-e { background: #0d8f56; }
.dash-action-ico svg { width: 22px; height: 22px; stroke: #fff; fill: none; stroke-width: 1.8; }

/* —— Warn / status rows —— */
.warn-banner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 1px solid #f7d7a1;
  background: linear-gradient(90deg, #fff7ed, #fffbeb);
  color: #92400e;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  cursor: pointer;
  font: inherit;
}
.warn-title { display: block; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: #b54708; }
.warn-text { font-weight: 700; font-size: 13px; color: var(--ink); }
.warn-action { flex: 0 0 auto; font-size: 12px; font-weight: 800; color: var(--accent); white-space: nowrap; }

.status-list { display: grid; gap: 8px; margin-bottom: 12px; }
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px;
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.status-row .k { font-weight: 700; font-size: 14px; }
.status-row .n {
  font-weight: 800;
  font-size: 16px;
  color: var(--accent);
}

/* —— Ratio / progress rows —— */
.ratio-list { display: grid; gap: 8px; }
.ratio-row {
  display: grid;
  gap: 8px;
  padding: 14px;
  margin: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.ratio-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.ratio-name { font-size: 14px; font-weight: 700; }
.ratio-amt { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ratio-track {
  height: 6px;
  border-radius: 99px;
  background: #eef2f6;
  overflow: hidden;
}
.ratio-fill { height: 100%; width: var(--ratio, 0%); border-radius: inherit; background: var(--muted); }
.ratio-row.is-thu .ratio-amt { color: var(--color-ok); }
.ratio-row.is-thu .ratio-fill { background: var(--color-ok); }
.ratio-row.is-chi .ratio-amt { color: var(--color-bad); }
.ratio-row.is-chi .ratio-fill { background: var(--color-bad); }
.pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  margin-right: 6px;
}
.pill.thu { color: var(--color-ok); background: #e7f8ef; }
.pill.chi { color: var(--color-bad); background: #feecec; }

/* —— Day list —— */
.day-list { display: flex; flex-direction: column; gap: 8px; }
.day-row {
  display: grid;
  gap: 8px;
  padding: 14px;
  margin: 0;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
}
.day-row-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.day-left { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.day-tag {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  color: #b54708;
  background: #fef0c7;
}
.day-tag.on { color: var(--accent); background: var(--accent-soft); }
.day-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.day-right .ok, .ok { color: var(--color-ok); }
.day-right .bad, .bad { color: var(--color-bad); }
.day-right .muted { color: var(--muted); font-weight: 500; }
.day-row .ratio-fill { background: var(--accent); }
.day-row.empty-day .ratio-fill { background: transparent; }
.day-row.active { border-color: #a7e6c4; box-shadow: 0 0 0 3px var(--accent-soft); }

.row-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.row-item:last-child { border-bottom: 0; }
.row-item .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.row-item .v { font-weight: 800; font-variant-numeric: tabular-nums; }

.stat {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.stat:last-child { border-bottom: 0; }
.stat .k { color: var(--muted); font-size: 14px; }
.stat .v { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }

.view-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.view-head .meta { color: var(--muted); font-size: 13px; margin-top: 2px; }
.view-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-capture, .btn-edit {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}
.btn-edit { background: var(--accent); color: #fff; border-color: transparent; }

.formula-note, .hint, .empty {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  margin: 8px 0;
  line-height: 1.45;
}

.btn {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: #fff; border: 1px solid var(--line); }
.btn + .btn { margin-top: 10px; }

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  font-size: 16px;
  color: var(--ink);
}
.field { margin-bottom: 12px; }
.field.tight { margin-bottom: 0; }
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }

.day-filter {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

/* —— Bottom nav (Modern 5-item floating dock) —— */
.nav-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: min(500px, 100%);
  margin: 0 auto;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding: 4px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;
  background: rgba(255, 255, 255, 0.95);
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 100;
}
.nav-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s ease;
}
.nav-side svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.15s ease;
}
.nav-side.is-on {
  color: var(--accent);
}
.nav-side.is-on svg {
  stroke: var(--accent);
  transform: scale(1.08);
}
.nav-ico-wrap {
  width: 36px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  transition: background 0.15s ease;
}
.nav-side.is-on .nav-ico-wrap {
  background: var(--accent-soft);
}
.nav-fab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  text-decoration: none;
}
.nav-fab span {
  width: 38px;
  height: 38px;
  margin-top: -14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-size: 24px;
  font-weight: 300;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
  border: 2px solid #fff;
  transition: transform 0.15s ease;
}
.nav-fab:active span {
  transform: scale(0.92);
}
.nav-dock > .userbar-menu {
  display: flex;
  align-items: stretch;
  position: relative;
}
.nav-dock > .userbar-menu > summary {
  width: 100%;
  list-style: none;
  cursor: pointer;
}
.nav-dock > .userbar-menu > summary::-webkit-details-marker,
.nav-dock > .userbar-menu > summary::marker { display: none; }
.nav-dock > .userbar-menu .userbar-menu-panel {
  top: auto;
  bottom: calc(100% + 10px);
  right: 8px;
}

.nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: min(480px, 100%);
  margin: 0 auto;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,0.94);
  border-top: 1px solid var(--line);
  z-index: 90;
  pointer-events: none;
}
.nav-track {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.nav-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px;
  border-radius: 12px;
  color: #9aa3af;
  font-weight: 700;
  font-size: 12px;
}
.nav-tab.active, .nav-tab.is-on {
  color: var(--accent);
  background: var(--accent-soft);
}
.nav-copy { display: flex; flex-direction: column; align-items: center; gap: 2px; }

.line-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content minmax(0, 8rem);
  column-gap: 6px;
  row-gap: 4px;
  margin-bottom: 6px;
  padding: 0 36px 0 0;
  border: none;
  border-radius: 0;
  background: transparent;
  min-width: 0;
  max-width: 100%;
}
.line-row .line-main, .line-row .line-meta { display: contents; }
.line-main .nd, .line-row select.hm,
.line-row .nd {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 44px;
  padding: 10px;
  font: inherit;
  font-size: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.line-main .st, .line-row .st {
  height: 44px;
  padding: 10px;
  font-size: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.line-main .nd, .line-row .nd {
  grid-column: 1;
  display: block;
  width: 100%;
  min-width: 0;
  resize: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 20px;
  padding-top: 8px;
  padding-bottom: 8px;
  align-self: start;
}
.line-main .st, .hm-field {
  align-self: start;
}
.line-main .st {
  grid-column: 2;
  width: var(--st-w, 5.5rem);
  min-width: 4.5rem;
  max-width: 100%;
  box-sizing: border-box;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  overflow: hidden;
}
.hm-field { grid-column: 3; min-width: 0; }
.line-row .nd:focus,
.line-row .st:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}
.line-row.is-st-grow {
  grid-template-columns: minmax(0, 1fr) minmax(0, 8rem);
}
.line-row.is-st-grow .st {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  white-space: nowrap;
}
.line-row.is-st-grow .nd { grid-column: 1; }
.line-row.is-st-grow .hm-field { grid-column: 2; }
.btn-x {
  position: absolute; top: 6px; right: 0;
  width: 32px; height: 32px; padding: 0;
  border: none;
  background: transparent; border-radius: 8px;
  color: var(--color-bad); cursor: pointer;
  font-size: 18px; line-height: 1;
}
.btn-add {
  width: 100%;
  border: 1px dashed var(--line);
  background: transparent;
  border-radius: 10px;
  padding: 10px;
  color: var(--accent);
  font-weight: 650;
  cursor: pointer;
}
.thu-simple .thu-amount {
  font-size: 22px;
  font-weight: 400;
  color: var(--color-ok);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(17,24,39,0.45);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
}
.modal-backdrop[hidden] { display: none !important; }
.modal {
  width: min(480px, 100%);
  max-height: min(80vh, calc(100% - env(safe-area-inset-top, 0px) - 24px));
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px 16px 12px 12px;
  padding: 14px;
  -webkit-overflow-scrolling: touch;
}
.login-body { padding-bottom: 32px; background: var(--bg); }
.login-body .app-header { background: transparent; }
.app-brand { margin: 0; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--accent); }
.app-title { margin: 2px 0 0; font-size: 22px; font-weight: 800; }
.brand { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
h1 { margin: 8px 0 0; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.block-loai { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.block-loai.thu .block-head strong { color: var(--color-ok); }
.block-loai.chi .block-head strong { color: var(--color-bad); }
.co-dinh-summary { cursor: pointer; font-weight: 700; }
.danger-zone { border-color: #fecdca; }
.btn-danger-ghost { background: transparent; border: 1px solid #fecdca; color: var(--color-bad); }
.thumb-bar { display: none; }

button.dash-action {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.dash-action.btn-capture,
.dash-action.btn-edit {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  min-height: 0;
}
.period-pick { padding: 12px 14px; }
.page-back { margin-bottom: 12px; }
.dash-hero.is-bad {
  background: linear-gradient(135deg, #fb7185 0%, #ef4444 55%, #dc2626 100%);
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.25);
}
.meta { color: var(--muted); font-size: 13px; margin: 4px 0 8px; }
.banner {
  background: #ecfdf3;
  color: #067647;
  border: 1px solid #abefc6;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}
.banner.err {
  background: #fef3f2;
  color: #b42318;
  border-color: #fecdca;
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-close {
  border: 0; background: transparent; font-size: 28px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 0 4px;
}
.modal-sub { margin: 6px 0 12px; color: var(--muted); font-size: 14px; }
.export-choice { display: grid; gap: 10px; }
.export-choice .btn { text-decoration: none; text-align: center; }
.missing-list { display: grid; gap: 8px; }
.missing-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-weight: 650;
}
.missing-go { color: var(--accent); font-size: 13px; font-weight: 700; }
.day-shot {
  background: transparent;
}
.day-shot.is-capturing {
  padding: 12px;
  background: #ffffff;
  border-radius: var(--radius);
}
.day-shot.is-capturing .dash-hero {
  margin-bottom: 12px;
}
.day-shot-note {
  margin-top: 10px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--accent-soft); color: var(--ink); font-size: 15px; font-weight: 700;
}
.day-shot.is-capturing .day-shot-note {
  display: block !important;
}
.co-dinh-summary {
  display: flex; align-items: center; justify-content: space-between;
  list-style: none; cursor: pointer; font-weight: 700;
}
.co-dinh-summary::-webkit-details-marker, .co-dinh-summary::marker { display: none; }
.co-dinh-detail { margin-top: 10px; padding-top: 4px; border-top: 1px dashed var(--line); }
.hm-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.hm-item {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 12px 10px; border-radius: 12px; border: 1px solid var(--line); background: #f8fafc;
}
.hm-left { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hm-note { color: var(--muted); font-size: 13px; line-height: 1.35; word-break: break-word; }
.hm-item .v { font-weight: 800; font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bcd-meta { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.bcd-meta strong { color: var(--ink); font-weight: 700; }
.bcd-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.bcd-table th, .bcd-table td {
  padding: 10px 4px; border-bottom: 1px solid var(--line); text-align: left;
}
.bcd-table th { color: var(--muted); font-weight: 600; font-size: 12px; }
.bcd-table .num { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bcd-table tfoot td { border-bottom: 0; padding-top: 12px; }
.bcd-table .bcd-total td { font-weight: 800; }
.thu-simple { display: flex; flex-direction: column; gap: 6px; padding: 4px 0 2px; }
.thu-amount-label { font-size: 13px; font-weight: 500; color: var(--muted); margin: 0; }
.install-url {
  margin: 8px 0 4px; padding: 12px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; word-break: break-all;
}
.install-steps { margin: 8px 0 0; padding-left: 20px; font-size: 15px; line-height: 1.55; }
.install-steps li { margin-bottom: 8px; }
.install-cta { display: grid; gap: 8px; }
.install-cta .btn { width: 100%; }
.install-status { margin: 0; }
.install-fallback { margin-top: 12px; color: var(--muted); font-size: 14px; }
.install-fallback summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.login-body .install-cta { margin-top: 12px; }
.install-coach {
  position: fixed; inset: 0; z-index: 240;
  background: rgba(17,24,39,0.45);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
}
.install-coach[hidden] { display: none !important; }
.install-coach-card {
  width: min(480px, 100%);
  background: #fff; border-radius: 16px; padding: 16px;
  box-shadow: var(--shadow-card);
}
.install-coach-card h2 { margin: 0 0 8px; font-size: 18px; }
.install-coach-card ol { margin: 0 0 12px; padding-left: 20px; font-size: 15px; line-height: 1.5; }
.install-coach-card .btn { width: 100%; margin-top: 8px; }
.install-ios-hint { display: none; margin: 0; }
html.is-ios .install-ios-hint { display: block; }
.install-sub-ios { display: none; }
html.is-ios .install-sub-android { display: none; }
html.is-ios .install-sub-ios { display: inline; }
html.is-standalone .install-ios-hint { display: none; }
html.is-standalone [data-install-app] { display: none; }
.install-ios {
  position: fixed; inset: 0; z-index: 260;
  background: rgba(17,24,39,0.4);
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end;
  padding: 16px 16px calc(10px + env(safe-area-inset-bottom, 0px));
}
.install-ios[hidden] { display: none !important; }
.install-ios-card {
  width: min(400px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 18px 16px 14px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.install-ios-share { color: #0d8f56; margin-bottom: 8px; }
.install-ios-card p { margin: 0 0 8px; font-size: 15px; line-height: 1.45; color: var(--ink); }
.install-ios-card .btn { width: 100%; margin-top: 6px; }
.install-ios-arrow {
  width: 0; height: 0; margin: 10px auto 4px;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 16px solid #fff;
}
.danger-hint { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.user-admin-list { display: grid; gap: 8px; }
.user-admin-row {
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 0; border-top: 1px solid var(--line);
}
.user-admin-row:first-child { border-top: 0; padding-top: 0; }
.user-admin-info .meta { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.4; }
.btn-edit-sm { padding: 10px 14px; font-size: 13px; align-self: flex-start; min-height: 44px; }
.role-help { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.role-help b { color: var(--ink); }
.field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; color: var(--ink); }
.coso-perm-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.coso-perm-list { display: grid; }
.coso-perm-row { display: grid; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); }
.coso-perm-row:last-child { border-bottom: 0; }
.coso-perm-name { font-size: 14px; font-weight: 600; }
.coso-perm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.coso-perm-check {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: #f8fafc; font-size: 13px; font-weight: 600; cursor: pointer;
}
.coso-perm-check input { width: 20px; height: 20px; accent-color: var(--accent); }
.coso-perm-list.role-co-dong .col-ql { opacity: 0.45; }
.user-admin-info .coso-meta .err { color: var(--color-bad); }
.hm-label {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0);
}
.line-row select.hm {
  appearance: none; -webkit-appearance: none;
  padding-right: 1.5rem;
}
.btn-x.ghost { visibility: hidden; }
.btn-add { min-height: 44px; }
code { font-size: 13px; background: #f3f4f6; padding: 1px 6px; border-radius: 6px; }

@media (max-width: 430px) {
  .chart-cmp-btn { font-size: 10px; padding: 6px 2px; }
  .chart-range { font-size: 9.5px; gap: 4px; margin-left: 8px; margin-right: 8px; }
}
@media (max-width: 380px) {
  .line-row.is-st-grow {
    grid-template-columns: minmax(0, 1fr);
  }
  .line-row.is-st-grow .nd,
  .line-row.is-st-grow .hm-field {
    grid-column: 1;
  }
  .dash-hero-value { font-size: 24px; }
}

/* —— Theme picker (Cài đặt) —— */
.theme-pick { display: grid; gap: 8px; margin-top: 12px; }
.theme-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.theme-option.is-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: var(--accent-soft);
}
.theme-swatch {
  width: 28px;
  height: 20px;
  border-radius: 6px;
  flex: 0 0 auto;
}
.theme-swatch-default {
  background: linear-gradient(135deg, #34d399, #0d8f56);
}
.theme-swatch-national_day {
  background: linear-gradient(135deg, #ef5350, #d32f2f);
}
.theme-check {
  margin-left: auto;
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

/* —— Theme: Quốc Khánh (chỉ decoration; accent/chart/lợi nhuận giữ nguyên) —— */
.theme-nd-strip {
  display: none;
}
html[data-theme="national_day"] .theme-nd-strip {
  display: block;
  position: relative;
  height: 12px;
  background: #c62828;
  flex: 0 0 auto;
  overflow: hidden;
}
html[data-theme="national_day"] .theme-nd-star {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #ffd54f;
  font-size: 9px;
  line-height: 1;
  text-shadow: 0 0 4px rgba(198, 40, 40, 0.6);
}
html[data-theme="national_day"] .dash-hero {
  background:
    radial-gradient(420px 180px at 100% 0%, rgba(255,255,255,0.16), transparent 55%),
    linear-gradient(135deg, #ef5350 0%, #e53935 48%, #c62828 100%);
  box-shadow: 0 10px 24px rgba(198, 40, 40, 0.28);
}
html[data-theme="national_day"] .dash-hero.is-centered {
  overflow: visible;
}
html[data-theme="national_day"] .dash-hero.is-centered::before {
  content: "★ MỪNG QUỐC KHÁNH 2/9 ★";
  display: block;
  margin-bottom: 6px;
  padding: 0 44px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #ffe082;
  line-height: 1.3;
}
html[data-theme="national_day"] .dash-hero.is-centered::after {
  content: none;
}
.theme-nd-card-flag { display: none; }
html[data-theme="national_day"] .theme-nd-card-flag {
  display: block;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 26px;
  padding: 1px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
  transform: rotate(-10deg);
  transform-origin: 70% 80%;
  pointer-events: none;
  animation: nd-flag-settle 1.4s ease-out 1;
}
html[data-theme="national_day"] .theme-nd-card-flag svg {
  display: block;
  width: 38px;
  height: 24px;
}
@keyframes nd-flag-settle {
  0% { transform: rotate(-2deg) translateY(-2px); }
  45% { transform: rotate(-14deg) translateY(0); }
  100% { transform: rotate(-10deg) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  html[data-theme="national_day"] .theme-nd-card-flag {
    animation: none;
  }
}

/* —— Date Navigator Bar (Sổ Ngày) —— */
.day-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.day-nav-arrows {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 3px 4px;
  box-shadow: var(--shadow-card);
}
.day-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  line-height: 1;
}
.day-nav-btn:hover,
.day-nav-btn:active {
  background: var(--bg);
  color: var(--ink);
}
.day-nav-center {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.day-nav-caret {
  font-size: 10px;
  color: var(--muted);
}
.day-nav-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  font-size: 16px;
}
.day-nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.day-nav-today {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow-card);
}
.day-nav-snap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}
.day-nav-snap:active {
  background: var(--bg);
}

/* —— Hero Sub-metrics (Sổ Ngày) —— */
.dash-hero-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}
.dash-hm-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}
.dash-hm-item span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 600;
}
.dash-hm-item strong {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.dash-hm-item.is-diff strong {
  color: #d1fae5;
}
.dash-hero-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-decoration: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.dash-hero-edit:active {
  background: rgba(255, 255, 255, 0.32);
}

/* —— Grouped Card (Sổ Ngày) —— */
.card.grouped-card {
  padding: 0;
  overflow: hidden;
}
.grouped-card .card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 16px 10px;
}
.grouped-card .card-head strong {
  font-size: 14px;
  font-weight: 800;
}
.grouped-card .card-head .meta {
  font-size: 12px;
  color: var(--muted);
}
.grouped-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.grouped-list .ratio-row {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  border-top: 1px solid var(--line);
  padding: 12px 16px;
}

/* —— Sub-page Back Navigation —— */
.sub-page-nav {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
}
.sub-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  padding: 4px 2px;
}
.sub-back-link:active {
  opacity: 0.7;
}

/* —— Live Chi Subtotal —— */
.chi-live-total {
  font-size: 13px;
  font-weight: 800;
  color: var(--color-bad);
  font-variant-numeric: tabular-nums;
}
.block-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}

/* —— Collapsible Day History Accordion —— */
.day-history-card {
  padding: 0;
  overflow: hidden;
  margin-top: 12px;
}
.day-history-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.day-history-summary::-webkit-details-marker,
.day-history-summary::marker { display: none; }
.day-history-summary .caret {
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.2s ease;
}
.day-history-card[open] .day-history-summary .caret {
  transform: rotate(180deg);
}
.day-history-card .day-list {
  padding: 0 12px 14px;
}

/* —— Discreet Danger Link in View Mode —— */
.day-view-danger {
  display: flex;
  justify-content: center;
  margin: 16px 0 8px;
}
.btn-link-danger {
  background: none;
  border: 0;
  padding: 6px 12px;
  color: #9ca3af;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.btn-link-danger:hover,
.btn-link-danger:active {
  color: var(--color-bad);
}

/* ============================================================
   ANTI-COPY, WATERMARK & PRINT PROTECTION
   ============================================================ */
.wrap, .card, .dash-hero, .metric-grid, .ratio-list, .bcd-table, .user-admin-list {
  -webkit-user-select: none;
  user-select: none;
}
input, textarea, select {
  -webkit-user-select: auto !important;
  user-select: auto !important;
}

.app-watermark {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  overflow: hidden;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
  opacity: 0.055;
  user-select: none;
  -webkit-user-select: none;
}
.app-watermark span {
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-22deg);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink, #14201c);
  white-space: nowrap;
  letter-spacing: 0.5px;
}

@media print {
  body * {
    visibility: hidden !important;
  }
  body::before {
    content: "Tài liệu tài chính nội bộ Điểm Dừng — Nghiêm cấm in ấn hoặc sao chép!";
    visibility: visible !important;
    position: fixed;
    top: 30%;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    color: #b42318;
  }
}

/* —— Fast Entry Quick Suggestion Chips —— */
.quick-chips-bar {
  margin: 6px 0 10px;
  padding: 8px 10px;
  background: var(--bg-card-muted, #f8fafc);
  border: 1px dashed rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-sm, 10px);
}
.quick-chips-title {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  margin-bottom: 6px;
}
.quick-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.quick-chip-btn {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #ffffff;
  color: #1e293b;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  transition: all 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}
.quick-chip-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.quick-chip-btn:active {
  transform: scale(0.95);
  background: var(--accent-soft, #e6f7ef);
  border-color: var(--accent, #0d8f56);
  color: var(--accent, #0d8f56);
}

/* —— Live Calculation in Fast Entry Form —— */
.form-live-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.form-live-summary .live-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
}
.form-live-summary .live-thuc-nhan {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
}
.form-live-summary .live-thuc-nhan.is-pos {
  color: #0d8f56;
}
.form-live-summary .live-thuc-nhan.is-neg {
  color: #dc2626;
}

/* —— Shareholder Distribution Cards —— */
.shareholder-card-group {
  padding: 0;
  overflow: hidden;
}
.shareholder-card-group .card-head {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}
.shareholder-list {
  display: flex;
  flex-direction: column;
}
.shareholder-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  transition: background 0.15s ease;
}
.shareholder-row:last-child {
  border-bottom: none;
}
.shareholder-row:hover {
  background: #f8fafc;
}
.shareholder-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sh-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 1px solid rgba(15, 23, 42, 0.08);
  flex-shrink: 0;
}
.sh-avatar.is-me {
  background: #e6f7ef;
  color: #0d8f56;
  border-color: rgba(13, 143, 86, 0.25);
}
.shareholder-row strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
}
.sh-role {
  display: block;
  font-size: 11.5px;
  color: #64748b;
  margin-top: 1px;
}
.sh-amount {
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  background: #f8fafc;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(15, 23, 42, 0.06);
}
.shareholder-row.is-me .sh-amount {
  background: #f0fdf4;
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.15);
}
.shareholder-total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: #f8fafc;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}
.sh-total-num {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}

/* —— Executive Dashboard Hero Metric Adjustments —— */
.exec-hero .dash-hero-metrics {
  background: rgba(255, 255, 255, 0.12);
  padding: 10px 14px;
  border-radius: 12px;
  border-top: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.exec-hero .dash-hm-item {
  text-align: center;
}
.exec-hero .dash-hm-item:first-child {
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

/* —— Utilities Menu (more-item) enhancements —— */
.more-item {
  transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
}
.more-item:active {
  transform: scale(0.985);
  background: #f8fafc;
}
.more-item.is-logout {
  border-color: rgba(220, 38, 38, 0.2);
  background: #fffafa;
  margin-top: 6px;
}
.more-item.is-logout strong {
  color: #dc2626;
}
.more-item.is-logout:active {
  background: #fee2e2;
}

/* —— Store Switcher Menu enhancements —— */
.coso-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background 0.15s ease;
}
.coso-picker-item:hover {
  background: #f1f5f9;
}
.coso-picker-item .coso-check {
  font-weight: 800;
  color: var(--accent);
}




