/* Roll Rumble — admin panel styles */

/* Brand: Roll Rumble yellow (#ffd80f, sampled from the logo) on black. */
:root {
  --bg: #f5f3ec;
  --surface: #ffffff;
  --surface-2: #faf8f2;
  --ink: #121212;
  --ink-2: #36332e;
  --muted: #6f6a60;
  --line: #ebe7dd;
  --line-2: #dcd6c8;
  --accent: #ffd80f;
  --accent-hover: #f2c900;
  --accent-ink: #121212;
  --accent-soft: #fff5c4;
  --cash: #1f8a5c;
  --cash-ink: #136641;
  --cash-soft: #dcf2e7;
  --upi: #5b4fd1;
  --upi-ink: #3d33a6;
  --upi-soft: #e7e4fb;
  --danger: #cf3b3b;
  --danger-ink: #9b2323;
  --danger-soft: #fbe4e4;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(28, 26, 31, .04), 0 6px 20px rgba(28, 26, 31, .05);
  --shadow-lg: 0 24px 64px rgba(28, 26, 31, .22);
  --sidebar-w: 244px;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --display: 'Archivo Black', 'Inter', system-ui, sans-serif;
  --mono: 'DM Mono', ui-monospace, Consolas, monospace;
  --tabbar-h: 0px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 500 15px/1.5 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
p { margin: 0 0 12px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.ic { width: 18px; height: 18px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mobile-only { display: none; }
[hidden] { display: none !important; }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px 14px 16px;
  background: var(--ink); color: #f0e8e0;
  --mark-ink: var(--ink);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; }
.brand .mark { color: #f0e8e0; flex: none; }
.sidebar .brand { padding: 2px 8px 10px; }
.sidebar .brand b { display: block; font: 800 14.5px/1.1 var(--font); letter-spacing: .06em; }
.sidebar .brand small { display: block; font: 500 12px/1.3 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-top: 3px; }
.mark.logo { display: block; flex: none; border-radius: 50%; object-fit: cover; }

.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a, .side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px;
  color: rgba(240, 232, 224, .72); text-decoration: none; font-weight: 600; font-size: 14.5px;
  border: 0; background: transparent; width: 100%; cursor: pointer; text-align: left;
  transition: background .15s, color .15s;
}
.side-nav a:hover, .side-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-nav a.active, .side-link.active { background: var(--accent); color: var(--accent-ink); }
.side-nav .ic, .side-link .ic { width: 19px; height: 19px; }

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; border-top: 1px solid rgba(255, 255, 255, .08); padding-top: 12px; }
.side-foot form { margin: 0; }
.side-me { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; text-decoration: none; color: #f0e8e0; }
.side-me:hover, .side-me.active { background: rgba(255, 255, 255, .07); }
.side-me .who { display: flex; flex-direction: column; min-width: 0; }
.side-me .who b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-me .who small { font-size: 12px; color: rgba(240, 232, 224, .55); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font: 800 13px/1 var(--font); letter-spacing: .02em; text-decoration: none;
}

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.content { width: 100%; max-width: 1440px; margin: 0 auto; padding: 28px 32px 56px; }
.tabbar { display: none; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { margin: 6px 0 0; }
.page-title { font-family: var(--display); font-weight: 400; font-size: 32px; letter-spacing: -.01em; line-height: 1; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Cards & grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pad { padding: 22px; }
.card + .card, .grid-2 + .card, .card + .grid-2 { margin-top: 18px; }
.card-title { display: flex; align-items: center; gap: 9px; margin: 0 0 16px; font: 700 16px/1.2 var(--font); }
.card-title .ic { color: var(--muted); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .card-title { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-2 > .card + .card { margin-top: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: 650 14px/1 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: transform .12s var(--ease), background .15s, border-color .15s, color .15s, box-shadow .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #333039; border-color: #333039; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: rgba(28, 26, 31, .06); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: #f1caca; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-lg { height: 52px; padding: 0 22px; font-size: 16px; border-radius: 14px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; gap: 6px; }
.btn-sm .ic { width: 16px; height: 16px; }
.btn-icon { width: 38px; height: 38px; padding: 0; }
.btn-icon.btn-sm { width: 34px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .42; cursor: not-allowed; transform: none; pointer-events: none; }
.btn.is-loading { pointer-events: none; opacity: .75; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.field > span, .label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
.field small.hint { color: var(--muted); font-size: 12.5px; }
.input, .select {
  width: 100%; height: 44px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff;
  font: 500 15px var(--font); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 76px; padding: 10px 14px; line-height: 1.45; resize: vertical; }
.select { appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f6874' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.input:focus, .select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(28, 26, 31, .08); }
.input::placeholder { color: #aaa1a8; }
.has-error .input, .has-error .select { border-color: var(--danger); }

/* Open dropdown list. Chrome and Edge (135+) let the list itself be styled;
   other browsers keep their own list, and the closed field looks the same everywhere. */
@supports (appearance: base-select) {
  .select, .select::picker(select) { appearance: base-select; }
  .select { display: flex; align-items: center; }
  .select::picker-icon { display: none; } /* the chevron is the background image above */
  .select:open { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(28, 26, 31, .08); }
  .select::picker(select) {
    margin-block: 6px; padding: 6px;
    border: 1px solid var(--line); border-radius: 14px; background: #fff;
    box-shadow: 0 18px 40px -14px rgba(28, 26, 31, .26), 0 4px 10px -4px rgba(28, 26, 31, .08); /* falls below, not onto the field */
    max-height: min(340px, 60dvh); overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  }
  .select option {
    display: flex; align-items: center; gap: 10px;
    min-height: 40px; padding: 8px 12px; border-radius: 10px;
    font: 550 14.5px/1.3 var(--font); color: var(--ink-2); cursor: pointer;
    transition: background-color .12s;
  }
  .select option + option { margin-top: 2px; }
  .select option:hover, .select option:focus-visible { outline: none; background: rgba(28, 26, 31, .06); color: var(--ink); }
  .select option:checked { background: var(--accent-soft); color: var(--ink); font-weight: 650; }
  .select option::checkmark { order: 1; margin-left: auto; font-size: 13px; color: var(--ink); }
  .select option:disabled { color: #bdb6ab; cursor: not-allowed; background: transparent; }
  @media (pointer: coarse) { .select option { min-height: 46px; font-size: 16px; } }
  @media (prefers-reduced-motion: no-preference) {
    .select::picker(select) {
      transition: opacity .16s, translate .18s var(--ease), overlay .18s allow-discrete, display .18s allow-discrete;
    }
    .select:not(:open)::picker(select) { opacity: 0; translate: 0 -6px; }
    @starting-style { .select:open::picker(select) { opacity: 0; translate: 0 -6px; } }
  }
}
.err { color: var(--danger); font-size: 12.5px; font-weight: 600; }
.input-wrap { position: relative; display: block; }
.input-wrap .input { padding-right: 46px; }
.input-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 38px; height: 36px; border: 0; background: transparent; border-radius: 9px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.input-btn:hover { background: rgba(28, 26, 31, .06); color: var(--ink); }
.money-input { position: relative; display: block; }
.money-input::before { content: '₹'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; pointer-events: none; }
.money-input .input { padding-left: 30px; font-variant-numeric: tabular-nums; }
.search { position: relative; display: block; }
.search .ic { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 40px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; cursor: pointer; margin: 2px 0 16px; line-height: 1.35; }
.check input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--ink); cursor: pointer; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1 1 160px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* Toggle switch */
.switch { position: relative; display: inline-flex; width: 44px; height: 26px; flex: none; vertical-align: middle; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 99px; background: #d6cdc2; transition: background .2s; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .22); transition: transform .22s var(--ease); }
.switch input:checked + .track { background: var(--cash); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--ink); outline-offset: 2px; }
.switch input:disabled { cursor: not-allowed; }
.switch input:disabled + .track { opacity: .5; }

/* Colour picker */
.color-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; padding: 0; background: var(--c); }
.swatch.on { box-shadow: 0 0 0 2px var(--ink); }
.color-row input[type="color"] { width: 38px; height: 32px; padding: 0; border: 1px solid var(--line-2); border-radius: 9px; background: #fff; cursor: pointer; }

/* ---------- Flash, toasts ---------- */
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 13px; margin: 0 0 16px; font-weight: 600; font-size: 14px; }
.flash .ic { flex: none; }
.flash span { flex: 1; }
.flash-success { background: var(--cash-soft); color: var(--cash-ink); }
.flash-error { background: var(--danger-soft); color: var(--danger-ink); }
.flash-info { background: #eae4dc; color: var(--ink-2); }
.flash-warn { background: var(--accent-soft); color: #5c4800; box-shadow: inset 0 0 0 1px rgba(214, 170, 0, .35); }
.flash-warn a { color: inherit; font-weight: 750; }
.flash-x { border: 0; background: transparent; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; padding: 0 4px; }

.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - 32px));
  padding: 13px 16px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow-lg); animation: toast-in .35s var(--ease);
}
.toast .ic { flex: none; }
.toast.success .ic { color: var(--accent); }
.toast.error { background: var(--danger-ink); }
.toast.out { animation: toast-out .25s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ---------- Badges, chips, tabs ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 650; background: #efe8df; color: var(--ink-2); white-space: nowrap; }
.badge .ic { width: 13px; height: 13px; }
.badge-cash { background: var(--cash-soft); color: var(--cash-ink); }
.badge-upi { background: var(--upi-soft); color: var(--upi-ink); }
.badge-owner { background: var(--ink); color: #fff; }
.badge-off { background: #ece9e6; color: #8a8388; }
.badge-danger { background: var(--danger-soft); color: var(--danger-ink); }
.badge-ok { background: var(--cash-soft); color: var(--cash-ink); }
.badge-accent { background: var(--accent-soft); color: #5c4800; }

.tabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: 14px; background: #e9e1d6; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 11px;
  border: 0; background: transparent; color: var(--ink-2); font-weight: 650; font-size: 14px; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.tabs a:hover, .tabs button:hover { color: var(--ink); }
.tabs .active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(28, 26, 31, .1); }
.tabs .count { font-size: 12px; color: var(--muted); font-weight: 600; }

/* ---------- Tables / lists ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; padding: 11px 14px; font-size: 11.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }
.table tr.is-off td { color: #9a9398; }
.table tr.is-deleted td { color: #a29ba0; text-decoration: line-through; text-decoration-color: rgba(0, 0, 0, .25); }
.table tr.is-deleted td.actions { text-decoration: none; }
.actions { white-space: nowrap; text-align: right; }
.actions .btn + .btn, .actions form + .btn, .actions .btn + form, .actions form + form { margin-left: 4px; }
.actions form { display: inline; }

.thumb { width: 46px; height: 46px; border-radius: 12px; flex: none; overflow: hidden; display: grid; place-items: center; background: var(--c, #ddd); color: #fff; font: 800 15px/1 var(--font); letter-spacing: .02em; text-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-lg { width: 96px; height: 96px; border-radius: 18px; font-size: 26px; }
.name-cell { display: flex; align-items: center; gap: 12px; min-width: 200px; }
.name-cell b { display: block; font-weight: 700; }
.name-cell small { display: block; color: var(--muted); font-size: 12.5px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty-state { text-align: center; padding: 48px 24px; }
.empty-state h2 { font-size: 20px; margin-bottom: 8px; }
.empty-state p { color: var(--muted); max-width: 420px; margin: 0 auto 18px; }

/* ---------- Modal dialogs ---------- */
dialog.modal {
  width: min(600px, calc(100vw - 24px)); max-height: calc(100dvh - 32px);
  padding: 0; border: 0; border-radius: 22px; background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
dialog.modal[open] { display: flex; flex-direction: column; animation: modal-in .28s var(--ease); }
dialog.modal::backdrop { background: rgba(28, 26, 31, .5); backdrop-filter: blur(3px); }
dialog.modal > form { display: flex; flex-direction: column; min-height: 0; max-height: inherit; margin: 0; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 14px 22px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font: 700 18px/1.2 var(--font); }
.modal-body { padding: 20px 22px; overflow-y: auto; min-height: 0; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }
dialog.modal.modal-sm { width: min(420px, calc(100vw - 24px)); }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- Login & first-time setup ---------- */
.bare-main { min-height: 100vh; min-height: 100dvh; }
.login { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(420px, 1fr); min-height: 100vh; min-height: 100dvh; }

/* black brand half: logo, headline, floating food drawings, soft yellow glow */
.login-hero {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 34px 48px 44px; background: var(--ink); color: #f5f3ec;
}
.login-hero::before {
  content: ''; position: absolute; z-index: -2; width: 1100px; height: 1100px; right: -380px; top: 50%; transform: translateY(-50%);
  background:
    radial-gradient(circle, rgba(255, 216, 15, .22) 0, rgba(255, 216, 15, .07) 28%, transparent 58%),
    repeating-radial-gradient(circle, rgba(255, 216, 15, .09) 0, rgba(255, 216, 15, .015) 34px, rgba(255, 216, 15, .09) 68px);
  -webkit-mask: radial-gradient(circle, #000 0 26%, transparent 60%);
  mask: radial-gradient(circle, #000 0 26%, transparent 60%);
}
.lh-top { display: flex; align-items: center; gap: 12px; }
.lh-top .logo { width: 48px; height: 48px; border-radius: 50%; }
.lh-top b { font: 800 15px/1 var(--font); letter-spacing: .08em; }
.lh-chip { margin-left: 4px; padding: 6px 10px; border-radius: 99px; background: rgba(255, 216, 15, .14); color: var(--accent); font: 600 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.lh-art { position: absolute; z-index: -1; right: 4%; top: 47%; width: min(44%, 420px); aspect-ratio: 1; transform: translateY(-50%); pointer-events: none; }
.lh-art img { position: absolute; width: 50%; height: auto; filter: drop-shadow(0 26px 26px rgba(0, 0, 0, .5)); animation: lh-float 6s ease-in-out infinite alternate; }
.lh-art img:nth-child(1) { left: 24%; top: 0; width: 58%; }
.lh-art img:nth-child(2) { left: -6%; top: 44%; animation-delay: -2s; }
.lh-art img:nth-child(3) { left: 54%; top: 48%; animation-delay: -4s; }
@keyframes lh-float { from { translate: 0 -9px; rotate: -3deg; } to { translate: 0 9px; rotate: 3deg; } }
.lh-copy { position: relative; max-width: 470px; }
.lh-title { margin: 0 0 18px; font: 400 clamp(46px, 5.2vw, 78px)/.92 var(--display); letter-spacing: -.01em; text-transform: uppercase; }
.lh-title span { color: var(--accent); }
.lh-copy p { margin: 0 0 24px; max-width: 410px; font-size: 16.5px; line-height: 1.55; font-weight: 500; color: rgba(245, 243, 236, .72); }
.lh-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lh-points li { display: flex; align-items: center; gap: 12px; font-size: 14.5px; font-weight: 600; color: rgba(245, 243, 236, .92); }
.lh-points .ic { width: 36px; height: 36px; padding: 9px; border-radius: 11px; background: rgba(255, 216, 15, .12); color: var(--accent); }

/* form half */
.login-panel { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px; padding: 40px 24px 28px; }
.login-card { width: min(440px, 100%); padding: 34px 32px 26px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 1px 2px rgba(18, 18, 18, .04), 0 28px 64px rgba(18, 18, 18, .09); }
.login-card h2 { margin: 0 0 6px; font: 400 31px/1.05 var(--display); letter-spacing: -.01em; }
.login-card > p.muted { margin: 0 0 22px; font-size: 14.5px; }
.login-card .flash { margin-bottom: 18px; }
.login-card .field { margin-bottom: 16px; }
.input-icon { position: relative; display: block; }
.input-icon > .ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; transition: color .15s; }
.input-icon:focus-within > .ic { color: var(--ink); }
.input-icon .input { height: 52px; padding-left: 46px; border-radius: 14px; font-size: 16px; }
.input-icon .input-btn { right: 6px; }
.caps { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: #8a5a00; }
.caps .ic { width: 15px; height: 15px; }
.login-card .remember { margin: 4px 0 18px; }
.login-card .btn-lg { height: 54px; font-size: 16px; border-radius: 15px; gap: 10px; box-shadow: 0 10px 22px -10px rgba(214, 170, 0, .8); }
.login-card .btn .ic-arrow { transition: transform .2s var(--ease); }
.login-card .btn:hover .ic-arrow { transform: translateX(3px); }
.login-card .btn[disabled] { box-shadow: none; }
.lc-help { margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.login-foot { width: min(440px, 100%); display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 0 6px; font-size: 13px; color: var(--muted); }
.login-foot a, .login-foot span { display: inline-flex; align-items: center; gap: 6px; }
.login-foot a { font-weight: 650; color: var(--ink-2); text-decoration: none; }
.login-foot a:hover { color: var(--ink); text-decoration: underline; }
.login-foot .ic { width: 15px; height: 15px; }
.login-solo { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-solo .login-card { text-align: center; }
.login-solo .logo { margin: 0 auto 16px; border-radius: 50%; }
.login-solo h2 { font-size: 26px; margin-bottom: 10px; }

@media (max-width: 960px) {
  .login { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-hero { flex-direction: row; align-items: center; gap: 12px; padding: 16px 18px; padding-top: max(16px, env(safe-area-inset-top)); }
  .login-hero::before, .lh-art, .lh-copy { display: none; }
  .lh-top .logo { width: 42px; height: 42px; }
  .login-panel { justify-content: flex-start; padding: 26px 14px 28px; }
  .login-card { padding: 26px 20px 22px; border-radius: 20px; }
  .login-card h2 { font-size: 27px; }
}
@media (prefers-reduced-motion: reduce) {
  .lh-art img { animation: none; }
}

/* ---------- Account ---------- */
.perm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.perm-list li { display: grid; grid-template-columns: 22px 160px 1fr; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.perm-list li.on .ic { color: var(--cash); }
.perm-list li.off { opacity: .6; }
.perm-list li.off .ic { color: var(--muted); }
.signout-card { display: flex; align-items: center; justify-content: space-between; gap: 14px 20px; flex-wrap: wrap; }
.signout-card .card-title { margin-bottom: 4px; }
.signout-card p { margin: 0; }

/* Users → login activity (owner only) */
.login-activity { margin-top: 18px; }
.login-activity .card-head { margin-bottom: 4px; }
.la-note { margin: 0 0 10px; max-width: 640px; }
.la-table td { font-size: 13.5px; }
.perm-check.not-yours { opacity: .45; cursor: not-allowed; }

/* ---------- Responsive shell ---------- */
@media (max-width: 1100px) {
  .content { padding: 24px 22px 48px; }
}
@media (max-width: 900px) {
  :root { --tabbar-h: 64px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar {
    position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    height: 58px; padding: 0 14px; padding-top: env(safe-area-inset-top);
    background: rgba(244, 239, 232, .88); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--line); --mark-ink: #f0e8e0;
  }
  .topbar .brand .mark { color: var(--ink); }
  .topbar .brand b { font: 800 14px/1 var(--font); letter-spacing: .06em; }
  .content { padding: 18px 14px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: flex; justify-content: space-around;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: var(--ink); --mark-ink: var(--ink);
  }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: rgba(240, 232, 224, .6); text-decoration: none; font-size: 11px; font-weight: 650; }
  .tabbar a .ic { width: 22px; height: 22px; }
  .tabbar a.active { color: var(--accent); }
  .tabbar a.active .ic { color: var(--accent); }
  .page-title { font-size: 26px; }
  .page-head { margin-bottom: 16px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .pad { padding: 18px; }
  .mobile-only { display: block; }
  .toasts { left: 12px; right: 12px; bottom: calc(var(--tabbar-h) + 14px + env(safe-area-inset-bottom)); align-items: center; }
  .perm-list li { grid-template-columns: 22px 1fr; }
  .perm-list li span { grid-column: 2; }
  dialog.modal { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  dialog.modal[open] { animation: sheet-in .32s var(--ease); }
  .table-cards thead { display: none; }
}
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }

.btn-danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger.solid:hover { background: #b52f2f; border-color: #b52f2f; }

/* ---------- Sales counter (POS) ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 22px; align-items: start; }
.pos-menu { min-width: 0; }
.pos-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.pos-top .search { width: min(340px, 100%); }
.edit-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 18px; border-radius: 14px; background: var(--accent-soft); color: #4d3d00; font-size: 14px; border: 1px solid #f2dc6b; }
.edit-banner .ic { flex: none; }
.edit-banner span { flex: 1; }

.cat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 -2px 16px; padding: 2px 2px 6px; }
.money-input input::-webkit-outer-spin-button, .money-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.money-input input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex: none; display: inline-flex; align-items: center; gap: 9px; height: 48px; padding: 0 18px;
  border: 1px solid var(--line-2); border-radius: 14px; background: #fff; color: var(--ink);
  font: 750 15px/1 var(--font); cursor: pointer; transition: background .15s, color .15s, border-color .15s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.cat-tab:hover { border-color: var(--ink-2); }
.cat-tab:active { transform: scale(.97); }
.cat-tab .count { padding: 3px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 12px; font-weight: 700; }
.cat-tab.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.cat-tab.active .count { background: var(--accent); color: var(--accent-ink); }

.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.item-tile {
  position: relative; display: flex; flex-direction: column; align-items: stretch; text-align: left;
  padding: 8px 8px 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; cursor: pointer;
  transition: transform .12s var(--ease), box-shadow .18s, border-color .15s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.item-tile:hover { border-color: var(--line-2); box-shadow: 0 10px 24px rgba(28, 26, 31, .08); }
.item-tile:active { transform: scale(.96); }
.item-tile.in-bill { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.tile-art {
  position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
  display: grid; place-items: center; background: var(--c, #ccc); color: rgba(255, 255, 255, .95);
  font: 400 34px/1 var(--display); letter-spacing: .02em; text-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}
.tile-art::before {
  content: ''; position: absolute; inset: -40%;
  background: repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .16) 0 2px, transparent 2px 22px);
  opacity: .55; pointer-events: none;
}
.tile-art img { position: relative; width: 100%; height: 100%; object-fit: cover; }
.tile-art span { position: relative; }
.tile-art.has-photo { background: #1b1b1b; }
.tile-art.has-photo::before { display: none; }
.tile-art.collage { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 2px; }
.item-tile:hover .tile-art.has-photo img { transform: scale(1.04); }
.tile-art.has-photo img { transition: transform .35s var(--ease); }
.tile-name { margin: 10px 4px 2px; font-weight: 750; font-size: 15px; line-height: 1.25; }
.tile-note { margin: 0 4px 4px; font-size: 12px; line-height: 1.3; color: var(--muted); }
.tile-price { margin: 0 4px; font-weight: 700; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile-qty {
  position: absolute; top: 14px; right: 14px; min-width: 32px; height: 32px; padding: 0 9px; border-radius: 99px;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 800 15px/1 var(--font);
  box-shadow: 0 0 0 2px var(--ink), 0 4px 12px rgba(0, 0, 0, .3);
}
.bump { animation: bump .32s var(--ease); }
@keyframes bump { 40% { transform: scale(1.22); } }

.pos-bill { position: sticky; top: 20px; display: flex; flex-direction: column; max-height: calc(100vh - 40px); overflow: hidden; }
.bill-head { display: flex; align-items: center; gap: 10px; padding: 16px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.bill-head h2 { font: 400 22px/1 var(--display); }
.bill-head .muted { flex: 1; }
.bill-head-actions { display: flex; gap: 4px; }
.bill-close { display: none; }
.bill-lines { list-style: none; margin: 0; padding: 4px 12px; overflow-y: auto; flex: 1 1 auto; min-height: 140px; }
.bill-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 34px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.bill-empty .ic.big { width: 34px; height: 34px; margin-bottom: 6px; opacity: .55; }
.bill-empty b { color: var(--ink-2); }
.line { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 30px; align-items: center; gap: 10px; padding: 11px 4px; border-bottom: 1px dashed var(--line-2); }
.line:last-child { border-bottom: 0; }
.line-name { min-width: 0; }
.line-name b { display: block; font-size: 14.5px; font-weight: 750; line-height: 1.25; }
.line-name small { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.line-total { min-width: 62px; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.line-x { width: 30px; height: 30px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.line-x:hover { background: var(--danger-soft); color: var(--danger); }
.line-x .ic { width: 16px; height: 16px; }
.line.flash-in { animation: line-in .45s var(--ease); }
@keyframes line-in { from { background: #fff4cc; } }
.stepper { display: inline-flex; align-items: center; height: 38px; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: #fff; }
.stepper button { width: 36px; height: 100%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.stepper button:hover { background: var(--surface-2); }
.stepper button .ic { width: 16px; height: 16px; }
.stepper input { width: 40px; height: 100%; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); text-align: center; font: 750 15px var(--font); color: var(--ink); -moz-appearance: textfield; appearance: textfield; background: #fff; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input:focus { outline: none; background: #fffbea; }

.bill-foot { display: flex; flex-direction: column; gap: 12px; padding: 14px 18px 18px; border-top: 1px solid var(--line); background: var(--surface-2); }
.bill-total { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.bill-total span { font-weight: 700; color: var(--muted); }
.bill-total b { font: 400 34px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.pay-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; height: 58px; border-radius: 15px;
  border: 2px solid var(--line-2); background: #fff; color: var(--ink); font: 800 16.5px/1 var(--font); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, transform .12s; -webkit-tap-highlight-color: transparent;
}
.pay-btn .ic { width: 22px; height: 22px; }
.pay-btn:hover { border-color: var(--ink-2); }
.pay-btn:active { transform: scale(.97); }
.pay-btn[data-pay="cash"][aria-checked="true"] { border-color: var(--cash); background: var(--cash-soft); color: var(--cash-ink); }
.pay-btn[data-pay="upi"][aria-checked="true"] { border-color: var(--upi); background: var(--upi-soft); color: var(--upi-ink); }
.cash-calc { display: flex; align-items: center; gap: 12px; }
.cash-calc .money-input { flex: 1; }
.cash-calc .input { height: 42px; }
.cash-return { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cash-return.ok { color: var(--cash-ink); }
.cash-return.short { color: var(--danger); }
#complete { height: 60px; font-size: 17px; border-radius: 16px; }
.pay-hint { margin: -4px 0 0; min-height: 18px; text-align: center; font-size: 13px; color: var(--muted); }
.pay-hint.warn { color: #a04a16; font-weight: 650; }
/* "Sale done!" — brand yellow screen over the bill: rays, popping tick, confetti, details rising in */
.bill-success {
  position: absolute; inset: 0; z-index: 3; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 24px; text-align: center; border-radius: inherit;
  background: radial-gradient(circle at 50% 38%, #ffe766 0, var(--accent) 45%, #f5c400 100%); color: var(--accent-ink);
  animation: bs-reveal .42s cubic-bezier(.3, .8, .3, 1) both; /* yellow bursts up from the Complete sale button */
}
@keyframes bs-reveal { from { clip-path: circle(0% at 50% 88%); } to { clip-path: circle(150% at 50% 88%); } }
.bill-success > :not(.bs-rays):not(.bs-confetti) { position: relative; z-index: 1; }
.bill-success.out { animation: fade-out .25s forwards; }
.bs-rays {
  position: absolute; left: 50%; top: 38%; width: 1000px; height: 1000px; margin: -500px 0 0 -500px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .32) 0deg 9deg, transparent 9deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 0 18%, rgba(0, 0, 0, .5) 34%, transparent 58%);
  mask: radial-gradient(circle, #000 0 18%, rgba(0, 0, 0, .5) 34%, transparent 58%);
  animation: bs-spin 9s linear infinite, success-in .6s ease-out;
}
.bs-confetti { position: absolute; left: 50%; top: 38%; width: 0; height: 0; }
.bs-confetti i {
  position: absolute; left: -4px; top: -7px; width: 8px; height: 14px; border-radius: 2px; background: var(--c);
  opacity: 0; animation: bs-burst .95s var(--d) cubic-bezier(.15, .75, .3, 1) forwards;
}
.bs-confetti i.dot { width: 9px; height: 9px; border-radius: 50%; }
.ok-ring {
  width: 88px; height: 88px; margin-bottom: 10px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--accent); box-shadow: 0 12px 28px rgba(0, 0, 0, .25);
  animation: bs-pop .6s cubic-bezier(.2, 1.5, .4, 1) both;
}
.ok-ring::after { content: ''; position: absolute; inset: -7px; border-radius: 50%; border: 3px solid var(--ink); opacity: 0; animation: bs-ring .9s .2s ease-out both; }
.ok-ring .ic { width: 46px; height: 46px; stroke-width: 3.2; stroke-dasharray: 26; stroke-dashoffset: 26; animation: bs-draw .38s .28s ease-out forwards; }
.bs-title { font: 400 34px/1 var(--display); letter-spacing: .01em; text-transform: uppercase; animation: bs-up .45s .2s var(--ease) both; }
.bs-bill { margin-top: 4px; font: 500 13px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; opacity: .72; animation: bs-up .45s .28s var(--ease) both; }
.bs-amount { font: 400 44px/1.05 var(--display); animation: bs-up .45s .34s var(--ease) both; }
.bs-meta { padding: 5px 12px; border-radius: 99px; background: var(--ink); color: var(--accent); font-size: 13.5px; font-weight: 700; animation: bs-up .45s .4s var(--ease) both; }
.bs-tap { position: absolute !important; bottom: 14px; left: 0; right: 0; font-size: 12px; font-weight: 600; opacity: .55; animation: bs-up .45s .8s var(--ease) both; }
@keyframes success-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes bs-spin { to { transform: rotate(360deg); } }
@keyframes bs-pop { 0% { transform: scale(.2); opacity: 0; } 60% { transform: scale(1.14); opacity: 1; } 100% { transform: scale(1); } }
@keyframes bs-ring { 0% { opacity: .55; transform: scale(.92); } 100% { opacity: 0; transform: scale(1.7); } }
@keyframes bs-draw { to { stroke-dashoffset: 0; } }
@keyframes bs-up { from { opacity: 0; transform: translateY(12px); } }
@keyframes bs-burst {
  0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(.6); }
  70% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .bs-rays { animation: none; }
  .ok-ring .ic { stroke-dashoffset: 0; }
}

.bill-scrim, .bill-bar { display: none; }

@media (max-width: 1180px) {
  .pos { grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; }
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (max-width: 900px) {
  .page-pos .content { padding-bottom: calc(var(--tabbar-h) + 100px + env(safe-area-inset-bottom)); }
  .pos { grid-template-columns: minmax(0, 1fr); }
  .pos-top .page-title { display: none; }
  .pos-top .search { width: 100%; }
  .cat-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px 14px; padding: 2px 14px 6px; }
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .pos-bill {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 70; max-height: 88dvh;
    border-radius: 24px 24px 0 0; border-bottom: 0; transform: translateY(105%); visibility: hidden;
    transition: transform .32s var(--ease), visibility 0s linear .32s; padding-bottom: env(safe-area-inset-bottom);
  }
  .pos.bill-open .pos-bill { transform: none; visibility: visible; transition: transform .32s var(--ease); }
  .bill-close { display: inline-flex; }
  .bill-scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(28, 26, 31, .45); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .pos.bill-open .bill-scrim { opacity: 1; pointer-events: auto; }
  .bill-bar {
    position: fixed; left: 12px; right: 12px; z-index: 45; bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom));
    display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; padding: 0 18px;
    border: 0; border-radius: 18px; background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer;
    box-shadow: 0 0 0 2px var(--ink), 0 14px 30px rgba(0, 0, 0, .28);
  }
  .bill-bar b { font: 400 22px/1 var(--display); }
  .bill-bar-count { min-width: 70px; }
  .bill-bar-go { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
  .bill-bar-go .ic { width: 16px; height: 16px; }
}
@media (max-width: 420px) {
  .item-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile-art { font-size: 28px; }
  .cat-tab { height: 44px; padding: 0 14px; font-size: 14.5px; }
  .line { grid-template-columns: minmax(0, 1fr) auto 30px; }
  .line .line-total { grid-column: 2; grid-row: 2; justify-self: end; }
  .line .stepper { grid-column: 2; grid-row: 1; }
  .line .line-x { grid-column: 3; grid-row: 1; }
}

/* ---------- Shared bits for list pages ---------- */
.danger-text { color: var(--danger); }
.danger-text:hover { background: var(--danger-soft); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar-search { width: min(300px, 100%); }
.spacer { flex: 1; }
:target { scroll-margin-top: 90px; }
.item-row:target, .bill-row:target { animation: target-glow 2.4s var(--ease); }
@keyframes target-glow { 0%, 40% { background: #fff4cc; } }

/* ---------- History ---------- */
.filters { margin-bottom: 16px; }
.range-tabs { margin-bottom: 16px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-row .field { margin: 0; flex: 0 1 150px; }
.filter-row .field.grow { flex: 1 1 220px; }
.filter-row .field-dates { flex: 0 1 280px; }
.more-filters { display: contents; } /* desktop: the extra filters sit in the same row */
.more-toggle { display: none; }
.more-toggle .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 12px; }
.filter-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.filter-actions .check { margin: 0; }
.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.stat > span { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stat > span .ic { width: 15px; height: 15px; }
.stat b { display: block; margin: 6px 0 2px; font: 700 25px/1.1 var(--font); letter-spacing: -.015em; }
.stat small { color: var(--muted); font-size: 12.5px; }
.stat-cash > span { color: var(--cash-ink); }
.stat-upi > span { color: var(--upi-ink); }

.bill-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.day-head { display: flex; align-items: baseline; gap: 10px; padding: 12px 18px; background: var(--surface-2); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 2; }
.bill-row + .day-head { border-top: 1px solid var(--line); }
.day-head .day-total { margin-left: auto; font-size: 13.5px; color: var(--muted); }
.day-head .day-total b { color: var(--ink); font-variant-numeric: tabular-nums; }
.bill-row { display: grid; grid-template-columns: 88px minmax(0, 1fr) 96px 104px auto; gap: 14px; align-items: center; padding: 13px 18px; border-bottom: 1px solid var(--line); }
.bill-row:last-child { border-bottom: 0; }
.b-id b { display: block; font-weight: 800; font-variant-numeric: tabular-nums; }
.b-id small { color: var(--muted); font-size: 12.5px; }
.b-lines { display: block; font-weight: 600; line-height: 1.35; }
.b-lines .x { color: var(--muted); font-weight: 700; font-size: 13px; }
.b-lines .sep { color: var(--muted); }
.b-items small { display: block; margin-top: 3px; }
.b-items .badge { height: 20px; font-size: 11px; padding: 0 7px; }
.b-total { text-align: right; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.b-actions { display: flex; gap: 2px; justify-content: flex-end; }
.b-actions form { display: inline; margin: 0; }
.bill-row.is-deleted { background: repeating-linear-gradient(-45deg, #fff, #fff 10px, #fcf7f7 10px, #fcf7f7 20px); }
.bill-row.is-deleted .b-lines, .bill-row.is-deleted .b-total, .bill-row.is-deleted .b-id b { text-decoration: line-through; color: #a29ba0; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 18px; }
.bill-row[data-bill] { cursor: pointer; transition: background-color .12s; }
.bill-row[data-bill]:not(.is-deleted):hover { background: #fffbe6; }

/* bill popup */
dialog.modal.bill-dialog { width: min(580px, calc(100vw - 24px)); }
dialog.modal.bill-dialog:focus { outline: none; }
.bill-dialog .modal-head p { margin: 3px 0 0; }
.bd-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; font-weight: 650; }
.bd-note { margin: 0 0 12px; padding: 9px 12px; border-radius: 10px; font-size: 13px; font-weight: 650; }
.bd-edited { background: var(--accent-soft); color: #5c4800; }
.bd-deleted { background: var(--danger-soft); color: var(--danger-ink); }
.bd-lines td { padding: 11px 10px; }
.bd-lines th { padding: 9px 10px; }
.bd-lines td small { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.bd-lines td small .badge { height: 18px; padding: 0 6px; font-size: 10.5px; }
.bd-lines tfoot th { padding-top: 14px; border-top: 2px solid var(--ink); border-bottom: 0; font: 700 15px var(--font); letter-spacing: 0; text-transform: none; color: var(--ink); }
.bd-lines tfoot th.num { font: 400 26px/1 var(--display); }
.bill-dialog.is-deleted .bd-lines tbody { opacity: .55; text-decoration: line-through; }
.modal-foot form { display: inline-flex; margin: 0; }

/* ---------- Items ---------- */
.cat-block { margin-bottom: 16px; overflow: hidden; }
.cat-block-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.cat-block-head h2 { font: 400 20px/1.1 var(--display); }
.cat-block-head .btn { margin-left: auto; }
.cat-block.is-hidden-cat .cat-block-head { background: repeating-linear-gradient(-45deg, var(--surface-2), var(--surface-2) 10px, #f3eee7 10px, #f3eee7 20px); }
.cat-empty { padding: 16px 20px; margin: 0; }
.item-rows { display: flex; flex-direction: column; }
.item-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) 90px auto auto auto; gap: 16px; align-items: center; padding: 11px 14px 11px 20px; border-bottom: 1px solid var(--line); }
.item-row:last-child { border-bottom: 0; }
.item-row.is-off .ir-name, .item-row.is-off .ir-price, .item-row.is-off .thumb { opacity: .45; }
.ir-name { min-width: 0; }
.ir-name b { display: block; font-weight: 750; }
.ir-name small { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ir-price { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.ir-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; font-weight: 650; color: var(--ink-2); white-space: nowrap; }
.ir-actions { display: flex; align-items: center; gap: 2px; }
.ir-actions form, .actions form { display: inline-flex; margin: 0; }
.move { display: inline-flex; gap: 0; }
.move .btn[disabled] { opacity: .2; }

.photo-field { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 18px; }
.photo-field-body { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.photo-field-body .check { margin: 0; }
.photo-field .hint { font-size: 12.5px; line-height: 1.45; }
.pf-title { font-size: 14.5px; }
.pf-title small { font-weight: 500; font-size: 12.5px; }
.ready-note { color: var(--cash-ink); font-weight: 650; }
kbd { display: inline-block; padding: 0 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; background: #fff; font: 600 11.5px/1.5 var(--mono); color: var(--ink); }

/* big photo square: click to choose, drop a photo on it, or paste one */
.photo-drop {
  position: relative; flex: none; width: 140px; height: 140px; padding: 0; overflow: hidden;
  border: 2px dashed var(--line-2); border-radius: 20px; background: var(--surface-2); color: var(--ink-2);
  cursor: pointer; transition: border-color .15s, background-color .15s, opacity .15s;
}
.photo-drop:hover, .photo-drop:focus-visible, .photo-drop.dragging { border-color: var(--ink); background: var(--accent-soft); }
.photo-drop.dragging { box-shadow: 0 0 0 4px var(--accent); }
.photo-drop:not(.empty) { border-style: solid; border-color: var(--line); }
.photo-drop .pd-img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 0; background: transparent; }
.photo-drop .pd-img img { width: 100%; height: 100%; object-fit: cover; }
.pd-cta { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 13px; text-align: center; }
.pd-cta .ic { width: 28px; height: 28px; }
.photo-drop:not(.empty) .pd-cta { opacity: 0; background: rgba(18, 18, 18, .55); color: #fff; transition: opacity .15s; }
.photo-drop:not(.empty):hover .pd-cta, .photo-drop:not(.empty):focus-visible .pd-cta, .photo-drop.dragging .pd-cta { opacity: 1; }
.photo-drop.busy { opacity: .55; pointer-events: none; }
.hint-touch { display: none; }
@media (pointer: coarse) {
  .hint-touch { display: inline; }
  .hint-desktop { display: none; }
}
@media (max-width: 560px) {
  .photo-field { gap: 14px; }
  .photo-drop { width: 104px; height: 104px; border-radius: 16px; }
  .pd-cta { font-size: 12px; gap: 4px; }
  .pd-cta .ic { width: 22px; height: 22px; }
}

/* ---------- Phone comfort: bigger tap targets ---------- */
@media (max-width: 900px) {
  .check { min-height: 40px; align-items: center; margin-top: 0; margin-bottom: 8px; }
  .check input { width: 22px; height: 22px; }
  .switch { width: 52px; height: 30px; }
  .switch .track::after { width: 24px; height: 24px; }
  .switch input:checked + .track::after { transform: translateX(22px); }
  .btn-sm { height: 40px; }
  .btn-icon.btn-sm { width: 40px; }
  .input, .select { height: 48px; font-size: 16px; } /* 16px stops phones zooming into fields */
  textarea.input { font-size: 16px; }
  .modal-foot .btn { height: 46px; }
}
@media (max-width: 420px) {
  .toolbar .tabs .ic { display: none; }
  .tabs a, .tabs button { padding: 0 12px; }
}
.toggle-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); cursor: pointer; }
.toggle-row b { display: block; font-size: 14.5px; }
.toggle-row small { display: block; color: var(--muted); font-size: 12.5px; }

.combo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.combo-card { display: flex; flex-direction: column; overflow: hidden; border-top: 5px solid var(--c); }
.combo-card.is-off { opacity: .6; }
.combo-top { display: flex; align-items: center; gap: 12px; padding: 16px 16px 10px; }
.combo-title { flex: 1; min-width: 0; }
.combo-title b { display: block; font: 400 19px/1.15 var(--display); }
.combo-title small { display: block; font-size: 12.5px; margin-top: 2px; }
.combo-items { list-style: none; margin: 0; padding: 4px 16px 10px; display: flex; flex-direction: column; gap: 6px; }
.combo-items li { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.combo-items li .muted { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 500; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.combo-price { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px 12px; border-top: 1px dashed var(--line-2); margin-top: auto; }
.combo-price b { font: 400 26px/1 var(--display); font-variant-numeric: tabular-nums; }
.combo-actions { display: flex; align-items: center; gap: 4px; padding: 8px 10px 10px 8px; background: var(--surface-2); border-top: 1px solid var(--line); }

dialog.modal.modal-wide { width: min(940px, calc(100vw - 24px)); }
.combo-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; }
.combo-picker { border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: var(--surface-2); max-height: 62dvh; overflow-y: auto; }
.combo-picker > .label { display: block; margin: 2px 4px 8px; }
.cp-group h4 { margin: 12px 4px 6px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cp-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; border: 1px solid transparent; }
.cp-row .thumb { width: 36px; height: 36px; border-radius: 10px; font-size: 12px; }
.cp-row.on { background: #fff; border-color: var(--ink); }
.cp-name { flex: 1; min-width: 0; line-height: 1.25; }
.cp-name b { display: block; font-size: 14px; }
.cp-name small { font-size: 12px; }
.stepper-sm { height: 34px; border-radius: 10px; }
.stepper-sm button { width: 32px; }
.stepper-sm input { width: 34px; font-size: 14px; }
.combo-sum { padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--line-2); color: var(--muted); font-size: 13.5px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 3px; }
.combo-sum.filled { border-style: solid; background: var(--surface-2); color: var(--ink-2); }
.combo-sum .good { color: var(--cash-ink); font-weight: 750; }
.combo-sum .bad { color: var(--danger); font-weight: 750; }

/* ---------- Users ---------- */
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
.user-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; }
.user-card.is-off { opacity: .62; }
.uc-top { display: flex; align-items: center; gap: 12px; }
.avatar-lg { width: 46px; height: 46px; font-size: 16px; }
.uc-name { flex: 1; min-width: 0; }
.uc-name b { display: block; font-size: 16.5px; font-weight: 750; }
.uc-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.uc-perms { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 99px; font-size: 12.5px; font-weight: 650; background: var(--cash-soft); color: var(--cash-ink); }
.perm-chip .ic { width: 14px; height: 14px; }
.uc-meta { display: flex; gap: 16px; flex-wrap: wrap; }
.uc-meta span { display: inline-flex; align-items: center; gap: 6px; }
.uc-meta .ic { width: 15px; height: 15px; }
.uc-actions { display: flex; gap: 4px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); margin-top: auto; }
.uc-actions form { display: inline-flex; margin: 0; }
.uc-actions form:last-child { margin-left: auto; }

.perm-section { margin: 4px 0 14px; }
.perm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.presets { display: flex; gap: 2px; flex-wrap: wrap; }
.presets .btn { height: 30px; font-size: 12.5px; padding: 0 10px; color: var(--ink-2); background: var(--surface-2); }
.perm-checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.perm-check { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.perm-check input { position: absolute; opacity: 0; pointer-events: none; }
.pc-box { width: 22px; height: 22px; flex: none; border-radius: 7px; border: 1.5px solid var(--line-2); display: grid; place-items: center; color: transparent; background: #fff; transition: background .15s, border-color .15s; }
.pc-box .ic { width: 15px; height: 15px; stroke-width: 3; }
.pc-text b { display: block; font-size: 14px; line-height: 1.2; }
.pc-text small { display: block; color: var(--muted); font-size: 12px; line-height: 1.35; margin-top: 2px; }
.perm-check:has(input:checked) { border-color: var(--ink); background: #fff; }
.perm-check input:checked + .pc-box { background: var(--ink); border-color: var(--ink); color: #fff; }
.perm-check input:focus-visible + .pc-box { outline: 2px solid var(--ink); outline-offset: 2px; }
.perm-section.locked .perm-check { cursor: not-allowed; opacity: .7; }

@media (max-width: 900px) {
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat b { font-size: 22px; }
  .filter-row .field { flex: 1 1 130px; }
  /* bill rows: item names get the full width; payment badge + buttons share the second line */
  .bill-row { grid-template-columns: 60px minmax(0, 1fr) auto; grid-template-areas: "id items total" "id foot foot"; column-gap: 10px; row-gap: 6px; padding: 12px 12px 10px 14px; }
  .b-id small { white-space: nowrap; }
  .b-id { grid-area: id; align-self: start; }
  .b-items { grid-area: items; }
  .b-total { grid-area: total; align-self: start; }
  .b-pay { grid-area: foot; justify-self: start; align-self: center; }
  .b-actions { grid-area: foot; justify-self: end; }
  .b-actions .btn { width: 40px; height: 40px; padding: 0; }
  .b-actions .btn span { display: none; }
  /* filters: dates always visible, the rest behind "Filters" */
  .more-toggle { display: inline-flex; align-self: flex-end; height: 44px; }
  .more-filters { display: none; width: 100%; }
  .more-filters.open { display: flex; flex-wrap: wrap; gap: 12px; }
  .filter-row .field-dates { flex: 1 1 180px; }
  .day-head { padding: 10px 14px; flex-wrap: wrap; }
  .item-row { grid-template-columns: 46px minmax(0, 1fr) auto; grid-template-areas: "thumb name price" "thumb t1 t2" "actions actions actions"; row-gap: 8px; padding: 12px 14px; }
  .item-row > .thumb { grid-area: thumb; align-self: start; }
  .item-row .ir-name { grid-area: name; }
  .item-row .ir-price { grid-area: price; }
  .item-row .ir-toggle:nth-of-type(1) { grid-area: t1; }
  .item-row .ir-toggle:nth-of-type(2) { grid-area: t2; justify-self: end; }
  .item-row .ir-actions { grid-area: actions; justify-content: flex-end; }
  .cat-block-head { padding: 12px 12px 10px 14px; }
  .combo-form { grid-template-columns: minmax(0, 1fr); }
  .combo-picker { max-height: none; }
  .perm-checks { grid-template-columns: minmax(0, 1fr); }
  .user-grid, .combo-grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar-search { width: 100%; }
}

/* ---------- Dashboard ---------- */
.live { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 13px; border-radius: 99px; background: var(--cash-soft); color: var(--cash-ink); font-size: 13px; font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: var(--cash); animation: live-pulse 2s infinite; }
.live.off { background: var(--danger-soft); color: var(--danger-ink); }
.live.off i { background: var(--danger); animation: none; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(31, 138, 92, .45); } 70% { box-shadow: 0 0 0 8px rgba(31, 138, 92, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 138, 92, 0); } }

.dash-head { align-items: center; }
.dash-date { margin: 0 0 6px !important; font: 600 12px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.dash-head .page-actions .dp-trigger { height: 42px; background: var(--surface); }
.dash { transition: opacity .2s; }
.dash.loading { opacity: .55; pointer-events: none; }

.kpis { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 4px; min-width: 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.kpi-ic { position: absolute; right: 16px; top: 16px; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: #5c4800; }
.kpi-ic .ic { width: 19px; height: 19px; }
.kpi-label { font-size: 13.5px; font-weight: 650; color: var(--muted); }
.kpi-value { margin-top: 4px; font: 700 34px/1.1 var(--font); letter-spacing: -.02em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-delta { align-self: flex-start; max-width: 100%; margin-top: 6px; padding: 3px 9px; border-radius: 99px; font-size: 12.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-delta:empty { display: none; }
.kpi-delta.up { background: var(--cash-soft); color: var(--cash-ink); }
.kpi-delta.down { background: var(--danger-soft); color: var(--danger-ink); }
.kpi-delta.flat { background: var(--surface-2); color: var(--muted); }
/* the big black tile: today's sales in logo yellow, the logo on soft yellow rings */
.kpi-hero { overflow: hidden; isolation: isolate; background: var(--ink); border-color: var(--ink); color: #fff; justify-content: center; padding: 22px 24px; }
.kpi-hero::before {
  content: ''; position: absolute; z-index: -1; right: -110px; top: 50%; width: 340px; height: 340px; transform: translateY(-50%);
  background: repeating-radial-gradient(circle, rgba(255, 216, 15, .16) 0, rgba(255, 216, 15, .03) 15px, rgba(255, 216, 15, .16) 30px);
  -webkit-mask: radial-gradient(circle, #000 0 22%, transparent 64%); mask: radial-gradient(circle, #000 0 22%, transparent 64%);
}
.kpi-hero > .logo { position: absolute; z-index: -1; right: 22px; top: 50%; width: 96px; height: 96px; transform: translateY(-50%) rotate(-8deg); border-radius: 50%; box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.kpi-hero .kpi-label { color: rgba(255, 255, 255, .66); }
.kpi-hero .kpi-value { max-width: calc(100% - 120px); font-size: 52px; color: var(--accent); }
.kpi-hero .kpi-delta { max-width: calc(100% - 120px); }
.kpi-hero .kpi-delta.up { background: rgba(134, 227, 182, .14); color: #86e3b6; }
.kpi-hero .kpi-delta.down { background: rgba(255, 180, 180, .14); color: #ffb4b4; }
.kpi-hero .kpi-delta.flat { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .66); }

/* three quick facts under the totals */
.highlights { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.hi { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.hi-ic { flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--ink); color: var(--accent); }
.hi-ic .ic { width: 17px; height: 17px; }
.hi-text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hi-text small { font-size: 12px; font-weight: 650; color: var(--muted); }
.hi-text b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.kpi-value.tick { animation: kpi-tick .9s var(--ease); }
@keyframes kpi-tick { 0% { color: #c99a00; } }
.kpi-hero .kpi-value.tick { animation-name: kpi-tick-hero; }
@keyframes kpi-tick-hero { 0% { color: #fff; } }

.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dash-grid > .card, .combo-grid > .card, .user-grid > .card { margin-top: 0; }
.pay-note { display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.pay-note .ic { flex: none; margin-top: 1px; color: var(--muted); }
.span-2 { grid-column: span 2; }
.chart-card { min-width: 0; padding: 18px 20px 20px; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.chart-head h2 { display: flex; align-items: center; gap: 8px; font: 700 16px/1.25 var(--font); }
.chart-head h2 .ic { width: 17px; height: 17px; color: var(--muted); }
.chart-head p { margin: 2px 0 0; }
.chart-head .btn .ic { width: 15px; height: 15px; }
.chart { position: relative; }
.chart svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: #efe9e1; stroke-width: 1; }
.chart .axis { stroke: #cdc4b9; stroke-width: 1; }
.chart .tick { fill: var(--muted); font: 500 11.5px var(--font); font-variant-numeric: tabular-nums; }
.chart .peak { fill: var(--ink); font: 700 12px var(--font); }
.chart .bar { transition: fill .15s; }
.chart .bar.lift { fill: var(--accent); stroke: var(--ink); stroke-width: 1.5; } /* hovered bar lights up in logo yellow */
.chart .hit { fill: transparent; cursor: pointer; outline: none; }
.chart .hit:focus-visible { fill: rgba(28, 26, 31, .05); stroke: var(--ink); stroke-width: 1.5; }
.chart-empty { position: absolute; inset: 0 0 30px 56px; display: grid; place-items: center; margin: 0; color: var(--muted); font-weight: 600; font-size: 14px; pointer-events: none; }
.chart-empty.static { position: static; padding: 28px 0; text-align: center; }
.chart-table { max-height: 300px; overflow-y: auto; }

.seg { display: flex; gap: 2px; height: 28px; margin: 14px 0 18px; }
.seg-part { display: flex; align-items: center; min-width: 0; padding: 0 10px; border-radius: 4px; color: #fff; outline: none; transition: filter .15s; }
.seg-part b { font: 700 13px/1 var(--font); white-space: nowrap; }
.seg-part.hover { filter: brightness(1.12); }
.seg-part:focus-visible { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink); }
.seg-empty { background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 4px; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 72px; align-items: center; gap: 10px; font-size: 14px; }
.legend i { width: 12px; height: 12px; border-radius: 3px; }
.legend .lg-name { font-weight: 650; }
.legend b { font-variant-numeric: tabular-nums; }
.legend .muted { font-size: 12.5px; text-align: right; }

/* ranked rows: position · (photo) · name over a thin bar · value */
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.rank li { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; align-items: center; gap: 11px; margin: 0 -8px; padding: 7px 8px; border-radius: 12px; outline: none; transition: background .15s; }
.rank.with-photos li { grid-template-columns: 24px 38px minmax(0, 1fr) auto; }
.rank li.hover, .rank li:focus-visible { background: var(--surface-2); }
.rank li:focus-visible { box-shadow: inset 0 0 0 1.5px var(--ink); }
.rank-pos { width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font: 700 12px/1 var(--font); background: var(--surface-2); color: var(--muted); font-variant-numeric: tabular-nums; }
.rank-pos.first { background: var(--accent); color: var(--ink); }
.rank-thumb { width: 38px; height: 38px; border-radius: 11px; overflow: hidden; display: grid; place-items: center; background: var(--accent-soft); }
.rank-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rank-thumb b { font-size: 12px; color: #5c4800; }
.rank-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.rank-name { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-track { display: block; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.rank-bar { display: block; height: 100%; width: calc(var(--p) * 100%); min-width: 4px; border-radius: 4px; }
.rank-val { min-width: 2ch; text-align: right; font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

.recent { list-style: none; margin: 0; padding: 0; }
.recent li { border-bottom: 1px solid var(--line); }
.recent li:last-child { border-bottom: 0; }
.recent-row { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; margin: 0 -8px; padding: 10px 8px; border-radius: 12px; color: inherit; text-decoration: none; }
a.recent-row { transition: background .15s; }
a.recent-row:hover { background: var(--surface-2); }

/* the dashboard settles in, card by card */
.page-dash .kpi, .page-dash .hi, .page-dash .dash-grid > .card { animation: dash-in .5s var(--ease) backwards; }
.page-dash .kpi:nth-child(2), .page-dash .hi:nth-child(2) { animation-delay: 50ms; }
.page-dash .kpi:nth-child(3), .page-dash .hi:nth-child(3) { animation-delay: 100ms; }
.page-dash .kpi:nth-child(4) { animation-delay: 150ms; }
.page-dash .dash-grid > .card { animation-delay: 160ms; }
.page-dash .dash-grid > .card:nth-child(n+3) { animation-delay: 220ms; }
@keyframes dash-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  .page-dash .kpi, .page-dash .hi, .page-dash .dash-grid > .card { animation: none; }
}
.r-id b { display: block; font-size: 13.5px; }
.r-id small { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.r-items { min-width: 0; }
.r-lines { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-items small { display: block; font-size: 12px; }
.r-total { font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; min-width: 56px; }

.viz-tip { position: fixed; left: 0; top: 0; z-index: 300; display: flex; flex-direction: column; gap: 1px; max-width: 260px; padding: 8px 11px; border-radius: 10px; background: var(--ink); color: #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, .22); pointer-events: none; }
.viz-tip b { font: 700 15px/1.25 var(--font); }
.viz-tip span { font-size: 12.5px; color: rgba(255, 255, 255, .74); }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-hero { grid-column: 1 / -1; }
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-grid .span-2 { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 22px; }
  .kpi-ic { display: none; }
  .kpi-hero { padding: 18px; }
  .kpi-hero .kpi-value { font-size: 46px; max-width: calc(100% - 78px); }
  .kpi-hero .kpi-delta { max-width: calc(100% - 78px); }
  .kpi-hero > .logo { width: 70px; height: 70px; right: 14px; }
  .kpi-hero::before { right: -150px; }
  .kpi:not(.kpi-hero) .kpi-delta { display: none; }
  .kpi-label { font-size: 12.5px; }
  .highlights { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .hi { padding: 10px 12px; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
  .chart-card { padding: 16px; }
  .page-dash .page-actions .btn { display: none; }
  .dash-head .page-actions { width: 100%; }
  .dash-head .page-actions .dp-trigger { flex: 1 1 100%; min-width: 0; } /* own row; Live on the next */
}

/* ---------- Date range picker ---------- */
.dp-trigger {
  display: inline-flex; align-items: center; gap: 9px; height: 46px; padding: 0 14px 0 15px;
  border: 1px solid var(--line-2); border-radius: 14px; background: #fff; color: var(--ink);
  font: 650 14.5px/1 var(--font); white-space: nowrap; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.dp-trigger:hover { border-color: var(--ink-2); }
.dp-trigger .ic { color: var(--muted); }
.dp-trigger .chev { width: 16px; height: 16px; margin-left: 2px; }
.dp-trigger[aria-expanded="true"], .dp-trigger.active { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.dp-trigger.active .ic:first-child { color: var(--ink); }
.field .dp-trigger { width: 100%; height: 44px; justify-content: flex-start; }
.field .dp-trigger .chev { margin-left: auto; }

.dp {
  position: absolute; z-index: 400; display: flex;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg);
  overflow: hidden; animation: dp-in .18s var(--ease);
}
.dp[hidden], .dp-scrim[hidden] { display: none !important; }
@keyframes dp-in { from { opacity: 0; transform: translateY(-6px); } }
.dp-presets { display: flex; flex-direction: column; gap: 2px; width: 196px; padding: 10px; background: var(--surface-2); border-right: 1px solid var(--line); }
.dp-preset {
  display: grid; grid-template-columns: 18px 1fr; column-gap: 8px; align-items: center; padding: 9px 10px;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink-2); text-align: left; cursor: pointer;
  font: 650 14px/1.25 var(--font);
}
.dp-preset .ic { width: 16px; height: 16px; color: var(--ink); visibility: hidden; grid-row: span 2; }
.dp-preset small { grid-column: 2; margin-top: 2px; font-size: 12px; font-weight: 500; color: var(--muted); }
.dp-preset:hover { background: rgba(28, 26, 31, .05); }
.dp-preset.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(28, 26, 31, .08); }
.dp-preset.on .ic { visibility: visible; }
.dp-cal { position: relative; padding: 14px 16px 14px; }
.dp-nav { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; justify-content: space-between; pointer-events: none; }
.dp-arrow { pointer-events: auto; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; }
.dp-arrow:hover { background: var(--surface-2); }
.dp-arrow:disabled { opacity: .25; cursor: default; background: transparent; }
.dp-months { display: flex; gap: 26px; }
.dp-month { width: 266px; }
.dp-mname { height: 34px; margin-bottom: 6px; text-align: center; font: 700 15px/34px var(--font); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 38px); row-gap: 3px; }
.dp-wd { padding-bottom: 6px; text-align: center; font: 650 11.5px var(--font); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.dp-day {
  position: relative; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--ink);
  font: 600 14px var(--font); font-variant-numeric: tabular-nums; cursor: pointer;
}
.dp-day:hover:not(:disabled) { background: rgba(28, 26, 31, .07); }
.dp-day:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.dp-day:disabled { color: #cdc6bf; cursor: not-allowed; }
.dp-day.today::after { content: ''; position: absolute; left: 50%; bottom: 5px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: #e0a800; }
.dp-day.in { border-radius: 0; background: var(--accent-soft); }
.dp-day.in.preview { background: #fffadf; }
.dp-day.start.today::after, .dp-day.end.today::after { background: var(--accent); }
.dp-day.start, .dp-day.end { background: var(--ink); color: #fff; }
.dp-day.start:hover, .dp-day.end:hover { background: #333039; }
.dp-day.start { border-radius: 10px 0 0 10px; }
.dp-day.end { border-radius: 0 10px 10px 0; }
.dp-day.start.end { border-radius: 10px; }
.dp-day.start.today::after, .dp-day.end.today::after { background: #fff; }
.dp-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.dp-sel { font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.dp-sel small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.dp-actions { display: flex; gap: 6px; flex: none; }
.dp-scrim { position: fixed; inset: 0; z-index: 399; background: rgba(28, 26, 31, .45); }

@media (max-width: 700px) {
  .dp {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; flex-direction: column;
    max-height: 92dvh; overflow-y: auto; border-radius: 22px 22px 0 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom); animation: sheet-in .28s var(--ease);
  }
  .dp-presets { flex-direction: row; width: auto; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .dp-presets::-webkit-scrollbar { display: none; }
  .dp-preset { flex: none; display: block; padding: 9px 13px; border-radius: 99px; background: #fff; border: 1px solid var(--line-2); }
  .dp-preset .ic, .dp-preset small { display: none; }
  .dp-preset.on { background: var(--ink); border-color: var(--ink); color: #fff; }
  .dp-cal { padding: 14px 12px 16px; }
  .dp-months, .dp-month { width: 100%; }
  .dp-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .dp-day { height: 44px; }
  .dp-foot { flex-wrap: wrap; }
  .dp-actions { width: 100%; }
  .dp-actions .btn { flex: 1; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- Settings (owner): WhatsApp report, business day ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
/* two independent columns, so a tall card never leaves a gap beside it */
.settings-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.settings-col > .card { margin-top: 0; }
.set-lead { margin: -4px 0 14px; }
.wa-next { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 10px 12px; border-radius: 12px; background: var(--cash-soft); color: var(--cash-ink); font-size: 13.5px; font-weight: 600; }
.wa-next .ic { width: 16px; height: 16px; flex: none; }
.wa-form .toggle-row { margin-bottom: 14px; }
.wa-people { display: grid; gap: 10px; margin-bottom: 12px; }
.wa-person { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.wa-person .field { margin: 0; }
.wa-help { margin: 4px 0 14px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); color: #4a3a00; font-size: 14px; }
.wa-help summary { display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; list-style: none; }
.wa-help summary::-webkit-details-marker { display: none; }
.wa-help summary .ic { width: 16px; height: 16px; }
.wa-help ol { margin: 10px 0 8px; padding-left: 22px; display: grid; gap: 6px; line-height: 1.45; }
.wa-help a { color: inherit; font-weight: 700; }
.wa-help p { margin: 0; color: #6b5a14; }
.set-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.set-actions form { margin: 0; }
form.set-actions { margin-top: 10px; }
.set-note { margin: 12px 0 0; }
/* Settings → Email report (the wa-* form classes are shared settings-form layout, named after the old
   WhatsApp form): who gets it, which account sends it, and the email preview */
.mail-to { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mail-to .field { margin: 0; }
.wa-providers.mail-presets { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; }
.wa-meta-fields.mail-server { margin-top: 10px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.4fr); }
.wa-meta-fields + .wa-help, .mail-server + .wa-help { margin-top: 14px; }
.mail-preview { padding: 14px 10px; margin-bottom: 14px; border-radius: 16px; background: #f5f3ec; max-height: 620px; overflow-y: auto; }
@media (max-width: 1100px) {
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-col { display: contents; } /* one column: setup, report, day, history */
  #email { order: 1; } #report { order: 2; } #day { order: 3; } #log { order: 4; }
}
@media (max-width: 700px) {
  .mail-to, .wa-providers.mail-presets, .wa-meta-fields.mail-server { grid-template-columns: minmax(0, 1fr); }
}
.settings-link { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; color: inherit; text-decoration: none; transition: border-color .15s; }
.settings-link:hover { border-color: var(--ink-2); }
.settings-link > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.settings-link small { font-size: 13px; }
.sl-ic { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--ink); color: var(--accent); }
.wa-keep { margin: -4px 0 12px; }
/* Settings → WhatsApp: provider choice and Meta details */
.wa-todo { background: var(--accent-soft); color: #5c4800; }
.wa-providers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 14px; padding: 0; border: 0; }
.wa-providers legend { margin-bottom: 8px; padding: 0; }
.wa-provider { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.wa-provider input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--ink); flex: none; }
.wa-provider b { display: block; font-size: 14.5px; }
.wa-provider small { display: block; margin-top: 2px; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.wa-provider:has(input:checked) { border-color: var(--ink); background: var(--accent-soft); }
.wa-meta { margin-bottom: 6px; }
.wa-meta-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wa-meta-fields .field { margin: 0; }
.wa-meta-fields .wa-token input { font-family: ui-monospace, Consolas, monospace; }
.wa-meta-note { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; }
.wa-meta-note .ic { width: 15px; height: 15px; color: var(--cash); }
.wa-meta .wa-help { margin-top: 12px; }
.wa-people-label { display: block; margin: 14px 0 8px; }
.wa-steps { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.wa-status { margin: 10px 0 0; }
.set-note-top { margin: 0 0 8px; }
@media (max-width: 700px) {
  .wa-providers, .wa-meta-fields { grid-template-columns: minmax(0, 1fr); }
}
/* "Confirm it's you" — owner pages ask for the password again after 15 minutes */
.reconfirm { display: grid; place-items: center; min-height: 60vh; }
.reconfirm-card { width: min(430px, 100%); text-align: left; }
.reconfirm-ic { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 14px; border-radius: 16px; background: var(--ink); color: var(--accent); }
.reconfirm-ic .ic { width: 24px; height: 24px; }
.reconfirm-card h1 { margin: 0 0 6px; font: 400 26px/1.1 var(--display); }
.reconfirm-card > p.muted { margin: 0 0 18px; }
.reconfirm-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Compact sizing (owner: "too big and bulky, no extra dead space") ----------
   Pages use the whole width of big screens; text, controls, tiles and gaps are a little smaller.
   Kept together here so it is easy to tune. The previous file is in storage/backup-before-compact/. */
body { font-size: 14px; }
.content { max-width: 1760px; }
@media (min-width: 901px) {
  :root { --sidebar-w: 224px; }
  .content { padding: 22px 26px 40px; }
  .sidebar { padding: 18px 12px 14px; gap: 14px; }
  .side-nav { gap: 2px; }
  .side-nav a, .side-link { gap: 11px; padding: 9px 11px; font-size: 14px; }
  .page-head { margin-bottom: 18px; }
  .page-title { font-size: 28px; }
  .pad { padding: 18px; }
  .card + .card, .grid-2 + .card, .card + .grid-2 { margin-top: 14px; }
  .dash-grid > .card, .combo-grid > .card, .user-grid > .card, .settings-col > .card { margin-top: 0; } /* grid cards: the grid gap spaces them */
  .grid-2 { gap: 14px; }
  .settings-col, .settings-grid { gap: 14px; }
  .card-title { margin-bottom: 14px; font-size: 15px; }
  .btn { height: 38px; padding: 0 14px; font-size: 13.5px; }
  .btn-lg { height: 46px; padding: 0 20px; font-size: 15px; }
  .btn-icon { width: 36px; height: 36px; padding: 0; }
  .btn-icon.btn-sm { width: 34px; height: 34px; }
  .input, .select { height: 40px; font-size: 14px; }
  .field { margin-bottom: 12px; }
  .tabs .tab, .tabs a, .tabs button { font-size: 13.5px; }

  /* dashboard */
  .dash-head .page-actions .dp-trigger { height: 38px; }
  .kpis { gap: 12px; margin-bottom: 12px; }
  .kpi { padding: 15px 18px; }
  .kpi-ic { right: 14px; top: 14px; width: 34px; height: 34px; }
  .kpi-value { font-size: 29px; }
  .kpi-hero { padding: 18px 22px; }
  .kpi-hero .kpi-value { font-size: 44px; max-width: calc(100% - 108px); }
  .kpi-hero > .logo { width: 84px; height: 84px; }
  .highlights { gap: 12px; margin-bottom: 12px; }
  .hi { padding: 10px 14px; }
  .dash-grid { gap: 12px; }
  .chart-card { padding: 16px 18px 18px; }

  /* sales history */
  .stat-strip { gap: 10px; margin-bottom: 14px; }
  .stat b { font-size: 22px; }
  .bill-row { padding: 11px 16px; }

  /* items & combos */
  .item-row { padding: 8px 14px 8px 18px; }
  .cat-tab { height: 42px; padding: 0 15px; font-size: 14px; }
}
/* sales counter: smaller tiles, so more items fit on the screen */
@media (min-width: 1181px) {
  .pos { grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; }
  .item-grid { grid-template-columns: repeat(auto-fill, minmax(142px, 1fr)); gap: 10px; }
}
@media (min-width: 901px) {
  .item-tile { padding: 7px 7px 10px; border-radius: 16px; }
  .tile-name { margin-top: 8px; font-size: 14px; }
  .tile-price { font-size: 13px; }
  .bill-total b { font-size: 30px; }
  .pay-btn { height: 52px; font-size: 15.5px; }
  #complete { height: 54px; font-size: 16px; }
}
/* phones: three items per row on the sales counter instead of two */
@media (max-width: 900px) {
  .page-title { font-size: 24px; }
  .kpi-hero .kpi-value { font-size: 40px; }
}
@media (max-width: 420px) {
  .item-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .item-tile { padding: 5px 5px 8px; border-radius: 14px; }
  .tile-art { border-radius: 10px; font-size: 22px; }
  .tile-name { margin: 6px 3px 1px; font-size: 13px; line-height: 1.2; }
  .tile-note { margin: 0 3px 2px; font-size: 11px; }
  .tile-price { margin: 0 3px; font-size: 12.5px; }
  .tile-qty { top: 9px; right: 9px; min-width: 28px; height: 28px; padding: 0 7px; font-size: 14px; }
}
/* phones: shorter item rows on Items & Combos (the whole "Available"/"Homepage" label is tappable) */
@media (max-width: 900px) {
  .item-row { row-gap: 4px; padding: 9px 12px; }
  .item-row .switch { width: 44px; height: 26px; }
  .item-row .switch .track::after { width: 20px; height: 20px; }
  .item-row .switch input:checked + .track::after { transform: translateX(18px); }
  .item-row .ir-toggle { min-height: 34px; font-size: 12.5px; }
  .item-row .ir-actions .btn-sm { height: 36px; }
  .item-row .ir-actions .btn-icon.btn-sm { width: 36px; }
}

/* ---------- Computers: the whole admin drawn at 86% ----------
   Like zooming the browser out: every size above shrinks together, so pages stay in proportion.
   Change --z to make everything bigger or smaller (1 = off). Notes for anyone editing:
   - vh / dvh lengths are NOT adjusted by zoom, so full-height pieces divide by --z (below);
   - scripts that place pop-ups from screen coordinates divide by the zoom
     (document.documentElement.currentCSSZoom) — see datepicker.js position() and dashboard.js showTip(). */
@media (min-width: 901px) {
  :root { --z: .86; --sidebar-w: 236px; } /* 236 page px = about 203 on screen; fits "Settings & WhatsApp" */
  html { zoom: var(--z); }
  body { font-size: 15px; }
  .content { max-width: 2200px; }
  .app { min-height: calc(100vh / var(--z)); }
  .sidebar { height: calc(100vh / var(--z)); }
  .bare-main, .login, .login-solo { min-height: calc(100vh / var(--z)); }
  .pos-bill { max-height: calc(100vh / var(--z) - 40px); }
  dialog.modal { max-height: calc(100dvh / var(--z) - 32px); }
  .side-nav a, .side-link { font-size: 15px; }
}

/* ---------- Log out: highlighted (owner asked) ---------- */
/* sidebar (computers): a soft red pill that fills red on hover */
.side-link.side-logout {
  margin-top: 6px; border: 1px solid rgba(255, 120, 120, .38); background: rgba(229, 72, 77, .14);
  color: #ffb0b0; font-weight: 700;
}
.side-link.side-logout .ic { color: #ff8f8f; }
.side-link.side-logout:hover { background: #e5484d; border-color: #e5484d; color: #fff; }
.side-link.side-logout:hover .ic { color: #fff; }
/* phones: always in the top bar, next to your initials (asks first, so a stray tap doesn't log you out) */
.top-r { display: flex; align-items: center; gap: 8px; }
.top-r form { margin: 0; }
.top-logout {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 99px;
  border: 1px solid #f1caca; background: var(--danger-soft); color: var(--danger-ink);
  font: 700 13px/1 var(--font); cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background .15s, color .15s, border-color .15s, transform .15s var(--ease);
}
.top-logout .ic { width: 16px; height: 16px; }
.top-logout:active { transform: scale(.95); }
/* My account (phones): a full-width red button */
.btn-logout { height: 46px; background: var(--danger-soft); border-color: #f1caca; color: var(--danger-ink); font-weight: 750; }
.btn-logout:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ---------- Hover animation on every button (mouse/trackpad only; off with "reduce motion") ---------- */
@keyframes rr-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 60% { transform: rotate(10deg); } 85% { transform: rotate(-4deg); } }
@keyframes rr-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  /* lift + soft shadow, press back down */
  .btn { transition: transform .2s var(--ease), background .15s, border-color .15s, color .15s, box-shadow .2s, opacity .15s; }
  .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -9px rgba(18, 18, 18, .38); }
  .btn-ghost:hover { transform: translateY(-1px); box-shadow: none; }
  .btn:active { transform: translateY(0) scale(.97); box-shadow: none; transition-duration: .06s; }

  /* a light sweep across the solid buttons */
  .btn-primary, .btn-accent, .btn-danger.solid, .btn-logout { position: relative; overflow: hidden; isolation: isolate; }
  .btn-primary::after, .btn-accent::after, .btn-danger.solid::after, .btn-logout::after {
    content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, .38) 50%, transparent 70%);
    transform: translateX(-130%); transition: transform .65s var(--ease);
  }
  .btn-primary:hover::after, .btn-accent:hover::after, .btn-danger.solid:hover::after, .btn-logout:hover::after { transform: translateX(130%); }

  /* each icon does its own little move */
  .btn .ic, .side-nav .ic, .side-link .ic, .top-logout .ic, .input-btn .ic, .line-x .ic, .stepper button .ic, .cat-tab .ic, .pay-btn .ic, .tabs .ic, .dp-trigger .ic {
    transition: transform .28s var(--ease);
  }
  .btn:hover .ic { transform: scale(1.12); }
  .btn:hover .i-plus { transform: rotate(90deg) scale(1.08); }
  .btn:hover .i-arrow, .btn:hover .i-right, .btn:hover .i-external { transform: translateX(3px); }
  .btn:hover .i-download { transform: translateY(2px); }
  .btn:hover .i-send { transform: translate(2px, -2px); }
  .btn:hover .i-pencil { transform: rotate(-14deg) scale(1.08); }
  .btn:hover .i-trash { animation: rr-wiggle .45s ease; transform: none; }
  .btn:hover .i-refresh, .btn:hover .i-restore { transform: rotate(-200deg); }
  .btn:hover .i-logout, .side-logout:hover .i-logout, .top-logout:hover .i-logout { transform: translateX(3px); }
  .btn:hover .i-message { transform: rotate(-10deg) scale(1.1); }
  .btn:hover .i-up { transform: translateY(-2px); }
  .btn:hover .i-down, .btn:hover .chev { transform: translateY(2px); }
  .btn:hover .i-x { transform: rotate(90deg); }

  /* sidebar: the link slides a little, its icon grows */
  .side-nav a, .side-link, .side-me { transition: background .15s, color .15s, transform .22s var(--ease), border-color .15s; }
  .side-nav a:not(.active):hover, .side-link:not(.active):not(.side-logout):hover, .side-me:not(.active):hover { transform: translateX(4px); }
  .side-nav a:hover .ic, .side-link:not(.side-logout):hover .ic { transform: scale(1.14); }
  .side-link.side-logout:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -8px rgba(229, 72, 77, .7); }
  .avatar { transition: transform .22s var(--ease); }
  .side-me:hover .avatar, a.avatar:hover { transform: scale(1.08) rotate(-4deg); }
  .top-logout:hover { background: var(--danger); border-color: var(--danger); color: #fff; transform: translateY(-1px); }

  /* sales counter */
  .cat-tab:not(.active):hover { transform: translateY(-2px); box-shadow: 0 8px 16px -10px rgba(18, 18, 18, .4); }
  .cat-tab:active { transform: scale(.97); }
  .item-tile { transition: transform .2s var(--ease), box-shadow .2s, border-color .15s; }
  .item-tile:hover { transform: translateY(-3px); }
  .item-tile:active { transform: scale(.96); }
  .pay-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -12px rgba(18, 18, 18, .45); }
  .pay-btn:hover .ic { transform: scale(1.15) rotate(-6deg); }
  .pay-btn:active { transform: scale(.97); box-shadow: none; }
  .stepper button:hover .ic { transform: scale(1.25); }
  .line-x { transition: background .15s, color .15s, transform .2s var(--ease); }
  .line-x:hover .ic { transform: rotate(90deg); }

  /* tabs, date button, small controls */
  .tabs a:not(.active):hover, .tabs button:not(.active):hover { background: rgba(255, 255, 255, .55); }
  .tabs a:hover .ic, .tabs button:hover .ic { transform: scale(1.12); }
  .dp-trigger { transition: transform .2s var(--ease), border-color .15s, box-shadow .2s; }
  .dp-trigger:hover { transform: translateY(-1px); box-shadow: 0 8px 16px -10px rgba(18, 18, 18, .35); }
  .dp-trigger:hover .ic { transform: scale(1.1); }
  .input-btn:hover .ic { transform: scale(1.15); }
  .flash-x { transition: transform .25s var(--ease), opacity .15s; }
  .flash-x:hover { transform: rotate(90deg); opacity: 1; }
  .switch .track { transition: background .2s, box-shadow .2s; }
  .switch:hover .track { box-shadow: 0 0 0 4px rgba(18, 18, 18, .07); }
  a.recent-row { transition: background .15s, transform .2s var(--ease); }
  a.recent-row:hover { transform: translateX(3px); }
}

/* ---------- Log in animation (login.js) ---------- */
.login-card { position: relative; }
.login-card .btn-lg { position: relative; overflow: hidden; isolation: isolate; }
.login-card .btn-lg > :not(.btn-ripple) { position: relative; z-index: 1; }
.login-card .btn.is-loading { opacity: 1; }
.btn-ripple {
  position: absolute; z-index: 0; border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(circle, rgba(255, 255, 255, .8) 0, rgba(255, 255, 255, .38) 40%, rgba(255, 255, 255, 0) 70%);
  animation: rr-ripple .6s cubic-bezier(.2, .7, .3, 1) forwards;
}
@keyframes rr-ripple { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
.login-card.is-sending .btn-lg { pointer-events: none; }
.login-card.is-sending .ic-arrow { display: none; }
.btn-spin {
  width: 18px; height: 18px; flex: none; border-radius: 50%;
  border: 2.5px solid rgba(18, 18, 18, .22); border-top-color: var(--ink); animation: rr-spin .7s linear infinite;
}
@keyframes rr-spin { to { transform: rotate(360deg); } }
.login-card.is-sending { animation: login-press .45s var(--ease); }
@keyframes login-press { 35% { transform: scale(.985); } }
.login-card.is-sending::after {
  content: ''; position: absolute; left: 24px; right: 24px; top: 0; height: 3px; border-radius: 0 0 3px 3px;
  background: linear-gradient(90deg, var(--accent), var(--ink)); transform-origin: left;
  animation: login-progress 1.4s cubic-bezier(.2, .7, .3, 1) forwards;
}
@keyframes login-progress { from { transform: scaleX(0); } to { transform: scaleX(.92); } }
/* wrong password or an empty box */
.login-card.shake { animation: login-shake .5s cubic-bezier(.36, .07, .19, .97); }
@keyframes login-shake {
  10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); }
}
/* logged in: a yellow "Welcome back" screen with the logo opens onto the first page (layout.php) */
.welcome {
  position: fixed; inset: 0; z-index: 500; display: grid; place-content: center; justify-items: center; gap: 16px;
  background: radial-gradient(circle at 50% 45%, #ffe766 0, var(--accent) 45%, #f5c400 100%); color: var(--ink);
  pointer-events: none; clip-path: circle(150% at 50% 50%);
  animation: welcome-out .5s .62s cubic-bezier(.7, 0, .3, 1) forwards;
}
.welcome .mark { width: 140px; height: 140px; border-radius: 50%; box-shadow: 0 16px 36px rgba(90, 60, 0, .35); animation: welcome-pop .55s cubic-bezier(.2, 1.5, .4, 1) both; }
.welcome b { font: 400 34px/1.1 var(--display); text-transform: uppercase; letter-spacing: .01em; text-align: center; padding: 0 20px; animation: welcome-up .45s .12s var(--ease) both; }
@keyframes welcome-out { to { clip-path: circle(0% at 50% 50%); visibility: hidden; } }
@keyframes welcome-pop { from { transform: scale(.3) rotate(-25deg); opacity: 0; } }
@keyframes welcome-up { from { transform: translateY(14px); opacity: 0; } }
/* the dashboard cards settle in as the welcome screen opens */
.just-in.page-dash .kpi, .just-in.page-dash .hi, .just-in.page-dash .dash-grid > .card { animation-delay: .78s; }
.just-in.page-dash .kpi:nth-child(2), .just-in.page-dash .hi:nth-child(2) { animation-delay: .83s; }
.just-in.page-dash .kpi:nth-child(3), .just-in.page-dash .hi:nth-child(3) { animation-delay: .88s; }
.just-in.page-dash .kpi:nth-child(4) { animation-delay: .93s; }
.just-in.page-dash .dash-grid > .card:nth-child(n+3) { animation-delay: .98s; }

/* ---------- Sales counter: tap animation on an item (pos.js tapFX) ---------- */
.item-tile { overflow: hidden; }
.tile-qty { z-index: 3; }
.tap-ripple {
  position: absolute; z-index: 2; border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%) scale(0);
  background: radial-gradient(circle, rgba(255, 216, 15, .62) 0, rgba(255, 216, 15, .38) 42%, rgba(255, 216, 15, 0) 70%);
  animation: rr-ripple .55s cubic-bezier(.2, .7, .3, 1) forwards;
}
.item-tile.tap-pop { animation: tap-pop .34s cubic-bezier(.3, 1.5, .5, 1); }
@keyframes tap-pop { 0% { transform: scale(.93); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }
.tap-plus {
  position: fixed; z-index: 95; pointer-events: none; padding: 5px 10px; border-radius: 99px;
  background: var(--accent); color: var(--ink); font: 800 15px/1 var(--font);
  box-shadow: 0 0 0 2px var(--ink), 0 8px 18px rgba(0, 0, 0, .25);
  transform: translate(-50%, -50%); animation: tap-plus .75s cubic-bezier(.2, .8, .3, 1) forwards;
}
@keyframes tap-plus {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(.5); }
  18% { opacity: 1; transform: translate(-50%, -90%) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -260%) scale(.92); }
}
.fly-ghost { position: fixed; z-index: 94; margin: 0; pointer-events: none; aspect-ratio: auto; box-shadow: 0 12px 26px rgba(0, 0, 0, .28); will-change: transform, opacity; }
.line.got-item, .bill-bar.got-item { animation: got-item .38s var(--ease); }
@keyframes got-item { 40% { transform: scale(1.035); } }
.bill-total b.tick { animation: total-tick .45s var(--ease); }
@keyframes total-tick { 40% { transform: scale(1.1); color: #b38a00; } }

@media (prefers-reduced-motion: reduce) {
  .welcome, .tap-ripple, .tap-plus, .fly-ghost, .btn-ripple { display: none; }
  .item-tile.tap-pop, .login-card.shake, .login-card.is-sending, .line.got-item, .bill-bar.got-item, .bill-total b.tick { animation: none; }
}
@media (min-width: 901px) {
  .welcome .mark { width: 180px; height: 180px; } /* about 155 px on screen (the admin is drawn at 86%) */
  .welcome b { font-size: 42px; }
}

/* ---------- Pay later · Table / name · receipt printing ---------- */
:root { --later: #c2620a; --later-ink: #8f430b; --later-soft: #fdebd2; }
.badge-later { background: var(--later-soft); color: var(--later-ink); }
.stat-later > span { color: var(--later-ink); }

/* sales counter: the Unpaid button sits next to the search */
.pos-top-r { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex: 1; min-width: 0; }
.unpaid-btn { flex: none; gap: 8px; border-color: var(--later); background: var(--later-soft); color: var(--later-ink); font-weight: 750; }
.unpaid-btn:hover { border-color: var(--later-ink); background: #fbdfb8; }
.unpaid-btn .count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--later); color: #fff; font-size: 12.5px; font-weight: 800; }
@media (max-width: 900px) {
  .pos-top-r { width: 100%; }
  .pos-top-r .search { flex: 1; width: auto; }
}
@media (max-width: 420px) { .unpaid-btn .ub-label { display: none; } }

/* bill: Table / name */
.table-field { position: relative; display: block; }
.table-field > .ic { position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.table-field:focus-within > .ic { color: var(--ink); }
.table-field .input { height: 42px; padding-left: 40px; font-weight: 650; }

/* bill: three ways to pay, icon over the word so "Pay later" fits the narrow bill */
.pay-toggle { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pay-toggle .pay-btn { flex-direction: column; gap: 4px; padding: 0 4px; font-size: 14px; }
.pay-toggle .pay-btn .ic { width: 21px; height: 21px; }
.pay-btn[data-pay="later"][aria-checked="true"] { border-color: var(--later); background: var(--later-soft); color: var(--later-ink); }

/* bill: the Print switch next to the big button (black + yellow when on) */
.bill-go { display: flex; align-items: stretch; gap: 10px; }
.bill-go #complete { flex: 1; min-width: 0; }
.print-opt {
  position: relative; flex: none; width: 66px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border: 2px solid var(--line-2); border-radius: 16px; background: #fff; color: var(--muted); font-size: 11.5px; font-weight: 750;
  cursor: pointer; user-select: none; transition: background .15s, border-color .15s, color .15s; -webkit-tap-highlight-color: transparent;
}
.print-opt input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.print-opt .ic { width: 22px; height: 22px; opacity: .55; }
.print-opt:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--accent); }
.print-opt:has(input:checked) .ic { opacity: 1; }
.print-opt:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Unpaid list (popup on the sales counter) */
.unpaid-dialog { width: min(640px, calc(100vw - 32px)); }
.unpaid-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.up-row { padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; transition: opacity .3s, transform .3s var(--ease); }
.up-row.busy { opacity: .7; }
.up-row.done { opacity: 0; transform: translateX(48px); }
.up-top { display: flex; align-items: center; gap: 10px; }
.up-id { display: flex; flex-direction: column; line-height: 1.15; }
.up-id b { font-size: 17px; }
.up-id small { color: var(--muted); font-size: 12px; }
.up-table { max-width: 45%; overflow: hidden; padding: 4px 10px; border-radius: 10px; background: var(--ink); color: var(--accent); font-size: 14px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.up-total { margin-left: auto; font: 400 22px/1 var(--display); font-variant-numeric: tabular-nums; }
.up-items { margin: 10px 0 2px; font-weight: 600; }
.up-by { margin: 0; color: var(--muted); font-size: 12.5px; }
.up-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.up-actions .up-pay[data-pay="cash"] { border-color: var(--cash); background: var(--cash-soft); color: var(--cash-ink); }
.up-actions .up-pay[data-pay="upi"] { border-color: var(--upi); background: var(--upi-soft); color: var(--upi-ink); }
.up-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 10px; color: var(--muted); text-align: center; }
.up-empty .ic.big { width: 40px; height: 40px; color: var(--cash); }
.up-empty b { color: var(--ink); font-size: 16px; }

/* Sales history: table / name under the bill number, Not paid + "Paid cash / UPI" on the row */
.b-id .b-table { display: block; width: fit-content; max-width: 100%; margin-top: 4px; padding: 1px 7px; overflow: hidden; border-radius: 7px; background: var(--ink); color: var(--accent); font-size: 11.5px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.b-pay .badge-later { font-weight: 750; }
.pay-forms { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.pay-forms form { display: inline-flex; margin: 0; }
a.stat { color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.stat:hover { border-color: var(--later); box-shadow: 0 8px 22px -16px rgba(143, 67, 11, .5); }
a.stat:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn.pay-cash { border-color: var(--cash); background: var(--cash-soft); color: var(--cash-ink); }
.btn.pay-upi { border-color: var(--upi); background: var(--upi-soft); color: var(--upi-ink); }
.bd-meta .bd-table { font-weight: 800; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .print-opt:hover { border-color: var(--ink-2); }
  .print-opt:hover .ic { transform: translateY(-1px) scale(1.08); }
  .print-opt .ic { transition: transform .18s var(--ease), opacity .15s; }
  .up-row:hover { border-color: var(--line-2); box-shadow: 0 8px 22px -16px rgba(18, 18, 18, .35); }
}

/* ---------- 2-step login (login code screen, My account) · Security check (Settings) ---------- */
.code-input { font: 700 22px/1 var(--mono); letter-spacing: .18em; text-align: center; }
.input-icon .code-input { padding-right: 46px; }
.link-btn { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.two-step { margin-top: 18px; }
.two-step .card-title .badge { margin-left: 6px; }
.ts-status { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 12px; }
.ts-status > .ic { flex: none; margin-top: 2px; color: var(--cash); }
.ts-steps { display: grid; gap: 16px; margin: 6px 0 12px; padding-left: 22px; }
.ts-steps li { padding-left: 4px; line-height: 1.5; }
.ts-steps li > .btn { margin: 6px 0 4px; }
.ts-steps li > .small { display: block; margin-top: 6px; }
.ts-key { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.ts-key code { padding: 9px 12px; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--surface-2); font: 600 16px/1.3 var(--mono); letter-spacing: .06em; word-break: break-all; }
.ts-confirm { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-top: 8px; }
.ts-confirm .field { margin: 0; flex: 0 1 220px; }
.ts-confirm .code-input { height: 46px; }
.ts-confirm .btn { height: 46px; }
.ts-cancel { margin-top: 4px; }
.ts-more { margin-top: 6px; }
.ts-more summary { cursor: pointer; font-weight: 700; color: var(--ink-2); }
.ts-form { display: grid; gap: 10px; max-width: 460px; margin-top: 12px; }
.ts-codes { margin-bottom: 16px; padding: 14px 16px; border: 1px solid #f0d98a; border-radius: 14px; background: var(--accent-soft); }
.ts-codes p { margin: 0 0 10px; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 14px; margin: 0 0 12px; padding-left: 22px; }
.codes code { font: 700 16px/1.6 var(--mono); letter-spacing: .04em; }

.sec-list { display: grid; gap: 2px; margin: 6px 0 12px; padding: 0; list-style: none; }
.sec-list li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sec-list li:last-child { border-bottom: 0; }
.sec-list .sec-ic { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; }
.sec-list .sec-ic .ic { width: 15px; height: 15px; stroke-width: 3; }
.sec-list .ok .sec-ic { background: var(--cash-soft); color: var(--cash-ink); }
.sec-list .warn .sec-ic { background: var(--later-soft); color: var(--later-ink); }
.sec-list .bad .sec-ic { background: var(--danger-soft); color: var(--danger-ink); }
.sec-list b { display: block; }
.sec-list small { display: block; color: var(--muted); line-height: 1.45; }
.sec-list .bad b { color: var(--danger-ink); }
.sec-sum { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-weight: 700; }

/* ---------- Scan to order (QR cards on the tables) ---------- */
/* New sale → "QR orders" button: yellow; red and ringing when a guest says they've paid */
.qr-btn { flex: none; gap: 8px; border-color: var(--ink); background: var(--accent); color: var(--ink); font-weight: 750; }
.qr-btn:hover { background: var(--accent-hover); border-color: var(--ink); }
.qr-btn .count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; background: var(--ink); color: var(--accent); font-size: 12.5px; font-weight: 800; }
.qr-btn.off { background: var(--surface); border-color: var(--line-2); color: var(--muted); }
.qr-btn.hot { background: var(--danger); border-color: var(--danger); color: #fff; animation: qr-ring 1.2s ease-in-out infinite; }
.qr-btn.hot .count { background: #fff; color: var(--danger); }
@keyframes qr-ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(207, 59, 59, .55); } 50% { box-shadow: 0 0 0 8px rgba(207, 59, 59, 0); } }
@media (max-width: 420px) { .qr-btn .ub-label { display: none; } }
@media (prefers-reduced-motion: reduce) { .qr-btn.hot { animation: none; } }

.qr-dialog .modal-head { gap: 10px; }
.qr-switch { display: flex; align-items: center; gap: 8px; margin-left: auto; font-size: 13px; font-weight: 700; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.qr-row.says-paid { border-color: var(--cash); box-shadow: inset 4px 0 0 var(--cash); }
.qr-state { display: flex; align-items: center; gap: 6px; margin: 10px 0 0; font-size: 13px; font-weight: 750; color: var(--muted); }
.qr-state .ic { width: 16px; height: 16px; }
.says-paid .qr-state { color: var(--cash-ink); }
.qr-note { margin: 6px 0 0; padding: 7px 10px; border-radius: 10px; background: var(--accent-soft); font-size: 13.5px; }
.qr-accept { border-color: var(--upi); background: var(--upi); color: #fff; }
.qr-accept:hover { background: var(--upi-ink); border-color: var(--upi-ink); }
.qr-accept.soft { background: var(--upi-soft); color: var(--upi-ink); }
.qr-reasons { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.qr-reason.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.toast.link { cursor: pointer; }
.toast.link span { text-decoration: underline; text-underline-offset: 3px; }

/* Sales history: bills that came from a QR card */
.b-id .b-qr { display: inline-block; margin-top: 4px; padding: 1px 6px; border-radius: 7px; background: var(--upi-soft); color: var(--upi-ink); font-size: 11px; font-weight: 800; letter-spacing: .04em; }

/* Owner page: QR ordering */
.sl-ic.sl-qr { background: var(--accent); color: var(--ink); }
.ic.ic-inline { width: 15px; height: 15px; vertical-align: -3px; }
.qr-steps { margin: 0 0 10px; padding-left: 20px; }
.qr-steps li { margin-bottom: 6px; }
.qt-list { margin: 0 0 14px; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 14px; }
.qt-row { display: flex; align-items: center; gap: 12px; padding: 9px 10px 9px 14px; }
.qt-row + .qt-row { border-top: 1px solid var(--line); }
.qt-row:target { background: var(--accent-soft); }
.qt-row.is-off .qt-name b { color: var(--muted); text-decoration: line-through; }
.qt-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.qt-name b { font-size: 15px; }
.qt-name small { color: var(--muted); font-size: 12.5px; }
.qt-actions { display: flex; align-items: center; gap: 6px; }
.qt-more { position: relative; }
.qt-more > summary { list-style: none; }
.qt-more > summary::-webkit-details-marker { display: none; }
.qt-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; display: grid; gap: 8px; width: 290px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); }
.qt-menu form { margin: 0; }
.qt-rename { display: flex; gap: 8px; }
.qt-rename .input { height: 34px; }
.qt-menu .btn-block { justify-content: flex-start; }
.qt-add { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.qt-add form { margin: 0; }
.qt-add-form { display: flex; align-items: center; gap: 8px; font-weight: 650; }
.qt-add-form .input { width: 72px; text-align: center; }
.qr-test { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.qr-test-code { width: 120px; height: 120px; flex: none; }
.qr-test-code svg { display: block; width: 100%; height: 100%; border-radius: 8px; }
.qr-test p { margin: 4px 0 0; }
@media (max-width: 560px) {
  .qt-actions .btn span { display: none; }
  /* phones: the table's menu opens as a sheet above the bottom tab bar, so it's never off-screen */
  .qt-menu { position: fixed; left: 12px; right: 12px; top: auto; width: auto; bottom: calc(var(--tabbar-h) + 12px + env(safe-area-inset-bottom)); z-index: 60; }
}

/* Sales history: the "Pay later drafts" card (drafts are not sales until paid) */
.stat b.stat-note { font-size: 16px; line-height: 1.3; }

/* Settings → Homepage rolls: which featured rolls have a photo */
.roll-photo-list { display: grid; gap: 6px; margin: 12px 0; padding: 0; list-style: none; font-weight: 600; font-size: 14px; }
.roll-photo-list .badge { min-width: 74px; justify-content: center; margin-right: 6px; }

/* ---------- Counter update (4 Dec 2026): token numbers, UPI QR at the counter, UPI check ---------- */
/* New sale: "Last token 23" pill (the token of the last bill, to tell the customer) */
.last-token { flex: none; display: inline-flex; align-items: baseline; gap: 5px; padding: 7px 12px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--surface); color: var(--ink-2); font-size: 13px; font-weight: 700; white-space: nowrap; }
.last-token b { font: 400 19px/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { /* small phones: "TOKEN" stacked over the number, so the search box keeps its room */
  .last-token .lt-a { display: none; }
  .last-token { flex-direction: column; align-items: center; gap: 1px; padding: 4px 11px 5px; font-size: 9.5px; letter-spacing: .07em; text-transform: uppercase; line-height: 1; }
  .last-token b { font-size: 17px; letter-spacing: 0; }
  .pos-top-r { gap: 8px; }
}
/* "Sale done!": the token is the biggest thing on it (the tick shrinks a little to make room) */
.bs-token { display: flex; align-items: baseline; gap: 9px; margin: 8px 0 4px; padding: 5px 18px 8px; border-radius: 18px; background: var(--ink); color: var(--accent); animation: bs-up .45s .24s var(--ease) both; }
.bs-token small { font: 700 12.5px/1 var(--font); letter-spacing: .16em; text-transform: uppercase; opacity: .85; }
.bs-token b { font: 400 54px/1 var(--display); font-variant-numeric: tabular-nums; }
.bill-success.has-token .ok-ring { width: 64px; height: 64px; margin-bottom: 6px; }
.bill-success.has-token .ok-ring .ic { width: 34px; height: 34px; }
/* UPI picked: a QR with the bill's exact amount (tap it, or "Show big", for the customer to scan) */
.upi-pay { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1.5px solid var(--upi); border-radius: 14px; background: #fff; }
.upi-qr { flex: none; width: 84px; height: 84px; padding: 0; border: 0; background: #fff; cursor: zoom-in; }
.upi-qr svg { display: block; width: 100%; height: 100%; }
.upi-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.upi-text b { color: var(--upi-ink); font-size: 15px; }
.upi-text small { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.upi-pay .btn { flex: none; }
@media (min-width: 901px) { dialog.modal.upi-dialog { width: min(400px, calc(100vw - 24px)); } } /* phones: a bottom sheet like the other windows */
.upi-dialog form { align-items: center; gap: 6px; padding: 22px 22px 18px; text-align: center; }
.upi-big-code { width: min(320px, 100%); aspect-ratio: 1; }
.upi-big-code svg { display: block; width: 100%; height: 100%; }
.upi-big-amt { margin-top: 6px; font: 400 40px/1 var(--display); font-variant-numeric: tabular-nums; }
.upi-big-to { font-weight: 700; color: var(--ink-2); }
.upi-big-hint { margin-bottom: 8px; color: var(--muted); font-size: 12.5px; }
/* token pills: Unpaid list, Sales history */
.up-token { flex: none; padding: 4px 9px; border-radius: 10px; background: var(--accent); color: var(--ink); font-size: 13px; font-weight: 800; white-space: nowrap; }
.b-id .b-tok { display: inline-block; margin-left: 3px; padding: 1px 6px; border-radius: 7px; background: var(--accent); color: var(--ink); font-size: 11px; font-weight: 800; white-space: nowrap; vertical-align: 1px; }
@media (min-width: 901px) { .bill-row { grid-template-columns: 104px minmax(0, 1fr) 96px 104px auto; } } /* "#52 Token 41" on one line */
@media (max-width: 900px) { .b-id .b-tok { margin: 2px 0 0; padding: 1px 5px; font-size: 10.5px; } } /* fits the 60px column */
/* Items → Combos: a switched-off item hides its combos */
.combo-items li.is-off { color: var(--muted); text-decoration: line-through; }
.combo-off { display: flex; gap: 8px; align-items: flex-start; margin: 0 16px 12px; padding: 8px 10px; border-radius: 10px; background: var(--later-soft); color: var(--later-ink); font-size: 13px; line-height: 1.4; }
.combo-off .ic { flex: none; width: 16px; height: 16px; margin-top: 1px; }
/* Settings → Receipt printer: FSSAI number */
.set-fssai { margin: 14px 0 4px; }
.set-fssai .input { max-width: 260px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.sl-ic.sl-upi { background: var(--upi-soft); color: var(--upi-ink); }
.pay-note a { color: inherit; font-weight: 750; white-space: nowrap; }
/* Owner page: UPI check */
.uc-days { display: flex; margin-bottom: 10px; }
.uc-days a { white-space: nowrap; }
.uc-other { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; }
.uc-other .input { width: auto; height: 36px; }
.uc-ours { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 14px; border-radius: 14px; background: var(--upi-soft); }
.uc-ours > span { flex-basis: 100%; display: flex; align-items: center; gap: 6px; color: var(--upi-ink); font-size: 13.5px; font-weight: 650; }
.uc-ours > span .ic { width: 17px; height: 17px; }
.uc-ours > b { font: 400 30px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.uc-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 14px; }
.uc-form .field { flex: 1 1 220px; margin: 0; }
.uc-form .btn { height: 44px; }
.uc-result { margin-top: 14px; padding: 12px 14px; border-radius: 14px; }
.uc-result b { display: flex; align-items: center; gap: 8px; font-size: 18px; }
.uc-result b .ic { width: 20px; height: 20px; }
.uc-result p { margin: 4px 0 6px; line-height: 1.45; }
.uc-result small { opacity: .8; }
.uc-ok { background: var(--cash-soft); color: var(--cash-ink); }
.uc-bad { background: var(--danger-soft); color: var(--danger-ink); }
.uc-warn { background: var(--later-soft); color: var(--later-ink); }
.uc-bills { margin-top: 14px; }
.uc-bills summary { cursor: pointer; font-weight: 700; color: var(--ink-2); }
.uc-bills .table-wrap { margin-top: 8px; }
.uc-bills .table td, .uc-bills .table th, .uc-past td, .uc-past th { padding: 8px 10px; }
.uc-note { margin: 14px 0 0; }
