/* ==========================================================================
   TOLA S6 DESIGN SYSTEM — CSS TOKENS & COMPONENTS (REV-A)
   Matches TOLA-SW-S6-Dashboard-Design-Spec-AR.md (§8.1, §8.2, §9, §10)
   ========================================================================== */

:root, [data-theme="light"] {
  /* Surface & Canvas */
  --bg-color: #F7F8FA;
  --surface-color: #FFFFFF;
  --surface-alt: #F2F4F7;
  --surface-hover: #F8F9FB;
  --border-color: #E3E6EA;
  --border-subtle: #EEF0F3;
  
  /* Text & Typography */
  --text-primary: #1A1D21;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;
  --text-inverse: #FFFFFF;

  /* Brand Colors (§8.2) */
  --brand-ink: #1F2329;        /* فحمي مطفي */
  --brand-ink-hover: #292E36;
  --brand-gold: #C9A961;       /* شامبين ذهبي */
  --brand-gold-hover: #B6954B;
  --brand-gold-light: #FAF6EE;
  --brand-gold-border: #E8D9B5;

  /* Semantic Status Colors (§8.2) */
  --color-ok: #1F8A4C;         /* متصلة · مطابقة · ناجح */
  --color-ok-bg: #EAF6EE;
  --color-ok-border: #BCE2CB;

  --color-warn: #C77700;       /* متدهورة · فرق مفتوح · مخزون منخفض */
  --color-warn-bg: #FEF7EA;
  --color-warn-border: #F7DCAC;

  --color-info: #2C6FB8;       /* وضع خدمة · معلومة */
  --color-info-bg: #EFF5FC;
  --color-info-border: #C4DCF4;

  --color-danger: #CC0605;     /* RAL 3020 عطل · فرق حرج · إجراء خطِر */
  --color-danger-bg: #FDF1F1;
  --color-danger-border: #F8BCBC;

  --color-offline: #6B7280;    /* غير متصل (ليس عطلًا) */
  --color-offline-bg: #F3F4F6;
  --color-offline-border: #D1D5DB;

  /* Elevation */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.09), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Radius (§8.1) */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;

  /* Density Token (§8.1 - Default Comfortable: 40px, Compact: 32px) */
  --table-row-height: 40px;
  --table-font-size: 13px;
  --table-padding-y: 9px;
  --table-padding-x: 14px;
}

[data-theme="dark"] {
  --bg-color: #0F1115;
  --surface-color: #171A20;
  --surface-alt: #1F232B;
  --surface-hover: #262B34;
  --border-color: #2D333E;
  --border-subtle: #22262E;

  --text-primary: #F3F4F6;
  --text-secondary: #D1D5DB;
  --text-muted: #9CA3AF;
  --text-inverse: #0F1115;

  --brand-ink: #121418;
  --brand-ink-hover: #1E2229;
  --brand-gold: #D4B774;
  --brand-gold-hover: #C5A358;
  --brand-gold-light: #262215;
  --brand-gold-border: #4D4023;

  --color-ok: #2CC26B;
  --color-ok-bg: #12291B;
  --color-ok-border: #1E4E30;

  --color-warn: #EAA024;
  --color-warn-bg: #2B210F;
  --color-warn-border: #523B17;

  --color-info: #468FE0;
  --color-info-bg: #13243A;
  --color-info-border: #1F426B;

  --color-danger: #EE3433;
  --color-danger-bg: #2E1212;
  --color-danger-border: #5C1D1D;

  --color-offline: #9CA3AF;
  --color-offline-bg: #1F232B;
  --color-offline-border: #374151;

  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.7);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.8);
}

/* Compact Density Modifier (§8.1) */
[data-density="compact"] {
  --table-row-height: 32px;
  --table-font-size: 12px;
  --table-padding-y: 5px;
  --table-padding-x: 10px;
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'IBM Plex Sans Arabic', 'Cairo', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color 0.15s ease, color 0.15s ease;
}

/* Monospace for IDs, codes, currencies per §8.1 & §9.2 */
.font-mono, [bdi], code, pre, .tola-mono {
  font-family: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  direction: ltr;
  unicode-bidi: isolate;
}

/* Focus styles for keyboard accessibility WCAG 2.2 AA (§10 A1) */
:focus-visible {
  outline: 2px solid var(--brand-gold);
  outline-offset: 2px;
}

/* Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ==========================================================================
   Layout Shell
   ========================================================================== */
.tola-app-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Fixed Sidebar Navigation (§3.1) */
.tola-sidebar {
  width: 270px;
  min-width: 270px;
  background-color: var(--brand-ink);
  color: #E2E6ED;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.08);
  user-select: none;
  overflow-y: auto;
}

.tola-sidebar-brand {
  padding: 20px 20px 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tola-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tola-logo-badge {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #2D333D 0%, #15181C 100%);
  border: 1px solid var(--brand-gold);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.tola-logo-title {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.2px;
  line-height: 1.2;
}

.tola-logo-sub {
  font-size: 11px;
  color: var(--brand-gold);
  font-weight: 500;
}

.tola-env-tag {
  font-size: 10px;
  padding: 2px 7px;
  background: rgba(31, 138, 76, 0.2);
  color: #4ADE80;
  border: 1px solid rgba(74, 222, 128, 0.3);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

/* Sidebar Nav Groups */
.tola-nav-section {
  padding: 14px 12px 6px 12px;
}

.tola-nav-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255, 255, 255, 0.4);
  padding: 0 10px 6px 10px;
}

.tola-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: #C0C7D2;
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
  margin-bottom: 2px;
}

.tola-nav-item:hover {
  background-color: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
}

.tola-nav-item.active {
  background-color: rgba(201, 169, 97, 0.15);
  color: #FFFFFF;
  font-weight: 600;
  border-inline-start: 3px solid var(--brand-gold);
}

.tola-nav-item.active .tola-nav-icon {
  color: var(--brand-gold);
}

.tola-nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.6);
}

.tola-nav-badge {
  margin-inline-start: auto;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  font-weight: 600;
}

.tola-nav-badge.danger {
  background: var(--color-danger);
  color: #FFFFFF;
}

.tola-nav-badge.warn {
  background: var(--color-warn);
  color: #FFFFFF;
}

/* Sidebar Footer */
.tola-sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

/* Main Content Area */
.tola-main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top App Bar (§3.2) */
.tola-topbar {
  height: 64px;
  background-color: var(--surface-color);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: var(--shadow-xs);
}

.tola-topbar-start {
  display: flex;
  align-items: center;
  gap: 16px;
}

.tola-topbar-end {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Scope Selector (§3.2, §4 P5) */
.tola-scope-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tola-scope-badge:hover {
  border-color: var(--brand-gold);
}

.tola-scope-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--brand-gold);
  box-shadow: 0 0 0 2px var(--brand-gold-light);
}

/* Universal Search Trigger (Ctrl+K) (§3.2) */
.tola-search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--surface-alt);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
  min-width: 240px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tola-search-trigger:hover {
  border-color: var(--text-muted);
  background: var(--surface-color);
}

.tola-kbd {
  margin-inline-start: auto;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: inherit;
}

/* Interactive Role Simulator Pill */
.tola-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--brand-gold-light);
  border: 1px solid var(--brand-gold-border);
  color: #7A5B18;
  font-size: 12px;
  font-weight: 600;
}

[data-theme="dark"] .tola-role-pill {
  color: #E6CE93;
}

/* Page Body Container */
.tola-page-container {
  padding: 24px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

/* Breadcrumbs (§3.2) */
.tola-breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.tola-breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}

.tola-breadcrumbs a:hover {
  color: var(--brand-gold);
}

.tola-breadcrumbs-sep {
  color: var(--border-color);
}

.tola-breadcrumbs-current {
  color: var(--text-primary);
  font-weight: 600;
}

/* Page Header */
.tola-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.tola-page-title-group h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tola-page-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.tola-page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Design Tokens & Components (§8.1, §8.3)
   ========================================================================== */

/* Buttons */
.tola-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
  white-space: nowrap;
  font-family: inherit;
}

.tola-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.tola-btn-primary {
  background-color: var(--brand-gold);
  color: #1F2329;
  border-color: var(--brand-gold);
}
.tola-btn-primary:hover:not(:disabled) {
  background-color: var(--brand-gold-hover);
  border-color: var(--brand-gold-hover);
}

