/* Hallmark · checked: 2026-12-02 · genre: modern-minimal (inferred) · shape: app screen
 * floor: tokens, focus, reduced motion, overflow clip · waived: 29 (background bloom, requested by the owner)
 * built: the project, from Figma "Xe Sandwich · v2 (Hallmark fixes)" */

:root {
  --color-page: #FFFFFF;
  --color-card: #FFFFFF;
  --color-soft: #F3F4FA;
  --color-ink: #2A2333;
  --color-ink-2: #6E6577;
  --color-line: #E6E7F0;
  --color-success: #2F8061;
  --color-danger: #B3261E;
  --color-chart: #ECE5FC;
  --color-chart-strong: #5A4790;
  --color-on-ink: #FFFFFF;
  --color-bloom-pink: rgb(246 195 210 / 0.75);
  --color-bloom-blue: rgb(195 217 247 / 0.8);
  --color-bloom-pink-2: rgb(244 201 216 / 0.55);
  --color-bloom-blue-2: rgb(201 220 248 / 0.7);
  --color-wash-top: #EEF1F8;
  --color-wash-bottom: #F6EFF4;
  --color-glass: rgb(255 255 255 / 0.72);
  --color-scrim: rgb(42 35 51 / 0.35);
  --color-focus: #5A4790;

  --font-body: "Google Sans Flex", system-ui, -apple-system, "Segoe UI", sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-md: 0.9375rem;
  --text-lg: 1.0625rem;
  --text-xl: 1.25rem;
  --text-title: 1.75rem;
  --text-figure: 2.25rem;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 28px;

  --shadow-card: 0 4px 18px rgb(115 120 168 / 0.10);
  --shadow-bar: 0 8px 24px rgb(115 120 168 / 0.16);

  --dur-micro: 120ms;
  --dur-short: 220ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --tabbar-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-ink);
  background-color: var(--color-page);
  -webkit-tap-highlight-color: transparent;
}
/* Nền gradient nằm cố định sau nội dung (iOS bỏ qua background-attachment: fixed) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(80% 32% at 0% 0%, var(--color-bloom-pink), transparent),
    radial-gradient(75% 40% at 100% 30%, var(--color-bloom-blue), transparent),
    radial-gradient(70% 35% at 0% 70%, var(--color-bloom-pink-2), transparent),
    radial-gradient(85% 30% at 100% 100%, var(--color-bloom-blue-2), transparent),
    linear-gradient(180deg, var(--color-wash-top), var(--color-wash-bottom));
}
::placeholder { color: var(--color-ink-2); opacity: 0.7; font-weight: 500; }
::selection { background: var(--color-chart); color: var(--color-ink); }
input, button, select, textarea { font: inherit; color: inherit; caret-color: var(--color-chart-strong); }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

.app { max-width: 480px; margin: 0 auto; padding-bottom: calc(var(--tabbar-h) + 40px + env(safe-area-inset-bottom)); }
.screen { display: flex; flex-direction: column; gap: var(--space-5); padding: calc(var(--space-6) + env(safe-area-inset-top)) var(--space-4) var(--space-6); outline: none; }

/* Header */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-3); }
.head h1 { margin: 0; font-size: var(--text-title); line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
.head time, .head .sub { display: block; font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); margin-bottom: 2px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-4); border: 0; border-radius: var(--radius-md);
  font-size: var(--text-md); font-weight: 600; text-decoration: none;
  transition: background-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--color-ink); color: var(--color-on-ink); }
.btn-soft { background: var(--color-soft); color: var(--color-ink); }
.btn-card { background: var(--color-card); color: var(--color-ink); box-shadow: var(--shadow-card); }
.btn-block { width: 100%; min-height: 56px; font-size: var(--text-lg); font-weight: 700; border-radius: 20px; }
.btn-icon { width: 44px; padding: 0; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.link { background: none; border: 0; padding: var(--space-2) 0; min-height: 44px; font-size: var(--text-sm); font-weight: 600; color: var(--color-ink); text-decoration: none; display: inline-flex; align-items: center; }
.ico { display: inline-flex; width: 20px; height: 20px; flex: none; }
.ico svg { width: 100%; height: 100%; }

/* Cards */
.card { background: var(--color-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: var(--space-4) var(--space-5); }
.section-head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.section-head h2 { margin: 0; font-size: var(--text-lg); font-weight: 700; }

/* Revenue */
.revenue { background: var(--color-glass); -webkit-backdrop-filter: none; border-radius: var(--radius-xl); padding: var(--space-5) var(--space-5) var(--space-4); box-shadow: var(--shadow-card); }
.revenue .label { font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); }
.revenue .figure { font-size: var(--text-figure); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; margin: var(--space-1) 0 var(--space-3); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr); gap: var(--space-5); align-items: center; }
.split .rule { width: 1px; height: 40px; background: var(--color-line); }
.split .k { font-size: var(--text-xs); color: var(--color-ink-2); }
.split .v { font-size: var(--text-lg); font-weight: 700; }
.pos { color: var(--color-success); }
.neg { color: var(--color-danger); }

