/* Tiras Forwarding Platform — Design System */

:root {
  /* Brand */
  --teal-50:  #eef4ff;
  --teal-100: #dbe8ff;
  --teal-200: #b4ccff;
  --teal-300: #79a6f8;
  --teal-400: #4f83ef;
  --teal-500: #2a63e0;
  --teal-600: #0047be;
  --teal-700: #003c9e;
  --teal-800: #003080;
  --teal-900: #002460;

  /* Neutrals (light) */
  --gray-0:  #ffffff;
  --gray-50: #f6f8fa;
  --gray-100:#eef1f4;
  --gray-150:#e4e9ee;
  --gray-200:#d4dbe2;
  --gray-300:#b6c1cc;
  --gray-400:#8a98a6;
  --gray-500:#5e6e7d;
  --gray-600:#42525f;
  --gray-700:#2d3b47;
  --gray-800:#1a2530;
  --gray-900:#0d1820;

  /* Semantic */
  --success: #15a366;
  --success-bg: #e3f7ee;
  --warning: #d68a16;
  --warning-bg: #fdf3e0;
  --danger:  #d04545;
  --danger-bg: #fce9e9;
  --info:    #3879d6;
  --info-bg: #e6efff;

  /* Active theme tokens (light by default) */
  --bg:        var(--gray-50);
  --bg-sunken: #eef2f5;
  --surface:   var(--gray-0);
  --surface-2: #f9fbfc;
  --surface-hover: var(--gray-100);
  --border:    var(--gray-150);
  --border-strong: var(--gray-200);
  --text:      var(--gray-900);
  --text-muted: var(--gray-500);
  --text-faint: var(--gray-400);
  --primary:   var(--teal-600);
  --primary-hover: var(--teal-700);
  --primary-soft: var(--teal-50);
  --primary-text: #ffffff;
  --shadow-sm: 0 1px 2px rgba(13,24,32,0.04), 0 1px 1px rgba(13,24,32,0.03);
  --shadow-md: 0 4px 12px rgba(13,24,32,0.06), 0 2px 4px rgba(13,24,32,0.04);
  --shadow-lg: 0 12px 32px rgba(13,24,32,0.10), 0 4px 8px rgba(13,24,32,0.05);
  --shadow-pop: 0 18px 48px rgba(13,24,32,0.18);

  /* Radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;

  /* Density */
  --row-h: 44px;
  --pad-x: 16px;
  --pad-y: 12px;
  --gap:   12px;

  /* Type */
  --font-sans: "IBM Plex Sans", "Vazirmatn", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 13px;
  --fs-base: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 26px;
  --fs-3xl: 34px;
}

html[data-theme="dark"] {
  --bg:        #0a1216;
  --bg-sunken: #060c0f;
  --surface:   #121c22;
  --surface-2: #0f181d;
  --surface-hover: #182530;
  --border:    #1f2c34;
  --border-strong: #2a3a44;
  --text:      #e6edf2;
  --text-muted:#8a98a4;
  --text-faint:#5d6c78;
  --primary:   var(--teal-400);
  --primary-hover: var(--teal-300);
  --primary-soft: #0a1c3e;
  --primary-text: #04112c;
  --success-bg: #0e2a1f;
  --warning-bg: #2a1f0e;
  --danger-bg:  #2a1212;
  --info-bg:    #0e1d2e;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.55);
  --shadow-pop: 0 18px 48px rgba(0,0,0,0.7);
}

html[data-density="compact"] {
  --row-h: 36px;
  --pad-x: 12px;
  --pad-y: 8px;
  --gap:   8px;
  --fs-base: 13px;
}
html[data-density="comfy"] {
  --row-h: 52px;
  --pad-x: 20px;
  --pad-y: 16px;
  --gap:   16px;
  --fs-base: 15px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv11", "ss01";
}
html[dir="rtl"] body { font-family: "Vazirmatn", "IBM Plex Sans", system-ui, sans-serif; }

button { font-family: inherit; }

/* ─── Layout shell ───────────────────────────────────────── */
.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  grid-template-rows: 56px 1fr 52px;
  height: 100vh;
  background: var(--bg);
}
html[dir="rtl"] .app { grid-template-columns: 248px 1fr; }

.topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 5;
}
.sidebar {
  grid-column: 1;
  grid-row: 2;
  background: var(--surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 12px 8px;
}
html[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid var(--border); }
.main {
  grid-column: 2;
  grid-row: 2;
  overflow-y: auto;
  background: var(--bg);
}

/* ─── Bottom role switcher ───────────────────────────────── */
.rolebar {
  grid-column: 1 / -1;
  grid-row: 3;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 6;
}
.rolebar-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-faint);
  white-space: nowrap;
}
.rolebar-segs {
  display: flex;
  gap: 4px;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.rolebar-seg {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background .12s, color .12s;
}
.rolebar-seg:hover { color: var(--text); background: var(--surface-hover); }
.rolebar-seg.on {
  background: var(--primary);
  color: var(--primary-text);
  box-shadow: var(--shadow-sm);
}
.rolebar-seg.on:hover { background: var(--primary); color: var(--primary-text); }
.rolebar-hint {
  font-size: 11px;
  color: var(--text-faint);
  margin-inline-start: auto;
  white-space: nowrap;
}
@media (max-width: 820px) {
  .rolebar-seg span { display: none; }
  .rolebar-hint { display: none; }
}

/* ─── Sidebar nav ────────────────────────────────────────── */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
  display: grid; place-items: center;
  color: white;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px -2px var(--teal-500);
}
html[data-theme="dark"] .brand-mark { box-shadow: 0 4px 12px -2px rgba(30,163,153,0.3); }
.brand-name { font-weight: 600; font-size: 15px; letter-spacing: 0.2px; }
.brand-tagline { font-size: 11px; color: var(--text-muted); margin-top: 1px; letter-spacing: 0.3px; }

.nav-section { padding: 6px 12px 4px; font-size: 10px; text-transform: uppercase; color: var(--text-faint); letter-spacing: 0.8px; font-weight: 600; margin-top: 6px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-md);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  user-select: none;
  position: relative;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-item.active .nav-icon { color: var(--primary); }
.nav-item.disabled { opacity: 0.35; cursor: not-allowed; }
.nav-item.disabled:hover { background: transparent; color: var(--text-muted); }
.nav-icon { width: 18px; height: 18px; flex: none; color: var(--text-faint); display: grid; place-items: center; }
.nav-badge { margin-left: auto; background: var(--primary); color: var(--primary-text); font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 10px; min-width: 18px; text-align: center; }
html[dir="rtl"] .nav-badge { margin-left: 0; margin-right: auto; }

/* ─── Topbar ─────────────────────────────────────────────── */
.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.topbar-crumb { color: var(--text-faint); margin: 0 8px; }
.topbar-spacer { flex: 1; }
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 10px;
  border-radius: var(--r-md);
  width: 280px;
  color: var(--text-muted);
}
.search-box input { border: none; background: transparent; flex: 1; color: var(--text); outline: none; font-family: inherit; font-size: 13px; }
.search-box input::placeholder { color: var(--text-faint); }
.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn .dot {
  position: absolute; top: 6px; right: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--teal-500);
  border: 2px solid var(--surface);
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  cursor: pointer;
}
html[dir="rtl"] .user-chip { padding: 4px 4px 4px 10px; }
.user-chip:hover { background: var(--surface-hover); }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
  color: white; font-size: 11px; font-weight: 600;
  display: grid; place-items: center;
  flex: none;
}
.user-name { font-size: 13px; font-weight: 500; }
.user-role { font-size: 10px; color: var(--text-muted); }