.tola-btn-secondary {
  background-color: var(--surface-color);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.tola-btn-secondary:hover:not(:disabled) {
  background-color: var(--surface-alt);
  border-color: var(--text-muted);
}

.tola-btn-ink {
  background-color: var(--brand-ink);
  color: #FFFFFF;
}
.tola-btn-ink:hover:not(:disabled) {
  background-color: var(--brand-ink-hover);
}

.tola-btn-danger {
  background-color: var(--color-danger);
  color: #FFFFFF;
  border-color: var(--color-danger);
}
.tola-btn-danger:hover:not(:disabled) {
  background-color: #B20504;
}

.tola-btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.tola-btn-ghost:hover:not(:disabled) {
  background: var(--surface-alt);
  color: var(--text-primary);
}

.tola-btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.tola-btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--surface-color);
  color: var(--text-secondary);
}
.tola-btn-icon:hover {
  background: var(--surface-alt);
  color: var(--text-primary);
}

/* Semantic Badges (§8.2 & §4 P1, P9) */
/* RULE: Status before beauty: Color + Icon + Arabic Text */
.tola-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.tola-badge-ok {
  background-color: var(--color-ok-bg);
  color: var(--color-ok);
  border-color: var(--color-ok-border);
}

.tola-badge-warn {
  background-color: var(--color-warn-bg);
  color: var(--color-warn);
  border-color: var(--color-warn-border);
}

.tola-badge-info {
  background-color: var(--color-info-bg);
  color: var(--color-info);
  border-color: var(--color-info-border);
}

.tola-badge-danger {
  background-color: var(--color-danger-bg);
  color: var(--color-danger);
  border-color: var(--color-danger-border);
}

.tola-badge-offline {
  background-color: var(--color-offline-bg);
  color: var(--color-offline);
  border-color: var(--color-offline-border);
}

.tola-badge-neutral {
  background-color: var(--surface-alt);
  color: var(--text-muted);
  border-color: var(--border-color);
}

/* KPI Metric Cards (§8.1, §4 P3) */
.tola-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.tola-kpi-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}

.tola-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-gold-border);
}

.tola-kpi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.tola-kpi-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.tola-kpi-icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-alt);
  color: var(--text-muted);
}

.tola-kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.tola-kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.tola-kpi-unit {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.tola-kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 1px 5px;
}

.tola-kpi-trend.positive {
  color: var(--color-ok);
  background: var(--color-ok-bg);
}

.tola-kpi-trend.negative {
  color: var(--color-danger);
  background: var(--color-danger-bg);
}

.tola-kpi-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
  margin-top: 6px;
}

/* Card Containers */
.tola-card {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  margin-bottom: 24px;
}

.tola-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tola-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tola-card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}

.tola-card-body {
  padding: 20px;
}

/* Filter Bar (§8.3 & §7.2) */
.tola-filter-bar {
  padding: 12px 20px;
  background-color: var(--surface-alt);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tola-filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tola-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tola-filter-chip.active {
  background: var(--brand-gold-light);
  border-color: var(--brand-gold);
  color: #7A5B18;
  font-weight: 600;
}

[data-theme="dark"] .tola-filter-chip.active {
  color: #E6CE93;
}

.tola-chip-remove {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
}
.tola-chip-remove:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--color-danger);
}

/* Data Table (§8.1 & §7.1) */
.tola-table-wrapper {
  overflow-x: auto;
  width: 100%;
}

.tola-table {
  width: 100%;
  border-collapse: collapse;
  text-align: start;
  font-size: var(--table-font-size);
}

.tola-table th {
  background-color: var(--surface-alt);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 10px var(--table-padding-x);
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 10;
}

.tola-table td {
  padding: var(--table-padding-y) var(--table-padding-x);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  height: var(--table-row-height);
  vertical-align: middle;
}

.tola-table tbody tr {
  transition: background-color 0.1s ease;
}

.tola-table tbody tr:hover {
  background-color: var(--surface-hover);
}

.tola-table tbody tr.selected {
  background-color: var(--brand-gold-light);
}

/* Numerical column alignment §9.6 */
.tola-table th.col-number,
.tola-table td.col-number {
  text-align: end;
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* Checkbox styling */
.tola-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--brand-gold);
  cursor: pointer;
  vertical-align: middle;
}

