/* ============================================================================
   main.css — Tavroo
   Variables + Reset + Typography + Layout (Sidebar, Topbar, Main)
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');

/* ============================================================================
   1. CSS VARIABLES
   ============================================================================ */

:root {
  /* Brand aliases (use with var(--copper), etc.) */
  --text-900:           #1C1C1E;
  --text-700:           #3A3A3C;
  --text-500:           #6B6B70;
  --copper:             #C4956A;
  --copper-dark:        #A67A52;
  --copper-light:       #F5EDE3;
  --border:             #E8E4DC;

  /* Brand — white / copper */
  --white:              #FFFFFF;
  --warm-white:         #FAF9F7;
  --cream:              #F4F1EB;
  --cream-dark:         #EAE4D8;

  /* Primary — Copper */
  --color-primary-50:   #F5EDE3;
  --color-primary-100:  #EDD9C4;
  --color-primary-200:  #E4CCB0;
  --color-primary-300:  #D9B88F;
  --color-primary-400:  #D4A87A;
  --color-primary-500:  #C4956A;
  --color-primary-600:  #A67A52;
  --color-primary-700:  #8B6644;
  --color-primary-800:  #6E5036;
  --color-primary-900:  #523C29;

  /* Neutral — warm gray (keeps existing utility names) */
  --color-gray-50:  #FAFAF9;
  --color-gray-100: #F4F1EB;
  --color-gray-200: #E8E4DC;
  --color-gray-300: #D4CFC5;
  --color-gray-400: #ADADB8;
  --color-gray-500: #8E8E93;
  --color-gray-600: #6B6B70;
  --color-gray-700: #4A4A4D;
  --color-gray-800: #3A3A3C;
  --color-gray-900: #1C1C1E;

  /* Accent — copper tone (legacy hooks) */
  --color-accent-400: #D4A87A;
  --color-accent-500: #C4956A;
  --color-accent-600: #A67A52;
  --color-accent-700: #8B6644;

  /* Semantic */
  --color-success:  #10B981;
  --color-warning:  #F59E0B;
  --color-danger:   #EF4444;
  --color-info:     #C4956A;

  /* Task Priority Colors */
  --priority-urgent:  #EF4444;
  --priority-high:    #F97316;
  --priority-medium:  #F59E0B;
  --priority-low:     #10B981;
  --priority-none:    #ADADB8;

  /* Task Status Colors */
  --status-todo:         #94A3B8;
  --status-inprogress:   #C4956A;
  --status-review:       #8B5CF6;
  --status-done:         #10B981;
  --status-cancelled:    #EF4444;

  /* Surfaces */
  --surface-app:           #FAF9F7;
  --surface-sidebar:     #FFFFFF;
  --surface-card:        #FFFFFF;
  --surface-hover:       #F4F1EB;
  --surface-active:      #F5EDE3;

  /* Typography */
  --text-primary:    #1C1C1E;
  --text-secondary:  #6B6B70;
  --text-muted:      #ADADB8;
  --text-inverse:    #FFFFFF;
  --text-on-sidebar:        #3A3A3C;
  --text-on-sidebar-muted:  #6B6B70;
  --text-on-sidebar-active: #C4956A;

  /* Borders */
  --border-light:  #E8E4DC;
  --border-medium: #D4CFC5;
  --border-focus:  #C4956A;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(28 28 30 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(28 28 30 / 0.07), 0 2px 4px -2px rgb(28 28 30 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(28 28 30 / 0.08), 0 4px 6px -4px rgb(28 28 30 / 0.05);
  --shadow-xl: 0 32px 80px rgb(28 28 30 / 0.12), 0 8px 24px rgb(28 28 30 / 0.06);

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  16px;
  --radius-full: 9999px;

  /* Typography Stacks */
  --font-sans-en: 'Inter', system-ui, -apple-system, sans-serif;
  --font-sans-ar: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif;
  --font-sans:    var(--font-sans-en);
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow:   400ms ease;

  /* Layout */
  --sidebar-width:           240px;
  --sidebar-width-collapsed:  56px;
  --topbar-height:            56px;
  --z-modal:        1000;
  --z-dropdown:      500;
  --z-tooltip:       999;
  --z-sidebar:       100;
  --z-topbar:         90;
}

/* استخدم الخط العربي عند dir="rtl" */
[dir="rtl"] {
  --font-sans: var(--font-sans-ar);
}

/* ============================================================================
   2. RESET & BASE
   ============================================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--surface-app);
  min-height: 100vh;
  overflow: hidden; /* الـ scroll يكون داخل main-content */
}