.lang-toggle {
  display: flex; padding: 2px; background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
}
.lang-toggle button {
  border: none; background: transparent; padding: 4px 10px; font-size: 11px; font-weight: 600; color: var(--text-muted); border-radius: 999px; cursor: pointer;
}
.lang-toggle button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ─── Page ───────────────────────────────────────────────── */
.page { padding: 24px 28px; max-width: 1480px; margin: 0 auto; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -0.2px; }
.page-sub { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { background: var(--surface-hover); }
.btn-primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* ─── Cards & panels ─────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.card-pad { padding: 18px 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.card-title { font-weight: 600; font-size: 14px; }
.card-sub { color: var(--text-muted); font-size: 12px; }

/* ─── KPIs ───────────────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.kpi-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.kpi-value { font-size: 28px; font-weight: 600; margin-top: 6px; letter-spacing: -0.5px; }
.kpi-sub { display: flex; align-items: center; gap: 6px; font-size: 11px; margin-top: 8px; }
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-spark { position: absolute; right: 0; bottom: 0; opacity: 0.4; pointer-events: none; }
html[dir="rtl"] .kpi-spark { right: auto; left: 0; transform: scaleX(-1); }
.kpi-icon {
  width: 32px; height: 32px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid; place-items: center;
  border-radius: var(--r-md);
  position: absolute; top: 16px; right: 18px;
}
html[dir="rtl"] .kpi-icon { right: auto; left: 18px; }

/* ─── Tables ─────────────────────────────────────────────── */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}
html[dir="rtl"] .tbl th { text-align: right; }
.tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--surface-2); }
.tbl .num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; font-family: var(--font-mono); font-size: 12px; }
.tbl .mono { font-family: var(--font-mono); font-size: 12px; }
html[data-density="compact"] .tbl th,
html[data-density="compact"] .tbl td { padding: 7px 12px; }
html[data-density="comfy"] .tbl th,
html[data-density="comfy"] .tbl td { padding: 16px 18px; }

/* ─── Badges & chips ─────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  background: var(--surface-hover);
  color: var(--text);
  white-space: nowrap;
}
.badge::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
}
.badge.success { background: var(--success-bg); color: var(--success); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.danger  { background: var(--danger-bg);  color: var(--danger); }
.badge.info    { background: var(--info-bg);    color: var(--info); }
.badge.muted   { background: var(--bg-sunken); color: var(--text-muted); }
.badge.solid   { background: var(--primary); color: var(--primary-text); }
.badge-mode {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}
.badge-mode.sea  { color: var(--info);    border-color: var(--info);    background: var(--info-bg); }
.badge-mode.air  { color: var(--teal-600); border-color: var(--teal-500); background: var(--teal-50); }
html[data-theme="dark"] .badge-mode.air { color: var(--teal-300); background: var(--primary-soft); }
.badge-mode.land { color: var(--warning); border-color: var(--warning); background: var(--warning-bg); }
.badge-mode.multi { color: var(--text); border-color: var(--border-strong); background: var(--surface-hover); }

/* ─── Forms / inputs ─────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 500; color: var(--text-muted); }
.input, .select, .textarea {
  font-family: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  outline: none;
  width: 100%;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ─── Empty / hint blocks ────────────────────────────────── */
.empty {
  padding: 40px 20px; text-align: center; color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface-2);
}

/* ─── Filter row ─────────────────────────────────────────── */
.filter-row {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin-bottom: 14px;
}
.chip-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.chip-btn.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.chip-btn:hover { color: var(--text); }

/* ─── Tracking timeline ──────────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 14px; padding: 4px; }
.tl-row { display: flex; gap: 14px; align-items: flex-start; }
.tl-dot {
  width: 14px; height: 14px; flex: none;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  margin-top: 4px;
  position: relative;
}
.tl-row.done .tl-dot { background: var(--success); border-color: var(--success); }
.tl-row.active .tl-dot { background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.tl-line { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 2px; height: 36px; background: var(--border-strong); }
.tl-row.done .tl-line { background: var(--success); }
.tl-body { flex: 1; padding-bottom: 4px; }
.tl-title { font-weight: 500; font-size: 13px; }
.tl-meta  { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* ─── Stepper (shipment journey) ─────────────────────────── */
.stepper { display: flex; align-items: center; gap: 0; padding: 8px 0; }
.step { display: flex; align-items: center; gap: 8px; }
.step + .step::before {
  content: ""; display: block; width: 40px; height: 2px; background: var(--border-strong); margin: 0 8px;
}
.step.done + .step::before, .step.active + .step::before { background: var(--success); }
.step-circle {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--border-strong);
  font-size: 11px; font-weight: 600; color: var(--text-muted);
}
.step.done .step-circle { background: var(--success); border-color: var(--success); color: white; }
.step.active .step-circle { background: var(--primary); border-color: var(--primary); color: var(--primary-text); box-shadow: 0 0 0 4px var(--primary-soft); }
.step-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.step.done .step-label, .step.active .step-label { color: var(--text); }