/* Tabs (§8.3) */
.tola-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
  padding: 0 20px;
  background: var(--surface-color);
}

.tola-tab {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tola-tab:hover {
  color: var(--text-primary);
}

.tola-tab.active {
  color: var(--brand-gold);
  border-bottom-color: var(--brand-gold);
  font-weight: 700;
}

/* Friction Modals (§4 P4, P8) */
.tola-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 21, 0.7);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: tolaFadeIn 0.15s ease;
}

.tola-modal {
  background-color: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  max-width: 540px;
  width: 100%;
  overflow: hidden;
  animation: tolaSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tola-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tola-modal-header.danger {
  background-color: var(--color-danger-bg);
  border-bottom-color: var(--color-danger-border);
}

.tola-modal-header.danger .tola-modal-title {
  color: var(--color-danger);
}

.tola-modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.tola-modal-body {
  padding: 24px;
}

.tola-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* Drawer / Side Panel (§8.3) */
.tola-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
  display: flex;
  justify-content: flex-end;
}

.tola-drawer {
  width: 480px;
  max-width: 90vw;
  background-color: var(--surface-color);
  height: 100vh;
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  z-index: 91;
  animation: tolaSlideIn 0.2s ease;
}

/* Form Controls */
.tola-input-group {
  margin-bottom: 16px;
}

.tola-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.tola-label .required {
  color: var(--color-danger);
  margin-inline-start: 4px;
}

.tola-input, .tola-select, .tola-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--surface-color);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tola-input:focus, .tola-select:focus, .tola-textarea:focus {
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px var(--brand-gold-light);
  outline: none;
}

.tola-help-text {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Empty State (§4 P6) */
.tola-empty-state {
  padding: 48px 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tola-empty-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.tola-empty-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.tola-empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 380px;
  margin-bottom: 20px;
}

/* Conversion Funnel (§6 AD-13) */
.tola-funnel-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.tola-funnel-step {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  position: relative;
  overflow: hidden;
}

.tola-funnel-bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: 0;
  background: rgba(201, 169, 97, 0.18);
  z-index: 1;
  border-inline-end: 2px solid var(--brand-gold);
}

.tola-funnel-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.tola-funnel-step-name {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.tola-funnel-metrics {
  display: flex;
  align-items: center;
  gap: 20px;
}

.tola-funnel-count {
  font-weight: 700;
  font-size: 14px;
}

.tola-funnel-dropoff {
  font-size: 11.5px;
  color: var(--color-danger);
  background: var(--color-danger-bg);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

/* Toast Notification Stack */
.tola-toast-container {
  position: fixed;
  bottom: 24px;
  inset-inline-end: 24px;
  z-index: 150;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
}

.tola-toast {
  background: var(--brand-ink);
  color: #FFFFFF;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
  border-inline-start: 4px solid var(--brand-gold);
  animation: tolaSlideUp 0.2s ease;
}

.tola-toast.ok {
  border-inline-start-color: var(--color-ok);
}

.tola-toast.danger {
  border-inline-start-color: var(--color-danger);
}

/* Animations */
@keyframes tolaFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tolaSlideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes tolaSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* LTR Support Flip (§9.1) */
[dir="ltr"] .tola-funnel-bar-fill {
  left: 0;
  right: auto;
  border-right: 2px solid var(--brand-gold);
}

[dir="ltr"] .tola-nav-item.active {
  border-left: 3px solid var(--brand-gold);
  border-right: none;
}

[dir="ltr"] .tola-toast {
  border-left: 4px solid var(--brand-gold);
  border-right: none;
}

/* Interactive Map of Saudi Arabia (§6 AD-03) */
.tola-map-province {
  fill: #16202F;
  stroke: #25354C;
  stroke-width: 1;
  transition: all 0.25s ease;
  cursor: pointer;
}

.tola-map-province:hover {
  fill: #1E2D42;
  stroke: #C9A961;
  stroke-width: 1.6;
}

.tola-map-province-active {
  fill: rgba(201, 169, 97, 0.14) !important;
  stroke: #C9A961 !important;
  stroke-width: 2 !important;
  filter: drop-shadow(0 0 8px rgba(201, 169, 97, 0.3));
}

.tola-map-pin {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tola-map-pin:hover {
  filter: brightness(1.25);
}

