:root {
  --bg: #f4f7fc;
  --surface: #ffffff;
  --surface-blue: #eaf3ff;
  --text: #10213b;
  --muted: #6f7d91;
  --blue: #0759cf;
  --blue-dark: #003c97;
  --red: #ed1b2f;
  --green: #149962;
  --border: #e1e9f4;
  --shadow: 0 15px 40px rgba(22, 56, 105, .10);
  --radius: 21px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
button, input, textarea, select { font: inherit; }
button, a { touch-action: manipulation; }
.hidden { display: none !important; }

.state-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 14px; padding: 30px; text-align: center; background: var(--bg); }
.state-screen h1 { margin: 4px 0 0; font-size: 26px; }
.state-screen p { max-width: 320px; margin: 0; color: var(--muted); line-height: 1.55; }
.state-mascot-ring { width: 150px; height: 150px; display: grid; place-items: center; overflow: hidden; border: 7px solid white; border-radius: 50%; background: linear-gradient(145deg, #e6f1ff, #fff); box-shadow: 0 0 0 3px var(--blue), var(--shadow); }
.state-mascot-ring.error-ring { box-shadow: 0 0 0 3px var(--red), var(--shadow); }
.state-mascot-ring img { width: 135px; height: 135px; object-fit: contain; }
.web-login { min-height: 100vh; }
.web-login-card { width: min(100%, 390px); margin-top: 2px; padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: #fff; box-shadow: var(--shadow); text-align: left; }
.web-login-card .button.wide { margin: 8px 0 12px; }
.web-login-card p { max-width: none; min-height: 20px; font-size: 12px; }
.spinner { width: 28px; height: 28px; border: 3px solid #d8e3f2; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.app-shell { max-width: 760px; margin: 0 auto; min-height: 100vh; padding-bottom: 94px; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; background: rgba(244,247,252,.93); border-bottom: 1px solid var(--border); backdrop-filter: blur(16px); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.brand-row { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-row strong { display: block; font-size: 13px; letter-spacing: .08em; }
.brand-row > div:last-child { min-width: 0; }
.brand-row > div:last-child span { display: block; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.header-avatar { width: 45px; height: 45px; flex: 0 0 auto; display: grid; place-items: center; overflow: hidden; border: 3px solid #fff; border-radius: 50%; background: var(--surface-blue); box-shadow: 0 0 0 2px var(--blue); }
.header-avatar img { width: 42px; height: 42px; object-fit: contain; }
.live-pill { display: flex; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--green); background: #fff; font-size: 10px; font-weight: 800; }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: #22bb70; box-shadow: 0 0 0 4px rgba(34,187,112,.12); }
.live-pill.offline { color: var(--red); }
.live-pill.offline i { background: var(--red); box-shadow: 0 0 0 4px rgba(237,27,47,.12); }

.network-state { position: sticky; z-index: 19; top: 68px; margin: 8px 12px 0; padding: 10px; display: grid; grid-template-columns: 46px 1fr auto; align-items: center; gap: 9px; border: 1px solid #ffd1d7; border-radius: 17px; background: #fff1f3; box-shadow: var(--shadow); }
.network-state img { width: 44px; height: 44px; object-fit: contain; }
.network-state b { display: block; font-size: 12px; }
.network-state p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }

main { padding: 16px; }
.view { display: none; animation: rise .22s ease-out; }
.view.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
h1 { margin: 2px 0 0; font-size: 27px; letter-spacing: -.03em; }
h2 { margin: 22px 2px 11px; font-size: 17px; }
.eyebrow { display: inline-block; color: var(--blue); font-size: 10px; line-height: 1.4; letter-spacing: .12em; font-weight: 900; }
.muted, .empty { color: var(--muted); font-size: 12px; line-height: 1.55; }
.empty { padding: 12px 0; text-align: center; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

.home-overview { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.price-card, .balance-first { min-height: 155px; padding: 17px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; border-radius: 25px; box-shadow: var(--shadow); }
.price-card { position: relative; color: #fff; background: radial-gradient(circle at 100% 0, rgba(255,255,255,.22), transparent 36%), linear-gradient(145deg, #0867eb, var(--blue-dark)); }
.price-card::after { content: "O"; position: absolute; right: -11px; top: -25px; color: rgba(255,255,255,.09); font-size: 115px; font-weight: 900; }
.balance-first { border: 1px solid #dbe8fa; color: var(--text); background: linear-gradient(150deg, #fff, #edf5ff); }
.price-card span, .balance-first span { position: relative; z-index: 1; margin-bottom: auto; color: rgba(255,255,255,.76); font-size: 9px; font-weight: 900; letter-spacing: .11em; }
.balance-first span { color: var(--blue); }
.price-card strong, .balance-first strong { position: relative; z-index: 1; display: block; font-size: clamp(27px, 8vw, 39px); line-height: 1; letter-spacing: -.05em; white-space: nowrap; }
.balance-first strong { color: var(--blue); }
.balance-first strong.locked-home { font-size: clamp(20px, 6vw, 28px); line-height: 1.05; white-space: normal; }
.price-card small, .balance-first small { position: relative; z-index: 1; margin-top: 5px; color: rgba(255,255,255,.72); font-size: 10px; }
.balance-first small { color: var(--muted); }

.role-tools { display: flex; gap: 9px; margin-top: 11px; }
.role-button { flex: 1; min-height: 48px; padding: 9px 12px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #cfe0f7; border-radius: 15px; color: var(--blue); background: #fff; cursor: pointer; }
.role-button span { font-size: 20px; }
.role-button b { font-size: 12px; }

.status-progress-card { margin-top: 13px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: 0 8px 24px rgba(22,56,105,.05); }
.status-main { display: flex; align-items: center; gap: 11px; }
.status-icon { width: 45px; height: 45px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 14px; background: var(--surface-blue); font-size: 23px; }
.status-copy { min-width: 0; }
.status-copy span { display: block; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .09em; }
.status-copy b { display: block; margin-top: 2px; font-size: 14px; }
.status-copy p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.visits-left { margin-left: auto; color: var(--blue); font-size: 25px; text-align: center; }
.visits-left small { display: block; color: var(--muted); font-size: 8px; font-weight: 700; }
.progress-label { display: flex; justify-content: space-between; margin-top: 13px; color: var(--muted); font-size: 9px; }
.progress { height: 8px; margin: 6px 0 2px; overflow: hidden; border-radius: 999px; background: #e7eef8; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #4c95ff); }

.friday-banner { position: relative; min-height: 120px; margin-top: 13px; padding: 16px 105px 16px 17px; overflow: hidden; border-radius: 22px; color: #fff; background: linear-gradient(135deg, #ef2438, #b90719); box-shadow: 0 13px 30px rgba(210,17,38,.2); }
.friday-banner h2 { margin: 8px 0 4px; font-size: 19px; }
.friday-banner p { margin: 0; color: rgba(255,255,255,.8); font-size: 11px; line-height: 1.4; }
.friday-banner img { position: absolute; right: 2px; bottom: -4px; width: 108px; height: 108px; object-fit: contain; }
.friday-tag { padding: 4px 7px; border-radius: 7px; color: var(--red); background: #fff; font-size: 9px; font-weight: 900; letter-spacing: .08em; }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick-card { min-height: 82px; padding: 9px 4px; display: grid; justify-items: center; align-content: center; gap: 7px; border: 1px solid var(--border); border-radius: 17px; color: var(--text); background: #fff; cursor: pointer; }
.quick-card span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: var(--surface-blue); font-size: 18px; }
.quick-card:nth-child(2) span { color: var(--red); background: #fff0f2; }
.quick-card b { font-size: 10px; }

.panel { margin-top: 13px; padding: 17px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; box-shadow: 0 8px 24px rgba(22,56,105,.04); }
.panel summary { cursor: pointer; font-weight: 850; list-style: none; }
.panel summary::-webkit-details-marker { display: none; }
.panel summary::after { content: "+"; float: right; color: var(--muted); font-size: 20px; }
.panel[open] summary::after { content: "−"; }
#info-panel p { white-space: pre-line; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 16px; }
.heading-actions { display: flex; gap: 7px; }
.role-badge { display: inline-flex; margin-top: 7px; padding: 5px 9px; border-radius: 999px; color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-dark)); font-size: 9px; font-weight: 900; letter-spacing: .06em; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 14px; color: var(--blue); background: #fff; font-size: 21px; cursor: pointer; }
.stats-row, .stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.stat { padding: 13px; border: 1px solid var(--border); border-radius: 17px; background: #fff; }
.stat span { display: block; color: var(--muted); font-size: 9px; }
.stat b { display: block; margin-top: 5px; color: var(--blue); font-size: 18px; }

label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; font-weight: 750; }
input, textarea, select { width: 100%; min-height: 48px; padding: 12px 13px; outline: none; border: 1px solid var(--border); border-radius: 13px; color: var(--text); background: var(--bg); }
textarea { min-height: 110px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(7,89,207,.1); }
.input-action { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.form-stack { display: grid; gap: 9px; margin-top: 14px; }
.form-top { margin-top: 14px; }
.button { min-height: 48px; padding: 0 17px; border: 0; border-radius: 13px; font-weight: 850; cursor: pointer; }
.button.primary { color: #fff; background: var(--blue); }
.button.secondary { border: 1px solid #cfe0f7; color: var(--blue-dark); background: var(--surface-blue); }
.button.danger { color: #fff; background: var(--red); }
.button.wide { width: 100%; margin-top: 9px; }
.button.compact { min-height: 36px; padding: 0 10px; font-size: 10px; }
.button:disabled { opacity: .55; cursor: wait; }
.staff-card { border-left: 3px solid var(--blue); }
.role-chip { padding: 5px 8px; border-radius: 999px; color: var(--blue-dark); background: var(--surface-blue); font-size: 9px; font-weight: 900; }
.role-chip.pro-admin { color: #fff; background: linear-gradient(135deg, #0759cf, #ed1b2f); }
.role-chip.super-admin { color: #fff; background: var(--blue-dark); }
.role-chip.cashier { color: #fff; background: var(--green); }
.protected-note { align-self: center; color: var(--muted); font-size: 10px; font-weight: 750; }

.loyalty-flip-wrap { width: min(100%, 350px); aspect-ratio: .74; margin: 0 auto; perspective: 1400px; }
.loyalty-flip { position: relative; width: 100%; height: 100%; padding: 0; border: 0; appearance: none; background: transparent; transform-style: preserve-3d; -webkit-transform-style: preserve-3d; cursor: pointer; }
.loyalty-face { position: absolute; inset: 0; padding: 24px; display: flex; flex-direction: column; overflow: hidden; border-radius: 30px; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: 0 20px 44px rgba(0,60,151,.22); text-align: left; transform-origin: center; transition: transform .65s cubic-bezier(.2,.75,.25,1), opacity .16s ease; }
.loyalty-front { color: #fff; background: radial-gradient(circle at 93% 8%, rgba(255,255,255,.24), transparent 28%), linear-gradient(140deg, #0868ed, #003c97); transform: rotateY(0deg); opacity: 1; visibility: visible; }
.loyalty-front::after { content: ""; position: absolute; right: -76px; bottom: -68px; width: 230px; height: 230px; border: 30px solid rgba(237,27,47,.84); border-radius: 50%; }
.portrait-brand, .loyalty-bottom { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.portrait-brand b { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .08em; }
.portrait-brand b i { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--red); background: #fff; font-size: 17px; font-style: normal; font-weight: 950; }
.portrait-brand > small { color: rgba(255,255,255,.72); font-size: 8px; font-weight: 850; letter-spacing: .12em; }
.portrait-status { position: relative; z-index: 1; width: max-content; margin-top: 22px; padding: 7px 10px; border: 1px solid rgba(255,255,255,.3); border-radius: 999px; background: rgba(255,255,255,.11); font-size: 10px; font-weight: 800; }
.loyalty-balance-label { position: relative; z-index: 1; margin-top: 48px; color: rgba(255,255,255,.72); font-size: 11px; }
.loyalty-balance { position: relative; z-index: 1; margin-top: 4px; font-size: clamp(38px, 12vw, 48px); line-height: 1; font-weight: 900; letter-spacing: -.05em; }
.loyalty-balance small { font-size: 12px; font-weight: 700; letter-spacing: 0; }
.portrait-owner { position: relative; z-index: 1; margin-top: 34px; }
.portrait-owner small, .portrait-owner b { display: block; }
.portrait-owner small { color: rgba(255,255,255,.65); font-size: 8px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.portrait-owner b { max-width: 88%; margin-top: 4px; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.loyalty-bottom { margin-top: auto; font-size: 10px; }
.loyalty-bottom b { letter-spacing: .12em; }
.loyalty-bottom i { max-width: 45%; color: rgba(255,255,255,.72); font-size: 9px; font-style: normal; line-height: 1.35; text-align: right; }
.loyalty-back { align-items: center; border: 2px solid #d8e8fb; color: var(--text); background: linear-gradient(155deg, #fff, #eaf3ff); transform: rotateY(-180deg); opacity: 0; visibility: hidden; pointer-events: none; text-align: center; }
.loyalty-flip.flipped .loyalty-front { transform: rotateY(180deg); opacity: 0; visibility: hidden; pointer-events: none; }
.loyalty-flip.flipped .loyalty-back { transform: rotateY(0deg); opacity: 1; visibility: visible; pointer-events: auto; }
.qr-card-heading b, .qr-card-heading small { display: block; }
.qr-card-heading b { color: var(--blue); font-size: 20px; }
.qr-card-heading small { max-width: 245px; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.4; }
#qr-image { width: min(230px, 74vw); height: min(230px, 74vw); margin-top: 15px; padding: 8px; display: grid; place-items: center; overflow: hidden; border: 1px solid #d7e5f6; border-radius: 22px; background: #fff; box-shadow: 0 10px 25px rgba(7,89,207,.1); }
#qr-image img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.qr-card-details { margin-top: 13px; }
.qr-card-details small, .qr-card-details b, .qr-card-details i { display: block; }
.qr-card-details small { color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.qr-card-details b { margin-top: 3px; color: var(--blue-dark); font-size: 17px; letter-spacing: .12em; }
.qr-card-details i { max-width: 260px; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 10px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.qr-flip-back { margin-top: auto; color: var(--blue); font-size: 9px; font-weight: 800; }
.qr-error { color: var(--red); font-size: 9px; }
.qr-retry { min-height: 38px; padding: 0 10px; border: 0; border-radius: 10px; color: #fff; background: var(--blue); font-size: 9px; font-weight: 850; cursor: pointer; }
.card-status-panel { margin-top: 14px; }
.receipt-head, .member-head, .history-head { display: flex; justify-content: space-between; gap: 10px; }
.badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; color: var(--blue); background: var(--surface-blue); font-size: 9px; font-weight: 850; }

.receipt-list { display: grid; gap: 12px; }
.electronic-receipt { overflow: hidden; border: 1px solid #cfe0f7; border-radius: 21px; background: #fff; box-shadow: 0 10px 28px rgba(7,89,207,.08); }
.receipt-brand { padding: 13px 14px; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px; color: #fff; background: linear-gradient(120deg, var(--blue), var(--blue-dark)); }
.receipt-brand > span { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 9px; color: var(--red); background: #fff; font-size: 18px; font-weight: 900; }
.receipt-brand b, .receipt-brand small { display: block; }
.receipt-brand b { font-size: 11px; letter-spacing: .08em; }
.receipt-brand small { margin-top: 2px; color: rgba(255,255,255,.7); font-size: 9px; }
.receipt-brand i { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; color: var(--blue); background: #fff; font-style: normal; font-weight: 900; }
.receipt-number { padding: 12px 14px 8px; display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.receipt-number b { color: var(--text); font-family: ui-monospace, monospace; }
.receipt-lines { padding: 0 14px 8px; }
.receipt-lines p { margin: 0; padding: 8px 0; display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed #dbe5f2; font-size: 11px; }
.receipt-lines span { color: var(--muted); }
.receipt-lines b { text-align: right; }
.receipt-lines .receipt-coins b { color: var(--green); font-size: 13px; }
.receipt-lines .receipt-locked b { color: var(--blue); }
.receipt-foot { padding: 10px 14px; color: var(--blue); background: var(--surface-blue); font-size: 9px; font-weight: 800; text-align: center; }
.locked-balance { max-width: 100%; font-size: clamp(25px, 8vw, 38px) !important; }
.reward-lock-note { margin-top: 12px; padding: 10px 12px; border: 1px solid #cfe0f7; border-radius: 13px; color: var(--blue-dark); background: var(--surface-blue); font-size: 10px; line-height: 1.45; }
.activity-summary { margin-bottom: 12px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.activity-summary > div { padding: 13px; border: 1px solid var(--border); border-radius: 16px; background: #fff; }
.activity-summary span, .activity-summary b { display: block; }
.activity-summary span { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .08em; }
.activity-summary b { margin-top: 5px; color: var(--blue-dark); font-size: 17px; }

.empty-state { min-height: 350px; padding: 34px 20px; display: grid; place-content: center; justify-items: center; text-align: center; }
.empty-state img { width: 170px; height: 170px; object-fit: contain; }
.empty-state h2 { margin: 12px 0 5px; }
.empty-state p { max-width: 290px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.contact-card { width: 100%; margin-top: 10px; padding: 14px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 11px; border: 1px solid var(--border); border-radius: 18px; color: var(--text); background: #fff; text-align: left; }
.contact-card > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: var(--blue); background: var(--surface-blue); font-size: 21px; }
.contact-card b { font-size: 13px; }
.contact-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; white-space: pre-line; }
.contact-card i { color: var(--blue); font-size: 22px; font-style: normal; }
button.contact-card { cursor: pointer; }
.navigator-list { display: grid; gap: 8px; margin-top: 14px; }
.navigator-option { min-height: 53px; padding: 10px 12px; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 14px; color: var(--text); text-decoration: none; }
.navigator-option span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; color: var(--blue); background: var(--surface-blue); font-weight: 900; }
.navigator-option i { color: var(--blue); font-style: normal; font-size: 20px; }

.customer-identity { margin: 12px 0 14px; display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 11px; }
.customer-photo { width: 64px; height: 64px; display: grid; place-items: center; overflow: hidden; border: 3px solid #fff; border-radius: 50%; background: var(--surface-blue); box-shadow: 0 0 0 2px var(--blue); }
.customer-photo img { width: 60px; height: 60px; object-fit: contain; }
.customer-identity h2 { margin: 0 0 3px; font-size: 17px; }
.customer-identity p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.customer-confirm-note { margin: 0 0 14px; padding: 9px 11px; border-radius: 12px; color: #655319; background: #fff8da; font-size: 10px; line-height: 1.45; }
.summary-lines { margin-top: 11px; }
.summary-lines p { margin: 0; padding: 10px 0; display: flex; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--border); font-size: 12px; }
.summary-lines span { color: var(--muted); }
#scanner-video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 17px; background: #081425; }
#scanner-panel p { color: var(--muted); font-size: 11px; text-align: center; }

.member-list, .history-list { display: grid; gap: 8px; margin-top: 13px; }
.member, .history-item { padding: 13px; border: 1px solid var(--border); border-radius: 15px; background: var(--bg); }
.member p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.member-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.member-actions .button { min-height: 36px; padding: 0 11px; font-size: 10px; }
.history-head span { color: var(--muted); font-size: 9px; }
.history-item p { margin: 7px 0; color: var(--blue); font-size: 12px; }
.history-item small { color: var(--muted); font-size: 9px; line-height: 1.5; }
.pagination { margin-top: 13px; display: flex; justify-content: center; align-items: center; gap: 9px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 13px; }
.setting-row p { margin: 4px 0 0; }
.analytics-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.analytics-toolbar p { margin: 4px 0 0; }
.analytics-toolbar select { width: auto; min-width: 112px; }
.analytics-summary { margin-top: 13px; }
.analytics-subheading { margin-top: 17px; padding-top: 14px; display: flex; align-items: end; justify-content: space-between; gap: 10px; border-top: 1px solid var(--border); }
.analytics-subheading span { color: var(--muted); font-size: 8px; }
.cashier-analytics-list { display: grid; gap: 8px; margin-top: 10px; }
.cashier-analytics-card { padding: 12px; border: 1px solid var(--border); border-radius: 15px; background: var(--bg); }
.analytics-lines { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px 12px; margin-top: 8px; }
.analytics-lines p { margin: 0; padding-top: 6px; border-top: 1px dashed #dbe5f2; font-size: 9px; }
.analytics-lines span, .analytics-lines b { display: block; }
.analytics-lines span { color: var(--muted); }
.analytics-lines b { margin-top: 3px; color: var(--blue-dark); }
.toggle { position: relative; width: 52px; height: 30px; flex: 0 0 auto; margin: 0; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span { position: absolute; inset: 0; border-radius: 999px; background: #cfd8e6; transition: .2s; cursor: pointer; }
.toggle span::after { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.18); transition: .2s; }
.toggle input:checked + span { background: var(--blue); }
.toggle input:checked + span::after { transform: translateX(22px); }

.bottom-nav { position: fixed; z-index: 30; left: 50%; bottom: max(9px, env(safe-area-inset-bottom)); width: min(calc(100% - 18px), 720px); padding: 6px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--border); border-radius: 22px; background: rgba(255,255,255,.95); box-shadow: 0 17px 48px rgba(15,48,94,.18); backdrop-filter: blur(18px); transform: translateX(-50%); }
.nav-button { min-height: 56px; padding: 4px 2px; border: 0; border-radius: 16px; color: #8491a4; background: transparent; font-size: 9px; font-weight: 800; cursor: pointer; }
.nav-button span { display: block; margin-bottom: 3px; font-size: 19px; }
.nav-button.active { color: var(--blue); background: var(--surface-blue); }

.modal { position: fixed; inset: 0; z-index: 100; padding: 14px; display: flex; align-items: flex-end; background: rgba(4,18,40,.56); backdrop-filter: blur(5px); }
.modal-card { position: relative; width: min(100%, 720px); max-height: 90vh; margin: 0 auto; padding: 23px; overflow: auto; border-radius: 26px; background: #fff; animation: sheet .2s ease-out; }
@keyframes sheet { from { opacity: 0; transform: translateY(30px); } }
.modal-close { position: absolute; z-index: 2; top: 11px; right: 13px; width: 38px; height: 38px; border: 0; border-radius: 12px; background: var(--bg); font-size: 23px; cursor: pointer; }
.divider { margin: 17px 0 8px; display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 10px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.success-popup { text-align: center; }
.success-popup > img { width: 145px; height: 145px; object-fit: contain; }
.success-popup h1 { margin-top: 0; }
.success-popup > p { color: var(--muted); font-size: 12px; }
.success-popup > p b { color: var(--green); font-size: 18px; }
.success-popup .electronic-receipt { margin-top: 16px; text-align: left; }
.delivery-note { margin-bottom: 0; }
.toast { position: fixed; z-index: 120; left: 50%; bottom: 92px; width: max-content; max-width: calc(100% - 30px); padding: 11px 15px; border-radius: 13px; color: #fff; background: var(--blue-dark); box-shadow: var(--shadow); font-size: 11px; text-align: center; transform: translateX(-50%); }
.toast.error { background: var(--red); }

@media (max-width: 390px) {
  main { padding: 13px; }
  .price-card, .balance-first { min-height: 142px; padding: 14px; }
  .quick-grid { gap: 6px; }
  .quick-card { min-height: 78px; }
  .customer-identity { grid-template-columns: 58px 1fr; }
  .customer-identity .badge { grid-column: 1 / -1; width: max-content; }
  .customer-photo { width: 58px; height: 58px; }
  .customer-photo img { width: 54px; height: 54px; }
}

@media (min-width: 620px) {
  main { padding: 22px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

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