/* ============================================================
   Digi-Borj — Design System
   RTL • Nexo-inspired modern admin
   ============================================================ */

@font-face { font-family: "Vazirmatn FD"; src: url("../fonts/Vazirmatn-FD-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn FD"; src: url("../fonts/Vazirmatn-FD-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Vazirmatn FD"; src: url("../fonts/Vazirmatn-FD-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Vazirmatn FD"; src: url("../fonts/Vazirmatn-FD-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Vazirmatn FD"; src: url("../fonts/Vazirmatn-FD-ExtraBold.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Nexo Display"; src: url("../fonts/Lalezar-Arabic.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #f4f5fb;
  --bg-soft: #eef0fa;
  --surface: #ffffff;
  --surface-2: #f8f9fe;
  --surface-3: #eef0fa;
  --text: #0f1126;
  --text-2: #3a3f5e;
  --muted: #646a8c;
  --border: #e4e7f2;
  --border-strong: #cfd4e6;

  --primary: #6a4df4;
  --primary-2: #9b5cff;
  --primary-ink: #4b32c3;
  --primary-soft: #efecfe;
  --primary-grad: linear-gradient(120deg, #6a4df4 0%, #8b5cf6 55%, #a855f7 100%);
  --brand-grad: linear-gradient(120deg, #6a4df4 0%, #9b5cff 48%, #ff5ca8 100%);
  --accent: #ff5ca8;
  --accent-soft: #ffe9f4;

  /* section identity — matches resident app */
  --sec-market: #0e7c53;
  --sec-market-soft: #e7f6ef;
  --sec-cafe: #8a4b22;
  --sec-cafe-soft: #f8efe7;
  --sec-catering: #c2410c;
  --sec-catering-soft: #fdf0e7;
  --sec-services: #1e40af;
  --sec-services-soft: #e9edfb;
  --sec-amenities: #6d28d9;
  --sec-amenities-soft: #f1ebfd;
  --sec-charges: #102f4c;
  --sec-charges-soft: #e8eef4;

  --success: #12b76a;
  --success-soft: #e6f8ef;
  --warning: #f79009;
  --warning-soft: #fef4e6;
  --danger: #f04438;
  --danger-soft: #feecea;
  --info: #0ba5ec;
  --info-soft: #e7f6fe;
  --pink: #ee46bc;
  --pink-soft: #fdeaf7;

  --nav: #0b0c1a;
  --nav-2: #07080f;
  --nav-text: #a9adcf;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 16px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 2px 8px -2px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 12px 30px -14px rgba(16, 24, 40, .22), 0 2px 6px -2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 30px 60px -24px rgba(16, 24, 40, .3), 0 10px 24px -14px rgba(16, 24, 40, .12);

  --sidebar-w: 268px;
  --topbar-h: 74px;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --font: "Vazirmatn FD", "Segoe UI", Tahoma, system-ui, sans-serif;
  --display: "Nexo Display", "Vazirmatn FD", Tahoma, sans-serif;
}

[data-theme="dark"] {
  --bg: #07080f;
  --bg-soft: #0b0d1a;
  --surface: #0f1120;
  --surface-2: #13162b;
  --surface-3: #1a1e3a;
  --text: #f1f2ff;
  --text-2: #c9cce8;
  --muted: #9095bc;
  --border: rgba(255, 255, 255, .08);
  --border-strong: rgba(255, 255, 255, .16);
  --primary: #8b74ff;
  --primary-2: #b18cff;
  --primary-ink: #b9a8ff;
  --primary-soft: rgba(139, 116, 255, .14);
  --primary-grad: linear-gradient(120deg, #8b74ff 0%, #a78bfa 55%, #c084fc 100%);
  --accent-soft: rgba(255, 92, 168, .14);
  --success-soft: rgba(18, 183, 106, .14);
  --warning-soft: rgba(247, 144, 9, .14);
  --danger-soft: rgba(240, 68, 56, .14);
  --info-soft: rgba(11, 165, 236, .14);
  --pink-soft: rgba(238, 70, 188, .14);
  --shadow: 0 14px 34px -16px rgba(0, 0, 0, .7), 0 2px 6px -2px rgba(0, 0, 0, .4);
  --shadow-sm: 0 2px 8px -2px rgba(0, 0, 0, .5);
  --shadow-lg: 0 34px 70px -28px rgba(0, 0, 0, .8);
  --nav: #07080f;
  --nav-2: #05060b;
}

* { box-sizing: border-box; }

html, body { height: 100%; }
html, body { overflow-x: hidden; overflow-x: clip; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background .25s var(--ease), color .25s var(--ease);
}

h1, h2, h3, h4, h5, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }
::selection { background: rgba(106, 77, 244, .22); }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================== LAYOUT ============================== */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--sidebar-w);
  background: radial-gradient(1200px 400px at 20% -10%, #1b1640 0%, transparent 60%), linear-gradient(180deg, var(--nav) 0%, var(--nav-2) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  z-index: 60;
  transition: transform .3s var(--ease);
  overflow-y: auto;
  overflow-x: hidden;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #9b5cff, #6a4df4);
  box-shadow: 0 10px 24px -8px rgba(106, 77, 244, .9), inset 0 1px 0 rgba(255,255,255,.35);
  flex: none;
}
.brand-mark svg { width: 25px; height: 25px; color: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.45; }
.brand-text strong { font-size: 18px; font-weight: 800; letter-spacing: .2px; }
.brand-text span { font-size: 11px; color: #9aa3c4; }

.nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.nav-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .6px;
  color: #6d7799; padding: 16px 12px 7px; text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--nav-text); font-size: 13.5px; font-weight: 500;
  cursor: pointer; position: relative;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav-item svg { width: 20px; height: 20px; flex: none; opacity: .9; }
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(106, 77, 244, .28), rgba(106, 77, 244, .1));
  color: #fff; font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(155, 92, 255, .35);
}
.nav-item.active::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 22%; bottom: 22%;
  width: 3px; border-radius: 4px; background: #9b5cff;
}
.nav-badge {
  margin-inline-start: auto;
  background: rgba(255, 255, 255, .1);
  color: #dfe3f5;
  font-size: 10.5px; font-weight: 700;
  padding: 1px 7px; border-radius: 20px;
  min-width: 21px; text-align: center;
}
.nav-item.active .nav-badge { background: #6a4df4; color: #fff; }

.sidebar-foot { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.side-card {
  display: flex; gap: 10px; align-items: flex-start;
  background: linear-gradient(135deg, rgba(155, 92, 255, .22), rgba(99, 91, 255, .06));
  border: 1px solid rgba(155, 92, 255, .28);
  border-radius: 14px; padding: 12px;
}
.side-card-icon { font-size: 17px; line-height: 1.4; }
.side-card strong { font-size: 12.5px; display: block; }
.side-card p { font-size: 10.5px; color: #9aa3c4; line-height: 1.6; margin-top: 1px; }
.user-card {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 14px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .07);
}
.user-card .user-meta { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.user-card strong { font-size: 12.5px; white-space: nowrap; }
.user-card span { font-size: 10.5px; color: #9aa3c4; }
.user-card .icon-btn { margin-inline-start: auto; }

.main {
  flex: 1;
  margin-inline-start: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ============================== TOPBAR ============================== */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 26px;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--border);
}
.topbar-right, .topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.page-heading h1 { font-size: 18px; font-weight: 700; letter-spacing: -.2px; line-height: 1.5; }
.crumbs { font-size: 11px; color: var(--muted); }
.menu-btn { display: none; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 11px;
  width: 250px; height: 40px;
  transition: box-shadow .2s var(--ease), border-color .2s var(--ease), width .2s var(--ease);
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(106, 77, 244, .12); background: var(--surface); }
.search-box svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.search-box input { border: 0; background: none; outline: none; color: var(--text); font-size: 12.5px; width: 100%; }
.search-box kbd {
  font-family: inherit; font-size: 10px; color: var(--muted);
  border: 1px solid var(--border-strong); border-radius: 6px; padding: 0 5px; flex: none;
}

.icon-btn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  position: relative;
  transition: all .18s var(--ease);
}
.icon-btn:hover { color: var(--primary); border-color: #d8d0ff; background: var(--primary-soft); transform: translateY(-1px); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn.ghost { background: transparent; border-color: transparent; color: #9aa3c4; width: 32px; height: 32px; }
.icon-btn.ghost:hover { background: rgba(255,255,255,.08); color: #fff; }
.icon-btn .dot {
  position: absolute; top: 9px; inset-inline-end: 10px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); box-shadow: 0 0 0 2px var(--surface);
}
.bell .dot { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 2px var(--surface); } 50% { box-shadow: 0 0 0 5px rgba(240, 68, 56, .18); } }

.cart-btn {
  position: relative; height: 40px; padding: 0 12px;
  display: flex; align-items: center; gap: 7px;
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2);
  cursor: pointer; transition: all .18s var(--ease);
}
.cart-btn:hover { color: var(--primary); border-color: #d8d0ff; background: var(--primary-soft); }
.cart-btn svg { width: 19px; height: 19px; }
.cart-count {
  min-width: 20px; height: 20px; padding: 0 5px;
  display: grid; place-items: center;
  background: var(--primary-grad); color: #fff;
  font-size: 10.5px; font-weight: 700; border-radius: 7px;
}

.topbar-user { display: flex; align-items: center; gap: 9px; padding-inline-start: 10px; border-inline-start: 1px solid var(--border); }
.topbar-user-meta { display: flex; flex-direction: column; line-height: 1.35; }
.topbar-user-meta strong { font-size: 12.5px; }
.topbar-user-meta span { font-size: 10.5px; color: var(--muted); }

.avatar {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(140deg, #9b5cff, #6a4df4);
  color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 6px 14px -8px rgba(106, 77, 244, .9);
}
.av-lg { width: 36px; height: 36px; border-radius: 11px; font-size: 13px; }

.theme-btn .ic-moon, .icon-btn .ic-moon { display: none; }
[data-theme="dark"] .ic-sun { display: none; }
[data-theme="dark"] .ic-moon { display: block; }

/* ============================== VIEW ============================== */
.view { padding: 24px 26px 10px; flex: 1; animation: fadeIn .35s var(--ease); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 18px 26px 22px;
  font-size: 11.5px; color: var(--muted);
}
.footer-links { display: flex; gap: 16px; }
.footer-links a:hover { color: var(--primary); }

/* ============================== PRIMITIVES ============================== */
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.mt-6 { margin-top: 6px; } .mt-10 { margin-top: 10px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.hide { display: none !important; }

.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-intro h2 { font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.page-intro p { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s var(--ease), transform .2s var(--ease), border-color .2s var(--ease);
}
.card.pad { padding: 18px; }
.card-hover:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.card-head h3 { font-size: 14.5px; font-weight: 700; }
.card-head p { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.card-body { padding: 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 40px; padding: 0 16px;
  border-radius: 12px; border: 1px solid transparent;
  font-size: 12.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: all .18s var(--ease);
}
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--primary-grad); color: #fff; box-shadow: 0 10px 22px -12px rgba(106, 77, 244, .95); }
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-1px); box-shadow: 0 14px 26px -12px rgba(106, 77, 244, 1); }
.btn-soft { background: var(--primary-soft); color: var(--primary-ink); }
[data-theme="dark"] .btn-soft { color: #d8ccff; }
.btn-soft:hover { background: #e6dfff; }
[data-theme="dark"] .btn-soft:hover { background: #2e2470; }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: #fcdbd7; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.05); }
.btn-sm { height: 33px; padding: 0 11px; font-size: 11.5px; border-radius: 10px; }
.btn-sm svg { width: 15px; height: 15px; }
.btn-xs { height: 28px; padding: 0 9px; font-size: 11px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px;
  border-radius: 8px; font-size: 10.5px; font-weight: 600;
  background: var(--surface-3); color: var(--text-2);
  white-space: nowrap;
}
.chip svg { width: 12px; height: 12px; }
.chip-primary { background: var(--primary-soft); color: var(--primary-ink); }
[data-theme="dark"] .chip-primary { color: #c4b5fd; }
.chip-success { background: var(--success-soft); color: #067647; }
[data-theme="dark"] .chip-success { color: #6ee7b7; }
.chip-warning { background: var(--warning-soft); color: #b54708; }
[data-theme="dark"] .chip-warning { color: #fdb022; }
.chip-danger { background: var(--danger-soft); color: #b42318; }
[data-theme="dark"] .chip-danger { color: #fda29b; }
.chip-info { background: var(--info-soft); color: #026aa2; }
[data-theme="dark"] .chip-info { color: #7cd4fd; }
.chip-pink { background: var(--pink-soft); color: #c11574; }
.chip-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge-count {
  background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  border-radius: 20px; padding: 0 6px; min-width: 18px; height: 18px;
  display: inline-grid; place-items: center;
}

/* tables */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; min-width: 620px; }
.tbl th {
  text-align: right; font-size: 11px; font-weight: 600; color: var(--muted);
  padding: 11px 16px; background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--border); font-size: 12.5px; vertical-align: middle; }
.tbl tbody tr { transition: background .15s var(--ease); }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .cell-main { font-weight: 600; }
.tbl .cell-sub { font-size: 10.5px; color: var(--muted); }

.progress { height: 7px; background: var(--surface-3); border-radius: 20px; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 20px; background: var(--primary-grad); transition: width .6s var(--ease); }
.progress.sm { height: 5px; }
.progress.success > i { background: linear-gradient(90deg, #34d399, #12b76a); }
.progress.warning > i { background: linear-gradient(90deg, #fdb022, #f79009); }
.progress.danger > i { background: linear-gradient(90deg, #f97066, #f04438); }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 10.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 40px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 11px;
  padding: 9px 12px;
  font-size: 12.5px;
  outline: none;
  transition: all .18s var(--ease);
}
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); background: var(--surface);
  box-shadow: 0 0 0 4px rgba(106, 77, 244, .12);
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.7; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237b849c' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; padding-inline-start: 34px; }
.input[type="number"] { appearance: textfield; }
.input-icon { position: relative; }
.input-icon svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.input-icon .input { padding-inline-start: 36px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .col-span-2 { grid-column: span 2; }

.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; }
.switch input { display: none; }
.switch .track { width: 38px; height: 22px; border-radius: 20px; background: var(--border-strong); position: relative; transition: background .2s var(--ease); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(-16px); }
[dir="rtl"] .switch input:checked + .track::after { transform: translateX(-16px); }

/* segmented */
.segmented { display: inline-flex; background: var(--surface-3); border-radius: 11px; padding: 3px; gap: 2px; }
.segmented button {
  border: 0; background: transparent; color: var(--muted);
  font-size: 11.5px; font-weight: 600; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  transition: all .18s var(--ease);
}
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* ============================== KPI ============================== */
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 17px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.kpi:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.kpi::after {
  content: ""; position: absolute; width: 120px; height: 120px; border-radius: 50%;
  inset-inline-end: -50px; top: -55px; background: var(--kpi-glow, rgba(106, 77, 244, .09));
}
.kpi-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kpi-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.kpi-ico svg { width: 20px; height: 20px; }
.kpi-ico.green { background: var(--success-soft); color: var(--success); }
.kpi-ico.orange { background: var(--warning-soft); color: var(--warning); }
.kpi-ico.pink { background: var(--pink-soft); color: var(--pink); }
.kpi-ico.blue { background: var(--info-soft); color: var(--info); }
.kpi-label { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.kpi-value { font-size: 23px; font-weight: 800; letter-spacing: -.6px; line-height: 1.35; margin-top: 1px; }
.kpi-value small { font-size: 11.5px; font-weight: 500; color: var(--muted); margin-inline-start: 4px; }
.kpi-foot { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 10.5px; color: var(--muted); }
.trend { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-size: 10.5px; border-radius: 6px; padding: 1px 5px; }
.trend.up { color: #067647; background: var(--success-soft); }
.trend.down { color: #b42318; background: var(--danger-soft); }
.trend svg { width: 11px; height: 11px; }

/* ============================== GRID ============================== */
.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
.g-3-1 { grid-template-columns: 3fr 1.15fr; }

/* ============================== CHARTS ============================== */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 5; }
.chart .axis-text { fill: var(--muted); font-size: 10px; font-family: var(--font); }
.chart .area-fill { fill: url(#areaGrad); }
.chart .line-path { fill: none; stroke: url(#lineGrad); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.chart .point { fill: var(--surface); stroke: #6a4df4; stroke-width: 2.4; }
.chart .point:hover { r: 5.5; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--muted); }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 3px; margin-inline-end: 5px; }

.donut-wrap { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; }
.donut { position: relative; width: 168px; height: 168px; flex: none; }
.donut svg { transform: rotate(-90deg); }
.donut .ring-bg { stroke: var(--surface-3); }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-center strong { font-size: 25px; font-weight: 800; letter-spacing: -.8px; line-height: 1.15; }
.donut-center span { font-size: 10.5px; color: var(--muted); }
.donut-legend { display: flex; flex-direction: column; gap: 9px; min-width: 130px; }
.dl-row { display: flex; align-items: center; gap: 8px; font-size: 11.5px; }
.dl-row i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.dl-row b { margin-inline-start: auto; font-weight: 700; }

.bars { display: flex; align-items: flex-end; gap: 10px; height: 118px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.bars .bar i { width: 100%; max-width: 26px; border-radius: 7px 7px 4px 4px; background: var(--primary-soft); position: relative; transition: height .5s var(--ease); }
.bars .bar i.hi { background: var(--primary-grad); }
.bars .bar span { font-size: 9.5px; color: var(--muted); }

/* ============================== LISTS ============================== */
.list { display: flex; flex-direction: column; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px dashed var(--border);
}
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.li-ico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); font-size: 16px; flex: none; }
.li-main { min-width: 0; flex: 1; }
.li-main strong { font-size: 12.5px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-main span { font-size: 10.5px; color: var(--muted); }

/* ============================== PRODUCTS ============================== */
.cat-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-chip {
  height: 33px; padding: 0 14px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font-size: 11.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .18s var(--ease);
}
.cat-chip:hover { border-color: #d8d0ff; color: var(--primary); }
.cat-chip.active { background: var(--primary-grad); border-color: transparent; color: #fff; box-shadow: 0 8px 18px -10px rgba(106, 77, 244, .9); }

.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.product {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-xs);
  transition: all .22s var(--ease); display: flex; flex-direction: column;
}
.product:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: #ded6ff; }
.product-thumb {
  height: 104px; display: grid; place-items: center; font-size: 40px;
  background: radial-gradient(120px 80px at 70% 20%, rgba(255,255,255,.65), transparent), var(--surface-3);
  position: relative;
}
.product-thumb .tag { position: absolute; top: 8px; inset-inline-start: 8px; }
.product-body { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.product-body strong { font-size: 12.5px; font-weight: 600; line-height: 1.5; }
.product-body .muted { font-size: 10.5px; }
.product-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; gap: 6px; }
.price { font-size: 13px; font-weight: 800; letter-spacing: -.2px; }
.price small { font-size: 9.5px; font-weight: 500; color: var(--muted); margin-inline-start: 2px; }
.add-btn {
  width: 32px; height: 32px; border-radius: 10px; border: 0;
  background: var(--primary-soft); color: var(--primary-ink);
  display: grid; place-items: center; cursor: pointer; flex: none;
  transition: all .18s var(--ease);
}
.add-btn:hover { background: var(--primary); color: #fff; transform: scale(1.08); }
.add-btn svg { width: 16px; height: 16px; }

.menu-list { display: flex; flex-direction: column; }
.menu-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 0;
  border-bottom: 1px dashed var(--border);
}
.menu-row:last-child { border-bottom: 0; padding-bottom: 0; }
.menu-emoji { width: 46px; height: 46px; border-radius: 13px; background: var(--surface-3); display: grid; place-items: center; font-size: 22px; flex: none; }

/* ============================== FACILITIES ============================== */
.slot-grid { display: grid; grid-template-columns: 74px repeat(7, minmax(0, 1fr)); gap: 6px; }
.slot-grid .sh { font-size: 10px; color: var(--muted); text-align: center; padding: 4px 0; font-weight: 600; }
.slot-grid .rh { font-size: 10.5px; color: var(--muted); display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.slot {
  height: 34px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2);
  font-size: 10px; cursor: pointer; display: grid; place-items: center;
  transition: all .16s var(--ease); padding: 0;
}
.slot:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-ink); }
.slot:disabled { background: var(--surface-3); color: var(--muted); cursor: not-allowed; opacity: .75; text-decoration: line-through; }
.slot.mine { background: var(--success-soft); border-color: #a6f4c5; color: #067647; font-weight: 700; }
.slot.selected { background: var(--primary-grad); border-color: transparent; color: #fff; font-weight: 700; }

/* ============================== KANBAN ============================== */
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.kcol-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; padding: 0 2px; }
.kcol-head strong { font-size: 12px; display: flex; align-items: center; gap: 6px; }
.kcol-head i { width: 7px; height: 7px; border-radius: 50%; }
.kcard {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 12px; margin-bottom: 9px; box-shadow: var(--shadow-xs);
  transition: all .18s var(--ease);
}
.kcard:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.kcard strong { font-size: 12px; display: block; line-height: 1.55; }
.kcard p { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.kcard-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; }

/* ============================== TIMELINE ============================== */
.timeline { position: relative; padding-inline-start: 20px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 5px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
.tl-item { position: relative; padding-bottom: 16px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: ""; position: absolute; inset-inline-start: -19px; top: 5px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--surface); border: 2.5px solid var(--primary);
}
.tl-item.done::before { background: var(--success); border-color: var(--success); }
.tl-item strong { font-size: 12px; display: block; }
.tl-item span { font-size: 10.5px; color: var(--muted); }

/* ============================== MODAL ============================== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(12, 17, 35, .55); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 20px;
  animation: fadeIn .18s var(--ease);
}
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); width: min(560px, 100%);
  max-height: calc(100vh - 40px); display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: pop .22s var(--ease);
}
.modal.wide { width: min(780px, 100%); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 15px; font-weight: 700; }
.modal-head p { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ============================== DRAWER ============================== */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 90; background: rgba(12, 17, 35, .45);
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease);
  backdrop-filter: blur(3px);
}
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(400px, 92vw);
  background: var(--surface); z-index: 95; display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform .3s var(--ease);
  box-shadow: var(--shadow-lg);
}
[dir="rtl"] .drawer { transform: translateX(105%); }
.drawer.open { transform: none !important; }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 18px 14px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { font-size: 15px; font-weight: 700; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.drawer-foot { padding: 14px 18px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }

.cart-line { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px dashed var(--border); }
.cart-line:last-child { border-bottom: 0; }
.cart-emoji { width: 40px; height: 40px; border-radius: 11px; background: var(--surface-3); display: grid; place-items: center; font-size: 19px; flex: none; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.qty button { width: 26px; height: 28px; border: 0; background: var(--surface); color: var(--text-2); cursor: pointer; font-size: 15px; display: grid; place-items: center; transition: background .15s; }
.qty button:hover { background: var(--primary-soft); color: var(--primary); }
.qty span { width: 26px; text-align: center; font-size: 11.5px; font-weight: 700; }
.cart-empty { text-align: center; padding: 50px 10px; color: var(--muted); }
.cart-empty .big { font-size: 42px; margin-bottom: 10px; opacity: .55; }

/* ============================== TOAST ============================== */
.toast-root { position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 200; display: flex; flex-direction: column; gap: 9px; }
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-inline-start: 3px solid var(--primary);
  border-radius: 12px; padding: 11px 14px;
  box-shadow: var(--shadow-lg); font-size: 12px; font-weight: 500;
  min-width: 250px; max-width: 360px;
  animation: slideIn .3s var(--ease);
}
.toast.success { border-inline-start-color: var(--success); }
.toast.warning { border-inline-start-color: var(--warning); }
.toast.danger { border-inline-start-color: var(--danger); }
.toast .t-ico { font-size: 15px; }
.toast.out { animation: slideOut .25s var(--ease) forwards; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }
@keyframes slideOut { to { opacity: 0; transform: translateX(-20px); } }

/* ============================== TABS ============================== */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab {
  padding: 10px 14px; border: 0; background: none; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; transition: all .18s var(--ease);
  white-space: nowrap; display: flex; align-items: center; gap: 6px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ============================== FORMULA ============================== */
.formula {
  background: linear-gradient(135deg, rgba(99, 91, 255, .07), rgba(106, 77, 244, .04));
  border: 1px dashed #d8d0ff; border-radius: 14px; padding: 14px 16px;
  font-size: 12px; line-height: 2.1; color: var(--text-2);
  direction: rtl;
}
[data-theme="dark"] .formula { border-color: #372a80; }
.formula b { color: var(--primary-ink); font-weight: 700; }
[data-theme="dark"] .formula b { color: #c4b5fd; }
.formula .op { color: var(--muted); font-weight: 700; padding: 0 3px; }

.result-box {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--primary-grad); color: #fff; border-radius: 14px;
  padding: 14px 16px; box-shadow: 0 14px 30px -16px rgba(106, 77, 244, 1);
}
.result-box span { font-size: 11.5px; opacity: .85; }
.result-box strong { font-size: 22px; font-weight: 800; letter-spacing: -.5px; }
.result-box small { font-size: 10.5px; opacity: .8; }

/* ============================== MISC ============================== */
.empty-state { text-align: center; padding: 46px 16px; color: var(--muted); }
.empty-state .big { font-size: 40px; margin-bottom: 8px; opacity: .6; }
.empty-state strong { display: block; color: var(--text); font-size: 13px; margin-bottom: 2px; }

.divider { height: 1px; background: var(--border); margin: 14px 0; }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-mini { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.stat-mini span { font-size: 10.5px; color: var(--muted); display: block; }
.stat-mini strong { font-size: 15px; font-weight: 800; letter-spacing: -.3px; }

.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 18px; }
.info-row { display: flex; flex-direction: column; }
.info-row span { font-size: 10.5px; color: var(--muted); }
.info-row strong { font-size: 12.5px; font-weight: 600; }

.alert {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: 12px; padding: 11px 13px; font-size: 11.5px;
  background: var(--info-soft); color: #0b6a94; border: 1px solid rgba(11, 165, 236, .18);
}
[data-theme="dark"] .alert { color: #8cd8fb; }
.alert.warn { background: var(--warning-soft); color: #b54708; border-color: rgba(247, 144, 9, .2); }
[data-theme="dark"] .alert.warn { color: #fdb022; }

/* ============================== HERO ============================== */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius-xl);
  background: #0b0c1a; color: #fff;
  padding: 26px 28px; min-height: 164px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin-bottom: 20px; box-shadow: var(--shadow-lg);
}
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .5; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to left, rgba(9, 10, 22, .97) 18%, rgba(9, 10, 22, .82) 52%, rgba(106, 77, 244, .38) 100%);
}
.hero > * { position: relative; z-index: 2; }
.hero h2 { font-family: var(--display); font-size: 30px; font-weight: 400; line-height: 1.5; letter-spacing: 0; }
.hero p { font-size: 12.5px; color: #b9bdd8; margin-top: 2px; }
.hero-stats { display: flex; gap: 26px; margin-top: 16px; flex-wrap: wrap; }
.hero-stat strong { display: block; font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.hero-stat span { font-size: 10.5px; color: #9aa0c4; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hero .btn-ghost { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .18); color: #fff; backdrop-filter: blur(6px); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.hero .btn-primary { background: #fff; color: #1a1440; box-shadow: 0 12px 26px -14px rgba(0, 0, 0, .8); }
.hero .btn-primary:hover { background: #f3f0ff; }

/* ============================== IMAGES ============================== */
.product-thumb { padding: 0; overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.product:hover .product-thumb img { transform: scale(1.07); }
.product-thumb .tag { z-index: 2; }

.thumb { width: 46px; height: 46px; border-radius: 13px; overflow: hidden; flex: none; background: var(--surface-3); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.banner { position: relative; height: 148px; border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to left, rgba(10, 12, 26, .85), rgba(10, 12, 26, .1)); }
.banner-text { position: absolute; inset-inline-end: 18px; bottom: 14px; z-index: 2; color: #fff; }
.banner-text strong { display: block; font-size: 15px; }
.banner-text span { font-size: 11px; color: #d3d6e8; }

.fac-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.fac-card {
  position: relative; height: 82px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-3); cursor: pointer; padding: 0;
  transition: all .2s var(--ease);
}
.fac-card img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; }
.fac-card span {
  position: absolute; inset: auto 0 0 0; padding: 14px 8px 6px;
  font-size: 10.5px; font-weight: 600; color: #fff; text-align: right;
  background: linear-gradient(transparent, rgba(0, 0, 0, .8));
}
.fac-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.fac-card.active { outline: 2px solid var(--primary); outline-offset: 2px; }

.fac-hero { position: relative; height: 130px; border-radius: 16px; overflow: hidden; margin-bottom: 16px; }
.fac-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fac-hero .cap { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 12px 14px; background: linear-gradient(transparent 35%, rgba(6, 8, 18, .8)); color: #fff; font-size: 12px; font-weight: 600; }

/* ============================== RESPONSIVE ============================== */
@media (max-width: 1280px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .g-3-1 { grid-template-columns: 1fr; }
  .g-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1080px) {
  .search-box { width: 180px; }
  .topbar-user-meta { display: none; }
  .g-2-1, .g-1-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(105%); width: 272px; }
  [dir="rtl"] .sidebar { transform: translateX(105%); }
  .sidebar.open { transform: none; }
  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(10, 15, 32, .5); backdrop-filter: blur(3px);
    z-index: 55; opacity: 0; pointer-events: none; transition: opacity .25s;
  }
  .sidebar-backdrop.show { opacity: 1; pointer-events: auto; }
  .main { margin-inline-start: 0; }
  .menu-btn { display: grid; }
  .search-box { display: none; }
  .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
  .topbar { padding: 0 16px; }
  .view { padding: 18px 16px 8px; }
  .page-heading h1 { font-size: 16px; }
  .footer { padding: 16px; flex-direction: column; }
  .slot-grid { grid-template-columns: 62px repeat(7, minmax(46px, 1fr)); overflow-x: auto; }
  .hero { flex-direction: column; align-items: stretch; padding: 22px; min-height: 0; gap: 18px; }
  .hero h2 { font-size: 25px; }
  .hero-stats { gap: 18px; margin-top: 12px; }
  .hero-actions { justify-content: flex-start; }
  .fac-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .col-span-2 { grid-column: span 1; }
  .topbar-left { gap: 6px; }
  .cart-btn { padding: 0 9px; }
  .topbar-user { display: none; }
  .products { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }
  .stat-row { grid-template-columns: 1fr; }
  .toast-root { inset-inline: 12px; bottom: 12px; }
  .toast { min-width: 0; width: 100%; }
  .page-intro h2 { font-size: 19px; }
  .hero { padding: 18px; border-radius: 20px; }
  .hero h2 { font-size: 21px; }
  .hero p { font-size: 11.5px; }
  .hero-stat strong { font-size: 16px; }
  .hero-stat span { font-size: 9.5px; }
  .hero-actions .btn { flex: 1; }
  .banner { height: 118px; }
  .fac-hero { height: 110px; }
}

@media print {
  .sidebar, .topbar, .footer, .drawer, .drawer-backdrop, .toast-root { display: none !important; }
  .main { margin: 0; }
}
