:root {
  --ink: #17152b;
  --muted: #706d82;
  --line: rgba(83, 71, 132, .12);
  --surface: rgba(255, 255, 255, .9);
  --purple: #5546d9;
  --purple-dark: #4032b5;
  --cash: #ef7a5c;
  --cash-bg: #fff0e9;
  --transfer: #368b78;
  --transfer-bg: #e8f7f2;
  --shadow: 0 22px 60px rgba(72, 57, 130, .14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 3% 5%, rgba(71, 57, 218, .28), transparent 29rem),
    radial-gradient(circle at 92% 12%, rgba(255, 159, 145, .3), transparent 31rem),
    linear-gradient(145deg, #eeeaff 0%, #faf6fb 46%, #fff0e9 100%);
  background-attachment: fixed;
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", ui-sans-serif, system-ui, sans-serif;
}
body::before, body::after {
  position: fixed;
  z-index: -1;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  filter: blur(3px);
  content: '';
  opacity: .42;
}
body::before { top: 45%; left: -120px; background: #b5abff; }
body::after { right: -100px; bottom: 4%; background: #ffc0b3; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; transform: none !important; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid rgba(85, 70, 217, .25); outline-offset: 2px; }
.app-version {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 5;
  border: 1px solid rgba(83, 71, 132, .12);
  border-radius: 999px;
  padding: 4px 8px;
  color: rgba(112, 109, 130, .72);
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 4px 14px rgba(72, 57, 130, .06);
  font-size: .62rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.app-shell { width: min(calc(100% - 40px), 1160px); margin: 24px auto 64px; }
.topbar, .list-header, .section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.topbar { align-items: center; margin-bottom: 22px; }
.brand-lockup { display: flex; align-items: center; gap: 13px; }
.brand-mark { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 15px; color: #fff; background: linear-gradient(145deg, #6959ee, #4032b5); box-shadow: 0 12px 25px rgba(77, 61, 197, .28); font-size: 1.15rem; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -.045em; }
h2 { font-size: 1.12rem; letter-spacing: -.025em; }
.eyebrow { margin-bottom: 5px; color: var(--purple); font-size: .67rem; font-weight: 800; letter-spacing: .14em; }
.today, .form-intro > p { margin-top: 5px; color: var(--muted); font-size: .82rem; }
.primary-button, .secondary-button { min-height: 48px; border: 0; border-radius: 16px; padding: 0 19px; font-weight: 800; }
.primary-button { color: #fff; background: linear-gradient(135deg, #6656eb, #4a39c4); box-shadow: 0 12px 26px rgba(79, 62, 199, .25); }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 15px 30px rgba(79, 62, 199, .32); }
.button-link { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.header-action { white-space: nowrap; transition: .2s ease; }
.header-action span { font-size: 1.2rem; vertical-align: -1px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.signed-in-user { color: var(--muted); font-size: .72rem; font-weight: 800; }
.logout-button { min-height: 42px; border: 1px solid var(--line); border-radius: 13px; padding: 0 13px; color: var(--muted); background: rgba(255,255,255,.68); font-size: .73rem; font-weight: 800; }
.logout-button:hover { color: var(--purple); background: #fff; }
.metrics-section, .shift-section, .transactions-section { margin-top: 22px; }
.metrics-grid { display: grid; grid-template-columns: 1.65fr repeat(3, 1fr); gap: 14px; margin-top: 13px; }
.metric-card, .shift-card, .quick-transaction, .transactions-section { border: 1px solid rgba(255, 255, 255, .72); border-radius: 26px; background: var(--surface); box-shadow: 0 14px 45px rgba(70, 55, 120, .08); backdrop-filter: blur(18px); }
.metric-card { min-width: 0; min-height: 154px; padding: 21px; }
.metric-card p, .shift-card p { color: var(--muted); font-size: .78rem; font-weight: 700; }
.metric-card strong { display: block; margin-top: 21px; font-size: clamp(1.04rem, 2vw, 1.4rem); letter-spacing: -.045em; white-space: nowrap; }
.revenue-card { position: relative; min-height: 190px; overflow: hidden; color: #fff; border: 0; background: linear-gradient(145deg, #4034b8 0%, #7062ef 54%, #d29be5 100%); box-shadow: 0 22px 45px rgba(75, 59, 191, .25); }
.revenue-card::before { position: absolute; top: -75px; right: -55px; width: 210px; height: 210px; border: 1px solid rgba(255,255,255,.23); border-radius: 50%; content: ''; box-shadow: 0 0 0 32px rgba(255,255,255,.055), 0 0 0 66px rgba(255,255,255,.035); }
.revenue-heading { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.revenue-card p { color: rgba(255, 255, 255, .8); }
.revenue-card strong { position: relative; margin-top: 13px; font-size: clamp(1.8rem, 3.2vw, 2.65rem); }
.live-pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,.25); border-radius: 999px; padding: 5px 9px; color: #fff; background: rgba(255,255,255,.13); font-size: .67rem; font-weight: 700; }
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: #bff8df; box-shadow: 0 0 0 4px rgba(191,248,223,.15); }
.hero-actions { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 22px; }
.hero-actions button, .hero-actions a { display: flex; min-height: 42px; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.25); border-radius: 14px; color: var(--ink); background: rgba(255,255,255,.92); font-size: .76rem; font-weight: 800; text-decoration: none; }
.hero-actions button:hover, .hero-actions a:hover { background: #fff; }
.hero-actions span { margin-right: 3px; color: var(--purple); font-size: 1rem; }
.cash-card { background: linear-gradient(145deg, rgba(255,255,255,.96), #fff1eb); }
.transfer-card { background: linear-gradient(145deg, rgba(255,255,255,.96), #e9f8f3); }
.count-card { background: linear-gradient(145deg, rgba(255,255,255,.96), #f1efff); }
.method-dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; }
.cash-dot { background: var(--cash); box-shadow: 0 0 0 4px rgba(239,122,92,.11); }
.transfer-dot { background: var(--transfer); box-shadow: 0 0 0 4px rgba(54,139,120,.11); }
.shift-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 13px; }
.shift-card { position: relative; overflow: hidden; padding: 19px 21px; }
.shift-card::after { position: absolute; right: -18px; bottom: -30px; width: 94px; height: 94px; border-radius: 50%; background: linear-gradient(135deg, rgba(98,82,229,.09), rgba(250,153,135,.12)); content: ''; }
.shift-card h3 { font-size: .95rem; }
.shift-card .shift-time { margin: 5px 0 17px; }
.shift-card strong { font-size: 1.18rem; letter-spacing: -.03em; }
.shift-card .shift-count { float: right; border-radius: 999px; padding: 4px 8px; color: var(--purple); background: #efedff; font-size: .67rem; }
.quick-transaction { display: grid; grid-template-columns: minmax(220px, .68fr) minmax(390px, 1fr); gap: 32px; margin-top: 22px; padding: 28px; }
.form-intro { padding: 5px 8px 0 2px; }
.form-intro h2 { font-size: 1.45rem; }
.quick-transaction form { display: grid; gap: 9px; }
.quick-transaction label, .quick-transaction legend { font-size: .8rem; font-weight: 800; }
.quick-transaction label span:not(.optional), legend span { color: #e24f43; }
.optional { color: var(--muted); font-weight: 500; }
input[type="text"], input[type="date"], select { width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; color: var(--ink); background: rgba(250,249,255,.92); outline: none; }
input:focus, select:focus { border-color: #8174ec; background: #fff; box-shadow: 0 0 0 4px rgba(85,70,217,.1); }
.amount-field { display: flex; align-items: center; min-height: 60px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: #faf9ff; }
.amount-field:focus-within { border-color: #8174ec; background: #fff; box-shadow: 0 0 0 4px rgba(85,70,217,.1); }
.amount-field input { border: 0; background: transparent; box-shadow: none !important; font-size: 1.55rem; font-weight: 800; }
.amount-field span { padding: 0 15px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.field-error { min-height: 15px; color: #d94040; font-size: .73rem; }
fieldset { margin: 0 0 3px; padding: 0; border: 0; }
.payment-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 7px; }
.payment-option { display: flex; align-items: center; gap: 10px; min-height: 68px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 16px; background: #fff; cursor: pointer; transition: .15s ease; }
.payment-option input { accent-color: var(--purple); }
.payment-option b, .payment-option small { display: block; }
.payment-option small { margin-top: 3px; color: var(--muted); font-size: .67rem; font-weight: 500; }
.cash-option:has(input:checked) { border-color: #f5ad99; background: var(--cash-bg); box-shadow: 0 7px 18px rgba(231,108,79,.1); }
.transfer-option:has(input:checked) { border-color: #8fcebf; background: var(--transfer-bg); box-shadow: 0 7px 18px rgba(54,139,120,.1); }
.save-button { width: 100%; margin-top: 7px; min-height: 54px; }
.transactions-section { padding: 26px 28px; }
.secondary-button { color: var(--purple); background: #efedff; }
.secondary-button:hover { background: #e6e2ff; }
.filters { display: flex; align-items: end; gap: 10px; margin: 21px 0 14px; }
.history-mask-notice { margin: -2px 0 16px; border-radius: 13px; padding: 11px 13px; color: #5d5870; background: #f3f1ff; font-size: .72rem; font-weight: 700; line-height: 1.45; }
.filters label { flex: 0 1 230px; color: var(--muted); font-size: .72rem; font-weight: 800; }
.filters input, .filters select { min-height: 43px; margin-top: 5px; }
.text-button { min-height: 43px; border: 0; color: var(--purple); background: transparent; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.transaction-list { border-top: 1px solid var(--line); }
.transaction-item { display: grid; grid-template-columns: 1.1fr .85fr .9fr 1.2fr; gap: 14px; align-items: center; padding: 17px 4px; border-bottom: 1px solid var(--line); }
.transaction-code { font-size: .83rem; font-weight: 800; }
.transaction-meta { margin-top: 4px; color: var(--muted); font-size: .71rem; }
.transaction-amount { font-weight: 800; text-align: right; }
.badge { display: inline-flex; width: max-content; border-radius: 999px; padding: 6px 9px; font-size: .68rem; font-weight: 800; }
.cash-badge { color: #b54c35; background: var(--cash-bg); }
.transfer-badge { color: #24715f; background: var(--transfer-bg); }
.note { color: var(--muted); font-size: .77rem; overflow-wrap: anywhere; }
.empty-state { padding: 50px 20px; color: var(--muted); text-align: center; }
.empty-state::before { display: grid; width: 52px; height: 52px; margin: 0 auto 13px; place-items: center; border-radius: 18px; color: var(--purple); background: #efedff; content: '⌁'; font-size: 1.35rem; }
.empty-state strong { display: block; margin-bottom: 5px; color: var(--ink); }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 6; max-width: min(360px, calc(100% - 40px)); transform: translateY(120px); border-radius: 15px; padding: 14px 17px; color: #fff; background: #211d3d; box-shadow: 0 16px 38px rgba(33,29,61,.3); opacity: 0; transition: .25s; }
.toast.show { transform: translateY(0); opacity: 1; }
.mobile-nav { display: none; }

/* Bảng lịch sử desktop: quét nhanh theo từng cột */
.transaction-column-headings { display: none; }
@media (min-width: 681px) {
  .transactions-section { padding: 30px 34px; }
  .transaction-list {
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: rgba(255,255,255,.68);
  }
  .transaction-column-headings,
  .transaction-item {
    display: grid;
    grid-template-columns: minmax(270px, 1.3fr) minmax(145px, .62fr) minmax(145px, .55fr) minmax(230px, 1fr);
    gap: 24px;
  }
  .transaction-column-headings {
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding: 13px 18px;
    color: var(--muted);
    background: rgba(249,248,253,.9);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .transaction-column-headings span:nth-child(3) { text-align: center; }
  .transaction-item { padding: 18px; transition: background .15s ease; }
  .transaction-item:nth-of-type(odd) { background: rgba(85, 70, 217, .028); }
  .transaction-item:hover { background: rgba(247,246,253,.84); }
  .transaction-code { font-size: .98rem; }
  .transaction-meta { margin-top: 6px; font-size: .76rem; }
  .transaction-amount { font-size: 1.05rem; text-align: center; white-space: nowrap; }
  .transaction-note { font-size: .85rem; line-height: 1.45; }
}

/* Màn hình nhân viên */
.staff-page { display: grid; min-height: 100vh; place-items: center; }
.staff-shell { width: min(calc(100% - 32px), 620px); margin: 32px auto; }
.staff-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.staff-header-actions { display: flex; align-items: center; gap: 9px; }
.staff-shift { display: grid; gap: 3px; justify-items: end; border: 1px solid rgba(255,255,255,.75); border-radius: 16px; padding: 10px 13px; background: rgba(255,255,255,.6); backdrop-filter: blur(12px); }
.staff-shift span { color: var(--purple); font-size: .78rem; font-weight: 800; }
.staff-shift small { color: var(--muted); font-size: .65rem; text-transform: capitalize; }
.staff-card { border: 1px solid rgba(255,255,255,.82); border-radius: 32px; padding: 30px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.staff-card-heading { display: flex; align-items: center; gap: 13px; margin-bottom: 27px; }
.staff-card-heading h2 { font-size: 1.3rem; }
.staff-card-heading p:last-child { margin-top: 4px; color: var(--muted); font-size: .78rem; }
.staff-card-icon { display: grid; flex: 0 0 auto; width: 48px; height: 48px; place-items: center; border-radius: 16px; color: #fff; background: linear-gradient(145deg, #ef8a6f, #d95e77); box-shadow: 0 12px 24px rgba(218,94,113,.22); font-size: 1.25rem; }
.voice-entry { display: flex; align-items: center; gap: 12px; margin: -5px 0 20px; border: 1px solid #dcd8ff; border-radius: 18px; padding: 12px; background: linear-gradient(145deg, #f5f3ff, #fff7f2); }
.voice-entry > div { min-width: 0; }
.voice-entry strong, .voice-entry small { display: block; }
.voice-entry strong { font-size: .78rem; }
.voice-entry small { margin-top: 3px; color: var(--muted); font-size: .65rem; line-height: 1.4; }
.voice-button { flex: 0 0 auto; min-height: 44px; border: 0; border-radius: 14px; padding: 0 13px; color: #fff; background: linear-gradient(145deg, #6e5ce9, #4b3abb); font-size: .72rem; font-weight: 800; }
.voice-button span { color: #ffb6ab; font-size: .68rem; }
.voice-button.listening { background: linear-gradient(145deg, #ed745b, #d54c69); box-shadow: 0 0 0 6px rgba(226,91,96,.1); }
.voice-button.voice-unavailable { color: #5d5870; background: #e7e4ef; box-shadow: none; }
.voice-button.voice-unavailable span { color: #9a94aa; }
.voice-status { min-height: 16px; margin: -12px 2px 15px; color: var(--purple); font-size: .7rem; line-height: 1.45; }
.voice-permission { margin: -6px 0 20px; border: 1px solid #dcd8ff; border-radius: 18px; padding: 14px; background: #f8f7ff; }
.voice-permission[hidden] { display: none; }
.voice-permission strong, .voice-permission small { display: block; }
.voice-permission strong { font-size: .8rem; }
.voice-permission small { margin-top: 4px; color: var(--muted); font-size: .67rem; line-height: 1.45; }
.voice-permission-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 13px; }
.voice-permission-actions button { min-height: 42px; border-radius: 13px; padding: 0 13px; font-size: .71rem; font-weight: 800; }
.permission-cancel { border: 1px solid var(--line); color: var(--muted); background: #fff; }
.permission-grant { border: 0; color: #fff; background: linear-gradient(145deg, #6e5ce9, #4b3abb); }
.staff-card form { display: grid; gap: 10px; }
.staff-card label, .staff-card legend { font-size: .82rem; font-weight: 800; }
.staff-card label span:not(.optional), .staff-card legend span { color: #e24f43; }
.staff-amount { min-height: 76px; }
.staff-amount input { font-size: clamp(1.8rem, 8vw, 2.5rem); }
.staff-payment-options .payment-option { min-height: 78px; }
.staff-save-button { width: 100%; min-height: 60px; margin-top: 8px; font-size: 1rem; }
.staff-save-button span { margin-right: 5px; font-size: 1.1rem; }
.staff-hint { margin-top: 15px; color: var(--muted); font-size: .73rem; text-align: center; }

/* Đăng nhập */
.login-page { display: grid; min-height: 100vh; place-items: center; }
.login-shell { width: min(calc(100% - 30px), 430px); margin: 30px auto; }
.login-card { border: 1px solid rgba(255,255,255,.82); border-radius: 32px; padding: 34px; background: rgba(255,255,255,.91); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 25px; }
.login-brand .eyebrow { margin: 0; }
.login-card h1 { font-size: 1.65rem; }
.login-subtitle { margin: 8px 0 26px; color: var(--muted); font-size: .79rem; line-height: 1.55; }
.login-card form { display: grid; gap: 9px; }
.login-card form > label:first-child { font-size: .8rem; font-weight: 800; }
.login-card input[type="password"] { width: 100%; min-height: 62px; border: 1px solid var(--line); border-radius: 16px; padding: 0 16px; color: var(--ink); background: #faf9ff; outline: none; font-size: 1.65rem; font-weight: 800; letter-spacing: .18em; text-align: center; }
.login-card input[type="password"]:focus { border-color: #8174ec; background: #fff; box-shadow: 0 0 0 4px rgba(85,70,217,.1); }
.login-error { min-height: 18px; }
.remember-option { display: flex; align-items: flex-start; gap: 10px; border-radius: 14px; padding: 10px 3px; cursor: pointer; }
.remember-option input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--purple); }
.remember-option b, .remember-option small { display: block; }
.remember-option b { font-size: .78rem; }
.remember-option small { margin-top: 3px; color: var(--muted); font-size: .66rem; line-height: 1.4; }
.login-button { width: 100%; min-height: 56px; margin-top: 5px; }
.login-security { margin-top: 20px; color: var(--muted); font-size: .65rem; line-height: 1.5; text-align: center; }

@media (min-width: 900px) {
  .app-shell { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(390px, .85fr); gap: 0 22px; }
  .topbar { grid-column: 1 / -1; }
  .metrics-section, .shift-section { grid-column: 1; }
  .quick-transaction { grid-column: 2; grid-row: 2 / span 2; align-self: start; position: sticky; top: 22px; grid-template-columns: 1fr; margin-top: 0; }
  .transactions-section { grid-column: 1 / -1; }
  .metrics-grid { grid-template-columns: repeat(3, 1fr); }
  .revenue-card { grid-column: 1 / -1; }
  .manager-shell { display: block; }
  .manager-shell .metrics-grid { grid-template-columns: 1.65fr repeat(3, 1fr); }
  .manager-shell .revenue-card { grid-column: auto; }
}

@media (max-width: 899px) {
  .metrics-grid { grid-template-columns: 1.45fr repeat(3, 1fr); }
  .quick-transaction { grid-template-columns: .62fr 1fr; }
}

@media (max-width: 680px) {
  body { background: linear-gradient(160deg, #5d4dde 0, #9a81ee 255px, #f4edf8 430px, #fff5f1 100%); background-attachment: fixed; }
  body::before, body::after { display: none; }
  .app-shell { width: 100%; margin: 0; padding: 20px 14px 110px; }
  .topbar { margin-bottom: 23px; color: #fff; }
  .brand-mark { width: 41px; height: 41px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.15); box-shadow: none; backdrop-filter: blur(8px); }
  .topbar .eyebrow, .topbar .today { color: rgba(255,255,255,.72); }
  h1 { font-size: 1.28rem; }
  .header-action { display: none; }
  .topbar-actions .signed-in-user { display: none; }
  .topbar-actions .logout-button { border-color: rgba(255,255,255,.25); color: #fff; background: rgba(255,255,255,.13); }
  .metrics-section { margin-top: 0; }
  .metrics-section > .section-heading { display: none; }
  .metrics-grid { grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 0; }
  .revenue-card { grid-column: 1 / -1; min-height: 214px; border-radius: 28px; padding: 23px; background: linear-gradient(145deg, rgba(67,53,187,.92), rgba(119,98,237,.82) 56%, rgba(228,166,210,.78)); box-shadow: 0 25px 48px rgba(46,35,133,.29); }
  .revenue-card strong { margin-top: 17px; font-size: clamp(2rem, 10vw, 2.75rem); }
  .hero-actions { margin-top: 27px; }
  .hero-actions button { min-height: 48px; }
  .metric-card:not(.revenue-card) { min-height: 101px; border-radius: 20px; padding: 14px 11px; text-align: center; }
  .metric-card:not(.revenue-card) p { font-size: .67rem; white-space: nowrap; }
  .metric-card:not(.revenue-card) strong { margin-top: 13px; font-size: clamp(.86rem, 3.5vw, 1.05rem); }
  .method-dot { display: none; }
  .shift-section, .quick-transaction, .transactions-section { margin-top: 18px; }
  .shift-section .section-heading { padding: 0 3px; }
  .shift-grid { gap: 9px; }
  .shift-card { padding: 16px; border-radius: 20px; }
  .shift-card .shift-count { display: block; float: none; width: max-content; margin-top: 7px; }
  .shift-card .shift-time { margin: 9px 0 14px; font-size: .68rem; }
  .shift-card strong { font-size: 1rem; }
  .quick-transaction { display: block; scroll-margin-top: 14px; border-radius: 30px; padding: 23px 18px; }
  .form-intro { margin-bottom: 22px; }
  .form-intro h2 { font-size: 1.32rem; }
  .amount-field { min-height: 64px; }
  .payment-option { min-height: 72px; padding: 10px; }
  .payment-option small { display: none; }
  .transactions-section { border-radius: 30px; padding: 23px 17px; }
  .list-header { align-items: center; }
  .secondary-button { min-height: 43px; padding: 0 13px; font-size: .73rem; }
  .filters { display: grid; grid-template-columns: 1fr 1fr; }
  .filters label { min-width: 0; }
  .text-button { text-align: left; }
  .transaction-item { grid-template-columns: 1fr auto; gap: 8px 12px; }
  .transaction-method { grid-column: 1; }
  .transaction-note { grid-column: 1 / -1; }
  .transaction-amount { grid-column: 2; grid-row: 1; }
  .mobile-nav { position: fixed; right: 14px; bottom: 12px; left: 14px; z-index: 5; display: grid; grid-template-columns: 1fr 72px 1fr; align-items: center; min-height: 70px; border: 1px solid rgba(255,255,255,.75); border-radius: 24px; padding: 7px 16px; background: rgba(255,255,255,.88); box-shadow: 0 18px 48px rgba(50,38,102,.2); backdrop-filter: blur(18px); }
  .mobile-nav a { display: grid; gap: 2px; justify-items: center; color: var(--muted); text-decoration: none; font-size: .62rem; font-weight: 700; }
  .mobile-nav a span { color: var(--ink); font-size: 1.35rem; line-height: 1; }
  .mobile-create { display: grid; width: 58px; height: 58px; margin: -29px auto 0; place-items: center; border: 6px solid rgba(244,237,248,.95); border-radius: 50%; color: #fff; background: linear-gradient(145deg, #7564ef, #4938c3); box-shadow: 0 10px 25px rgba(75,59,191,.35); font-size: 1.65rem; }
  .toast { right: 14px; bottom: 96px; }
  .staff-page { display: block; background: linear-gradient(160deg, #5d4dde 0, #9a81ee 245px, #f4edf8 420px, #fff5f1 100%); }
  .staff-shell { width: 100%; margin: 0; padding: 20px 14px 40px; }
  .staff-header { min-height: 102px; color: #fff; }
  .staff-header .brand-mark { border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.15); box-shadow: none; }
  .staff-header .eyebrow { color: rgba(255,255,255,.72); }
  .staff-shift { border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.12); }
  .staff-shift span, .staff-shift small { color: #fff; }
  .staff-header-actions { align-items: stretch; }
  .staff-header .logout-button { border-color: rgba(255,255,255,.2); color: #fff; background: rgba(255,255,255,.12); }
  .staff-card { border-radius: 30px; padding: 23px 18px; }
  .staff-card-heading { margin-bottom: 24px; }
  .staff-amount { min-height: 78px; }
  .staff-payment-options { grid-template-columns: 1fr 1fr; }
  .staff-hint { padding: 0 25px; }
  .login-page { display: block; background: linear-gradient(160deg, #5d4dde 0, #9a81ee 245px, #f4edf8 420px, #fff5f1 100%); }
  .login-shell { width: 100%; margin: 0; padding: 70px 14px 30px; }
  .login-card { padding: 28px 22px; }
}

@media (max-width: 390px) {
  .app-shell { padding-right: 11px; padding-left: 11px; }
  .brand-lockup { gap: 10px; }
  .brand-mark { width: 38px; height: 38px; }
  .payment-options, .filters { grid-template-columns: 1fr; }
  .metric-card:not(.revenue-card) p { font-size: .6rem; }
  .metric-card:not(.revenue-card) strong { font-size: .82rem; }
  .staff-header { align-items: flex-start; }
  .staff-shift { padding: 8px 9px; }
  .staff-shift small { display: none; }
  .staff-header .logout-button { min-height: 38px; padding: 0 9px; font-size: .64rem; }
  .staff-payment-options { grid-template-columns: 1fr; }
  .voice-entry { align-items: flex-start; }
  .voice-entry small { display: none; }
  .voice-permission-actions { display: grid; grid-template-columns: 1fr; }
  .permission-grant { grid-row: 1; }
}

/* Ưu tiên thao tác ra đơn */
.staff-shell { width: min(calc(100% - 32px), 720px); }
.staff-header { margin-bottom: 14px; }
.staff-header .brand-mark { width: 42px; height: 42px; border-radius: 13px; }
.staff-header h1 { font-size: 1.15rem; }
.staff-header .eyebrow { font-size: .58rem; }
.staff-card { padding: 25px 28px 28px; }
.staff-card-heading { gap: 10px; margin-bottom: 14px; }
.staff-card-icon { width: 40px; height: 40px; border-radius: 13px; font-size: 1rem; }
.staff-card-heading h2 { font-size: 1rem; }
.staff-card-heading p:last-child { display: none; }
.voice-entry { gap: 10px; margin: 0 0 13px; border-color: var(--line); border-radius: 14px; padding: 8px; background: #faf9ff; }
.voice-entry strong { font-size: .72rem; }
.voice-entry small { font-size: .61rem; }
.voice-button { min-height: 40px; border-radius: 11px; padding: 0 11px; }
.voice-status { margin: -4px 2px 12px; }
.voice-permission { margin: 0 0 14px; }
.staff-card form { gap: 13px; }
.staff-card form > label,
.staff-card form legend { color: var(--ink); font-size: 1rem; font-weight: 800; }
.staff-amount { min-height: 112px; border: 2px solid #7765f0; border-radius: 25px; background: #fff; box-shadow: 0 0 0 8px rgba(103, 84, 234, .09); }
.staff-amount input { padding: 0 25px; font-size: clamp(2.4rem, 8vw, 3.35rem); color: #575568; }
.staff-amount span { padding: 0 25px; color: #706c82; font-size: 1rem; }
.staff-card .field-error { margin-top: -5px; }
.staff-payment-options { gap: 14px; margin-top: 11px; }
.staff-payment-options .payment-option { min-height: 106px; border-width: 2px; border-radius: 24px; padding: 16px 24px; }
.staff-payment-options .payment-option input { width: 20px; height: 20px; flex: 0 0 auto; }
.staff-payment-options .payment-option b { color: #e45448; font-size: 1.13rem; }
.staff-payment-options .payment-option small { display: none; }
.staff-payment-options .cash-option:has(input:checked) { border-color: #ff9d87; background: #fff0ea; box-shadow: 0 12px 25px rgba(230, 93, 71, .08); }
.staff-payment-options .transfer-option:has(input:checked) { border-color: #8c7cf2; background: #f0edff; box-shadow: 0 12px 25px rgba(85, 70, 217, .08); }
.staff-card #note { min-height: 66px; border-width: 2px; border-radius: 20px; padding: 0 24px; background: #fbfaff; font-size: 1.06rem; }
.staff-save-button { min-height: 72px; border-radius: 24px; font-size: 1.18rem; }
.staff-hint { margin-top: 10px; font-size: .65rem; }

@media (max-width: 680px) {
  .staff-shell { padding-top: 12px; }
  .staff-header { min-height: 74px; margin-bottom: 9px; }
  .staff-shift { padding: 7px 10px; }
  .staff-card { padding: 20px 16px 22px; }
  .staff-card-heading { margin-bottom: 11px; }
  .staff-card-icon { display: none; }
  .voice-entry > div { display: none; }
  .voice-entry { display: block; width: max-content; margin-left: auto; border: 0; padding: 0; background: transparent; }
  .voice-button { border: 1px solid #dcd8ff; color: var(--purple); background: #f2f0ff; box-shadow: none; }
  .voice-button span { color: var(--purple); }
  .voice-button.listening { color: #fff; }
  .staff-card form { gap: 11px; }
  .staff-card form > label,
  .staff-card form legend { font-size: .92rem; }
  .staff-amount { min-height: 94px; border-radius: 22px; box-shadow: 0 0 0 6px rgba(103, 84, 234, .08); }
  .staff-amount input { padding: 0 17px; font-size: clamp(2.15rem, 11vw, 2.8rem); }
  .staff-amount span { padding: 0 18px; font-size: .86rem; }
  .staff-payment-options { gap: 9px; }
  .staff-payment-options .payment-option { min-height: 88px; border-radius: 20px; padding: 13px 15px; }
  .staff-payment-options .payment-option b { font-size: .94rem; }
  .staff-card #note { min-height: 61px; border-radius: 18px; padding: 0 18px; font-size: .98rem; }
  .staff-save-button { min-height: 66px; border-radius: 21px; font-size: 1.08rem; }
}

@media (max-width: 390px) {
  .staff-header .brand-mark { display: none; }
  .staff-header h1 { font-size: 1.05rem; }
  .staff-payment-options { grid-template-columns: 1fr 1fr; }
  .staff-payment-options .payment-option { min-height: 82px; padding: 11px; }
  .staff-payment-options .payment-option b { font-size: .84rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Admin desktop: khung quản trị gọn, sáng và ưu tiên bảng dữ liệu */
.admin-sidebar { display: none; }

@media (min-width: 900px) {
  .admin-page {
    background: #e9e9eb;
  }
  .admin-page::before,
  .admin-page::after { display: none; }
  .admin-frame {
    display: grid;
    width: min(calc(100% - 24px), 1540px);
    min-height: calc(100vh - 24px);
    margin: 12px auto;
    overflow: clip;
    align-items: start;
    grid-template-columns: 218px minmax(0, 1fr);
    border: 1px solid #dedee3;
    border-radius: 22px;
    background: linear-gradient(to right, #f7f7f8 218px, #fff 218px);
    box-shadow: 0 16px 45px rgba(36, 34, 47, .08);
  }
  .admin-sidebar {
    position: sticky;
    top: 12px;
    display: flex;
    height: calc(100vh - 24px);
    min-width: 0;
    flex-direction: column;
    border-right: 1px solid #e8e8ec;
    padding: 20px 14px 18px;
    background: #f7f7f8;
  }
  .admin-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 7px 28px;
    color: var(--ink);
    font-size: 1.2rem;
    text-decoration: none;
  }
  .admin-sidebar-brand > span {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(145deg, #7869f4, #5141d2);
    box-shadow: 0 8px 18px rgba(85, 70, 217, .22);
    font-size: .9rem;
  }
  .admin-nav-label {
    margin: 0 10px 9px;
    color: #aaa8b3;
    font-size: .6rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
  }
  .admin-sidebar-nav { display: grid; gap: 6px; }
  .admin-sidebar-nav a,
  .admin-sidebar-nav .admin-nav-button {
    display: flex;
    width: 100%;
    min-height: 43px;
    align-items: center;
    gap: 11px;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0 12px;
    color: #777581;
    font-size: .79rem;
    font-weight: 700;
    text-decoration: none;
    text-align: left;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
  }
  .admin-sidebar-nav a span,
  .admin-sidebar-nav .admin-nav-button span {
    width: 18px;
    color: #96939f;
    font-size: 1rem;
    text-align: center;
  }
  .admin-sidebar-nav a:hover,
  .admin-sidebar-nav .admin-nav-button:hover { color: var(--ink); background: #fff; }
  .admin-sidebar-nav a.active {
    border-color: #d8d7dd;
    color: var(--purple);
    background: #fff;
    box-shadow: 0 5px 16px rgba(53, 48, 77, .04);
  }
  .admin-sidebar-nav a.active span { color: var(--purple); }
  .admin-sidebar-bottom {
    display: grid;
    gap: 9px;
    margin-top: auto;
    border-top: 1px solid #e4e4e8;
    padding: 16px 7px 0;
  }
  .admin-sidebar-bottom p { color: #a19faa; font-size: .65rem; }
  .admin-sidebar-bottom button {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: 10px;
    border: 0;
    border-radius: 10px;
    padding: 0 8px;
    color: #777581;
    background: transparent;
    font-size: .77rem;
    font-weight: 700;
  }
  .admin-sidebar-bottom button:hover { color: #c44747; background: #fff; }
  .admin-main {
    display: grid;
    width: 100%;
    max-width: none;
    margin: 0;
    align-content: start;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 0 22px 28px;
    background: #fff;
  }
  .admin-topbar {
    position: sticky;
    top: 0;
    z-index: 4;
    min-height: 76px;
    margin: 0 -22px 2px;
    padding: 0 22px;
    border-bottom: 1px solid #ececf0;
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(16px);
  }
  .admin-topbar .brand-mark { display: none; }
  .admin-topbar .brand-lockup { gap: 0; }
  .admin-topbar .eyebrow { margin-bottom: 3px; font-size: .58rem; }
  .admin-topbar h1 { font-size: 1.18rem; letter-spacing: -.025em; }
  .admin-topbar .today { margin-top: 3px; font-size: .7rem; }
  .admin-topbar .header-action {
    min-height: 42px;
    border-radius: 11px;
    padding: 0 15px;
    box-shadow: none;
    font-size: .75rem;
  }
  .admin-topbar .logout-button { display: none; }
  .admin-main .metrics-section,
  .admin-main .shift-section,
  .admin-main .transactions-section { margin-top: 0; }
  .admin-main .section-heading { align-items: center; }
  .admin-main .section-heading .eyebrow { margin-bottom: 3px; font-size: .58rem; }
  .admin-main .section-heading h2,
  .admin-main .list-header h2 { font-size: 1rem; }
  .admin-main .metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 11px;
  }
  .admin-main .metric-card {
    min-height: 112px;
    border: 1px solid #e8e7ec;
    border-radius: 15px;
    padding: 16px;
    background: #fff;
    box-shadow: none;
    backdrop-filter: none;
  }
  .admin-main .metric-card p { color: #797681; font-size: .7rem; }
  .admin-main .metric-card strong {
    margin-top: 18px;
    color: var(--ink);
    font-size: clamp(1.08rem, 1.7vw, 1.42rem);
  }
  .admin-main .revenue-card { color: var(--ink); }
  .admin-main .revenue-card::before,
  .admin-main .hero-actions { display: none; }
  .admin-main .live-pill {
    border-color: #dedaff;
    color: var(--purple);
    background: #f0eeff;
  }
  .admin-main .live-pill i { background: #7060e8; box-shadow: 0 0 0 4px rgba(112,96,232,.1); }
  .admin-main .cash-card { border-top: 3px solid #f1a28d; }
  .admin-main .transfer-card { border-top: 3px solid #73b9a9; }
  .admin-main .count-card { border-top: 3px solid #8d7ff0; }
  .admin-main .shift-grid { gap: 10px; margin-top: 11px; }
  .admin-main .shift-card {
    border: 1px solid #e8e7ec;
    border-radius: 15px;
    padding: 16px 18px;
    background: #fff;
    box-shadow: none;
  }
  .admin-main .shift-card::after { display: none; }
  .admin-main .shift-card .shift-time { margin: 5px 0 12px; }
  .admin-main .transactions-section {
    border: 1px solid #e3e2e7;
    border-radius: 17px;
    padding: 20px;
    background: #fff;
    box-shadow: none;
    backdrop-filter: none;
  }
  .admin-main .secondary-button {
    min-height: 40px;
    border: 1px solid #dedce8;
    border-radius: 10px;
    padding: 0 13px;
    background: #fff;
    font-size: .72rem;
  }
  .admin-main .filters { margin: 15px 0 12px; }
  .admin-main .filters input,
  .admin-main .filters select { min-height: 40px; border-radius: 10px; background: #fafafd; }
  .admin-main .transaction-list { margin-top: 8px; border-radius: 12px; }
  .admin-main .transaction-column-headings { background: #f7f7f9; }
  .admin-main .transaction-item { padding-top: 15px; padding-bottom: 15px; }
}

@media (min-width: 1200px) {
  .admin-main { grid-template-columns: minmax(0, 1.65fr) minmax(285px, .6fr); }
  .admin-topbar,
  .admin-main .transactions-section { grid-column: 1 / -1; }
  .admin-main .metrics-section { grid-column: 1; }
  .admin-main .shift-section { grid-column: 2; }
  .admin-main .shift-grid { grid-template-columns: 1fr; }
}

/* ===== Doanh thu theo ngày · modal (thêm mới, không sửa lan) ===== */
.daily-modal[hidden] { display: none; }
.daily-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
.daily-modal-backdrop { position: absolute; inset: 0; background: rgba(23, 21, 43, .42); backdrop-filter: blur(3px); }
.daily-modal-card { position: relative; z-index: 1; width: min(760px, 100%); max-height: 88vh; overflow: auto; border: 1px solid rgba(255, 255, 255, .72); border-radius: 26px; background: var(--surface); box-shadow: 0 30px 80px rgba(72, 57, 130, .28); backdrop-filter: blur(18px); padding: 24px 26px; }
body.daily-modal-open { overflow: hidden; }
.daily-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.daily-modal-head h3 { margin: 0; font-size: 1.15rem; letter-spacing: -.02em; }
.daily-modal-tools { display: flex; align-items: center; gap: 12px; }
.daily-range { color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .04em; }
.daily-range select { display: block; min-height: 40px; margin-top: 5px; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; background: #fff; font-weight: 700; color: var(--ink); }
.daily-close-button { flex: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--muted); font-size: 1rem; font-weight: 800; cursor: pointer; }
.daily-close-button:hover { color: var(--ink); background: #f4f2ff; }
.daily-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.daily-table thead th { text-align: right; color: var(--muted); font-size: .7rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 0 12px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.daily-table thead th:first-child { text-align: left; }
.daily-table tbody td { padding: 12px; border-bottom: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.daily-table tbody td:first-child { text-align: left; font-weight: 700; white-space: normal; }
.daily-table tbody tr:hover { background: rgba(85, 70, 217, .035); }
.daily-table .day-sub { display: block; font-size: .68rem; color: var(--muted); font-weight: 600; }
.daily-table .daily-cash { color: #b54c35; font-weight: 700; }
.daily-table .daily-transfer { color: #24715f; font-weight: 700; }
.daily-table .daily-total { font-weight: 800; color: var(--ink); }
.daily-table .daily-cnt { color: var(--muted); font-size: .8rem; }
.daily-table tfoot td { padding: 16px 12px; font-weight: 800; font-size: .95rem; text-align: right; background: rgba(85, 70, 217, .05); }
.daily-table tfoot td:first-child { text-align: left; border-radius: 0 0 0 14px; }
.daily-table tfoot td:last-child { border-radius: 0 0 14px 0; }
.daily-table tfoot .daily-cash { color: #b54c35; }
.daily-table tfoot .daily-transfer { color: #24715f; }
.daily-table tfoot .daily-grand { color: var(--purple-dark); }
.col-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.col-dot.dot-cash { background: var(--cash); }
.col-dot.dot-transfer { background: var(--transfer); }
.daily-loading, .daily-empty { padding: 40px 12px; text-align: center; color: var(--muted); font-weight: 700; }
.daily-empty strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 1rem; }
@media (max-width: 640px) {
  .daily-modal { padding: 12px; }
  .daily-modal-card { padding: 18px 16px; border-radius: 20px; max-height: 92vh; }
  .daily-table thead th:nth-child(2), .daily-table tbody td:nth-child(2), .daily-table tfoot td:nth-child(2) { display: none; }
  .daily-table { font-size: .82rem; }
  .daily-table tbody td, .daily-table thead th { padding: 10px 8px; }
}

/* ===== Biểu đồ tổng doanh số 10 ngày (in-page) ===== */
.daily-chart-block { grid-column: 1 / -1; display: flex; flex-direction: column; min-height: 220px; margin-top: 14px; padding: 20px 22px; }
.daily-chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.daily-chart-head h3 { margin: 2px 0 0; font-size: 1rem; letter-spacing: -.02em; }
.daily-chart-head .eyebrow { margin: 0; }
.daily-chart-head .text-button { min-height: auto; padding: 0; }
.daily-chart { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; height: 180px; padding-top: 10px; }
.chart-col { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 34px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #6f60ea, var(--purple)); box-shadow: 0 8px 16px rgba(85, 70, 217, .18); transition: filter .15s ease; }
.chart-col:hover .chart-bar { filter: brightness(1.08); }
.chart-col.is-today .chart-bar { background: linear-gradient(180deg, #ff9d87, var(--cash)); box-shadow: 0 8px 16px rgba(239, 122, 92, .22); }
.chart-value { font-size: .64rem; font-weight: 800; color: var(--ink); white-space: nowrap; letter-spacing: -.02em; }
.chart-day { font-size: .62rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.daily-chart .daily-loading, .daily-chart .daily-empty { margin: auto; padding: 20px; }
@media (max-width: 640px) {
  .daily-chart-block { min-height: 200px; padding: 16px; }
  .daily-chart { gap: 4px; }
  .chart-value { font-size: .56rem; }
  .chart-day { font-size: .55rem; }
}