/* ─── Activity feed ──────────────────────────────────────── */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.feed-item:last-child { border-bottom: none; }
.feed-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center; flex: none;
  background: var(--surface-hover);
  color: var(--text-muted);
}
.feed-icon.info { background: var(--info-bg); color: var(--info); }
.feed-icon.success { background: var(--success-bg); color: var(--success); }
.feed-icon.warn { background: var(--warning-bg); color: var(--warning); }
.feed-icon.danger { background: var(--danger-bg); color: var(--danger); }
.feed-body { flex: 1; min-width: 0; }
.feed-title { font-size: 13px; }
.feed-title strong { font-weight: 600; }
.feed-meta { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

/* ─── Detail layout ──────────────────────────────────────── */
.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 16px; align-items: start; }
@media (max-width: 1200px) { .detail-grid { grid-template-columns: 1fr; } }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 16px; font-size: 13px; }
html[dir="rtl"] .kv { direction: rtl; }
.kv dt { color: var(--text-muted); font-weight: 400; }
.kv dd { margin: 0; font-weight: 500; }
.kv dd.mono { font-family: var(--font-mono); font-size: 12px; }

/* ─── Tabs ───────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab { padding: 8px 14px; font-size: 13px; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tab.on { color: var(--primary); border-bottom-color: var(--primary); }
.tab:hover { color: var(--text); }

/* ─── Inbox / kanban for ops ─────────────────────────────── */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 1300px) { .kanban { grid-template-columns: repeat(2, 1fr); } }
.kcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-lg); display: flex; flex-direction: column; min-height: 400px; }
.kcol-head { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.kcol-title { font-weight: 600; font-size: 13px; }
.kcol-count { font-size: 11px; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); padding: 1px 7px; border-radius: 999px; }
.kcol-body { padding: 10px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; cursor: pointer; }
.kcard:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.kcard-title { font-weight: 600; font-size: 13px; }
.kcard-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: flex; gap: 8px; align-items: center; }

/* ─── Modal ──────────────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0;
  background: rgba(13,24,32,0.5);
  display: grid; place-items: center;
  z-index: 1000;
  padding: 24px;
  backdrop-filter: blur(4px);
}
.modal {
  background: var(--surface); border-radius: var(--r-lg);
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow: auto;
  box-shadow: var(--shadow-pop);
  border: 1px solid var(--border);
}
.modal-head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ─── Charts (SVG) ───────────────────────────────────────── */
.chart-wrap { padding: 12px 18px 18px; }
.chart-legend { display: flex; gap: 16px; margin-bottom: 8px; font-size: 12px; color: var(--text-muted); }
.chart-legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
html[dir="rtl"] .chart-legend span::before { margin-right: 0; margin-left: 6px; }

/* ─── Access denied / role guard ─────────────────────────── */
.locked {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px;
  padding: 60px 30px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface-2);
  color: var(--text-muted);
}
.locked-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--warning-bg); color: var(--warning); }

/* ─── Money cell ─────────────────────────────────────────── */
.money { font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 12px; }
.money.pos { color: var(--success); }
.money.neg { color: var(--danger); }
.money.big { font-size: 14px; font-weight: 600; }

/* ─── Donut & micro charts ───────────────────────────────── */
.donut-row { display: flex; align-items: center; gap: 18px; padding: 16px 20px; }
.donut-row svg { flex: none; }
.donut-legend { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.donut-legend-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.donut-legend-row .sw { width: 10px; height: 10px; border-radius: 2px; }
.donut-legend-row .lbl { color: var(--text-muted); flex: 1; }
.donut-legend-row .val { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ─── Notification panel ─────────────────────────────────── */
.notif-pop {
  position: absolute; top: 44px; right: 0;
  width: 340px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop);
  z-index: 50;
  overflow: hidden;
}
html[dir="rtl"] .notif-pop { right: auto; left: 0; }
.notif-head { padding: 12px 16px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.notif-item { padding: 12px 16px; display: flex; gap: 10px; border-bottom: 1px solid var(--border); cursor: pointer; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--primary-soft); }
.notif-item.unread:hover { background: var(--primary-soft); }

/* ─── Print-money confirm banner ─────────────────────────── */
.banner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r-lg);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}
.banner.warn { background: var(--warning-bg); border-color: rgba(214,138,22,0.3); color: var(--warning); }
.banner.info { background: var(--info-bg); border-color: rgba(56,121,214,0.3); color: var(--info); }

/* numerals in fa */
html[dir="rtl"] { font-feature-settings: "ss01"; }
