/* ==========================================================
   نظام نقاط البيع — التصميم العام
   أزرق غامق • رمادي فاتح • أبيض • برتقالي خفيف
   ========================================================== */
@font-face { font-family: 'Cairo'; src: url('../fonts/Cairo.woff2') format('woff2'); font-weight: 200 1000; font-display: swap; }

:root {
  --navy-900: #0b1f3a;
  --navy-800: #102a4c;
  --navy-700: #16365f;
  --navy-600: #1e4a7d;
  --navy-100: #e6edf6;
  --orange:   #f7924a;
  --orange-d: #ea7a2c;
  --orange-l: #fff1e6;
  --bg:       #f1f4f8;
  --surface:  #ffffff;
  --line:     #e3e8ef;
  --text:     #1b2536;
  --muted:    #6b778a;
  --success:  #16a34a;
  --success-l:#e8f7ee;
  --danger:   #dc2626;
  --danger-l: #fdecec;
  --warning:  #d97706;
  --warning-l:#fff6e0;
  --radius:   14px;
  --radius-sm:10px;
  --shadow:   0 1px 2px rgba(16,42,76,.06), 0 4px 16px rgba(16,42,76,.06);
  --font: 'Cairo', 'Inter', 'Segoe UI', Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy-600); text-decoration: none; }