/* Segmented */
.seg { display: flex; gap: var(--space-1); padding: 6px; background: var(--color-card); border-radius: 18px; box-shadow: var(--shadow-card); }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 14px; background: transparent; font-size: var(--text-sm); font-weight: 600; color: var(--color-ink-2); transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.seg button[aria-pressed="true"] { background: var(--color-ink); color: var(--color-on-ink); }

/* Chart */
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--space-3); }
.chart-head h2 { margin: 0; font-size: var(--text-md); font-weight: 600; }
.chart-head .total { font-weight: 700; color: var(--color-chart-strong); }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-2); align-items: end; height: 140px; }
.bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; }
.bar i { display: block; width: 26px; min-height: 4px; border-radius: 10px; background: var(--color-chart); }
.bar.today i { background: var(--color-chart-strong); }
.bar span { font-size: var(--text-xs); font-weight: 500; color: var(--color-ink-2); }
.bar.today span { color: var(--color-chart-strong); font-weight: 700; }

/* Rows */
.rows { list-style: none; margin: 0; padding: var(--space-1) var(--space-4); }
.row { display: flex; align-items: center; gap: var(--space-3); min-height: 60px; }
.row + .row { border-top: 1px solid var(--color-line); }
.row .main { flex: 1; min-width: 0; }
.row .t { font-size: var(--text-md); font-weight: 600; overflow-wrap: break-word; }
.row .s { font-size: var(--text-xs); color: var(--color-ink-2); }
.row .amt { font-weight: 600; white-space: nowrap; }
.row .x { flex: none; }

/* Strip */
.strip { display: flex; justify-content: space-between; align-items: center; }
.strip .k { font-size: var(--text-xs); color: var(--color-ink-2); }
.strip .v { font-size: var(--text-xl); font-weight: 700; line-height: 1.25; }
.strip .right { text-align: right; }

/* Menu grid */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.item {
  display: flex; flex-direction: column; gap: var(--space-2); text-align: left;
  border: 0; border-radius: var(--radius-lg); background: var(--color-card); box-shadow: var(--shadow-card);
  padding: var(--space-4) 14px 14px; min-height: 140px;
  transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.item:active { transform: scale(0.98); }
.item .name { font-size: var(--text-md); font-weight: 600; line-height: 1.3; overflow-wrap: break-word; min-width: 0; }
.item .meta { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); margin-top: auto; }
.item .price { font-size: var(--text-sm); font-weight: 500; color: var(--color-ink-2); }
.item .count { font-size: var(--text-xs); font-weight: 600; color: var(--color-ink-2); background: var(--color-soft); border-radius: var(--radius-sm); padding: 2px 10px; }
.item .cta { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border-radius: var(--radius-md); background: var(--color-soft); font-size: var(--text-md); font-weight: 700; }
.item.flash { background: var(--color-chart); }

/* Form */
.field-label { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--color-ink-2); margin-bottom: var(--space-2); }
.input {
  width: 100%; min-height: 52px; border: 1px solid transparent; border-radius: 18px;
  background: var(--color-card); box-shadow: var(--shadow-card); padding: 0 var(--space-4);
  font-size: var(--text-lg); font-weight: 600;
}
.input:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 1px; }
.input.big { min-height: 72px; font-size: 2rem; font-weight: 700; letter-spacing: -0.01em; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.chip { min-height: 40px; padding: 0 var(--space-4); border: 0; border-radius: 14px; background: var(--color-soft); font-size: var(--text-sm); font-weight: 600; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--space-4) * -1); padding-inline: var(--space-4); }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.scroll .chip { flex: none; }
.error { min-height: 1.5em; margin: var(--space-1) 0 0; font-size: var(--text-sm); font-weight: 500; color: var(--color-danger); }
.date-chip { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--space-3); border-radius: 14px; background: var(--color-card); box-shadow: var(--shadow-card); font-size: var(--text-sm); font-weight: 600; }
.date-chip input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; }

