/* Sugar POS — neon night theme taken from The Little Sugar House advert */
@font-face { font-family: 'Fredoka'; src: url(fonts/fredoka-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url(fonts/fredoka-latin-500-normal.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url(fonts/fredoka-latin-600-normal.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url(fonts/fredoka-latin-700-normal.woff2) format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Pacifico'; src: url(fonts/pacifico-latin-400-normal.woff2) format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --bg: #12061f; --bg2: #1b0a30; --panel: #231040; --panel2: #2e1652; --panel3: #3a1d66;
  --line: rgba(255, 255, 255, .09); --line2: rgba(255, 255, 255, .16);
  --pink: #ff2fa8; --pink2: #ff74c9; --magenta: #d81b8f; --purple: #8b3dff; --violet: #b46cff;
  --blue: #2f8bff; --cyan: #3fd0ff; --yellow: #ffe03d; --lime: #8ee62f; --red: #ff4d6d; --orange: #ff9f3d;
  --text: #fff4fb; --muted: #c4acdf; --dim: #8f78ad;
  --radius: 14px; --radius-sm: 10px;
  --glow-pink: 0 0 0 1px rgba(255, 47, 168, .5), 0 6px 22px rgba(255, 47, 168, .35);
  --font: 'Fredoka', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font); color: var(--text); font-size: 15px; line-height: 1.35;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(255, 47, 168, .22), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(47, 139, 255, .20), transparent 60%),
    radial-gradient(700px 500px at 50% 120%, rgba(139, 61, 255, .25), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--cyan); }
::selection { background: var(--pink); color: #fff; }
.num, td.num, .money { font-variant-numeric: tabular-nums; }

/* ---------- boot / brand ---------- */
.boot { height: 100vh; display: grid; place-content: center; gap: 22px; justify-items: center; }
.brand-script { font-family: 'Pacifico', cursive; font-size: 30px; line-height: 1.25; color: var(--pink2);
  text-shadow: 0 0 6px rgba(255, 47, 168, .9), 0 0 22px rgba(255, 47, 168, .55), 2px 2px 0 #5b0e3f; }
.spinner { width: 38px; height: 38px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .12); border-top-color: var(--pink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- auth screens ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(440px, 100%); background: linear-gradient(180deg, rgba(46, 22, 82, .92), rgba(27, 10, 48, .95));
  border: 1px solid var(--line2); border-radius: 22px; padding: 30px 28px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5), 0 0 0 1px rgba(255, 47, 168, .15); }
.auth-card .brand-script { text-align: center; font-size: 34px; margin-bottom: 4px; }
.auth-card .tagline { text-align: center; color: var(--yellow); font-weight: 600; margin-bottom: 22px; letter-spacing: .3px; }
.auth-card .logo-img { display: block; max-height: 90px; max-width: 70%; margin: 0 auto 10px; border-radius: 12px; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.pinpad button { height: 62px; font-size: 24px; font-weight: 600; border-radius: 14px; border: 1px solid var(--line2); background: var(--panel2); cursor: pointer; }
.pinpad button:active { transform: scale(.97); background: var(--panel3); }
.pin-dots { display: flex; justify-content: center; gap: 12px; height: 26px; align-items: center; margin-top: 8px; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--pink2); }
.pin-dots span.on { background: var(--pink); box-shadow: 0 0 10px var(--pink); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 228px 1fr; height: 100vh; }
.side { background: linear-gradient(180deg, rgba(35, 16, 64, .95), rgba(18, 6, 31, .95)); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.side .brand { padding: 18px 16px 12px; text-align: center; border-bottom: 1px solid var(--line); }
.side .brand .brand-script { font-size: 21px; word-break: break-word; }
.side .brand img { max-width: 100%; max-height: 64px; border-radius: 10px; display: block; margin: 0 auto 6px; }
.side .brand small { display: block; color: var(--yellow); font-weight: 600; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; margin-top: 2px; }
.nav { padding: 10px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; flex: 1; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: 15.5px; position: relative; }
.nav a svg { width: 22px; height: 22px; flex: none; }
.nav a:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.nav a.active { color: #fff; background: linear-gradient(90deg, rgba(255, 47, 168, .32), rgba(139, 61, 255, .18)); box-shadow: inset 3px 0 0 var(--pink); }
.nav a.active svg { color: var(--pink2); filter: drop-shadow(0 0 6px rgba(255, 47, 168, .8)); }
.nav .badge { margin-left: auto; }
.side .me { padding: 12px; border-top: 1px solid var(--line); display: flex; gap: 10px; align-items: center; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: linear-gradient(135deg, var(--pink), var(--purple)); flex: none; }
.me .who { min-width: 0; flex: 1; }
.me .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who small { color: var(--dim); }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: rgba(18, 6, 31, .55); backdrop-filter: blur(8px); flex-wrap: wrap; }
.topbar h1 { font-size: 22px; margin: 0; font-weight: 600; }
.topbar .spacer { flex: 1; }
.clock { color: var(--muted); font-variant-numeric: tabular-nums; }
.menu-btn { display: none; }
.page { flex: 1; overflow: auto; padding: 20px; min-height: 0; }
.page.flush { padding: 0; overflow: hidden; display: flex; }

/* ---------- common UI ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 12px; border: 1px solid var(--line2);
  background: var(--panel2); cursor: pointer; font-weight: 500; white-space: nowrap; transition: transform .06s, background .15s, box-shadow .15s; min-height: 40px; text-decoration: none; color: var(--text); }
.btn:hover { background: var(--panel3); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn.pink { background: linear-gradient(135deg, var(--pink), var(--magenta)); border-color: transparent; box-shadow: var(--glow-pink); color: #fff; font-weight: 600; }
.btn.pink:hover { filter: brightness(1.08); }
.btn.yellow { background: var(--yellow); color: #2b0d3f; border-color: transparent; font-weight: 600; }
.btn.blue { background: linear-gradient(135deg, var(--blue), #1f5fd6); border-color: transparent; color: #fff; font-weight: 600; }
.btn.lime { background: var(--lime); color: #1b2a05; border-color: transparent; font-weight: 600; }
.btn.danger { background: rgba(255, 77, 109, .16); border-color: rgba(255, 77, 109, .5); color: #ffc2cf; }
.btn.danger:hover { background: rgba(255, 77, 109, .3); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; min-height: 32px; font-size: 13.5px; border-radius: 9px; }
.btn.lg { padding: 14px 22px; font-size: 18px; min-height: 54px; border-radius: 14px; }
.btn.icon { padding: 0; width: 40px; }
.btn.sm.icon { width: 32px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; }
.muted { color: var(--muted); } .dim { color: var(--dim); }
.yellow-t { color: var(--yellow); } .pink-t { color: var(--pink2); } .red-t { color: #ff8ba0; } .lime-t { color: var(--lime); } .cyan-t { color: var(--cyan); }
.card { background: linear-gradient(180deg, rgba(46, 22, 82, .75), rgba(35, 16, 64, .75)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card h3 { margin: 0 0 12px; font-size: 17px; font-weight: 600; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.badge { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: rgba(255, 255, 255, .1); white-space: nowrap; }
.badge.pink { background: rgba(255, 47, 168, .22); color: var(--pink2); }
.badge.red { background: rgba(255, 77, 109, .22); color: #ff9db0; }
.badge.yellow { background: rgba(255, 224, 61, .18); color: var(--yellow); }
.badge.lime { background: rgba(142, 230, 47, .18); color: var(--lime); }
.badge.blue { background: rgba(47, 139, 255, .22); color: #8fc2ff; }
.badge.purple { background: rgba(139, 61, 255, .25); color: #d2b2ff; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); font-size: 14px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.empty { text-align: center; padding: 40px 20px; color: var(--dim); }
.empty b { display: block; color: var(--muted); font-size: 17px; margin-bottom: 4px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }

/* forms */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 500; }
.field > span .req { color: var(--pink2); }
.input, select.input, textarea.input { width: 100%; background: rgba(10, 3, 20, .55); border: 1px solid var(--line2); border-radius: 11px; padding: 10px 12px; outline: none; min-height: 42px; }
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(255, 47, 168, .22); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
select.input option { background: var(--bg2); }
.input.big { font-size: 26px; font-weight: 600; text-align: right; min-height: 58px; }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; user-select: none; padding: 4px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--pink); flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.seg { display: inline-flex; background: rgba(10, 3, 20, .5); border: 1px solid var(--line2); border-radius: 12px; padding: 3px; gap: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button.on { background: linear-gradient(135deg, var(--pink), var(--magenta)); color: #fff; box-shadow: 0 2px 10px rgba(255, 47, 168, .4); }

/* tables */
.table-wrap { overflow: auto; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(27, 10, 48, .6); }
table.t { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.t th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .6px; padding: 11px 12px; background: rgba(46, 22, 82, .85); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.t td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.t tr.click { cursor: pointer; }
.t tbody tr:hover td { background: rgba(255, 255, 255, .03); }
.t .num { text-align: right; white-space: nowrap; }
.t tfoot td { font-weight: 700; background: rgba(46, 22, 82, .6); }
.thumb { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; display: block; background: var(--panel3); }
.thumb.ph { display: grid; place-items: center; font-weight: 700; color: #fff; font-size: 17px; }
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: 0; padding: 10px 14px; cursor: pointer; color: var(--muted); font-weight: 500; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: #fff; border-bottom-color: var(--pink); }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input { width: auto; min-width: 160px; }
.toolbar .search { flex: 1; min-width: 200px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { padding: 14px 16px; border-radius: var(--radius); background: linear-gradient(160deg, rgba(58, 29, 102, .85), rgba(35, 16, 64, .85)); border: 1px solid var(--line); position: relative; overflow: hidden; }
.kpi::after { content: ''; position: absolute; inset: auto -20px -40px auto; width: 90px; height: 90px; border-radius: 50%; background: var(--accent, var(--pink)); opacity: .16; filter: blur(4px); }
.kpi small { color: var(--muted); font-weight: 500; font-size: 13px; }
.kpi b { display: block; font-size: 24px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi em { font-style: normal; font-size: 12.5px; color: var(--dim); }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: 1fr 400px; width: 100%; min-height: 0; }
.pos-left { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 14px 16px 0; }
.pos-search { display: flex; gap: 10px; margin-bottom: 10px; }
.pos-search .input { font-size: 17px; min-height: 48px; padding-left: 42px; background-image: none; }
.pos-search .sicon { position: relative; flex: 1; }
.pos-search .sicon svg { position: absolute; left: 13px; top: 14px; width: 20px; height: 20px; color: var(--dim); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.chip { flex: none; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line2); background: rgba(255, 255, 255, .04); cursor: pointer; font-weight: 500; display: inline-flex; gap: 8px; align-items: center; min-height: 40px; }
.chip.on { background: var(--c, var(--pink)); border-color: transparent; color: #fff; box-shadow: 0 0 16px color-mix(in srgb, var(--c, var(--pink)) 55%, transparent); }
.chip.sub { min-height: 34px; padding: 5px 13px; font-size: 14px; }
.chip.sub.on { background: rgba(255, 255, 255, .16); box-shadow: inset 0 0 0 2px var(--c, var(--pink)); }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; overflow-y: auto; padding: 4px 2px 16px; align-content: start; flex: 1; min-height: 0; }
.pcard { border-radius: 16px; background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); cursor: pointer; overflow: hidden; display: flex; flex-direction: column; text-align: left; padding: 0; position: relative; transition: transform .08s, box-shadow .15s; }
.pcard:hover { box-shadow: 0 0 0 1px var(--c, var(--pink)), 0 8px 24px rgba(0, 0, 0, .35); }
.pcard:active { transform: scale(.97); }
.pcard .img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; display: block; background: var(--panel3); }
.pcard .img.ph { display: grid; place-items: center; font-size: 34px; font-weight: 700; color: rgba(255, 255, 255, .92); text-shadow: 0 2px 8px rgba(0, 0, 0, .3);
  background: linear-gradient(135deg, var(--c, var(--pink)), color-mix(in srgb, var(--c, var(--pink)) 40%, #12061f)); }
.pcard .info { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.pcard .nm { font-weight: 500; font-size: 14.5px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.4em; }
.pcard .pr { font-weight: 700; color: var(--yellow); font-size: 16.5px; margin-top: auto; }
.pcard .stk { position: absolute; top: 7px; right: 7px; font-size: 11.5px; background: rgba(18, 6, 31, .78); color: #fff; backdrop-filter: blur(2px); }
.pcard .stk.red { color: #ff9db0; } .pcard .stk.yellow { color: var(--yellow); }
.pcard.out { opacity: .5; }
.pcard .qbadge { position: absolute; top: 7px; left: 7px; background: var(--pink); color: #fff; border-radius: 999px; min-width: 26px; height: 26px; display: grid; place-items: center; font-weight: 700; font-size: 14px; box-shadow: 0 0 12px var(--pink); }
.cart { border-left: 1px solid var(--line); background: linear-gradient(180deg, rgba(35, 16, 64, .92), rgba(18, 6, 31, .95)); display: flex; flex-direction: column; min-height: 0; }
.cart-head { padding: 12px 14px; display: flex; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); }
.cart-head h2 { margin: 0; font-size: 18px; font-weight: 600; flex: 1; }
.cart-lines { flex: 1; overflow-y: auto; padding: 6px 8px; min-height: 0; }
.cline { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; }
.cline:hover { background: rgba(255, 255, 255, .04); border-color: var(--line); }
.cline.flash { animation: flash .5s; }
@keyframes flash { from { background: rgba(255, 47, 168, .35); } to { background: transparent; } }
.cline .n { font-weight: 500; }
.cline .t { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.cline .d { color: var(--muted); font-size: 13.5px; display: flex; gap: 8px; align-items: center; }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty button { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel2); cursor: pointer; font-size: 18px; font-weight: 600; line-height: 1; }
.qty b { min-width: 30px; text-align: center; font-variant-numeric: tabular-nums; }
.cart-tot { padding: 12px 16px; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.cart-tot .r { display: flex; justify-content: space-between; color: var(--muted); font-variant-numeric: tabular-nums; }
.cart-tot .r.total { color: #fff; font-size: 28px; font-weight: 700; margin-top: 4px; }
.cart-tot .r.total span:last-child { color: var(--yellow); text-shadow: 0 0 14px rgba(255, 224, 61, .45); }
.cart-actions { padding: 0 14px 14px; display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.cart-actions .pay { grid-column: 1 / -1; font-size: 22px; min-height: 64px; }
.shift-gate { margin: auto; max-width: 420px; text-align: center; }

/* payment */
.pay-total { text-align: center; padding: 6px 0 14px; }
.pay-total small { color: var(--muted); }
.pay-total b { display: block; font-size: 44px; color: var(--yellow); text-shadow: 0 0 20px rgba(255, 224, 61, .4); font-variant-numeric: tabular-nums; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 10px 0; }
.quick .btn { min-height: 52px; font-size: 17px; font-weight: 600; }
.change-box { text-align: center; padding: 14px; border-radius: 14px; background: rgba(142, 230, 47, .1); border: 1px solid rgba(142, 230, 47, .35); margin-top: 8px; }
.change-box b { display: block; font-size: 34px; color: var(--lime); font-variant-numeric: tabular-nums; }
.change-box.short { background: rgba(255, 77, 109, .1); border-color: rgba(255, 77, 109, .4); }
.change-box.short b { color: #ff8ba0; }
.done-big { text-align: center; padding: 10px 0; }
.done-big .tick { width: 76px; height: 76px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: #1b2a05; font-size: 42px; box-shadow: 0 0 30px rgba(142, 230, 47, .5); }

/* modal */
.overlay { position: fixed; inset: 0; background: rgba(8, 2, 16, .72); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: linear-gradient(180deg, #2e1652, #1d0b33); border: 1px solid var(--line2);
  border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 47, 168, .18); animation: pop .15s ease-out; }
.modal.wide { width: min(900px, 100%); } .modal.xwide { width: min(1150px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-h h2 { margin: 0; font-size: 19px; font-weight: 600; flex: 1; }
.modal-b { padding: 18px 20px; overflow-y: auto; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* toasts */
#toasts { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 100; width: max-content; max-width: min(480px, calc(100vw - 24px)); pointer-events: none; }
.toast { pointer-events: auto; padding: 11px 18px; border-radius: 12px; background: #2e1652; border: 1px solid var(--line2); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: pop .15s; font-weight: 500; }
.toast.err { border-color: rgba(255, 77, 109, .6); background: #3b1230; }
.toast.ok { border-color: rgba(142, 230, 47, .5); }

/* chart */
.chart { width: 100%; height: 280px; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.bars .bar { height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--pink), var(--purple)); }
.barrow { display: grid; grid-template-columns: 140px 1fr 90px; gap: 10px; align-items: center; padding: 4px 0; font-size: 14px; }
.barrow .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barrow .val { text-align: right; font-variant-numeric: tabular-nums; }

/* image picker */
.imgpick { display: flex; gap: 14px; align-items: center; }
.imgpick .prev { width: 110px; height: 110px; border-radius: 16px; object-fit: cover; background: var(--panel3); display: grid; place-items: center; color: var(--dim); border: 1px dashed var(--line2); flex: none; overflow: hidden; }
.imgpick .prev img { width: 100%; height: 100%; object-fit: cover; }

/* category tree */
.cat-row { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; }
.cat-row:hover { background: rgba(255, 255, 255, .04); }
.cat-row.sub { margin-left: 34px; border-left: 2px solid var(--line2); border-radius: 0 12px 12px 0; }
.cat-row .nm { flex: 1; font-weight: 500; }
.perm-group { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
.perm-group h4 { margin: 0 0 6px; display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: var(--pink2); }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 14px; }

/* responsive */
@media (max-width: 1100px) { .pos { grid-template-columns: 1fr 340px; } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 250px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .7); }
  .menu-btn { display: inline-flex; }
  .pos { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .pos-left { padding: 10px 10px 0; }
  .cart { border-left: 0; border-top: 1px solid var(--line); max-height: 52vh; }
  .g2, .g3, .form-grid, .perm-grid { grid-template-columns: 1fr; }
  .page { padding: 12px; }
  .topbar { padding: 10px 12px; }
  .topbar h1 { font-size: 19px; }
  .clock { display: none; }
}
@media (max-width: 520px) { .g4 { grid-template-columns: 1fr; } .pgrid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); } .barrow { grid-template-columns: 100px 1fr 80px; } }

/* product picker dropdown */
.picker { position: relative; }
.picklist { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin-top: 4px; background: #2e1652; border: 1px solid var(--line2); border-radius: 12px; max-height: 300px; overflow: auto; box-shadow: 0 14px 40px rgba(0, 0, 0, .55); }
.picklist:empty { display: none; }
.picklist button { display: flex; width: 100%; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 0; background: none; cursor: pointer; text-align: left; }
.picklist button:hover, .picklist button.hl { background: rgba(255, 47, 168, .2); }
.table-wrap .input { min-height: 36px; padding: 6px 10px; }

.auth-card .toast { pointer-events: auto; }
.warnbox { padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255, 77, 109, .55); background: rgba(255, 77, 109, .12); margin-bottom: 14px; }
.okbox { padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(142, 230, 47, .45); background: rgba(142, 230, 47, .08); margin-bottom: 14px; }
.badge:empty { display: none; }
/* installed app on phones: keep clear of the notch / home bar */
@media (display-mode: standalone) { .topbar { padding-top: max(12px, env(safe-area-inset-top)); } .cart-actions, .side .me { padding-bottom: max(14px, env(safe-area-inset-bottom)); } }
