/* BIN CAFE MANAGEMENT SYSTEM — dark premium POS theme */
:root {
  --bg: #08080b;
  --bg-2: #0d0d12;
  --surface: #12121a;
  --surface-2: #171722;
  --surface-3: #1d1d29;
  --border: #262634;
  --border-soft: #1e1e2a;
  --ink: #f6f6fa;
  --ink-2: #c9c9d6;
  --muted: #8b8b9e;
  --muted-2: #6b6b7d;
  --accent: #7c6cff;
  --accent-2: #a78bfa;
  --accent-soft: rgba(124, 108, 255, .14);
  --grad: linear-gradient(135deg, #6d5bf6 0%, #a78bfa 100%);
  --success: #3fd18b;
  --success-soft: rgba(63, 209, 139, .12);
  --warning: #f6b73c;
  --warning-soft: rgba(246, 183, 60, .12);
  --danger: #ff5d6c;
  --danger-soft: rgba(255, 93, 108, .12);
  --info: #59b0ff;
  --info-soft: rgba(89, 176, 255, .12);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow: 0 18px 45px -18px rgba(0, 0, 0, .85), 0 1px 0 rgba(255, 255, 255, .04) inset;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1100px 700px at 12% -8%, rgba(124, 108, 255, .18), transparent 60%),
    radial-gradient(900px 600px at 96% 4%, rgba(167, 139, 250, .12), transparent 55%),
    radial-gradient(800px 520px at 60% 110%, rgba(89, 176, 255, .08), transparent 60%),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}
a { color: var(--accent-2); text-decoration: none; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 700; letter-spacing: -.015em; }
p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
svg { display: block; }
::selection { background: rgba(124, 108, 255, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2a2a38; border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a3a4d; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.login-brand {
  position: relative; overflow: hidden; padding: 56px 60px; display: flex; flex-direction: column;
  justify-content: space-between; background: linear-gradient(160deg, #0a0a10 0%, #14101f 55%, #0a0a10 100%);
  border-right: 1px solid var(--border-soft);
}
.login-brand::before {
  content: ''; position: absolute; width: 620px; height: 620px; right: -180px; top: -160px;
  background: radial-gradient(circle, rgba(124, 108, 255, .38), transparent 62%); filter: blur(20px);
}
.login-brand::after {
  content: ''; position: absolute; width: 520px; height: 520px; left: -180px; bottom: -200px;
  background: radial-gradient(circle, rgba(63, 209, 139, .16), transparent 62%); filter: blur(20px);
}
.login-brand > * { position: relative; z-index: 1; }
.brand-mark { display: flex; align-items: center; gap: 14px; }
.brand-logo {
  width: 52px; height: 52px; border-radius: 15px; background: var(--grad); display: grid; place-items: center;
  font-weight: 800; font-size: 19px; letter-spacing: -.04em; color: #fff; box-shadow: 0 12px 30px -10px rgba(124, 108, 255, .9);
}
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: .14em; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .22em; text-transform: uppercase; }
.login-hero h2 { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.08; margin-bottom: 18px; }
.login-hero p { color: var(--ink-2); max-width: 460px; font-size: 15px; }
.login-features { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 30px; max-width: 520px; }
.login-feature {
  background: rgba(255, 255, 255, .04); border: 1px solid var(--border-soft); border-radius: 14px; padding: 13px 15px;
  font-size: 12.5px; color: var(--ink-2); display: flex; gap: 10px; align-items: center;
}
.login-feature span.dot { width: 7px; height: 7px; border-radius: 99px; background: var(--success); box-shadow: 0 0 0 4px rgba(63, 209, 139, .12); flex: none; }
.login-foot { color: var(--muted-2); font-size: 12px; }
.login-panel { display: grid; place-items: center; padding: 40px 32px; background: rgba(8, 8, 11, .55); backdrop-filter: blur(12px); }
.login-card { width: 100%; max-width: 400px; }
.login-card h3 { font-size: 24px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 28px; font-size: 13.5px; }
.login-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-2); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; margin-bottom: 18px; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 8px;
  background: linear-gradient(180deg, rgba(18, 18, 26, .96), rgba(10, 10, 14, .98));
  border-right: 1px solid var(--border-soft); padding: 20px 14px 16px; z-index: 40;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 16px; border-bottom: 1px solid var(--border-soft); margin-bottom: 6px; }
