/* Admin shell: bottom tab bar on phones, sidebar on tablets/desktops. */
.shell { min-height: 100vh; min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); padding: calc(6px + var(--safe-t)) 10px 6px 14px; display: flex; align-items: center; gap: 10px; }
.topbar .brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.topbar .brand img { width: 34px; height: 34px; border-radius: 9px; }
.topbar .brand b { font-family: var(--display); font-size: 17px; color: #129A8F; }
.topbar .brand small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .04em; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; }
.live-dot.on { background: #3BB273; box-shadow: 0 0 0 3px color-mix(in srgb, #3BB273 25%, transparent); }
.bell { position: relative; } .bell .count { position: absolute; top: 6px; right: 5px; min-width: 17px; height: 17px; border-radius: 9px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }

main.page { padding: 16px 14px calc(96px + var(--safe-b)); max-width: 1100px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 2px; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); padding-bottom: var(--safe-b); }
.tabbar a, .tabbar button { display: grid; justify-items: center; gap: 2px; padding: 8px 0 7px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; background: none; border: 0; cursor: pointer; }
.tabbar .on { color: var(--brand-ink); }
.tabbar .scan-fab { margin-top: -22px; }
.tabbar .scan-fab span.fab { width: 56px; height: 56px; border-radius: 18px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; box-shadow: var(--shadow-lg); }
.sidebar { display: none; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 240px 1fr; }
  .sidebar { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; padding: 18px 12px; border-right: 1px solid var(--line); background: var(--surface-2); overflow-y: auto; }
  .sidebar .logo { padding: 4px 8px 18px; } .sidebar .logo img { width: 100%; max-width: 200px; }
  .sidebar a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
  .sidebar a:hover { background: var(--line-2); } .sidebar a.on { background: var(--brand); color: var(--on-brand); }
  .sidebar .sep { height: 1px; background: var(--line); margin: 10px 8px; }
  .tabbar { display: none; } .topbar .brand { visibility: hidden; }
  main.page { padding: 24px 28px 40px; }
  .stats { grid-template-columns: repeat(4, 1fr); } .stat.hero { grid-column: span 2; }
  .two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }
}

/* POS */
.pos { display: grid; gap: 14px; }
.pos-search { position: sticky; top: calc(58px + var(--safe-t)); z-index: 5; background: var(--bg); padding: 4px 0 8px; }
.prod-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 600px) { .prod-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .prod-grid { grid-template-columns: repeat(4, 1fr); } }
.prod { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; cursor: pointer; display: grid; gap: 4px; min-height: 92px; color: var(--ink); }
.prod:active { transform: scale(.98); }
.prod .n { font-weight: 600; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod .p { font-weight: 700; color: var(--brand-ink); }
.prod.out { opacity: .55; }
.cart-bar { position: fixed; left: 10px; right: 10px; bottom: calc(70px + var(--safe-b)); z-index: 35; }
.cart-bar .btn { width: 100%; min-height: 56px; justify-content: space-between; font-size: 16px; box-shadow: var(--shadow-lg); }
@media (min-width: 960px) {
  .pos { grid-template-columns: 1fr 380px; align-items: start; }
  .cart-panel { position: sticky; top: 80px; } .cart-bar { display: none; }
}
@media (max-width: 959px) { .cart-panel { display: none; } }
.receipt { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; padding: 14px; }

.action-now { border-left: 4px solid var(--red); } .action-soon { border-left: 4px solid var(--accent); }
.action-slow, .action-over { border-left: 4px solid var(--blue); }
.briefing { white-space: pre-wrap; line-height: 1.6; }
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 18px; }
.login-card { width: 100%; max-width: 400px; }
.login-card .logo { width: 100%; max-width: 300px; display: block; margin: 0 auto 22px; }
.chart-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 6px; }
.chart-bars > div { flex: 1; background: var(--brand-soft); border-radius: 5px 5px 2px 2px; position: relative; min-height: 2px; }
.chart-bars > div.cur { background: var(--brand-ink); }
.chart-axis { display: flex; gap: 3px; font-size: 10px; color: var(--faint); } .chart-axis > span { flex: 1; text-align: center; }
@media print {
  .topbar, .tabbar, .sidebar, .cart-bar, .no-print { display: none !important; }
  body { background: #fff; } main.page { padding: 0; }
  .print-area { display: block !important; }
}

#cs > .spread h2 { display: none; }
#cs > .spread { justify-content: flex-end; }

/* cash drawers */
.drawer-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .drawer-grid { grid-template-columns: 1fr 1fr; } }
.drawer-card { border-color: var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
.stream-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .stream-grid { grid-template-columns: 1fr 1fr; } }
.stream-card ul { margin: 6px 0 0; padding-left: 18px; }
.stream-card li { margin: 3px 0; }
