/* =========================================================================
   VCRM 2026 — Design System
   RTL-first, bilingual (HE/EN), dark sidebar + light content, card-based.
   ========================================================================= */

:root {
  /* Brand — Company default (Gold & Bronze + coral red), overridden at runtime by theme.js */
  --brand: #d8453b;
  --brand-600: #be3d34;
  --brand-700: #9f332b;
  --brand-soft: #fae9e7;
  --accent: #c2a24a;          /* antique gold — accents / highlights */
  --accent-600: #a78b3f;
  --accent-soft: #f9f6ed;

  /* Status palette */
  --green: #16a34a;  --green-soft: #dcfce7;
  --amber: #d97706;  --amber-soft: #fef3c7;
  --red: #dc2626;    --red-soft: #fee2e2;
  --blue: #2563eb;   --blue-soft: #dbeafe;
  --purple: #7c3aed; --purple-soft: #ede9fe;
  --pink: #db2777;   --pink-soft: #fce7f3;
  --teal: #0d9488;   --teal-soft: #ccfbf1;
  --gray: #64748b;   --gray-soft: #f1f5f9;

  /* Neutrals (light theme) */
  --bg: #f5f6fa;
  --surface: #ffffff;
  --surface-2: #fafbfd;
  --border: #e6e8ef;
  --border-strong: #d4d7e3;
  --text: #1e2235;
  --text-2: #5b6178;
  --text-3: #9aa0b4;

  /* Sidebar (dark) — warm near-black to match company identity */
  --side-bg: #18161a;
  --side-bg-2: #211e24;
  --side-item: #b3aeb8;
  --side-item-active: #ffffff;
  --side-active-bg: rgba(255,255,255,.08);

  /* Layout */
  --side-w: 264px;
  --side-w-collapsed: 76px;
  --header-h: 64px;
  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(20,24,46,.06), 0 1px 3px rgba(20,24,46,.05);
  --shadow: 0 4px 16px rgba(20,24,46,.07), 0 1px 4px rgba(20,24,46,.05);
  --shadow-lg: 0 18px 50px rgba(20,24,46,.18);
  --font-he: 'Heebo', system-ui, sans-serif;
  --font-en: 'Inter', system-ui, sans-serif;
  --speed: .18s;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-he);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
html[lang="en"] body { font-family: var(--font-en); }

h1,h2,h3,h4,h5 { margin: 0; font-weight: 700; color: var(--text); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

/* Logical-property helpers so RTL/LTR flips automatically */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; }
.gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.center { align-items: center; justify-content: center; }
.between { justify-content: space-between; }
.mt-8{margin-top:8px} .mt-16{margin-top:16px} .mt-24{margin-top:24px}
.muted { color: var(--text-2); }
.muted-3 { color: var(--text-3); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.text-end { text-align: end; }
.hidden { display: none !important; }
.scroll-y { overflow-y: auto; }

/* =========================================================================
   App shell
   ========================================================================= */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; transition: grid-template-columns var(--speed); }
.shell.collapsed { grid-template-columns: var(--side-w-collapsed) 1fr; }