.sidebar-brand .brand-logo { width: 42px; height: 42px; border-radius: 12px; font-size: 15px; }
.sidebar-brand .brand-name { font-size: 14px; letter-spacing: .1em; }
.sidebar-brand .brand-sub { font-size: 9.5px; letter-spacing: .16em; }
.nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 2px; }
.nav-group-label { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); padding: 14px 10px 6px; font-weight: 600; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9.5px 11px; border-radius: 11px; color: var(--ink-2);
  font-size: 13.2px; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: background .16s, color .16s, border-color .16s;
  background: none; width: 100%; text-align: left;
}
.nav-item:hover { background: rgba(255, 255, 255, .05); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: #fff; border-color: rgba(124, 108, 255, .35); }
.nav-item .ico { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-item .badge-count { margin-left: auto; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 99px; }
.sidebar-user {
  margin-top: 8px; border-top: 1px solid var(--border-soft); padding-top: 12px; display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 36px; height: 36px; border-radius: 11px; background: var(--surface-3); border: 1px solid var(--border);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--accent-2); flex: none;
}
.avatar.lg { width: 52px; height: 52px; border-radius: 15px; font-size: 18px; }
.sidebar-user .who { min-width: 0; flex: 1; }
.sidebar-user .who b { display: block; font-size: 12.8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .who span { font-size: 11px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
  padding: 14px 26px; background: rgba(8, 8, 11, .82); backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border-soft);
}
.topbar h1 { font-size: 17.5px; }
.topbar .crumbs { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink-2); position: relative; transition: .15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); border-color: #333344; }
.icon-btn .dot-badge { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 99px; background: var(--danger); border: 2px solid var(--surface); }
.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 99px; font-size: 11.5px;
  font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); white-space: nowrap;
}
.pill.live { color: var(--success); border-color: rgba(63, 209, 139, .3); background: var(--success-soft); }
.pill.off { color: var(--muted); }
.pill .live-dot { width: 7px; height: 7px; border-radius: 99px; background: currentColor; animation: pulse 1.8s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.85); } }
.content { padding: 26px; flex: 1; max-width: 1680px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head .title h2 { font-size: 22px; }
.page-head .title p { color: var(--muted); font-size: 12.8px; margin-top: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: 9px; flex-wrap: wrap; }

/* ---------- Cards ---------- */
.card {
  background: linear-gradient(180deg, rgba(23, 23, 34, .92), rgba(16, 16, 23, .94));
  border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.card.tight { padding: 14px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head h3 { font-size: 14.5px; }
.card-head .sub { font-size: 11.8px; color: var(--muted); margin-top: 2px; }
.card-head .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.stat {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 17px 18px;
  background: linear-gradient(160deg, rgba(26, 26, 38, .95), rgba(15, 15, 22, .98)); border: 1px solid var(--border-soft);
  box-shadow: var(--shadow);
}
.stat::after { content: ''; position: absolute; inset: auto -30% -60% auto; width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle, var(--tint, rgba(124, 108, 255, .18)), transparent 70%); }
.stat .top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.stat .label { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.stat .ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); margin-left: auto; }
.stat .value { font-size: 23px; font-weight: 800; letter-spacing: -.03em; }
.stat .value.sm { font-size: 19px; }
.stat .meta { margin-top: 6px; font-size: 11.8px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.stat .meta b { color: var(--ink-2); font-weight: 600; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9.5px 15px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--ink); font-weight: 600; font-size: 13px;
  cursor: pointer; transition: .16s; white-space: nowrap; text-decoration: none;
}
.btn:hover { background: var(--surface-3); border-color: #363648; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 12px 26px -14px rgba(124, 108, 255, .95); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: rgba(255, 255, 255, .05); }
.btn.danger { background: var(--danger-soft); border-color: rgba(255, 93, 108, .35); color: #ff8b95; }
.btn.danger:hover { background: rgba(255, 93, 108, .2); }
.btn.success { background: var(--success-soft); border-color: rgba(63, 209, 139, .35); color: #4fe0a0; }
.btn.sm { padding: 6.5px 11px; font-size: 12px; border-radius: 9px; }
.btn.xs { padding: 4.5px 9px; font-size: 11.5px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.lg { padding: 13px 20px; font-size: 14.5px; border-radius: 13px; }
.btn-icon { padding: 7px; width: 30px; height: 30px; border-radius: 8px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 11.3px; color: var(--muted-2); }
.field .err { font-size: 11.5px; color: #ff8b95; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--border); background: #0e0e15;
  color: var(--ink); outline: none; transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(124, 108, 255, .16); }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:disabled, select:disabled, textarea:disabled { opacity: .6; }
textarea { resize: vertical; min-height: 78px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 17px, calc(100% - 11px) 17px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); }
.switch-row:last-child { border-bottom: 0; }
.switch-row .t { font-size: 13px; font-weight: 600; }
.switch-row .d { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.switch { position: relative; width: 42px; height: 24px; border-radius: 99px; background: #2a2a38; border: 1px solid var(--border); cursor: pointer; flex: none; transition: .18s; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 99px; background: #b9b9c9; transition: .18s; }
.switch.on { background: var(--grad); border-color: transparent; }
.switch.on::after { left: 20px; background: #fff; }
.input-group { display: flex; gap: 8px; }
.input-group > input { flex: 1; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 8px; }
.pw-toggle:hover { color: var(--ink); background: rgba(255, 255, 255, .06); }

/* ---------- Tables ---------- */
.table-wrap { overflow: auto; border-radius: var(--radius-sm); border: 1px solid var(--border-soft); }
table.data { width: 100%; border-collapse: collapse; font-size: 12.8px; }
table.data th {
  text-align: left; padding: 11px 13px; font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; background: #0f0f17; position: sticky; top: 0; z-index: 1; white-space: nowrap;
  border-bottom: 1px solid var(--border-soft);
}
table.data td { padding: 11px 13px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table.data tbody tr:hover { background: rgba(255, 255, 255, .025); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
table.data .actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); font-size: 13px; }
.empty-state .big { font-size: 30px; margin-bottom: 8px; }
.thumb { width: 42px; height: 42px; border-radius: 10px; object-fit: cover; background: var(--surface-3); border: 1px solid var(--border-soft); display: grid; place-items: center; font-size: 16px; color: var(--muted); }
.thumb.lg { width: 64px; height: 64px; border-radius: 13px; font-size: 22px; }
.cell-title { font-weight: 600; }
.cell-sub { font-size: 11.3px; color: var(--muted); }
.money { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 10.8px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.badge.gray { background: #1e1e2a; color: var(--muted); border: 1px solid var(--border); }
.badge.green { background: var(--success-soft); color: #4fe0a0; border: 1px solid rgba(63, 209, 139, .28); }
.badge.yellow { background: var(--warning-soft); color: #f8c65f; border: 1px solid rgba(246, 183, 60, .28); }
.badge.red { background: var(--danger-soft); color: #ff8b95; border: 1px solid rgba(255, 93, 108, .28); }
.badge.blue { background: var(--info-soft); color: #7cc4ff; border: 1px solid rgba(89, 176, 255, .28); }
.badge.violet { background: var(--accent-soft); color: var(--accent-2); border: 1px solid rgba(124, 108, 255, .3); }

/* ---------- Charts ---------- */
.chart-wrap { width: 100%; overflow: hidden; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 10px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-right: 6px; }
.seg { display: inline-flex; background: #0f0f17; border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { background: none; border: 0; color: var(--muted); font-size: 11.8px; font-weight: 600; padding: 6px 11px; border-radius: 8px; cursor: pointer; }
.seg button.active { background: var(--surface-3); color: var(--ink); }

/* ---------- Modal / toast ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(3, 3, 6, .72); backdrop-filter: blur(6px); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 32px 16px; overflow-y: auto;
  animation: fade .16s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 560px; background: linear-gradient(180deg, #171722, #101019);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 40px 90px -30px #000; overflow: hidden;
  animation: slide .18s ease-out; margin: auto;
}
.modal.wide { max-width: 860px; }
.modal.narrow { max-width: 420px; }
@keyframes slide { from { transform: translateY(10px) scale(.99); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border-soft); }
.modal-head h3 { font-size: 15.5px; }
.modal-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.modal-body { padding: 20px; max-height: min(70vh, 720px); overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border-soft); display: flex; gap: 10px; justify-content: flex-end; background: rgba(0, 0, 0, .2); }
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 300; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast {
  display: flex; gap: 11px; align-items: flex-start; padding: 13px 15px; border-radius: 13px;
  background: #16161f; border: 1px solid var(--border); box-shadow: 0 20px 40px -18px #000; animation: slide .2s ease-out;
  font-size: 12.8px;
}
.toast.success { border-color: rgba(63, 209, 139, .4); }
.toast.error { border-color: rgba(255, 93, 108, .45); }
.toast.warn { border-color: rgba(246, 183, 60, .4); }
.toast .t-ico { width: 20px; height: 20px; border-radius: 99px; display: grid; place-items: center; flex: none; font-size: 11px; font-weight: 800; }
.toast.success .t-ico { background: var(--success-soft); color: #4fe0a0; }
.toast.error .t-ico { background: var(--danger-soft); color: #ff8b95; }
.toast.warn .t-ico { background: var(--warning-soft); color: #f8c65f; }
.toast.info .t-ico { background: var(--info-soft); color: #7cc4ff; }
.toast b { display: block; margin-bottom: 2px; font-size: 12.8px; }
.toast .muted { color: var(--muted); font-size: 12px; }

/* ---------- Dropdown / notifications ---------- */
.dd { position: relative; }
.dd-menu {
  position: absolute; right: 0; top: calc(100% + 8px); width: 330px; background: #15151f; border: 1px solid var(--border);
  border-radius: 15px; box-shadow: 0 30px 60px -25px #000; z-index: 60; overflow: hidden;
}
.dd-menu .dd-head { padding: 12px 14px; border-bottom: 1px solid var(--border-soft); display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; }
.dd-menu .dd-list { max-height: 330px; overflow-y: auto; }
.dd-item { padding: 11px 14px; border-bottom: 1px solid var(--border-soft); font-size: 12.3px; }
.dd-item:last-child { border-bottom: 0; }
.dd-item b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.dd-item .muted { color: var(--muted); font-size: 11.5px; }
.dd-item.unread { background: rgba(124, 108, 255, .06); }

/* ---------- POS ---------- */
.pos { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 18px; align-items: start; }
.pos-left { min-width: 0; }
.pos-search { display: flex; gap: 10px; margin-bottom: 14px; }
.cat-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.cat-chip { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.cat-chip.active { background: var(--grad); border-color: transparent; color: #fff; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.product-card {
  border-radius: 15px; border: 1px solid var(--border-soft); background: linear-gradient(180deg, #171722, #12121a);
  overflow: hidden; cursor: pointer; transition: .16s; display: flex; flex-direction: column; text-align: left; padding: 0;
}
.product-card:hover { border-color: rgba(124, 108, 255, .45); transform: translateY(-2px); box-shadow: 0 18px 30px -22px rgba(124, 108, 255, .8); }
.product-card:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.product-media { aspect-ratio: 4/3; background: linear-gradient(140deg, #1d1d29, #14141d); display: grid; place-items: center; font-size: 30px; color: #3c3c50; overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: cover; }
.product-info { padding: 11px 12px 13px; }
.product-info .n { font-size: 12.8px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 33px; }
.product-info .c { font-size: 10.5px; color: var(--muted); margin: 3px 0 6px; }
.product-info .p { font-size: 13.2px; font-weight: 700; color: #fff; }
.pos-right { position: sticky; top: 84px; }
.cart { display: flex; flex-direction: column; }
.cart-items { display: flex; flex-direction: column; gap: 10px; max-height: 40vh; overflow-y: auto; padding-right: 2px; }
.cart-item { display: flex; gap: 10px; padding: 10px; border-radius: 12px; background: #101018; border: 1px solid var(--border-soft); }
.cart-item .ci-main { flex: 1; min-width: 0; }
.cart-item .ci-name { font-size: 12.6px; font-weight: 600; }
.cart-item .ci-opt { font-size: 11px; color: var(--accent-2); margin-top: 2px; }
.cart-item .ci-price { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.qty { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--border); border-radius: 9px; background: #0d0d14; }
.qty button { width: 26px; height: 26px; border: 0; background: none; color: var(--ink-2); cursor: pointer; font-size: 15px; border-radius: 8px; }
.qty button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.qty span { min-width: 22px; text-align: center; font-size: 12.5px; font-weight: 700; }
.totals { display: flex; flex-direction: column; gap: 7px; padding: 13px 0 0; border-top: 1px dashed var(--border); margin-top: 13px; font-size: 12.8px; }
.totals .tr { display: flex; justify-content: space-between; color: var(--ink-2); }
.totals .tr.total { font-size: 17px; font-weight: 800; color: #fff; padding-top: 8px; border-top: 1px solid var(--border-soft); margin-top: 5px; }
.totals .tr.total span:last-child { font-variant-numeric: tabular-nums; }
.pay-methods { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.pay-method { padding: 11px; border-radius: 11px; border: 1px solid var(--border); background: #0f0f17; cursor: pointer; text-align: center; font-size: 12.3px; font-weight: 600; color: var(--ink-2); }
.pay-method.active { border-color: var(--accent); background: var(--accent-soft); color: #fff; }
.pay-method .m-ico { font-size: 16px; margin-bottom: 3px; }

/* ---------- Receipt ---------- */
.receipt {
  background: #f7f5ef; color: #14140f; font-family: var(--mono); font-size: 12px; line-height: 1.45;
  padding: 18px; border-radius: 10px; white-space: pre-wrap; word-break: break-word; max-height: 52vh; overflow-y: auto;
}
.receipt.sm { font-size: 11px; padding: 12px; }
.qr-box { background: #fff; padding: 12px; border-radius: 12px; display: grid; place-items: center; }
.qr-box img { width: 100%; max-width: 230px; }

/* ---------- Kitchen board ---------- */
.kds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.kds-col { background: rgba(255, 255, 255, .02); border: 1px solid var(--border-soft); border-radius: 15px; padding: 12px; min-height: 220px; }
.kds-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); display: flex; gap: 8px; margin-bottom: 12px; }
.ticket { background: #15151f; border: 1px solid var(--border); border-radius: 13px; padding: 12px; margin-bottom: 10px; }
.ticket .tk-head { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.ticket .tk-code { font-weight: 700; color: var(--ink); font-size: 12.5px; }
.ticket .tk-items { font-size: 12.4px; display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.ticket .tk-items b { color: var(--accent-2); }

/* ---------- Permission matrix ---------- */
.role-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.role-chip {
  border: 1px solid var(--border); background: #0f0f17; border-radius: 13px; padding: 10px 14px;
  cursor: pointer; text-align: left; color: var(--ink-2); min-width: 128px; transition: .16s;
}
.role-chip:hover { border-color: #3a3a50; background: var(--surface-2); }
.role-chip.active { border-color: var(--accent); background: var(--accent-soft); color: #fff; }
.role-chip b { display: block; font-size: 13.5px; }
.role-chip span { font-size: 11.5px; color: var(--muted); }
.role-chip.active span { color: #cfc7ff; }
.perm-module { border: 1px solid var(--border-soft); border-radius: 14px; overflow: hidden; background: #0f0f17; }
.perm-module + .perm-module { margin-top: 14px; }
.perm-module-head {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: rgba(255, 255, 255, .03);
  border-bottom: 1px solid var(--border-soft); flex-wrap: wrap;
}
.perm-module-head b { font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; }
.perm-row { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; border-bottom: 1px solid var(--border-soft); }
.perm-row:last-child { border-bottom: 0; }
.perm-row .perm-text { flex: 1; min-width: 0; }
.perm-row .perm-name { font-size: 13px; font-weight: 600; }
.perm-row .perm-desc { font-size: 11.8px; color: var(--muted); margin-top: 2px; }
.perm-row .perm-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.perm-row .perm-code { font-family: var(--mono); font-size: 10.5px; color: var(--muted-2); background: #14141d; border: 1px solid var(--border-soft); padding: 1px 6px; border-radius: 6px; }
.perm-row.locked { opacity: .75; }
.perm-state { font-size: 11px; font-weight: 700; width: 54px; text-align: right; flex: none; padding-top: 4px; }
.perm-state.on { color: #4fe0a0; }
.perm-state.off { color: var(--muted-2); }
.perms-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dirty-dot { width: 8px; height: 8px; border-radius: 99px; background: var(--warning); display: inline-block; }

/* ---------- Misc ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--border-soft); margin-bottom: 20px; padding-bottom: 0; }
.tab { padding: 10px 15px; font-size: 13px; font-weight: 600; color: var(--muted); border: 0; background: none; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: #fff; border-bottom-color: var(--accent); }
.tab:hover { color: var(--ink-2); }
.skeleton { background: linear-gradient(90deg, #171722 25%, #1e1e2b 50%, #171722 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.loading-block { display: grid; gap: 12px; }
.spinner { width: 18px; height: 18px; border-radius: 99px; border: 2px solid rgba(255, 255, 255, .18); border-top-color: #fff; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 7px 12px; font-size: 12.8px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.hr { height: 1px; background: var(--border-soft); margin: 16px 0; border: 0; }
.mono { font-family: var(--mono); font-size: 12px; }
.text-muted { color: var(--muted); }
.text-danger { color: #ff8b95; }
.text-success { color: #4fe0a0; }
.text-warn { color: #f8c65f; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.nowrap { white-space: nowrap; }
.scroll-x { overflow-x: auto; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; }
.w-100 { width: 100%; }
.center { text-align: center; }
.flex1 { flex: 1; }
.chip-list { display: flex; gap: 6px; flex-wrap: wrap; }
.hide { display: none !important; }
.mobile-only { display: none; }

@media (max-width: 1180px) {
  .pos { grid-template-columns: minmax(0, 1fr) 340px; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 270px; transform: translateX(-102%); transition: transform .24s ease;
    box-shadow: 30px 0 60px -30px #000;
  }
  .sidebar.open { transform: none; }
  .sidebar-scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 35; }
  .mobile-only { display: inline-flex; }
  .pos { grid-template-columns: 1fr; }
  .pos-right { position: static; }
  .grid.cols-3, .grid.cols-2, .form-grid { grid-template-columns: 1fr; }
  .content { padding: 18px; }
  .topbar { padding: 12px 16px; }
  .topbar h1 { font-size: 15.5px; }
  .kds { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid.cols-4 { grid-template-columns: 1fr; }
  .card-head .right { margin-left: auto; }
  .card-head { gap: 8px; }
  .topbar-actions { gap: 6px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .modal-backdrop { padding: 10px; }
  .modal-body { max-height: 76vh; }
  .topbar-actions .pill.hide-sm { display: none; }
  .page-head .actions { width: 100%; }
}
@media print {
  body { background: #fff; }
  .sidebar, .topbar, .page-head .actions, .modal-foot, .toast-wrap { display: none !important; }
  .shell { display: block; }
  .modal-backdrop { position: static; background: #fff; padding: 0; }
  .modal { max-width: 100%; border: 0; box-shadow: none; }
  .modal-body { max-height: none; overflow: visible; }
}