/* Checklist */
.progress .top { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: var(--space-3); }
.track { height: 10px; border-radius: 5px; background: var(--color-soft); overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 5px; background: var(--color-ink); transform-origin: left; }
.tasks { display: flex; flex-direction: column; gap: 10px; list-style: none; margin: 0; padding: 0; }
.task {
  display: flex; align-items: center; gap: var(--space-3); width: 100%; min-height: 56px; text-align: left;
  border: 0; border-radius: 18px; background: var(--color-card); box-shadow: var(--shadow-card);
  padding: 0 var(--space-4); font-size: var(--text-md); font-weight: 500;
}
.task .box { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: none; border-radius: 9px; border: 2px solid var(--color-ink-2); color: var(--color-on-ink); }
.task[aria-pressed="true"] { background: transparent; box-shadow: none; min-height: 44px; color: var(--color-ink-2); }
.task[aria-pressed="true"] .label { text-decoration: line-through; }
.task[aria-pressed="true"] .box { background: var(--color-ink); border-color: var(--color-ink); }
.task .box svg { width: 16px; height: 16px; }

/* Empty, error, skeleton */
.empty { text-align: center; padding: var(--space-6) var(--space-5); }
.empty h2 { margin: 0 0 var(--space-1); font-size: var(--text-lg); }
.empty p { margin: 0 0 var(--space-4); color: var(--color-ink-2); font-size: var(--text-md); }
.skel { border-radius: var(--radius-lg); background: var(--color-soft); }
@media (prefers-reduced-motion: no-preference) {
  .skel { animation: pulse 1.4s ease-in-out infinite; }
}
@keyframes pulse { 50% { opacity: 0.55; } }

/* Status pill */
.status {
  position: fixed; z-index: 15; top: calc(8px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: calc(100% - 32px); padding: 6px 14px; border-radius: 999px;
  background: var(--color-ink); color: var(--color-on-ink); font-size: var(--text-xs); font-weight: 600;
}

/* Tab bar */
.tabbar {
  position: fixed; z-index: 10; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%); width: min(448px, calc(100% - 32px)); height: var(--tabbar-h);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: center; gap: var(--space-1);
  padding: 0 10px; border-radius: var(--radius-xl);
  background: var(--color-glass); box-shadow: var(--shadow-bar);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .tabbar { -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); }
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .tabbar { background: var(--color-card); }
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 56px; border-radius: 20px; text-decoration: none;
  color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 500;
}
.tabbar a .ico { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { background: var(--color-soft); color: var(--color-ink); font-weight: 700; }

/* Toast */
.toast {
  position: fixed; z-index: 20; left: 50%; bottom: calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom));
  transform: translateX(-50%); width: min(448px, calc(100% - 32px));
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4); min-height: 52px;
  border-radius: var(--radius-md); background: var(--color-ink); color: var(--color-on-ink); font-size: var(--text-sm); font-weight: 500;
}
.toast button { min-height: 40px; padding: 0 var(--space-3); border: 0; border-radius: var(--radius-sm); background: rgb(255 255 255 / 0.14); color: var(--color-on-ink); font-weight: 700; }

/* Sheet */
.sheet {
  width: min(480px, 100%); max-width: 100%; max-height: 90dvh; margin: auto auto 0; padding: 0;
  border: 0; border-radius: var(--radius-xl) var(--radius-xl) 0 0; background: var(--color-card); color: var(--color-ink);
}
.sheet::backdrop { background: var(--color-scrim); }
.sheet .inner { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5) var(--space-4) calc(var(--space-6) + env(safe-area-inset-bottom)); }
.sheet h2 { margin: 0; font-size: var(--text-xl); }
.sheet .input { box-shadow: none; background: var(--color-soft); }
.sheet .edit-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 44px; gap: var(--space-2); align-items: center; }
.sheet .edit-row .input { min-height: 48px; font-size: var(--text-md); }
.sheet .bar-actions { display: flex; gap: var(--space-2); }
.sheet .bar-actions .btn { flex: 1; }

.notice { padding: var(--space-4); }

/* Login */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
