/*
 * Platform design system — dashboards, auth pages and the marketing site.
 * Mobile-first, RTL-native (logical properties only), no build step required.
 */

/* Brand font (from the «بلس ماينس» identity kit) — used for the logo name only. */
@font-face { font-family: "DG Ghayaty"; src: url("../fonts/dg-ghayaty.ttf") format("truetype"); font-display: swap; }

/* ------------------------------------------------------------------ tokens */
:root {
  /* «بلس ماينس» identity: red + orange on a light base (no dark surfaces). */
  --c-primary: #ca0000;
  --c-primary-600: #b00000;
  --c-primary-700: #8f0000;
  --c-primary-50: #fdeeec;
  --c-primary-100: #f9d2ce;
  --c-accent: #eb9002;
  --c-accent-50: #fff4e2;
  --c-cream: #fffaf4;

  --c-bg: #f5f7f8;
  --c-surface: #ffffff;
  --c-surface-2: #f9fafb;
  --c-border: #e3e8eb;
  --c-border-strong: #cfd7dc;
  --c-text: #0f1f26;
  --c-text-2: #44545c;
  --c-muted: #6b7a82;

  --c-success: #12805c;
  --c-success-50: #e7f6ef;
  --c-warning: #a35a00;
  --c-warning-50: #fff4e0;
  --c-danger: #a8071a;
  --c-danger-50: #fdecec;
  --c-info: #1f63c7;
  --c-info-50: #e9f1fd;
  --c-neutral-50: #eef1f3;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 31, 38, .06);
  --shadow: 0 1px 3px rgba(15, 31, 38, .08), 0 4px 12px rgba(15, 31, 38, .05);
  --shadow-lg: 0 12px 40px rgba(15, 31, 38, .16);
  --focus: 0 0 0 3px rgba(202, 0, 0, .22);

  --font: "IBM Plex Sans Arabic", "Segoe UI", system-ui, -apple-system, Tahoma, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sidebar-w: 264px;
  --topbar-h: 60px;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; vertical-align: middle; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.3; font-weight: 700; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--c-border); margin: 1.25rem 0; }