img, svg, video {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol { list-style: none; }

hr {
  border: none;
  border-top: 1px solid var(--border-light);
}

::selection {
  background: var(--color-primary-200);
  color: var(--color-primary-900);
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Hide outline لكن خلّي focus-visible يشتغل */
:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================================================
   3. TYPOGRAPHY UTILITIES
   ============================================================================ */

.text-xs   { font-size: 11px; line-height: 16px; }
.text-sm   { font-size: 12px; line-height: 18px; }
.text-base { font-size: 14px; line-height: 20px; }
.text-lg   { font-size: 16px; line-height: 24px; }
.text-xl   { font-size: 18px; line-height: 28px; }
.text-2xl  { font-size: 22px; line-height: 32px; }
.text-3xl  { font-size: 28px; line-height: 36px; }

.font-medium   { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold     { font-weight: 700; }

.text-primary    { color: var(--text-primary); }
.text-secondary  { color: var(--text-secondary); }
.text-muted      { color: var(--text-muted); }
.text-inverse    { color: var(--text-inverse); }
.text-success    { color: var(--color-success); }
.text-warning    { color: var(--color-warning); }
.text-danger     { color: var(--color-danger); }

.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-center { text-align: center; }
.text-start  { text-align: start; }
.text-end    { text-align: end; }

/* ============================================================================
   4. APP LAYOUT
   ============================================================================ */

.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) 1fr;
  grid-template-areas:
    "sidebar topbar"
    "sidebar main";
  height: 100vh;
  width: 100vw;
  transition: grid-template-columns var(--transition-normal);
}

.app-layout.sidebar-collapsed {
  grid-template-columns: var(--sidebar-width-collapsed) 1fr;
}

.app-sidebar {
  grid-area: sidebar;
  background: var(--surface-sidebar);
  color: var(--text-on-sidebar);
  border-inline-end: 1px solid var(--border-light);
  z-index: var(--z-sidebar);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--transition-normal);
}

.app-topbar {
  grid-area: topbar;
  background: #FFFFFF;
  border-bottom: 1px solid #E8E4DC;
  z-index: var(--z-topbar);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
}

.app-main {
  grid-area: main;
  background: var(--surface-app);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

.app-main.is-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* ============================================================================
   5. SIDEBAR
   ============================================================================ */

.sidebar-header {
  padding: var(--space-5) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  min-width: 0;
}

.sidebar-brand img {
  display: block;
  height: 36px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.app-layout.sidebar-collapsed .sidebar-brand,
.app-layout.sidebar-collapsed .sidebar-section-label,
.app-layout.sidebar-collapsed .nav-item-label,
.app-layout.sidebar-collapsed .org-switcher {
  display: none;
}

.sidebar-org {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.org-switcher {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--cream);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast);
  width: 100%;
}

.org-switcher:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.org-switcher-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: start;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2) 0;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar-nav::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 2px;
}

.sidebar-section {
  padding: var(--space-2) 0;
}

.sidebar-section-label {
  padding: var(--space-2) var(--space-4);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px var(--space-4);
  margin: 1px var(--space-2);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  position: relative;
}

.nav-item:hover {
  background: #F4F1EB;
  color: var(--text-primary);
}

.nav-item.is-active {
  background: var(--copper-light);
  color: var(--copper);
  box-shadow: none;
}

.nav-item-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-item-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-item-badge {
  background: var(--color-primary-100);
  color: var(--color-primary-700);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.nav-item.is-nested {
  padding-inline-start: 36px;
  font-size: 12px;
}

.nav-item--admin {
  color: #B45309;
}

.nav-item--admin:hover {
  background: rgb(245 158 11 / 0.12);
  color: #92400E;
}

.nav-item--admin.is-active {
  background: rgb(245 158 11 / 0.18);
  color: #78350F;
  box-shadow: none;
}

.sidebar-divider--main-nav {
  margin: var(--space-2) var(--space-4) var(--space-1);
  background: var(--border-light);
}

.sidebar-divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-2) var(--space-3);
}