img { max-width: 100%; }
svg { fill: currentColor; }
h1,h2,h3,h4 { margin: 0; font-weight: 700; }
.num, .money { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.num, .money { white-space: nowrap; }

/* ---------------- Layout ---------------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 250px; flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy-900), var(--navy-800));
  color: #cfd9e8;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 20px 18px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; background: var(--orange); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.brand-mark svg { width: 26px; height: 26px; }
.brand-logo { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; background: #fff; }
.brand-name { color: #fff; font-weight: 800; font-size: 15px; line-height: 1.3; }
.brand-sub { font-size: 12px; color: #8ea3bf; }
.nav { padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; overflow-y: auto; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  color: #b9c7da; font-weight: 600; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav-link svg { width: 20px; height: 20px; opacity: .85; flex-shrink: 0; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.active { background: rgba(247,146,74,.14); color: #fff; box-shadow: inset -3px 0 0 var(--orange); }
.nav-link.active svg { color: var(--orange); opacity: 1; }
.nav-badge { margin-inline-start: auto; background: var(--orange); color: #fff; font-size: 11px; border-radius: 20px; padding: 0 8px; line-height: 20px; }
.sidebar-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.07); display: grid; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--navy-600); color: #fff; display: grid; place-items: center; font-weight: 700; }
.user-name { color: #fff; font-weight: 700; font-size: 14px; }
.user-role { font-size: 12px; color: #8ea3bf; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 66px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 19px; color: var(--navy-800); }
.topbar-end { margin-inline-start: auto; display: flex; align-items: center; gap: 12px; }
.topbar-date { color: var(--muted); font-size: 13px; direction: ltr; }
.menu-toggle { display: none; }
.content { padding: 24px; flex: 1; }
.sidebar-backdrop { display: none; }

/* ---------------- Components ---------------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h3 { font-size: 16px; color: var(--navy-800); }
.card-body { padding: 20px; }
.card + .card, .grid + .card, .card + .grid, .stats + .grid, .stats + .card { margin-top: 20px; }

.grid { display: grid; gap: 20px; }
.grid > *, .stats > *, .ps-grid > * { min-width: 0; }   /* يمنع تمدد الصفحة أفقياً على الجوال */
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-side { grid-template-columns: minmax(0, 1fr) 380px; align-items: start; }
.grid-side-l { grid-template-columns: 440px minmax(0, 1fr); align-items: start; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stats.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center;
}
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.stat-icon svg { width: 24px; height: 24px; }
.stat-icon.blue   { background: var(--navy-100); color: var(--navy-600); }
.stat-icon.orange { background: var(--orange-l); color: var(--orange-d); }
.stat-icon.green  { background: var(--success-l); color: var(--success); }
.stat-icon.red    { background: var(--danger-l); color: var(--danger); }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--navy-900); line-height: 1.3; }
.stat-value small { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-sub { font-size: 12px; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 700;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; transition: background .15s, transform .05s, box-shadow .15s; white-space: nowrap;
  text-decoration: none; line-height: 1.4;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 2px 8px rgba(247,146,74,.35); }
.btn-primary:hover { background: var(--orange-d); }
.btn-navy { background: var(--navy-700); color: #fff; }
.btn-navy:hover { background: var(--navy-800); }
.btn-light { background: var(--bg); color: var(--navy-700); border-color: var(--line); }
.btn-light:hover { background: #e7ecf3; }
.btn-ghost { background: transparent; color: #cfd9e8; border-color: rgba(255,255,255,.14); }
.btn-ghost:hover { background: rgba(255,255,255,.06); color: #fff; }
.btn-danger { background: var(--danger-l); color: var(--danger); }
.btn-danger:hover { background: #fbdada; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #128a3e; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 22px; font-size: 16px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--navy-700); }
.icon-btn svg { width: 22px; height: 22px; }

/* Forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--navy-700); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; font-family: inherit; font-size: 14.5px; color: var(--text);
  background: #fbfcfe; border: 1px solid #d5dde8; border-radius: var(--radius-sm);
  padding: 10px 12px; transition: border-color .15s, box-shadow .15s; outline: none;
}
.input:focus { border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(30,74,125,.12); background: #fff; }
textarea.input { min-height: 80px; resize: vertical; }
input[type=number].input { direction: ltr; text-align: right; }
.input-group { display: flex; }
.input-group .input { border-start-end-radius: 0; border-end-end-radius: 0; }
.input-group .addon { background: var(--bg); border: 1px solid #d5dde8; border-inline-start: 0; padding: 10px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-size: 13px; color: var(--muted); white-space: nowrap; }
[dir=rtl] .input-group .addon { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--orange); }
.form-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* Calc box (live computation preview) */
.calc-box { background: var(--navy-100); border: 1px dashed #b8c8de; border-radius: var(--radius-sm); padding: 12px 14px; display: grid; gap: 6px; }
.calc-row { display: flex; justify-content: space-between; font-size: 14px; }
.calc-row b { color: var(--navy-800); }
.calc-row.big b { font-size: 18px; color: var(--orange-d); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: right; background: #f7f9fc; color: var(--muted); font-weight: 700; font-size: 12.5px; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfd; }
.table tfoot td { font-weight: 800; background: #f7f9fc; border-top: 2px solid var(--line); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.thumb { width: 44px; height: 44px; max-width: none; flex-shrink: 0; display: block; border-radius: 10px; object-fit: cover; background: var(--bg); }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }

/* Pills / Badges */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px; border-radius: 20px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }
.pill-success { background: var(--success-l); color: var(--success); }
.pill-danger  { background: var(--danger-l); color: var(--danger); }
.pill-warning { background: var(--warning-l); color: var(--warning); }
.pill-muted   { background: #eef1f5; color: var(--muted); }
.pill-navy    { background: var(--navy-100); color: var(--navy-600); }
.pill-orange  { background: var(--orange-l); color: var(--orange-d); }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-muted { color: var(--muted); } .text-orange { color: var(--orange-d); }
.fw-bold { font-weight: 800; }

/* Alerts */
.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; font-weight: 600; }
.alert-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; flex-shrink: 0; }
.alert-success { background: var(--success-l); color: #166534; } .alert-success .alert-icon { background: var(--success); }
.alert-error   { background: var(--danger-l); color: #991b1b; }  .alert-error .alert-icon { background: var(--danger); }
.alert-info    { background: var(--navy-100); color: var(--navy-700); } .alert-info .alert-icon { background: var(--navy-600); }
.alert-warning { background: var(--warning-l); color: #92400e; } .alert-warning .alert-icon { background: var(--warning); }

/* Low stock list */
.stock-list { display: grid; gap: 10px; }
.stock-row { display: flex; align-items: center; gap: 12px; }
.stock-row .name { flex: 1; font-weight: 700; font-size: 14px; }
.bar { height: 8px; background: #edf1f6; border-radius: 10px; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 10px; background: var(--danger); }
.bar.ok > span { background: var(--success); } .bar.warn > span { background: var(--warning); }

/* Charts (pure CSS) */
.chart { display: flex; align-items: flex-end; gap: 6px; height: 220px; padding: 10px 4px 0; border-bottom: 1px solid var(--line); }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; position: relative; }
.chart .b { width: 100%; max-width: 34px; background: linear-gradient(180deg, var(--navy-600), var(--navy-700)); border-radius: 6px 6px 2px 2px; min-height: 2px; position: relative; }
.chart .b.p { position: absolute; bottom: 0; background: var(--orange); opacity: .9; }
.chart .col:hover .tip { display: block; }
.chart .tip { display: none; position: absolute; bottom: 100%; background: var(--navy-900); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 5; }
.chart-labels { display: flex; gap: 6px; padding: 6px 4px 0; }
.chart-labels span { flex: 1; text-align: center; font-size: 11px; color: var(--muted); min-width: 0; overflow: hidden; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; margin-inline-end: 4px; }

/* Tabs */
.tabs { display: flex; gap: 4px; background: var(--bg); padding: 4px; border-radius: 12px; flex-wrap: wrap; }
.tab { padding: 8px 16px; border-radius: 9px; font-weight: 700; color: var(--muted); font-size: 14px; }
.tab.active { background: var(--surface); color: var(--navy-800); box-shadow: var(--shadow); }
.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.toolbar .field { min-width: 150px; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(11,31,58,.55); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal.open { display: flex; }
.modal-box { background: var(--surface); border-radius: 18px; width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { font-size: 17px; color: var(--navy-800); }
.modal-close { background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.modal-body { padding: 22px; }

/* ---------------- Login ---------------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); }
.login-side { background: radial-gradient(circle at 20% 20%, var(--navy-600), var(--navy-900) 70%); color: #fff; padding: 60px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-side h2 { font-size: 34px; line-height: 1.4; }
.login-side p { color: #b9c7da; font-size: 16px; max-width: 420px; }
.login-side .feat { display: grid; gap: 12px; margin-top: 30px; }
.login-side .feat div { display: flex; gap: 10px; align-items: center; color: #dbe5f2; }
.login-side .feat i { width: 8px; height: 8px; background: var(--orange); border-radius: 50%; display: inline-block; }
.login-form-wrap { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--bg); }
.login-card { width: 100%; max-width: 400px; }
.login-card h1 { font-size: 26px; color: var(--navy-900); margin-bottom: 4px; }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; background: #e6ebf2; padding: 5px; border-radius: 12px; margin: 22px 0 18px; }
.role-switch label { text-align: center; padding: 9px; border-radius: 9px; font-weight: 700; cursor: pointer; color: var(--muted); }
.role-switch input { display: none; }
.role-switch input:checked + span { color: var(--navy-800); }
.role-switch label:has(input:checked) { background: #fff; box-shadow: var(--shadow); color: var(--navy-800); }

/* ---------------- POS ---------------- */
body.pos-mode .content { padding: 16px; }
.pos { display: grid; grid-template-columns: minmax(0,1fr) 400px; gap: 16px; height: calc(100vh - 66px - 32px); }
.pos-left { display: flex; flex-direction: column; min-height: 0; gap: 12px; }
.pos-search { display: flex; gap: 10px; }
.pos-search .input { font-size: 15px; padding: 12px 14px; }
.cats { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.cat-btn { border: 1px solid var(--line); background: var(--surface); padding: 8px 16px; border-radius: 30px; font-family: inherit; font-weight: 700; font-size: 14px; color: var(--navy-700); cursor: pointer; white-space: nowrap; }
.cat-btn.active { background: var(--navy-700); color: #fff; border-color: var(--navy-700); }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); grid-auto-rows: max-content; gap: 12px; overflow-y: auto; padding: 2px 2px 10px; align-content: start; flex: 1 1 0; min-height: 0; }
.p-card { flex-shrink: 0; }
.p-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; transition: transform .1s, box-shadow .15s, border-color .15s; display: flex; flex-direction: column; user-select: none; text-align: right; font-family: inherit; padding: 0; }
.p-card:hover { box-shadow: 0 6px 18px rgba(16,42,76,.12); border-color: #c9d5e5; }
.p-card:active { transform: scale(.97); }
.p-card img { width: 100%; aspect-ratio: 1 / 1; height: auto; object-fit: cover; background: var(--bg); display: block; }
.p-card .p-info { padding: 8px 10px 10px; }
.p-card .p-name { font-weight: 700; font-size: 14px; color: var(--navy-900); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 38px; }
.p-card .p-price { color: var(--orange-d); font-weight: 800; font-size: 15px; }

.cart { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 0; }
.cart-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.cart-head h3 { font-size: 16px; color: var(--navy-800); }
.cart-items { flex: 1; overflow-y: auto; padding: 6px 12px; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 6px; border-bottom: 1px dashed var(--line); }
.cart-item .ci-name { font-weight: 700; font-size: 14px; }
.cart-item .ci-price { color: var(--muted); font-size: 12.5px; }
.cart-item .ci-total { font-weight: 800; color: var(--navy-800); text-align: left; }
.qty-ctrl { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border-radius: 9px; padding: 2px; }
.qty-ctrl button { width: 28px; height: 28px; border: 0; border-radius: 7px; background: #fff; color: var(--navy-700); font-size: 17px; font-weight: 800; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.06); font-family: inherit; line-height: 1; }
.qty-ctrl span { min-width: 26px; text-align: center; font-weight: 800; }
.cart-empty { text-align: center; color: var(--muted); padding: 50px 10px; }
.cart-empty svg { width: 54px; height: 54px; opacity: .25; display: block; margin: 0 auto 10px; }
.cart-foot { border-top: 1px solid var(--line); padding: 14px 18px; display: grid; gap: 10px; background: #fbfcfe; border-radius: 0 0 var(--radius) var(--radius); }
.sum-row { display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); font-weight: 600; }
.sum-row.total { font-size: 20px; color: var(--navy-900); font-weight: 800; }
.sum-row.total .money { color: var(--orange-d); }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-methods label { border: 2px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; font-weight: 800; cursor: pointer; color: var(--muted); background: #fff; }
.pay-methods input { display: none; }
.pay-methods label:has(input:checked) { border-color: var(--navy-600); color: var(--navy-700); background: var(--navy-100); }
.quick-cash { display: flex; gap: 6px; flex-wrap: wrap; }
.quick-cash button { flex: 1; min-width: 50px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 4px; font-family: inherit; font-weight: 700; cursor: pointer; color: var(--navy-700); }
.quick-cash button:hover { background: var(--navy-100); }

.shift-start { max-width: 520px; margin: 40px auto; text-align: center; }
.shift-start .big-icon { width: 80px; height: 80px; margin: 0 auto 16px; border-radius: 22px; background: var(--orange-l); color: var(--orange-d); display: grid; place-items: center; }
.shift-start .big-icon svg { width: 42px; height: 42px; }
.shift-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.shift-bar .pill { font-size: 13px; }

.summary-list { display: grid; gap: 0; }
.summary-list > div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.summary-list > div:last-child { border-bottom: 0; }
.summary-list b { font-weight: 800; }
.summary-list .hl { background: var(--orange-l); margin: 4px -12px; padding: 10px 12px; border-radius: 10px; border: 0; }

/* Category circles (POS) */
.cat-circles { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.cat-circle { flex: 0 0 auto; width: 84px; border: 0; background: none; cursor: pointer; font-family: inherit; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0; }
.cat-circle .cc-icon { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.45), transparent 45%), var(--cc); box-shadow: 0 6px 16px rgba(16,42,76,.18); border: 4px solid #fff; transition: transform .15s, box-shadow .15s; }
.cat-circle .cc-icon svg { width: 32px; height: 32px; fill: #fff; }
.cat-circle .cc-name { font-size: 13px; font-weight: 800; color: var(--navy-700); line-height: 1.3; text-align: center; }
.cat-circle:hover .cc-icon { transform: translateY(-2px); }
.cat-circle.active .cc-icon { box-shadow: 0 0 0 4px var(--cc), 0 8px 20px rgba(16,42,76,.25); transform: scale(1.06); }
.cat-circle.active .cc-name { color: var(--navy-900); }
.p-price small { font-size: 11.5px; color: var(--muted); font-weight: 700; }

/* POS tabs + menu orders */
.pos-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #e6ebf2; padding: 5px; border-radius: 12px; }
.pos-tab { border: 0; background: transparent; font-family: inherit; font-weight: 800; font-size: 14.5px; color: var(--muted); padding: 9px; border-radius: 9px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; }
.pos-tab.active { background: #fff; color: var(--navy-800); box-shadow: var(--shadow); }
.count-badge { background: #cfd8e3; color: var(--navy-700); border-radius: 20px; padding: 0 9px; font-size: 12.5px; line-height: 22px; min-width: 22px; }
.count-badge.hot { background: var(--orange); color: #fff; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(247,146,74,.2); } }
.tab-orders { flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
.mo-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.mo-toolbar .pay-methods label { padding: 5px; }
.mo-wrap { overflow-y: auto; flex: 1; display: grid; gap: 14px; align-content: start; padding-bottom: 8px; }
.mo-table { overflow: hidden; }
.mo-table-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #f7f9fc; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mo-tno { background: var(--navy-800); color: #fff; font-weight: 800; border-radius: 10px; padding: 4px 14px; font-size: 16px; }

/* Pending orders notice */
.menu-orders { display: grid; gap: 10px; }
.mo-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.mo-card .mo-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.mo-card ul { margin: 0 0 8px; padding: 0 18px 0 0; font-size: 13.5px; color: var(--text); }

/* ---------------- PlayStation ---------------- */
.ps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.ps-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: grid; gap: 12px; position: relative; overflow: hidden; }
.ps-card.running { border-color: #9fd9b4; }
.ps-card.running::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--success); }
.ps-card .ps-top { display: flex; justify-content: space-between; align-items: center; }
.ps-card .ps-name { font-size: 18px; font-weight: 800; color: var(--navy-900); }
.ps-timer { font-size: 32px; font-weight: 800; color: var(--navy-800); text-align: center; letter-spacing: 1px; direction: ltr; font-variant-numeric: tabular-nums; }
.ps-amount { text-align: center; color: var(--orange-d); font-weight: 800; font-size: 18px; }
.ps-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---------------- QR Cards ---------------- */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.qr-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; box-shadow: var(--shadow); }
.qr-card img.qr { width: 150px; height: 150px; image-rendering: pixelated; }
.qr-card .qr-name { font-weight: 800; color: var(--navy-900); margin-top: 6px; }
.qr-card .qr-price { color: var(--orange-d); font-weight: 800; }
.qr-card .qr-actions { display: flex; gap: 6px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }

/* Product cards (admin) */
.prod-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.prod-card { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; display: flex; flex-direction: column; transition: box-shadow .15s; }
.prod-card:hover { box-shadow: 0 8px 22px rgba(16,42,76,.1); }
.prod-card.off { opacity: .6; }
.pc-img { position: relative; }
.pc-img img { width: 100%; height: 130px; object-fit: cover; display: block; background: var(--bg); }
.pc-margin { position: absolute; top: 8px; left: 8px; }
.pc-off { position: absolute; top: 8px; right: 8px; }
.pc-body { padding: 12px; display: grid; gap: 8px; }
.pc-cat { font-size: 12px; color: var(--muted); }
.pc-name { font-weight: 800; color: var(--navy-900); font-size: 15.5px; }
.pc-nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: var(--bg); border-radius: 10px; padding: 8px; text-align: center; }
.pc-nums span { display: block; font-size: 11px; color: var(--muted); }
.pc-nums b { font-size: 13.5px; }
.pc-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Recipe rows */
.recipe-rows { display: grid; gap: 8px; }
.recipe-row { display: grid; grid-template-columns: minmax(0,1fr) 118px 58px 34px; gap: 8px; align-items: center; }
.recipe-row .cost { font-size: 13px; font-weight: 700; color: var(--navy-700); text-align: left; direction: ltr; }
.recipe-row .rm { width: 34px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--danger-l); color: var(--danger); cursor: pointer; font-size: 18px; font-weight: 800; }

/* ---------------- Responsive ---------------- */
body.pos-mode .content > .alert { position: fixed; top: 78px; left: 50%; transform: translateX(-50%); z-index: 60; box-shadow: 0 8px 24px rgba(0,0,0,.15); animation: fadeOut .4s 3s forwards; }
@keyframes fadeOut { to { opacity: 0; visibility: hidden; } }

@media (max-width: 1200px) {
  .stats.stats-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-side, .grid-side-l { grid-template-columns: 1fr; }
  .pos { grid-template-columns: minmax(0,1fr) 340px; }
}
@media (max-width: 900px) {
  .sidebar { position: fixed; right: 0; top: 0; transform: translateX(100%); transition: transform .25s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 30; }
  .menu-toggle { display: grid; }
  .grid-2, .grid-3, .stats.stats-3 { grid-template-columns: 1fr; }
  .pos { grid-template-columns: 1fr; height: auto; }
  .products-grid { max-height: 60vh; }
  .cart { min-height: 420px; }
  .login-page { grid-template-columns: 1fr; }
  .login-side { display: none; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .topbar-date { display: none; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .recipe-row { grid-template-columns: minmax(0,1fr) 90px 36px; }
  .recipe-row .cost { display: none; }
  .stat-value { font-size: 19px; }
}

@media print {
  .sidebar, .topbar, .no-print, .form-actions, .toolbar .btn { display: none !important; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 0; }
  body { background: #fff; }
}