code, kbd, .mono { font-family: var(--font-mono); font-size: .9em; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.skip-link { position: absolute; inset-inline-start: 1rem; top: -100px; background: var(--c-text); color: #fff; padding: .5rem 1rem; border-radius: var(--radius-sm); z-index: 1000; }
.skip-link:focus { top: 1rem; }
.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .icon-flip { transform: scaleX(-1); }

/* ------------------------------------------------------------------ layout helpers */
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 1rem; }
.stack > * + * { margin-top: var(--gap, 1rem); }
.row { display: flex; gap: var(--gap, .75rem); align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: .75rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid { display: grid; gap: var(--gap, 1rem); }
.grid-2, .grid-3, .grid-4 { display: grid; gap: var(--gap, 1rem); grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .layout-main-aside { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.25rem; align-items: start; }
}
.span-2 { grid-column: span 2; }
.muted { color: var(--c-muted); }
.small { font-size: .86rem; }
.xsmall { font-size: .78rem; }
.text-end { text-align: end; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.w-full { width: 100%; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.hidden { display: none !important; }

/* ------------------------------------------------------------------ buttons */
.btn {
  --btn-bg: var(--c-surface); --btn-fg: var(--c-text); --btn-bd: var(--c-border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 40px; padding: .5rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--btn-bd); background: var(--btn-bg); color: var(--btn-fg);
  font: inherit; font-weight: 600; font-size: .92rem; line-height: 1.2; cursor: pointer;
  text-decoration: none; transition: background .15s, border-color .15s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { text-decoration: none; background: var(--c-surface-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { --btn-bg: var(--c-primary); --btn-fg: #fff; --btn-bd: var(--c-primary); }
.btn-primary:hover { background: var(--c-primary-600); }
.btn-danger { --btn-bg: var(--c-danger); --btn-fg: #fff; --btn-bd: var(--c-danger); }
.btn-danger:hover { background: #a82323; }
.btn-ghost { --btn-bg: transparent; --btn-bd: transparent; }
.btn-ghost:hover { background: var(--c-neutral-50); }
.btn-link { --btn-bg: transparent; --btn-bd: transparent; --btn-fg: var(--c-primary); padding-inline: .25rem; min-height: auto; }
.btn-sm { min-height: 32px; padding: .3rem .7rem; font-size: .84rem; }
.btn-lg { min-height: 48px; padding: .7rem 1.4rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { min-width: 40px; padding-inline: .5rem; }
.btn-group { display: inline-flex; gap: .5rem; flex-wrap: wrap; }

/* ------------------------------------------------------------------ forms */
.form { max-width: 760px; }
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field > label, .label { font-weight: 600; font-size: .9rem; color: var(--c-text); }
.field .hint { font-size: .8rem; color: var(--c-muted); }
.field .error, .error-text { font-size: .82rem; color: var(--c-danger); display: flex; gap: .3rem; align-items: center; }
.required::after { content: " *"; color: var(--c-danger); }
.input, .select, .textarea {
  width: 100%; min-height: 42px; padding: .55rem .8rem; border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm); background: var(--c-surface); color: var(--c-text); font: inherit; font-size: .95rem;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 96px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: var(--focus); }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--c-danger); }
.input-group { display: flex; align-items: stretch; }
.input-group > .input { border-radius: 0; flex: 1; min-width: 0; }
.input-group > :first-child { border-start-start-radius: var(--radius-sm); border-end-start-radius: var(--radius-sm); }
.input-group > :last-child { border-start-end-radius: var(--radius-sm); border-end-end-radius: var(--radius-sm); }
.input-addon { display: flex; align-items: center; padding-inline: .75rem; background: var(--c-surface-2); border: 1px solid var(--c-border-strong); color: var(--c-muted); font-size: .9rem; white-space: nowrap; }
.input-group > .input-addon:first-child { border-inline-end: 0; }
.input-group > .input-addon:last-child { border-inline-start: 0; }
.check { display: flex; gap: .55rem; align-items: flex-start; cursor: pointer; font-size: .93rem; }
.check input { margin-top: .3rem; width: 17px; height: 17px; accent-color: var(--c-primary); flex-shrink: 0; }
.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 99px; background: var(--c-border-strong); position: relative; cursor: pointer; transition: background .15s; flex-shrink: 0; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: inset-inline-start .15s; }
.switch input:checked { background: var(--c-primary); }
.switch input:checked::after { inset-inline-start: 21px; }
.fieldset { border: 1px solid var(--c-border); border-radius: var(--radius); padding: 1rem 1.1rem; margin: 0 0 1rem; }
.fieldset legend { padding-inline: .4rem; font-weight: 700; }
/* A group of checkboxes inside a form: looks like any other field (label on top, no box). */
fieldset.field { border: 0; padding: 0; margin-inline: 0; min-width: 0; }
fieldset.field > legend { padding: 0; margin-bottom: .35rem; font-weight: 600; font-size: .9rem; color: var(--c-text); }
.form-actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; padding-top: .5rem; }
.choice-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice > span { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .9rem .6rem; border: 1.5px solid var(--c-border); border-radius: var(--radius); text-align: center; font-weight: 600; font-size: .9rem; background: var(--c-surface); transition: border-color .15s, background .15s; height: 100%; }
.choice span .icon { width: 1.6rem; height: 1.6rem; color: var(--c-primary); }
.choice input:checked + span { border-color: var(--c-primary); background: var(--c-primary-50); }
.choice input:focus-visible + span { box-shadow: var(--focus); }

/* ------------------------------------------------------------------ cards */
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-body { padding: 1.1rem 1.2rem; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .9rem 1.2rem; border-bottom: 1px solid var(--c-border); flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; font-size: 1rem; }
.card-footer { padding: .8rem 1.2rem; border-top: 1px solid var(--c-border); background: var(--c-surface-2); border-end-start-radius: var(--radius); border-end-end-radius: var(--radius); }
.card + .card { margin-top: 1rem; }
.stat { padding: 1rem 1.1rem; }
.stat-label { color: var(--c-muted); font-size: .85rem; display: flex; align-items: center; gap: .4rem; }
.stat-value { font-size: clamp(1.1rem, 2vw, 1.55rem); font-weight: 700; margin-top: .2rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-sub { font-size: .8rem; color: var(--c-muted); }
.dl { display: grid; grid-template-columns: minmax(110px, 38%) 1fr; gap: .45rem 1rem; margin: 0; font-size: .92rem; }
.dl dt { color: var(--c-muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { padding: .7rem .9rem; text-align: start; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.table th { font-size: .78rem; font-weight: 700; color: var(--c-muted); text-transform: uppercase; letter-spacing: .02em; background: var(--c-surface-2); white-space: nowrap; }
.table tbody tr:hover { background: #fbfcfc; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-link { color: inherit; font-weight: 600; }
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; padding: .8rem 1rem; border-bottom: 1px solid var(--c-border); }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; min-height: 38px; }
.toolbar .grow { flex: 1; min-width: 180px; }
@media (max-width: 719px) {
  .table-responsive thead { display: none; }
  .table-responsive tr { display: block; border-bottom: 1px solid var(--c-border); padding: .5rem 0; }
  .table-responsive td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .3rem 1rem; }
  .table-responsive td::before { content: attr(data-label); color: var(--c-muted); font-size: .82rem; }
  .table-responsive .num { text-align: end; }
}

/* ------------------------------------------------------------------ badges & status */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: var(--c-neutral-50); color: var(--c-text-2); white-space: nowrap; line-height: 1.5; }
.badge .icon { width: .95em; height: .95em; }
.badge-success { background: var(--c-success-50); color: var(--c-success); }
.badge-warning { background: var(--c-warning-50); color: var(--c-warning); }
.badge-danger { background: var(--c-danger-50); color: var(--c-danger); }
.badge-info { background: var(--c-info-50); color: var(--c-info); }
.badge-primary { background: var(--c-primary-50); color: var(--c-primary-700); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ------------------------------------------------------------------ alerts */
.alert { display: flex; gap: .65rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--radius); border: 1px solid; font-size: .93rem; margin-bottom: 1rem; }
.alert .icon { margin-top: .2rem; }
.alert-success { background: var(--c-success-50); border-color: #bfe6d3; color: #0b5c42; }
.alert-error { background: var(--c-danger-50); border-color: #f5c6c6; color: #8f1d1d; }
.alert-warning { background: var(--c-warning-50); border-color: #f6dbad; color: #7a4300; }
.alert-info { background: var(--c-info-50); border-color: #c6dbf7; color: #174a95; }
.alert p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ empty / loading */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--c-muted); }
.empty .icon { width: 2.6rem; height: 2.6rem; color: var(--c-border-strong); margin-bottom: .6rem; }
.empty h3 { color: var(--c-text); }
.skeleton { background: linear-gradient(90deg, #eef1f3 25%, #f7f9fa 50%, #eef1f3 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--radius-sm); min-height: 1em; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ------------------------------------------------------------------ dropdown / modal */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 220px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .35rem; z-index: 50; display: none; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-item { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .55rem .7rem; border-radius: var(--radius-sm); color: var(--c-text); font: inherit; font-size: .92rem; background: none; border: 0; text-align: start; cursor: pointer; }
.dropdown-item:hover { background: var(--c-neutral-50); text-decoration: none; }
.dropdown-item.active { background: var(--c-primary-50); color: var(--c-primary-700); }
.dropdown-sep { height: 1px; background: var(--c-border); margin: .35rem 0; }
.dropdown-label { padding: .4rem .7rem; font-size: .75rem; color: var(--c-muted); font-weight: 700; text-transform: uppercase; }
dialog.modal { border: 0; border-radius: var(--radius-lg); padding: 0; width: min(560px, calc(100% - 2rem)); box-shadow: var(--shadow-lg); color: var(--c-text); }
dialog.modal::backdrop { background: rgba(15, 31, 38, .45); }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.2rem; border-bottom: 1px solid var(--c-border); }
.modal-header h2 { margin: 0; font-size: 1.05rem; }
.modal-body { padding: 1.2rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: .6rem; padding: .9rem 1.2rem; border-top: 1px solid var(--c-border); background: var(--c-surface-2); }

/* ------------------------------------------------------------------ toasts */
.toasts { position: fixed; inset-inline-end: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .5rem; z-index: 200; max-width: min(380px, calc(100% - 2rem)); }
.toast { background: var(--c-text); color: #fff; padding: .75rem 1rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); display: flex; gap: .6rem; align-items: center; font-size: .92rem; animation: toast-in .2s ease-out; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ------------------------------------------------------------------ tabs & pills */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--c-border); overflow-x: auto; margin-bottom: 1.25rem; scrollbar-width: none; }
.tab { padding: .7rem .95rem; color: var(--c-text-2); font-weight: 600; font-size: .92rem; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--c-text); text-decoration: none; }
.tab.active, .tab[aria-current="page"] { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.pills { display: flex; gap: .4rem; flex-wrap: wrap; }
.pill { padding: .35rem .8rem; border-radius: 99px; border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text-2); font-size: .86rem; font-weight: 600; }
.pill:hover { text-decoration: none; border-color: var(--c-border-strong); }
.pill.active { background: var(--c-text); border-color: var(--c-text); color: #fff; }
.pill .count { opacity: .7; margin-inline-start: .25rem; }

/* ------------------------------------------------------------------ pagination */
.pagination { display: flex; gap: .35rem; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-top: 1px solid var(--c-border); flex-wrap: wrap; font-size: .88rem; }
.pagination .pages { display: flex; gap: .3rem; }

/* ------------------------------------------------------------------ app shell (dashboards) */
.app { min-height: 100vh; }
.sidebar {
  position: fixed; inset-block: 0; inset-inline-start: 0; width: var(--sidebar-w); background: var(--c-surface); color: var(--c-text-2); border-inline-end: 1px solid var(--c-border);
  display: flex; flex-direction: column; z-index: 40; transform: translateX(-100%); transition: transform .2s;
}
[dir="rtl"] .sidebar { transform: translateX(100%); }
.sidebar.open { transform: none !important; }
.sidebar-brand { display: flex; align-items: center; gap: .6rem; height: var(--topbar-h); padding-inline: 1.1rem; color: var(--c-text); font-weight: 700; font-size: 1.05rem; border-bottom: 1px solid var(--c-border); }
.sidebar-brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #eb9002, #ca0000); display: grid; place-items: center; color: #fff; font-weight: 800; flex-shrink: 0; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .75rem .6rem 1.5rem; }
.nav-section { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); padding: 1rem .7rem .35rem; }
.nav-link { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: var(--radius-sm); color: var(--c-text-2); font-size: .93rem; font-weight: 500; }
.nav-link:hover { background: var(--c-neutral-50); color: var(--c-text); text-decoration: none; }
.nav-link.active { background: var(--c-primary-50); color: var(--c-primary-700); font-weight: 600; }
.nav-link.active .icon { color: var(--c-primary); }
.nav-link .badge { margin-inline-start: auto; background: var(--c-accent); color: #fff; }
.sidebar-footer { padding: .8rem 1rem; border-top: 1px solid var(--c-border); font-size: .8rem; color: var(--c-muted); }
.sidebar-backdrop { position: fixed; inset: 0; background: rgba(15, 31, 38, .45); z-index: 35; display: none; }
.sidebar-backdrop.open { display: block; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: .75rem; padding-inline: 1rem; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--c-border); }
.topbar .spacer { flex: 1; }
.content { padding: 1.25rem 1rem 3rem; max-width: 1320px; margin-inline: auto; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.page-header h1 { margin: 0; font-size: 1.4rem; }
.page-header .subtitle { color: var(--c-muted); margin: .2rem 0 0; font-size: .92rem; }
.breadcrumb { display: flex; gap: .4rem; align-items: center; font-size: .84rem; color: var(--c-muted); margin-bottom: .4rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--c-muted); }
.switcher { display: flex; align-items: center; gap: .5rem; padding: .35rem .65rem; border: 1px solid var(--c-border); border-radius: var(--radius-sm); background: var(--c-surface); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; max-width: 260px; color: var(--c-text); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--c-primary-100); color: var(--c-primary-700); display: grid; place-items: center; font-weight: 700; font-size: .9rem; flex-shrink: 0; }
.store-logo { width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--c-neutral-50); flex-shrink: 0; }
@media (min-width: 1024px) {
  .sidebar { transform: none !important; }
  .main { margin-inline-start: var(--sidebar-w); }
  .menu-toggle { display: none; }
  .content { padding: 1.75rem 2rem 3rem; }
  .topbar { padding-inline: 2rem; }
}

/* ------------------------------------------------------------------ checklist / progress */
.progress { height: 8px; border-radius: 99px; background: var(--c-neutral-50); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--c-primary); border-radius: 99px; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: .7rem; align-items: center; padding: .65rem 0; border-bottom: 1px solid var(--c-border); }
.checklist li:last-child { border-bottom: 0; }
.check-circle { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--c-border-strong); display: grid; place-items: center; flex-shrink: 0; color: #fff; }
.checklist li.done .check-circle { background: var(--c-success); border-color: var(--c-success); }
.checklist li.done .title { color: var(--c-muted); text-decoration: line-through; }
.steps { display: flex; gap: .3rem; list-style: none; padding: 0; margin: 0 0 1.5rem; overflow-x: auto; }
.steps li { flex: 1; min-width: 70px; }
.steps .bar { height: 4px; border-radius: 99px; background: var(--c-border); }
.steps li.done .bar, .steps li.current .bar { background: var(--c-primary); }
.steps .lbl { font-size: .74rem; color: var(--c-muted); margin-top: .35rem; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.steps li.current .lbl { color: var(--c-text); font-weight: 700; }

/* ------------------------------------------------------------------ charts (pure CSS bars) */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 180px; padding-top: .5rem; }
.bars .bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .3rem; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar { width: 100%; max-width: 34px; background: var(--c-primary); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .bar:hover { background: var(--c-primary-700); }
.bars .bar-label { font-size: .68rem; color: var(--c-muted); white-space: nowrap; }
.hbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .8rem; align-items: center; font-size: .88rem; }
.hbar .track { grid-column: 1 / -1; height: 6px; background: var(--c-neutral-50); border-radius: 99px; overflow: hidden; margin-bottom: .55rem; }
.hbar .track span { display: block; height: 100%; background: var(--c-primary); }

/* ------------------------------------------------------------------ kanban (order board) */
.board { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.board-col { background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--radius); }
.board-col-header { display: flex; justify-content: space-between; align-items: center; padding: .7rem .9rem; font-weight: 700; font-size: .9rem; border-bottom: 1px solid var(--c-border); }
.board-col-body { padding: .6rem; display: flex; flex-direction: column; gap: .6rem; min-height: 80px; }
.order-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-sm); padding: .7rem .8rem; box-shadow: var(--shadow-sm); }
.order-card.is-new { border-inline-start: 4px solid var(--c-accent); }
.order-card a { color: inherit; }

/* ------------------------------------------------------------------ timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding-inline-start: 1.6rem; padding-bottom: 1rem; font-size: .9rem; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 5px; top: 8px; bottom: -8px; width: 2px; background: var(--c-border); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 0; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--c-surface); border: 2px solid var(--c-primary); }

/* ------------------------------------------------------------------ auth pages */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-panel { display: flex; flex-direction: column; justify-content: center; padding: 2rem 1.25rem; }
.auth-card { width: 100%; max-width: 420px; margin-inline: auto; }
.auth-card h1 { font-size: 1.5rem; }
.auth-aside { display: none; background: radial-gradient(900px 420px at 0% 0%, rgba(235, 144, 2, .16), transparent 60%), radial-gradient(700px 380px at 100% 100%, rgba(202, 0, 0, .10), transparent 60%), var(--c-cream); color: var(--c-text-2); padding: 3rem; border-inline-start: 1px solid var(--c-border); }
.auth-aside h2 { color: var(--c-text); font-size: 1.8rem; }
.auth-aside ul { padding-inline-start: 1.1rem; }
.auth-aside li { margin-bottom: .6rem; }
@media (min-width: 960px) { .auth { grid-template-columns: 1fr 1fr; } .auth-aside { display: flex; flex-direction: column; justify-content: center; } }
.divider-text { display: flex; align-items: center; gap: .75rem; color: var(--c-muted); font-size: .85rem; margin: 1rem 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--c-border); }
.otp-input { letter-spacing: .5em; text-align: center; font-size: 1.3rem; font-family: var(--font-mono); direction: ltr; }

/* ------------------------------------------------------------------ marketing site */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--c-border); }
.site-header .container { display: flex; align-items: center; gap: 1rem; height: 66px; }
.site-brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; color: var(--c-text); }
.site-brand:hover { text-decoration: none; }
.brand-logo { display: inline-flex; align-items: center; gap: .45rem; }
.brand-logo-mark { height: 28px; width: auto; flex-shrink: 0; }
.brand-name { font-family: "DG Ghayaty", var(--font); font-weight: 400; font-size: 1.45rem; line-height: 1; color: var(--c-primary); }
.brand-logo-lg .brand-logo-mark { height: 46px; }
.brand-logo-lg .brand-name { font-size: 2.2rem; }
.site-nav { display: none; gap: .25rem; margin-inline-start: 1rem; }
.site-nav a { padding: .45rem .75rem; color: var(--c-text-2); font-weight: 600; font-size: .93rem; border-radius: var(--radius-sm); }
.site-nav a:hover { background: var(--c-neutral-50); text-decoration: none; }
.site-nav a.active { color: var(--c-primary); }
.site-actions { margin-inline-start: auto; display: flex; gap: .5rem; align-items: center; }
.mobile-nav { display: none; border-top: 1px solid var(--c-border); padding: .5rem 1rem 1rem; background: #fff; }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; padding: .6rem .25rem; color: var(--c-text); font-weight: 600; border-bottom: 1px solid var(--c-border); }
@media (min-width: 960px) { .site-nav { display: flex; } .mobile-toggle { display: none; } .mobile-nav { display: none !important; } }
.hero { padding: 3.5rem 0 3rem; background: radial-gradient(900px 400px at 85% -10%, var(--c-primary-50), transparent 70%), radial-gradient(700px 360px at 0% 10%, var(--c-accent-50), transparent 70%); }
.hero h1 { font-size: clamp(1.9rem, 4.5vw, 3.1rem); letter-spacing: -.02em; line-height: 1.2; max-width: 820px; }
.hero .lead { font-size: 1.12rem; color: var(--c-text-2); max-width: 680px; }
.hero-badge { display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .8rem; border-radius: 99px; background: #fff; border: 1px solid var(--c-border); font-size: .85rem; font-weight: 600; margin-bottom: 1.2rem; color: var(--c-text-2); }
.section { padding: 3.5rem 0; }
.section-alt { background: #fff; border-block: 1px solid var(--c-border); }
.section-title { text-align: center; max-width: 720px; margin: 0 auto 2.2rem; }
.section-title h2 { font-size: clamp(1.45rem, 3vw, 2.1rem); }
.section-title p { color: var(--c-text-2); font-size: 1.03rem; }
.feature { padding: 1.4rem; }
.feature .feature-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--c-primary-50); color: var(--c-primary); display: grid; place-items: center; margin-bottom: .9rem; }
.feature .feature-icon .icon { width: 22px; height: 22px; }
.feature h3 { font-size: 1.04rem; }
.feature p { color: var(--c-text-2); font-size: .93rem; margin: 0; }
.activity-chip { display: flex; align-items: center; gap: .65rem; padding: .9rem 1rem; background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); font-weight: 600; }
.activity-chip .icon { color: var(--c-primary); width: 1.4rem; height: 1.4rem; }
.plan { position: relative; display: flex; flex-direction: column; padding: 1.6rem 1.4rem; }
.plan.featured { border: 2px solid var(--c-primary); box-shadow: var(--shadow-lg); }
.plan .plan-flag { position: absolute; top: -12px; inset-inline-start: 1.4rem; background: var(--c-primary); color: #fff; font-size: .78rem; font-weight: 700; padding: .2rem .7rem; border-radius: 99px; }
.plan .price { font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; margin: .4rem 0 0; }
.plan .price small { font-size: .95rem; font-weight: 500; color: var(--c-muted); }
.plan ul { list-style: none; padding: 0; margin: 1.1rem 0 1.5rem; flex: 1; }
.plan li { display: flex; gap: .55rem; padding: .32rem 0; font-size: .93rem; }
.plan li .icon { color: var(--c-success); margin-top: .25rem; }
.plan li.no { color: var(--c-muted); }
.plan li.no .icon { color: var(--c-border-strong); }
.billing-toggle { display: inline-flex; padding: .25rem; background: var(--c-neutral-50); border-radius: 99px; gap: .25rem; }
.billing-toggle a { padding: .4rem 1rem; border-radius: 99px; font-weight: 600; font-size: .9rem; color: var(--c-text-2); }
.billing-toggle a.active { background: #fff; color: var(--c-text); box-shadow: var(--shadow-sm); text-decoration: none; }
.compare th, .compare td { text-align: center; }
.compare th:first-child, .compare td:first-child { text-align: start; }
details.faq { background: #fff; border: 1px solid var(--c-border); border-radius: var(--radius); padding: 0 1.1rem; }
details.faq + details.faq { margin-top: .6rem; }
details.faq summary { cursor: pointer; padding: 1rem 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-size: 1.3rem; line-height: 1; color: var(--c-muted); }
details.faq[open] summary::after { content: "−"; }
details.faq .answer { padding-bottom: 1rem; color: var(--c-text-2); }
.cta-band { background: linear-gradient(135deg, #ca0000, #eb9002); color: #fff; border-radius: var(--radius-lg); padding: 2.5rem 1.5rem; text-align: center; }
.cta-band h2 { color: #fff; }
.site-footer { background: var(--c-cream); color: var(--c-text-2); border-top: 1px solid var(--c-border); padding: 3rem 0 1.5rem; margin-top: 3rem; font-size: .92rem; }
.site-footer a { color: var(--c-text-2); }
.site-footer a:hover { color: var(--c-primary); }
.site-footer h4 { color: var(--c-text); font-size: .95rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .45rem; }
.prose { max-width: 760px; }
.prose h2 { margin-top: 1.8rem; }
.prose ul, .prose ol { padding-inline-start: 1.3rem; }
.prose li { margin-bottom: .35rem; }

/* ------------------------------------------------------------------ print */
@media print {
  .sidebar, .topbar, .no-print, .site-header, .site-footer { display: none !important; }
  .main { margin: 0 !important; }
  body { background: #fff; }
  .card { box-shadow: none; border: 0; }
}
@media (max-width: 639px) {
  .hide-sm { display: none; }
  /* Phone topbar: let the store switcher shrink so the account menu never falls off the edge. */
  .topbar { gap: .35rem; padding-inline: .6rem; }
  .topbar .dropdown { min-width: 0; }
  .switcher { max-width: 150px; min-width: 0; }
}
/* Grid/flex children must be allowed to shrink, or wide content (tables, code) widens the page. */
.card, .layout-main-aside > *, .stack > * { min-width: 0; }
pre { max-width: 100%; overflow-x: auto; }
.list-plain { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
form.inline { display: inline; }
.input-sm, .select-sm { padding: .3rem .5rem; font-size: .85rem; min-height: 0; width: auto; }
.text-danger { color: var(--c-danger); }
pre.code { background: var(--c-surface-2, #f4f5f7); border: 1px solid var(--c-border); border-radius: 8px; padding: .55rem .7rem; font-size: .8rem; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: .25rem 0 .8rem; }
.pt-0 { padding-top: 0 !important; }
.text-success { color: var(--c-success); }

/* design page: theme gallery & visual choices */
.theme-gallery { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.theme-option { display: flex; flex-direction: column; gap: .5rem; border: 2px solid var(--c-border); border-radius: 14px; padding: .55rem; cursor: pointer; background: var(--c-surface); position: relative; }
.theme-option input { position: absolute; opacity: 0; pointer-events: none; }
.theme-option:has(input:checked) { border-color: var(--c-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 18%, transparent); }
.theme-option:has(input:focus-visible) { outline: 3px solid var(--c-primary); outline-offset: 2px; }
.theme-meta { display: flex; flex-direction: column; gap: .15rem; padding: 0 .2rem .2rem; }
.theme-mock { display: flex; flex-direction: column; gap: 6px; height: 150px; padding: 8px; border-radius: 10px; background: var(--m-bg); overflow: hidden; }
.theme-mock .m-header { display: flex; align-items: center; gap: 6px; background: var(--m-surface); border-radius: calc(var(--m-r) / 2); padding: 5px; }
.theme-mock .m-logo { width: 14px; height: 14px; border-radius: 4px; background: var(--m-brand); }
.theme-mock .m-line { height: 6px; flex: 1; border-radius: 3px; background: color-mix(in srgb, var(--m-ink) 25%, transparent); }
.theme-mock .m-row { display: flex; gap: 6px; background: var(--m-surface); border-radius: calc(var(--m-r) / 1.5); padding: 5px; }
.theme-mock .m-txt { flex: 1; background: linear-gradient(color-mix(in srgb, var(--m-ink) 30%, transparent) 0 0) 0 2px / 70% 5px no-repeat, linear-gradient(color-mix(in srgb, var(--m-ink) 15%, transparent) 0 0) 0 12px / 45% 4px no-repeat; }
.theme-mock .m-img { width: 30px; height: 30px; border-radius: calc(var(--m-r) / 2); background: color-mix(in srgb, var(--m-brand) 30%, var(--m-surface)); }
.theme-mock .m-grid { display: grid; gap: 5px; grid-template-columns: repeat(2, 1fr); flex: 1; }
.theme-mock .m-grid.m-grid3 { grid-template-columns: repeat(3, 1fr); }
.theme-mock .m-card { border-radius: calc(var(--m-r) / 1.5); background: linear-gradient(color-mix(in srgb, var(--m-brand) 28%, var(--m-surface)) 0 0) top / 100% 62% no-repeat, var(--m-surface); }
.theme-mock .m-btn { height: 14px; border-radius: 99px; background: var(--m-brand); margin-top: auto; }
.color-input { height: 46px; padding: 4px; }
.visual-choices { display: flex; gap: .6rem; flex-wrap: wrap; }
.visual-choice { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: .6rem .7rem; border: 2px solid var(--c-border); border-radius: 12px; cursor: pointer; min-width: 110px; position: relative; }
.visual-choice input { position: absolute; opacity: 0; pointer-events: none; }
.visual-choice:has(input:checked) { border-color: var(--c-primary); background: color-mix(in srgb, var(--c-primary) 7%, var(--c-surface)); }
.vc-mock { display: grid; gap: 4px; width: 70px; height: 54px; }
.vc-mock i { display: block; border-radius: 4px; background: color-mix(in srgb, var(--c-primary) 35%, var(--c-surface)); }
.vc-list { grid-template-columns: 1fr; } .vc-list i:nth-child(n+4) { display: none; }
.vc-grid2 { grid-template-columns: repeat(2, 1fr); }
.vc-grid3 { grid-template-columns: repeat(3, 1fr); }
.vc-ratio { display: grid; place-items: center; width: 70px; height: 54px; }
.vc-ratio i { display: block; background: color-mix(in srgb, var(--c-primary) 35%, var(--c-surface)); border-radius: 5px; }
.vc-square i { width: 40px; height: 40px; } .vc-portrait i { width: 36px; height: 46px; } .vc-landscape i { width: 52px; height: 38px; }

/* ---- "Sign in as merchant" bar (platform staff) ---- */
.impersonation-bar { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
    padding: .5rem 1rem; background: #3b2a06; color: #fff4d6; font-size: .88rem; }
.impersonation-bar .icon { color: #f6c453; flex: none; }
.impersonation-bar .grow { flex: 1 1 14rem; min-width: 0; }
.impersonation-bar .impersonation-meta { opacity: .8; font-weight: 400; }
.impersonation-bar form { margin: 0; }
.impersonation-bar .btn { background: #f6c453; border-color: #f6c453; color: #2a1d02; }
.impersonation-bar .btn:hover { background: #ffd56e; }

/* ---- branch type (physical / digital) ---- */
.choice-grid-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.branch-form:has(input[name="kind"][value="online"]:checked) .only-physical { display: none; }
.branch-form:not(:has(input[name="kind"][value="online"]:checked)) .only-online { display: none; }
.badge-online { background: var(--c-info-50); color: var(--c-info); }
.choice-grid-2 .choice > span { align-items: flex-start; text-align: start; padding: .9rem 1rem; }
.choice-grid-2 .choice strong { display: flex; align-items: center; gap: .45rem; }
.choice-grid-2 .choice strong .icon { width: 1.25rem; height: 1.25rem; }

/* ---- drivers ---- */
.driver-store-list { display: grid; gap: .35rem; margin-top: .4rem; }
.driver-stores:has(input[name="all_stores"][type="checkbox"]:checked) .driver-store-list { display: none; }

/* ---- driver web app (/driver) — mobile first ---- */
body.driver-app { background: var(--c-bg); padding-bottom: 76px; }
.drv-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .5rem; height: 56px; padding: 0 1rem; background: var(--c-surface); color: var(--c-text); border-bottom: 1px solid var(--c-border); }
.drv-brand { display: flex; align-items: center; gap: .45rem; font-weight: 700; }
.drv-brand .icon { color: var(--c-primary); }
.drv-top .spacer { flex: 1; }
.drv-top form { margin: 0; }
.drv-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; color: #d6e6e8; background: transparent; border: 0; cursor: pointer; }
.drv-icon:hover { background: rgba(255,255,255,.08); }
.drv-main { max-width: 560px; margin: 0 auto; padding: 1rem; }
.drv-tabs { position: fixed; bottom: 0; inset-inline: 0; z-index: 20; display: flex; background: #fff; border-top: 1px solid var(--c-border); padding-bottom: env(safe-area-inset-bottom); }
.drv-tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .15rem; padding: .55rem 0 .5rem; font-size: .78rem; font-weight: 600; color: var(--c-muted); }
.drv-tabs a.on { color: var(--c-primary); }
.drv-tabs a:hover { text-decoration: none; }
.drv-auth { text-align: center; padding: 2rem .5rem; }
.drv-auth form { text-align: start; margin-top: 1.2rem; }
.drv-auth h1 { font-size: 1.4rem; margin: .8rem 0 .3rem; }
.drv-auth-ic { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--c-primary-50); color: var(--c-primary); }
.drv-auth-ic .icon { width: 30px; height: 30px; }
.drv-code { font-size: 1.5rem; letter-spacing: .4em; text-align: center; font-weight: 700; }
.drv-hello { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.drv-hello h1, .drv-h1 { font-size: 1.25rem; margin: 0 0 .2rem; }
.drv-avail { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .8rem; border-radius: 99px; border: 1px solid var(--c-border); background: #fff; font-weight: 700; font-size: .85rem; color: var(--c-muted); cursor: pointer; white-space: nowrap; }
.drv-avail i { width: 9px; height: 9px; border-radius: 50%; background: #b9c3c6; }
.drv-avail.on { color: var(--c-success); border-color: #bfe6d3; background: var(--c-success-50); }
.drv-avail.on i { background: var(--c-success); }
.drv-list { display: grid; gap: .7rem; }
.drv-card, .drv-detail { display: block; background: #fff; border: 1px solid var(--c-border); border-radius: 18px; padding: .9rem 1rem; color: var(--c-text); box-shadow: 0 1px 3px rgba(12,42,47,.05); }
.drv-card:hover { text-decoration: none; border-color: #bcd9d2; }
.drv-card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .55rem; }
.drv-store { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; font-size: .85rem; color: var(--c-primary); }
.drv-card-body { display: grid; gap: .25rem; }
.drv-cash { margin-top: .6rem; padding: .45rem .65rem; border-radius: 10px; background: #fff6e3; color: #7a4a00; font-size: .88rem; display: flex; align-items: center; gap: .4rem; }
.drv-empty { text-align: center; padding: 2.5rem 1rem; background: #fff; border-radius: 18px; border: 1px dashed var(--c-border-strong); }
.drv-empty > .icon { width: 40px; height: 40px; color: var(--c-muted); }
.drv-empty h2 { font-size: 1.1rem; margin: .6rem 0 .3rem; }
.drv-back { display: inline-flex; align-items: center; gap: .3rem; margin-bottom: .7rem; font-weight: 600; font-size: .9rem; }
.drv-sec { padding: .8rem 0; border-top: 1px solid #eef2f2; }
.drv-sec h2 { font-size: .78rem; text-transform: none; color: var(--c-muted); margin: 0 0 .3rem; font-weight: 700; }
.drv-money { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.drv-money span { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.drv-money strong { font-size: 1.25rem; }
.drv-actions { margin-top: 1rem; }
.drv-fail { margin-top: .9rem; background: #fff; border: 1px solid var(--c-border); border-radius: 14px; padding: 0 1rem; }
.drv-fail summary { cursor: pointer; padding: .8rem 0; font-weight: 600; color: var(--c-danger); display: flex; align-items: center; gap: .4rem; list-style: none; }
.drv-fail summary::-webkit-details-marker { display: none; }
.drv-fail form { padding-bottom: 1rem; }

.board-driver { display: flex; align-items: center; gap: .35rem; margin-top: .45rem; padding: .3rem .5rem; border-radius: 8px; background: var(--c-neutral-50); font-size: .8rem; font-weight: 600; min-width: 0; }
.board-driver .truncate { flex: 1; min-width: 0; }
.board-driver .icon { width: .95rem; height: .95rem; color: var(--c-primary); flex: none; }
.board-driver .badge { font-size: .68rem; }
.board-driver.is-none { color: var(--c-muted); border: 1px dashed var(--c-border-strong); background: transparent; }
.board-driver.is-none:hover { color: var(--c-primary); text-decoration: none; }

.drv-track { display: flex; align-items: center; gap: .45rem; margin: 0 0 .8rem; padding: .5rem .7rem; border-radius: 12px; background: #fff; border: 1px solid var(--c-border); font-size: .82rem; color: var(--c-muted); }
.drv-track.is-on { color: var(--c-success); border-color: #bfe6d3; background: var(--c-success-50); }
.drv-track .icon { width: 1rem; height: 1rem; flex: none; }

/* ---- bookings ---- */
.resource-form:has(input[name="own_hours"][type="checkbox"]:not(:checked)) .own-hours-week { display: none; }
.cal { padding: .5rem 0; overflow-x: auto; }
.cal-head, .cal-row { display: grid; grid-template-columns: 130px minmax(460px, 1fr); align-items: stretch; }
.cal-scale { position: relative; height: 26px; border-bottom: 1px solid var(--c-border); margin-inline-end: 1rem; }
.cal-scale span { position: absolute; top: 4px; font-size: .72rem; color: var(--c-muted); transform: translateX(50%); }
[dir="ltr"] .cal-scale span { transform: translateX(-50%); }
.cal-row { border-bottom: 1px solid var(--c-border); min-height: 54px; }
.cal-res { display: grid; align-content: center; padding: .4rem 1rem; gap: .1rem; }
.cal-track { position: relative; margin-inline-end: 1rem; }
.cal-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--c-border); }
.cal-ev { position: absolute; top: 7px; bottom: 7px; display: flex; align-items: center; gap: .3rem; padding: 0 .45rem; border-radius: 8px; background: var(--c-primary-50); border: 1px solid var(--c-primary-100); color: var(--c-primary-700); font-size: .76rem; overflow: hidden; white-space: nowrap; }
.cal-ev span { overflow: hidden; text-overflow: ellipsis; }
.cal-ev:hover { text-decoration: none; border-color: var(--c-primary); }
.cal-ev.is-done { background: var(--c-success-50); border-color: #bfe6d3; color: var(--c-success); }
.cal-ev.is-noshow { background: var(--c-neutral-50); border-color: var(--c-border); color: var(--c-muted); text-decoration: line-through; }

/* ---- advanced reports ---- */
.delta { font-weight: 700; }
.delta.is-good { color: var(--c-success); }
.delta.is-bad { color: var(--c-danger); }
.heat-wrap { overflow-x: auto; }
.heat { border-collapse: separate; border-spacing: 3px; font-size: .72rem; }
.heat th { font-weight: 600; color: var(--c-muted); padding: 0 .3rem; white-space: nowrap; text-align: start; }
.heat td { width: 22px; height: 20px; border-radius: 4px; background: var(--c-neutral-50); }
.heat td.l1 { background: #fde4cc; } .heat td.l2 { background: #f8b56a; } .heat td.l3 { background: #e5602e; } .heat td.l4 { background: #ca0000; }