.sidebar-footer {
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.sidebar-user:hover {
  background: var(--surface-hover);
}

.sidebar-user-info {
  flex: 1;
  overflow: hidden;
  min-width: 0;
}

.sidebar-user-name {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-email {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-layout.sidebar-collapsed .sidebar-user-info {
  display: none;
}

.sidebar-toggle {
  position: absolute;
  top: 16px;
  inset-inline-end: -12px;
  width: 24px;
  height: 24px;
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1;
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.sidebar-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
}

/* ============================================================================
   6. TOPBAR
   ============================================================================ */

.topbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.topbar-search-input {
  width: 100%;
  height: 36px;
  background: #F4F1EB;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 0 var(--space-3);
  padding-inline-start: 36px;
  padding-inline-end: 60px;
  font-size: 13px;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.topbar-search-input:hover {
  background: var(--cream);
  border-color: var(--border-light);
}

.topbar-search-input:focus {
  background: var(--surface-card);
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgb(196 149 106 / 0.18);
  outline: none;
}

.topbar-search-icon {
  position: absolute;
  inset-inline-start: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.topbar-search-shortcut {
  position: absolute;
  inset-inline-end: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-card);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  font-family: var(--font-mono);
  pointer-events: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin-inline-start: auto;
}

.topbar-create-wrap {
  position: relative;
  margin-inline-end: var(--space-1);
}

.topbar-create-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topbar-create-menu {
  position: absolute;
  top: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 200px;
  padding: var(--space-2);
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 220;
  flex-direction: column;
  gap: 2px;
}

/* Author `display` must not override the `hidden` attribute (default menu closed). */
.topbar-create-menu[hidden] {
  display: none !important;
}

.topbar-create-menu:not([hidden]) {
  display: flex;
}

.topbar-create-menu-item {
  display: block;
  width: 100%;
  text-align: start;
  padding: var(--space-2) var(--space-3);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.topbar-create-menu-item:hover {
  background: var(--surface-hover);
}

.topbar-action {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.topbar-action:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.topbar-lang-toggle {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  min-width: 36px;
}

.topbar-lang-toggle-label {
  line-height: 1;
}

.topbar-action-badge {
  position: absolute;
  top: 6px;
  inset-inline-end: 6px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--color-danger);
  color: white;
  font-size: 10px;
  font-weight: 600;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface-card);
}

.topbar-notif-wrap {
  position: relative;
}

.topbar-notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  width: min(360px, 92vw);
  max-height: min(420px, 70vh);
  overflow: auto;
  background: var(--surface-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  padding: var(--space-2);
}

.topbar-notif-empty {
  padding: var(--space-6);
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.topbar-notif-item {
  padding: var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.topbar-notif-item:hover {
  background: var(--surface-hover);
}

.topbar-notif-item.is-unread .topbar-notif-text {
  font-weight: 600;
}

.topbar-notif-item-main {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.topbar-notif-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary-500);
  flex-shrink: 0;
  margin-top: 5px;
  opacity: 0;
}

.topbar-notif-item.is-unread .topbar-notif-dot {
  opacity: 1;
}

.topbar-notif-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.4;
}

.topbar-notif-time {
  font-size: 11px;
  color: var(--text-muted);
  padding-inline-start: 16px;
}

.topbar-notif-markall {
  width: 100%;
  margin-top: var(--space-2);
}

.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border-light);
  margin: 0 var(--space-2);
}

.topbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: box-shadow var(--transition-fast);
  flex-shrink: 0;
}

.topbar-avatar:hover {
  box-shadow: 0 0 0 3px var(--color-primary-100);
}

.topbar-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition-fast);
}

.topbar-menu-btn:hover {
  background: var(--surface-hover, #F4F1EB);
}

/* ============================================================================
   7. RESPONSIVE — Mobile
   ============================================================================ */

@media (max-width: 768px) {
  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 56px 1fr;
    grid-template-areas:
      "topbar"
      "main";
  }

  .app-layout.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 200;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }

  .app-topbar {
    grid-column: 1;
    grid-row: 1;
  }

  .app-main {
    grid-column: 1;
    grid-row: 2;
    overflow-y: auto;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
  }

  .sidebar-overlay.is-visible {
    display: block;
  }

  .topbar-menu-btn {
    display: flex;
  }

  .topbar-search {
    display: none;
  }

  .sidebar-toggle {
    display: none;
  }
}

/* ============================================================================
   8. UTILITIES
   ============================================================================ */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

.hidden { display: none !important; }
.invisible { visibility: hidden; }

.w-full { width: 100%; }
.h-full { height: 100%; }

.rounded-full { border-radius: var(--radius-full); }
.rounded-md   { border-radius: var(--radius-md); }
.rounded-lg   { border-radius: var(--radius-lg); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.cursor-pointer { cursor: pointer; }

/* ============================================================================
   9. ANIMATIONS
   ============================================================================ */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fadeIn  { animation: fadeIn 200ms ease; }
.animate-slideUp { animation: slideUp 250ms ease; }
.animate-spin    { animation: spin 1s linear infinite; }
.animate-pulse   { animation: pulse 1.5s ease-in-out infinite; }

/* ============================================================================
   10. SCROLLBAR (custom)
   ============================================================================ */

.app-main::-webkit-scrollbar,
.scroll-area::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.app-main::-webkit-scrollbar-track,
.scroll-area::-webkit-scrollbar-track {
  background: transparent;
}

.app-main::-webkit-scrollbar-thumb,
.scroll-area::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.app-main::-webkit-scrollbar-thumb:hover,
.scroll-area::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-400);
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* ============================================================================
   11. RTL ADJUSTMENTS
   ============================================================================ */

[dir="rtl"] body {
  letter-spacing: 0;
}

/* أرقام لاتينية في contexts معينة (تواريخ، أرقام) */
.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

/* ============================================================================
   12. ROUTE LOADING / ERROR STATES
   ============================================================================ */

.route-error {
  padding: var(--space-12);
  text-align: center;
  color: var(--text-secondary);
}

.route-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
}

/* Top-of-screen navigation progress (router) */
#route-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 10050;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#route-progress.route-progress--active {
  opacity: 1;
}

#route-progress.route-progress--out {
  opacity: 0;
}

.route-progress-bar {
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, #C4956A, #D4A87A, #C4956A);
  border-radius: 0 2px 2px 0;
  animation: routeProgressSweep 0.85s ease-in-out infinite;
}

html[dir="rtl"] .route-progress-bar {
  margin-inline-start: auto;
  animation-name: routeProgressSweepRtl;
}

@keyframes routeProgressSweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

@keyframes routeProgressSweepRtl {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-400%); }
}
