/* ZupZap cafe counter — responsive: sidebar on desktop, stacked + bottom nav on phones */
:root {
  --c-purple: #5B46E8; --c-purple-dark: #4536B8; --c-purple-soft: #EEEBFF; --c-purple-tint: #F4F2FF;
  --c-orange: #FF6B1A; --c-orange-soft: #FFEBDD;
  --c-ink: #1E1B2E; --c-muted: #7A7490; --c-border: #E8E4F3; --c-bg: #F6F5FB;
  --c-green: #1E9B5A; --c-green-soft: #E6F7EE; --c-red: #D8453B;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; background: var(--c-bg); color: var(--c-ink); }
.hide { display: none !important; }

/* shell */
.c-shell { display: grid; grid-template-columns: 262px 1fr; min-height: 100vh; }
.c-side { background: linear-gradient(180deg, #2B2477 0%, #1E1858 100%); color: #fff; padding: 18px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.c-side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; }
.c-side .brand .cup { font-size: 34px; }
.c-side .brand b { display: block; font-size: 26px; font-weight: 900; letter-spacing: -.5px; }
.c-side .brand span { color: #B9B2E6; font-size: 13px; }
.c-nav button { width: 100%; display: flex; align-items: center; gap: 14px; background: none; border: none; color: #DAD5F5; font-size: 16px; padding: 14px 16px; border-radius: 12px; cursor: pointer; text-align: left; margin-bottom: 4px; }
.c-nav button svg { width: 22px; height: 22px; }
.c-nav button.active { background: #6A55F5; color: #fff; font-weight: 700; }
.c-nav button:hover:not(.active) { background: rgba(255,255,255,.08); }
.c-side .foot { margin-top: auto; padding: 0 10px 8px; }
.c-side .foot .art { font-size: 70px; line-height: 1; opacity: .9; }
.c-side .foot p { margin: 6px 0 0; color: #DAD5F5; font-size: 16px; line-height: 1.3; }
.c-side .foot i { display: block; width: 40px; height: 4px; background: var(--c-orange); border-radius: 4px; margin-top: 10px; }
.c-main { min-width: 0; }

/* top bar */
.c-top { display: flex; align-items: center; gap: 18px; padding: 14px 26px; background: #fff; border-bottom: 1px solid var(--c-border); position: sticky; top: 0; z-index: 10; }
.c-top h1 { margin: 0; font-size: 24px; font-weight: 800; }
.c-branch { position: relative; margin-left: 10px; }
.c-branch select { appearance: none; background: #fff; border: 1px solid var(--c-border); border-radius: 12px; padding: 11px 36px 11px 42px; font-size: 15px; font-weight: 600; min-width: 250px; }
.c-branch::before { content: "🏪"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); }
.c-branch::after { content: "⌄"; position: absolute; right: 13px; top: 42%; transform: translateY(-50%); color: var(--c-muted); }
.c-online { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; background: var(--c-green-soft); color: var(--c-green); font-weight: 700; padding: 9px 16px; border-radius: 10px; font-size: 14px; }
.c-online::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #2BB673; }
.c-user { display: flex; align-items: center; gap: 10px; cursor: pointer; padding-left: 18px; border-left: 1px solid var(--c-border); }
.c-user .av { width: 42px; height: 42px; border-radius: 50%; background: var(--c-purple-soft); color: var(--c-purple); display: grid; place-items: center; font-weight: 800; }
.c-user b { display: block; font-size: 15px; } .c-user span { color: var(--c-muted); font-size: 13px; }

/* page */
.c-page { padding: 22px 26px 40px; }
.c-title h2 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.4px; }
.c-title p { margin: 4px 0 18px; color: var(--c-muted); font-size: 16px; }
.c-cols { display: grid; grid-template-columns: 1fr 1.25fr; gap: 20px; align-items: start; }
.card { background: #fff; border: 1px solid var(--c-border); border-radius: 18px; padding: 18px 20px; box-shadow: 0 2px 10px rgba(40,30,90,.04); }
.card h3 { margin: 0 0 14px; font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.card h3 .right { margin-left: auto; display: flex; gap: 54px; color: var(--c-muted); font-size: 14px; font-weight: 600; }

/* scan box */
.scanbox { background: var(--c-purple-tint); border-radius: 16px; padding: 22px 18px 18px; text-align: center; }
.frame { position: relative; width: 260px; height: 260px; margin: 0 auto; display: grid; place-items: center; }
.frame video, .frame .ph { width: 180px; height: 180px; border-radius: 12px; object-fit: cover; background: #fff; }
.frame .ph { display: grid; place-items: center; font-size: 90px; color: #D9D3F4; }
.frame::before, .frame::after, .frame .c3, .frame .c4 { content: ""; position: absolute; width: 50px; height: 50px; border: 5px solid var(--c-purple); border-radius: 12px; }
.frame::before { left: 0; top: 0; border-right: none; border-bottom: none; border-radius: 12px 0 0 0; }
.frame::after { right: 0; top: 0; border-left: none; border-bottom: none; border-radius: 0 12px 0 0; }
.frame .c3 { left: 0; bottom: 0; border-right: none; border-top: none; border-radius: 0 0 0 12px; }
.frame .c4 { right: 0; bottom: 0; border-left: none; border-top: none; border-radius: 0 0 12px 0; }
.scan-hint { color: var(--c-muted); font-size: 15px; margin: 10px 0 14px; }
.scan-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn { border: none; border-radius: 12px; padding: 14px 18px; font-size: 16px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; }
.btn.purple { background: var(--c-purple); color: #fff; }
.btn.orange { background: var(--c-orange); color: #fff; box-shadow: 0 10px 22px rgba(255,107,26,.28); }
.btn.outline { background: #fff; color: var(--c-ink); border: 1px solid var(--c-border); }
.btn.link { background: none; color: var(--c-purple); padding: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }
.manual { margin-top: 12px; display: flex; gap: 10px; }
.manual input { flex: 1; padding: 12px 14px; border: 1px solid var(--c-border); border-radius: 12px; font-size: 14px; }

/* employee card */
.emp { margin-top: 18px; background: var(--c-green-soft); border: 1px solid #CBEBD8; border-radius: 16px; padding: 18px; display: flex; align-items: center; gap: 18px; }
.emp .av { width: 80px; height: 80px; border-radius: 50%; background: #BFE9D1; color: #1E7A48; display: grid; place-items: center; font-size: 26px; font-weight: 800; flex: 0 0 auto; }
.emp b { display: block; font-size: 22px; font-weight: 800; }
.emp .code { color: var(--c-muted); font-size: 16px; }
.emp .meta { color: var(--c-muted); font-size: 15px; margin-top: 2px; }
.emp .ok { color: var(--c-green); font-weight: 700; margin-top: 8px; display: flex; align-items: center; gap: 8px; }
.emp .ok::before { content: "✓"; width: 22px; height: 22px; border-radius: 50%; background: #2BB673; color: #fff; display: grid; place-items: center; font-size: 13px; }
.emp.empty { background: var(--c-purple-tint); border-color: var(--c-border); color: var(--c-muted); justify-content: center; font-size: 15px; }
.checks { margin-top: 12px; background: var(--c-green-soft); border-radius: 12px; padding: 12px 16px; color: var(--c-ink); font-size: 14.5px; display: flex; align-items: center; gap: 10px; }
.checks b { color: var(--c-green); }
.checks::before { content: "🛡️"; }

/* items */
.item { display: grid; grid-template-columns: 82px 1fr 120px 160px; gap: 14px; align-items: center; padding: 12px 14px; border: 1px solid var(--c-border); border-radius: 14px; margin-bottom: 10px; background: #fff; }
.item.sel { background: var(--c-purple-tint); border-color: #CFC6FF; }
.item .ic { width: 82px; height: 64px; border-radius: 12px; background: var(--c-purple-soft); display: grid; place-items: center; font-size: 36px; }
.item .nm { font-size: 18px; font-weight: 800; } .item .ds { color: var(--c-muted); font-size: 14px; }
.item .av b { display: block; font-size: 18px; font-weight: 800; } .item .av span { color: var(--c-muted); font-size: 13.5px; }
.stepper { display: grid; grid-template-columns: 44px 1fr 44px; height: 48px; border: 1px solid var(--c-border); border-radius: 12px; overflow: hidden; background: #fff; }
.stepper button { border: none; background: #fff; font-size: 22px; color: var(--c-ink); cursor: pointer; }
.stepper button:disabled { color: #C9C4DB; }
.stepper .q { display: grid; place-items: center; font-weight: 800; font-size: 18px; border-left: 1px solid var(--c-border); border-right: 1px solid var(--c-border); }
.item.sel .q { color: var(--c-purple); }
.item.off { opacity: .55; }
.summary { margin-top: 14px; background: var(--c-purple-tint); border-radius: 16px; padding: 16px 18px; }
.summary h4 { margin: 0 0 8px; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.summary .lines { color: var(--c-ink); font-size: 15px; padding-bottom: 10px; border-bottom: 1px solid #DDD6F5; min-height: 22px; }
.summary .row { display: flex; justify-content: space-between; margin-top: 8px; font-size: 15px; }
.summary .row b { font-weight: 800; }
.actions { display: grid; grid-template-columns: 1fr 180px; gap: 12px; margin-top: 14px; }
.actions .btn { padding: 16px; font-size: 18px; }
.last { margin-top: 18px; background: #fff; border: 1px solid var(--c-border); border-radius: 14px; padding: 12px 18px; display: flex; align-items: center; gap: 12px; font-size: 15px; }
.last b { font-weight: 800; } .last span { color: var(--c-muted); }

/* done */
.done { text-align: center; padding: 36px 20px; }
.done .big { font-size: 72px; }
.done h3 { justify-content: center; font-size: 26px; }
.done p { color: var(--c-muted); font-size: 16px; }

/* tables (transactions / summary) */
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 12px; border-bottom: 1px solid var(--c-border); }
th { background: #F7F6FC; color: var(--c-muted); font-size: 13.5px; }
td.num, th.num { text-align: right; }
.prod { display: inline-flex; align-items: center; gap: 10px; } .prod i { font-style: normal; font-size: 20px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid var(--c-border); border-radius: 16px; padding: 16px; }
.kpi span { color: var(--c-muted); font-size: 14px; } .kpi b { display: block; font-size: 30px; font-weight: 900; }
.kpi.hi { background: var(--c-purple); border-color: var(--c-purple); color: #fff; } .kpi.hi span { color: #D9D3FF; }
.empty { color: var(--c-muted); text-align: center; padding: 20px; }
.toast { position: fixed; right: 22px; bottom: 22px; background: var(--c-ink); color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 14px; z-index: 100; max-width: 420px; }
.toast.ok { background: var(--c-green); } .toast.err { background: var(--c-red); }

/* mobile-only bits */
.m-top, .m-nav, .m-bar { display: none; }

/* login */
.c-login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #EEEBFF, #FFF1E6); padding: 20px; }
.c-login .box { width: 100%; max-width: 420px; background: #fff; border-radius: 22px; padding: 30px 26px; box-shadow: 0 16px 40px rgba(40,30,90,.12); }
.c-login .brand { font-weight: 900; font-size: 34px; } .c-login .brand .zup { color: var(--c-purple); } .c-login .brand .zap { color: var(--c-orange); }
.c-login .sub { color: var(--c-muted); margin-bottom: 8px; }
.c-login label { display: block; font-size: 13px; color: var(--c-muted); margin: 12px 0 6px; }
.c-login input { width: 100%; padding: 13px 14px; font-size: 15px; border: 1px solid var(--c-border); border-radius: 12px; }
.c-login .btn { width: 100%; margin-top: 18px; }

/* ---------- phone layout ---------- */
@media (max-width: 900px) {
  .c-shell { grid-template-columns: 1fr; }
  .c-side, .c-top { display: none; }
  .m-top { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 6px; }
  .m-top .brand b { font-size: 28px; font-weight: 900; letter-spacing: -.5px; }
  .m-top .brand b .zup { color: var(--c-purple); } .m-top .brand b .zap { color: var(--c-orange); }
  .m-top .brand span { display: block; color: var(--c-muted); font-size: 14px; margin-top: -2px; }
  .m-top .right { display: flex; align-items: center; gap: 14px; }
  .m-top .on { display: inline-flex; align-items: center; gap: 7px; color: var(--c-ink); font-size: 15px; }
  .m-top .on::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #2BB673; }
  .m-top .av { width: 48px; height: 48px; border-radius: 50%; background: var(--c-purple-soft); color: var(--c-purple); display: grid; place-items: center; font-weight: 800; }
  .c-page { padding: 8px 18px 150px; }
  .c-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .c-title h2 { font-size: 27px; } .c-title p { display: none; }
  .c-title .c-branch { margin: 0; } .c-title .c-branch select { min-width: 0; padding: 10px 32px 10px 36px; font-size: 14px; }
  .c-cols { grid-template-columns: 1fr; gap: 14px; }
  .card { padding: 0; border: none; background: transparent; box-shadow: none; }
  .card > h3 { font-size: 22px; margin: 6px 0 10px; } .card h3 .right { display: none; }
  .card.scan > h3 { display: none; }
  .scanbox { border-radius: 22px; padding: 26px 18px 20px; }
  .frame { width: 220px; height: 220px; } .frame video, .frame .ph { width: 150px; height: 150px; }
  .scan-btns { grid-template-columns: 1fr; gap: 6px; }
  .scan-btns .purple { background: var(--c-orange); border-radius: 999px; padding: 16px; font-size: 17px; box-shadow: 0 10px 22px rgba(255,107,26,.28); }
  .scan-btns .outline { background: none; border: none; color: var(--c-purple); font-weight: 700; }
  .emp { padding: 14px; gap: 14px; margin-top: 14px; border-radius: 18px; }
  .emp .av { width: 64px; height: 64px; font-size: 20px; }
  .emp b { font-size: 19px; } .emp .meta { display: none; }
  .emp .ok { position: absolute; right: 32px; margin: 0; background: #CDEFDB; padding: 6px 12px; border-radius: 999px; font-size: 14px; }
  .emp { position: relative; } .checks { display: none; }
  .item { grid-template-columns: 56px 1fr 140px; padding: 10px 12px; border-radius: 16px; }
  .item .ic { width: 56px; height: 56px; border-radius: 50%; font-size: 28px; }
  .item .nm { font-size: 17px; } .item .ds { display: none; }
  .item .av { grid-column: 2; grid-row: 2; } .item .av b { display: none; } .item .av span::before { content: attr(data-left) " "; font-weight: 600; color: var(--c-ink); }
  .item > div:nth-child(2) { grid-row: 1; }
  .item .av span { font-size: 14px; }
  .stepper { grid-column: 3; grid-row: 1 / span 2; height: 50px; border-radius: 999px; }
  .stepper button { border-radius: 50%; } .stepper button:last-child { background: var(--c-purple); color: #fff; }
  .stepper .q { border: none; }
  .summary, .actions, .last, .checks { display: none; }
  .m-bar { display: flex; position: fixed; left: 12px; right: 12px; bottom: 78px; background: #fff; border: 1px solid var(--c-border); border-radius: 22px; padding: 10px 10px 10px 14px; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(40,30,90,.14); z-index: 20; }
  .m-bar .bk { width: 48px; height: 48px; border-radius: 14px; background: var(--c-purple-soft); display: grid; place-items: center; font-size: 22px; }
  .m-bar .t { flex: 1; min-width: 0; } .m-bar .t b { display: block; font-size: 15px; } .m-bar .t span { color: var(--c-muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .m-bar .btn { border-radius: 999px; padding: 14px 18px; font-size: 15px; }
  .m-nav { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 1px solid var(--c-border); justify-content: space-around; padding: 10px 0 max(10px, env(safe-area-inset-bottom)); z-index: 20; }
  .m-nav button { background: none; border: none; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--c-muted); font-size: 12.5px; min-width: 70px; cursor: pointer; }
  .m-nav button svg { width: 24px; height: 24px; }
  .m-nav button.active { color: var(--c-purple); font-weight: 700; }
  .m-nav button.active::after { content: ""; width: 40px; height: 3px; background: var(--c-purple); border-radius: 3px; margin-top: 2px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  table { font-size: 13.5px; } th, td { padding: 10px 8px; }
}