/* ---- Sidebar ---- */
.sidebar {
  background: linear-gradient(180deg, var(--side-bg), var(--side-bg-2));
  color: var(--side-item);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  z-index: 40;
}
.sb-brand { display: flex; align-items: center; gap: 12px; padding: 16px 18px; height: var(--header-h); }
.sb-logo { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--accent), var(--brand)); display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; flex: none; }
.sb-brand b { color: #fff; font-size: 17px; letter-spacing: .3px; }
.sb-brand .sb-sub { color: var(--side-item); font-size: 11px; }
.shell.collapsed .sb-brand .col, .shell.collapsed .sb-section-label, .shell.collapsed .nav-item span { display: none; }

.sb-scope { margin: 6px 12px 10px; padding: 9px 12px; background: rgba(255,255,255,.06); border-radius: 11px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.sb-scope:hover { background: rgba(255,255,255,.1); }
.sb-scope .dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.sb-scope b { color: #fff; font-size: 13px; }
.shell.collapsed .sb-scope .col, .shell.collapsed .sb-scope .chev { display: none; }

.sb-nav { flex: 1; overflow-y: auto; padding: 6px 12px 18px; }
.sb-nav::-webkit-scrollbar { width: 6px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 4px; }
.sb-section-label { color: var(--side-item); opacity: .55; font-size: 11px; font-weight: 600; padding: 16px 12px 6px; letter-spacing: .4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9.5px 12px; margin: 2px 0; border-radius: 11px;
  color: var(--side-item); font-weight: 500; font-size: 13.5px;
  cursor: pointer; transition: background var(--speed), color var(--speed);
  white-space: nowrap; position: relative;
}
.nav-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav-item.active { background: var(--side-active-bg); color: var(--side-item-active); }
.nav-item.active::before { content:""; position:absolute; inset-inline-start: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 4px; background: var(--accent); }
.nav-item svg { width: 19px; height: 19px; flex: none; }
.nav-item .badge-mini { margin-inline-start: auto; }
.shell.collapsed .nav-item { justify-content: center; }
.shell.collapsed .nav-item .badge-mini { display: none; }

/* ---- Header ---- */
.main { display: flex; flex-direction: column; min-width: 0; }
.header {
  height: var(--header-h); background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  position: sticky; top: 0; z-index: 30;
}
.hamburger { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; color: var(--text-2); }
.hamburger:hover { background: var(--gray-soft); }
.global-search { flex: 1; max-width: 460px; position: relative; }
.global-search input {
  width: 100%; height: 40px; border: 1px solid var(--border); border-radius: 11px;
  padding-inline-start: 40px; padding-inline-end: 14px; background: var(--surface-2);
  font-size: 13.5px; color: var(--text); transition: border var(--speed), box-shadow var(--speed);
}
.global-search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); background: #fff; }
.global-search .gs-icon { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 17px; height: 17px; }
.header-spacer { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; color: var(--text-2); position: relative; transition: var(--speed); }
.icon-btn:hover { background: var(--gray-soft); color: var(--text); }
.icon-btn .dot-notif { position: absolute; top: 8px; inset-inline-end: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.lang-switch { display: flex; border: 1px solid var(--border); border-radius: 11px; overflow: hidden; height: 40px; }
.lang-switch button { border: none; background: var(--surface); padding: 0 13px; font-weight: 600; font-size: 12.5px; color: var(--text-2); }
.lang-switch button.active { background: var(--brand); color: #fff; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px; padding-inline-end: 12px; border-radius: 30px; border: 1px solid var(--border); background: var(--surface); }
.user-chip:hover { background: var(--gray-soft); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg,var(--brand),var(--purple)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }

/* ---- Content ---- */
.content { padding: 24px; flex: 1; min-width: 0; }
.page-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 23px; font-weight: 800; }
.page-head .sub { color: var(--text-2); font-size: 13.5px; margin-top: 3px; }
.page-actions { margin-inline-start: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.breadcrumb { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-3); margin-bottom: 8px; }
.breadcrumb a:hover { color: var(--brand); }

/* =========================================================================
   Buttons
   ========================================================================= */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: 13.5px; transition: var(--speed); white-space: nowrap; }
.btn svg { width: 17px; height: 17px; }
.btn:hover { background: var(--gray-soft); border-color: var(--border-strong); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); border-color: var(--brand-600); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-600); border-color: var(--accent-600); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--gray-soft); }
.btn-danger { background: var(--red-soft); border-color: transparent; color: var(--red); }
.btn-danger:hover { background: #fecaca; }
.btn-sm { height: 33px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn-icon { width: 40px; padding: 0; justify-content: center; }
.btn-sm.btn-icon { width: 33px; }

/* =========================================================================
   Cards & widgets
   ========================================================================= */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 18px; }
.card-head { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.card-head h3 { font-size: 15px; }
.card-head .card-actions { margin-inline-start: auto; display: flex; gap: 8px; }
.card-body { padding: 18px; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
@media (max-width: 1100px){ .grid-4{grid-template-columns:repeat(2,1fr)} .grid-3{grid-template-columns:repeat(2,1fr)} .span-2,.span-3{grid-column:span 2} }
@media (max-width: 720px){ .grid-2,.grid-3,.grid-4{grid-template-columns:1fr} .span-2,.span-3{grid-column:span 1} }

/* KPI / stat card */
.stat { display: flex; flex-direction: column; gap: 10px; }
.stat .stat-top { display: flex; align-items: center; gap: 12px; }
.stat .stat-ico { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.stat .stat-ico svg { width: 21px; height: 21px; }
.stat .stat-label { color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.stat .stat-val { font-size: 25px; font-weight: 800; letter-spacing: -.3px; line-height: 1.1; }
.stat .stat-delta { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 3px; }
.delta-up { color: var(--green); } .delta-down { color: var(--red); }

/* tinted icon backgrounds */
.t-brand{background:var(--brand-soft);color:var(--brand)} .t-accent{background:var(--accent-soft);color:var(--accent-600)}
.t-green{background:var(--green-soft);color:var(--green)} .t-amber{background:var(--amber-soft);color:var(--amber)}
.t-red{background:var(--red-soft);color:var(--red)} .t-blue{background:var(--blue-soft);color:var(--blue)}
.t-purple{background:var(--purple-soft);color:var(--purple)} .t-pink{background:var(--pink-soft);color:var(--pink)}
.t-teal{background:var(--teal-soft);color:var(--teal)} .t-gray{background:var(--gray-soft);color:var(--gray)}

/* =========================================================================
   Badges / status pills
   ========================================================================= */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 30px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge .bdot { width: 7px; height: 7px; border-radius: 50%; }
.badge-mini { font-size: 11px; padding: 1px 8px; min-width: 20px; justify-content: center; }
.b-green{background:var(--green-soft);color:#15803d} .b-green .bdot{background:var(--green)}
.b-amber{background:var(--amber-soft);color:#b45309} .b-amber .bdot{background:var(--amber)}
.b-red{background:var(--red-soft);color:#b91c1c} .b-red .bdot{background:var(--red)}
.b-blue{background:var(--blue-soft);color:#1d4ed8} .b-blue .bdot{background:var(--blue)}
.b-purple{background:var(--purple-soft);color:#6d28d9} .b-purple .bdot{background:var(--purple)}
.b-pink{background:var(--pink-soft);color:#be185d} .b-pink .bdot{background:var(--pink)}
.b-teal{background:var(--teal-soft);color:#0f766e} .b-teal .bdot{background:var(--teal)}
.b-gray{background:var(--gray-soft);color:#475569} .b-gray .bdot{background:var(--gray)}
.b-accent{background:var(--accent-soft);color:var(--accent-600)} .b-accent .bdot{background:var(--accent)}

/* =========================================================================
   Tables
   ========================================================================= */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th { text-align: start; font-weight: 600; color: var(--text-2); font-size: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.tbl tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background var(--speed); }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl .cell-main { font-weight: 600; color: var(--text); }
.tbl .cell-sub { color: var(--text-3); font-size: 12px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; }

/* =========================================================================
   Filter bar / toolbar / tabs / chips
   ========================================================================= */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.search-inline { position: relative; min-width: 230px; }
.search-inline input { width: 100%; height: 38px; border: 1px solid var(--border); border-radius: 10px; padding-inline-start: 36px; padding-inline-end: 12px; background: var(--surface); font-size: 13px; }
.search-inline input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-inline svg { position: absolute; inset-inline-start: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
.select { height: 38px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; background: var(--surface); color: var(--text); font-size: 13px; min-width: 130px; }
.select:focus { outline: none; border-color: var(--brand); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab { padding: 10px 15px; font-weight: 600; font-size: 13.5px; color: var(--text-2); border-bottom: 2.5px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand); border-color: var(--brand); }
.tab .badge-mini { background: var(--gray-soft); color: var(--text-2); }
.tab.active .badge-mini { background: var(--brand-soft); color: var(--brand); }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { border: none; background: transparent; padding: 8px 14px; font-weight: 600; font-size: 12.5px; color: var(--text-2); }
.seg button.active { background: var(--brand-soft); color: var(--brand); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 30px; background: var(--gray-soft); font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.chip.on { background: var(--brand-soft); color: var(--brand); }

/* =========================================================================
   Forms
   ========================================================================= */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field input, .field select, .field textarea {
  height: 40px; border: 1px solid var(--border); border-radius: 10px; padding: 0 12px;
  background: var(--surface); font-size: 13.5px; color: var(--text); width: 100%;
}
.field textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width:600px){ .form-grid{grid-template-columns:1fr} }

/* switch */
.switch { position: relative; width: 42px; height: 24px; border-radius: 30px; background: var(--border-strong); transition: var(--speed); flex: none; cursor: pointer; }
.switch::after { content:""; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: var(--speed); }
.switch.on { background: var(--green); }
.switch.on::after { inset-inline-start: 21px; }
html[dir="rtl"] .switch.on::after { inset-inline-start: 21px; }

.checkbox { width: 18px; height: 18px; border: 1.5px solid var(--border-strong); border-radius: 5px; display: grid; place-items: center; cursor: pointer; color: #fff; flex: none; }
.checkbox.on { background: var(--brand); border-color: var(--brand); }

/* =========================================================================
   Modal
   ========================================================================= */
.modal-overlay { position: fixed; inset: 0; background: rgba(20,24,46,.45); backdrop-filter: blur(2px); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; animation: fade .15s; }
@keyframes fade { from{opacity:0} to{opacity:1} }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 540px; animation: pop .18s; }
.modal.wide { max-width: 820px; }
.modal.xwide { max-width: 1040px; }
@keyframes pop { from{transform:translateY(12px) scale(.98);opacity:0} to{transform:none;opacity:1} }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-size: 17px; }
.modal-head .close { margin-inline-start: auto; }
.modal-body { padding: 22px; max-height: 68vh; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--border); }

/* =========================================================================
   Misc widgets
   ========================================================================= */
.progress { height: 8px; border-radius: 30px; background: var(--gray-soft); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 30px; background: var(--brand); }

.timeline { position: relative; padding-inline-start: 22px; }
.timeline::before { content:""; position: absolute; inset-inline-start: 6px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 18px; }
.tl-item::before { content:""; position: absolute; inset-inline-start: -22px; top: 3px; width: 13px; height: 13px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); }
.tl-item.done::before { background: var(--brand); }
.tl-item .tl-time { font-size: 11.5px; color: var(--text-3); }

.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-inline-start: -8px; }
.avatar-stack .avatar:first-child { margin-inline-start: 0; }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-row:last-child { border-bottom: none; }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-3); }
.empty-state .es-ico { width: 64px; height: 64px; border-radius: 18px; background: var(--gray-soft); display: grid; place-items: center; margin: 0 auto 16px; color: var(--text-3); }
.empty-state h3 { color: var(--text-2); margin-bottom: 6px; }

/* toast */
.toast-wrap { position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--text); color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 13.5px; display: flex; align-items: center; gap: 10px; animation: pop .2s; max-width: 340px; }
.toast.success { background: #15803d; } .toast.error { background: var(--red); }

/* dropdown menu */
.menu-pop { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow-lg); min-width: 230px; z-index: 60; padding: 7px; animation: pop .14s; }
.menu-pop .mp-item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.menu-pop .mp-item:hover { background: var(--gray-soft); }
.menu-pop .mp-item svg { width: 17px; height: 17px; color: var(--text-2); }
.menu-pop .mp-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-pop .mp-head { padding: 9px 11px 6px; font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: .3px; }

.dropdown { position: relative; }

/* =========================================================================
   Charts (lightweight, self-contained SVG)
   ========================================================================= */
.chart-svg { width: 100%; display: block; overflow: visible; }
.bar-track { fill: var(--gray-soft); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; }
.legend .lg-item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-2); }
.legend .lg-dot { width: 10px; height: 10px; border-radius: 3px; }

.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }

/* funnel */
.funnel { display: flex; flex-direction: column; gap: 8px; }
.funnel-row { display: flex; align-items: center; gap: 12px; }
.funnel-bar { height: 34px; border-radius: 9px; display: flex; align-items: center; padding: 0 12px; color: #fff; font-weight: 700; font-size: 13px; min-width: 60px; }

/* =========================================================================
   Login
   ========================================================================= */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
@media (max-width: 880px){ .login-wrap{grid-template-columns:1fr} .login-art{display:none} }
.login-art { background: linear-gradient(135deg, var(--brand-700), var(--brand), var(--accent)); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-art::after { content:""; position: absolute; inset-inline-end: -120px; bottom: -120px; width: 360px; height: 360px; border-radius: 50%; background: rgba(255,255,255,.08); }
.login-art .la-logo { width: 56px; height: 56px; border-radius: 16px; background: rgba(255,255,255,.16); display: grid; place-items: center; font-weight: 800; font-size: 26px; }
.login-art h1 { color: #fff; font-size: 34px; line-height: 1.2; max-width: 420px; }
.login-art ul.la-feats { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.login-art ul.la-feats li { display: flex; align-items: center; gap: 12px; font-size: 15px; opacity: .95; }
.login-art ul.la-feats svg { width: 22px; height: 22px; }
.login-form-side { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 24px; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.role-opt { border: 1.5px solid var(--border); border-radius: 13px; padding: 13px; cursor: pointer; transition: var(--speed); }
.role-opt:hover { border-color: var(--brand); }
.role-opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.role-opt .ro-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; margin-bottom: 8px; }
.role-opt b { font-size: 13.5px; display: block; }
.role-opt span { font-size: 11.5px; color: var(--text-2); }

/* =========================================================================
   Access gate
   ========================================================================= */
.gate-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(120% 120% at 80% 0%, var(--brand-soft), var(--bg) 55%); }
.gate-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 30px; animation: pop .2s; }
.gate-lock { width: 60px; height: 60px; border-radius: 17px; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; margin: 24px 0 16px; }
.gate-lock svg { width: 28px; height: 28px; }
.gate-card h2 { font-size: 22px; }
.gate-err { display: flex; align-items: center; gap: 8px; background: var(--red-soft); color: var(--red);
  font-size: 12.5px; font-weight: 600; padding: 9px 12px; border-radius: 10px; margin-bottom: 10px; }
.gate-err svg { width: 16px; height: 16px; }
.gate-shake { animation: gateShake .4s; border-color: var(--red) !important; }
@keyframes gateShake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)} }

/* =========================================================================
   Event (customer) full-management screen — wide, banner + stats
   ========================================================================= */
.content.content-flush { padding: 0; }
.evt-screen { display: flex; flex-direction: column; }
.evt-banner { color: #fff; padding: 18px 28px 0; position: relative; }
.evt-banner-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.evt-crumb { color: rgba(255,255,255,.8); margin-bottom: 0; }
.evt-crumb a { color: rgba(255,255,255,.92); }
.evt-crumb a:hover { color: #fff; text-decoration: underline; }
.evt-crumb svg { width: 13px; height: 13px; }
.evt-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.2); color: #fff; padding: 6px 12px; border-radius: 30px; font-weight: 700; font-size: 12.5px; }
.evt-chip svg { width: 15px; height: 15px; }
.evt-btn { background: rgba(255,255,255,.16); border-color: transparent; color: #fff; }
.evt-btn:hover { background: rgba(255,255,255,.28); border-color: transparent; }
.evt-btn-solid { background: #fff; border-color: #fff; color: var(--text); }
.evt-btn-solid:hover { background: #fff; }
.evt-head-main { display: flex; align-items: center; gap: 16px; padding: 18px 0 20px; }
.evt-avatar { width: 58px; height: 58px; border-radius: 16px; background: rgba(255,255,255,.18); display: grid; place-items: center; flex: none; }
.evt-avatar svg { width: 28px; height: 28px; }
.evt-title { color: #fff; font-size: 26px; font-weight: 800; }
.evt-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: rgba(255,255,255,.92); background: rgba(255,255,255,.14); padding: 4px 10px; border-radius: 8px; }
.evt-tag svg { width: 14px; height: 14px; }
.evt-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: rgba(255,255,255,.18);
  border-radius: 14px 14px 0 0; overflow: hidden; margin-top: 4px; }
.evt-stat { background: rgba(0,0,0,.12); padding: 14px 16px; display: flex; align-items: center; gap: 11px; }
.evt-stat-ic { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.2); display: grid; place-items: center; flex: none; }
.evt-stat-ic svg { width: 17px; height: 17px; }
.evt-stat-v { font-size: 16px; font-weight: 800; line-height: 1.15; }
.evt-stat-l { font-size: 11px; color: rgba(255,255,255,.85); }
.evt-body { padding: 22px 28px 28px; }
@media (max-width: 980px){ .evt-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px){ .evt-banner { padding: 14px 16px 0; } .evt-body { padding: 18px 16px; } .evt-stats { grid-template-columns: 1fr; } }

/* =========================================================================
   Seating editor
   ========================================================================= */
.seat-stage { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); position: relative; overflow: hidden; min-height: 520px; background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 26px 26px; }
.seat-table { position: absolute; cursor: grab; user-select: none; display: grid; place-items: center; transition: box-shadow var(--speed); }
.seat-table:active { cursor: grabbing; }
.seat-table.sel { z-index: 5; }
.seat-round { border-radius: 50%; }
.seat-obj { position: absolute; background: repeating-linear-gradient(45deg,#cbd5e1,#cbd5e1 6px,#e2e8f0 6px,#e2e8f0 12px); border: 1px solid var(--border-strong); border-radius: 8px; display: grid; place-items: center; color: var(--text-2); font-size: 11px; font-weight: 700; }
.seat-chair { position: absolute; width: 13px; height: 13px; border-radius: 50%; }

/* operator card */
.op-guest { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.qty-stepper button { border: none; background: var(--surface); width: 38px; height: 38px; font-size: 18px; font-weight: 700; color: var(--brand); }
.qty-stepper button:hover { background: var(--brand-soft); }
.qty-stepper .qv { width: 46px; text-align: center; font-weight: 800; font-size: 16px; }

/* responsive helper */
@media (max-width: 880px){
  .shell { grid-template-columns: 0 1fr; }
  .sidebar { position: fixed; inset-inline-start: -100%; width: var(--side-w); transition: inset-inline-start var(--speed); }
  .shell.mobile-open .sidebar { inset-inline-start: 0; box-shadow: var(--shadow-lg); }
  .content { padding: 16px; }
  .global-search { max-width: none; }
}

.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 39; }
@media (min-width: 881px){ .scrim { display: none; } }

/* =========================================================================
   Appearance drawer + theme controls
   ========================================================================= */
.drawer-overlay { position: fixed; inset: 0; background: rgba(20,24,46,.45); backdrop-filter: blur(2px); z-index: 120; animation: fade .15s; }
.drawer { position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: 360px; max-width: 92vw;
  background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: drawerIn .22s ease; }
@keyframes drawerIn { from { transform: translateX(var(--dx, 30px)); opacity: .4; } to { transform: none; opacity: 1; } }
html[dir="rtl"] .drawer { animation-name: drawerInRtl; }
@keyframes drawerInRtl { from { transform: translateX(-30px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer-head h3 { font-size: 17px; }
.drawer-body { padding: 18px 20px; overflow-y: auto; }

.theme-sec { padding: 14px 0; border-bottom: 1px solid var(--border); }
.theme-sec:last-of-type { border-bottom: none; }
.theme-sec-h { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--text-2); margin-bottom: 12px; }
.theme-sec-h svg { width: 16px; height: 16px; }

.theme-swatches { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.theme-swatch { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--surface); position: relative; transition: var(--speed); }
.theme-swatch:hover { border-color: var(--border-strong); }
.theme-swatch.active { border-color: var(--brand); background: var(--brand-soft); }
.theme-swatch .sw-pair { display: flex; flex: none; }
.theme-swatch .sw-pair span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--surface); }
.theme-swatch .sw-pair span:last-child { margin-inline-start: -7px; }
.theme-swatch .sw-lbl { font-size: 12px; font-weight: 600; color: var(--text); text-align: start; line-height: 1.2; }
.theme-swatch .sw-check { margin-inline-start: auto; color: var(--brand); display: grid; place-items: center; }
.theme-swatch .sw-check svg { width: 15px; height: 15px; }

.theme-custom { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme-color { display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.theme-color input[type="color"] { width: 48px; height: 48px; border: none; border-radius: 50%; padding: 0; cursor: pointer; background: none; }
.theme-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.theme-color input[type="color"]::-webkit-color-swatch { border: 2px solid var(--border); border-radius: 50%; }
.theme-color span { font-size: 11.5px; font-weight: 600; color: var(--text-2); text-align: center; }

/* =========================================================================
   Dark mode
   ========================================================================= */
html[data-mode="dark"] {
  --bg: #0e1016;
  --surface: #161922;
  --surface-2: #1b1f2b;
  --border: #272c3a;
  --border-strong: #353c4f;
  --text: #e7e9f1;
  --text-2: #a4abbf;
  --text-3: #6c7387;
  --gray: #94a3b8;
  --gray-soft: #232a3a;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 4px 16px rgba(0,0,0,.45);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.6);
}
html[data-mode="dark"] .b-gray { background: #283047; color: #aeb6cc; }
html[data-mode="dark"] .b-gray .bdot { background: #8b93a8; }
html[data-mode="dark"] .global-search input,
html[data-mode="dark"] .field input,
html[data-mode="dark"] .field select,
html[data-mode="dark"] .field textarea,
html[data-mode="dark"] .search-inline input,
html[data-mode="dark"] .select { background: var(--surface-2); color: var(--text); }
html[data-mode="dark"] .seat-stage { background-image: radial-gradient(#2a3144 1px, transparent 1px); }
html[data-mode="dark"] .login-form-side { background: var(--bg); }
html[data-mode="dark"] .gate-wrap { background: radial-gradient(120% 120% at 80% 0%, var(--surface-2), var(--bg) 55%); }
html[data-mode="dark"] .checkbox { border-color: var(--border-strong); }
html[data-mode="dark"] .qty-stepper button { background: var(--surface-2); }

/* =========================================================================
   Light sidebar option
   ========================================================================= */
html[data-sidebar="light"] {
  --side-bg: #ffffff;
  --side-bg-2: #f6f7fb;
  --side-item: #5b6178;
  --side-item-active: #1e2235;
  --side-active-bg: var(--brand-soft);
}
html[data-sidebar="light"] .sidebar { border-inline-end: 1px solid var(--border); }
html[data-sidebar="light"] .sb-brand b,
html[data-sidebar="light"] .sb-scope b { color: var(--text); }
html[data-sidebar="light"] .sb-scope { background: var(--gray-soft); }
html[data-sidebar="light"] .sb-scope:hover { background: var(--border); }
html[data-sidebar="light"] .nav-item:hover { background: var(--gray-soft); color: var(--text); }
html[data-sidebar="light"] .sb-nav::-webkit-scrollbar-thumb { background: var(--border-strong); }
/* dark mode + light sidebar => keep sidebar surface dark-elevated */
html[data-mode="dark"][data-sidebar="light"] {
  --side-bg: #161922;
  --side-bg-2: #1b1f2b;
  --side-item: #a4abbf;
  --side-item-active: #ffffff;
}
