/* ═══════════════════════════════════════════════════════════════════════
   GADRI ACADEMY v2.0 — DESIGN SYSTEM
   Built following Gadri Brand Guidelines Vol. 01 | 2024
   ═══════════════════════════════════════════════════════════════════════ */
:root {
  /* Brand Primary */
  --gadri-blue: #2565ED;
  --gadri-blue-dark: #1B4FC2;
  --gadri-blue-deep: #133A93;
  --gadri-blue-soft: #E8EFFC;
  --gadri-blue-subtle: #F4F7FE;

  /* Brand Cream */
  --gadri-cream: #F9F6EE;
  --gadri-cream-warm: #F3EEDF;
  --gadri-cream-soft: #FBF9F3;

  /* Brand Accents */
  --gadri-green: #46A568;
  --gadri-green-soft: #E4F2EA;
  --gadri-pink: #F6AECE;
  --gadri-pink-soft: #FDEEF5;
  --gadri-orange: #F36D4D;
  --gadri-orange-soft: #FDE6DF;

  /* Status colors */
  --status-red: #DC2626;
  --status-red-soft: #FEE2E2;
  --status-amber: #D97706;
  --status-amber-soft: #FEF3C7;
  --status-indigo: #4F46E5;
  --status-indigo-soft: #E0E7FF;

  /* Ink scale */
  --ink-black: #0A1628;
  --ink-900: #0F1F3D;
  --ink-800: #1E2E4F;
  --ink-700: #334967;
  --ink-600: #4A6182;
  --ink-500: #6B819E;
  --ink-400: #98A8BE;
  --ink-300: #C4CDD9;
  --ink-200: #E3E8EF;
  --ink-100: #EFF3F8;
  --ink-50: #F6F9FC;
  --white: #FFFFFF;

  --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04), 0 2px 6px rgba(15,23,42,0.06);
  --shadow-md: 0 4px 8px rgba(15,23,42,0.05), 0 8px 20px rgba(15,23,42,0.08);
  --shadow-lg: 0 8px 16px rgba(15,23,42,0.07), 0 16px 40px rgba(15,23,42,0.12);
  --shadow-xl: 0 16px 32px rgba(15,23,42,0.10), 0 32px 64px rgba(15,23,42,0.16);

  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --r-2xl: 32px;

  --font-main: 'Cairo', sans-serif;
  --trans-fast: 0.15s ease;
  --trans-base: 0.25s ease;
  --trans-slow: 0.4s ease;
}

/* Dark Mode */
[data-theme="dark"] {
  --gadri-cream: #0B1220;
  --gadri-cream-warm: #17223C;
  --gadri-cream-soft: #111A2E;
  --gadri-blue: #4A85F5;
  --gadri-blue-dark: #6B9CFF;
  --gadri-blue-deep: #2565ED;
  --gadri-blue-soft: rgba(74,133,245,0.15);
  --gadri-blue-subtle: rgba(74,133,245,0.08);
  --gadri-green: #5BBF7F;
  --gadri-green-soft: rgba(91,191,127,0.15);
  --gadri-pink: #F6AECE;
  --gadri-pink-soft: rgba(246,174,206,0.15);
  --gadri-orange: #FF8666;
  --gadri-orange-soft: rgba(255,134,102,0.15);

  --status-red: #F87171;
  --status-red-soft: rgba(248,113,113,0.15);
  --status-amber: #FBBF24;
  --status-amber-soft: rgba(251,191,36,0.15);
  --status-indigo: #818CF8;
  --status-indigo-soft: rgba(129,140,248,0.15);

  --white: #17223C;
  /* 🎯 Ink scale محسّن للوضع الليلي — WCAG AA contrast */
  --ink-black: #FFFFFF;
  --ink-900: #FFFFFF;  /* 21:1 على #17223C */
  --ink-800: #F1F5FB;  /* 18:1 */
  --ink-700: #DCE3EE;  /* 13:1 */
  --ink-600: #B5C2D4;  /* 8:1 */
  --ink-500: #94A3B8;  /* 5.3:1 — متن ثانوي */
  --ink-400: #7B8BA3;  /* 4.5:1 — حد WCAG AA */
  --ink-300: #5A6B85;  /* للحدود والأيقونات */
  --ink-200: #3F4F6B;  /* للحدود الخفيفة */
  --ink-100: #2A3654;
  --ink-50: #1F2A45;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3), 0 2px 6px rgba(0,0,0,0.35);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.4), 0 8px 20px rgba(0,0,0,0.45);
  --shadow-lg: 0 8px 16px rgba(0,0,0,0.45), 0 16px 40px rgba(0,0,0,0.55);
  --shadow-xl: 0 16px 32px rgba(0,0,0,0.5), 0 32px 64px rgba(0,0,0,0.65);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-main);
  background: var(--gadri-cream);
  color: var(--ink-900);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background var(--trans-base), color var(--trans-base);
}

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

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--sb-track, rgba(15,23,42,0.04)); }
::-webkit-scrollbar-thumb { background: var(--sb-thumb, rgba(100,116,139,0.35)); border-radius: 999px; border: 2px solid var(--sb-border, rgba(248,250,252,0.9)); background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--sb-thumb-hover, rgba(100,116,139,0.55)); }

/* ═══════════════════════════════════════════════════════════════════════
   🎨 UI/UX Enhancements - Tooltips, Skeletons, Focus States
   ═══════════════════════════════════════════════════════════════════════ */

/* 💡 Professional Tooltips (replaces native title) */
[data-tooltip] {
  position: relative;
}
[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 30, 77, 0.95);
  color: white;
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(15, 30, 77, 0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 9999;
}
[data-tooltip]:hover::after,
[data-tooltip]:focus::after,
[data-tooltip]:hover::before,
[data-tooltip]:focus::before {
  opacity: 1;
  transform: translateX(-50%) translateY(-2px);
}

/* 🎯 Improved Focus States (accessibility) */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gadri-blue, #1E4FCB);
  outline-offset: 2px;
  border-radius: 4px;
}

/* 📦 Skeleton Loading State (modern) */
.skeleton-loader {
  background: linear-gradient(90deg, 
    var(--ink-100, #f0f0f0) 25%, 
    var(--ink-50, #fafafa) 50%, 
    var(--ink-100, #f0f0f0) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: 8px;
}
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 100%;
}
.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }
.skeleton-circle {
  border-radius: 50%;
  width: 40px;
  height: 40px;
}
.skeleton-card {
  height: 120px;
  margin-bottom: 12px;
}

/* ═══════════════════════════════════════════════════════════════════════
   🌙 SMART DARK MODE - Auto-detect + Manual override
   ═══════════════════════════════════════════════════════════════════════ */
/* المنطق:
   1. لو data-theme="dark" → دارك دائماً
   2. لو data-theme="light" → فاتح دائماً
   3. لو data-theme="auto" أو غير محدّد → حسب نظام المستخدم
*/
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"],
  html:not([data-theme]) {
    /* Trigger dark variables automatically */
  }
}

/* Auto dark transitions */
html { transition: background-color 0.3s ease, color 0.3s ease; }
body { transition: background-color 0.3s ease, color 0.3s ease; }

/* ═══════════════════════════════════════════════════════════════════════
   📱 MOBILE UX ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════════════ */

/* Touch-friendly targets (Apple/Google guidelines: min 44x44px) */
@media (max-width: 768px) {
  button, .btn, a.btn, .nav-link, .icon-btn, [role="button"] {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Smaller buttons get padding boost */
  .btn-sm, .btn.btn-sm {
    min-height: 40px;
    padding: 10px 16px;
  }
  
  /* Inputs: easier to tap */
  input, select, textarea {
    min-height: 44px;
    font-size: 16px; /* prevents iOS zoom on focus */
  }
  
  /* Modals: full screen on mobile */
  .modal {
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    margin: 8px;
    max-height: 95vh;
  }
  
  /* Better spacing on small screens */
  .card { padding: 16px !important; }
  .stat-card { padding: 14px !important; }
  
  /* Grid adjustments */
  .grid-4 { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .grid-3 { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .grid-5 { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  
  /* Tables: horizontal scroll */
  table { font-size: 12px; }
  .data-grid-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  
  /* Hide complex elements on mobile */
  .hide-mobile { display: none !important; }
}

/* Very small screens (phones) */
@media (max-width: 480px) {
  .grid-4, .grid-3, .grid-5 { 
    grid-template-columns: 1fr !important; 
  }
  
  /* Course cards: smaller */
  .course-card { font-size: 12px; }
  .course-card .course-thumb { height: 100px; }
  
  /* Page header: smaller */
  .page-header h1 { font-size: 18px !important; }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
}

/* ⚡ Mobile: better tap feedback */
@media (hover: none) {
  /* Touch device - replace hover with active */
  .card:hover { transform: none !important; }
  .btn:hover { transform: none !important; }
  
  /* Add active feedback instead */
  .card:active, .btn:active {
    opacity: 0.85;
    transition: opacity 0.1s;
  }
}

/* 🍔 Mobile-friendly safe area (notch support) */
@supports (padding: max(0px)) {
  body {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   📦 SKELETON LOADERS - متقدّمة
   ═══════════════════════════════════════════════════════════════════════ */

/* Variant: Card skeleton */
.skeleton-course-card {
  background: var(--white, #fff);
  border: 1px solid var(--ink-200, #e2e8f0);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}
.skeleton-course-card .skeleton-thumb {
  height: 160px;
  background: linear-gradient(90deg, #f0f0f0 25%, #fafafa 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
}
.skeleton-course-card .skeleton-body {
  padding: 16px;
}
.skeleton-course-card .skeleton-line {
  height: 12px;
  background: linear-gradient(90deg, #f0f0f0 25%, #fafafa 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: 6px;
  margin-bottom: 8px;
}
.skeleton-course-card .skeleton-line.title { height: 18px; width: 80%; }
.skeleton-course-card .skeleton-line.subtitle { width: 60%; }
.skeleton-course-card .skeleton-line.short { width: 40%; }

/* Variant: Row skeleton (لـ tables) */
.skeleton-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--ink-100, #f0f0f0);
}
.skeleton-row .skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(90deg, #f0f0f0 25%, #fafafa 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  flex-shrink: 0;
}
.skeleton-row .skeleton-content {
  flex: 1;
}

/* Variant: Stat card skeleton */
.skeleton-stat {
  padding: 18px;
  background: var(--white, #fff);
  border-radius: 12px;
  border: 1px solid var(--ink-200, #e2e8f0);
}
.skeleton-stat .skeleton-label {
  height: 12px;
  width: 60%;
  margin-bottom: 12px;
  background: linear-gradient(90deg, #f0f0f0 25%, #fafafa 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: 4px;
}
.skeleton-stat .skeleton-value {
  height: 28px;
  width: 50%;
  background: linear-gradient(90deg, #f0f0f0 25%, #fafafa 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: 6px;
}

/* Dark mode skeleton */
[data-theme="dark"] .skeleton-loader,
[data-theme="dark"] .skeleton-line,
[data-theme="dark"] .skeleton-thumb,
[data-theme="dark"] .skeleton-avatar,
[data-theme="dark"] .skeleton-label,
[data-theme="dark"] .skeleton-value {
  background: linear-gradient(90deg, #2a3441 25%, #3a4451 50%, #2a3441 75%);
  background-size: 200% 100%;
}

/* 🔘 Button hover/active states improvement */
.btn {
  position: relative;
  overflow: hidden;
}
.btn:active {
  transform: translateY(1px);
}

/* Ripple effect on click */
.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
  pointer-events: none;
}
.btn:active::after {
  width: 300px;
  height: 300px;
  transition: width 0s, height 0s;
}

/* 🎯 Smooth page transitions */
.page-content {
  animation: pageContentIn 0.3s ease;
}
@keyframes pageContentIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 📋 Better scroll behavior */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   SHARED COMPONENTS
   ═══════════════════════════════════════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: -0.005em;
}
.badge-blue { background: var(--gadri-blue-soft); color: var(--gadri-blue-dark); }
.badge-green { background: var(--gadri-green-soft); color: #138446; }
.badge-pink { background: var(--gadri-pink-soft); color: #B5478B; }
.badge-orange { background: var(--gadri-orange-soft); color: #C2400A; }
.badge-red { background: var(--status-red-soft); color: var(--status-red); }
.badge-amber { background: var(--status-amber-soft); color: var(--status-amber); }
.badge-indigo { background: #EEF2FF; color: #4338CA; }
.badge-gray { background: rgba(15,23,42,0.06); color: var(--ink-600); }
[data-theme="dark"] .badge-blue { color: #8FB4FF; }
[data-theme="dark"] .badge-green { color: #5BBF7F; }
[data-theme="dark"] .badge-pink { color: #F6AECE; }
[data-theme="dark"] .badge-orange { color: #FF8666; }
[data-theme="dark"] .badge-red { color: #F87171; }
[data-theme="dark"] .badge-amber { color: #FBBF24; }
[data-theme="dark"] .badge-indigo { color: #A5B4FC; }
[data-theme="dark"] .badge-gray { background: rgba(255,255,255,0.08); color: #B5C2D4; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 7px;
  border: none;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease, box-shadow 150ms ease, transform 100ms ease;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--gadri-blue);
  color: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 1px 3px rgba(15,23,42,0.06);
}
.btn-primary:hover { 
  background: var(--gadri-blue-dark); 
  box-shadow: 0 1px 2px rgba(15,23,42,0.06), 0 2px 8px rgba(37,101,237,0.18);
}
.btn-secondary {
  background: var(--white);
  color: var(--ink-800);
  border: 0.5px solid rgba(15,23,42,0.1);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .btn-secondary {
  border-color: rgba(255,255,255,0.1);
}
.btn-secondary:hover { 
  background: rgba(15,23,42,0.025); 
  border-color: rgba(15,23,42,0.15);
}
[data-theme="dark"] .btn-secondary:hover { 
  background: rgba(255,255,255,0.04); 
  border-color: rgba(255,255,255,0.15);
}
.btn-ghost { 
  background: transparent; 
  color: var(--ink-600);
}
.btn-ghost:hover { 
  background: rgba(15,23,42,0.04); 
  color: var(--ink-900);
}
[data-theme="dark"] .btn-ghost:hover { 
  background: rgba(255,255,255,0.05);
}
.btn-danger { background: var(--status-red); color: #fff; }
.btn-danger:hover { background: #B91C1C; }
.btn-success { background: var(--gadri-green); color: #fff; }
.btn-success:hover { filter: brightness(0.95); }
.btn-sm { padding: 5px 10px; font-size: 12px; gap: 4px; }
.btn-icon { padding: 7px; width: 32px; height: 32px; }

.icon { width: 16px; height: 16px; flex-shrink: 0; stroke-width: 2; }
.icon-sm { width: 13px; height: 13px; }
.icon-lg { width: 20px; height: 20px; }
.icon-xl { width: 26px; height: 26px; }

/* Language Switcher */
.lang-switcher {
  display: inline-flex;
  background: var(--gadri-cream-warm);
  border: 1px solid var(--ink-200);
  border-radius: 100px;
  padding: 4px;
}
.lang-switcher button {
  background: transparent;
  border: none;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 100px;
  color: var(--ink-600);
  transition: all var(--trans-base);
}
.lang-switcher button.active {
  background: var(--gadri-blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,101,237,0.3);
}

/* Theme Toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gadri-cream-warm);
  border: 1px solid var(--ink-200);
  cursor: pointer;
  color: var(--ink-700);
  transition: all var(--trans-base);
}
.theme-toggle:hover {
  background: var(--gadri-blue);
  color: #fff;
  border-color: var(--gadri-blue);
  transform: scale(1.05);
}
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ═══════════════════════════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════════════════════════ */
.login-wrap {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 100vh;
  background: var(--gadri-cream);
}
html[dir="ltr"] .login-wrap { grid-template-columns: 1fr 1.1fr; }

.login-art {
  background: linear-gradient(135deg, var(--gadri-blue) 0%, var(--gadri-blue-deep) 100%);
  color: #fff;
  padding: 60px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
[data-theme="dark"] .login-art {
  background: linear-gradient(135deg, #0B1220 0%, #1B4FC2 100%);
}
.login-art::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.08) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
}
.login-art-inner { position: relative; z-index: 2; }

.art-kicker {
  font-size: 11px;
  letter-spacing: 3px;
  font-weight: 600;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 40px;
}

.art-title {
  font-size: 60px;
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 16px;
  letter-spacing: -1.5px;
}
.art-title .accent {
  color: var(--gadri-cream);
  opacity: 0.92;
  display: block;
  font-style: italic;
  font-weight: 400;
  font-size: 0.7em;
  margin-top: 8px;
}

.art-divider {
  width: 60px;
  height: 2px;
  background: var(--gadri-cream);
  margin: 32px 0;
  opacity: 0.6;
}

.art-sub {
  font-size: 16px;
  line-height: 1.8;
  opacity: 0.92;
  max-width: 480px;
  margin-bottom: 40px;
}

.art-stats {
  display: flex;
  gap: 48px;
  margin-top: auto;
  padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.art-stat-num { font-size: 40px; font-weight: 800; line-height: 1; margin-bottom: 8px; }
.art-stat-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; opacity: 0.7; font-weight: 600; }

.art-footer {
  position: relative;
  z-index: 2;
  padding-top: 24px;
  font-size: 12px;
  opacity: 0.6;
  letter-spacing: 1px;
}

.login-form-side {
  display: flex;
  flex-direction: column;
  padding: 40px 60px;
  background: var(--gadri-cream);
  overflow-y: auto;
}

.login-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
}

.brand-emblem {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-emblem-mark {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gadri-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(37,101,237,0.3);
}
/* When emblem contains the SVG logo, use transparent white background */
.brand-emblem-mark.brand-emblem-logo {
  background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
  padding: 4px;
  box-shadow: 0 4px 14px rgba(37,101,237,0.25), 0 0 0 2px rgba(251, 191, 36, 0.3);
}
[data-theme="dark"] .brand-emblem-mark.brand-emblem-logo {
  background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(241,245,249,0.9) 100%);
  box-shadow: 0 4px 14px rgba(37,101,237,0.4), 0 0 0 2px rgba(251, 191, 36, 0.35);
}
.brand-emblem-mark.brand-emblem-logo svg,
.brand-emblem-mark.brand-emblem-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 5px;
}
.brand-emblem-text .brand-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--ink-900);
  letter-spacing: -0.3px;
}
.brand-emblem-text .brand-tag {
  font-size: 11px;
  color: var(--ink-500);
  letter-spacing: 1px;
  font-weight: 600;
  text-transform: uppercase;
}

.login-form {
  max-width: 400px;
  width: 100%;
  margin: auto 0;
}

.login-form h1 {
  font-size: 36px;
  font-weight: 800;
  color: var(--ink-900);
  margin-bottom: 10px;
  letter-spacing: -1px;
}
.login-form h1 .accent { color: var(--gadri-blue); }

.login-form .subtitle {
  color: var(--ink-600);
  font-size: 15px;
  margin-bottom: 32px;
  line-height: 1.7;
}

.login-err {
  background: var(--status-red-soft);
  border: 1px solid var(--status-red);
  color: var(--status-red);
  padding: 12px 16px;
  border-radius: var(--r-md);
  margin-bottom: 20px;
  font-size: 13px;
  font-weight: 600;
  display: none;
}
.login-err.show { display: block; }

.field-group { margin-bottom: 18px; }
.field-group label {
  display: block;
  font-size: var(--text-sm, 13px); /* unified (Phase 2) — value unchanged */
  font-weight: 600;
  color: var(--ink-800);
  margin-bottom: 8px;
}
.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--ink-200);
  border-radius: var(--r-md);
  font-size: var(--text-base, 15px); /* unified (Phase 2): was 14px (+1px) */
  color: var(--ink-900);
  background: var(--white);
  transition: all var(--trans-base);
}
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  outline: none;
  border-color: var(--gadri-blue);
  box-shadow: 0 0 0 4px rgba(37,101,237,0.1);
}
[data-theme="dark"] .field-group input,
[data-theme="dark"] .field-group select,
[data-theme="dark"] .field-group textarea {
  background: var(--gadri-cream-soft);
}

/* Native date/time pickers follow dark theme (appearance only - no behavior change) */
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"] {
  color-scheme: dark;
}

/* Dark theme: native dropdown options stay readable */
[data-theme="dark"] select option {
  background: var(--gadri-cream-soft);
  color: var(--ink-900);
}

/* ===== Phase 1: modal form fields distinct & readable in dark theme (CSS only) ===== */
[data-theme="dark"] .modal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
[data-theme="dark"] .modal select,
[data-theme="dark"] .modal textarea {
  background: var(--gadri-cream-soft) !important;   /* distinct from modal panel (--white = #17223C) */
  border: 1px solid rgba(255,255,255,0.14) !important;
  color: var(--ink-900) !important;
}
[data-theme="dark"] .modal input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):focus,
[data-theme="dark"] .modal select:focus,
[data-theme="dark"] .modal textarea:focus {
  border-color: var(--gadri-blue) !important;
  box-shadow: 0 0 0 3px rgba(74,133,245,0.18) !important;
}
[data-theme="dark"] .modal input::placeholder,
[data-theme="dark"] .modal textarea::placeholder {
  color: var(--ink-500);
}

/* ===== Phase 1b: selection cards + broadcast page fields (dark only) ===== */
[data-theme="dark"] .choice-card {
  background: var(--gadri-cream-soft) !important;
  border: 1px solid rgba(255,255,255,0.14) !important;
}
[data-theme="dark"] .choice-card:hover {
  border-color: var(--gadri-blue) !important;
}
[data-theme="dark"] .choice-card:has(input:checked) {
  border-color: var(--gadri-blue) !important;
  box-shadow: 0 0 0 2px rgba(74,133,245,0.22) inset !important;
}
[data-theme="dark"] .bc-layout input:not([type="checkbox"]):not([type="radio"]),
[data-theme="dark"] .bc-layout textarea,
[data-theme="dark"] .bc-layout select {
  background: var(--gadri-cream-soft) !important;
  border-color: rgba(255,255,255,0.14) !important;
}
[data-theme="dark"] .bc-layout input:not([type="checkbox"]):not([type="radio"]):focus,
[data-theme="dark"] .bc-layout textarea:focus,
[data-theme="dark"] .bc-layout select:focus {
  border-color: var(--gadri-blue) !important;
  box-shadow: 0 0 0 3px rgba(74,133,245,0.18) !important;
}

/* ===== Phase 1c: circular composer remnants (dark only) ===== */
[data-theme="dark"] .modal input[type="checkbox"],
[data-theme="dark"] .modal input[type="radio"] {
  color-scheme: dark;
}
[data-theme="dark"] .dm-upload-box {
  background: var(--gadri-cream-soft) !important;
}
[data-theme="dark"] .modal input[type="file"] {
  color-scheme: dark;
  background: var(--gadri-cream-soft) !important;
  border-color: rgba(255,255,255,0.14) !important;
  color: var(--ink-700) !important;
}
[data-theme="dark"] .modal input[type="file"]::file-selector-button {
  background: var(--ink-100);
  color: var(--ink-900);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 6px;
  cursor: pointer;
  margin-inline-end: 8px;
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: var(--gadri-blue);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--trans-base);
  box-shadow: 0 4px 14px rgba(37,101,237,0.3);
  margin-top: 8px;
}
.login-btn:hover { background: var(--gadri-blue-dark); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(37,101,237,0.4); }

.login-divider {
  display: flex;
  align-items: center;
  margin: 28px 0;
  color: var(--ink-400);
  font-size: 11px;
  letter-spacing: 2px;
  font-weight: 600;
}
.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--ink-200);
}
.login-divider::before { margin-inline-end: 16px; }
.login-divider::after { margin-inline-start: 16px; }

.demo-creds {
  background: var(--gadri-cream-warm);
  border: 1px dashed var(--ink-300);
  border-radius: var(--r-md);
  padding: 14px;
  font-size: 12px;
}
.demo-creds h4 {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--ink-600);
  margin-bottom: 10px;
  text-transform: uppercase;
  font-weight: 700;
}
.demo-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--ink-200);
  color: var(--ink-700);
  font-weight: 500;
}
.demo-row:last-child { border: none; }
.demo-row code {
  background: var(--white);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  color: var(--gadri-blue);
  font-weight: 700;
  font-size: 11px;
}

.login-footer {
  margin-top: auto;
  padding-top: 24px;
  font-size: 12px;
  color: var(--ink-500);
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════════════════════════════════ */
.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  background: var(--gadri-cream);
}
html[dir="ltr"] .app-shell { grid-template-columns: 280px 1fr; }

/* Sidebar */
.sidebar {
  background: var(--gadri-cream);
  border-inline-end: 0.5px solid rgba(15,23,42,0.08);
  padding: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
[data-theme="dark"] .sidebar {
  background: var(--white);
  border-inline-end-color: rgba(255,255,255,0.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 0.5px solid rgba(15,23,42,0.06);
  flex-shrink: 0;
}
[data-theme="dark"] .sidebar-brand {
  border-bottom-color: rgba(255,255,255,0.06);
}
.sidebar-brand .brand-emblem-mark { 
  width: 32px; 
  height: 32px; 
  font-size: 13px;
  border-radius: 7px;
  flex-shrink: 0;
}
.sidebar-brand .brand-emblem-text {
  flex: 1;
  min-width: 0;
}
.sidebar-brand .brand-name { 
  font-size: 13.5px; 
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.sidebar-brand .brand-tag { 
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 1px;
  font-weight: 400;
}

.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 8px 12px;
}
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--ink-200); border-radius: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb:hover { background: var(--ink-300); }

.sidebar-section {
  margin-bottom: 14px;
}
.sidebar-section:last-child { margin-bottom: 0; }
.sidebar-section-title {
  padding: 6px 10px 4px;
  margin-bottom: 0;
  font-size: 10.5px;
  letter-spacing: -0.005em;
  color: var(--ink-400);
  text-transform: none;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--ink-600);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 1px;
  position: relative;
  border: none;
  background: transparent;
  width: 100%;
  text-align: inherit;
  letter-spacing: -0.005em;
  font-family: inherit;
}
.nav-item:hover {
  background: rgba(15,23,42,0.04);
  color: var(--ink-900);
}
[data-theme="dark"] .nav-item:hover {
  background: rgba(255,255,255,0.05);
}
.nav-item.active {
  background: rgba(37,101,237,0.08);
  color: var(--gadri-blue-dark);
  font-weight: 600;
  box-shadow: none;
}
[data-theme="dark"] .nav-item.active {
  background: rgba(74,133,245,0.15);
  color: #fff;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  inset-inline-start: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 14px;
  background: var(--gadri-blue);
  border-radius: 0 4px 4px 0;
}
html[dir="ltr"] .nav-item.active::before {
  border-radius: 4px 0 0 4px;
}
.nav-item .icon { 
  width: 15px; 
  height: 15px;
  flex-shrink: 0;
  opacity: 0.85;
}
.nav-item.active .icon { opacity: 1; }
.nav-item .ti {
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
}
.nav-item .nav-label { flex: 1; }
.nav-item .nav-badge {
  background: var(--ink-100);
  color: var(--ink-600);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 5px;
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}
.nav-item .nav-badge.urgent {
  background: var(--status-red-soft);
  color: var(--status-red);
}
.nav-item .nav-badge.warning {
  background: var(--status-amber-soft);
  color: var(--status-amber);
}
.nav-item.active .nav-badge {
  background: var(--gadri-blue);
  color: #fff;
}
.nav-item.active .nav-badge.urgent {
  background: var(--status-red);
  color: #fff;
}

/* ── Sidebar Quick Search Button — Modern inline style ─────────── */
.sidebar-search-btn {
  margin: 4px 0 8px;
  padding: 7px 10px !important;
  background: rgba(15,23,42,0.025) !important;
  border: 0.5px solid rgba(15,23,42,0.08) !important;
  color: var(--ink-500) !important;
  font-weight: 500 !important;
  border-radius: 7px !important;
  transition: all 150ms ease !important;
}
.sidebar-search-btn::before { display: none !important; }
[data-theme="dark"] .sidebar-search-btn {
  background: rgba(255,255,255,0.03) !important;
  border-color: rgba(255,255,255,0.08) !important;
}
.sidebar-search-btn:hover {
  background: var(--white) !important;
  border-color: rgba(37,101,237,0.25) !important;
  color: var(--ink-700) !important;
}
.sidebar-search-btn:hover .nav-label,
.sidebar-search-btn:hover .icon,
.sidebar-search-btn:hover .ti {
  color: var(--ink-700) !important;
}
.sidebar-search-kbd {
  margin-inline-start: auto;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  background: var(--white);
  color: var(--ink-500);
  border: 0.5px solid rgba(15,23,42,0.1);
  border-radius: 4px;
  font-family: 'SF Mono', ui-monospace, monospace;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
[data-theme="dark"] .sidebar-search-btn {
  border-color: rgba(255,255,255,0.18) !important;
}
[data-theme="dark"] .sidebar-search-btn:hover {
  border-color: var(--gadri-blue) !important;
  background: rgba(37,101,237,0.15) !important;
}
[data-theme="dark"] .sidebar-search-kbd {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.15);
}

.sidebar-footer {
  margin-top: 0;
  padding: 10px 8px;
  border-top: 0.5px solid rgba(15,23,42,0.06);
  flex-shrink: 0;
}
[data-theme="dark"] .sidebar-footer {
  border-top-color: rgba(255,255,255,0.06);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
  transition: background-color 120ms ease;
}
.sidebar-user:hover {
  background: rgba(15,23,42,0.04);
}
[data-theme="dark"] .sidebar-user:hover {
  background: rgba(255,255,255,0.05);
}
.sidebar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--gadri-blue-soft);
  color: var(--gadri-blue-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
[data-theme="dark"] .sidebar-user-avatar {
  background: rgba(74,133,245,0.18);
  color: #fff;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name { 
  font-size: 12.5px; 
  font-weight: 600; 
  color: var(--ink-900); 
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis;
  letter-spacing: -0.005em;
}
.sidebar-user-role { 
  font-size: 11px; 
  color: var(--ink-500); 
  font-weight: 400;
  margin-top: 1px;
}
.sidebar-user-action {
  color: var(--ink-400);
  display: flex;
  align-items: center;
  font-size: 14px;
  flex-shrink: 0;
}

/* Topbar */
/* ─── 💎 Premium Cream Topbar (light mode) ─── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  /* خلفيّة كريميّة زجاجيّة فاخرة */
  background: linear-gradient(180deg, 
    rgba(255, 255, 255, 0.92) 0%, 
    rgba(251, 247, 240, 0.88) 100%);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid rgba(15, 23, 42, 0.08);
  box-shadow: 
    0 1px 0 rgba(15, 23, 42, 0.02),
    0 4px 12px -4px rgba(30, 79, 203, 0.04);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar::after {
  content: '';
  position: absolute;
  bottom: -0.5px;
  inset-inline-start: 0;
  inset-inline-end: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(212, 175, 55, 0.0) 20%,
    rgba(212, 175, 55, 0.35) 50%,
    rgba(212, 175, 55, 0.0) 80%,
    transparent 100%);
  pointer-events: none;
}

/* Dark mode - زجاج معتم فاخر */
[data-theme="dark"] .topbar {
  background: linear-gradient(180deg, 
    rgba(23, 34, 60, 0.88) 0%, 
    rgba(11, 18, 32, 0.92) 100%);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 1px 0 rgba(255, 255, 255, 0.04),
    0 4px 16px -4px rgba(0, 0, 0, 0.3);
}
[data-theme="dark"] .topbar::after {
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(212, 175, 55, 0.0) 20%,
    rgba(212, 175, 55, 0.5) 50%,
    rgba(212, 175, 55, 0.0) 80%,
    transparent 100%);
}

/* ─── 💎 Topbar Status Pills ─── */
.topbar-status-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.topbar-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all 200ms ease;
  letter-spacing: -0.005em;
}

/* Date pill - light mode */
.topbar-status-pill-date {
  background: rgba(30, 79, 203, 0.06);
  border: 0.5px solid rgba(30, 79, 203, 0.12);
  color: #1E4FCB;
}
.topbar-status-pill-date i {
  color: #1E4FCB;
  opacity: 0.85;
}
.topbar-status-pill-date:hover {
  background: rgba(30, 79, 203, 0.1);
  border-color: rgba(30, 79, 203, 0.2);
}

/* Date pill - dark mode */
[data-theme="dark"] .topbar-status-pill-date {
  background: rgba(96, 165, 250, 0.1);
  border-color: rgba(96, 165, 250, 0.18);
  color: #93C5FD;
}
[data-theme="dark"] .topbar-status-pill-date i {
  color: #93C5FD;
}
[data-theme="dark"] .topbar-status-pill-date:hover {
  background: rgba(96, 165, 250, 0.15);
  border-color: rgba(96, 165, 250, 0.3);
}

/* Online pill - light mode */
.topbar-status-pill-online {
  background: rgba(16, 185, 129, 0.08);
  border: 0.5px solid rgba(16, 185, 129, 0.18);
  color: #059669;
}

/* Online pill - dark mode */
[data-theme="dark"] .topbar-status-pill-online {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.2);
  color: #6EE7B7;
}

/* Status dot with pulse */
.topbar-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
  display: inline-block;
  position: relative;
}
[data-theme="dark"] .topbar-status-dot {
  background: #34D399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18);
}
.topbar-status-dot::before {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: inherit;
  opacity: 0.5;
  animation: topbar-dot-pulse 2.4s ease-in-out infinite;
}
@keyframes topbar-dot-pulse {
  0%, 100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.6); opacity: 0; }
}
.topbar-title h1 {
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.015em;
  line-height: 1.3;
}
.topbar-title p {
  font-size: 12px;
  color: var(--ink-500);
  font-weight: 400;
  margin-top: 1px;
  letter-spacing: -0.005em;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Notifications */
.notif-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gadri-cream-warm);
  border: 1px solid var(--ink-200);
  color: var(--ink-700);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--trans-base);
}
.notif-btn:hover { background: var(--gadri-blue); color: #fff; border-color: var(--gadri-blue); }
.notif-badge {
  position: absolute;
  top: -2px;
  inset-inline-end: -2px;
  background: var(--status-red);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 100px;
  min-width: 16px;
  text-align: center;
  border: 2px solid var(--white);
}

.notif-panel {
  position: absolute;
  top: calc(100% + 10px);
  inset-inline-end: 0;
  width: 380px;
  max-height: 500px;
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  display: none;
  flex-direction: column;
  z-index: 50;
  overflow: hidden;
}
.notif-panel.open { display: flex; }
.notif-panel-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--ink-200);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.notif-panel-head h4 { font-size: 15px; font-weight: 800; color: var(--ink-900); }
.notif-panel-body { flex: 1; overflow-y: auto; }
.notif-item {
  display: flex;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--ink-100);
  cursor: pointer;
  transition: background var(--trans-base);
}
.notif-item:hover { background: var(--gadri-cream-warm); }
.notif-item.unread { background: var(--gadri-blue-subtle); }
.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--gadri-blue-soft);
  color: var(--gadri-blue);
}
.notif-text { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 700; color: var(--ink-900); margin-bottom: 2px; }
.notif-desc { font-size: 12px; color: var(--ink-600); line-height: 1.5; }
.notif-time { font-size: 10px; color: var(--ink-400); margin-top: 4px; letter-spacing: 0.5px; }

/* User Chip */
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  background: var(--gadri-cream-warm);
  border: 0.5px solid rgba(15, 23, 42, 0.08);
  border-radius: 100px;
  transition: all 200ms ease;
}
.user-chip:hover {
  background: var(--gadri-cream);
  border-color: rgba(30, 79, 203, 0.18);
  box-shadow: 0 2px 8px rgba(30, 79, 203, 0.08);
}
[data-theme="dark"] .user-chip {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .user-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(96, 165, 250, 0.25);
  box-shadow: 0 2px 8px rgba(96, 165, 250, 0.12);
}
html[dir="ltr"] .user-chip { padding: 6px 6px 6px 14px; }
.user-chip-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E4FCB, #0F1E4D);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 2px 6px rgba(30, 79, 203, 0.25);
}
[data-theme="dark"] .user-chip-avatar {
  background: linear-gradient(135deg, #3B82F6, #1E40AF);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}
.user-chip-info { display: flex; flex-direction: column; line-height: 1.2; gap: 2px; }
.user-chip-greeting {
  font-size: 10px;
  color: var(--ink-500);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  letter-spacing: -0.005em;
}
[data-theme="dark"] .user-chip-greeting {
  color: rgba(255, 255, 255, 0.5);
}
.user-chip-name { font-size: 13px; font-weight: 700; color: var(--ink-900); letter-spacing: -0.005em; }
.user-chip-role { font-size: 10px; color: var(--ink-500); font-weight: 600; letter-spacing: 0.5px; }

.btn-logout {
  padding: 7px 14px;
  background: transparent;
  border: 1px solid var(--ink-200);
  color: var(--ink-700);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans-base);
}
.btn-logout:hover { background: var(--status-red); color: #fff; border-color: var(--status-red); }

/* Content Area */
.app-shell > main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  min-width: 0;
}
.app-shell > main > .topbar { flex: none; }
.content-area {
  padding: 32px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.page-section { display: none; animation: fadeUp 0.3s ease; }
.page-section.active { display: block; }

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

/* ═══════════════════════════════════════════════════════════════════════
   CARDS, GRID, TABLES
   ═══════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--white);
  border-radius: 12px;
  border: 0.5px solid rgba(15,23,42,0.08);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 150ms ease, border-color 150ms ease;
}
[data-theme="dark"] .card {
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.card-compact { padding: 12px 14px; }
.card:hover { 
  box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 2px 6px rgba(15,23,42,0.04);
}
[data-theme="dark"] .card:hover {
  box-shadow: 0 1px 2px rgba(0,0,0,0.2), 0 2px 8px rgba(0,0,0,0.3);
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 0.5px solid rgba(15,23,42,0.06);
}
[data-theme="dark"] .card-head {
  border-bottom-color: rgba(255,255,255,0.06);
}
.card-head h3 {
  font-size: var(--text-md, 16px); /* unified: was 14px (Phase 1) */
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.3;
}
.card-head .card-subtitle {
  font-size: 11.5px;
  color: var(--ink-500);
  margin-top: 2px;
  font-weight: 400;
  letter-spacing: -0.005em;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-5 { grid-template-columns: repeat(2, 1fr); } }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
@media (max-width: 1100px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 700px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.flex-row { display: flex; align-items: center; gap: 12px; }
.flex-col { display: flex; flex-direction: column; gap: 12px; }
.flex-spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.flex-wrap { display: flex; flex-wrap: wrap; gap: 10px; }

/* Hero Banner */
.hero {
  background: linear-gradient(135deg, var(--gadri-cream-warm) 0%, var(--gadri-cream) 100%);
  border: 0.5px solid rgba(15,23,42,0.06);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, var(--gadri-cream-warm) 0%, var(--gadri-cream-soft) 100%);
  border-color: rgba(255,255,255,0.06);
}
.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  inset-inline-end: -10%;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, var(--gadri-blue-soft) 0%, transparent 70%);
  opacity: 0.45;
  pointer-events: none;
}
.hero-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}
.hero-sub {
  font-size: 13px;
  color: var(--ink-500);
  line-height: 1.6;
  max-width: 600px;
  font-weight: 400;
  position: relative;
  z-index: 1;
}

/* KPI Cards — Modern enterprise style */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .kpi-grid { grid-template-columns: 1fr; } }

.kpi-card {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--white);
  border: 0.5px solid rgba(15,23,42,0.08);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
  cursor: pointer;
}
[data-theme="dark"] .kpi-card {
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.kpi-card:hover { 
  transform: translateY(-1px);
  border-color: rgba(37,101,237,0.3);
  box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 2px 6px rgba(37,101,237,0.06);
}
[data-theme="dark"] .kpi-card:hover {
  border-color: rgba(74,133,245,0.4);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* 🎨 شريط ضوء علويّ رفيع جداً بلون البطاقة (لمسة فنيّة) */
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  inset-inline-end: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gadri-blue) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 200ms ease;
  display: block;
  pointer-events: none;
}
.kpi-card:hover::before { opacity: 0.7; }
.kpi-card.green::before  { background: linear-gradient(90deg, transparent 0%, #138446 50%, transparent 100%); }
.kpi-card.pink::before   { background: linear-gradient(90deg, transparent 0%, #B5478B 50%, transparent 100%); }
.kpi-card.orange::before { background: linear-gradient(90deg, transparent 0%, #C2400A 50%, transparent 100%); }
.kpi-card.red::before    { background: linear-gradient(90deg, transparent 0%, var(--status-red) 50%, transparent 100%); }
.kpi-card.indigo::before { background: linear-gradient(90deg, transparent 0%, #4338CA 50%, transparent 100%); }
.kpi-card.amber::before  { background: linear-gradient(90deg, transparent 0%, #D97706 50%, transparent 100%); }
.kpi-card.purple::before { background: linear-gradient(90deg, transparent 0%, #7C3AED 50%, transparent 100%); }

[data-theme="dark"] .kpi-card::before {
  background: linear-gradient(90deg, transparent 0%, #60A5FA 50%, transparent 100%);
}
[data-theme="dark"] .kpi-card.green::before  { background: linear-gradient(90deg, transparent 0%, #5BBF7F 50%, transparent 100%); }
[data-theme="dark"] .kpi-card.pink::before   { background: linear-gradient(90deg, transparent 0%, #F6AECE 50%, transparent 100%); }
[data-theme="dark"] .kpi-card.orange::before { background: linear-gradient(90deg, transparent 0%, #FF8666 50%, transparent 100%); }
[data-theme="dark"] .kpi-card.red::before    { background: linear-gradient(90deg, transparent 0%, #F87171 50%, transparent 100%); }
[data-theme="dark"] .kpi-card.indigo::before { background: linear-gradient(90deg, transparent 0%, #818CF8 50%, transparent 100%); }
[data-theme="dark"] .kpi-card.amber::before  { background: linear-gradient(90deg, transparent 0%, #FBBF24 50%, transparent 100%); }
[data-theme="dark"] .kpi-card.purple::before { background: linear-gradient(90deg, transparent 0%, #C4B5FD 50%, transparent 100%); }

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.kpi-icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gadri-blue-soft);
  color: var(--gadri-blue-dark);
  flex-shrink: 0;
}
.kpi-icon svg { width: 14px; height: 14px; }
[data-theme="dark"] .kpi-icon {
  background: rgba(74,133,245,0.15);
  color: #fff;
}
.kpi-card.green .kpi-icon { background: var(--gadri-green-soft); color: #138446; }
.kpi-card.pink .kpi-icon { background: var(--gadri-pink-soft); color: #B5478B; }
.kpi-card.orange .kpi-icon { background: var(--gadri-orange-soft); color: #C2400A; }
.kpi-card.red .kpi-icon { background: var(--status-red-soft); color: var(--status-red); }
.kpi-card.indigo .kpi-icon { background: #EEF2FF; color: #4338CA; }
.kpi-card.amber .kpi-icon { background: var(--status-amber-soft); color: var(--status-amber); }
[data-theme="dark"] .kpi-card.green .kpi-icon { background: rgba(91,191,127,0.15); color: #5BBF7F; }
[data-theme="dark"] .kpi-card.pink .kpi-icon { background: rgba(246,174,206,0.15); color: #F6AECE; }
[data-theme="dark"] .kpi-card.orange .kpi-icon { background: rgba(255,134,102,0.15); color: #FF8666; }
[data-theme="dark"] .kpi-card.red .kpi-icon { background: rgba(248,113,113,0.15); color: #F87171; }
[data-theme="dark"] .kpi-card.amber .kpi-icon { background: rgba(251,191,36,0.15); color: #FBBF24; }

.kpi-trend {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 5px;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.kpi-trend.up { background: var(--gadri-green-soft); color: #138446; }
.kpi-trend.down { background: var(--status-red-soft); color: var(--status-red); }
[data-theme="dark"] .kpi-trend.up { color: #5BBF7F; }
[data-theme="dark"] .kpi-trend.down { color: #F87171; }
/* عند 0% أو trend ثابت — أخفِه (لا قيمة معلوماتيّة) */
.kpi-trend:empty,
.kpi-trend[data-flat="true"] { display: none; }
/* 🎯 أخفِ الـ trend الذي ليس .up ولا .down (يعني 0%/—) */
.kpi-trend:not(.up):not(.down) { display: none; }

.kpi-label {
  font-size: 11.5px;
  letter-spacing: -0.005em;
  color: var(--ink-500);
  text-transform: none;
  font-weight: 500;
  margin-bottom: 4px;
}
[data-theme="dark"] .kpi-label { 
  color: #B5C2D4;
  font-weight: 500;
}

.kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  /* لمسة فنيّة: gradient خفيف من اللون الأساسيّ للأسود */
  background: linear-gradient(135deg, var(--gadri-blue) 0%, var(--ink-900) 60%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
[data-theme="dark"] .kpi-value {
  background: linear-gradient(135deg, #93C5FD 0%, #FFFFFF 60%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 🎨 لمسات لونيّة لكلّ نوع بطاقة - kpi-value */
.kpi-card.green .kpi-value {
  background: linear-gradient(135deg, #138446 0%, var(--ink-900) 65%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.kpi-card.pink .kpi-value {
  background: linear-gradient(135deg, #B5478B 0%, var(--ink-900) 65%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.kpi-card.orange .kpi-value {
  background: linear-gradient(135deg, #C2400A 0%, var(--ink-900) 65%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.kpi-card.red .kpi-value {
  background: linear-gradient(135deg, var(--status-red) 0%, var(--ink-900) 65%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.kpi-card.indigo .kpi-value {
  background: linear-gradient(135deg, #4338CA 0%, var(--ink-900) 65%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.kpi-card.amber .kpi-value {
  background: linear-gradient(135deg, #D97706 0%, var(--ink-900) 65%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.kpi-card.purple .kpi-value {
  background: linear-gradient(135deg, #7C3AED 0%, var(--ink-900) 65%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* 🌙 Dark Mode - tints أفتح */
[data-theme="dark"] .kpi-card.green .kpi-value {
  background: linear-gradient(135deg, #5BBF7F 0%, #FFFFFF 65%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .kpi-card.pink .kpi-value {
  background: linear-gradient(135deg, #F6AECE 0%, #FFFFFF 65%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .kpi-card.orange .kpi-value {
  background: linear-gradient(135deg, #FF8666 0%, #FFFFFF 65%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .kpi-card.red .kpi-value {
  background: linear-gradient(135deg, #F87171 0%, #FFFFFF 65%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .kpi-card.indigo .kpi-value {
  background: linear-gradient(135deg, #818CF8 0%, #FFFFFF 65%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .kpi-card.amber .kpi-value {
  background: linear-gradient(135deg, #FBBF24 0%, #FFFFFF 65%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .kpi-card.purple .kpi-value {
  background: linear-gradient(135deg, #C4B5FD 0%, #FFFFFF 65%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.kpi-desc { 
  font-size: 11px; 
  color: var(--ink-500); 
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
  letter-spacing: -0.005em;
}
[data-theme="dark"] .kpi-desc {
  color: #94A3B8;
}
.kpi-desc::before {
  content: '';
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gadri-blue);
  display: inline-block;
  flex-shrink: 0;
}
.kpi-card.green .kpi-desc::before { background: #138446; }
.kpi-card.pink .kpi-desc::before { background: #B5478B; }
.kpi-card.orange .kpi-desc::before { background: #C2400A; }
.kpi-card.red .kpi-desc::before { background: var(--status-red); }
.kpi-card.indigo .kpi-desc::before { background: #4338CA; }
.kpi-card.amber .kpi-desc::before { background: var(--status-amber); }

/* السهم الصغير — إن وُجد */
.kpi-arrow {
  position: absolute;
  bottom: 12px;
  inset-inline-end: 12px;
  font-size: 14px;
  color: var(--ink-300);
  opacity: 0;
  transition: opacity 150ms ease, transform 150ms ease;
}
.kpi-card:hover .kpi-arrow {
  opacity: 1;
  transform: translateX(2px);
}
html[dir="rtl"] .kpi-card:hover .kpi-arrow {
  transform: translateX(-2px);
}

/* Tables */
.table-wrap {
  background: var(--white);
  border-radius: 10px;
  border: 0.5px solid rgba(15,23,42,0.08);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .table-wrap {
  border-color: rgba(255,255,255,0.08);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
table thead { background: rgba(15,23,42,0.025); }
[data-theme="dark"] table thead { background: rgba(255,255,255,0.04); }
table th {
  padding: 9px 14px;
  text-align: inherit;
  font-weight: var(--fw-semibold, 600); /* unified (Phase 2.5) */
  color: var(--ink-500);
  font-size: var(--text-xs, 12px); /* unified (Phase 2.5): was 11px */
  letter-spacing: -0.005em;
  text-transform: none;
  border-bottom: 0.5px solid rgba(15,23,42,0.06);
}
[data-theme="dark"] table th { border-bottom-color: rgba(255,255,255,0.06); }
table td {
  padding: 10px 14px;
  border-bottom: 0.5px solid rgba(15,23,42,0.05);
  color: var(--ink-800);
  font-weight: 400;
  font-size: var(--text-base, 15px); /* unified (Phase 2.5) — value unchanged */
  letter-spacing: -0.005em;
  vertical-align: middle;
  white-space: nowrap;
}
[data-theme="dark"] table td { 
  border-bottom-color: rgba(255,255,255,0.05);
  color: var(--ink-200);
}
table tbody tr:last-child td { border-bottom: none; }
table tbody tr { transition: background-color 120ms ease; }
table tbody tr:hover { background: rgba(15,23,42,0.025); }
[data-theme="dark"] table tbody tr:hover { background: rgba(255,255,255,0.03); }

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--gadri-blue-soft);
  color: var(--gadri-blue-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 11px;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}
[data-theme="dark"] .avatar {
  background: rgba(74,133,245,0.18);
  color: #fff;
}
.avatar.green { background: var(--gadri-green-soft); color: #138446; }
.avatar.pink { background: var(--gadri-pink-soft); color: #B5478B; }
.avatar.orange { background: var(--gadri-orange-soft); color: #C2400A; }
.avatar.indigo { background: #EEF2FF; color: #4338CA; }
.avatar.amber { background: var(--status-amber-soft); color: var(--status-amber); }
[data-theme="dark"] .avatar.green { background: rgba(91,191,127,0.18); color: #5BBF7F; }
[data-theme="dark"] .avatar.pink { background: rgba(246,174,206,0.18); color: #F6AECE; }
[data-theme="dark"] .avatar.orange { background: rgba(255,134,102,0.18); color: #FF8666; }
[data-theme="dark"] .avatar.indigo { background: rgba(139,92,246,0.18); color: #C4B5FD; }
[data-theme="dark"] .avatar.amber { background: rgba(251,191,36,0.18); color: #FBBF24; }
.avatar-lg { width: 40px; height: 40px; font-size: 13px; border-radius: 9px; }
.avatar-xl { width: 56px; height: 56px; font-size: 18px; border-radius: 12px; }

/* Empty state */
.empty-state {
  padding: 32px 16px;
  text-align: center;
  color: var(--ink-400);
}
.empty-state .icon-lg {
  width: 56px;
  height: 56px;
  color: var(--ink-300);
  margin-bottom: 16px;
}
.empty-state h4 { font-size: 16px; font-weight: 700; color: var(--ink-700); margin-bottom: 6px; }
.empty-state p { font-size: 14px; line-height: 1.6; max-width: 420px; margin: 0 auto; color: var(--ink-500); }

/* Enhanced rich empty state */
.empty-state-rich {
  padding: 48px 24px;
  text-align: center;
  background: linear-gradient(135deg, var(--gadri-cream-warm), rgba(251,191,36,0.05));
  border: 1px solid var(--ink-200);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  margin: 20px 0;
}
.empty-state-rich .icon-big { font-size: 56px; margin-bottom: 14px; opacity: 0.6; }
.empty-state-rich h3 { font-size: 20px; font-weight: 800; color: var(--ink-900); margin-bottom: 8px; }
.empty-state-rich p { font-size: 14px; color: var(--ink-600); margin-bottom: 16px; max-width: 500px; margin-inline:auto; line-height: 1.7; }
.empty-state-rich .tips-list {
  display: inline-block;
  text-align: start;
  background: var(--white);
  padding: 14px 20px;
  border-radius: var(--r-sm);
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-700);
}
.empty-state-rich .tips-list li { margin: 4px 0; }

/* Tooltip system */
.tt-trigger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: help;
  position: relative;
}
.tt-trigger .tt-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink-300);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.tt-trigger:hover .tt-icon { background: var(--gadri-blue); }
.tt-trigger .tt-content {
  position: absolute;
  bottom: calc(100% + 8px);
  inset-inline-start: 0;
  background: var(--ink-900);
  color: var(--white);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  max-width: 300px;
  white-space: normal;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
  z-index: 100;
  line-height: 1.5;
}
.tt-trigger .tt-content::after {
  content: '';
  position: absolute;
  top: 100%;
  inset-inline-start: 12px;
  border: 5px solid transparent;
  border-top-color: var(--ink-900);
}
.tt-trigger:hover .tt-content { opacity: 1; visibility: visible; }

/* kbd styling */
kbd {
  display: inline-block;
  padding: 2px 6px;
  background: var(--ink-100);
  border: 1px solid var(--ink-300);
  border-bottom-width: 2px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  font-family: monospace;
  color: var(--ink-800);
}

/* Search bar */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--white);
  border: 0.5px solid rgba(15,23,42,0.1);
  border-radius: 7px;
  padding: 7px 12px;
  flex: 1;
  max-width: 380px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
[data-theme="dark"] .search-box {
  border-color: rgba(255,255,255,0.1);
}
.search-box:focus-within { 
  border-color: var(--gadri-blue); 
  box-shadow: 0 0 0 3px rgba(37,101,237,0.12); 
}
.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-size: var(--text-sm, 13px); /* unified (Phase 2): was 12.5px */
  font-weight: 400;
  color: var(--ink-900);
  letter-spacing: -0.005em;
  font-family: inherit;
}
.search-box input::placeholder {
  color: var(--ink-400);
  font-weight: 400;
}
.search-box .icon { 
  color: var(--ink-400);
  width: 14px;
  height: 14px;
}

/* Filter chips */
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  padding: 5px 11px;
  border-radius: 6px;
  background: transparent;
  border: 0.5px solid rgba(15,23,42,0.1);
  color: var(--ink-600);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
  letter-spacing: -0.005em;
  font-family: inherit;
}
[data-theme="dark"] .chip {
  border-color: rgba(255,255,255,0.1);
  color: #B5C2D4;
}
.chip:hover { 
  background: rgba(15,23,42,0.04); 
  color: var(--ink-900);
  border-color: rgba(15,23,42,0.15);
}
[data-theme="dark"] .chip:hover {
  background: rgba(255,255,255,0.05);
  color: #FFFFFF;
  border-color: rgba(255,255,255,0.15);
}
.chip.active {
  background: var(--gadri-blue);
  color: #fff;
  border-color: var(--gadri-blue);
  font-weight: 600;
}
[data-theme="dark"] .chip.active {
  background: var(--gadri-blue);
  color: #fff;
  border-color: var(--gadri-blue);
}

/* Progress */
.progress {
  height: 5px;
  background: rgba(15,23,42,0.06);
  border-radius: 100px;
  overflow: hidden;
}
[data-theme="dark"] .progress {
  background: rgba(255,255,255,0.08);
}
.progress-fill {
  height: 100%;
  background: var(--gadri-blue);
  border-radius: 100px;
  transition: width 250ms ease;
}
.progress-fill.green { background: #138446; }
.progress-fill.orange { background: #C2400A; }
.progress-fill.amber { background: var(--status-amber); }

.progress-circle {
  position: relative;
  width: 80px;
  height: 80px;
}
.progress-circle svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.progress-circle .pc-bg { fill: none; stroke: var(--ink-100); stroke-width: 8; }
.progress-circle .pc-fg { fill: none; stroke: var(--gadri-blue); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset var(--trans-slow); }
.progress-circle .pc-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-900);
}

/* ═══════════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,22,40,0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--white);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s ease;
}
.modal.md { max-width: 640px; }
.modal.lg { max-width: 800px; }
.modal.xl { max-width: 1000px; }
.modal.full { max-width: 1200px; }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--ink-200);
}
.modal-head h3 { font-size: var(--text-lg, 18px); font-weight: var(--fw-heavy, 800); color: var(--ink-900); letter-spacing: -0.3px; } /* unified (Phase 1/2.6) — value unchanged */
.modal-head .close {
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--ink-500);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: all var(--trans-base);
}
.modal-head .close:hover { background: var(--ink-100); color: var(--ink-900); }

.modal-body { padding: 24px; overflow-y: auto; font-size: var(--text-base, 15px); } /* unified (Phase 2.6) — content text, value unchanged */
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--ink-200);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--ink-200);
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab {
  padding: 12px 20px;
  background: transparent;
  border: none;
  color: var(--ink-600);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  transition: color var(--trans-base);
  white-space: nowrap;
}
.tab:hover { color: var(--ink-900); }
.tab.active { color: var(--gadri-blue); }
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gadri-blue);
}
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeUp 0.3s ease; }

/* ═══════════════════════════════════════════════════════════════════════
   COURSE CARDS
   ═══════════════════════════════════════════════════════════════════════ */
.course-card {
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: all var(--trans-base);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.course-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gadri-blue);
}
.course-thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--gadri-blue) 0%, var(--gadri-blue-deep) 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 40px;
  overflow: hidden;
}
.course-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.1) 1.5px, transparent 1.5px);
  background-size: 20px 20px;
}
.course-thumb .course-thumb-badge {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 2;
}
.course-body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.course-title { font-size: 16px; font-weight: 800; color: var(--ink-900); margin-bottom: 6px; letter-spacing: -0.3px; line-height: 1.4; }
.course-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--ink-500);
  font-weight: 600;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}
.course-meta span { display: inline-flex; align-items: center; gap: 4px; }
.course-desc { font-size: 13px; color: var(--ink-600); line-height: 1.6; margin-bottom: 16px; flex: 1; }
.course-footer { display: flex; justify-content: space-between; align-items: center; padding-top: 12px; border-top: 1px solid var(--ink-100); }
.course-trainer { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-700); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════
   SETUP WIZARD
   ═══════════════════════════════════════════════════════════════════════ */
.setup-hero {
  background: linear-gradient(135deg, #1e40af 0%, #2565ED 50%, #FBBF24 100%);
  color: white;
  padding: 32px;
  border-radius: var(--r-lg);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.setup-hero-bg {
  position: absolute;
  top: -80px; inset-inline-end: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.2), transparent);
  border-radius: 50%;
}
.setup-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 12px;
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-lg);
  overflow-x: auto;
}
.setup-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s;
  flex: 0 0 auto;
}
.setup-step-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--ink-100);
  color: var(--ink-500);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  border: 2px solid var(--ink-200);
  transition: all 0.3s;
}
.setup-step-label {
  font-size: 11px;
  color: var(--ink-600);
  font-weight: 700;
  text-align: center;
  max-width: 70px;
}
.setup-step.active .setup-step-icon {
  background: linear-gradient(135deg, #2565ED, #1e40af);
  color: white;
  border-color: #FBBF24;
  box-shadow: 0 0 0 4px rgba(251,191,36,0.3);
  transform: scale(1.08);
}
.setup-step.active .setup-step-label { color: var(--gadri-blue); font-weight: 800; }
.setup-step.done .setup-step-icon {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border-color: #10b981;
  font-size: 22px;
}
.setup-step-line {
  flex: 1;
  height: 2px;
  background: var(--ink-200);
  margin: 0 4px;
  transition: all 0.3s;
  max-width: 40px;
}
.setup-step-line.done { background: #10b981; }

.setup-option {
  padding: 24px;
  background: var(--white);
  border: 2px solid var(--ink-200);
  border-radius: var(--r-lg);
  text-align: center;
  transition: all 0.2s;
}
.setup-option:hover { border-color: var(--gadri-blue); transform: translateY(-3px); box-shadow: var(--shadow-md); }
.setup-option.active { border-color: var(--gadri-blue); background: rgba(37,101,237,0.05); }
.setup-option h3 { font-size: 16px; font-weight: 800; margin-bottom: 8px; color: var(--ink-900); }
.setup-option p { font-size: 12px; color: var(--ink-600); line-height: 1.6; }

.setup-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--ink-500);
}
.setup-empty h4 { font-size: 16px; font-weight: 700; margin: 10px 0 4px; color: var(--ink-700); }
.setup-empty p { font-size: 13px; }

.setup-item-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px;
  background: var(--white);
  border: 0.5px solid rgba(15,23,42,0.08);
  border-radius: 11px;
  transition: all 120ms ease;
}
.setup-item-card:hover { 
  border-color: rgba(15,23,42,0.16); 
  background: rgba(15,23,42,0.015);
}
[data-theme="dark"] .setup-item-card { border-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .setup-item-card:hover { 
  border-color: rgba(255,255,255,0.16); 
  background: rgba(255,255,255,0.03);
}
.setup-item-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex: none;
}
.setup-item-body { flex: 1; min-width: 0; }
.setup-item-title { 
  font-size: 12.5px; 
  font-weight: 600; 
  color: var(--ink-900); 
  margin-bottom: 1px; 
  letter-spacing: -0.005em;
}
.setup-item-meta { font-size: 10.5px; color: var(--ink-500); }
.setup-item-actions { display: inline-flex; gap: 4px; flex: none; }

.setup-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--gadri-cream-warm);
  border: 1px solid var(--ink-200);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-800);
  cursor: pointer;
  transition: all 0.2s;
}
.setup-chip:hover { background: rgba(37,101,237,0.1); border-color: var(--gadri-blue); color: var(--gadri-blue); }
.setup-chip button {
  border: none; background: transparent; color: var(--ink-500);
  font-size: 16px; cursor: pointer; padding: 0; line-height: 1;
  width: 16px; height: 16px; display: flex; align-items: center; justify-content: center;
}
.setup-chip button:hover { color: var(--danger); }

.review-summary-card {
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  text-align: center;
}
.review-summary-card.missing { border-color: #ef4444; background: rgba(239,68,68,0.05); }

/* Meeting modal sections */
.meeting-section-header {
  padding: 10px 14px;
  background: linear-gradient(90deg, rgba(37,101,237,0.12), rgba(37,101,237,0.03));
  border-inline-start: 4px solid var(--gadri-blue);
  border-radius: var(--r-sm);
  font-weight: 800;
  font-size: 14px;
  color: var(--gadri-blue);
  margin: 18px 0 12px;
}
.agenda-item {
  padding: 8px;
  background: var(--gadri-cream-warm);
  border-radius: var(--r-sm);
  margin-bottom: 8px;
  border-inline-start: 3px solid var(--gadri-blue);
}

/* Dark mode specific overrides for course cards */
[data-theme="dark"] .course-card {
  background: var(--white);
  border-color: var(--ink-200);
}
[data-theme="dark"] .course-body {
  background: var(--white);
}
[data-theme="dark"] .course-title { color: var(--ink-900); }
[data-theme="dark"] .course-desc { color: var(--ink-600); }
[data-theme="dark"] .course-meta { color: var(--ink-500); }
[data-theme="dark"] .course-trainer { color: var(--ink-700); }

/* ═══════════════════════════════════════════════════════════════════════
   LESSON LIST (inside course detail)
   ═══════════════════════════════════════════════════════════════════════ */
.lesson-list { display: flex; flex-direction: column; gap: 8px; }
.lesson-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--gadri-cream-warm);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  transition: all var(--trans-base);
  cursor: pointer;
}
.lesson-item:hover { background: var(--gadri-blue-subtle); border-color: var(--gadri-blue); }
.lesson-item.completed {
  background: var(--gadri-green-soft);
  border-color: var(--gadri-green);
}
.lesson-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gadri-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.lesson-item.completed .lesson-icon { background: var(--gadri-green); }
.lesson-info { flex: 1; }
.lesson-title { font-size: 13px; font-weight: 700; color: var(--ink-900); }
.lesson-type { font-size: 11px; color: var(--ink-500); font-weight: 600; letter-spacing: 0.5px; }

/* Video container */
.video-container {
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 20px;
}
.video-container iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   MEETINGS
   ═══════════════════════════════════════════════════════════════════════ */
.meeting-card {
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-lg);
  padding: 20px;
  transition: all var(--trans-base);
  cursor: pointer;
}
.meeting-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--gadri-blue); }
.meeting-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.meeting-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.3px;
  line-height: 1.4;
  margin-bottom: 4px;
}
.meeting-type {
  font-size: 11px;
  color: var(--ink-500);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.meeting-date-box {
  text-align: center;
  background: var(--white);
  border: 1.5px solid var(--gadri-blue);
  border-radius: var(--r-md);
  min-width: 52px;
  overflow: hidden;
  color: var(--gadri-blue);
  flex-shrink: 0;
}
.meeting-date-head {
  background: var(--gadri-blue);
  padding: 3px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.meeting-date-head i { font-size: 10px; color: #fff; }
.meeting-date-head span { font-size: 9px; font-weight: 700; color: #fff; letter-spacing: 0.5px; }
.meeting-date-day { font-size: 20px; font-weight: 800; line-height: 1; padding: 5px 0; }
.meeting-date-month { font-size: 10px; font-weight: 700; letter-spacing: 1px; margin-top: 4px; text-transform: uppercase; }

.meeting-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--ink-600);
  font-weight: 600;
  padding: 12px 0;
  border-top: 1px solid var(--ink-100);
  border-bottom: 1px solid var(--ink-100);
  margin-bottom: 12px;
}
.meeting-meta span { display: inline-flex; align-items: center; gap: 6px; }

/* Minutes document style */
.minutes-doc {
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-lg);
  padding: 32px 40px;
}
.minutes-header {
  text-align: center;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--gadri-blue);
  margin-bottom: 24px;
}
.minutes-header h2 { font-size: var(--text-xl, 22px); font-weight: 800; color: var(--ink-900); letter-spacing: -0.5px; } /* unified (Phase 1) — value unchanged */
.minutes-header .subtitle { font-size: 13px; color: var(--ink-500); margin-top: 6px; font-weight: 600; }

.minutes-section { margin-bottom: 24px; }
.minutes-section h4 {
  font-size: 12px;
  letter-spacing: 1.5px;
  color: var(--gadri-blue);
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 8px;
}
.minutes-section h4::before {
  content: '';
  width: 20px;
  height: 2px;
  background: var(--gadri-blue);
  border-radius: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════
   TASKS
   ═══════════════════════════════════════════════════════════════════════ */
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  transition: all var(--trans-base);
}
.task-item:hover { border-color: var(--gadri-blue); box-shadow: var(--shadow-xs); }
.task-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--ink-300);
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  transition: all var(--trans-base);
  display: flex;
  align-items: center;
  justify-content: center;
}
.task-check:hover { border-color: var(--gadri-blue); }
.task-check.done { background: var(--gadri-green); border-color: var(--gadri-green); color: #fff; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 13px; font-weight: 700; color: var(--ink-900); margin-bottom: 4px; }
.task-item.done .task-title { text-decoration: line-through; color: var(--ink-500); }
.task-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; font-size: 11px; color: var(--ink-500); }
.task-meta span { display: inline-flex; align-items: center; gap: 4px; }

.task-priority-high { border-inline-start: 3px solid var(--status-red); }
.task-priority-med { border-inline-start: 3px solid var(--status-amber); }
.task-priority-low { border-inline-start: 3px solid var(--gadri-green); }

/* ═══════════════════════════════════════════════════════════════════════
   SKILLS MATRIX
   ═══════════════════════════════════════════════════════════════════════ */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.skill-item {
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  padding: 14px;
}
.skill-name { font-size: 13px; font-weight: 700; color: var(--ink-900); margin-bottom: 8px; }
.skill-levels {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}
.skill-level-dot {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--ink-100);
}
.skill-level-dot.filled { background: var(--gadri-blue); }
.skill-level-dot.target { background: var(--gadri-green); }
.skill-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-500); font-weight: 600; }

/* Skills Matrix Table */
.matrix-table {
  background: var(--white);
  border-radius: var(--r-lg);
  overflow: auto;
  border: 1px solid var(--ink-200);
}
.matrix-table table { min-width: 800px; }
.matrix-cell {
  text-align: center;
  font-weight: 800;
}
.matrix-cell.lv-1 { background: var(--status-red-soft); color: var(--status-red); }
.matrix-cell.lv-2 { background: var(--status-amber-soft); color: var(--status-amber); }
.matrix-cell.lv-3 { background: var(--gadri-blue-soft); color: var(--gadri-blue); }
.matrix-cell.lv-4 { background: var(--gadri-green-soft); color: var(--gadri-green); }
.matrix-cell.lv-5 { background: var(--gadri-green); color: #fff; }

/* ═══════════════════════════════════════════════════════════════════════
   GAMIFICATION
   ═══════════════════════════════════════════════════════════════════════ */
.badge-card {
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-lg);
  padding: 20px;
  text-align: center;
  transition: all var(--trans-base);
}
.badge-card:hover { transform: translateY(-4px) rotate(-1deg); box-shadow: var(--shadow-md); }
.badge-card.locked { opacity: 0.4; filter: grayscale(1); }
.badge-emblem {
  width: 80px;
  height: 80px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gadri-blue), var(--gadri-blue-deep));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 4px 16px rgba(37,101,237,0.3);
  position: relative;
}
.badge-card.gold .badge-emblem { background: linear-gradient(135deg, #FBBF24, #D97706); box-shadow: 0 4px 16px rgba(251,191,36,0.4); }
.badge-card.silver .badge-emblem { background: linear-gradient(135deg, #CBD5E1, #94A3B8); box-shadow: 0 4px 16px rgba(148,163,184,0.3); }
.badge-card.bronze .badge-emblem { background: linear-gradient(135deg, #D97706, #92400E); box-shadow: 0 4px 16px rgba(217,119,6,0.3); }
.badge-card.diamond .badge-emblem { background: linear-gradient(135deg, #60A5FA, #C084FC); box-shadow: 0 4px 16px rgba(96,165,250,0.4); }
.badge-name { font-size: 14px; font-weight: 800; color: var(--ink-900); margin-bottom: 4px; }
.badge-desc { font-size: 11px; color: var(--ink-500); line-height: 1.5; }

.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  transition: all var(--trans-base);
}
.leaderboard-item:hover { transform: translateX(-4px); }
html[dir="ltr"] .leaderboard-item:hover { transform: translateX(4px); }
.leaderboard-item.rank-1 { background: linear-gradient(90deg, rgba(251,191,36,0.1), transparent); border-color: #FBBF24; }
.leaderboard-item.rank-2 { background: linear-gradient(90deg, rgba(148,163,184,0.1), transparent); border-color: #94A3B8; }
.leaderboard-item.rank-3 { background: linear-gradient(90deg, rgba(217,119,6,0.1), transparent); border-color: #D97706; }

.lb-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gadri-cream-warm);
  color: var(--ink-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  flex-shrink: 0;
}
.leaderboard-item.rank-1 .lb-rank { background: #FBBF24; color: #fff; }
.leaderboard-item.rank-2 .lb-rank { background: #94A3B8; color: #fff; }
.leaderboard-item.rank-3 .lb-rank { background: #D97706; color: #fff; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-size: 13px; font-weight: 700; color: var(--ink-900); }
.lb-dept { font-size: 11px; color: var(--ink-500); }
.lb-points { font-size: 16px; font-weight: 800; color: var(--gadri-blue); }
.lb-points-label { font-size: 9px; color: var(--ink-500); letter-spacing: 1px; font-weight: 600; text-transform: uppercase; text-align: end; }

/* ═══════════════════════════════════════════════════════════════════════
   CERTIFICATE — A4 landscape, Gadri Academy professional template
   ═══════════════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════════════
   🏆 PREMIUM CERTIFICATE DESIGN — World-Class Standard
   مستوى: Stanford / Harvard / SAP / Microsoft Certifications
   ═══════════════════════════════════════════════════════════════════════ */
.cert-preview {
  background: #FEFEFE;
  color: #0F1E4D;
  width: 297mm;
  height: 210mm;
  max-width: 100%;
  padding: 0;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 20px 60px rgba(15, 30, 77, 0.18),
    0 8px 20px rgba(15, 30, 77, 0.10),
    inset 0 0 0 1px rgba(212, 175, 55, 0.08);
  border-radius: 6px;
  font-family: 'Cairo', 'Tajawal', 'Amiri', serif;
}

/* Subtle paper texture overlay */
.cert-preview::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(37, 101, 237, 0.018) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(212, 175, 55, 0.022) 0%, transparent 40%),
    linear-gradient(135deg, transparent 0%, rgba(37, 101, 237, 0.012) 100%);
  pointer-events: none;
  z-index: 0;
}

/* Watermark - subtle ◆ pattern */
.cert-preview::after {
  content: '◆';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 380px;
  color: rgba(37, 101, 237, 0.025);
  font-weight: 100;
  pointer-events: none;
  z-index: 0;
  user-select: none;
}

/* ═══ Scale down for on-screen preview (Smart Mobile Responsive) ═══ */
@media (max-width: 1100px) {
  .cert-preview { transform: scale(0.85); transform-origin: top center; }
}
@media (max-width: 900px) {
  .cert-preview { transform: scale(0.7); transform-origin: top center; }
}
@media (max-width: 700px) {
  .cert-preview { transform: scale(0.55); transform-origin: top center; }
}

/* 📱 على الجوال الصغير: الشهادة كاملة مع scroll أفقي */
@media (max-width: 480px) {
  .cert-preview {
    transform: none !important;
    width: 297mm !important;
    height: 210mm !important;
    max-width: none !important;
    margin: 0 auto;
  }
  /* Container يسمح بـ scroll أفقي */
  .modal-content,
  .modal-body,
  [data-modal-content] {
    overflow-x: auto !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

/* 🖨️ تحسينات الطباعة - تعمل على كل الأجهزة */
@media print {
  * { 
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
  body, html {
    background: white !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .cert-preview {
    transform: none !important;
    width: 297mm !important;
    height: 210mm !important;
    max-width: 297mm !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: white !important;
    page-break-inside: avoid;
    page-break-after: avoid;
    margin: 0 !important;
  }
  /* إخفاء كل شيء إلا الشهادة */
  .modal-header,
  .modal-footer,
  button,
  .no-print {
    display: none !important;
  }
  @page {
    size: A4 landscape;
    margin: 0;
  }
}

[data-theme="dark"] .cert-preview {
  background: #FEFEFE !important;
  color: #0F1E4D !important;
}
.cert-preview * { color: inherit; box-sizing: border-box; }

/* ═══ DOUBLE GOLD-ACCENTED FRAME — Professional Thickness ═══ */
.cert-frame-outer {
  position: absolute;
  inset: 8mm;
  border: 5px solid #1E4FCB;
  border-radius: 4px;
  pointer-events: none;
  z-index: 1;
  box-shadow: 
    inset 0 0 0 1px rgba(212, 175, 55, 0.3),
    0 0 0 1px rgba(30, 79, 203, 0.2);
}
.cert-frame-inner {
  position: absolute;
  inset: 13mm;
  border: 1.5px solid #D4AF37;
  border-radius: 3px;
  pointer-events: none;
  z-index: 1;
}

/* Optional middle delicate line for premium effect */
.cert-preview .cert-frame-outer::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 2px;
  pointer-events: none;
}

/* Corners removed for cleaner minimalist design */
.cert-corner { display: none; }

/* ═══ TOP RIBBON BADGE (centered, bigger, lower) ═══ */
.cert-type-badge {
  position: absolute;
  top: 18mm;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  z-index: 4;
  filter: drop-shadow(0 4px 8px rgba(15, 30, 77, 0.25));
}

/* ═══ LOGO (REAL IMAGE) ═══ */
.cert-logo {
  position: absolute;
  top: 20mm;
  inset-inline-start: 22mm;
  width: 130px;
  height: auto;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.06));
}

/* ═══ MEDAL/SEAL ═══ */
.cert-medal {
  position: absolute;
  top: 20mm;
  inset-inline-end: 22mm;
  width: 100px; 
  height: 110px;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 4px 8px rgba(15, 30, 77, 0.15));
}

/* ═══ QR CODE — Premium Verification Badge ═══ */
.cert-qr-wrap {
  position: absolute;
  bottom: 16mm;
  inset-inline-start: 16mm;
  width: 90px;
  text-align: center;
  z-index: 4;
  pointer-events: none;
}

/* Premium QR card with gold border */
.cert-qr-card {
  background: linear-gradient(135deg, #FFFFFF 0%, #F8FAFC 100%);
  padding: 6px;
  border-radius: 8px;
  border: 1.5px solid #D4AF37;
  box-shadow: 
    0 2px 8px rgba(15, 30, 77, 0.10),
    0 0 0 1px rgba(212, 175, 55, 0.15),
    inset 0 0 0 1px rgba(255, 255, 255, 0.8);
  position: relative;
}

/* Corner decorative dots */
.cert-qr-card::before,
.cert-qr-card::after {
  content: '◆';
  position: absolute;
  font-size: 6px;
  color: #D4AF37;
  line-height: 1;
}
.cert-qr-card::before {
  top: 2px;
  left: 4px;
}
.cert-qr-card::after {
  bottom: 2px;
  right: 4px;
}

.cert-qr-img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  display: block;
  border-radius: 4px;
}

/* Label below QR */
.cert-qr-label {
  font-family: 'Cairo', sans-serif;
  font-size: 7px;
  font-weight: 800;
  color: #1E4FCB;
  letter-spacing: 0.8px;
  margin-top: 5px;
  line-height: 1.4;
  text-transform: uppercase;
  position: relative;
}

.cert-qr-label::before,
.cert-qr-label::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #D4AF37, transparent);
  vertical-align: middle;
  margin: 0 4px;
}

.cert-qr-label .gold {
  color: #D4AF37;
  font-size: 8px;
}

.cert-qr-label .verify-text {
  display: block;
  margin-top: 2px;
  font-size: 6.5px;
  color: #64748B;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* ═══ MAIN CONTENT — Properly Inside Thick Frame ═══ */
.cert-inner {
  position: absolute;
  inset: 0;
  padding: 36mm 30mm 20mm;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  z-index: 3;
  gap: 8px;
}

.cert-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 700px;
  margin-top: 0;
  flex: 1;
  min-height: 0;
  width: 100%;
  justify-content: center;
}

/* ═══ TITLE — Elegant Amiri Serif (Stanford/Harvard style) ═══ */
.cert-title {
  font-family: 'Amiri', 'Times New Roman', serif;
  font-size: 44px;
  font-weight: 700;
  font-style: italic;
  color: #0F1E4D;
  letter-spacing: 0;
  margin: 0;
  line-height: 1.2;
  position: relative;
  padding-bottom: 14px;
}

/* Gold underline ornament */
.cert-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent 0%, #D4AF37 30%, #B8902C 50%, #D4AF37 70%, transparent 100%);
}

/* ═══ "PRESENTED TO" / "تشهد لـ" — Subtle Elegance ═══ */
.cert-given {
  font-family: 'Amiri', serif;
  font-size: 17px;
  color: #475569;
  font-weight: 400;
  font-style: italic;
  margin: 0;
  line-height: 1.6;
  letter-spacing: 0.5px;
}

/* ═══ NAME — Aref Ruqaa Calligraphy (Royal/Diwani Style) ═══ */
.cert-name-wrap {
  padding: 18px 30px 22px;
  min-width: 480px;
  position: relative;
  margin: 8px 0;
}

/* Gold flourish above name */
.cert-name-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, #D4AF37 50%, transparent 100%);
}

/* Gold underline below name */
.cert-name-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 360px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent 0%, #1E4FCB 20%, #D4AF37 50%, #1E4FCB 80%, transparent 100%);
}

.cert-name {
  font-size: 58px;
  font-weight: 700;
  color: #1E4FCB;
  letter-spacing: 0;
  line-height: 1.3;
  margin: 0;
  font-family: 'Aref Ruqaa', 'Amiri', 'Traditional Arabic', serif;
  text-shadow: 0 1px 2px rgba(30, 79, 203, 0.08);
}

/* ═══ BODY TEXT — Clean & Readable ═══ */
.cert-body-text {
  font-family: 'Cairo', 'Tajawal', serif;
  font-size: 15px;
  color: #1E293B;
  font-weight: 400;
  line-height: 1.8;
  max-width: 660px;
  margin: 4px 0 0;
  /* النص يظهر كاملاً بدون قطع */
}
.cert-body-text .accent {
  font-weight: 800;
  color: #1E4FCB;
  padding: 0 6px;
  position: relative;
}
.cert-body-text .line2 {
  display: block;
  margin-top: 6px;
}

/* ═══ META INFO ROW ═══ */
.cert-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 580px;
  margin-top: 18px;
  padding: 12px 24px;
  font-size: 12px;
  color: #475569;
  background: linear-gradient(135deg, rgba(37, 101, 237, 0.04) 0%, rgba(212, 175, 55, 0.04) 100%);
  border-radius: 8px;
  border: 1px solid rgba(37, 101, 237, 0.12);
  position: relative;
}

.cert-meta-row::before {
  content: '◆';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #D4AF37;
  font-size: 12px;
  background: white;
  padding: 0 8px;
}

.cert-meta-row strong { 
  font-family: 'Courier New', monospace; 
  color: #1E4FCB; 
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
}

/* ═══ SIGNATURES FOOTER ═══ */
/* ═══ OLD SIGNATURES — Hidden (replaced by Digital Verification Block) ═══ */
.cert-footer-row,
.cert-sig-block,
.cert-sig-img,
.cert-sig-line,
.cert-sig-title,
.cert-center-logo-wrap,
.cert-center-logo-img,
.cert-center-stamp { 
  display: none !important; 
}

/* ═══ DIGITAL VERIFICATION BLOCK — Modern Global Standard (Coursera/Stanford) ═══ */
.cert-verify-block {
  width: 100%;
  max-width: 680px;
  display: grid;
  grid-template-columns: 130px 1fr;
  align-items: center;
  gap: 32px;
  margin-top: auto; /* يدفع الـ block للأسفل دائماً */
  padding: 18px 28px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.6) 0%, rgba(248, 250, 252, 0.8) 100%);
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  box-shadow: 
    0 1px 3px rgba(15, 30, 77, 0.04),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  flex-shrink: 0; /* لا يتقلص أبداً */
  flex-grow: 0; /* لا يكبر */
}

/* Official Stamp */
.cert-stamp-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
.cert-stamp {
  width: 110px;
  height: 110px;
  filter: drop-shadow(0 2px 4px rgba(15, 30, 77, 0.15));
}
.cert-stamp svg {
  width: 100%;
  height: 100%;
}

/* Verification Info */
.cert-verify-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: start;
}

.cert-verify-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 6px;
}
.cert-verify-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: #10B981;
  color: white;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.cert-verify-label {
  font-family: 'Amiri', serif;
  font-size: 15px;
  font-weight: 700;
  color: #10B981;
  letter-spacing: 0.3px;
}

.cert-verify-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(212, 175, 55, 0.5) 50%, transparent 100%);
  margin: 2px 0 4px;
}

.cert-verify-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0;
  gap: 12px;
}
.cert-verify-key {
  font-family: 'Cairo', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: #64748B;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.cert-verify-val {
  font-family: 'Cairo', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #0F1E4D;
}
.cert-verify-id {
  font-family: 'Courier New', monospace;
  color: #1E4FCB;
  letter-spacing: 0.5px;
  direction: ltr;
}
.cert-verify-url {
  color: #1E4FCB;
  direction: ltr;
  font-size: 11px;
}

/* ═══ ORIGINAL FOOTER STYLES (kept hidden but valid) ═══ */
.cert-footer-row-OLD {
  width: 100%;
  max-width: 720px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  gap: 24px;
  margin-top: auto;
  padding-top: 8px;
  padding-bottom: 4mm;
}
.cert-sig-block {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

/* Gold separator above each signature */
.cert-sig-block::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #D4AF37, transparent);
}

.cert-sig-img {
  height: 44px;
  width: auto;
  max-width: 150px;
}
.cert-sig-line {
  width: 150px;
  height: 1px;
  background: #1E293B;
  margin: 0 auto;
}
.cert-sig-title {
  font-size: 12px;
  font-weight: 700;
  color: #0F1E4D;
  font-family: 'Cairo', serif;
  letter-spacing: 0.3px;
}

/* ═══ CENTER LOGO IN FOOTER ═══ */
.cert-center-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.cert-center-logo-img {
  width: 80px;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.04));
}
.cert-center-stamp {
  font-size: 9px;
  font-weight: 700;
  color: #D4AF37;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin-top: 2px;
}

/* ═══ Hide deprecated elements ═══ */
.cert-preview .cert-seal,
.cert-preview .cert-bismillah,
.cert-preview .cert-kicker,
.cert-preview .cert-for,
.cert-preview .cert-course,
.cert-preview .cert-footer,
.cert-preview .cert-qr,
.cert-preview .cert-qr-box,
.cert-preview .cert-id,
.cert-preview .cert-waves-top,
.cert-preview .cert-waves-bottom { display: none; }

/* ═══ TYPE-SPECIFIC ACCENTS — Unified Brand Identity ═══ */
/* All types use Gadri Blue + Gold — consistent brand */
/* Only the medal color and badge ribbon differ */

/* Completion (default): Royal Blue + Gold ⭐ */

/* Attendance: Slate Gray for medal/ribbon only — keep blue text */
.cert-type-attendance .cert-frame-outer {
  border-color: #1E4FCB; /* keep brand blue */
}

/* Appreciation: Royal Blue + Gold (NOT purple) */
.cert-type-appreciation .cert-title { color: #0F1E4D; }
.cert-type-appreciation .cert-name { color: #1E4FCB; }
.cert-type-appreciation .cert-name-wrap::after {
  background: linear-gradient(90deg, transparent 0%, #1E4FCB 20%, #D4AF37 50%, #1E4FCB 80%, transparent 100%);
}

/* Path Completion: Royal Blue + Gold (same as completion - tier affects medal/ribbon only) */
.cert-type-path_completion .cert-title { color: #0F1E4D; }
.cert-type-path_completion .cert-name { color: #1E4FCB; }
.cert-type-path_completion .cert-name-wrap::after {
  background: linear-gradient(90deg, transparent 0%, #1E4FCB 20%, #D4AF37 50%, #1E4FCB 80%, transparent 100%);
}

/* ═══════════════════════════════════════════════════════════════════════
   SIGNATURES MANAGEMENT
   ═══════════════════════════════════════════════════════════════════════ */
.sig-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.sig-card {
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-lg);
  padding: 16px;
  transition: all 0.2s;
}
.sig-card:hover { box-shadow: var(--shadow-md); border-color: var(--gadri-blue-subtle); }
.sig-card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--ink-100);
}
.sig-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: linear-gradient(135deg, #1e40af, #2565ED);
  color: white; display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.sig-title { font-size: 14px; font-weight: 800; color: var(--ink-900); }
.sig-slot-id { font-size: 10px; color: var(--ink-500); font-family: monospace; }

.sig-preview-box {
  background: linear-gradient(135deg, #f8fafc, #ffffff);
  border: 2px dashed var(--ink-200);
  border-radius: var(--r-md);
  padding: 20px;
  min-height: 120px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.sig-preview-img { max-width: 100%; max-height: 100px; display: block; }
.sig-empty { text-align: center; color: var(--ink-500); }
.sig-empty p { font-size: 12px; margin-top: 8px; }
.sig-empty svg { display: block; margin: 0 auto; }

.sig-meta {
  padding: 8px 12px; background: var(--gadri-cream-warm);
  border-radius: var(--r-sm); font-size: 12px; margin-bottom: 12px;
}
.sig-meta-label { color: var(--ink-500); margin-inline-end: 6px; }

.sig-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.sig-actions .btn { flex: 1; min-width: 90px; }

/* Uploaded signature image inside cert */
.cert-sig-img-uploaded {
  height: 50px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  margin-bottom: 4px;
}
.cert-sig-person {
  font-size: 11px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 2px;
}

/* ═══════════════════════════════════════════════════════════════════════
   TOASTS
   ═══════════════════════════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: 20px;
  inset-inline-end: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}
/* ═══════════════════════════════════════════════════════════════════
   🎭 BEHAVIOR-DRIVEN UX LAYER — Interactions + Loading + Feedback
   ═══════════════════════════════════════════════════════════════════ */

/* ── Button States ── */
.btn {
  position: relative;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  overflow: hidden;
}
.btn:hover:not(:disabled):not(.is-loading) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,101,237,0.2);
}
.btn:active:not(:disabled):not(.is-loading) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(37,101,237,0.15);
}
.btn:disabled, .btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Ripple effect on click */
.btn::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,0.4);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.5s, height 0.5s;
}
.btn:active::after { width: 300px; height: 300px; transition: 0s; }

/* ── Loading Button ── */
.btn.is-loading {
  color: transparent !important;
  pointer-events: none;
  cursor: wait;
}
.btn.is-loading::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 18px; height: 18px;
  margin: -9px 0 0 -9px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: btnSpin 0.7s linear infinite;
  z-index: 2;
}
.btn-secondary.is-loading::before, .btn-ghost.is-loading::before {
  border-color: rgba(37,101,237,0.2);
  border-top-color: var(--gadri-blue);
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* ── Global Page Loading ── */
.page-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.2s;
}
[data-theme="dark"] .page-loading-overlay { background: rgba(15,23,42,0.85); }
.loader-ring {
  width: 56px; height: 56px;
  border: 4px solid rgba(37,101,237,0.15);
  border-top-color: var(--gadri-blue);
  border-radius: 50%;
  animation: btnSpin 0.8s linear infinite;
}
.loader-text {
  color: var(--ink-700);
  font-weight: 700;
  font-size: 14px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Skeleton Loading ── */
.skeleton {
  background: linear-gradient(90deg, var(--ink-100), var(--ink-200), var(--ink-100));
  background-size: 200% 100%;
  animation: skeletonPulse 1.3s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@keyframes skeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-text { height: 14px; margin: 6px 0; }
.skeleton-text.lg { height: 20px; }
.skeleton-text.sm { height: 10px; }
.skeleton-circle { border-radius: 50%; width: 40px; height: 40px; }
.skeleton-card {
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  margin-bottom: 12px;
}

/* ── Card Hover Effects ── */
.card, .stat-card {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.card.clickable { cursor: pointer; }
.card.clickable:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(37,101,237,0.12);
  border-color: var(--gadri-blue);
}

/* ═══════════════════════════════════════════════════════════════════
   📊 STAT CARDS - تصميم احترافي عالمي موحد (Linear/Stripe style)
   يطبّق على كل بطاقات stat-card في النظام (89 بطاقة)
   ═══════════════════════════════════════════════════════════════════ */
.stat-card {
  background: var(--bg-card, var(--white));
  border: 0.5px solid rgba(15,23,42,0.08);
  border-radius: 10px;
  padding: 13px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 70px;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
[data-theme="dark"] .stat-card {
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Hover effect على البطاقات القابلة للنقر */
.stat-card[onclick],
.stat-card[style*="cursor:pointer"],
.stat-card[style*="cursor: pointer"] {
  cursor: pointer;
}
.stat-card[onclick]:hover,
.stat-card[style*="cursor:pointer"]:hover,
.stat-card[style*="cursor: pointer"]:hover {
  transform: translateY(-1px);
  border-color: rgba(37,101,237,0.3);
  box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 2px 6px rgba(37,101,237,0.06);
}
[data-theme="dark"] .stat-card[onclick]:hover {
  border-color: rgba(74,133,245,0.4);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Stat Label - العنوان الفرعي */
.stat-card .stat-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-500);
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  gap: 5px;
  line-height: 1.4;
}
[data-theme="dark"] .stat-card .stat-label {
  color: #94A3B8;
}

/* Stat Value - الرقم الكبير */
.stat-card .stat-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink-900);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin: 0;
}
[data-theme="dark"] .stat-card .stat-value {
  color: #FFFFFF;
}

/* إزالة الـ border-inline-start الملوّن — يبدو bootstrap */
.stat-card[style*="border-inline-start"] {
  position: relative;
  border-inline-start: 0.5px solid rgba(15,23,42,0.08) !important;
}
[data-theme="dark"] .stat-card[style*="border-inline-start"] {
  border-inline-start-color: rgba(255,255,255,0.08) !important;
}
.stat-card[style*="border-inline-start"]::before {
  display: none;
}

/* للعداد الفرعي إن وُجد */
.stat-card > div:last-child:not(.stat-label):not(.stat-value) {
  font-size: 11px;
  color: var(--ink-500);
  font-weight: 400;
}

/* Mobile responsive */
@media (max-width: 640px) {
  .stat-card {
    padding: 11px 14px;
    min-height: 62px;
  }
  .stat-card .stat-value {
    font-size: 19px;
  }
  .stat-card .stat-label {
    font-size: 11px;
  }
}

/* ── Form Field States ── */
.field-group { position: relative; }
.field-group input:not([type="checkbox"]):not([type="radio"]),
.field-group select,
.field-group textarea {
  transition: all 0.2s;
}
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  outline: none;
  border-color: var(--gadri-blue);
  box-shadow: 0 0 0 3px rgba(37,101,237,0.1);
}
.field-group.has-error input,
.field-group.has-error select,
.field-group.has-error textarea {
  border-color: #ef4444 !important;
  background: rgba(239,68,68,0.03);
}
.field-group.has-error input:focus {
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}
.field-group.is-valid input,
.field-group.is-valid select {
  border-color: #10b981;
}

/* Inline error/help messages */
.field-error, .field-help {
  font-size: 11px;
  margin-top: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: slideDown 0.2s;
}
.field-error {
  background: rgba(239,68,68,0.08);
  color: #dc2626;
  border-inline-start: 3px solid #ef4444;
}
.field-help {
  background: rgba(37,101,237,0.06);
  color: #1e40af;
  border-inline-start: 3px solid var(--gadri-blue);
}
.field-error::before { content: "⚠️"; font-size: 12px; }
.field-help::before { content: "💡"; font-size: 12px; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Confirmation Modal (Smart) ── */
.confirm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s;
  padding: 20px;
}
.confirm-modal {
  background: var(--white);
  border-radius: var(--r-lg);
  max-width: 440px;
  width: 100%;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  animation: confirmPop 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes confirmPop {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.confirm-hero {
  padding: 28px 24px 20px;
  text-align: center;
  position: relative;
}
.confirm-hero.danger { background: linear-gradient(135deg, #fee2e2, #fecaca); }
.confirm-hero.warning { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.confirm-hero.info { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.confirm-hero.success { background: linear-gradient(135deg, #dcfce7, #bbf7d0); }
.confirm-icon {
  width: 64px; height: 64px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center; justify-content: center;
  font-size: 32px;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  animation: iconBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes iconBounce {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.confirm-title {
  font-size: var(--text-lg, 18px); /* unified (Phase 2.6) — matches .modal-head h3 */
  font-weight: var(--fw-heavy, 800);
  color: var(--ink-900);
  margin-bottom: 6px;
}
.confirm-desc {
  font-size: var(--text-sm, 13px); /* unified (Phase 2.6) — value unchanged */
  color: var(--ink-600);
  line-height: 1.6;
}
.confirm-body {
  padding: 20px 24px;
  font-size: var(--text-sm, 13px); /* unified (Phase 2.6) — value unchanged */
  color: var(--ink-700);
  line-height: 1.7;
  background: var(--white);
}
.confirm-details {
  background: var(--gadri-cream-warm);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin: 12px 0;
  font-size: var(--text-xs, 12px); /* unified (Phase 2.6) — value unchanged */
}
.confirm-details strong { color: var(--ink-900); }
.confirm-actions {
  padding: 14px 20px 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  background: var(--white);
}
.confirm-actions .btn { min-width: 100px; }

/* Danger typing safeguard */
.confirm-typing {
  margin-top: 10px;
}
.confirm-typing label {
  font-size: var(--text-2xs, 11px); /* unified (Phase 2.6) — value unchanged */
  color: var(--ink-600);
  display: block;
  margin-bottom: 4px;
}
.confirm-typing input {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--ink-200);
  border-radius: var(--r-sm);
  font-family: monospace;
  font-weight: 700;
  font-size: var(--text-sm, 13px); /* unified (Phase 2) — value unchanged */
}
.confirm-typing input:focus {
  border-color: #ef4444;
  outline: none;
}

/* ── Badge Pulse (for notifications) ── */
.badge-pulse::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 100%; height: 100%;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(239,68,68,0.6);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
  70%  { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

/* ── Success Celebration ── */
@keyframes successFlash {
  0%   { background-color: rgba(16,185,129,0); }
  30%  { background-color: rgba(16,185,129,0.15); }
  100% { background-color: rgba(16,185,129,0); }
}
.success-flash { animation: successFlash 0.8s ease; }

/* ── Status Transitions ── */
@keyframes statusChange {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.status-changed { animation: statusChange 0.5s ease; }

/* ── Empty States Enhanced ── */
.empty-state {
  text-align: center;
  padding: 40px 24px;
  color: var(--ink-500);
}
.empty-state .icon {
  font-size: 48px;
  margin-bottom: 14px;
  opacity: 0.55;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.empty-state-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink-900);
  margin-bottom: 6px;
}
.empty-state-desc {
  font-size: 13px;
  color: var(--ink-600);
  margin-bottom: 16px;
  max-width: 360px;
  margin-inline: auto;
}

/* ── Disabled action hint ── */
.disabled-reason {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: white;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 100;
}
.has-disabled-reason:hover .disabled-reason { opacity: 1; }

/* ── Transitions for page content ── */
#pageContent {
  animation: pageIn 0.3s ease;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Processing overlay for cards ── */
.is-processing {
  position: relative;
  pointer-events: none;
}
.is-processing::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(2px);
  border-radius: inherit;
  z-index: 10;
}
.is-processing::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 28px; height: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid rgba(37,101,237,0.2);
  border-top-color: var(--gadri-blue);
  border-radius: 50%;
  animation: btnSpin 0.7s linear infinite;
  z-index: 11;
}

/* ── Notification badge ripple ── */
.notif-badge {
  position: relative;
}

/* ── Contextual menu hover ── */
.action-row {
  display: flex;
  gap: 6px;
  opacity: 0.5;
  transition: opacity 0.2s;
}
tr:hover .action-row, .card:hover .action-row { opacity: 1; }

/* ── Inline feedback bubble ── */
.inline-feedback {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  animation: slideDown 0.25s;
}
.inline-feedback.ok     { background: rgba(16,185,129,0.15); color: #059669; }
.inline-feedback.err    { background: rgba(239,68,68,0.15); color: #dc2626; }
.inline-feedback.info   { background: rgba(37,101,237,0.15); color: #1e40af; }

/* ═══ END UX LAYER ═══ */

.toast {
  background: var(--white);
  border: 1px solid var(--ink-200);
  border-radius: var(--r-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 400px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: toastIn 0.3s ease;
  pointer-events: auto;
  border-inline-start: 4px solid var(--gadri-blue);
}
.toast.success { border-inline-start-color: var(--gadri-green); }
.toast.error { border-inline-start-color: var(--status-red); }
.toast.warning { border-inline-start-color: var(--status-amber); }
.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gadri-blue-soft);
  color: var(--gadri-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.toast.success .toast-icon { background: var(--gadri-green-soft); color: var(--gadri-green); }
.toast.error .toast-icon { background: var(--status-red-soft); color: var(--status-red); }
.toast.warning .toast-icon { background: var(--status-amber-soft); color: var(--status-amber); }
.toast-body { flex: 1; }
.toast-title { font-size: 13px; font-weight: 700; color: var(--ink-900); }
.toast-msg { font-size: 12px; color: var(--ink-600); margin-top: 2px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }

/* Animation utilities */
.fade-in { animation: fadeUp 0.3s ease; }
.pulse { animation: pulse 2s ease infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* QR display */
.qr-display {
  background: #fff;
  padding: 20px;
  border-radius: var(--r-lg);
  display: inline-block;
  box-shadow: var(--shadow-md);
}
.qr-display canvas { display: block; }

.stat-big {
  font-size: 48px;
  font-weight: 800;
  color: var(--gadri-blue);
  letter-spacing: -2px;
  line-height: 1;
}
.stat-label-big {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--ink-500);
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 8px;
}

/* Mobile responsive */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr !important; }
  .sidebar { 
    position: fixed !important; 
    top: 0; 
    bottom: 0;
    transform: translateX(-100%); 
    transition: transform 0.3s ease; 
    z-index: 50; 
    width: 280px; 
    max-width: 85vw;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }
  html[dir="rtl"] .sidebar { 
    transform: translateX(100%); 
    right: 0;
    left: auto;
    box-shadow: -4px 0 24px rgba(0,0,0,0.3);
  }
  .sidebar.open { transform: translateX(0) !important; }
  .login-wrap:not(.gadri-v4) { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .content-area { padding: 16px; }
  .topbar { padding: 14px 16px; gap: 8px; }
  .topbar-title h1 { font-size: 18px; }
  .topbar-title p { font-size: 12px; }
  
  /* Mobile menu button — show only on mobile */
  .mobile-menu-btn { display: flex !important; }
  
  /* Mobile overlay */
  .mobile-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 40;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
    display: none;
  }
  .mobile-overlay.active {
    opacity: 1; pointer-events: auto;
    display: block;
  }
  
  /* Modals: full width on mobile */
  .modal { 
    width: 95% !important; 
    max-width: 95vw !important; 
    max-height: 90vh !important;
  }
  
  /* Hide page subtitle on mobile to save space */
  .topbar-title p { display: none; }
}

@media (max-width: 480px) {
  .topbar-title h1 { font-size: 16px; }
  .content-area { padding: 12px; }
}

/* صفحة الموظّفين — على الجوال فقط: تقديم الإجراءات الأساسية (موظّف جديد + إضافة من جسر)
   إلى السطر الأول عبر order، دون تغيير ترتيب DOM ودون أي تأثير على الديسكتوب. */
@media (max-width: 480px) {
  .emp-act-new  { order: -2; }
  .emp-act-jisr { order: -1; }
}

/* ═══════════════════════════════════════════════════════════════════════
   📱 GLOBAL MOBILE FIXES - إصلاحات شاملة لكل صفحات النظام
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {

  /* ─── 0️⃣ عنوان الصفحة (topbar): محاذاة لليمين بجوار زر القائمة ───
     عند التفاف التوب-بار تنزل الأزرار لسطر ثانٍ، وكان space-between يدفع
     العنوان لأقصى اليسار. flex:1 يجعله يملأ السطر فيُحاذى نصّه لليمين (RTL)
     ملاصقًا لزر القائمة. min-width:0 + ellipsis يمنعان كسر التخطيط
     بالعناوين الطويلة. مقصور على الجوال فلا يتأثّر الديسكتوب. */
  .topbar-title {
    flex: 1 1 auto;
    min-width: 0;
    text-align: start;
  }
  .topbar-title h1 {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ─── 1️⃣ الجداول: scroll أفقي بدلاً من تشويش الصفحة ─── */
  .card table,
  .card-body table,
  main table:not(.matrix-table table) {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    white-space: nowrap !important;
    /* مظهر السكرول */
    scrollbar-width: thin;
  }
  .card table::-webkit-scrollbar,
  main table::-webkit-scrollbar {
    height: 6px;
  }
  .card table::-webkit-scrollbar-thumb,
  main table::-webkit-scrollbar-thumb {
    background: var(--gadri-gold, #C9A96A);
    border-radius: 3px;
  }
  
  /* الجداول ذات الحاوية الخاصة (مثل matrix) */
  .matrix-table { overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; }
  
  /* ─── 2️⃣ الـ Charts: تأكيد التكيف ─── */
  canvas {
    max-width: 100% !important;
    height: auto !important;
    max-height: 280px !important;
  }
  
  /* ─── 3️⃣ النماذج: منع zoom التلقائي على iOS ─── */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="search"],
  input[type="date"],
  input[type="datetime-local"],
  input[type="time"],
  textarea,
  select {
    font-size: 16px !important; /* منع zoom على iOS */
  }
  
  /* ─── 4️⃣ Modals: تكيف أفضل ─── */
  .modal {
    width: 100% !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  .modal-body {
    max-height: calc(100vh - 140px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  
  /* ─── 5️⃣ Cards: padding أصغر ─── */
  .card {
    padding: 14px !important;
    border-radius: 10px !important;
  }
  .card-head { padding: 12px 14px !important; }
  .card-head h3 { font-size: 15px !important; }
  
  /* ─── 6️⃣ KPI Cards: تأكيد أنها column واحد على الشاشات الصغيرة ─── */
  .kpi-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .kpi-value { font-size: 22px !important; }
  .kpi-label { font-size: 11px !important; }
  
  /* ─── 7️⃣ الأزرار: حجم مناسب للمس (44px أدنى حد) ─── */
  .btn {
    min-height: 44px !important;
    padding: 10px 14px !important;
    font-size: 14px !important;
  }
  .btn-sm { min-height: 36px !important; padding: 8px 10px !important; }
  
  /* ─── 8️⃣ Topbar: منع تكدس الأزرار ─── */
  .topbar {
    flex-wrap: wrap !important;
    padding: 10px 12px !important;
    gap: 6px !important;
  }
  .topbar-right {
    gap: 4px !important;
  }
  .topbar-right .theme-toggle,
  .topbar-right .notif-btn,
  .topbar-right .user-chip {
    padding: 8px !important;
  }
  
  /* ─── 9️⃣ Filters Bar: عمود واحد ─── */
  .filters-bar,
  .filter-bar,
  .search-filter-bar {
    flex-direction: column !important;
    gap: 10px !important;
  }
  .filters-bar > *,
  .filter-bar > * {
    width: 100% !important;
  }
  
  /* ─── 🔟 Tabs: scroll أفقي ─── */
  .tabs,
  .tab-list {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    scrollbar-width: none;
  }
  .tabs::-webkit-scrollbar,
  .tab-list::-webkit-scrollbar { display: none; }
  
  /* ─── 1️⃣1️⃣ Page Hero: padding أقل ─── */
  .page-hero-pro,
  .page-hero {
    padding: 16px !important;
    border-radius: 12px !important;
  }
  
  /* ─── 1️⃣2️⃣ User Chip في الأعلى - تصغير ─── */
  .user-chip-name { display: none !important; }
  .user-chip-greeting { display: none !important; }
  .user-chip { padding: 6px !important; }

  /* ─── إخفاء topbar-status pills في الموبايل ─── */
  #topbarStatus { display: none !important; }
}

/* جوال صغير - تشديد المعالجات */
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: 1fr !important; }
  
  /* أيقونات أصغر */
  .topbar svg { width: 18px !important; height: 18px !important; }
  
  /* تخفي العناصر الزخرفية */
  .topbar-decoration,
  .topbar-bg-pattern { display: none !important; }
}

/* جوال صغير جداً (تحت 380px) */
@media (max-width: 380px) {
  .content-area { padding: 8px !important; }
  .card { padding: 10px !important; }
  .kpi-card { padding: 12px !important; }
  .kpi-value { font-size: 20px !important; }
}

/* ═══════════════════════════════════════════════════════════════════════
   📋 Text Selection Policy — Allow copy by default
   نسمح بنسخ النصوص افتراضياً (احترافي + مفيد للمستخدم)
   نمنع التحديد فقط على عناصر الواجهة (أزرار، أيقونات، إلخ)
   ═══════════════════════════════════════════════════════════════════════ */

/* ✅ افتراضياً: السماح بتحديد ونسخ النصوص في كل مكان */
* {
  -webkit-tap-highlight-color: transparent !important;
}

/* 🎯 السماح الصريح بالنسخ للنصوص والمحتوى */
body, p, span, div, h1, h2, h3, h4, h5, h6,
td, th, li, dd, dt, label, code, pre,
.cell, .modal-body, .card, .info, .text,
[role="article"], article, section {
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

/* 🚫 منع التحديد على عناصر الواجهة فقط (أزرار، أيقونات، تنقل) */
button, a, .btn, .icon, .nav-item, .nav-label,
.sidebar, .topbar, .menu-item, .dropdown-item,
[role="button"], [role="menuitem"], [role="tab"],
.close, .toggle, .switch, .badge,
.modal-head, .card-header > .actions,
.tab, .tabs, .pagination, .breadcrumb,
input[type="checkbox"], input[type="radio"],
.checkbox-label, .radio-label,
img, svg, .emoji-only {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}

/* ✅ Inputs: text cursor + قابلية النسخ */
input, textarea, [contenteditable="true"], [contenteditable=""] {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  cursor: text !important;
}

/* 🎨 تنسيق التحديد بهويّة قادري */
::selection {
  background: rgba(30, 79, 203, 0.25);
  color: #0F1E4D;
}
[data-theme="dark"] ::selection {
  background: rgba(212, 175, 55, 0.35);
  color: #FFFFFF;
}

/* Remove all outlines */
button, a, [role="button"], [tabindex] {
  outline: none !important;
}
button:focus, a:focus, [role="button"]:focus, [tabindex]:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* Mobile menu toggle button — hidden by default on desktop */
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--ink-200);
  border-radius: 10px;
  cursor: pointer;
  color: var(--ink-700);
  transition: all 0.2s;
  flex-shrink: 0;
}
.mobile-menu-btn:hover {
  background: rgba(37, 101, 237, 0.1);
  color: var(--gadri-blue);
}
.mobile-menu-btn svg {
  width: 20px; height: 20px;
}

/* Hide overlay by default */
.mobile-overlay {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   V3 EXTENSIONS — Copilot · Command Palette · Daily Brief · Timeline ·
   Achievement Wall · 3D Certificate · Cinematic Login · Themes · More
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Particle canvas (login cinematic bg) ────────────────────────────── */
#loginParticles {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.login-screen { position: relative; overflow: hidden; }
.login-screen > *:not(#loginParticles) { position: relative; z-index: 1; }

/* ── Daily Quote (rotates) ─────────────────────────────────────────── */
.login-quote {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 2; text-align: center; max-width: 600px; padding: 0 24px;
  color: rgba(255,255,255,0.85); font-style: italic; font-size: 14px;
  opacity: 0; animation: fadeInUp 1.2s ease 0.6s forwards;
}
.login-quote .q-author { display: block; margin-top: 4px; font-size: 12px; opacity: 0.7; font-style: normal; }
@keyframes fadeInUp { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ── Command Palette (Cmd+K) ─────────────────────────────────────────── */
.cmdk-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: none; align-items: flex-start; justify-content: center;
  padding-top: 12vh; z-index: 9999; animation: fadeIn 0.15s ease;
}
.cmdk-overlay.open { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.cmdk-box {
  width: 92%; max-width: 640px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 16px;
  box-shadow: var(--shadow-xl);
  overflow: hidden; animation: slideDown 0.2s ease;
}
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.cmdk-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.cmdk-input-wrap svg { flex-shrink: 0; opacity: 0.5; }
.cmdk-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: 'Cairo', sans-serif; font-size: 16px; color: var(--text-primary);
}
.cmdk-kbd {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 2px 8px; font-size: 11px; font-weight: 600;
  color: var(--text-secondary);
}

.cmdk-results { max-height: 420px; overflow-y: auto; padding: 8px; }
.cmdk-group-label {
  padding: 10px 14px 6px; font-size: 11px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
}
.cmdk-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 8px; cursor: pointer;
  transition: background 0.12s ease;
}
.cmdk-item:hover, .cmdk-item.selected { background: var(--bg-surface); }
.cmdk-item.selected { background: var(--primary-50); }
[data-theme="dark"] .cmdk-item.selected { background: rgba(37,101,237,0.2); }
.cmdk-item-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--primary-50); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
[data-theme="dark"] .cmdk-item-icon { background: rgba(37,101,237,0.2); }
.cmdk-item-text { flex: 1; min-width: 0; }
.cmdk-item-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.cmdk-item-sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.cmdk-item-type {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  background: var(--bg-surface); color: var(--text-secondary); font-weight: 600;
}
.cmdk-empty { padding: 40px 20px; text-align: center; color: var(--text-muted); }
.cmdk-footer {
  padding: 10px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 16px; font-size: 11px; color: var(--text-muted);
}
.cmdk-footer span { display: flex; align-items: center; gap: 6px; }

/* ── Copilot (AI Assistant) ──────────────────────────────────────────── */
.copilot-fab {
  position: fixed; bottom: 24px;
  left: 24px;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #4F46E5 100%);
  color: white; border: none; cursor: pointer;
  box-shadow: 0 8px 24px rgba(37,101,237,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 900; transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
[dir="ltr"] .copilot-fab { left: auto; right: 24px; }
.copilot-fab:hover { transform: scale(1.1) rotate(5deg); box-shadow: 0 12px 32px rgba(37,101,237,0.5); }
.copilot-fab::after {
  content: ''; position: absolute; inset: -4px;
  border-radius: 50%; background: inherit; opacity: 0.4;
  animation: pulse-ring 2s ease-out infinite; z-index: -1;
}
@keyframes pulse-ring {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(1.4); opacity: 0; }
}

.copilot-panel {
  position: fixed; bottom: 90px; left: 24px;
  width: 400px; max-width: calc(100vw - 48px);
  height: 560px; max-height: calc(100vh - 120px);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow-xl);
  display: none; flex-direction: column; overflow: hidden;
  z-index: 899; animation: copilotIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
[dir="ltr"] .copilot-panel { left: auto; right: 24px; }
.copilot-panel.open { display: flex; }
@keyframes copilotIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.copilot-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, #4F46E5 100%);
  color: white;
}
.copilot-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.2); display: flex;
  align-items: center; justify-content: center; font-size: 20px;
}
.copilot-header h3 { font-size: 15px; font-weight: 700; margin: 0; color: white; }
.copilot-header small { font-size: 11px; opacity: 0.85; }
.copilot-close {
  margin-inline-start: auto; background: rgba(255,255,255,0.15);
  border: none; color: white; width: 32px; height: 32px;
  border-radius: 50%; cursor: pointer; font-size: 18px;
}
.copilot-close:hover { background: rgba(255,255,255,0.25); }

.copilot-messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.copilot-msg {
  max-width: 85%; padding: 12px 14px; border-radius: 14px;
  font-size: 14px; line-height: 1.6; word-wrap: break-word;
  animation: msgIn 0.3s ease;
}
@keyframes msgIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.copilot-msg.user {
  align-self: flex-end; background: var(--primary); color: white;
  border-bottom-right-radius: 4px;
}
[dir="rtl"] .copilot-msg.user { border-bottom-right-radius: 14px; border-bottom-left-radius: 4px; }
.copilot-msg.ai {
  align-self: flex-start; background: var(--bg-surface);
  color: var(--text-primary); border-bottom-left-radius: 4px;
}
[dir="rtl"] .copilot-msg.ai { border-bottom-left-radius: 14px; border-bottom-right-radius: 4px; }
.copilot-msg.ai.thinking { color: var(--text-secondary); font-style: italic; }
.copilot-msg .typing-dots {
  display: inline-flex; gap: 3px; align-items: center;
}
.copilot-msg .typing-dots span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted);
  animation: typingBlink 1.4s infinite;
}
.copilot-msg .typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.copilot-msg .typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBlink { 0%, 60%, 100% { opacity: 0.3; } 30% { opacity: 1; } }

.copilot-suggestions {
  padding: 8px 16px; display: flex; flex-wrap: wrap; gap: 6px;
  border-top: 1px solid var(--border);
}
.copilot-chip {
  padding: 6px 12px; border-radius: 14px;
  background: var(--bg-surface); border: 1px solid var(--border);
  font-size: 12px; cursor: pointer; color: var(--text-primary);
  transition: all 0.15s ease;
}
.copilot-chip:hover { background: var(--primary-50); border-color: var(--primary); color: var(--primary); }
[data-theme="dark"] .copilot-chip:hover { background: rgba(37,101,237,0.2); }

.copilot-input-wrap {
  padding: 12px 16px; border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: center;
}
.copilot-input {
  flex: 1; padding: 10px 14px; border-radius: 20px;
  border: 1px solid var(--border); background: var(--bg-surface);
  font-family: 'Cairo', sans-serif; font-size: 14px; color: var(--text-primary);
  outline: none;
}
.copilot-input:focus { border-color: var(--primary); }
.copilot-send {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--primary); color: white; border: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.copilot-send:hover { background: var(--primary-hover); }
.copilot-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Page Hero Pro - Professional Flat Header (Linear/Stripe style) ── */
.page-hero-pro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
}
.page-hero-pro::before {
  content: '';
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  width: 3px;
  height: 100%;
  background: var(--hero-accent, var(--gadri-blue));
}
.page-hero-pro-content {
  flex: 1;
  min-width: 0;
}
.page-hero-pro-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--hero-accent-bg, var(--gadri-blue-soft));
  color: var(--hero-accent, var(--gadri-blue));
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.page-hero-pro-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--ink-900);
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.page-hero-pro-title-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--hero-accent-bg, var(--gadri-blue-soft));
  color: var(--hero-accent, var(--gadri-blue));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.page-hero-pro-subtitle {
  font-size: 13px;
  color: var(--ink-500);
  margin: 0;
  line-height: 1.5;
}
.page-hero-pro-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .page-hero-pro {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }
  .page-hero-pro-title { font-size: 18px; }
  .page-hero-pro-subtitle { font-size: 12px; }
  .page-hero-pro-actions { justify-content: flex-end; }
}

/* ── Smart Dashboard Context Bar ──────────────────────────────── */
.dashboard-context-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 20px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}
.context-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.context-greeting {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-900);
}
.greeting-icon {
  font-size: 20px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.context-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-700);
  font-weight: 500;
}
.meta-pill .meta-icon {
  width: 12px;
  height: 12px;
  opacity: 0.7;
}
.meta-pill-success {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
  color: #047857;
}
[data-theme="dark"] .meta-pill-success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.status-online {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  animation: pulse-status 2s infinite;
}
@keyframes pulse-status {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.05); }
}
.dashboard-actions {
  display: flex;
  gap: 8px;
}
.btn-icon-pro {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--ink-700);
}
.btn-icon-pro svg {
  width: 16px;
  height: 16px;
}
.btn-icon-pro:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 101, 237, 0.25);
}

/* ── KPI Cards Enhanced - بطاقات قابلة للنقر مع تأثيرات احترافية ── */
.kpi-card[role="button"] {
  cursor: pointer;
  position: relative;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.kpi-card[role="button"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.10);
  border-color: var(--primary);
}
[data-theme="dark"] .kpi-card[role="button"]:hover {
  box-shadow: 0 12px 28px rgba(37,101,237,0.25);
}
.kpi-card[role="button"]:active {
  transform: translateY(-1px);
}
.kpi-card[role="button"]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.kpi-arrow {
  position: absolute;
  bottom: 12px;
  inset-inline-end: 14px;
  font-size: 16px;
  color: var(--ink-500);
  opacity: 0;
  transform: translateX(-8px);
  transition: all 0.25s ease;
  font-weight: 700;
}
[dir="rtl"] .kpi-arrow {
  transform: translateX(8px);
}
.kpi-card[role="button"]:hover .kpi-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--primary);
}

/* ── Quick Actions Strip - شريط الإجراءات السريعة (Linear style) ─── */
.quick-actions-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.quick-action-card {
  background: var(--bg-card);
  border: 0.5px solid rgba(15,23,42,0.08);
  border-radius: 10px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .quick-action-card {
  border-color: rgba(255,255,255,0.08);
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.quick-action-card:hover {
  transform: translateY(-1px);
  border-color: rgba(37,101,237,0.3);
  box-shadow: 0 1px 2px rgba(15,23,42,0.04), 0 2px 8px rgba(37,101,237,0.08);
}
.quick-action-icon-wrap {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.quick-action-icon-wrap svg {
  width: 14px;
  height: 14px;
}
.quick-action-blue   { background: var(--gadri-blue-soft); color: var(--gadri-blue-dark); }
.quick-action-green  { background: var(--gadri-green-soft); color: #138446; }
.quick-action-purple { background: #EEF2FF; color: #4338CA; }
.quick-action-amber  { background: var(--status-amber-soft); color: var(--status-amber); }
.quick-action-pink   { background: var(--gadri-pink-soft); color: #B5478B; }
[data-theme="dark"] .quick-action-blue   { background: rgba(74,133,245,0.15); color: #fff; }
[data-theme="dark"] .quick-action-green  { background: rgba(91,191,127,0.15); color: #5BBF7F; }
[data-theme="dark"] .quick-action-purple { background: rgba(139,92,246,0.15); color: #C4B5FD; }
[data-theme="dark"] .quick-action-amber  { background: rgba(251,191,36,0.15); color: #FBBF24; }
[data-theme="dark"] .quick-action-pink   { background: rgba(246,174,206,0.15); color: #F6AECE; }

.quick-action-text-wrap { flex: 1; min-width: 0; }
.quick-action-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-900);
  margin-bottom: 1px;
  letter-spacing: -0.005em;
}
.quick-action-sub {
  font-size: 11px;
  color: var(--ink-500);
  font-weight: 400;
}

/* ── KPI Section Title - عنوان القسم احترافي ─────────────────── */
.kpi-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 12.5px;
  padding: 0 2px;
}
.kpi-section-title-text {
  font-weight: 600;
  color: var(--ink-700);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.005em;
}
.kpi-section-title-text-icon { 
  font-size: 14px;
  opacity: 0.65;
}
.kpi-section-link {
  font-size: 11.5px;
  color: var(--gadri-blue);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s ease;
  letter-spacing: -0.005em;
}
.kpi-section-link:hover { opacity: 0.75; }

/* Mobile */
@media (max-width: 760px) {
  .quick-actions-strip { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
@media (max-width: 480px) {
  .quick-actions-strip { grid-template-columns: 1fr; }
}

/* Mobile responsiveness for context bar */
@media (max-width: 640px) {
  .dashboard-context-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .context-greeting { font-size: 15px; }
  .context-meta { font-size: 11px; gap: 6px; }
  .meta-pill { padding: 3px 8px; font-size: 11px; }
}

@media (max-width: 520px) {
  .copilot-panel { left: 8px; right: 8px; width: auto; bottom: 86px; }
  .cmdk-box { margin: 0 12px; }
}

/* ── Achievement Wall ────────────────────────────────────────────────── */
.achievement-wall { display: grid; gap: 16px; }
.achievement-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 18px; display: flex; gap: 14px;
  align-items: center; position: relative; overflow: hidden;
  transition: transform 0.2s ease;
}
.achievement-card:hover { transform: translateY(-2px); }
.achievement-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(37,101,237,0.05), transparent);
  transform: translateX(-100%); transition: transform 0.6s ease;
}
.achievement-card:hover::before { transform: translateX(100%); }
.achievement-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; flex-shrink: 0;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 4px 12px rgba(245,158,11,0.4);
}
.achievement-icon.cert { background: linear-gradient(135deg, #2565ED 0%, #4F46E5 100%); box-shadow: 0 4px 12px rgba(37,101,237,0.4); }
.achievement-icon.badge-diamond { background: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%); }
.achievement-icon.course { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.achievement-text { flex: 1; }
.achievement-title { font-weight: 700; font-size: 15px; color: var(--text-primary); }
.achievement-desc { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.achievement-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.achievement-congrats {
  position: absolute; top: 12px; inset-inline-end: 12px;
  background: var(--success-50); color: var(--success);
  padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700;
}

/* ── Employee Timeline ───────────────────────────────────────────────── */
.timeline-wrap { position: relative; padding: 20px 0; }
.timeline-line {
  position: absolute; top: 0; bottom: 0;
  inset-inline-start: 28px; width: 2px;
  background: linear-gradient(180deg, var(--primary), var(--border));
}
.timeline-event {
  position: relative; padding-inline-start: 64px; padding-bottom: 24px;
}
.timeline-dot {
  position: absolute; inset-inline-start: 16px; top: 4px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-card); border: 3px solid var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; z-index: 1;
}
.timeline-dot.success { border-color: var(--success); }
.timeline-dot.warning { border-color: var(--warning); }
.timeline-dot.accent { border-color: #f59e0b; }
.timeline-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
}
.timeline-date { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.timeline-title { font-weight: 700; color: var(--text-primary); font-size: 14px; }
.timeline-desc { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }

/* ── 3D Certificate Effect ───────────────────────────────────────────── */
.cert-3d-wrap {
  perspective: 1500px; padding: 40px 20px;
  display: flex; justify-content: center; align-items: center;
}
.cert-3d {
  transition: transform 0.2s cubic-bezier(0.3, 0.7, 0.4, 1);
  transform-style: preserve-3d;
  will-change: transform;
}

/* ── Theme Picker ────────────────────────────────────────────────────── */
.theme-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin-top: 12px;
}
.theme-swatch {
  border: 2px solid var(--border); border-radius: 12px;
  padding: 12px; cursor: pointer; text-align: center;
  transition: all 0.2s ease; background: var(--bg-card);
}
.theme-swatch:hover { transform: translateY(-2px); }
.theme-swatch.active { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50); }
[data-theme="dark"] .theme-swatch.active { box-shadow: 0 0 0 3px rgba(37,101,237,0.3); }
.theme-swatch-colors { display: flex; gap: 4px; justify-content: center; margin-bottom: 8px; }
.theme-swatch-colors span { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--bg-card); }
.theme-swatch-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }

[data-color-theme="gadri"] { --primary: #2565ED; --primary-hover: #1d4fc4; --primary-50: #dbeafe; }
[data-color-theme="emerald"] { --primary: #059669; --primary-hover: #047857; --primary-50: #d1fae5; }
[data-color-theme="wine"] { --primary: #9f1239; --primary-hover: #881337; --primary-50: #ffe4e6; }
[data-color-theme="rose"] { --primary: #e11d48; --primary-hover: #be123c; --primary-50: #ffe4e6; }
[data-color-theme="amber"] { --primary: #d97706; --primary-hover: #b45309; --primary-50: #fef3c7; }
[data-color-theme="purple"] { --primary: #7c3aed; --primary-hover: #6d28d9; --primary-50: #ede9fe; }

/* ── Mentions (@) in comments ────────────────────────────────────────── */
.mention {
  background: var(--primary-50); color: var(--primary);
  padding: 1px 6px; border-radius: 6px; font-weight: 600;
  cursor: pointer;
}
[data-theme="dark"] .mention { background: rgba(37,101,237,0.2); }

.comments-section {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
}
.comment-item { display: flex; gap: 10px; padding: 10px 0; }
.comment-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 12px; flex-shrink: 0;
}
.comment-content {
  flex: 1; background: var(--bg-surface); padding: 10px 12px;
  border-radius: 12px; border-top-left-radius: 4px;
}
[dir="rtl"] .comment-content { border-top-right-radius: 4px; border-top-left-radius: 12px; }
.comment-author { font-size: 12px; font-weight: 700; color: var(--text-primary); }
.comment-time { font-size: 10px; color: var(--text-muted); margin-inline-start: 8px; }
.comment-body { font-size: 13px; color: var(--text-primary); margin-top: 4px; line-height: 1.6; }

.comment-input-wrap { display: flex; gap: 8px; margin-top: 12px; align-items: flex-start; }
.comment-input {
  flex: 1; min-height: 60px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-surface); font-family: 'Cairo', sans-serif;
  font-size: 13px; color: var(--text-primary); resize: vertical;
}
.mention-dropdown {
  position: absolute; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-lg);
  max-height: 200px; overflow-y: auto; z-index: 100; min-width: 200px;
}
.mention-option {
  padding: 8px 12px; cursor: pointer; display: flex;
  align-items: center; gap: 8px; font-size: 13px;
}
.mention-option:hover, .mention-option.selected { background: var(--bg-surface); }

/* ── Voice Recording ────────────────────────────────────────────────── */
.voice-recorder {
  background: var(--bg-card); border: 2px dashed var(--border);
  border-radius: 16px; padding: 32px; text-align: center;
  transition: all 0.2s ease;
}
.voice-recorder.recording {
  border-color: var(--danger); background: var(--danger-50);
  animation: recordPulse 2s ease infinite;
}
[data-theme="dark"] .voice-recorder.recording { background: rgba(239,68,68,0.15); }
@keyframes recordPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(239,68,68,0); }
}
.voice-btn {
  width: 80px; height: 80px; border-radius: 50%;
  background: var(--primary); color: white; border: none;
  cursor: pointer; font-size: 32px; margin-bottom: 12px;
  transition: all 0.2s ease;
}
.voice-btn:hover { transform: scale(1.05); }
.voice-recorder.recording .voice-btn { background: var(--danger); }
.voice-timer { font-family: 'Courier New', monospace; font-size: 22px; font-weight: 700; color: var(--text-primary); }
.voice-wave { display: none; align-items: center; justify-content: center; gap: 3px; height: 40px; margin-top: 12px; }
.voice-recorder.recording .voice-wave { display: flex; }
.voice-wave span {
  width: 4px; background: var(--danger); border-radius: 2px;
  animation: waveAnim 1s ease infinite;
}
.voice-wave span:nth-child(1) { animation-delay: 0s; }
.voice-wave span:nth-child(2) { animation-delay: 0.1s; }
.voice-wave span:nth-child(3) { animation-delay: 0.2s; }
.voice-wave span:nth-child(4) { animation-delay: 0.3s; }
.voice-wave span:nth-child(5) { animation-delay: 0.4s; }
@keyframes waveAnim { 0%, 100% { height: 8px; } 50% { height: 30px; } }

/* ── Suggestions Box (ideas) ─────────────────────────────────────────── */
.idea-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 14px; padding: 16px; margin-bottom: 12px;
}
.idea-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 8px; }
.idea-title { font-weight: 700; font-size: 15px; color: var(--text-primary); }
.idea-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.idea-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}
.vote-btn {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 6px 14px; cursor: pointer;
  display: flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--text-primary); transition: all 0.15s ease;
}
.vote-btn:hover { border-color: var(--primary); color: var(--primary); }
.vote-btn.voted { background: var(--primary); color: white; border-color: var(--primary); }

/* ── Decision Intelligence Insights ──────────────────────────────────── */
.insight-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-inline-start: 4px solid var(--primary);
  border-radius: 12px; padding: 16px; margin-bottom: 12px;
  display: flex; gap: 14px; align-items: flex-start;
}
.insight-card.alert { border-inline-start-color: var(--danger); }
.insight-card.warn { border-inline-start-color: var(--warning); }
.insight-card.success { border-inline-start-color: var(--success); }
.insight-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--primary-50); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.insight-card.alert .insight-icon { background: var(--danger-50); color: var(--danger); }
.insight-card.warn .insight-icon { background: var(--warning-50); color: var(--warning); }
.insight-card.success .insight-icon { background: var(--success-50); color: var(--success); }
[data-theme="dark"] .insight-card.alert .insight-icon { background: rgba(239,68,68,0.2); }
[data-theme="dark"] .insight-card.warn .insight-icon { background: rgba(245,158,11,0.2); }
[data-theme="dark"] .insight-card.success .insight-icon { background: rgba(16,185,129,0.2); }
.insight-body { flex: 1; }
.insight-title { font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.insight-text { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.insight-action {
  display: inline-block; margin-top: 8px; color: var(--primary);
  font-size: 13px; font-weight: 600; cursor: pointer;
}

/* ── Smart Scheduler (best time suggestion) ──────────────────────────── */
.time-slot {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 10px;
  border: 2px solid var(--border); cursor: pointer;
  transition: all 0.15s ease; margin-bottom: 8px;
  background: var(--bg-card);
}
.time-slot:hover { border-color: var(--primary); }
.time-slot.recommended { border-color: var(--success); background: var(--success-50); }
[data-theme="dark"] .time-slot.recommended { background: rgba(16,185,129,0.15); }
.time-slot-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 10px;
  background: var(--success); color: white; font-weight: 700; margin-inline-start: auto;
}
.time-slot-availability { font-size: 12px; color: var(--text-secondary); }

/* ── Live collaboration indicator ───────────────────────────────────── */
.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 10px;
  background: var(--danger-50); color: var(--danger);
  font-size: 11px; font-weight: 700;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--danger);
  animation: liveBlink 1.4s ease infinite;
}
@keyframes liveBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.8); }
}

.collaborators-avatars { display: flex; margin-inline-start: 8px; }
.collab-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); color: white; border: 2px solid var(--bg-card);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  margin-inline-start: -8px;
}

/* ── Confetti ─────────────────────────────────────────────────────── */
.confetti-wrap {
  position: fixed; inset: 0; pointer-events: none; z-index: 10000;
  overflow: hidden;
}
.confetti {
  position: absolute; width: 10px; height: 10px;
  animation: confettiFall 3s linear forwards;
}
@keyframes confettiFall {
  0% { transform: translateY(-100vh) rotate(0); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════
   ✨ PREMIUM LOGIN SCREEN — Cinematic redesign
   ═══════════════════════════════════════════════════════════════════════ */

/* Force grid rows to stretch full height */
.login-wrap.premium-login {
  grid-template-rows: 1fr !important;
  align-items: stretch !important;
}

/* Base wrapper override */
.premium-login {
  background: radial-gradient(ellipse at top left, #0a1a3a 0%, #0a1128 40%, #05080f 100%);
  position: relative;
  overflow: hidden;
  height: 100vh !important;
  min-height: 100vh !important;
  max-height: 100vh !important;
  width: 100%;
}
/* 🎨 شاشة الدخول دائماً داكنة (في الوضعين النهاري والليلي) لأن ذلك يبرز هوية العلامة الذهبية */
[data-theme="light"] .premium-login,
:root:not([data-theme="dark"]) .premium-login {
  background: radial-gradient(ellipse at top left, #0a1a3a 0%, #0a1128 40%, #05080f 100%);
}

/* Ensure body/html fills viewport when login is shown */
html:has(#loginScreen.login-wrap:not([style*="display: none"])) ,
body:has(#loginScreen.login-wrap:not([style*="display: none"])) {
  height: 100vh;
  overflow: hidden;
}

/* Animated wave layers */
.login-waves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.wave-path {
  animation: waveFloat 14s ease-in-out infinite;
  transform-origin: center bottom;
}
.wave-path.wave-2 { animation-duration: 18s; animation-delay: -3s; }
.wave-path.wave-3 { animation-duration: 22s; animation-delay: -6s; }
@keyframes waveFloat {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50%      { transform: translateY(-20px) scaleY(1.04); }
}

/* Floating decorative marks */
.float-decor {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
}
.float-bean {
  position: absolute;
  font-size: 18px;
  color: rgba(99, 142, 237, 0.15);
  animation: floatBean 8s ease-in-out infinite;
}
[data-theme="light"] .float-bean { color: rgba(37, 101, 237, 0.12); }
@keyframes floatBean {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.3; }
  50%      { transform: translateY(-30px) rotate(180deg); opacity: 0.7; }
}

/* Particles canvas z-index */
#loginParticles { z-index: 2; opacity: 0.5; }

/* LEFT SIDE — Cinematic brand */
.premium-art {
  position: relative;
  z-index: 3;
  background: transparent !important;
  padding: 40px 56px !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #f1f5f9;
  height: 100vh !important;
  overflow-y: auto;
}
[data-theme="light"] .premium-art {
  color: #1e293b;
}

.premium-art .login-art-inner {
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 560px;
  align-items: flex-start;
}

/* Custom Logo */
.premium-logo {
  display: inline-flex;
  position: relative;
  animation: logoEntrance 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.premium-logo-svg {
  width: 320px;
  max-width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 32px rgba(37, 101, 237, 0.35)) drop-shadow(0 4px 12px rgba(251, 191, 36, 0.25));
}
@keyframes logoEntrance {
  from { opacity: 0; transform: scale(0.85) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.premium-kicker {
  font-family: 'Courier New', 'Cairo', monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3.5px;
  color: #FBBF24;
  opacity: 0.95;
  animation: fadeSlide 0.8s ease 0.2s both;
  padding: 6px 14px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 20px;
  align-self: flex-start;
}
[data-theme="light"] .premium-kicker {
  color: #B45309;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(180, 83, 9, 0.25);
}

.premium-title {
  font-family: 'Cairo', serif;
  margin: 0;
  line-height: 1;
  animation: fadeSlide 0.9s ease 0.4s both;
}
.premium-title .title-ar {
  display: block;
  font-size: clamp(48px, 6vw, 82px);
  font-weight: 900;
  background: linear-gradient(135deg, #fff 0%, #93c5fd 60%, #60a5fa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -2px;
  margin-bottom: 4px;
  text-shadow: 0 0 60px rgba(96, 165, 250, 0.3);
}
[data-theme="light"] .premium-title .title-ar {
  background: linear-gradient(135deg, #1e293b 0%, #2563eb 60%, #1d4ed8 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
.premium-title .title-en {
  display: block;
  font-size: clamp(16px, 1.6vw, 22px);
  font-weight: 300;
  letter-spacing: 14px;
  color: rgba(255,255,255,0.4);
  text-transform: uppercase;
  margin-top: 6px;
}
[data-theme="light"] .premium-title .title-en { color: rgba(30,41,59,0.5); }

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

/* Ornate divider with 3 dots */
.premium-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  animation: fadeSlide 1s ease 0.6s both;
}
.premium-divider span {
  display: block;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.6), transparent);
}
.premium-divider span:nth-child(1) { width: 60px; }
.premium-divider span:nth-child(2) {
  width: 7px; height: 7px; border-radius: 50%;
  background: #FBBF24; box-shadow: 0 0 14px #FBBF24;
  flex: none;
}
.premium-divider span:nth-child(3) { flex: 1; max-width: 200px; }
[data-theme="light"] .premium-divider span:nth-child(2) {
  background: #D97706; box-shadow: 0 0 14px rgba(217, 119, 6, 0.6);
}

/* Philosophical quote block */
.premium-quote {
  position: relative;
  padding: 22px 26px;
  background: linear-gradient(135deg, rgba(37, 101, 237, 0.10) 0%, rgba(251, 191, 36, 0.06) 100%);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeSlide 1.1s ease 0.8s both;
  max-width: 520px;
  box-shadow: 0 4px 24px rgba(37, 101, 237, 0.1);
}
[data-theme="light"] .premium-quote {
  background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(254, 243, 199, 0.5) 100%);
  border-color: rgba(180, 83, 9, 0.2);
}
.premium-quote .quote-mark {
  position: absolute;
  top: -10px; inset-inline-start: 18px;
  font-family: 'Georgia', serif;
  font-size: 56px;
  font-weight: 900;
  color: #FBBF24;
  line-height: 1;
  opacity: 0.6;
  pointer-events: none;
  background: #0a1128;
  padding: 0 8px;
  border-radius: 50%;
}
[data-theme="light"] .premium-quote .quote-mark {
  color: #D97706;
  background: #ffffff;
}
.premium-quote .quote-text {
  font-family: 'Cairo', serif;
  font-size: 17px;
  font-weight: 500;
  line-height: 1.85;
  color: rgba(255,255,255,0.95);
  margin: 0;
  position: relative;
  z-index: 1;
  transition: opacity 0.6s ease;
}
[data-theme="light"] .premium-quote .quote-text { color: #1e293b; }
.premium-quote .quote-sub {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #FBBF24;
  text-transform: uppercase;
  transition: opacity 0.6s ease;
}
[data-theme="light"] .premium-quote .quote-sub { color: #B45309; }

/* Stats pills */
.premium-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeSlide 1.2s ease 1s both;
}
.stat-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}
.stat-pill:hover {
  transform: translateY(-2px);
  background: rgba(96, 165, 250, 0.12);
  border-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 8px 24px rgba(37, 101, 237, 0.2);
}
[data-theme="light"] .stat-pill {
  background: rgba(255,255,255,0.85);
  border-color: rgba(37, 101, 237, 0.15);
}
.stat-pill .stat-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2565ED 0%, #1e40af 100%);
  color: white;
  flex: none;
  box-shadow: 0 4px 12px rgba(37, 101, 237, 0.3);
}
.stat-pill:nth-child(2) .stat-icon {
  background: linear-gradient(135deg, #FBBF24 0%, #D97706 100%);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.35);
}
.stat-pill:nth-child(3) .stat-icon {
  background: linear-gradient(135deg, #ffffff 0%, #e5e7eb 100%);
  color: #1e40af;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}
.stat-pill .stat-icon svg { width: 18px; height: 18px; }
.stat-pill .stat-num {
  font-size: 22px;
  font-weight: 800;
  color: rgba(255,255,255,0.95);
  line-height: 1;
}
[data-theme="light"] .stat-pill .stat-num { color: #1e293b; }
.stat-pill .stat-label {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  margin-top: 3px;
}
[data-theme="light"] .stat-pill .stat-label { color: #64748b; }

/* Trust badges */
.premium-trust {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  animation: fadeSlide 1.3s ease 1.2s both;
}
.trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
}
[data-theme="light"] .trust-badge {
  background: rgba(255,255,255,0.7);
  border-color: rgba(30,41,59,0.1);
  color: #475569;
}

.premium-art .art-footer {
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.35);
  text-transform: uppercase;
  margin-top: 40px;
}
[data-theme="light"] .premium-art .art-footer { color: rgba(30,41,59,0.4); }

/* RIGHT SIDE — Premium form */
.premium-form-side {
  position: relative;
  z-index: 3;
  background: rgba(10, 17, 40, 0.7) !important;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-inline-start: 1px solid rgba(96, 165, 250, 0.15);
  display: flex !important;
  flex-direction: column !important;
  height: 100vh !important;
  overflow-y: auto;
}
[data-theme="light"] .premium-form-side {
  background: rgba(10, 17, 40, 0.7) !important;
  border-inline-start-color: rgba(96, 165, 250, 0.15);
}

.premium-form {
  padding: 32px 48px !important;
  max-width: 480px;
  margin: 0 auto !important;
  flex: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  width: 100%;
}

/* Mobile-only brand (hidden on desktop) */
.mobile-brand {
  display: none;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
[data-theme="light"] .mobile-brand { border-bottom-color: rgba(30,41,59,0.08); }
.mobile-logo { width: 48px; height: 48px; border-radius: 12px; }

.premium-welcome {
  margin-bottom: 32px;
}
.welcome-tag {
  display: inline-block;
  padding: 5px 14px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(37, 101, 237, 0.1));
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #FBBF24;
  text-transform: uppercase;
  margin-bottom: 14px;
  animation: fadeSlide 0.8s ease both;
}
[data-theme="light"] .welcome-tag {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(37, 101, 237, 0.05));
  color: #B45309;
  border-color: rgba(180, 83, 9, 0.25);
}
.premium-welcome h1 {
  font-size: 36px !important;
  font-weight: 800 !important;
  line-height: 1.15 !important;
  margin: 0 0 10px !important;
  color: rgba(255,255,255,0.98);
  letter-spacing: -1px;
  animation: fadeSlide 0.9s ease 0.1s both;
}
[data-theme="light"] .premium-welcome h1 { color: #0f172a; }
.premium-welcome h1 .accent {
  background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.premium-welcome .subtitle {
  font-size: 14px !important;
  line-height: 1.75 !important;
  color: rgba(255,255,255,0.55) !important;
  margin: 0 !important;
  animation: fadeSlide 1s ease 0.2s both;
}
[data-theme="light"] .premium-welcome .subtitle { color: #64748b !important; }

/* Premium input fields */
.premium-field {
  animation: fadeSlide 1s ease both;
  margin-bottom: 18px !important;
}
.premium-field:nth-of-type(2) { animation-delay: 0.3s; }
.premium-field:nth-of-type(3) { animation-delay: 0.4s; }
.premium-field label {
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px;
  color: rgba(255,255,255,0.7) !important;
  margin-bottom: 8px !important;
  display: block;
}
[data-theme="light"] .premium-field label { color: #334155 !important; }

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap .input-icon {
  position: absolute;
  inset-inline-start: 14px;
  width: 18px; height: 18px;
  color: rgba(255,255,255,0.4);
  pointer-events: none;
  transition: color 0.2s ease;
}
[data-theme="light"] .input-wrap .input-icon { color: #94a3b8; }
.input-wrap input {
  width: 100%;
  padding: 14px 16px 14px 46px !important;
  background: rgba(255,255,255,0.04) !important;
  border: 1.5px solid rgba(255,255,255,0.08) !important;
  border-radius: 12px !important;
  color: rgba(255,255,255,0.95) !important;
  font-family: 'Cairo', sans-serif !important;
  font-size: 15px !important;
  transition: all 0.25s ease;
}
[dir="rtl"] .input-wrap input { padding: 14px 46px 14px 16px !important; }
[data-theme="light"] .input-wrap input {
  background: rgba(248, 250, 252, 0.9) !important;
  border-color: rgba(30,41,59,0.1) !important;
  color: #0f172a !important;
}
.input-wrap input::placeholder { color: rgba(255,255,255,0.3); }
[data-theme="light"] .input-wrap input::placeholder { color: #94a3b8; }
.input-wrap input:focus {
  outline: none;
  background: rgba(255,255,255,0.07) !important;
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.12), 0 4px 16px rgba(37,101,237,0.15) !important;
}
[data-theme="light"] .input-wrap input:focus {
  background: #fff !important;
  box-shadow: 0 0 0 4px rgba(37, 101, 237, 0.12), 0 4px 16px rgba(37,101,237,0.1) !important;
}
.input-wrap input:focus ~ .input-icon { color: #60a5fa; }

.pwd-toggle {
  position: absolute;
  inset-inline-end: 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: rgba(255,255,255,0.4);
  padding: 6px;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.pwd-toggle:hover { color: #60a5fa; background: rgba(96, 165, 250, 0.08); }
.pwd-toggle svg { width: 16px; height: 16px; }
[data-theme="light"] .pwd-toggle { color: #94a3b8; }
[data-theme="light"] .pwd-toggle:hover { color: #2563eb; background: rgba(37, 101, 237, 0.08); }

/* Premium login button */
.premium-login-btn {
  width: 100%;
  padding: 16px 24px !important;
  background: linear-gradient(135deg, #1e40af 0%, #2565ED 40%, #3b82f6 100%) !important;
  background-size: 200% 200% !important;
  animation: btnGradient 8s ease infinite;
  color: white !important;
  border: none !important;
  border-radius: 14px !important;
  font-family: 'Cairo', sans-serif !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  cursor: pointer;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(37, 101, 237, 0.4), inset 0 1px 0 rgba(255,255,255,0.2) !important;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
  margin-top: 8px;
}
@keyframes btnGradient {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.premium-login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(37, 101, 237, 0.55), inset 0 1px 0 rgba(251, 191, 36, 0.3) !important;
}
.premium-login-btn:active { transform: translateY(0); }
.premium-login-btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.3), transparent);
  transition: left 0.6s ease;
}
.premium-login-btn:hover::before { left: 100%; }
.login-btn-arrow {
  width: 18px; height: 18px;
  transition: transform 0.25s ease;
}
.premium-login-btn:hover .login-btn-arrow { transform: translateX(4px); }
[dir="rtl"] .premium-login-btn:hover .login-btn-arrow { transform: translateX(-4px) scaleX(-1); }
[dir="rtl"] .login-btn-arrow { transform: scaleX(-1); }

/* Premium hint */
.premium-hint {
  margin-top: 24px;
  padding: 14px 16px;
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: rgba(255,255,255,0.75);
  animation: fadeSlide 1.1s ease 0.6s both;
}
[data-theme="light"] .premium-hint {
  background: rgba(37, 101, 237, 0.05);
  border-color: rgba(37, 101, 237, 0.15);
  color: #475569;
}
.premium-hint code {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(96, 165, 250, 0.15);
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #93c5fd;
  font-weight: 700;
  margin: 0 2px;
}
[data-theme="light"] .premium-hint code {
  background: rgba(37, 101, 237, 0.1);
  color: #1d4ed8;
}

/* Login footer refined */
.premium-form-side .login-footer {
  padding: 20px 48px !important;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  text-align: center;
  letter-spacing: 0.5px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
[data-theme="light"] .premium-form-side .login-footer {
  color: #94a3b8;
  border-top-color: rgba(255,255,255,0.05);
}
.premium-form-side .login-footer strong { color: #60a5fa; font-weight: 700; }
[data-theme="light"] .premium-form-side .login-footer strong { color: #60a5fa; }
.premium-form-side .login-footer .dot { opacity: 0.4; margin: 0 8px; }

/* Theme toggle + lang switcher refined for premium look */
.premium-form-side .login-top-bar {
  padding: 24px 48px !important;
  justify-content: flex-end !important;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
[data-theme="light"] .premium-form-side .login-top-bar {
  border-bottom-color: rgba(255,255,255,0.04);
}
.premium-form-side .theme-toggle,
.premium-form-side .lang-switcher {
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
}
[data-theme="light"] .premium-form-side .theme-toggle,
[data-theme="light"] .premium-form-side .lang-switcher {
  background: rgba(255,255,255,0.05) !important;
  border-color: rgba(255,255,255,0.08) !important;
}

/* Login error state */
.premium-form .login-err {
  background: rgba(239, 68, 68, 0.1) !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
  color: #fca5a5 !important;
  padding: 12px 16px !important;
  border-radius: 10px !important;
  font-size: 13px !important;
  margin-bottom: 16px;
}
[data-theme="light"] .premium-form .login-err {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #fca5a5 !important;
}

/* Hide old login-quote (we have built-in philosophical quote now) */
.premium-login + #loginQuote, .premium-login #loginQuote { display: none; }

/* ═══════════════════════════════════════════════════════════════════
   🎨 توحيد شاشة الدخول داكنة في الوضعين النهاري والليلي
   ═══════════════════════════════════════════════════════════════════ */

/* الجانب الفني (الشعار + الإحصائيات) */
[data-theme="light"] .premium-art {
  background: transparent !important;
}
[data-theme="light"] .premium-kicker {
  color: #FBBF24 !important;
  background: rgba(251, 191, 36, 0.08) !important;
  border: 1px solid rgba(251, 191, 36, 0.25) !important;
}
[data-theme="light"] .premium-title .title-ar { 
  color: #FBBF24 !important;
}
[data-theme="light"] .premium-title .title-en { 
  color: rgba(255, 255, 255, 0.5) !important;
}
[data-theme="light"] .premium-divider span:nth-child(2) {
  color: rgba(251, 191, 36, 0.85) !important;
}
[data-theme="light"] .premium-quote {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(96, 165, 250, 0.1) !important;
}
[data-theme="light"] .premium-quote .quote-mark {
  color: #FBBF24 !important;
}
[data-theme="light"] .premium-quote .quote-text { 
  color: rgba(255, 255, 255, 0.92) !important;
}
[data-theme="light"] .premium-quote .quote-sub { 
  color: #FBBF24 !important;
}
[data-theme="light"] .premium-art .art-footer { 
  color: rgba(255, 255, 255, 0.4) !important;
}

/* النموذج (form side) */
[data-theme="light"] .premium-welcome h1 { 
  color: #FBBF24 !important;
}
[data-theme="light"] .premium-welcome .subtitle { 
  color: rgba(255, 255, 255, 0.7) !important;
}
[data-theme="light"] .premium-field label { 
  color: rgba(255, 255, 255, 0.85) !important;
}
[data-theme="light"] .input-wrap .input-icon { 
  color: rgba(255, 255, 255, 0.4) !important;
}
[data-theme="light"] .input-wrap input {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
}
[data-theme="light"] .input-wrap input::placeholder { 
  color: rgba(255, 255, 255, 0.3) !important;
}
[data-theme="light"] .input-wrap input:focus {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(96, 165, 250, 0.5) !important;
}

/* الـ hint السفلي */
[data-theme="light"] .premium-hint {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.7) !important;
}
[data-theme="light"] .premium-hint code {
  background: rgba(255, 255, 255, 0.05) !important;
  color: #FBBF24 !important;
}

/* الإحصائيات (24/7, 6, 13) */
[data-theme="light"] .premium-stats,
[data-theme="light"] .premium-art .stat-item,
[data-theme="light"] .premium-art [class*="stat"] {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: white !important;
}

/* Responsive — mobile */
@media (max-width: 968px) {
  .premium-art { display: none !important; }
  .premium-form-side { width: 100% !important; max-width: 100% !important; }
  .premium-form { padding: 20px 28px !important; }
  .premium-form-side .login-top-bar { padding: 18px 28px !important; }
  .premium-form-side .login-footer { padding: 16px 28px !important; }
  .mobile-brand { display: flex; }
  .premium-welcome h1 { font-size: 28px !important; }
}
@media (max-width: 480px) {
  .premium-form { padding: 16px 20px !important; }
  .premium-welcome h1 { font-size: 24px !important; }
}

/* ── New v3 badge ───────────────────────────────────────────────────── */
.v3-new {
  display: inline-block; font-size: 9px; font-weight: 800;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  color: white; padding: 2px 6px; border-radius: 6px;
  margin-inline-start: 6px; vertical-align: middle;
}


/* ═══════════════════════════════════════════════════════════
   🎨 GADRI ACADEMY - LOGIN V6 (Clean & Simple)
═══════════════════════════════════════════════════════════ */

/* الحاوية - 3 أعمدة بسيطة */
#loginScreen.login-wrap.gadri-v4 {
  display: grid !important;
  grid-template-columns: 1fr 1fr 1fr !important;
  grid-template-rows: 1fr !important;
  align-items: center !important;
  justify-items: center !important;
  min-height: 100vh !important;
  width: 100% !important;
  background: linear-gradient(135deg, #FAF7EF 0%, #F9F6EE 50%, #F4F0E4 100%) !important;
  position: relative !important;
  overflow: hidden !important;
  padding: 40px !important;
  gap: 30px !important;
  box-sizing: border-box !important;
  /* مهم: نلغي direction على الحاوية لتفادي تأثيره على Grid */
  direction: ltr !important;
}
/* فرض الإخفاء عندما يضع JS style="display: none" */
#loginScreen.login-wrap.gadri-v4[style*="display: none"],
#loginScreen.login-wrap.gadri-v4[style*="display:none"],
#loginScreen.login-wrap.gadri-v4[hidden] {
  display: none !important;
}
[data-theme="dark"] #loginScreen.login-wrap.gadri-v4 {
  background: linear-gradient(135deg, #0F2240 0%, #0B1A33 50%, #061226 100%) !important;
}

/* خطوط دائرية زخرفية في الخلفية */
#loginScreen.login-wrap.gadri-v4::before,
#loginScreen.login-wrap.gadri-v4::after {
  content: '';
  position: absolute;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    circle,
    transparent 30%, rgba(37, 101, 237, 0.05) 30.5%, transparent 31%,
    transparent 40%, rgba(37, 101, 237, 0.04) 40.5%, transparent 41%,
    transparent 50%, rgba(37, 101, 237, 0.05) 50.5%, transparent 51%,
    transparent 60%, rgba(37, 101, 237, 0.03) 60.5%, transparent 61%
  );
}
#loginScreen.login-wrap.gadri-v4::before { top: 50%; left: -350px; transform: translateY(-50%); }
#loginScreen.login-wrap.gadri-v4::after { top: 50%; right: -350px; transform: translateY(-50%); }
[data-theme="dark"] #loginScreen.login-wrap.gadri-v4::before,
[data-theme="dark"] #loginScreen.login-wrap.gadri-v4::after {
  background: radial-gradient(circle,
    transparent 30%, rgba(255,255,255,0.04) 30.5%, transparent 31%,
    transparent 40%, rgba(255,255,255,0.03) 40.5%, transparent 41%,
    transparent 50%, rgba(255,255,255,0.04) 50.5%, transparent 51%);
}

/* ════════════════════════════════════════════
   العمود 1 (يسار): الفورم
   ════════════════════════════════════════════ */
.gadri-v4 .gv4-form-side {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 100%;
  max-width: 420px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 2;
  direction: rtl;
}
html[dir="ltr"] .gadri-v4 .gv4-form-side { direction: ltr; }

/* شريط علوي: لغة + ثيم */
.gadri-v4 .gv4-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 60px;
  direction: ltr;
  align-self: center;
}
.gadri-v4 .gv4-lang-switcher {
  display: inline-flex;
  background: #FFFFFF;
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  box-shadow: 0 2px 8px rgba(11, 26, 51, 0.08);
}
[data-theme="dark"] .gadri-v4 .gv4-lang-switcher {
  background: #1a2940;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.gadri-v4 .gv4-lang-switcher button {
  border: none;
  background: transparent;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 999px;
  color: #64748B;
  font-family: inherit;
  transition: all 0.2s;
  min-width: 50px;
}
.gadri-v4 .gv4-lang-switcher button.active {
  background: #2565ED;
  color: #FFFFFF;
}
[data-theme="dark"] .gadri-v4 .gv4-lang-switcher button { color: #94A3B8; }

.gadri-v4 .gv4-theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #FFFFFF;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(11, 26, 51, 0.08);
  transition: transform 0.3s;
  flex-shrink: 0;
  color: #C9A96A;
}
[data-theme="dark"] .gadri-v4 .gv4-theme-toggle {
  background: #1a2940;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.gadri-v4 .gv4-theme-toggle:hover { transform: rotate(180deg); }
.gadri-v4 .gv4-theme-toggle svg { width: 18px; height: 18px; }

/* الترحيب */
.gadri-v4 .gv4-welcome { text-align: center; margin-bottom: 28px; }
.gadri-v4 .gv4-welcome-title {
  font-size: 32px;
  font-weight: 800;
  color: #0B1A33;
  margin: 0 0 12px;
}
[data-theme="dark"] .gadri-v4 .gv4-welcome-title { color: #FFFFFF; }
.gadri-v4 .gv4-welcome-sub {
  font-size: 14px;
  color: #64748B;
  line-height: 1.7;
  margin: 0;
}
[data-theme="dark"] .gadri-v4 .gv4-welcome-sub { color: #94A3B8; }

/* رسالة خطأ */
.gadri-v4 .gv4-err {
  display: none;
  background: #FEE2E2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 14px;
  text-align: center;
  font-weight: 600;
}
.gadri-v4 .gv4-err.show { display: block; }
[data-theme="dark"] .gadri-v4 .gv4-err {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.4);
  color: #FCA5A5;
}

/* الحقول */
.gadri-v4 .gv4-field { margin-bottom: 18px; }
.gadri-v4 .gv4-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 8px;
  text-align: right;
}
html[dir="ltr"] .gadri-v4 .gv4-label { text-align: left; }
[data-theme="dark"] .gadri-v4 .gv4-label { color: #CBD5E1; }

.gadri-v4 .gv4-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border-radius: 14px;
  border: 1.5px solid transparent;
  transition: all 0.2s;
  box-shadow: 0 2px 6px rgba(11, 26, 51, 0.05);
}
[data-theme="dark"] .gadri-v4 .gv4-input-wrap {
  background: #1a2940;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.gadri-v4 .gv4-input-wrap:focus-within {
  border-color: #2565ED;
  box-shadow: 0 0 0 3px rgba(37, 101, 237, 0.15);
}
.gadri-v4 .gv4-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 16px 18px;
  font-size: 14px;
  color: #0B1A33;
  font-family: inherit;
  outline: none;
  width: 100%;
  text-align: right;
  direction: ltr;
}
html[dir="ltr"] .gadri-v4 .gv4-input-wrap input { text-align: left; }
.gadri-v4 .gv4-input-wrap input::placeholder { color: #94A3B8; }
[data-theme="dark"] .gadri-v4 .gv4-input-wrap input { color: #FFFFFF; }
[data-theme="dark"] .gadri-v4 .gv4-input-wrap input::placeholder { color: #64748B; }

.gadri-v4 .gv4-input-icon {
  width: 18px;
  height: 18px;
  margin: 0 16px;
  color: #94A3B8;
  flex-shrink: 0;
  transition: all 0.3s;
}
.gadri-v4 .gv4-input-wrap:focus-within .gv4-input-icon {
  color: #2565ED;
}
[data-theme="dark"] .gadri-v4 .gv4-input-icon { color: #64748B; }

.gadri-v4 .gv4-pwd-toggle {
  background: none;
  border: none;
  padding: 0 16px;
  cursor: pointer;
  color: #94A3B8;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.gadri-v4 .gv4-pwd-toggle:hover { color: #2565ED; }
.gadri-v4 .gv4-pwd-toggle svg { width: 18px; height: 18px; }

/* تذكرني */
.gadri-v4 .gv4-remember {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 24px;
}
.gadri-v4 .gv4-remember-box {
  width: 22px;
  height: 22px;
  border: 2px solid #C9A96A;
  border-radius: 6px;
  background: #C9A96A;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s;
  margin-top: 1px;
}
.gadri-v4 .gv4-remember:hover .gv4-remember-box { transform: scale(1.1); }
.gadri-v4 .gv4-remember-check {
  width: 14px;
  height: 14px;
  color: #FFFFFF;
}
.gadri-v4 .gv4-remember.unchecked .gv4-remember-box {
  background: transparent;
  border-color: #94A3B8;
}
.gadri-v4 .gv4-remember.unchecked .gv4-remember-check { display: none; }
.gadri-v4 .gv4-remember-text {
  font-size: 14px;
  font-weight: 700;
  color: #0B1A33;
  margin-bottom: 4px;
}
[data-theme="dark"] .gadri-v4 .gv4-remember-text { color: #FFFFFF; }
.gadri-v4 .gv4-remember-hint {
  font-size: 12px;
  color: #64748B;
}
[data-theme="dark"] .gadri-v4 .gv4-remember-hint { color: #94A3B8; }

/* زر الدخول */
.gadri-v4 .gv4-btn-login {
  width: 100%;
  padding: 16px 20px;
  background: linear-gradient(135deg, #2565ED 0%, #1E4FB8 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.3s;
  box-shadow: 0 6px 18px rgba(37, 101, 237, 0.3);
  font-family: inherit;
  margin-bottom: 16px;
}
.gadri-v4 .gv4-btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(37, 101, 237, 0.45);
}
.gadri-v4 .gv4-btn-login:active { transform: translateY(0); }
.gadri-v4 .gv4-btn-login:disabled { opacity: 0.7; cursor: wait; }
.gadri-v4 .gv4-btn-login svg { width: 18px; height: 18px; }
html[dir="rtl"] .gadri-v4 .gv4-btn-login svg { transform: scaleX(-1); }

/* ملاحظة الأمان */
.gadri-v4 .gv4-secure-note {
  text-align: center;
  font-size: 13px;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 24px;
}
[data-theme="dark"] .gadri-v4 .gv4-secure-note { color: #94A3B8; }
.gadri-v4 .gv4-secure-note svg { width: 14px; height: 14px; color: #C9A96A; }

/* ════════════════════════════════════════════
   العمود 2 (وسط): الباب
   ════════════════════════════════════════════ */
.gadri-v4 .gv4-hero-image {
  grid-column: 2 !important;
  grid-row: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 100%;
  width: 100%;
  position: relative;
  z-index: 1;
}
.gadri-v4 .gv4-hero-image img {
  max-width: 100%;
  max-height: 90vh;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(11, 26, 51, 0.12));
  transition: transform 0.4s ease;
}
[data-theme="dark"] .gadri-v4 .gv4-hero-image img {
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.5));
}
.gadri-v4 .gv4-hero-image:hover img {
  transform: scale(1.02);
}

/* الصورتين النهارية والليلية */
.gadri-v4 .gv4-hero-img-light { display: block !important; }
.gadri-v4 .gv4-hero-img-dark { display: none !important; }
[data-theme="dark"] .gadri-v4 .gv4-hero-img-light { display: none !important; }
[data-theme="dark"] .gadri-v4 .gv4-hero-img-dark { display: block !important; }

/* ════════════════════════════════════════════
   العمود 3 (يمين): الشعار + النص الإلهامي
   ════════════════════════════════════════════ */
.gadri-v4 .gv4-brand-side {
  grid-column: 3 !important;
  grid-row: 1 !important;
  width: 100%;
  max-width: 520px;
  height: 100%;
  padding: 40px 16px;
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  position: relative;
  z-index: 2;
  /* نص يبدأ من اليمين دائماً */
  text-align: right;
}

/* ════════════════════════════════════════════
   🏛️ الشعار - Modern Premium Style
   ════════════════════════════════════════════ */
.gadri-v4 .gv4-hero-brand {
  text-align: right;
  position: relative;
}

/* الماسة الكبيرة فوق الاسم */
.gadri-v4 .gv4-brand-crown {
  font-size: 22px;
  color: #C9A96A;
  text-align: center;
  margin-bottom: 12px;
  display: block;
  background: linear-gradient(135deg, #E5C07B 0%, #C9A96A 50%, #A88752 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 6px rgba(201, 169, 106, 0.4));
  animation: gv4CrownFloat 4s ease-in-out infinite;
}
@keyframes gv4CrownFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* اسم العلامة بالعربي - أنحف، gradient ذهبي→كحلي */
.gadri-v4 .gv4-hero-brand-ar {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin: 0;
  text-align: center;
  font-family: 'Cairo', 'Tajawal', system-ui, sans-serif;
  direction: rtl;
  white-space: nowrap;
  background: linear-gradient(135deg, #C9A96A 0%, #1E3A6F 50%, #0B1A33 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  animation: gv4GradientShift 8s ease-in-out infinite;
  display: block;
}
[data-theme="dark"] .gadri-v4 .gv4-hero-brand-ar {
  background: linear-gradient(135deg, #C9A96A 0%, #FFFFFF 50%, #C9A96A 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
}

/* خط ذهبي زخرفي تحت الاسم */
.gadri-v4 .gv4-brand-underline {
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, #C9A96A 50%, transparent 100%);
  margin: 14px auto;
  position: relative;
}
.gadri-v4 .gv4-brand-underline::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #E5C07B 0%, #C9A96A 100%);
  box-shadow: 0 1px 4px rgba(201, 169, 106, 0.4);
}

/* اسم العلامة بالإنجليزي - أنيق ومتباعد */
.gadri-v4 .gv4-hero-brand-en {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 10px;
  color: #C9A96A;
  text-transform: uppercase;
  text-align: center;
  display: block;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  margin-top: 8px;
  text-indent: 10px; /* compensates for letter-spacing */
}

/* ════════════════════════════════════════════
   💎 الاقتباس اليومي المتحرك
   ════════════════════════════════════════════ */
.gadri-v4 .gv4-rotating-quote {
  position: relative;
  margin: auto 0;
  padding: 24px 28px 24px 36px;
  background: linear-gradient(135deg, rgba(201, 169, 106, 0.08) 0%, rgba(201, 169, 106, 0.02) 100%);
  border-right: 3px solid #C9A96A;
  border-radius: 8px;
  text-align: right;
  direction: rtl;
  transition: opacity 0.6s ease;
}
[data-theme="dark"] .gadri-v4 .gv4-rotating-quote {
  background: linear-gradient(135deg, rgba(201, 169, 106, 0.12) 0%, rgba(201, 169, 106, 0.04) 100%);
}

/* علامة الاقتباس الكبيرة */
.gadri-v4 .gv4-rotating-quote-mark {
  position: absolute;
  top: -10px;
  right: 20px;
  font-size: 60px;
  color: #C9A96A;
  font-family: 'Georgia', serif;
  line-height: 1;
  opacity: 0.4;
  font-weight: 900;
}

/* نص الاقتباس */
.gadri-v4 .gv4-rotating-quote-text {
  font-size: 18px;
  font-weight: 600;
  color: #475569;
  line-height: 1.7;
  font-style: italic;
  margin: 0;
  font-family: 'Cairo', 'Tajawal', system-ui, sans-serif;
}
[data-theme="dark"] .gadri-v4 .gv4-rotating-quote-text { color: #CBD5E1; }

/* مؤلف الاقتباس */
.gadri-v4 .gv4-rotating-quote-author {
  font-size: 13px;
  color: #C9A96A;
  font-weight: 700;
  font-style: normal;
  margin-top: 12px;
  letter-spacing: 0.5px;
}

/* تأثير الانتقال (fade) */
.gadri-v4 .gv4-rotating-quote.gv4-fade-out {
  opacity: 0;
}

/* ════════════════════════════════════════════
   ✨ النص الإلهامي - بصمة قادري الثابتة
   ════════════════════════════════════════════ */
.gadri-v4 .gv4-tagline {
  text-align: right;
}

.gadri-v4 .gv4-tagline-ar {
  font-size: 38px;
  font-weight: 800;
  color: #0B1A33;
  line-height: 1.5;
  margin: 0;
  letter-spacing: -0.5px;
  font-family: 'Cairo', 'Tajawal', system-ui, sans-serif;
  direction: rtl;
}
[data-theme="dark"] .gadri-v4 .gv4-tagline-ar { color: #FFFFFF; }
.gadri-v4 .gv4-tagline-ar .gold {
  background: linear-gradient(135deg, #E5C07B 0%, #C9A96A 50%, #A88752 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
}

.gadri-v4 .gv4-tagline-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 28px 0;
  justify-content: flex-start;
  direction: rtl;
}
html[dir="ltr"] .gadri-v4 .gv4-tagline-divider { direction: rtl; }
.gadri-v4 .gv4-tagline-divider .line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, #2565ED, transparent);
  max-width: 280px;
}
.gadri-v4 .gv4-tagline-divider .diamond {
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, #4F8AF7 0%, #2565ED 50%, #1A4FB8 100%);
  transform: rotate(45deg);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(37, 101, 237, 0.4);
}

.gadri-v4 .gv4-tagline-en {
  font-size: 18px;
  font-weight: 700;
  color: #2565ED;
  letter-spacing: 3px;
  line-height: 1.8;
  text-transform: uppercase;
  direction: ltr;
  text-align: right;
}
.gadri-v4 .gv4-tagline-en .gold {
  background: linear-gradient(135deg, #E5C07B 0%, #C9A96A 50%, #A88752 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 900;
}
[data-theme="dark"] .gadri-v4 .gv4-tagline-en { color: #4F8AF7; }

/* ════════════════════════════════════════════
   النجوم المتحركة
   ════════════════════════════════════════════ */
.gadri-v4 .gv4-stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.gadri-v4 .gv4-star {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #C9A96A;
  opacity: 0;
  animation: gv4StarTwinkle 4s ease-in-out infinite;
}
[data-theme="dark"] .gadri-v4 .gv4-star {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.8);
}
@keyframes gv4StarTwinkle {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 0.8; transform: scale(1); }
}
.gadri-v4 .gv4-star:nth-child(1) { top: 12%; left: 8%; animation-delay: 0s; }
.gadri-v4 .gv4-star:nth-child(2) { top: 28%; left: 92%; animation-delay: 0.7s; }
.gadri-v4 .gv4-star:nth-child(3) { top: 65%; left: 5%; animation-delay: 1.4s; }
.gadri-v4 .gv4-star:nth-child(4) { top: 78%; left: 15%; animation-delay: 2.1s; }
.gadri-v4 .gv4-star:nth-child(5) { top: 22%; left: 45%; animation-delay: 2.8s; }
.gadri-v4 .gv4-star:nth-child(6) { top: 88%; left: 88%; animation-delay: 3.5s; }
.gadri-v4 .gv4-star:nth-child(7) { top: 45%; left: 2%; animation-delay: 1.0s; }
.gadri-v4 .gv4-star:nth-child(8) { top: 8%; left: 75%; animation-delay: 1.8s; }
.gadri-v4 .gv4-star:nth-child(9) { top: 55%; left: 95%; animation-delay: 2.5s; }
.gadri-v4 .gv4-star:nth-child(10) { top: 35%; left: 35%; animation-delay: 0.3s; }
.gadri-v4 .gv4-star:nth-child(11) { top: 72%; left: 55%; animation-delay: 3.2s; }
.gadri-v4 .gv4-star:nth-child(12) { top: 18%; left: 25%; animation-delay: 1.5s; }

/* ═══════════════════════════════════════════════════════════
   ✨ GADRI SIGNATURE - 17 لمسة سحرية
═══════════════════════════════════════════════════════════ */

/* ─── 1. شعاع ضوء يتسلل من الباب ─── */
.gadri-v4 .gv4-light-beam {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 400px;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 215, 130, 0.25) 0%,
    rgba(255, 215, 130, 0.1) 30%,
    transparent 70%
  );
  filter: blur(20px);
  pointer-events: none;
  z-index: 1;
  animation: gv4BeamPulse 6s ease-in-out infinite;
}
[data-theme="dark"] .gadri-v4 .gv4-light-beam {
  background: radial-gradient(
    ellipse at center,
    rgba(255, 255, 255, 0.2) 0%,
    rgba(180, 200, 255, 0.1) 30%,
    transparent 70%
  );
}
@keyframes gv4BeamPulse {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(0.95); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
}

/* ─── 2. جسيمات ذهبية صاعدة ─── */
.gadri-v4 .gv4-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.gadri-v4 .gv4-particle {
  position: absolute;
  bottom: -10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #C9A96A;
  box-shadow: 0 0 6px rgba(201, 169, 106, 0.6);
  opacity: 0;
  animation: gv4ParticleRise 14s linear infinite;
}
[data-theme="dark"] .gadri-v4 .gv4-particle {
  background: rgba(255, 215, 150, 0.9);
  box-shadow: 0 0 8px rgba(255, 215, 150, 0.8);
}
@keyframes gv4ParticleRise {
  0% { opacity: 0; transform: translateY(0) translateX(0); }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-100vh) translateX(20px); }
}
.gadri-v4 .gv4-particle:nth-child(1) { left: 35%; animation-delay: 0s; animation-duration: 14s; }
.gadri-v4 .gv4-particle:nth-child(2) { left: 45%; animation-delay: 2s; animation-duration: 16s; }
.gadri-v4 .gv4-particle:nth-child(3) { left: 55%; animation-delay: 4s; animation-duration: 12s; }
.gadri-v4 .gv4-particle:nth-child(4) { left: 38%; animation-delay: 6s; animation-duration: 18s; }
.gadri-v4 .gv4-particle:nth-child(5) { left: 48%; animation-delay: 8s; animation-duration: 14s; }
.gadri-v4 .gv4-particle:nth-child(6) { left: 58%; animation-delay: 10s; animation-duration: 16s; }
.gadri-v4 .gv4-particle:nth-child(7) { left: 42%; animation-delay: 12s; animation-duration: 13s; }
.gadri-v4 .gv4-particle:nth-child(8) { left: 52%; animation-delay: 1s; animation-duration: 17s; }

/* ─── 3. زخارف عربية في الخلفية ─── */
.gadri-v4 .gv4-arabic-pattern {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
  background-image: 
    radial-gradient(circle at 20% 30%, transparent 18%, currentColor 18.5%, currentColor 19%, transparent 19.5%),
    radial-gradient(circle at 80% 70%, transparent 18%, currentColor 18.5%, currentColor 19%, transparent 19.5%),
    radial-gradient(circle at 50% 50%, transparent 25%, currentColor 25.5%, currentColor 26%, transparent 26.5%);
  background-size: 200px 200px, 250px 250px, 300px 300px;
  color: #2565ED;
}
[data-theme="dark"] .gadri-v4 .gv4-arabic-pattern {
  color: #C9A96A;
  opacity: 0.06;
}

/* ─── 4. الباب يطفو ─── */
.gadri-v4 .gv4-hero-image img {
  animation: gv4FloatDoor 6s ease-in-out infinite;
}
@keyframes gv4FloatDoor {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.gadri-v4 .gv4-hero-image:hover img {
  animation: none;
  transform: scale(1.02);
}

/* ─── 5. glassmorphism فاخر على الفورم ─── */
.gadri-v4 .gv4-form-side {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 
    0 8px 32px rgba(11, 26, 51, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
[data-theme="dark"] .gadri-v4 .gv4-form-side {
  background: rgba(15, 34, 64, 0.4);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ─── 6. ماسة الفاصل تنبض كقلب ─── */
.gadri-v4 .gv4-tagline-divider .diamond {
  animation: gv4HeartBeat 1.5s ease-in-out infinite;
}
@keyframes gv4HeartBeat {
  0%, 100% { 
    transform: rotate(45deg) scale(1);
    box-shadow: 0 2px 8px rgba(37, 101, 237, 0.4);
  }
  14% { 
    transform: rotate(45deg) scale(1.2);
    box-shadow: 0 2px 16px rgba(37, 101, 237, 0.6);
  }
  28% { transform: rotate(45deg) scale(1); }
  42% { 
    transform: rotate(45deg) scale(1.15);
    box-shadow: 0 2px 14px rgba(37, 101, 237, 0.5);
  }
  70% { transform: rotate(45deg) scale(1); }
}

/* ─── 7. الشعار gradient متحرك ─── */
.gadri-v4 .gv4-hero-brand-ar {
  background: linear-gradient(135deg, #0B1A33 0%, #1E3A6F 50%, #0B1A33 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
  animation: gv4GradientShift 8s ease-in-out infinite;
}
[data-theme="dark"] .gadri-v4 .gv4-hero-brand-ar {
  background: linear-gradient(135deg, #FFFFFF 0%, #C9A96A 50%, #FFFFFF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% auto;
}
@keyframes gv4GradientShift {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

/* ─── 8. shimmer على الكلمات الذهبية ─── */
.gadri-v4 .gv4-tagline-ar .gold,
.gadri-v4 .gv4-tagline-en .gold {
  position: relative;
  display: inline-block;
}
.gadri-v4 .gv4-tagline-ar .gold::after,
.gadri-v4 .gv4-tagline-en .gold::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.6) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: gv4ShimmerText 4s ease-in-out infinite;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(black, black);
}
@keyframes gv4ShimmerText {
  0%, 100% { background-position: -200% 0; opacity: 0; }
  50% { background-position: 200% 0; opacity: 1; }
}

/* ─── 9. الترحيب gradient أزرق→ذهبي ─── */
.gadri-v4 .gv4-welcome-title {
  background: linear-gradient(135deg, #0B1A33 0%, #2565ED 60%, #C9A96A 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}
[data-theme="dark"] .gadri-v4 .gv4-welcome-title {
  background: linear-gradient(135deg, #FFFFFF 0%, #4F8AF7 60%, #C9A96A 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── 10. خط ذهبي زخرفي تحت الترحيب ─── */
.gadri-v4 .gv4-welcome::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #C9A96A, transparent);
  margin: 12px auto 0;
  border-radius: 999px;
}

/* ─── 11. الحقول 3D + underline animation ─── */
.gadri-v4 .gv4-input-wrap {
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.gadri-v4 .gv4-input-wrap::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #2565ED, transparent);
  transform: translateX(-50%);
  transition: width 0.4s ease;
}
.gadri-v4 .gv4-input-wrap:focus-within::after { width: 100%; }
.gadri-v4 .gv4-input-wrap:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 101, 237, 0.15);
}

/* ─── 12. أيقونات الحقول تتفاعل ─── */
.gadri-v4 .gv4-input-wrap:focus-within .gv4-input-icon {
  color: #2565ED;
  transform: scale(1.15);
}

/* ─── 13. زر تذكرني ─── */
.gadri-v4 .gv4-remember:hover .gv4-remember-box {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(201, 169, 106, 0.4);
}

/* ─── 14. زر الدخول shimmer + ripple ─── */
.gadri-v4 .gv4-btn-login {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.gadri-v4 .gv4-btn-login::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s ease;
  z-index: 1;
}
.gadri-v4 .gv4-btn-login:hover::before { left: 100%; }
.gadri-v4 .gv4-btn-login::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
  z-index: 0;
}
.gadri-v4 .gv4-btn-login:active::after {
  width: 500px;
  height: 500px;
}
.gadri-v4 .gv4-btn-login svg { transition: transform 0.3s ease; }
.gadri-v4 .gv4-btn-login:hover svg { transform: translateX(-4px); }
html[dir="rtl"] .gadri-v4 .gv4-btn-login:hover svg { transform: translateX(4px) scaleX(-1); }

/* ─── 15. زر الثيم - rotation + glow ─── */
.gadri-v4 .gv4-theme-toggle {
  position: relative;
  overflow: hidden;
}
.gadri-v4 .gv4-theme-toggle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(201, 169, 106, 0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gadri-v4 .gv4-theme-toggle:hover::before { opacity: 1; }
.gadri-v4 .gv4-theme-toggle svg {
  position: relative;
  z-index: 1;
  transition: all 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.gadri-v4 .gv4-theme-toggle:hover {
  transform: rotate(180deg) scale(1.1);
  box-shadow: 0 4px 16px rgba(201, 169, 106, 0.4);
}

/* ─── 16. ترحيب حسب الوقت ─── */
.gadri-v4 .gv4-time-greeting {
  text-align: center;
  font-size: 13px;
  color: #64748B;
  margin-bottom: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  animation: gv4FadeIn 0.6s ease-out 0.3s forwards;
}
[data-theme="dark"] .gadri-v4 .gv4-time-greeting { color: #94A3B8; }
.gadri-v4 .gv4-time-greeting .icon {
  font-size: 16px;
  animation: gv4IconFloat 3s ease-in-out infinite;
}
@keyframes gv4IconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ─── 17. حالة الخادم - نقطة خضراء نابضة ─── */
.gadri-v4 .gv4-live-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #10B981;
  font-weight: 700;
  margin-top: 8px;
}
.gadri-v4 .gv4-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  position: relative;
  flex-shrink: 0;
}
.gadri-v4 .gv4-live-dot::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #10B981;
  animation: gv4LivePulse 2s ease-out infinite;
}
@keyframes gv4LivePulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(2.5); opacity: 0; }
}
[data-theme="dark"] .gadri-v4 .gv4-live-status { color: #34D399; }
[data-theme="dark"] .gadri-v4 .gv4-live-dot,
[data-theme="dark"] .gadri-v4 .gv4-live-dot::before { background: #34D399; }

/* ─── خطوط دائرية تدور ببطء ─── */
#loginScreen.login-wrap.gadri-v4::before {
  animation: gv4SlowRotate 80s linear infinite;
}
#loginScreen.login-wrap.gadri-v4::after {
  animation: gv4SlowRotate 80s linear infinite reverse;
}
@keyframes gv4SlowRotate {
  0% { transform: translateY(-50%) rotate(0deg); }
  100% { transform: translateY(-50%) rotate(360deg); }
}

/* ─── Accessibility: تعطيل animations ─── */
@media (prefers-reduced-motion: reduce) {
  .gadri-v4 *,
  .gadri-v4 *::before,
  .gadri-v4 *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ════════════════════════════════════════════
   📱 Responsive - الشاشات المختلفة
   ════════════════════════════════════════════ */

/* شاشات لابتوب صغيرة (1280px - 1024px) */
@media (max-width: 1280px) {
  .gadri-v4 .gv4-hero-brand-ar { font-size: 42px; }
  .gadri-v4 .gv4-tagline-ar { font-size: 32px; }
  #loginScreen.login-wrap.gadri-v4 { padding: 30px !important; gap: 20px !important; }
}

/* تابلت أفقي (1024px - 860px) */
@media (max-width: 1024px) {
  .gadri-v4 .gv4-hero-brand-ar { font-size: 36px; }
  .gadri-v4 .gv4-hero-brand-en { font-size: 13px; letter-spacing: 6px; }
  .gadri-v4 .gv4-tagline-ar { font-size: 26px; }
  .gadri-v4 .gv4-tagline-en { font-size: 13px; letter-spacing: 1.5px; }
  .gadri-v4 .gv4-welcome-title { font-size: 26px; }
  .gadri-v4 .gv4-rotating-quote-text { font-size: 15px; }
  .gadri-v4 .gv4-rotating-quote { padding: 18px 22px 18px 28px; }
}

/* تابلت عمودي + جوال أفقي (860px - 600px) */
@media (max-width: 860px) {
  /* HTML/Body يسمحون بالـ scroll */
  html, body {
    height: auto !important;
    min-height: 100vh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  
  #loginScreen.login-wrap.gadri-v4 {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto !important;
    align-items: start !important;
    justify-items: stretch !important;
    padding: 20px 16px !important;
    gap: 20px !important;
    min-height: auto !important;
    height: auto !important;
    overflow: visible !important;
    overflow-y: visible !important;
    direction: rtl !important;
  }
  
  /* ═══ إزالة glassmorphism الفورم على الجوال - تصميم موحد ═══ */
  .gadri-v4 .gv4-form-side {
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
  [data-theme="dark"] .gadri-v4 .gv4-form-side {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }
  
  /* ═══ ترتيب جديد للجوال (معكوس): العلامة → الصورة → الفورم ═══ */
  /* 1️⃣ العلامة التجارية في الأعلى (شعار + اقتباس + عبارة) */
  .gadri-v4 .gv4-brand-side {
    grid-column: 1 !important;
    grid-row: 1 !important;
    max-width: 480px !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
    text-align: center !important;
    padding: 8px 8px 0 8px !important;
    gap: 20px !important;
    justify-content: flex-start !important;
    display: flex !important;
    flex-direction: column !important;
    justify-self: center !important;
  }
  
  /* 2️⃣ صورة الباب في الوسط */
  .gadri-v4 .gv4-hero-image {
    grid-column: 1 !important;
    grid-row: 2 !important;
    max-height: 28vh !important;
    max-width: 360px !important;
    width: 100% !important;
    height: auto !important;
    margin: 0 auto !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    justify-self: center !important;
  }
  .gadri-v4 .gv4-hero-image img {
    max-height: 28vh !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    border-radius: 12px !important;
  }
  
  /* 3️⃣ الفورم في الأسفل (سهل الوصول للإبهام) */
  .gadri-v4 .gv4-form-side {
    grid-column: 1 !important;
    grid-row: 3 !important;
    max-width: 480px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 4px 24px 4px !important;
    justify-self: center !important;
  }
  
  /* مركزة كل العناصر */
  .gadri-v4 .gv4-hero-brand,
  .gadri-v4 .gv4-tagline,
  .gadri-v4 .gv4-rotating-quote { text-align: center !important; }
  .gadri-v4 .gv4-tagline-divider { justify-content: center !important; }
  
  /* تحجيم الخطوط للجوال */
  .gadri-v4 .gv4-hero-brand-ar { 
    font-size: 32px !important;
    white-space: normal !important;
  }
  .gadri-v4 .gv4-hero-brand-en { font-size: 11px !important; letter-spacing: 4px !important; }
  .gadri-v4 .gv4-tagline-ar { font-size: 22px !important; line-height: 1.5 !important; }
  .gadri-v4 .gv4-tagline-en { font-size: 11px !important; letter-spacing: 1px !important; }
  .gadri-v4 .gv4-welcome-title { font-size: 24px !important; }
  .gadri-v4 .gv4-welcome-sub { font-size: 13px !important; line-height: 1.6 !important; }
  
  /* الاقتباس المتحرك - تنسيق للجوال */
  .gadri-v4 .gv4-rotating-quote {
    padding: 18px 18px 14px 18px !important;
    border-right: none !important;
    border-top: 2px solid #C9A96A !important;
    margin: 4px 0 !important;
    border-radius: 8px !important;
  }
  .gadri-v4 .gv4-rotating-quote-mark {
    top: -4px !important;
    right: 50% !important;
    transform: translateX(50%) !important;
    font-size: 36px !important;
  }
  .gadri-v4 .gv4-rotating-quote-text { font-size: 14px !important; line-height: 1.6 !important; }
  .gadri-v4 .gv4-rotating-quote-author { font-size: 12px !important; margin-top: 8px !important; }
  
  /* الشعار */
  .gadri-v4 .gv4-brand-crown { font-size: 18px !important; margin-bottom: 8px !important; }
  .gadri-v4 .gv4-brand-underline { width: 100px !important; margin: 10px auto !important; }
  
  /* إخفاء الزخارف على الجوال لتسريع الأداء */
  #loginScreen.login-wrap.gadri-v4::before,
  #loginScreen.login-wrap.gadri-v4::after { display: none !important; }
  .gadri-v4 .gv4-arabic-pattern,
  .gadri-v4 .gv4-stars-bg,
  .gadri-v4 .gv4-particles,
  .gadri-v4 .gv4-light-beam,
  .gadri-v4 .gv4-circular-lines { display: none !important; }
  
  /* حقول الإدخال - خلفية بيضاء واضحة */
  .gadri-v4 .gv4-input {
    background: #FFFFFF !important;
    border: 1px solid rgba(11, 26, 51, 0.12) !important;
  }
  [data-theme="dark"] .gadri-v4 .gv4-input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
  }
}

/* جوال صغير (600px - 480px) */
@media (max-width: 600px) {
  .gadri-v4 .gv4-hero-brand-ar { font-size: 28px !important; }
  .gadri-v4 .gv4-tagline-ar { font-size: 19px !important; }
  .gadri-v4 .gv4-welcome-title { font-size: 22px !important; }
  .gadri-v4 .gv4-rotating-quote-text { font-size: 13px !important; }
  
  .gadri-v4 .gv4-hero-image,
  .gadri-v4 .gv4-hero-image img { max-height: 24vh !important; }
  
  #loginScreen.login-wrap.gadri-v4 {
    padding: 16px 12px !important;
    gap: 16px !important;
  }
}

/* جوال صغير جداً (تحت 480px) */
@media (max-width: 480px) {
  #loginScreen.login-wrap.gadri-v4 {
    padding: 12px 10px !important;
    gap: 16px !important;
  }
  
  .gadri-v4 .gv4-form-side {
    padding: 4px 2px !important;
  }
  
  .gadri-v4 .gv4-hero-brand-ar { font-size: 26px !important; }
  .gadri-v4 .gv4-hero-brand-en { font-size: 10px !important; letter-spacing: 3px !important; }
  .gadri-v4 .gv4-tagline-ar { font-size: 17px !important; line-height: 1.4 !important; }
  .gadri-v4 .gv4-tagline-en { font-size: 10px !important; }
  .gadri-v4 .gv4-welcome-title { font-size: 20px !important; }
  .gadri-v4 .gv4-welcome-sub { font-size: 12px !important; }
  
  /* تصغير حقول الإدخال - 16px لمنع zoom على iOS */
  .gadri-v4 .gv4-input,
  .gadri-v4 .gv4-input input { font-size: 16px !important; }
  .gadri-v4 .gv4-btn-login { padding: 14px !important; font-size: 15px !important; }
  
  /* الاقتباس */
  .gadri-v4 .gv4-rotating-quote { padding: 16px 12px 12px 12px !important; margin: 4px 0 !important; }
  .gadri-v4 .gv4-rotating-quote-text { font-size: 13px !important; line-height: 1.5 !important; }
  
  /* الصورة أصغر */
  .gadri-v4 .gv4-hero-image,
  .gadri-v4 .gv4-hero-image img { max-height: 20vh !important; }
}

/* جوال صغير جداً (تحت 360px) - iPhone SE وما شابه */
@media (max-width: 360px) {
  .gadri-v4 .gv4-hero-brand-ar { font-size: 22px !important; }
  .gadri-v4 .gv4-tagline-ar { font-size: 15px !important; }
  .gadri-v4 .gv4-welcome-title { font-size: 18px !important; }
}

/* ═══════════════════════════════════════════════════════════
   📱 EXAM SYSTEM - تحسينات الجوال لشاشات الاختبارات
   ═══════════════════════════════════════════════════════════ */

/* ───── شاشة المدير (إنشاء/إدارة الاختبار) ───── */

/* الإحصائيّات الأربع: عمودان بدل أربعة */
@media (max-width: 768px) {
  .modal-body div[style*="grid-template-columns:repeat(4, 1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
}

/* عنوان عربي + إنجليزي → عمود واحد */
@media (max-width: 600px) {
  .modal-body .grid-2 {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
}

/* أزرار نوع السؤال (3 أعمدة → عمود واحد على الجوال) */
@media (max-width: 480px) {
  .modal-body div[style*="grid-template-columns:repeat(3,1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .qtype-radio {
    padding: 14px !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    text-align: right !important;
  }
  .qtype-radio > div:first-of-type {
    font-size: 32px !important;
    flex-shrink: 0;
  }
  .qtype-radio > div:last-of-type {
    text-align: right !important;
    flex: 1;
  }
}

/* أزرار صح/خطأ في إضافة سؤال — تكبير */
@media (max-width: 480px) {
  .modal-body input[name="qTfAnswer"] + div,
  .modal-body input[name="qTfAnswer"] ~ div {
    /* لا تغيير في layout (عمودان جنباً إلى جنب جيّدان) */
  }
  /* تكبير الإيموجي */
  label:has(input[name="qTfAnswer"]) > div:first-of-type {
    font-size: 40px !important;
  }
}

/* بطاقات الأسئلة في قائمة الإدارة */
@media (max-width: 480px) {
  .modal-body div[style*="background:white;border:1px solid #E5E7EB;border-radius:10px;padding:14px;display:flex"] {
    padding: 12px !important;
    gap: 10px !important;
  }
}


/* ───── شاشة الموظف (حلّ الاختبار) ───── */

/* رأس الـ modal: الاسم + المؤقّت + × */
@media (max-width: 600px) {
  .modal-head h3 {
    font-size: 14px !important;
  }
  #examTimer {
    font-size: 12px !important;
    padding: 4px 8px !important;
  }
}

@media (max-width: 380px) {
  .modal-head {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 12px !important;
  }
  .modal-head h3 {
    font-size: 13px !important;
    text-align: center !important;
  }
  .modal-head > div:last-of-type {
    justify-content: space-between !important;
  }
}

/* بطاقات الأسئلة للموظف */
@media (max-width: 480px) {
  .exam-question-card {
    padding: 12px !important;
    margin-bottom: 12px !important;
  }
  .exam-question-card > div:first-child {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
  }
  .exam-question-card > div:nth-child(2) {
    font-size: 14px !important;
  }
}

/* خيارات MC للموظف — تكبير لمساحة اللمس */
@media (max-width: 480px) {
  .exam-question-card label {
    padding: 14px 12px !important;
    min-height: 48px !important; /* أقلّ مساحة لمس مريحة */
  }
  .exam-question-card label > input[type="radio"] {
    width: 22px !important;
    height: 22px !important;
  }
  .exam-question-card label > span {
    font-size: 14px !important;
    line-height: 1.6 !important;
  }
}

/* أزرار صح/خطأ للموظف — تكبير */
@media (max-width: 480px) {
  .exam-question-card div[style*="grid-template-columns:1fr 1fr"] label {
    padding: 18px 10px !important;
    min-height: 80px !important;
  }
  .exam-question-card div[style*="grid-template-columns:1fr 1fr"] label > div:first-of-type {
    font-size: 36px !important;
  }
  .exam-question-card div[style*="grid-template-columns:1fr 1fr"] label > div:last-of-type {
    font-size: 16px !important;
  }
}

/* textarea للمقاليّ */
@media (max-width: 480px) {
  .exam-question-card textarea {
    font-size: 14px !important;
    padding: 12px !important;
    min-height: 100px !important;
  }
}

/* شريط التقدّم — يبقى مرئياً sticky */
@media (max-width: 480px) {
  .modal-body div[style*="position:sticky"] {
    padding: 10px 14px !important;
  }
  .modal-body div[style*="position:sticky"] .flex-spread > div {
    font-size: 12px !important;
  }
}

/* الـ modal-footer: زرّان جنباً إلى جنب */
@media (max-width: 480px) {
  .modal-footer {
    padding: 12px !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
  }
  .modal-footer .btn {
    flex: 1 !important;
    font-size: 13px !important;
    padding: 12px 8px !important;
    min-height: 48px !important;
  }
}


/* ───── شاشة النتيجة ───── */
@media (max-width: 480px) {
  /* الإيموجي الكبير */
  .modal-body div[style*="font-size:80px"] {
    font-size: 64px !important;
  }
  /* العنوان */
  .modal-body h2 {
    font-size: 22px !important;
  }
  /* الدرجة الكبيرة */
  .modal-body div[style*="font-size:64px"] {
    font-size: 48px !important;
  }
}


/* ───── أزرار الموظف في صفحة الدورة ───── */
@media (max-width: 480px) {
  /* "ابدأ الاختبار" / "متابعة" — تكبير */
  div[id^="examButtonArea_"] .btn {
    padding: 14px !important;
    font-size: 14px !important;
    min-height: 50px !important;
  }
}


/* ───── modal عام: يأخذ كامل الشاشة على الجوال ───── */
@media (max-width: 600px) {
  .modal-content,
  [data-modal-content] {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh !important;
    max-height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
  }
  .modal-body {
    max-height: calc(100vh - 120px) !important;
    padding: 14px !important;
  }
}


/* ───── إصلاحات لمسيّة عامّة ───── */
@media (hover: none) and (pointer: coarse) {
  /* تكبير كل الـ checkboxes والـ radio buttons لتكون أسهل في اللمس */
  input[type="checkbox"], input[type="radio"] {
    width: 20px !important;
    height: 20px !important;
    cursor: pointer !important;
  }
  /* تكبير الأزرار الصغيرة */
  .btn-sm {
    min-height: 40px !important;
    padding: 8px 14px !important;
  }
}

/* احترام تفضيل المستخدم لتقليل الحركة */
@media (prefers-reduced-motion: reduce) {
  .gadri-v4 *, .gadri-v4 *::before, .gadri-v4 *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   ✨ GADRI SIGNATURE - اللمسات الفنية الحصرية
═══════════════════════════════════════════════════════════ */

/* ─── 1. زخارف عربية هندسية ناعمة في الخلفية ─── */
#loginScreen.login-wrap.gadri-v4 .gv4-arabic-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.04;
  background-image: 
    repeating-linear-gradient(45deg, transparent, transparent 35px, #C9A96A 35px, #C9A96A 35.5px),
    repeating-linear-gradient(-45deg, transparent, transparent 35px, #C9A96A 35px, #C9A96A 35.5px);
  background-size: 70px 70px;
}
[data-theme="dark"] .gadri-v4 .gv4-arabic-pattern {
  opacity: 0.06;
  background-image: 
    repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(255,255,255,0.5) 35px, rgba(255,255,255,0.5) 35.5px),
    repeating-linear-gradient(-45deg, transparent, transparent 35px, rgba(255,255,255,0.5) 35px, rgba(255,255,255,0.5) 35.5px);
}

/* ─── 2. جسيمات ذهبية صاعدة (تحاكي الورق المتطاير) ─── */
.gadri-v4 .gv4-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.gadri-v4 .gv4-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: linear-gradient(135deg, #E5C07B, #C9A96A);
  border-radius: 50%;
  opacity: 0;
  bottom: -20px;
  animation: gv4ParticleRise 12s linear infinite;
  filter: blur(0.5px);
  box-shadow: 0 0 8px rgba(201, 169, 106, 0.6);
}
[data-theme="dark"] .gadri-v4 .gv4-particle {
  background: linear-gradient(135deg, #E5C07B, #C9A96A);
  box-shadow: 0 0 12px rgba(201, 169, 106, 0.8);
}
@keyframes gv4ParticleRise {
  0% {
    bottom: -20px;
    opacity: 0;
    transform: translateX(0) scale(0.5);
  }
  10% {
    opacity: 0.7;
    transform: translateX(15px) scale(1);
  }
  50% {
    opacity: 0.9;
    transform: translateX(-15px) scale(1);
  }
  90% {
    opacity: 0.4;
  }
  100% {
    bottom: 110%;
    opacity: 0;
    transform: translateX(20px) scale(0.5);
  }
}
/* 8 جسيمات في مواقع متفرقة بسرعات مختلفة */
.gadri-v4 .gv4-particle:nth-child(1)  { left: 10%; animation-delay: 0s;   animation-duration: 14s; }
.gadri-v4 .gv4-particle:nth-child(2)  { left: 25%; animation-delay: 2s;   animation-duration: 16s; }
.gadri-v4 .gv4-particle:nth-child(3)  { left: 40%; animation-delay: 4s;   animation-duration: 13s; }
.gadri-v4 .gv4-particle:nth-child(4)  { left: 55%; animation-delay: 1s;   animation-duration: 15s; }
.gadri-v4 .gv4-particle:nth-child(5)  { left: 70%; animation-delay: 3s;   animation-duration: 14s; }
.gadri-v4 .gv4-particle:nth-child(6)  { left: 85%; animation-delay: 5s;   animation-duration: 17s; }
.gadri-v4 .gv4-particle:nth-child(7)  { left: 15%; animation-delay: 7s;   animation-duration: 12s; }
.gadri-v4 .gv4-particle:nth-child(8)  { left: 80%; animation-delay: 6s;   animation-duration: 18s; }

/* ─── 3. شعاع ضوء يتسلل من خلف الباب ─── */
.gadri-v4 .gv4-light-beam {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 250px;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    ellipse at center top,
    rgba(255, 255, 255, 0.15) 0%,
    rgba(201, 169, 106, 0.08) 30%,
    transparent 70%
  );
  filter: blur(20px);
  animation: gv4BeamPulse 6s ease-in-out infinite;
}
[data-theme="dark"] .gadri-v4 .gv4-light-beam {
  background: radial-gradient(
    ellipse at center top,
    rgba(37, 101, 237, 0.25) 0%,
    rgba(255, 255, 255, 0.1) 30%,
    transparent 70%
  );
}
@keyframes gv4BeamPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ─── 4. تأثير زجاج فاخر على الفورم (Glassmorphism خفيف) ─── */
.gadri-v4 .gv4-form-side {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 
    0 10px 40px rgba(11, 26, 51, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  padding: 40px 28px !important;
  margin: auto;
}
[data-theme="dark"] .gadri-v4 .gv4-form-side {
  background: rgba(15, 34, 64, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 10px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ─── 5. ترحيب ديناميكي حسب الوقت ─── */
.gadri-v4 .gv4-time-greeting {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #C9A96A;
  margin-bottom: 16px;
  opacity: 0;
  animation: gv4FadeInScale 0.6s ease-out 0.3s forwards;
}
.gadri-v4 .gv4-time-greeting svg {
  width: 16px;
  height: 16px;
  animation: gv4IconFloat 3s ease-in-out infinite;
}
@keyframes gv4FadeInScale {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes gv4IconFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ─── 6. حالة الخادم الحية (Live Server Status) ─── */
.gadri-v4 .gv4-live-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #10B981;
  margin-right: 8px;
}
html[dir="ltr"] .gadri-v4 .gv4-live-status { margin-left: 8px; margin-right: 0; }
.gadri-v4 .gv4-live-dot {
  width: 8px;
  height: 8px;
  background: #10B981;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.gadri-v4 .gv4-live-dot::before {
  content: '';
  position: absolute;
  inset: 0;
  background: #10B981;
  border-radius: 50%;
  animation: gv4LivePulse 2s ease-out infinite;
}
@keyframes gv4LivePulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ─── 8. Parallax خفيف بالماوس على الباب ─── */
.gadri-v4 .gv4-hero-image {
  perspective: 1000px;
  will-change: transform;
}
.gadri-v4 .gv4-hero-image img {
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  transform-style: preserve-3d;
}

/* ─── 9. تحسين أزرار اللغة - مع underline animation ─── */
.gadri-v4 .gv4-lang-switcher button {
  position: relative;
  overflow: hidden;
}
.gadri-v4 .gv4-lang-switcher button:not(.active)::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: #2565ED;
  transform: translateX(-50%);
  transition: width 0.3s ease;
}
.gadri-v4 .gv4-lang-switcher button:not(.active):hover::after {
  width: 30%;
}

/* ─── 10. تحسين الـ Topbar layout ─── */
.gadri-v4 .gv4-topbar {
  justify-content: space-between !important;
  margin-bottom: 40px !important;
  align-self: stretch !important;
}

/* ─── إخفاء العناصر القديمة ─── */
.gadri-v4 .login-waves,
.gadri-v4 .float-decor,
.gadri-v4 #loginParticles,
.gadri-v4 #loginQuote { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════
   📊 DATA GRID — تصميم عالميّ احترافيّ
   مستوحى من: Linear / Stripe Dashboard / Notion / Airtable
   Design System: 4px base · Inter font · Semantic colors
   ═══════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────
   📐 Design Tokens (متغيّرات النظام)
   ───────────────────────────────────────────────────────── */
:root {
  /* Surfaces */
  --dg-surface-0: #ffffff;
  --dg-surface-1: #fafbfc;
  --dg-surface-2: #f4f5f7;
  --dg-surface-hover: #f7f8fa;
  
  /* Borders */
  --dg-border-subtle: rgba(15, 23, 42, 0.06);
  --dg-border-default: rgba(15, 23, 42, 0.10);
  --dg-border-strong: rgba(15, 23, 42, 0.14);
  
  /* Text */
  --dg-text-primary: #0F172A;
  --dg-text-secondary: #475569;
  --dg-text-tertiary: #64748B;
  --dg-text-disabled: #94A3B8;
  
  /* Brand - Gadri */
  --dg-brand-primary: #1E4FCB;
  --dg-brand-secondary: #D4AF37;
  --dg-brand-tint: rgba(30, 79, 203, 0.08);
  
  /* Semantic */
  --dg-success-bg: rgba(16, 185, 129, 0.08);
  --dg-success-text: #047857;
  --dg-success-border: rgba(16, 185, 129, 0.18);
  
  --dg-warning-bg: rgba(245, 158, 11, 0.08);
  --dg-warning-text: #B45309;
  --dg-warning-border: rgba(245, 158, 11, 0.18);
  
  --dg-danger-bg: rgba(239, 68, 68, 0.08);
  --dg-danger-text: #B91C1C;
  --dg-danger-border: rgba(239, 68, 68, 0.18);
  
  --dg-info-bg: rgba(30, 79, 203, 0.08);
  --dg-info-text: #1E4FCB;
  --dg-info-border: rgba(30, 79, 203, 0.18);
  
  --dg-purple-bg: rgba(139, 92, 246, 0.08);
  --dg-purple-text: #6D28D9;
  --dg-purple-border: rgba(139, 92, 246, 0.18);
  
  --dg-neutral-bg: rgba(100, 116, 139, 0.08);
  --dg-neutral-text: #475569;
  --dg-neutral-border: rgba(100, 116, 139, 0.18);
  
  /* Shadows */
  --dg-shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --dg-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --dg-shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --dg-shadow-lg: 0 10px 30px rgba(15, 23, 42, 0.10), 0 4px 12px rgba(15, 23, 42, 0.06);
  
  /* Radii */
  --dg-radius-sm: 6px;
  --dg-radius-md: 8px;
  --dg-radius-lg: 12px;
  --dg-radius-xl: 16px;
  
  /* Transitions */
  --dg-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dg-fast: 120ms var(--dg-ease);
  --dg-base: 180ms var(--dg-ease);
}

[data-theme="dark"] {
  --dg-surface-0: #1A1F2E;
  --dg-surface-1: #151B27;
  --dg-surface-2: #0F1420;
  --dg-surface-hover: #1F2638;
  
  --dg-border-subtle: rgba(255, 255, 255, 0.06);
  --dg-border-default: rgba(255, 255, 255, 0.10);
  --dg-border-strong: rgba(255, 255, 255, 0.14);
  
  --dg-text-primary: #F1F5F9;
  --dg-text-secondary: #CBD5E1;
  --dg-text-tertiary: #94A3B8;
  --dg-text-disabled: #64748B;
}

/* ─────────────────────────────────────────────────────────
   🏗 Wrapper - الحاوية الرئيسيّة
   ───────────────────────────────────────────────────────── */
.datagrid-wrapper {
  background: var(--dg-surface-0);
  border: 1px solid var(--dg-border-subtle);
  border-radius: var(--dg-radius-lg);
  overflow: hidden;
  box-shadow: var(--dg-shadow-sm);
  position: relative;
  transition: box-shadow var(--dg-base);
}
.datagrid-wrapper:hover {
  box-shadow: var(--dg-shadow-md);
}

.datagrid-scroll {
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--dg-border-strong) transparent;
}
.datagrid-scroll::-webkit-scrollbar { height: 10px; width: 10px; }
.datagrid-scroll::-webkit-scrollbar-track { background: transparent; }
.datagrid-scroll::-webkit-scrollbar-thumb {
  background: var(--dg-border-strong);
  border-radius: 100px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.datagrid-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--dg-text-tertiary);
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* ─────────────────────────────────────────────────────────
   📊 الجدول الأساسي
   ───────────────────────────────────────────────────────── */
.datagrid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
  font-family: 'Cairo', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: 'tnum' 1, 'ss01' 1;
  font-variant-numeric: tabular-nums;
  table-layout: auto;
}

/* ─────────────────────────────────────────────────────────
   🎯 Header - ترويسة احترافيّة هادئة (Linear/Stripe style)
   ───────────────────────────────────────────────────────── */
.datagrid thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15,23,42,0.025);
  box-shadow: inset 0 -0.5px 0 rgba(15,23,42,0.08);
}

[data-theme="dark"] .datagrid thead {
  background: rgba(255,255,255,0.04);
  box-shadow: inset 0 -0.5px 0 rgba(255,255,255,0.08);
}

.datagrid thead tr {
  height: 36px;
}

.datagrid th {
  padding: 0 14px;
  text-align: start;
  font-weight: var(--fw-semibold, 600); /* unified (Phase 2.5) */
  font-size: var(--text-xs, 12px); /* unified (Phase 2.5): was 11px */
  letter-spacing: -0.005em;
  color: var(--ink-500);
  text-transform: none;
  white-space: nowrap;
  user-select: none;
  vertical-align: middle;
  background: transparent;
  position: relative;
}
[data-theme="dark"] .datagrid th {
  color: #94A3B8;
}

/* فاصل بين الأعمدة - أنعم */
.datagrid th:not(:last-child)::after {
  content: '';
  position: absolute;
  inset-inline-end: 0;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: rgba(15,23,42,0.06);
}
[data-theme="dark"] .datagrid th:not(:last-child)::after {
  background: rgba(255,255,255,0.06);
}

.datagrid th.sortable {
  cursor: pointer;
  transition: color 120ms ease, background-color 120ms ease;
}
.datagrid th.sortable:hover {
  background: rgba(15,23,42,0.04);
  color: var(--ink-900);
}
[data-theme="dark"] .datagrid th.sortable:hover {
  background: rgba(255,255,255,0.05);
  color: #FFFFFF;
}
.datagrid th.sortable:hover .sort-icon {
  opacity: 1;
  color: var(--gadri-blue);
}

.datagrid th .sort-icon {
  display: inline-block;
  margin-inline-start: 4px;
  opacity: 0.45;
  font-size: 9px;
  transition: opacity var(--dg-fast), color var(--dg-fast);
  color: rgba(255, 255, 255, 0.7);
  vertical-align: middle;
}

.datagrid th.sorted-asc,
.datagrid th.sorted-desc {
  background: rgba(212, 175, 55, 0.15);
  color: var(--dg-brand-secondary);
}
.datagrid th.sorted-asc .sort-icon,
.datagrid th.sorted-desc .sort-icon {
  opacity: 1;
  color: var(--dg-brand-secondary);
}

/* ─────────────────────────────────────────────────────────
   📝 Body Rows
   ───────────────────────────────────────────────────────── */
.datagrid tbody tr {
  background: var(--dg-surface-0);
  transition: background var(--dg-fast);
  position: relative;
}

.datagrid tbody tr:not(:last-child) {
  border-bottom: 1px solid var(--dg-border-subtle);
}

.datagrid tbody tr:hover {
  background: var(--dg-surface-hover);
}

[data-theme="dark"] .datagrid tbody tr:hover {
  background: rgba(212, 175, 55, 0.04);
}

/* Selected row - مع خطّ جانبي */
.datagrid tbody tr.selected {
  background: var(--dg-brand-tint);
}
.datagrid tbody tr.selected::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--dg-brand-primary);
}

.datagrid td {
  padding: 14px 16px;
  color: var(--dg-text-primary);
  vertical-align: middle;
  font-size: var(--text-base, 15px); /* unified (Phase 2.5): was 13.5px (+1.5px) */
  line-height: 1.4;
}

/* ─────────────────────────────────────────────────────────
   ⭐ Primary Cell - الخليّة الأساسيّة (مع أيقونة)
   ───────────────────────────────────────────────────────── */
.datagrid td.cell-primary {
  font-weight: 500;
  color: var(--dg-text-primary);
  min-width: 240px;
  max-width: 320px;
}

.datagrid td.cell-primary .cell-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.datagrid td.cell-primary .cell-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  position: relative;
}

.datagrid td.cell-primary .cell-icon::before {
  content: none;
}

.datagrid td.cell-primary .cell-info {
  flex: 1;
  min-width: 0;
}

.datagrid td.cell-primary .cell-title {
  font-weight: 600;
  color: var(--ink-900);
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-theme="dark"] .datagrid td.cell-primary .cell-title {
  color: #FFFFFF;
}

.datagrid td.cell-primary .cell-subtitle {
  font-weight: 400;
  color: var(--dg-text-tertiary);
  font-size: 11.5px;
  margin-top: 3px;
  letter-spacing: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─────────────────────────────────────────────────────────
   👤 Avatar Cell
   ───────────────────────────────────────────────────────── */
.datagrid .cell-avatar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.datagrid .cell-avatar .avatar-mini {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #2565ED, #1842A8);
  box-shadow: 
    0 1px 2px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.datagrid .cell-avatar .avatar-text {
  font-weight: 500;
  font-size: 13px;
  color: var(--dg-text-primary);
  letter-spacing: -0.01em;
}

/* ─────────────────────────────────────────────────────────
   🏷 Badge - تصميم احترافيّ
   ───────────────────────────────────────────────────────── */
.datagrid .cell-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0;
  border: 1px solid;
  white-space: nowrap;
  line-height: 1.3;
  height: 22px;
  font-variant-numeric: tabular-nums;
}

.cell-badge.dot::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px currentColor;
  opacity: 0.18;
}
.cell-badge.dot {
  position: relative;
}
.cell-badge.dot::before {
  background: currentColor;
  box-shadow: none;
  opacity: 1;
}

/* Badge Variants */
.badge-status-success {
  background: var(--dg-success-bg);
  color: var(--dg-success-text);
  border-color: var(--dg-success-border);
}
.badge-status-pending {
  background: var(--dg-warning-bg);
  color: var(--dg-warning-text);
  border-color: var(--dg-warning-border);
}
.badge-status-info {
  background: var(--dg-info-bg);
  color: var(--dg-info-text);
  border-color: var(--dg-info-border);
}
.badge-status-danger {
  background: var(--dg-danger-bg);
  color: var(--dg-danger-text);
  border-color: var(--dg-danger-border);
}
.badge-status-neutral {
  background: var(--dg-neutral-bg);
  color: var(--dg-neutral-text);
  border-color: var(--dg-neutral-border);
}
.badge-status-purple {
  background: var(--dg-purple-bg);
  color: var(--dg-purple-text);
  border-color: var(--dg-purple-border);
}

[data-theme="dark"] .badge-status-success { color: #34D399; background: rgba(16,185,129,0.12); }
[data-theme="dark"] .badge-status-pending { color: #FBBF24; background: rgba(245,158,11,0.12); }
[data-theme="dark"] .badge-status-info { color: #93C5FD; background: rgba(96,165,250,0.12); }
[data-theme="dark"] .badge-status-danger { color: #FCA5A5; background: rgba(239,68,68,0.12); }
[data-theme="dark"] .badge-status-neutral { color: #CBD5E1; background: rgba(148,163,184,0.12); }
[data-theme="dark"] .badge-status-purple { color: #C4B5FD; background: rgba(167,139,250,0.12); }

/* ─────────────────────────────────────────────────────────
   📊 Stats & Progress
   ───────────────────────────────────────────────────────── */
.datagrid .cell-stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--dg-text-secondary);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.datagrid .cell-stats .stats-icon {
  font-size: 12px;
  opacity: 0.6;
}

/* Progress Bar - تصميم Linear */
.cell-progress {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 110px;
}

.cell-progress-bar {
  height: 6px;
  background: var(--dg-surface-2);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.cell-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--dg-brand-primary), #4F46E5);
  border-radius: 100px;
  transition: width 600ms var(--dg-ease);
  position: relative;
  box-shadow: 0 0 8px rgba(30, 79, 203, 0.3);
}

.cell-progress-fill.success {
  background: linear-gradient(90deg, #10B981, #059669);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}
.cell-progress-fill.warning {
  background: linear-gradient(90deg, #F59E0B, #D97706);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}
.cell-progress-fill.danger {
  background: linear-gradient(90deg, #EF4444, #DC2626);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.cell-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--dg-text-tertiary);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ─────────────────────────────────────────────────────────
   📅 Date Cell
   ───────────────────────────────────────────────────────── */
.datagrid .cell-date {
  font-size: 13px;
  color: var(--dg-text-secondary);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.datagrid .cell-date .date-icon {
  margin-inline-end: 6px;
  opacity: 0.5;
  font-size: 12px;
}

/* ─────────────────────────────────────────────────────────
   ⚙ Actions Cell - أزرار احترافيّة
   ───────────────────────────────────────────────────────── */
.datagrid td.cell-actions {
  text-align: end;
  white-space: nowrap;
  padding-inline-end: 14px;
  width: 1%;
}

.datagrid .action-btn {
  background: var(--white);
  border: 0.5px solid rgba(15,23,42,0.08);
  padding: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink-500);
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease, transform 100ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-inline-start: 5px;
}
[data-theme="dark"] .datagrid .action-btn {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
  color: #94A3B8;
}

.datagrid .action-btn:hover {
  background: rgba(15,23,42,0.04);
  color: var(--ink-900);
  border-color: rgba(15,23,42,0.12);
}
[data-theme="dark"] .datagrid .action-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #FFFFFF;
}

.datagrid .action-btn:active {
  transform: scale(0.95);
}

/* Variant: edit (orange/amber) */
.datagrid .action-btn.edit,
.datagrid .action-btn.primary {
  background: #FEF3C7;
  color: #D97706;
  border-color: rgba(217,119,6,0.15);
}
.datagrid .action-btn.edit:hover,
.datagrid .action-btn.primary:hover {
  background: #FDE68A;
  color: #B45309;
  border-color: rgba(217,119,6,0.3);
}
[data-theme="dark"] .datagrid .action-btn.edit,
[data-theme="dark"] .datagrid .action-btn.primary {
  background: rgba(217,119,6,0.15);
  color: #FBBF24;
  border-color: rgba(217,119,6,0.25);
}

/* Variant: delete (red) */
.datagrid .action-btn.danger {
  background: #FEE2E2;
  color: #DC2626;
  border-color: rgba(220,38,38,0.15);
}
.datagrid .action-btn.danger:hover {
  background: #FECACA;
  color: #B91C1C;
  border-color: rgba(220,38,38,0.3);
}
[data-theme="dark"] .datagrid .action-btn.danger {
  background: rgba(220,38,38,0.15);
  color: #F87171;
  border-color: rgba(220,38,38,0.25);
}

/* Variant: success (green) */
.datagrid .action-btn.success {
  background: #DCFCE7;
  color: #16A34A;
  border-color: rgba(22,163,74,0.15);
}
.datagrid .action-btn.success:hover {
  background: #BBF7D0;
  color: #15803D;
}
[data-theme="dark"] .datagrid .action-btn.success {
  background: rgba(22,163,74,0.15);
  color: #4ADE80;
  border-color: rgba(22,163,74,0.25);
}

/* Always visible (no fade on row hover) */
.datagrid tbody tr .action-btn {
  opacity: 1;
}

/* ─────────────────────────────────────────────────────────
   ☑ Checkbox Cell
   ───────────────────────────────────────────────────────── */
.datagrid td.cell-checkbox,
.datagrid th.cell-checkbox {
  width: 44px;
  padding-inline: 14px;
}

.datagrid .checkbox-cell {
  cursor: pointer;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--dg-border-strong);
  border-radius: 5px;
  display: inline-block;
  position: relative;
  vertical-align: middle;
  transition: all var(--dg-fast);
  background: var(--dg-surface-0);
}

.datagrid .checkbox-cell:hover {
  border-color: var(--dg-brand-primary);
  background: var(--dg-brand-tint);
}

.datagrid .checkbox-cell.checked {
  background: var(--dg-brand-primary);
  border-color: var(--dg-brand-primary);
  box-shadow: 0 0 0 3px var(--dg-brand-tint);
}

.datagrid .checkbox-cell.checked::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='20 6 9 17 4 12'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}

/* ─────────────────────────────────────────────────────────
   📑 Footer (Pagination)
   ───────────────────────────────────────────────────────── */
.datagrid-footer {
  background: var(--dg-surface-1);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--dg-border-subtle);
  font-size: 12.5px;
  color: var(--dg-text-secondary);
  flex-wrap: wrap;
  gap: 12px;
  font-variant-numeric: tabular-nums;
}

.datagrid-footer .count {
  font-weight: 600;
}

.datagrid-pagination {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.datagrid-pagination button {
  background: var(--dg-surface-0);
  border: 1px solid var(--dg-border-default);
  padding: 6px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--dg-text-secondary);
  transition: all var(--dg-fast);
  font-family: 'Cairo', sans-serif;
  font-weight: 600;
  min-height: 30px;
}

.datagrid-pagination button:hover:not(:disabled) {
  background: var(--dg-brand-primary);
  color: white;
  border-color: var(--dg-brand-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(30, 79, 203, 0.25);
}

.datagrid-pagination button:active:not(:disabled) {
  transform: translateY(0);
}

.datagrid-pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.datagrid-pagination .page-info {
  padding: 0 14px;
  font-weight: 700;
  color: var(--dg-text-primary);
  letter-spacing: -0.01em;
}

/* ─────────────────────────────────────────────────────────
   📭 Empty State
   ───────────────────────────────────────────────────────── */
.datagrid-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--dg-text-tertiary);
}

.datagrid-empty .empty-icon {
  font-size: 56px;
  opacity: 0.3;
  margin-bottom: 16px;
  filter: grayscale(30%);
}

.datagrid-empty h3 {
  margin: 0 0 6px;
  color: var(--dg-text-primary);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.datagrid-empty p {
  margin: 0;
  font-size: 13.5px;
  color: var(--dg-text-tertiary);
}

/* ─────────────────────────────────────────────────────────
   📋 Action Menu Dropdown
   ───────────────────────────────────────────────────────── */
.action-menu {
  position: relative;
  display: inline-block;
}

.action-menu-dropdown {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  background: var(--dg-surface-0);
  border: 1px solid var(--dg-border-default);
  border-radius: var(--dg-radius-md);
  box-shadow: var(--dg-shadow-lg);
  min-width: 200px;
  padding: 5px;
  z-index: 100;
  display: none;
}

.action-menu.open .action-menu-dropdown {
  display: block;
  animation: menuFadeIn 140ms var(--dg-ease);
}

@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.action-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--dg-text-secondary);
  cursor: pointer;
  border-radius: 6px;
  white-space: nowrap;
  transition: background var(--dg-fast);
  font-weight: 500;
}

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

.action-menu-item.danger { color: var(--dg-danger-text); }
.action-menu-item.danger:hover { background: var(--dg-danger-bg); }

.action-menu-divider {
  height: 1px;
  background: var(--dg-border-subtle);
  margin: 5px 0;
}

/* ─────────────────────────────────────────────────────────
   🎨 View Toggle (محتفظ به للتوافق)
   ───────────────────────────────────────────────────────── */
.view-toggle {
  display: inline-flex;
  background: var(--dg-surface-1);
  border-radius: var(--dg-radius-md);
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--dg-border-default);
}

.view-toggle button {
  background: transparent;
  border: none;
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--dg-text-tertiary);
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--dg-fast);
  font-family: 'Cairo', sans-serif;
}

.view-toggle button:hover { color: var(--dg-text-primary); }
.view-toggle button.active {
  background: var(--dg-surface-0);
  color: var(--dg-brand-primary);
  box-shadow: var(--dg-shadow-xs);
}

/* ─────────────────────────────────────────────────────────
   📱 Mobile - Responsive
   ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .datagrid { font-size: 12.5px; }
  .datagrid th { padding: 0 12px; }
  .datagrid td { padding: 12px; }
  .datagrid .hide-mobile { display: none; }
  
  .datagrid td.cell-primary { min-width: 180px; max-width: 220px; }
  .datagrid td.cell-primary .cell-icon {
    width: 34px; height: 34px; font-size: 16px;
  }
  .datagrid td.cell-primary .cell-title { font-size: 13px; }
  
  .datagrid tbody tr .action-btn { opacity: 1; }
  
  .datagrid-footer {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
}

/* ─────────────────────────────────────────────────────────
   🎨 Loading Skeleton
   ───────────────────────────────────────────────────────── */
.dg-skeleton {
  background: linear-gradient(
    90deg,
    var(--dg-surface-2) 0%,
    var(--dg-surface-1) 50%,
    var(--dg-surface-2) 100%
  );
  background-size: 200% 100%;
  animation: skeletonShine 1.4s ease-in-out infinite;
  border-radius: 4px;
  height: 14px;
}
@keyframes skeletonShine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ═══════════════════════════════════════════════════════════════════════
   📄 DOCUMENT VIEWER - عارض ملفّات احترافيّ
   ═══════════════════════════════════════════════════════════════════════ */

.doc-viewer {
  display: flex;
  flex-direction: column;
  height: 85vh;
  max-height: 900px;
  background: var(--dg-surface-0);
}

/* ─── Header ─── */
.doc-viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--dg-border-default);
  background: linear-gradient(180deg, var(--dg-surface-0) 0%, var(--dg-surface-1) 100%);
  gap: 12px;
  flex-wrap: wrap;
}

.doc-viewer-title {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.doc-viewer-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 
    inset 0 0 0 1px rgba(0, 0, 0, 0.04),
    0 2px 4px rgba(0, 0, 0, 0.04);
}

.doc-viewer-name {
  min-width: 0;
  flex: 1;
}

.doc-name-main {
  font-size: 16px;
  font-weight: 700;
  color: var(--dg-text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.doc-name-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--dg-text-tertiary);
  flex-wrap: wrap;
}

.doc-meta-badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.5px;
}

.doc-viewer-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.dv-btn {
  background: var(--dg-surface-1);
  border: 1px solid var(--dg-border-default);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--dg-text-secondary);
  transition: all var(--dg-fast);
  font-family: 'Cairo', sans-serif;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dv-btn:hover {
  background: var(--dg-brand-primary);
  color: white;
  border-color: var(--dg-brand-primary);
  transform: translateY(-1px);
  box-shadow: var(--dg-shadow-sm);
}
.dv-btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
}
.dv-btn-danger:hover {
  background: var(--dg-danger-text);
  border-color: var(--dg-danger-text);
}

/* ─── Meta strip ─── */
.doc-viewer-meta {
  display: flex;
  gap: 20px;
  padding: 12px 20px;
  background: var(--dg-surface-1);
  border-bottom: 1px solid var(--dg-border-subtle);
  font-size: 12.5px;
  color: var(--dg-text-secondary);
  flex-wrap: wrap;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.meta-icon { font-size: 13px; opacity: 0.7; }
.meta-label { color: var(--dg-text-tertiary); font-weight: 500; }
.meta-value { color: var(--dg-text-primary); font-weight: 600; }

.meta-link {
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--dg-brand-tint);
  transition: all var(--dg-fast);
}
.meta-link:hover {
  background: var(--dg-info-bg);
  transform: translateY(-1px);
}
.meta-arrow {
  color: var(--dg-brand-primary);
  font-weight: 700;
  margin-inline-start: 4px;
}

/* ─── Description ─── */
.doc-viewer-description {
  padding: 14px 20px;
  background: var(--dg-surface-2);
  border-bottom: 1px solid var(--dg-border-subtle);
  font-size: 13.5px;
  color: var(--dg-text-secondary);
  line-height: 1.6;
  font-style: italic;
}

/* ─── Preview Area ─── */
.doc-viewer-preview {
  flex: 1;
  overflow: hidden;
  background: var(--dg-surface-2);
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  min-height: 400px;
}

/* PDF Preview */
.preview-pdf {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

/* Image Preview */
.preview-image-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: 
    repeating-conic-gradient(#f0f0f0 0% 25%, white 0% 50%) 50% / 20px 20px;
  padding: 20px;
  overflow: auto;
}

.preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Video Preview */
.preview-video {
  width: 100%;
  height: 100%;
  background: black;
  object-fit: contain;
}

/* Audio Preview */
.preview-audio-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px;
  background: linear-gradient(135deg, var(--dg-brand-tint) 0%, var(--dg-surface-1) 100%);
}

.preview-audio-icon {
  font-size: 80px;
  opacity: 0.6;
  animation: audioPulse 2s ease-in-out infinite;
}

@keyframes audioPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.preview-audio-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--dg-text-primary);
  text-align: center;
  margin-bottom: 10px;
}

.preview-audio {
  width: 100%;
  max-width: 500px;
}

/* Office Preview */
.preview-office {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

/* Error / Empty States */
.preview-error,
.preview-text-loading {
  width: 100%;
  height: 100%;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  text-align: center;
}

.preview-error-icon {
  font-size: 64px;
  opacity: 0.3;
  margin-bottom: 8px;
}

.preview-error-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--dg-text-primary);
}

.preview-error-desc {
  font-size: 13.5px;
  color: var(--dg-text-tertiary);
  max-width: 400px;
}

/* ─── Tags ─── */
.doc-viewer-tags {
  padding: 12px 20px;
  border-top: 1px solid var(--dg-border-subtle);
  background: var(--dg-surface-1);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.doc-tag {
  padding: 4px 10px;
  background: var(--dg-surface-0);
  border: 1px solid var(--dg-border-default);
  border-radius: 14px;
  font-size: 11.5px;
  color: var(--dg-text-secondary);
  font-weight: 600;
}

/* Modal XL */
.modal.modal-xl {
  max-width: 95vw;
  width: 1200px;
}

/* ─── Fullscreen Mode (ملء الشاشة) ─── */
.modal.doc-viewer-fullscreen {
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  margin: 0 !important;
  position: fixed !important;
  inset: 0 !important;
  z-index: 9999;
  animation: fullscreenEnter 200ms var(--dg-ease);
}

.modal.doc-viewer-fullscreen .doc-viewer {
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0;
}

.modal.doc-viewer-fullscreen .doc-viewer-preview {
  min-height: calc(100vh - 200px);
}

/* في وضع ملء الشاشة - PDF يأخذ كل المساحة */
.modal.doc-viewer-fullscreen .preview-pdf,
.modal.doc-viewer-fullscreen .preview-office {
  min-height: calc(100vh - 220px);
}

@keyframes fullscreenEnter {
  from {
    transform: scale(0.95);
    opacity: 0.8;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Indicator في الـ Header عند ملء الشاشة */
.modal.doc-viewer-fullscreen .doc-viewer-header {
  background: linear-gradient(180deg, var(--dg-surface-0) 0%, var(--dg-surface-1) 100%);
  border-bottom: 2px solid var(--dg-brand-primary);
}

/* زرّ Fullscreen محدّد عند التفعيل */
.modal.doc-viewer-fullscreen #dvFullscreenBtn {
  background: var(--dg-brand-primary);
  color: white;
  border-color: var(--dg-brand-primary);
}

/* Mobile */
@media (max-width: 768px) {
  .doc-viewer {
    height: 90vh;
  }
  .doc-viewer-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .doc-viewer-meta {
    gap: 12px;
    font-size: 11.5px;
  }
  .doc-name-main { font-size: 14px; }
  .doc-viewer-icon { width: 40px; height: 40px; font-size: 20px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   🎓 COURSES PAGE — World-class redesign (Coursera/Udemy/edX inspired)
   ═══════════════════════════════════════════════════════════════════════ */

/* Page header */
.courses-head {
  /* Title+subtitle are de-duplicated (hidden). Collapse this header so no
     empty gap remains; restore spacing only when it actually holds action
     buttons (then it behaves as a slim toolbar row). */
  margin-bottom: 0;
}
.courses-head:has(button),
.courses-head:has(.btn) {
  margin-bottom: 14px;
}
.courses-head h1 {
  /* De-duplicated: the page title already appears in the topbar + breadcrumb,
     so the repeated in-page heading is hidden across all tabs (CSS only). */
  display: none;
}
/* لمسة هويّة قادري: شريط ذهبيّ صغير متناسب مع العنوان */
.courses-head h1::after {
  content: '';
  display: block;
  width: 28px;
  height: 2px;
  margin-top: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, #FBBF24 0%, #D97706 100%);
}
.courses-head p {
  /* De-duplicated: the page description already shows in the topbar subtitle,
     so the repeated in-page description is hidden across all tabs (CSS only). */
  display: none;
}

/* Stats Strip - 5 cards with big colored icons */
.courses-stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
@media (max-width: 1000px) { .courses-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px)  { .courses-stats { grid-template-columns: repeat(2, 1fr); } }

.courses-stats .stat-item {
  background: var(--white);
  border: 0.5px solid rgba(15,23,42,0.08);
  border-radius: 16px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .courses-stats .stat-item {
  border-color: rgba(255,255,255,0.08);
}
.courses-stats .stat-item:hover {
  border-color: rgba(37,101,237,0.25);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(15,23,42,0.06);
}
.courses-stats .stat-item.active {
  border-color: var(--gadri-blue);
  box-shadow: 0 0 0 1px rgba(37,101,237,0.2);
}

/* Big square icon on the left */
.courses-stats .stat-ico {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.courses-stats .stat-ico.amber  { background: #FEF3C7; color: #D97706; }
.courses-stats .stat-ico.blue   { background: #DBEAFE; color: #2563EB; }
.courses-stats .stat-ico.orange { background: #FED7AA; color: #EA580C; }
.courses-stats .stat-ico.green  { background: #DCFCE7; color: #16A34A; }
.courses-stats .stat-ico.purple { background: #EDE9FE; color: #7C3AED; }
.courses-stats .stat-ico.gray   { background: rgba(15,23,42,0.05); color: #475569; }
[data-theme="dark"] .courses-stats .stat-ico.amber  { background: rgba(217,119,6,0.18); color: #FBBF24; }
[data-theme="dark"] .courses-stats .stat-ico.blue   { background: rgba(37,99,235,0.2); color: #93C5FD; }
[data-theme="dark"] .courses-stats .stat-ico.orange { background: rgba(234,88,12,0.2); color: #FB923C; }
[data-theme="dark"] .courses-stats .stat-ico.green  { background: rgba(22,163,74,0.2); color: #4ADE80; }
[data-theme="dark"] .courses-stats .stat-ico.purple { background: rgba(124,58,237,0.22); color: #C4B5FD; }
[data-theme="dark"] .courses-stats .stat-ico.gray   { background: rgba(255,255,255,0.08); color: #94A3B8; }

/* Right side: number + label + description */
.courses-stats .stat-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  text-align: start;
}
.courses-stats .stat-num {
  font-size: 26px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.025em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .courses-stats .stat-num { color: #FFFFFF; }
.courses-stats .stat-lbl {
  font-size: 13px;
  color: var(--ink-700);
  letter-spacing: -0.005em;
  font-weight: 600;
  margin-top: 4px;
}
[data-theme="dark"] .courses-stats .stat-lbl { color: #DCE3EE; }
.courses-stats .stat-sub {
  font-size: 11px;
  color: var(--ink-500);
  letter-spacing: -0.005em;
  font-weight: 400;
  margin-top: 1px;
}
[data-theme="dark"] .courses-stats .stat-sub { color: #94A3B8; }

/* Featured Hero Course */
.course-hero {
  background: linear-gradient(135deg, #0F2547 0%, #1B4FC2 100%);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 18px;
  color: #fff;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.course-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15,31,71,0.18);
}
.course-hero::before {
  content: '';
  position: absolute;
  top: -40%;
  inset-inline-start: -10%;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(212,175,55,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.course-hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 22px;
  align-items: center;
}
.course-hero-info { flex: 1; min-width: 0; }
.course-hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.course-hero-eyebrow .star-badge {
  background: #D4AF37;
  color: #0F1F3D;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.course-hero-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  line-height: 1.3;
  color: #fff;
}
.course-hero-sub {
  font-size: 12.5px;
  opacity: 0.85;
  max-width: 540px;
  line-height: 1.6;
  margin-bottom: 14px;
}
.course-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 16px;
}
.course-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.course-hero-cta {
  background: #fff;
  color: #1B4FC2;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  letter-spacing: -0.005em;
  transition: transform 100ms ease, box-shadow 150ms ease;
}
.course-hero-cta:hover {
  box-shadow: 0 4px 12px rgba(255,255,255,0.25);
}
.course-hero-cta:active { transform: scale(0.98); }
.course-hero-visual {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(212,175,55,0.25), rgba(212,175,55,0.05));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212,175,55,0.3);
  position: relative;
  overflow: hidden;
}
.course-hero-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.15) 0%, transparent 50%);
  pointer-events: none;
}
.course-hero-visual i {
  font-size: 60px;
  color: #FFE7A8;
  filter: drop-shadow(0 4px 12px rgba(212,175,55,0.4));
  position: relative;
  z-index: 1;
}
@media (max-width: 760px) {
  .course-hero-visual { display: none; }
  .course-hero { padding: 20px; }
  .course-hero-title { font-size: 19px; }
}

/* Toolbar */
.courses-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.courses-view-toggle {
  display: inline-flex;
  gap: 2px;
  background: rgba(15,23,42,0.04);
  border-radius: 6px;
  padding: 2px;
}
[data-theme="dark"] .courses-view-toggle {
  background: rgba(255,255,255,0.05);
}
.courses-view-toggle button {
  background: transparent;
  border: none;
  width: 30px;
  height: 26px;
  border-radius: 5px;
  cursor: pointer;
  color: var(--ink-500);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-family: inherit;
  transition: background-color 120ms ease, color 120ms ease;
}
.courses-view-toggle button:hover { color: var(--ink-900); }
.courses-view-toggle button.active {
  background: var(--white);
  color: var(--ink-900);
  box-shadow: 0 1px 2px rgba(15,23,42,0.08);
}
[data-theme="dark"] .courses-view-toggle button.active {
  background: rgba(255,255,255,0.1);
  color: #fff;
}

/* Cards Grid - World class */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) { .courses-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .courses-grid { grid-template-columns: 1fr; } }

.crs-card {
  background: var(--white);
  border: 0.5px solid rgba(15,23,42,0.08);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  display: flex;
  flex-direction: column;
}
[data-theme="dark"] .crs-card {
  border-color: rgba(255,255,255,0.08);
}
.crs-card:hover {
  transform: translateY(-3px);
  border-color: rgba(37,101,237,0.3);
  box-shadow: 0 8px 24px rgba(15,23,42,0.08);
}
[data-theme="dark"] .crs-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.crs-thumb {
  height: 96px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.crs-thumb.blue   { background: linear-gradient(135deg, #3B82F6 0%, #1B4FC2 100%); }
.crs-thumb.amber  { background: linear-gradient(135deg, #F59E0B 0%, #C2410C 100%); }
.crs-thumb.green  { background: linear-gradient(135deg, #10B981 0%, #047857 100%); }
.crs-thumb.purple { background: linear-gradient(135deg, #A78BFA 0%, #6D28D9 100%); }
.crs-thumb.pink   { background: linear-gradient(135deg, #EC4899 0%, #9D174D 100%); }
.crs-thumb.dark   { background: linear-gradient(135deg, #1F2937 0%, #0F172A 100%); }
.crs-thumb.teal   { background: linear-gradient(135deg, #14B8A6 0%, #0F766E 100%); }
.crs-thumb.red    { background: linear-gradient(135deg, #EF4444 0%, #991B1B 100%); }
.crs-thumb-ico {
  font-size: 40px;
  color: rgba(255,255,255,0.85);
  z-index: 1;
}
.crs-thumb-pattern {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.08) 0%, transparent 40%);
  pointer-events: none;
}
.crs-thumb-badges {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  max-width: calc(100% - 20px);
  z-index: 2;
}
.crs-thumb-badge {
  background: rgba(255,255,255,0.95);
  color: #0F1F3D;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.crs-thumb-badge.mandatory { background: rgba(254,226,226,0.95); color: #DC2626; }
.crs-thumb-badge.featured  { background: rgba(212,175,55,0.95);  color: #422006; }
.crs-thumb-badge.enrolled  { background: rgba(167,139,250,0.95); color: #4C1D95; }

.crs-body {
  padding: 13px 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Top row: category + status in one line */
.crs-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
  gap: 8px;
}

.crs-cat {
  font-size: 10.5px;
  color: var(--ink-500);
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}
.crs-cat i { font-size: 12px; opacity: 0.7; }

.crs-status {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: -0.005em;
  flex-shrink: 0;
}
.crs-status::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.crs-status.completed { background: var(--gadri-green-soft); color: #138446; }
.crs-status.completed::before { background: #138446; }
.crs-status.draft     { background: var(--status-amber-soft); color: var(--status-amber); }
.crs-status.draft::before { background: var(--status-amber); }
.crs-status.ongoing   { background: var(--status-red-soft); color: var(--status-red); }
.crs-status.ongoing::before { 
  background: var(--status-red); 
  animation: crs-pulse 2s infinite;
}
.crs-status.scheduled { background: var(--gadri-blue-soft); color: var(--gadri-blue-dark); }
.crs-status.scheduled::before { background: var(--gadri-blue-dark); }
.crs-status.archived  { background: rgba(15,23,42,0.05); color: var(--ink-600); }
.crs-status.archived::before { background: var(--ink-500); }
[data-theme="dark"] .crs-status.completed { color: #5BBF7F; }
[data-theme="dark"] .crs-status.draft { color: #FBBF24; }
[data-theme="dark"] .crs-status.ongoing { color: #F87171; }
[data-theme="dark"] .crs-status.scheduled { color: #8FB4FF; }
[data-theme="dark"] .crs-status.archived { background: rgba(255,255,255,0.08); color: #94A3B8; }
@keyframes crs-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.crs-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
[data-theme="dark"] .crs-title { color: #FFFFFF; }
.crs-desc {
  font-size: 11.5px;
  color: var(--ink-500);
  line-height: 1.5;
  letter-spacing: -0.005em;
  margin-bottom: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.crs-trainer {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 0.5px solid rgba(15,23,42,0.06);
}
[data-theme="dark"] .crs-trainer {
  border-top-color: rgba(255,255,255,0.06);
}
.crs-trainer-av {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--gadri-blue-soft);
  color: var(--gadri-blue-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
[data-theme="dark"] .crs-trainer-av {
  background: rgba(74,133,245,0.18);
  color: #fff;
}
.crs-trainer-name {
  font-size: 11.5px;
  color: var(--ink-700);
  letter-spacing: -0.005em;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crs-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 8px;
  letter-spacing: -0.005em;
  flex-wrap: wrap;
}
.crs-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.crs-meta i { font-size: 12px; opacity: 0.7; }

.crs-enrollment {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--ink-600);
  font-variant-numeric: tabular-nums;
}
.crs-enrollment-bar {
  width: 36px;
  height: 3px;
  background: rgba(15,23,42,0.06);
  border-radius: 100px;
  overflow: hidden;
}
[data-theme="dark"] .crs-enrollment-bar {
  background: rgba(255,255,255,0.08);
}
.crs-enrollment-fill {
  height: 100%;
  background: var(--gadri-blue);
  border-radius: 100px;
  transition: width 250ms ease;
}

/* List View */
.courses-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.crs-list-row {
  background: var(--white);
  border: 0.5px solid rgba(15,23,42,0.08);
  border-radius: 8px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
}
[data-theme="dark"] .crs-list-row {
  border-color: rgba(255,255,255,0.08);
}
.crs-list-row:hover {
  border-color: rgba(37,101,237,0.3);
  background: rgba(37,101,237,0.02);
}
[data-theme="dark"] .crs-list-row:hover {
  background: rgba(74,133,245,0.05);
}
.crs-list-ico {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  color: #fff;
}
.crs-list-info { flex: 1; min-width: 0; }
.crs-list-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.005em;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
[data-theme="dark"] .crs-list-title { color: #FFFFFF; }
.crs-list-sub {
  font-size: 11px;
  color: var(--ink-500);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.005em;
  flex-wrap: wrap;
}
.crs-list-sub i { font-size: 12px; opacity: 0.7; }
.crs-list-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.crs-list-trainer-mini {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-700);
}
[data-theme="dark"] .crs-list-trainer-mini { color: #DCE3EE; }
@media (max-width: 600px) {
  .crs-list-trainer-mini { display: none; }
}

/* ═══════════════════════════════════════════════════════════════════════
   🎓 COURSE DETAIL PAGE — World-class redesign
   ═══════════════════════════════════════════════════════════════════════ */

/* Breadcrumb */
.cd-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ink-500);
  margin-bottom: 14px;
  flex-wrap: wrap;
  letter-spacing: -0.005em;
}
.cd-breadcrumb a, .cd-breadcrumb button.crumb {
  color: var(--ink-600);
  background: transparent;
  border: none;
  padding: 0;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: -0.005em;
}
.cd-breadcrumb a:hover, .cd-breadcrumb button.crumb:hover {
  color: var(--gadri-blue);
}
.cd-breadcrumb i { font-size: 10px; opacity: 0.5; }
.cd-breadcrumb .current {
  color: var(--ink-800);
  font-weight: 600;
  max-width: 280px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-theme="dark"] .cd-breadcrumb .current { color: #FFFFFF; }

/* Hero */
.cd-hero {
  background: linear-gradient(135deg, #0F2547 0%, #1B4FC2 100%);
  border-radius: 14px;
  padding: 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
}
.cd-hero::before {
  content: '';
  position: absolute;
  top: -30%;
  inset-inline-start: -10%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(212,175,55,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.cd-hero-row {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 22px;
  align-items: center;
}
.cd-hero-info { flex: 1; min-width: 0; }

.cd-hero-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.cd-hero-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 5px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cd-hero-tag.draft     { background: #FEF3C7; color: #92400E; }
.cd-hero-tag.scheduled { background: #DBEAFE; color: #1E40AF; }
.cd-hero-tag.ongoing   { background: #FED7AA; color: #9A3412; }
.cd-hero-tag.completed { background: #DCFCE7; color: #166534; }
.cd-hero-tag.archived  { background: rgba(255,255,255,0.18); color: #fff; }
.cd-hero-tag.mandatory { background: #FEE2E2; color: #B91C1C; }

.cd-hero-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
  line-height: 1.25;
  color: #fff;
}
.cd-hero-sub {
  font-size: 12.5px;
  opacity: 0.85;
  line-height: 1.6;
  margin-bottom: 14px;
  max-width: 580px;
}
.cd-hero-meta {
  display: flex;
  gap: 16px;
  font-size: 11.5px;
  opacity: 0.92;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.cd-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.cd-hero-meta i { font-size: 13px; opacity: 0.85; }

.cd-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cd-btn-gold {
  background: #D4AF37;
  color: #0F1F3D;
  padding: 9px 16px;
  border-radius: 7px;
  font-weight: 700;
  font-size: 12.5px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  letter-spacing: -0.005em;
  transition: filter 150ms ease, transform 100ms ease;
}
.cd-btn-gold:hover { filter: brightness(1.08); }
.cd-btn-gold:active { transform: scale(0.97); }
.cd-btn-glass {
  background: rgba(255,255,255,0.1);
  color: #fff;
  padding: 8px 14px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 12.5px;
  border: 0.5px solid rgba(255,255,255,0.2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  letter-spacing: -0.005em;
  transition: background-color 150ms ease;
}
.cd-btn-glass:hover { background: rgba(255,255,255,0.18); }
.cd-btn-glass.danger { color: #FCA5A5; border-color: rgba(252,165,165,0.3); }
.cd-btn-glass.danger:hover { background: rgba(252,165,165,0.12); }

.cd-hero-visual {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(212,175,55,0.28), rgba(212,175,55,0.05));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212,175,55,0.35);
  position: relative;
  overflow: hidden;
}
.cd-hero-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.15) 0%, transparent 50%);
  pointer-events: none;
}
.cd-hero-visual i {
  font-size: 52px;
  color: #FFE7A8;
  filter: drop-shadow(0 4px 12px rgba(212,175,55,0.4));
  position: relative;
  z-index: 1;
}
@media (max-width: 720px) {
  .cd-hero-visual { display: none; }
  .cd-hero { padding: 20px; }
  .cd-hero-title { font-size: 19px; }
}

/* Quick stats specific to this course */
.cd-quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
@media (max-width: 720px) { .cd-quick-stats { grid-template-columns: repeat(2, 1fr); } }
.cd-qs {
  background: var(--white);
  border: 0.5px solid rgba(15,23,42,0.08);
  border-radius: 10px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
[data-theme="dark"] .cd-qs { border-color: rgba(255,255,255,0.08); }
.cd-qs-ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.cd-qs-ico.blue   { background: #DBEAFE; color: #2563EB; }
.cd-qs-ico.green  { background: #DCFCE7; color: #16A34A; }
.cd-qs-ico.amber  { background: #FEF3C7; color: #D97706; }
.cd-qs-ico.purple { background: #EDE9FE; color: #7C3AED; }
[data-theme="dark"] .cd-qs-ico.blue   { background: rgba(37,99,235,0.18); color: #93C5FD; }
[data-theme="dark"] .cd-qs-ico.green  { background: rgba(22,163,74,0.18); color: #4ADE80; }
[data-theme="dark"] .cd-qs-ico.amber  { background: rgba(217,119,6,0.18); color: #FBBF24; }
[data-theme="dark"] .cd-qs-ico.purple { background: rgba(124,58,237,0.22); color: #C4B5FD; }
.cd-qs-num {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .cd-qs-num { color: #FFFFFF; }
.cd-qs-lbl {
  font-size: 10.5px;
  color: var(--ink-500);
  margin-top: 3px;
  letter-spacing: -0.005em;
}
[data-theme="dark"] .cd-qs-lbl { color: #94A3B8; }

/* Tabs */
.cd-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(15,23,42,0.08);
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
[data-theme="dark"] .cd-tabs { border-bottom-color: rgba(255,255,255,0.08); }
.cd-tabs::-webkit-scrollbar { height: 0; }
.cd-tab {
  padding: 10px 14px;
  font-size: 12.5px;
  color: var(--ink-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  font-family: inherit;
  background: transparent;
  border-top: none;
  border-inline-start: none;
  border-inline-end: none;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: color 120ms ease, border-bottom-color 120ms ease;
}
.cd-tab:hover { color: var(--ink-800); }
.cd-tab i { font-size: 14px; }
.cd-tab.active {
  color: var(--gadri-blue);
  border-bottom-color: var(--gadri-blue);
  font-weight: 600;
}
[data-theme="dark"] .cd-tab.active { color: #8FB4FF; border-bottom-color: #8FB4FF; }
.cd-tab-count {
  background: rgba(37,101,237,0.1);
  color: var(--gadri-blue-dark);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-inline-start: 2px;
}
[data-theme="dark"] .cd-tab-count {
  background: rgba(74,133,245,0.18);
  color: #93C5FD;
}

/* Two column layout */
.cd-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  align-items: flex-start;
}
@media (max-width: 960px) { .cd-grid { grid-template-columns: 1fr; } }

/* Main content cards */
.cd-card {
  background: var(--white);
  border: 0.5px solid rgba(15,23,42,0.08);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
[data-theme="dark"] .cd-card { border-color: rgba(255,255,255,0.08); }
.cd-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}
.cd-card-head h3 {
  font-size: var(--text-md, 16px); /* unified: was 14px (Phase 1) */
  font-weight: 600;
  color: var(--ink-900);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  letter-spacing: -0.01em;
}
[data-theme="dark"] .cd-card-head h3 { color: #FFFFFF; }
.cd-card-head h3 i { font-size: 16px; color: var(--ink-500); }

/* Media block */
.cd-media {
  background: var(--white);
  border: 0.5px solid rgba(15,23,42,0.08);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 12px;
}
[data-theme="dark"] .cd-media { border-color: rgba(255,255,255,0.08); }
.cd-media-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
}
.cd-media-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.cd-media-empty {
  padding: 50px 20px;
  text-align: center;
  background: linear-gradient(135deg, rgba(15,23,42,0.02), rgba(37,101,237,0.04));
}
.cd-media-empty i {
  font-size: 48px;
  color: var(--ink-300);
  margin-bottom: 12px;
  display: block;
}
.cd-media-empty h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-700);
  margin: 0 0 6px;
  letter-spacing: -0.005em;
}
.cd-media-empty p {
  font-size: 12px;
  color: var(--ink-500);
  margin: 0;
  letter-spacing: -0.005em;
}
[data-theme="dark"] .cd-media-empty h4 { color: #DCE3EE; }
[data-theme="dark"] .cd-media-empty p { color: #94A3B8; }

/* Online live - join card */
.cd-join {
  padding: 28px 20px;
  text-align: center;
  background: linear-gradient(135deg, rgba(37,101,237,0.04), rgba(74,133,245,0.08));
}
.cd-join-ico {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #3B82F6, #1B4FC2);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(37,101,237,0.25);
}
.cd-join-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
[data-theme="dark"] .cd-join-title { color: #FFFFFF; }
.cd-join-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: var(--ink-500);
  margin-bottom: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.cd-join-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.cd-join-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 11px 24px;
  background: var(--gadri-blue);
  color: #fff;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  letter-spacing: -0.005em;
  transition: filter 150ms ease, transform 100ms ease;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
.cd-join-btn:hover { filter: brightness(1.08); }
.cd-join-btn:active { transform: scale(0.97); }
.cd-join-pwd {
  display: inline-block;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--ink-600);
  background: rgba(15,23,42,0.04);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: monospace;
}
[data-theme="dark"] .cd-join-pwd { background: rgba(255,255,255,0.06); color: #DCE3EE; }

/* Location card */
.cd-location {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.cd-location-ico {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #10B981, #047857);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(16,185,129,0.22);
}
.cd-location-info { flex: 1; min-width: 0; }
.cd-location-label {
  font-size: 10.5px;
  color: var(--ink-500);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}
.cd-location-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-900);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
[data-theme="dark"] .cd-location-name { color: #FFFFFF; }
.cd-location-addr {
  font-size: 12px;
  color: var(--ink-500);
  letter-spacing: -0.005em;
}

/* Workshop block */
.cd-workshop {
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(167,139,250,0.06), rgba(124,58,237,0.04));
}
.cd-workshop-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #6D28D9;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
[data-theme="dark"] .cd-workshop-title { color: #C4B5FD; }
.cd-workshop-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--ink-700);
}
.cd-workshop-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
[data-theme="dark"] .cd-workshop-meta { color: #DCE3EE; }

/* Sessions list */
.cd-session {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 0.5px solid rgba(15,23,42,0.06);
  border-radius: 9px;
  margin-bottom: 7px;
  transition: border-color 150ms ease, background-color 150ms ease;
}
[data-theme="dark"] .cd-session { border-color: rgba(255,255,255,0.06); }
.cd-session:hover {
  border-color: rgba(37,101,237,0.2);
  background: rgba(37,101,237,0.02);
}
[data-theme="dark"] .cd-session:hover { background: rgba(74,133,245,0.04); }
.cd-session-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 15px;
}
.cd-session-ico.scheduled { background: #DBEAFE; color: #2563EB; }
.cd-session-ico.ongoing   { background: #FED7AA; color: #EA580C; }
.cd-session-ico.completed { background: #DCFCE7; color: #16A34A; }
.cd-session-ico.cancelled { background: rgba(15,23,42,0.05); color: var(--ink-500); }
.cd-session-info { flex: 1; min-width: 0; }
.cd-session-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
[data-theme="dark"] .cd-session-title { color: #FFFFFF; }
.cd-session-meta {
  font-size: 11px;
  color: var(--ink-500);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 3px;
  flex-wrap: wrap;
  letter-spacing: -0.005em;
}
.cd-session-meta i { font-size: 12px; opacity: 0.7; }
.cd-session-status {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  letter-spacing: -0.005em;
  flex-shrink: 0;
}
.cd-session-status.scheduled { background: #DBEAFE; color: #1E40AF; }
.cd-session-status.ongoing   { background: #FED7AA; color: #9A3412; }
.cd-session-status.completed { background: #DCFCE7; color: #166534; }
.cd-session-status.cancelled { background: rgba(15,23,42,0.05); color: var(--ink-600); }

/* Sidebar widgets */
.cd-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cd-side .cd-card { margin-bottom: 0; }
.cd-side-label {
  font-size: 10.5px;
  color: var(--ink-500);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 10px;
}
[data-theme="dark"] .cd-side-label { color: #94A3B8; }

.cd-trainer-block {
  display: flex;
  align-items: center;
  gap: 11px;
}
.cd-trainer-av {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, #3B82F6, #1B4FC2);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.cd-trainer-info { flex: 1; min-width: 0; }
.cd-trainer-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.005em;
}
[data-theme="dark"] .cd-trainer-name { color: #FFFFFF; }
.cd-trainer-role {
  font-size: 11px;
  color: #16A34A;
  margin-top: 1px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  letter-spacing: -0.005em;
}
[data-theme="dark"] .cd-trainer-role { color: #4ADE80; }

/* Progress */
.cd-progress-wrap {
  text-align: center;
  padding: 4px 0;
}
.cd-progress-svg {
  width: 110px;
  height: 110px;
  margin: 0 auto;
  display: block;
}
.cd-progress-bg { fill: none; stroke: rgba(15,23,42,0.08); stroke-width: 8; }
[data-theme="dark"] .cd-progress-bg { stroke: rgba(255,255,255,0.08); }
.cd-progress-fg { fill: none; stroke: #138446; stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 600ms ease; }
.cd-progress-text {
  font-size: 24px;
  font-weight: 700;
  fill: var(--ink-900);
  letter-spacing: -0.02em;
}
[data-theme="dark"] .cd-progress-text { fill: #FFFFFF; }
.cd-progress-label {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 6px;
  letter-spacing: -0.005em;
}

.cd-publish-btn {
  width: 100%;
  background: linear-gradient(135deg, #138446, #16A34A);
  color: #fff;
  padding: 11px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  letter-spacing: -0.005em;
  box-shadow: 0 4px 14px rgba(19,132,70,0.22);
  transition: filter 150ms ease, transform 100ms ease;
}
.cd-publish-btn:hover { filter: brightness(1.08); }
.cd-publish-btn:active { transform: scale(0.98); }

.cd-side-action {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--white);
  border: 0.5px solid rgba(15,23,42,0.1);
  color: var(--ink-800);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: inherit;
  letter-spacing: -0.005em;
  transition: background-color 120ms ease, border-color 120ms ease;
  text-align: start;
}
.cd-side-action i { font-size: 14px; color: var(--ink-500); }
.cd-side-action:hover {
  background: rgba(15,23,42,0.02);
  border-color: rgba(15,23,42,0.15);
}
[data-theme="dark"] .cd-side-action {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
  color: #DCE3EE;
}
[data-theme="dark"] .cd-side-action i { color: #94A3B8; }

/* Empty state */
.cd-empty {
  padding: 50px 20px;
  text-align: center;
}
.cd-empty i {
  font-size: 48px;
  color: var(--ink-300);
  margin-bottom: 12px;
  display: block;
}
.cd-empty h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-700);
  margin: 0 0 6px;
}
.cd-empty p {
  font-size: 12px;
  color: var(--ink-500);
  margin: 0 0 14px;
}
[data-theme="dark"] .cd-empty h4 { color: #DCE3EE; }

/* ═══════════════════════════════════════════════════════════════════════
   🛤️ LEARNING PATHS PAGE — World-class redesign (same DNA as courses)
   ═══════════════════════════════════════════════════════════════════════ */

/* Page header — moved to .courses-head (unified) */

/* Featured Path Hero (gradient with golden glow) */
.path-hero {
  background: linear-gradient(135deg, #1E0B3E 0%, #5B21B6 100%);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 18px;
  color: #fff;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.path-hero:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(91,33,182,0.22);
}
.path-hero::before {
  content: '';
  position: absolute;
  top: -30%;
  inset-inline-start: -10%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(212,175,55,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.path-hero-row {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 22px;
  align-items: center;
}
.path-hero-info { flex: 1; min-width: 0; }
.path-hero-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.path-hero-eyebrow .star-badge {
  background: #D4AF37;
  color: #1E0B3E;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.path-hero-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
  line-height: 1.3;
  color: #fff;
}
.path-hero-sub {
  font-size: 12.5px;
  opacity: 0.85;
  max-width: 540px;
  line-height: 1.6;
  margin-bottom: 14px;
}
.path-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 12px;
  opacity: 0.92;
  margin-bottom: 16px;
}
.path-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.path-hero-cta {
  background: #D4AF37;
  color: #1E0B3E;
  padding: 9px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  letter-spacing: -0.005em;
  transition: filter 150ms ease, transform 100ms ease;
}
.path-hero-cta:hover { filter: brightness(1.08); }
.path-hero-cta:active { transform: scale(0.97); }
.path-hero-visual {
  width: 130px;
  height: 130px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(212,175,55,0.28), rgba(212,175,55,0.05));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212,175,55,0.35);
  position: relative;
  overflow: hidden;
}
.path-hero-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.15) 0%, transparent 50%);
  pointer-events: none;
}
.path-hero-visual i {
  font-size: 60px;
  color: #FFE7A8;
  filter: drop-shadow(0 4px 12px rgba(212,175,55,0.4));
  position: relative;
  z-index: 1;
}
@media (max-width: 720px) {
  .path-hero-visual { display: none; }
  .path-hero { padding: 20px; }
  .path-hero-title { font-size: 17px; }
}

/* Path Cards Grid */
.paths-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 1100px) { .paths-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .paths-grid { grid-template-columns: 1fr; } }

.pth-card {
  background: var(--white);
  border: 0.5px solid rgba(15,23,42,0.08);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease;
  display: flex;
  flex-direction: column;
}
[data-theme="dark"] .pth-card { border-color: rgba(255,255,255,0.08); }
.pth-card:hover {
  transform: translateY(-3px);
  border-color: rgba(124,58,237,0.3);
  box-shadow: 0 8px 24px rgba(15,23,42,0.08);
}
.pth-card.certified {
  border-color: #D4AF37;
  box-shadow: 0 4px 16px rgba(212,175,55,0.18);
}

.pth-thumb {
  height: 100px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pth-thumb.purple    { background: linear-gradient(135deg, #A78BFA 0%, #6D28D9 100%); }
.pth-thumb.blue      { background: linear-gradient(135deg, #3B82F6 0%, #1B4FC2 100%); }
.pth-thumb.green     { background: linear-gradient(135deg, #10B981 0%, #047857 100%); }
.pth-thumb.amber     { background: linear-gradient(135deg, #F59E0B 0%, #C2410C 100%); }
.pth-thumb.pink      { background: linear-gradient(135deg, #EC4899 0%, #9D174D 100%); }
.pth-thumb.teal      { background: linear-gradient(135deg, #14B8A6 0%, #0F766E 100%); }
.pth-thumb.indigo    { background: linear-gradient(135deg, #6366F1 0%, #3730A3 100%); }
.pth-thumb.rose      { background: linear-gradient(135deg, #F43F5E 0%, #9F1239 100%); }
.pth-thumb-ico {
  font-size: 38px;
  color: rgba(255,255,255,0.92);
  z-index: 1;
}
.pth-thumb-pattern {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.12) 0%, transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.08) 0%, transparent 40%);
  pointer-events: none;
}
.pth-thumb-badges {
  position: absolute;
  top: 10px;
  inset-inline-start: 10px;
  display: flex;
  gap: 5px;
  z-index: 2;
}
.pth-thumb-badge {
  background: rgba(255,255,255,0.95);
  color: #0F1F3D;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.pth-thumb-badge.beginner     { background: #DCFCE7; color: #166534; }
.pth-thumb-badge.intermediate { background: #FEF3C7; color: #92400E; }
.pth-thumb-badge.advanced     { background: #FEE2E2; color: #B91C1C; }
.pth-thumb-badge.progressive  { background: #EDE9FE; color: #6D28D9; }
.pth-thumb-badge.cert {
  background: linear-gradient(135deg, #D4AF37, #F4D03F);
  color: #1E0B3E;
}

.pth-body {
  padding: 14px 15px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.pth-cat {
  font-size: 10.5px;
  color: var(--ink-500);
  letter-spacing: -0.005em;
  margin-bottom: 5px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}
.pth-cat i { font-size: 12px; opacity: 0.7; }
.pth-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.01em;
  margin-bottom: 5px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}
[data-theme="dark"] .pth-title { color: #FFFFFF; }
.pth-desc {
  font-size: 11.5px;
  color: var(--ink-500);
  line-height: 1.5;
  letter-spacing: -0.005em;
  margin-bottom: 12px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Stats row inside card */
.pth-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-top: 0.5px solid rgba(15,23,42,0.06);
  border-bottom: 0.5px solid rgba(15,23,42,0.06);
  font-size: 11px;
  color: var(--ink-600);
  letter-spacing: -0.005em;
  margin-bottom: 12px;
}
[data-theme="dark"] .pth-stats {
  border-top-color: rgba(255,255,255,0.06);
  border-bottom-color: rgba(255,255,255,0.06);
  color: #DCE3EE;
}
.pth-stats span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pth-stats i { font-size: 12px; opacity: 0.7; }
.pth-stats b {
  font-weight: 700;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .pth-stats b { color: #FFFFFF; }

/* Progress (employee view) */
.pth-progress {
  margin-bottom: 12px;
}
.pth-progress-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: -0.005em;
}
.pth-progress-label {
  color: var(--ink-500);
  font-weight: 500;
}
.pth-progress-pct {
  font-weight: 700;
  color: var(--gadri-blue);
  font-variant-numeric: tabular-nums;
}
.pth-progress-bar {
  height: 4px;
  background: rgba(15,23,42,0.06);
  border-radius: 100px;
  overflow: hidden;
}
[data-theme="dark"] .pth-progress-bar { background: rgba(255,255,255,0.08); }
.pth-progress-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 400ms ease;
}
.pth-progress-meta {
  font-size: 10.5px;
  color: var(--ink-500);
  margin-top: 3px;
  letter-spacing: -0.005em;
}

/* Milestones chips */
.pth-milestones {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.pth-milestone {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(124,58,237,0.08);
  color: #6D28D9;
  font-weight: 600;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
[data-theme="dark"] .pth-milestone {
  background: rgba(167,139,250,0.18);
  color: #C4B5FD;
}

/* Footer */
.pth-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  gap: 8px;
}
.pth-target {
  font-size: 10.5px;
  color: var(--ink-500);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  letter-spacing: -0.005em;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pth-target i { font-size: 12px; opacity: 0.7; flex-shrink: 0; }
.pth-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--gadri-blue);
  background: transparent;
  border: none;
  cursor: pointer;
  letter-spacing: -0.005em;
  font-family: inherit;
  padding: 0;
}
.pth-cta:hover { text-decoration: underline; }

/* ─── PATH DETAIL PAGE ─── */
.pd-hero {
  background: linear-gradient(135deg, #1E0B3E 0%, #5B21B6 100%);
  border-radius: 14px;
  padding: 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
}
.pd-hero::before {
  content: '';
  position: absolute;
  top: -30%;
  inset-inline-start: -10%;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, rgba(212,175,55,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.pd-hero-row {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 22px;
  align-items: center;
}
.pd-hero-info { flex: 1; min-width: 0; }
.pd-hero-tags {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.pd-hero-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 5px;
  background: rgba(255,255,255,0.18);
  color: #fff;
  letter-spacing: -0.005em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.pd-hero-tag.beginner     { background: #DCFCE7; color: #166534; }
.pd-hero-tag.intermediate { background: #FEF3C7; color: #92400E; }
.pd-hero-tag.advanced     { background: #FEE2E2; color: #B91C1C; }
.pd-hero-tag.progressive  { background: #EDE9FE; color: #6D28D9; }
.pd-hero-tag.cert { background: linear-gradient(135deg, #D4AF37, #F4D03F); color: #1E0B3E; }
.pd-hero-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 6px;
  line-height: 1.25;
  color: #fff;
}
.pd-hero-sub {
  font-size: 12.5px;
  opacity: 0.85;
  line-height: 1.6;
  margin-bottom: 14px;
  max-width: 580px;
}
.pd-hero-meta {
  display: flex;
  gap: 16px;
  font-size: 11.5px;
  opacity: 0.92;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.pd-hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.pd-hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pd-btn-gold {
  background: #D4AF37;
  color: #1E0B3E;
  padding: 9px 16px;
  border-radius: 7px;
  font-weight: 700;
  font-size: 12.5px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  letter-spacing: -0.005em;
  transition: filter 150ms ease;
}
.pd-btn-gold:hover { filter: brightness(1.08); }
.pd-btn-glass {
  background: rgba(255,255,255,0.1);
  color: #fff;
  padding: 8px 14px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 12.5px;
  border: 0.5px solid rgba(255,255,255,0.2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: inherit;
  letter-spacing: -0.005em;
}
.pd-btn-glass:hover { background: rgba(255,255,255,0.18); }
.pd-btn-glass.danger { color: #FCA5A5; border-color: rgba(252,165,165,0.3); }
.pd-hero-visual {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(212,175,55,0.28), rgba(212,175,55,0.05));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(212,175,55,0.35);
  position: relative;
  overflow: hidden;
}
.pd-hero-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.15) 0%, transparent 50%);
  pointer-events: none;
}
.pd-hero-visual i {
  font-size: 52px;
  color: #FFE7A8;
  filter: drop-shadow(0 4px 12px rgba(212,175,55,0.4));
  position: relative;
  z-index: 1;
}
@media (max-width: 720px) {
  .pd-hero-visual { display: none; }
  .pd-hero { padding: 20px; }
  .pd-hero-title { font-size: 19px; }
}

/* Path detail courses list */
.pd-course {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border: 0.5px solid rgba(15,23,42,0.06);
  border-radius: 9px;
  margin-bottom: 7px;
  transition: border-color 150ms ease, background-color 150ms ease;
}
[data-theme="dark"] .pd-course { border-color: rgba(255,255,255,0.06); }
.pd-course:hover {
  border-color: rgba(124,58,237,0.2);
  background: rgba(124,58,237,0.02);
}
.pd-course-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(124,58,237,0.08);
  color: #6D28D9;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .pd-course-num {
  background: rgba(167,139,250,0.18);
  color: #C4B5FD;
}
.pd-course-num.done {
  background: #DCFCE7;
  color: #166534;
}
.pd-course-info { flex: 1; min-width: 0; }
.pd-course-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.005em;
}
[data-theme="dark"] .pd-course-title { color: #FFFFFF; }
.pd-course-meta {
  font-size: 11px;
  color: var(--ink-500);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  letter-spacing: -0.005em;
}
.pd-course-meta i { font-size: 12px; opacity: 0.7; }

/* Milestone block in detail */
.pd-milestones {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pd-milestone {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(124,58,237,0.04);
  border: 0.5px solid rgba(124,58,237,0.15);
  border-radius: 9px;
}
[data-theme="dark"] .pd-milestone {
  background: rgba(167,139,250,0.08);
  border-color: rgba(167,139,250,0.2);
}
.pd-milestone-ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, #A78BFA, #6D28D9);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}
.pd-milestone-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: -0.005em;
}
[data-theme="dark"] .pd-milestone-title { color: #FFFFFF; }
.pd-milestone-desc {
  font-size: 11px;
  color: var(--ink-500);
  margin-top: 2px;
  letter-spacing: -0.005em;
}

/* ═══════════════════════════════════════════════════════════════════════
   🌙 DARK MODE HARDENING — Last-resort contrast guarantees
   هذا الـ block يأتي آخر شيء في الـ stylesheet ليطغى على أيّ تعريف سابق
   ═══════════════════════════════════════════════════════════════════════ */
[data-theme="dark"] .kpi-label {
  color: #B5C2D4 !important;
  font-weight: 500 !important;
}
[data-theme="dark"] .kpi-value {
  color: #FFFFFF !important;
}
[data-theme="dark"] .kpi-desc {
  color: #94A3B8 !important;
}
[data-theme="dark"] .kpi-trend.up { color: #5BBF7F !important; }
[data-theme="dark"] .kpi-trend.down { color: #F87171 !important; }

/* Cards titles & subtitles */
[data-theme="dark"] .card-head h3 {
  color: #FFFFFF !important;
}
[data-theme="dark"] .card-head .card-subtitle {
  color: #94A3B8 !important;
}

/* Section titles */
[data-theme="dark"] .kpi-section-title-text {
  color: #DCE3EE !important;
}

/* Table */
[data-theme="dark"] table th {
  color: #94A3B8 !important;
  border-bottom-color: rgba(255,255,255,0.08) !important;
}
[data-theme="dark"] table td {
  color: #DCE3EE !important;
}

/* Hero */
[data-theme="dark"] .hero-title {
  color: #FFFFFF !important;
}
[data-theme="dark"] .hero-sub {
  color: #94A3B8 !important;
}

/* Quick actions */
[data-theme="dark"] .quick-action-label {
  color: #FFFFFF !important;
}
[data-theme="dark"] .quick-action-sub {
  color: #94A3B8 !important;
}

/* Empty states */
[data-theme="dark"] .empty-state {
  color: #7B8BA3 !important;
}

/* Sidebar nav items */
[data-theme="dark"] .nav-item {
  color: #B5C2D4;
}
[data-theme="dark"] .nav-item:hover {
  color: #FFFFFF;
}
[data-theme="dark"] .nav-item.active {
  color: #FFFFFF !important;
}
[data-theme="dark"] .sidebar-section-title {
  color: #7B8BA3 !important;
}
[data-theme="dark"] .sidebar-brand .brand-name {
  color: #FFFFFF;
}
[data-theme="dark"] .sidebar-brand .brand-tag {
  color: #94A3B8;
}
[data-theme="dark"] .sidebar-user-name {
  color: #FFFFFF !important;
}
[data-theme="dark"] .sidebar-user-role {
  color: #94A3B8 !important;
}

/* Topbar */
[data-theme="dark"] .topbar-title h1 {
  color: #FFFFFF !important;
}
[data-theme="dark"] .topbar-title p {
  color: #94A3B8 !important;
}

/* ═══════════════════════════════════════════════════════════════════
   GADRI V5 LOGIN — التصميم السحريّ
   ═══════════════════════════════════════════════════════════════════ */

/* الإطار العامّ */
.gadri-v5 {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: 'Cairo', sans-serif;
  direction: rtl;
}

/* === النصف الأيسر: البصريّ === */
.gv5-visual {
  width: 54%;
  position: relative;
  overflow: hidden;
  background: #f5f5f0;
}
.gv5-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gv5-overlay {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(245,243,235,0.85) 0%, rgba(245,243,235,0.3) 40%, rgba(245,243,235,0) 60%),
    linear-gradient(180deg, rgba(245,243,235,0) 60%, rgba(15,23,41,0.18) 100%);
}

/* الذرّات الذهبيّة */
.gv5-particles { position: absolute; inset: 0; pointer-events: none; }
.gv5-particle {
  position: absolute;
  width: 3px; height: 3px; border-radius: 50%;
  background: radial-gradient(circle, #D4AF37, rgba(212,175,55,0));
  box-shadow: 0 0 6px #D4AF37;
  animation: gv5FloatParticle 9s ease-in-out infinite;
}
.gv5-particle:nth-child(1) { top: 20%; right: 20%; --gv5-dx: -30px; --gv5-dy: -40px; animation-delay: 0s; }
.gv5-particle:nth-child(2) { top: 40%; right: 35%; --gv5-dx: 25px; --gv5-dy: -50px; animation-delay: 1.5s; width: 2px; height: 2px; animation-duration: 11s; }
.gv5-particle:nth-child(3) { top: 60%; right: 15%; --gv5-dx: -20px; --gv5-dy: -60px; animation-delay: 3s; animation-duration: 10s; }
.gv5-particle:nth-child(4) { top: 30%; right: 45%; --gv5-dx: 30px; --gv5-dy: -35px; animation-delay: 4.5s; width: 2px; height: 2px; animation-duration: 12s; }
.gv5-particle:nth-child(5) { top: 50%; right: 25%; --gv5-dx: -15px; --gv5-dy: -55px; animation-delay: 6s; animation-duration: 9.5s; }
.gv5-particle:nth-child(6) { top: 25%; right: 55%; --gv5-dx: 20px; --gv5-dy: -45px; animation-delay: 2s; width: 2.5px; height: 2.5px; animation-duration: 11s; }
.gv5-particle:nth-child(7) { top: 70%; right: 30%; --gv5-dx: -25px; --gv5-dy: -50px; animation-delay: 5s; animation-duration: 10.5s; }
@keyframes gv5FloatParticle {
  0% { transform: translate(0, 0) scale(0.6); opacity: 0; }
  20% { opacity: 0.9; }
  80% { opacity: 0.6; }
  100% { transform: translate(var(--gv5-dx), var(--gv5-dy)) scale(1); opacity: 0; }
}

/* شعاع الضوء */
.gv5-light-sweep {
  position: absolute; top: 0; right: 0; bottom: 0; width: 40%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.15) 45%, rgba(212,175,55,0.18) 50%, rgba(255,255,255,0.15) 55%, transparent 100%);
  animation: gv5LightSweep 8s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: overlay;
}
@keyframes gv5LightSweep {
  0% { transform: translateX(-150%) skewX(-20deg); }
  100% { transform: translateX(250%) skewX(-20deg); }
}

/* العلامة */
.gv5-brand {
  position: absolute; top: 32px; right: 38px; z-index: 2;
  animation: gv5FadeUp 1s ease;
}
.gv5-brand-ar {
  font-size: 24px; font-weight: 800; color: #1B2952;
  letter-spacing: -0.4px;
}
.gv5-brand-en {
  font-size: 11px; color: #1B2952; opacity: 0.7;
  letter-spacing: 3px; font-weight: 700; margin-top: 4px;
  display: flex; align-items: center; gap: 7px;
}
.gv5-brand-en::before, .gv5-brand-en::after { content: '◆'; color: #D4AF37; font-size: 8px; }

/* النصّ السحريّ */
.gv5-tagline {
  position: absolute; top: 130px; right: 38px; text-align: right; z-index: 2;
  max-width: 60%;
  animation: gv5FadeUp 1.2s ease 0.3s both;
}
.gv5-tagline-1 {
  font-family: 'Aref Ruqaa', serif; font-size: 44px; font-weight: 700;
  color: #1B2952; line-height: 1.45;
  animation: gv5Breathe 4s ease-in-out infinite;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
.gv5-tagline-2-wrap {
  position: relative; display: inline-block; margin-top: 4px;
  animation: gv5Breathe 4s ease-in-out infinite 0.2s;
}
.gv5-tagline-aura {
  position: absolute;
  top: 55%; right: 30%;
  transform: translate(50%, -50%);
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(212,175,55,0.35) 0%, rgba(212,175,55,0) 70%);
  animation: gv5AuraGlow 3s ease-in-out infinite;
  pointer-events: none; z-index: -1;
}
.gv5-tagline-2 {
  font-family: 'Aref Ruqaa', serif; font-size: 44px; font-weight: 700;
  background: linear-gradient(135deg, #D4AF37 0%, #B8860B 30%, #F4D03F 50%, #B8860B 70%, #D4AF37 100%);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gv5GoldShimmer 4s ease infinite;
  line-height: 1.45; position: relative;
}
.gv5-tagline-2-wrap::after {
  content: ''; position: absolute; bottom: -2px; right: 0; left: 0; height: 3px;
  background: linear-gradient(90deg, transparent 0%, #D4AF37 30%, #F4D03F 50%, #D4AF37 70%, transparent 100%);
  transform: scaleX(0); transform-origin: center;
  animation: gv5UnderlineDraw 1.5s ease 1.2s forwards;
  border-radius: 2px;
}
.gv5-tagline-sub {
  font-family: 'Cairo', sans-serif; font-size: 14px; color: #1B2952;
  opacity: 0.75; line-height: 1.7; max-width: 360px; margin-top: 18px;
  font-weight: 500;
  animation: gv5FadeUp 1.5s ease 0.8s both;
}

/* روابط سفليّة */
.gv5-visual-footer {
  position: absolute; bottom: 24px; right: 38px; left: 38px; z-index: 2;
  display: flex; justify-content: flex-end; gap: 22px;
  font-size: 12px; color: #1B2952;
  opacity: 0.75; font-weight: 600;
}
.gv5-visual-footer span {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  transition: opacity 0.2s;
}
.gv5-visual-footer span:hover { opacity: 1; }
.gv5-visual-footer i { font-size: 14px; color: #D4AF37; }

/* === النصف الأيمن: الفورم === */
.gv5-form-side {
  width: 46%;
  padding: 40px 48px;
  display: flex;
  flex-direction: column;
  background: #FAFBFC;
  position: relative;
}

/* الشريط العلويّ */
.gv5-topbar {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 10px; margin-bottom: 18px;
  animation: gv5FadeUp 0.6s ease;
}
.gv5-lang-switcher {
  display: flex; gap: 4px; background: rgba(15,23,41,0.04);
  border-radius: 9px; padding: 3px;
}
.gv5-lang-switcher button {
  border: none; background: transparent;
  padding: 6px 14px; border-radius: 7px;
  font-size: 11px; font-weight: 700; color: #64748B;
  cursor: pointer; transition: all 0.2s;
  font-family: inherit;
}
.gv5-lang-switcher button.active { background: #fff; color: #1B2952; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.gv5-theme-toggle {
  width: 36px; height: 32px; border-radius: 9px;
  background: rgba(15,23,41,0.04); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #1B2952; transition: background 0.2s;
}
.gv5-theme-toggle:hover { background: rgba(15,23,41,0.08); }
.gv5-theme-toggle .icon { width: 16px; height: 16px; }

/* 🎓 البانر العلويّ البسيط (الخيار B) */
.gv5-banner {
  text-align: center;
  padding: 30px 0 26px;
  border-bottom: 1px solid rgba(15,23,41,0.08);
  margin-bottom: 28px;
  animation: gv5FadeUp 0.8s ease 0.1s both;
}
.gv5-banner-line {
  display: flex; align-items: center; gap: 12px;
  justify-content: center;
  margin-bottom: 10px;
}
.gv5-banner-line::before, .gv5-banner-line::after {
  content: '';
  width: 40px; height: 1px;
  background: linear-gradient(90deg, transparent, #D4AF37);
}
.gv5-banner-line::after {
  background: linear-gradient(90deg, #D4AF37, transparent);
}
.gv5-banner-en {
  font-size: 11px;
  color: #D4AF37;
  letter-spacing: 4px;
  font-weight: 800;
}
.gv5-banner-title {
  font-size: 16px;
  font-weight: 800;
  color: #0F1F3D;
  letter-spacing: 0.5px;
}

/* الوضع الليليّ للبانر */
[data-theme="dark"] .gv5-banner {
  border-bottom-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .gv5-banner-title { color: #F1F5F9; }

/* بطاقة الفورم */
.gv5-form-card {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  max-width: 320px; margin: 0 auto; width: 100%;
  animation: gv5FadeUp 0.8s ease 0.2s both;
}

/* الترحيب */
.gv5-welcome-title {
  font-size: 28px; font-weight: 800; color: #0F1F3D;
  margin: 0; letter-spacing: -0.5px;
  animation: gv5WelcomeBreathe 4s ease-in-out infinite;
}
.gv5-welcome-gold {
  background: linear-gradient(135deg, #D4AF37 0%, #B8860B 30%, #F4D03F 50%, #B8860B 70%, #D4AF37 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gv5GoldShimmer 4s ease infinite;
  display: inline-block;
}
.gv5-welcome-ornament {
  display: flex; align-items: center; gap: 8px;
  margin: 9px 0 6px;
}
.gv5-welcome-ornament::before,
.gv5-welcome-ornament::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,0.5), transparent);
  transform: scaleX(0);
  transform-origin: center;
  animation: gv5WelcomeLineDraw 1.5s ease 0.6s forwards;
}
.gv5-welcome-diamond {
  color: #D4AF37; font-size: 7px;
  animation: gv5FadeUp 0.6s ease 1.4s both;
}
.gv5-welcome-sub {
  font-size: 13px; color: #64748B; margin: 0 0 24px; line-height: 1.5;
}
@keyframes gv5WelcomeBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.012); }
}
@keyframes gv5WelcomeLineDraw {
  to { transform: scaleX(1); }
}

/* رسالة خطأ */
.gv5-err {
  display: none;
  background: #FEF2F2; border: 1px solid #FCA5A5;
  color: #991B1B; padding: 10px 14px; border-radius: 9px;
  font-size: 12px; font-weight: 600; margin-bottom: 14px;
}
.gv5-err.show { display: block; animation: gv5FadeUp 0.3s ease; }

/* الحقول */
.gv5-field { margin-bottom: 11px; }
.gv5-label {
  display: block; font-size: 12px; font-weight: 700; color: #0F1F3D;
  margin-bottom: 6px;
}
.gv5-input-wrap {
  display: flex; align-items: center; background: #fff;
  border: 1.2px solid #E2E8F0; border-radius: 9px;
  padding: 0 12px; height: 38px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.gv5-input-wrap:hover { border-color: #CBD5E1; }
.gv5-input-wrap:focus-within {
  border-color: #1B2952;
  box-shadow: 0 0 0 3px rgba(27,41,82,0.08);
}
.gv5-input-icon { font-size: 13px; color: #94A3B8; }
.gv5-input-wrap input {
  flex: 1; border: none; outline: none;
  font-family: inherit; font-size: 13px;
  color: #0F1F3D; background: transparent;
  text-align: right; padding: 0 9px;
}
.gv5-input-wrap input::placeholder { color: #94A3B8; }
.gv5-pwd-toggle {
  background: none; border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center; color: #94A3B8;
  transition: color 0.2s;
}
.gv5-pwd-toggle:hover { color: #1B2952; }

/* 🔧 إصلاح Chrome Autofill — منع اللون الأبيض */
.gv5-input-wrap input:-webkit-autofill,
.gv5-input-wrap input:-webkit-autofill:hover,
.gv5-input-wrap input:-webkit-autofill:focus,
.gv5-input-wrap input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
  -webkit-text-fill-color: #0F1F3D !important;
  caret-color: #0F1F3D !important;
  transition: background-color 5000s ease-in-out 0s;
  border-radius: 9px;
}
[data-theme="dark"] .gv5-input-wrap input:-webkit-autofill,
[data-theme="dark"] .gv5-input-wrap input:-webkit-autofill:hover,
[data-theme="dark"] .gv5-input-wrap input:-webkit-autofill:focus,
[data-theme="dark"] .gv5-input-wrap input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #1a2540 inset !important;
  -webkit-text-fill-color: #F1F5F9 !important;
  caret-color: #F1F5F9 !important;
}
.gv5-pwd-toggle svg { width: 14px; height: 14px; }

/* تذكّرني + نسيت كلمة المرور */
.gv5-options-row {
  display: flex; justify-content: space-between; align-items: center;
  margin: 6px 0 20px;
}
.gv5-remember {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: #1B2952; font-weight: 600;
  cursor: pointer; user-select: none;
}
.gv5-remember-box {
  width: 16px; height: 16px; border: 1.5px solid #CBD5E1;
  border-radius: 4px; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; background: #fff;
}
.gv5-remember-box.checked {
  background: #1B2952; border-color: #1B2952;
}
.gv5-remember-check {
  width: 11px; height: 11px; color: #fff;
  opacity: 0; transition: opacity 0.2s;
}
.gv5-remember-box.checked .gv5-remember-check { opacity: 1; }
.gv5-forgot {
  font-size: 12px; color: #1B2952; font-weight: 700;
  text-decoration: none; cursor: pointer; transition: color 0.2s;
}
.gv5-forgot:hover { color: #D4AF37; }

/* زرّ الدخول */
.gv5-btn-login {
  position: relative; height: 48px; width: 100%;
  background: linear-gradient(135deg, #1B2952 0%, #2C3E73 100%);
  color: #fff; border: none; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-size: 14px; font-weight: 700; font-family: inherit;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(27,41,82,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
  overflow: hidden;
}
.gv5-btn-login svg { width: 16px; height: 16px; transition: transform 0.2s; }
.gv5-btn-login::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,0.3), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s;
}
.gv5-btn-login:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(27,41,82,0.35);
}
.gv5-btn-login:hover::before { transform: translateX(100%); }
.gv5-btn-login:hover svg { transform: translateX(-3px); }
.gv5-btn-login:active { transform: translateY(0); }
.gv5-btn-login:disabled { opacity: 0.7; cursor: not-allowed; }

/* ملاحظة الأمان */
.gv5-secure-note {
  display: flex; align-items: center; gap: 8px;
  margin-top: 20px; padding: 10px 14px;
  background: rgba(212,175,55,0.06); border: 1px solid rgba(212,175,55,0.2);
  border-radius: 9px;
  font-size: 11px; color: #64748B;
}
.gv5-secure-note i { font-size: 14px; color: #D4AF37; }
.gv5-live-status {
  margin-right: auto; display: flex; align-items: center; gap: 5px;
  font-size: 10px; color: #16A34A; font-weight: 700;
}
.gv5-live-dot {
  width: 6px; height: 6px; border-radius: 50%; background: #16A34A;
  box-shadow: 0 0 6px #16A34A;
  animation: gv5Pulse 2s ease-in-out infinite;
}

/* الحركات */
@keyframes gv5FadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes gv5Breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}
@keyframes gv5GoldShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
@keyframes gv5AuraGlow {
  0%, 100% { box-shadow: 0 0 28px 8px rgba(212,175,55,0.15); }
  50% { box-shadow: 0 0 44px 14px rgba(212,175,55,0.32); }
}
@keyframes gv5UnderlineDraw {
  0% { transform: scaleX(0); opacity: 0; }
  100% { transform: scaleX(1); opacity: 1; }
}
@keyframes gv5Pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* === الوضع الليليّ === */
[data-theme="dark"] .gv5-form-side { background: #0F1729; }
[data-theme="dark"] .gv5-welcome-title { color: #F1F5F9; }
[data-theme="dark"] .gv5-welcome-sub { color: #94A3B8; }
[data-theme="dark"] .gv5-label { color: #E2E8F0; }
[data-theme="dark"] .gv5-input-wrap {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .gv5-input-wrap:hover { border-color: rgba(255,255,255,0.2); }
[data-theme="dark"] .gv5-input-wrap:focus-within {
  border-color: #D4AF37;
  box-shadow: 0 0 0 3px rgba(212,175,55,0.1);
}
[data-theme="dark"] .gv5-input-wrap input { color: #F1F5F9; }
[data-theme="dark"] .gv5-input-wrap input::placeholder { color: #64748B; }
[data-theme="dark"] .gv5-input-icon { color: #64748B; }
[data-theme="dark"] .gv5-pwd-toggle { color: #64748B; }
[data-theme="dark"] .gv5-pwd-toggle:hover { color: #D4AF37; }
[data-theme="dark"] .gv5-remember { color: #CBD5E1; }
[data-theme="dark"] .gv5-remember-box { background: rgba(255,255,255,0.04); border-color: #475569; }
[data-theme="dark"] .gv5-remember-box.checked { background: #1E4FCB; border-color: #1E4FCB; }
[data-theme="dark"] .gv5-forgot { color: #D4AF37; }
[data-theme="dark"] .gv5-forgot:hover { color: #F4D03F; }
[data-theme="dark"] .gv5-lang-switcher { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .gv5-lang-switcher button { color: #94A3B8; }
[data-theme="dark"] .gv5-lang-switcher button.active { background: rgba(255,255,255,0.1); color: #F1F5F9; }
[data-theme="dark"] .gv5-theme-toggle { background: rgba(255,255,255,0.06); color: #E2E8F0; }
[data-theme="dark"] .gv5-btn-login {
  background: linear-gradient(135deg, #1E4FCB 0%, #2C5FD6 100%);
  box-shadow: 0 4px 16px rgba(30,79,203,0.45);
}
[data-theme="dark"] .gv5-secure-note { background: rgba(212,175,55,0.08); border-color: rgba(212,175,55,0.25); color: #94A3B8; }
[data-theme="dark"] .gv5-overlay {
  background:
    linear-gradient(90deg, rgba(15,23,41,0.92) 0%, rgba(15,23,41,0.5) 40%, rgba(15,23,41,0.15) 60%),
    linear-gradient(180deg, rgba(15,23,41,0.4) 0%, rgba(15,23,41,0.6) 100%);
}
[data-theme="dark"] .gv5-brand-ar { color: #fff; }
[data-theme="dark"] .gv5-brand-en { color: #fff; opacity: 0.85; }
[data-theme="dark"] .gv5-tagline-1 { color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,0.4); }
[data-theme="dark"] .gv5-tagline-sub { color: #E2E8F0; opacity: 0.85; }
[data-theme="dark"] .gv5-visual-footer { color: #fff; opacity: 0.75; }

/* 📊 شريط الأرقام الأكاديميّة */
.gv5-academic-bar {
  position: absolute;
  bottom: 62px;
  right: 38px;
  left: 38px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: gv5FadeUp 1.5s ease 1s both;
}
.gv5-stats {
  display: flex;
  gap: 28px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(27,41,82,0.15);
}
.gv5-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.gv5-stat-num {
  font-size: 22px;
  font-weight: 800;
  color: #1B2952;
  letter-spacing: -0.5px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.gv5-plus {
  color: #D4AF37;
  font-weight: 700;
}
.gv5-stat-lbl {
  font-size: 10px;
  color: #1B2952;
  opacity: 0.65;
  font-weight: 600;
  margin-top: 2px;
}
.gv5-accred {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #1B2952;
  opacity: 0.8;
  font-weight: 600;
}
.gv5-accred i { color: #D4AF37; font-size: 13px; }
.gv5-accred-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #1B2952;
  opacity: 0.4;
}

/* الوضع الليليّ للّمسات الأكاديميّة */
[data-theme="dark"] .gv5-stats { border-bottom-color: rgba(255,255,255,0.15); }
[data-theme="dark"] .gv5-stat-num { color: #fff; }
[data-theme="dark"] .gv5-stat-lbl { color: #fff; opacity: 0.7; }
[data-theme="dark"] .gv5-accred { color: #fff; opacity: 0.85; }
[data-theme="dark"] .gv5-accred-dot { background: #fff; }

/* تجاوب الشاشات الصغيرة */
@media (max-width: 900px) {
  .gv5-visual { display: none; }
  .gv5-form-side { width: 100%; }
}


  /* شاشة التحميل — تصميم مؤسّسيّ بسيط (Minimal): spinner + نصّ فقط، بلا شعار/صور */
  #loadingScreen {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: none;
    align-items: center;
    justify-content: center;
    background: #FAFBFC;
  }
  #loadingScreen.is-visible { display: flex; }
  [data-theme="dark"] #loadingScreen { background: #0A0F1C; }
  .ls-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 40px 24px;
    text-align: center;
  }
  .ls-spinner {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(27,41,82,0.12);
    border-top-color: #1B2952;
    animation: lsSpin 0.7s linear infinite;
  }
  [data-theme="dark"] .ls-spinner {
    border-color: rgba(255,255,255,0.14);
    border-top-color: #E2E8F0;
  }
  @keyframes lsSpin { to { transform: rotate(360deg); } }
  .ls-status {
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    letter-spacing: 0;
  }
  [data-theme="dark"] .ls-status { color: rgba(255,255,255,0.72); }
  @media (prefers-reduced-motion: reduce) {
    .ls-spinner { animation-duration: 1.6s; }
  }

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR — Enterprise SaaS palette (SIDEBAR ONLY).
   Cards/content untouched. Colors only. All rules scoped to .sidebar.
   Light mode = royal-blue panel; dark mode = navy (unchanged). */

/* ── Light mode — premium enterprise sidebar
   (MS Learn / Docebo / Coursera Business / TalentLMS vibe).
   Sidebar only; dark mode, header, cards, content untouched. ── */
html:not([data-theme="dark"]) .sidebar {
  background: linear-gradient(180deg, #1E3A8A 0%, #1E40AF 35%, #1E3A8A 100%);
  box-shadow: -8px 0 24px rgba(15,23,42,0.08);
  border-inline-end: 1px solid rgba(255,255,255,0.08);
  color: #E5E7EB;
}
/* Header — clear separation from the menu */
html:not([data-theme="dark"]) .sidebar .sidebar-brand {
  background: transparent;
  border-bottom: none;
}
html:not([data-theme="dark"]) .sidebar .brand-name { color: #FFFFFF; }
html:not([data-theme="dark"]) .sidebar .brand-tag { color: rgba(255,255,255,0.65); }
html:not([data-theme="dark"]) .sidebar .sidebar-section-title { color: rgba(255,255,255,0.50); }
/* Items + text */
html:not([data-theme="dark"]) .sidebar .nav-item {
  color: #CBD5E1;
  border-radius: 12px;
  transition: background .2s ease, color .2s ease;
}
html:not([data-theme="dark"]) .sidebar .nav-item .icon,
html:not([data-theme="dark"]) .sidebar .nav-item .ti {
  color: rgba(255,255,255,0.75);
  opacity: 0.75;
  transition: all .2s ease;
}
/* Hover — quiet, elegant */
html:not([data-theme="dark"]) .sidebar .nav-item:hover {
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  color: #FFFFFF;
}
html:not([data-theme="dark"]) .sidebar .nav-item:hover .icon,
html:not([data-theme="dark"]) .sidebar .nav-item:hover .ti {
  opacity: 1;
  color: #F59E0B;
  transform: translateX(-2px);
}
/* Active — independent card */
html:not([data-theme="dark"]) .sidebar .nav-item.active {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-inline-start: 4px solid #F59E0B;
  border-radius: 14px;
  color: #FFFFFF;
}
html:not([data-theme="dark"]) .sidebar .nav-item.active .icon,
html:not([data-theme="dark"]) .sidebar .nav-item.active .ti { color: #FFFFFF; opacity: 1; }
html:not([data-theme="dark"]) .sidebar .nav-item.active::before { display: none; }
/* Search field — premium glass */
html:not([data-theme="dark"]) .sidebar .sidebar-search-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
html:not([data-theme="dark"]) .sidebar .sidebar-user { color: #FFFFFF; }
html:not([data-theme="dark"]) .sidebar .sidebar-user:hover { background: rgba(255,255,255,0.08); }

/* ── Dark mode — navy gradient (UNCHANGED) ── */
[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #0B1220 0%, #111C34 100%);
  border-inline-end: 1px solid rgba(255,255,255,0.06);
  box-shadow: 2px 0 18px rgba(0,0,0,0.45);
}
[data-theme="dark"] .sidebar .nav-item { color: #E5E7EB; }
[data-theme="dark"] .sidebar .nav-item .icon, [data-theme="dark"] .sidebar .nav-item .ti { color: #94A3B8; }
[data-theme="dark"] .sidebar .nav-item.active { background: #1E3A8A; color: #FFFFFF; }
[data-theme="dark"] .sidebar .nav-item.active .icon, [data-theme="dark"] .sidebar .nav-item.active .ti { color: #FFFFFF; }
[data-theme="dark"] .sidebar .nav-item.active::before { width: 4px; background: #F59E0B; }

/* ── Light mode — clean white page background (global SaaS look). ──
   Light only via :not([data-theme="dark"]); dark mode, sidebar, and
   cards (var(--white)=#FFFFFF) untouched. */
html:not([data-theme="dark"]) {
  --gadri-cream: #F8FAFC;        /* main content background */
  --gadri-cream-warm: #F1F5F9;   /* subtle hovers/section tints */
  --gadri-cream-soft: #FBFCFE;
}

/* ── Light mode — calm slate-50 header (no pure white, no blue line).
   Sidebar-blue stays the lead element; dark mode untouched. */
html:not([data-theme="dark"]) .topbar {
  background: #F1F5F9;
  border-bottom: 1px solid #E2E8F0;
  box-shadow: 0 1px 2px rgba(15,23,42,0.03);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* Blue accent line removed — replaced by the soft slate separator above */
html:not([data-theme="dark"]) .topbar::after {
  display: none;
}

/* Softer heading ink (light mode) — match the KPI label tone exactly:
   slate navy (ink-800) + weight 600, so page titles feel as calm as card labels. */
html:not([data-theme="dark"]) .topbar-title h1,
html:not([data-theme="dark"]) .courses-head h1 {
  color: var(--ink-800);
  font-weight: 600;
}
html:not([data-theme="dark"]) .kpi-label {
  color: var(--ink-800);
  font-weight: 600;
}

/* ── Scrollbar color tokens (theme-aware; chrome only, no scroll-behavior change) ── */
html:not([data-theme="dark"]) {
  --sb-track: rgba(15,23,42,0.04);
  --sb-thumb: rgba(100,116,139,0.35);
  --sb-thumb-hover: rgba(100,116,139,0.55);
  --sb-border: rgba(248,250,252,0.9);
}
[data-theme="dark"] {
  --sb-track: rgba(255,255,255,0.03);
  --sb-thumb: rgba(255,255,255,0.18);
  --sb-thumb-hover: rgba(255,255,255,0.30);
  --sb-border: rgba(11,18,32,0.9);
}

/* ═══════════════════════════════════════════════════════════════════════
   ✦ Typography & Visual Hierarchy — Enterprise SaaS scale (CSS only)
   لوحة التحكم: أحجام + أوزان + تباعد + قرائية. لا تغيير ألوان/سايدبار/هيدر-خلفية/منطق.
   ═══════════════════════════════════════════════════════════════════════ */

/* Unified type-scale tokens (size only, theme-independent) */
:root {
  --fs-page-title: 26px;
  --fs-page-sub: 14px;
  --fs-kpi-value: 28px;
  --fs-kpi-label: 16px;
  --fs-kpi-desc: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════
   ✦ Unified Typography System — Phase 0 (tokens only, theme-independent)
   Design tokens for a single source of truth. Sizes are wired gradually
   (Phase 1+). Defining them here has NO visual effect on its own.
   ═══════════════════════════════════════════════════════════════════════ */
:root {
  /* Type scale (8 steps — replaces ad-hoc 6.5/9.5/10.5/11.5/12.5/13.5/17/19px) */
  --text-2xs: 11px;   /* badges / fine labels (floor — never smaller) */
  --text-xs:  12px;   /* secondary labels, table headers */
  --text-sm:  13px;   /* helper text, descriptions */
  --text-base:15px;   /* body — system reference */
  --text-md:  16px;   /* prominent items, card titles */
  --text-lg:  18px;   /* section / dialog titles */
  --text-xl:  22px;   /* page sub-headers */
  --text-2xl: 26px;   /* main page title */
  --text-3xl: 32px;   /* KPI numbers / heroes */

  /* Weights */
  --fw-regular: 400;
  --fw-medium:  500;
  --fw-semibold:600;
  --fw-bold:    700;
  --fw-heavy:   800;

  /* Line-heights (by role) */
  --lh-tight:   1.2;
  --lh-snug:    1.35;
  --lh-normal:  1.5;
  --lh-relaxed: 1.65;

  /* Letter-spacing (two rules only) */
  --ls-tight: -0.01em;  /* headings >= 22px */
  --ls-caps:   0.4px;   /* small caps-like labels / section titles */

  /* Numeric typeface — crisp lining/tabular figures for data (Latin glyphs;
     Arabic text falls back to Cairo automatically since Inter lacks it) */
  --font-num: 'Inter', ui-sans-serif, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* Base readability — slightly larger body text */
body { font-size: 15px; }

/* Page title (rendered in the header) — bold, clear top of hierarchy */
.topbar-title h1 { font-weight: 700; }
.topbar-title p  { color: var(--ink-600); font-weight: 500; line-height: 1.5; }

/* ── KPI cards: readability + hierarchy (colors untouched) ── */
/* Card title (الموظفون/الدورات/الشهادات…): bolder + darker + clearer */
.kpi-label { font-weight: 700; color: var(--ink-900); line-height: 1.35; }
/* Big number: crisp Inter figures, professionally colour-coded per card.
   Solid in-palette accents (no muddy gradient) — vibrant yet sharp. */
.kpi-value {
  font-weight: 700;
  line-height: 1;
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  letter-spacing: 0;
  background: none;
  -webkit-text-fill-color: var(--gadri-blue-dark); /* default/blue card */
  color: var(--gadri-blue-dark);
}
[data-theme="dark"] .kpi-value {
  background: none;
  -webkit-text-fill-color: #93C5FD;
  color: #93C5FD;
}
/* Per-card accents — light (reuse existing card palette) */
.kpi-card.green  .kpi-value { background: none; -webkit-text-fill-color: #138446; color: #138446; }
.kpi-card.pink   .kpi-value { background: none; -webkit-text-fill-color: #B5478B; color: #B5478B; }
.kpi-card.orange .kpi-value { background: none; -webkit-text-fill-color: #C2400A; color: #C2400A; }
.kpi-card.red    .kpi-value { background: none; -webkit-text-fill-color: var(--status-red); color: var(--status-red); }
.kpi-card.indigo .kpi-value { background: none; -webkit-text-fill-color: #4338CA; color: #4338CA; }
.kpi-card.amber  .kpi-value { background: none; -webkit-text-fill-color: #D97706; color: #D97706; }
.kpi-card.purple .kpi-value { background: none; -webkit-text-fill-color: #7C3AED; color: #7C3AED; }
/* Per-card accents — dark (lighter shades for contrast on dark bg) */
[data-theme="dark"] .kpi-card.green  .kpi-value { background: none; -webkit-text-fill-color: #5BBF7F; color: #5BBF7F; }
[data-theme="dark"] .kpi-card.pink   .kpi-value { background: none; -webkit-text-fill-color: #F6AECE; color: #F6AECE; }
[data-theme="dark"] .kpi-card.orange .kpi-value { background: none; -webkit-text-fill-color: #FF8666; color: #FF8666; }
[data-theme="dark"] .kpi-card.red    .kpi-value { background: none; -webkit-text-fill-color: #F87171; color: #F87171; }
[data-theme="dark"] .kpi-card.indigo .kpi-value { background: none; -webkit-text-fill-color: #818CF8; color: #818CF8; }
[data-theme="dark"] .kpi-card.amber  .kpi-value { background: none; -webkit-text-fill-color: #FBBF24; color: #FBBF24; }
[data-theme="dark"] .kpi-card.purple .kpi-value { background: none; -webkit-text-fill-color: #C4B5FD; color: #C4B5FD; }
/* Numeric typeface scope: main dashboard KPI cards only (.kpi-value above).
   Reports/analytics and other pages keep their original number styling. */
/* Caption under the number: secondary but legible */
.kpi-desc  { color: var(--ink-600); font-weight: 500; line-height: 1.45; }

/* Quick-action buttons — text legibility only (colors/sizes untouched) */
.quick-action-label { font-size: 14px; font-weight: 600; }

/* ── Sidebar typography (size/weight/spacing only — colors/theme untouched) ── */
/* Menu items: clearer, Enterprise-grade legibility */
.sidebar .nav-item {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  gap: 10px;
}
/* Active item: a touch stronger text (colors/border/radius/hover untouched) */
.sidebar .nav-item.active { font-weight: 700; }
/* Section labels: readable but still secondary */
.sidebar .sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
}
/* Icons: balanced with the larger label (colors/opacity untouched) */
.sidebar .nav-item .icon { width: 18px; height: 18px; }

/* Desktop hierarchy (≥901px) — sizes/spacing that have mobile overrides */
@media (min-width: 901px) {
  /* Header: clear, prominent page title */
  .topbar { padding: 12px 24px; }
  .topbar-title h1 { font-size: 16px; line-height: 1.25; }
  .topbar-title p  { font-size: 12px; margin-top: 3px; }

  /* KPI cards: tighter internal rhythm around bigger text */
  .kpi-card  { padding: 18px 20px; }
  .kpi-top   { margin-bottom: 8px; }
  .kpi-label { font-size: var(--fs-kpi-label); margin-bottom: 2px; }
  .kpi-value { font-size: var(--fs-kpi-value); margin-bottom: 3px; }
  .kpi-desc  { font-size: var(--fs-kpi-desc); }

  /* Tables: airier rows on desktop (padding only; font-size unified in base rules) */
  table th     { padding: 11px 16px; }
  table td     { padding: 13px 16px; }
  .datagrid td { padding: 15px 16px; }
}


/* ===== Mobile UX Remediation (CSS only) — phones & tablets <=900px =====
   Desktop (>=901px) is NOT affected. No logic/JS/permission/security changes. */
@media (max-width: 900px) {
  /* 1) iOS-safe full-screen modals: dynamic viewport height (dvh) so the
     Safari address bar cannot push the footer off-screen; flex column keeps
     header (close) + scrollable body + footer (save/cancel) always visible. */
  .modal {
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    display: flex !important;
    flex-direction: column !important;
  }
  .modal-head   { flex: 0 0 auto !important; background: var(--white); }
  .modal-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .modal-footer {
    flex: 0 0 auto !important;
    background: var(--white);
    padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
  }
  /* 2) Forms -> single column inside modals/forms ONLY. General .grid-2/3/4
     keep their own responsive behavior (tablet 2-col; existing <=700px collapse). */
  .modal-body [style*="grid-template-columns"],
  .modal-body .grid-2, .modal-body .grid-3, .modal-body .grid-4,
  .field-row, .form-row {
    grid-template-columns: 1fr !important;
  }
  /* 3) Floating action buttons clear of the iPhone home indicator. */
  .copilot-fab { bottom: calc(24px + env(safe-area-inset-bottom)) !important; }
}
/* 3b) Hide floating buttons while a modal is open (mobile only). */
@media (max-width: 900px) {
  body:has(.modal-overlay.open) .copilot-fab,
  body:has(.modal-overlay.dynamic) .copilot-fab { display: none !important; }
}

/* 4) Copilot panel: iOS-safe height (mobile only) */
@media (max-width: 900px) {
  .copilot-panel {
    max-height: calc(100dvh - 110px) !important;
    bottom: calc(90px + env(safe-area-inset-bottom)) !important;
  }
}


/* ===== Mobile page-grid remediation (phones only) =====
   Inline repeat(N) grids overrode class media queries; collapse on phones.
   Tablet (>=601px) & desktop unaffected. !important beats inline grids. */
@media (max-width: 600px) {
  .courses-stats { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 600px) {
  main [style*="repeat(3,"],
  main [style*="repeat(4,"],
  main [style*="repeat(5,"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
/* Broadcast page: collapse inner grids to one column on phones. */
@media (max-width: 600px) {
  .bc-layout [style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

/* Mobile: data-table wrappers scroll horizontally + release iOS RTL sticky trap. <=900px; desktop untouched. */
@media (max-width: 900px) {
  .datagrid-wrap { overflow-x: auto !important; overflow-y: visible !important; -webkit-overflow-scrolling: touch; max-width: 100%; }
  .table-wrap { overflow-x: auto !important; -webkit-overflow-scrolling: touch; }
}

/* ===== Mobile fixes: notifications panel, settings tabs, archive filters (CSS only) ===== */
@media (max-width: 600px) {
  .notif-panel {
    position: fixed !important;
    top: calc(64px + env(safe-area-inset-top)) !important;
    inset-inline-start: 8px !important;
    inset-inline-end: 8px !important;
    width: auto !important;
    max-width: none !important;
    max-height: 78dvh !important;
  }
}
@media (max-width: 900px) {
  .tabs .tab,
  .tab-list .tab { flex: 0 0 auto !important; }
}
@media (max-width: 600px) {
  [style*="1fr auto auto auto auto"] { grid-template-columns: 1fr !important; }
  [style*="1fr auto auto auto auto"] > * { width: 100% !important; }
}

/* ===== Jisr integration: mobile-only display fixes (CSS only; desktop/tablet untouched) ===== */
/* Integrations grid → single column on small phones (prevents card overflow at 360px). */
@media (max-width: 480px) {
  .integrations-grid { grid-template-columns: 1fr !important; }
}
/* "Verify with Jisr" comparison table → Card View on phones (no horizontal scroll). */
@media (max-width: 480px) {
  .jisr-cmp { overflow-x: visible !important; }
  .jisr-cmp table { min-width: 0 !important; width: 100% !important; }
  .jisr-cmp thead { display: none !important; }
  .jisr-cmp tbody { display: block !important; }
  .jisr-cmp tr {
    display: block !important;
    border: 1px solid var(--ink-200) !important;
    border-radius: 10px !important;
    margin: 0 0 10px !important;
    padding: 4px 12px !important;
    background: var(--white) !important;
  }
  .jisr-cmp td {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 12px !important;
    width: auto !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid var(--ink-100) !important;
    white-space: normal !important;
    text-align: start !important;
    word-break: break-word;
    overflow-wrap: anywhere;
  }
  .jisr-cmp td:last-child { border-bottom: 0 !important; }
  .jisr-cmp td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--ink-500);
    font-size: 11px;
    flex-shrink: 0;
  }
  /* field cell becomes the card title (no "Field:" prefix) */
  .jisr-cmp td.jc-field {
    font-size: 13px !important;
    font-weight: 800 !important;
    color: var(--ink-900) !important;
    border-bottom: 1px solid var(--ink-200) !important;
    white-space: normal !important;
  }
  .jisr-cmp td.jc-field::before { display: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════
   👥 User Actions Menu — قائمة إجراءات المستخدمين (إعادة بناء احترافيّة)
   Modern SaaS dropdown: fixed positioning (JS), soft shadow, RTL, responsive.
   ═══════════════════════════════════════════════════════════════════════ */
.user-actions-menu { display: inline-block; position: relative; }

/* زرّ التشغيل (⋮) */
.ua-trigger {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(15, 23, 42, 0.04);
  color: var(--ink-700);
  border: 0.5px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, transform 100ms ease;
}
.ua-trigger:hover { background: rgba(15, 23, 42, 0.09); border-color: rgba(15, 23, 42, 0.14); }
.ua-trigger:active { transform: scale(0.96); }
.ua-trigger i { font-size: 16px; }

/* القائمة المنسدلة (التموضع fixed يُحسب في JS) */
.user-actions-dropdown {
  position: fixed;
  min-width: 224px;
  max-width: calc(100vw - 16px);
  background: var(--white);
  border: 0.5px solid rgba(15, 23, 42, 0.10);
  border-radius: 14px;
  box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.18),
              0 4px 12px -4px rgba(15, 23, 42, 0.10);
  padding: 6px;
  z-index: 9999;
  overflow: hidden;
  animation: uaMenuIn 140ms cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes uaMenuIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

/* عنصر إجراء */
.ua-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0; background: transparent; cursor: pointer;
  border-radius: 9px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  color: var(--ink-700);
  text-align: start;
  transition: background-color 120ms ease, color 120ms ease;
}
.ua-item i { font-size: 16px; flex-shrink: 0; }
.ua-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ua-item:hover { background: rgba(15, 23, 42, 0.05); }

/* تلوين حسب نوع الإجراء */
.ua-item--accent  { color: #7C3AED; }
.ua-item--accent:hover  { background: rgba(124, 58, 237, 0.10); }
.ua-item--success { color: #059669; }
.ua-item--success:hover { background: rgba(5, 150, 105, 0.12); }
.ua-item--warn    { color: #D97706; }
.ua-item--warn:hover    { background: rgba(217, 119, 6, 0.12); }
.ua-item--danger  { color: #DC2626; font-weight: 700; }
.ua-item--danger:hover  { background: rgba(220, 38, 38, 0.10); }

/* فاصل */
.ua-sep { height: 0.5px; background: rgba(15, 23, 42, 0.08); margin: 5px 8px; }

/* 🔱 بطاقة حساب مالك النظام (ذهبيّة) */
.ua-owner-card {
  padding: 16px 16px 14px;
  text-align: center;
  background: linear-gradient(135deg, rgba(201, 169, 106, 0.12), rgba(154, 123, 63, 0.06));
  border-radius: 11px;
}
.ua-owner-card .ua-owner-emoji { font-size: 24px; line-height: 1; }
.ua-owner-card .ua-owner-title {
  display: inline-flex; align-items: center; gap: 5px;
  margin: 7px 0 6px; font-size: 12px; font-weight: 800; color: #7C5E1E;
}
.ua-owner-card .ua-owner-text { font-size: 10.5px; line-height: 1.65; color: #6B5320; }

/* 🔒 بطاقة قفل (صلاحيّات أعلى) */
.ua-lock { padding: 14px 16px; text-align: center; }
.ua-lock i { font-size: 20px; color: #DC2626; display: block; margin-bottom: 6px; }
.ua-lock-title { font-size: 11.5px; font-weight: 700; color: #7F1D1D; margin-bottom: 4px; }
.ua-lock-text  { font-size: 10.5px; line-height: 1.5; color: #991B1B; }

/* الوضع الليلي */
[data-theme="dark"] .ua-trigger { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.10); }
[data-theme="dark"] .ua-trigger:hover { background: rgba(255, 255, 255, 0.12); }
[data-theme="dark"] .user-actions-dropdown { border-color: rgba(255, 255, 255, 0.10); box-shadow: 0 14px 36px -8px rgba(0, 0, 0, 0.55); }
[data-theme="dark"] .ua-item:hover { background: rgba(255, 255, 255, 0.07); }
[data-theme="dark"] .ua-sep { background: rgba(255, 255, 255, 0.10); }

/* الجوال: لمسة أكبر + احترام حدود الشاشة */
@media (max-width: 480px) {
  .user-actions-dropdown { min-width: 210px; max-width: calc(100vw - 16px); border-radius: 16px; }
  .ua-item { padding: 12px 14px; font-size: 14px; min-height: 44px; }
}

/* ═══════════════════════════════════════════════════════════════════
   🎨 login-ui-polish — تحسينات تصميميّة محدودة لصفحة الدخول (إلحاق فقط)
   ═══════════════════════════════════════════════════════════════════ */

/* (1) حجاب كريميّ على جهة النصّ (يمين/RTL) لرفع وضوح العلامة والشعارات فوق
   صورة المبنى دون تغميق مبالغ، مع تغميق سفليّ خفيف لروابط التذييل. */
.gv5-overlay {
  background:
    linear-gradient(270deg, rgba(245,243,235,0.86) 0%, rgba(245,243,235,0.40) 32%, rgba(245,243,235,0) 58%),
    linear-gradient(90deg, rgba(245,243,235,0.55) 0%, rgba(245,243,235,0) 38%),
    linear-gradient(180deg, rgba(15,23,41,0) 55%, rgba(15,23,41,0.20) 100%);
}

/* (2) منع قصّ/كسر التسميات الأطول للإحصائيّات + السماح بالالتفاف عند الضيق */
.gv5-stats { flex-wrap: wrap; row-gap: 10px; }
.gv5-stat-lbl { white-space: nowrap; }

/* (3) الحالة التحميليّة لزرّ الدخول: إخفاء السهم وإظهار دوّارة لطيفة
   (الزرّ هو .gv5-btn-login وليس .btn، لذا يحتاج دوّارته الخاصّة). */
.gv5-btn-login.is-loading { pointer-events: none; }
.gv5-btn-login.is-loading svg { display: none; }
.gv5-btn-login.is-loading::after {
  content: "";
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: gv5BtnSpin 0.7s linear infinite;
}
@keyframes gv5BtnSpin { to { transform: rotate(360deg); } }

/* (4) علامة العلامة للجوّال فقط — تظهر بدلاً من الـ Hero المخفيّ (≤900px) */
.gv5-mobile-brand { display: none; }
@media (max-width: 900px) {
  .gv5-mobile-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    margin: 4px 0 18px;
  }
  .gv5-mobile-brand-ar {
    font-size: 20px;
    font-weight: 800;
    color: #1B2952;
    letter-spacing: -0.3px;
  }
  .gv5-mobile-brand-sub {
    font-size: 12.5px;
    line-height: 1.5;
    color: #1B2952;
    opacity: 0.7;
    max-width: 280px;
  }
}
[data-theme="dark"] .gv5-mobile-brand-ar { color: #fff; }
[data-theme="dark"] .gv5-mobile-brand-sub { color: #E2E8F0; opacity: 0.8; }

/* (5) خطّ صفحة الدخول فقط → IBM Plex Sans Arabic (لا يمسّ بقيّة التطبيق).
   يُطبَّق على جذر #loginScreen فيرثه كلّ المحتوى، مع إبقاء خطّ الشعار الشعريّ
   الزخرفيّ (Aref Ruqaa) في .gv5-tagline-1/2 كما هو. */
#loginScreen { font-family: 'IBM Plex Sans Arabic', 'Cairo', sans-serif; }
#loginScreen .gv5-tagline-sub { font-family: 'IBM Plex Sans Arabic', 'Cairo', sans-serif; }

/* (6) الوضع الإنجليزيّ: عكس كامل لصفحة الدخول إلى LTR (مرآة متّسقة).
   data-theme و dir كلاهما على #htmlRoot، فالتحجيم دقيق. */
html[dir="ltr"] #loginScreen.gadri-v5 { direction: ltr; }
/* محاذاة إدخال النصّ تتبع الاتّجاه (كان text-align:right مثبّتًا) */
html[dir="ltr"] #loginScreen .gv5-input-wrap input { text-align: left; }
/* عناصر الـ Hero المثبّتة يمينًا → تُعكس إلى اليسار (الحافة الخارجيّة للشاشة) */
html[dir="ltr"] #loginScreen .gv5-brand { right: auto; left: 38px; }
html[dir="ltr"] #loginScreen .gv5-tagline { right: auto; left: 38px; text-align: left; }
html[dir="ltr"] #loginScreen .gv5-visual-footer { justify-content: flex-start; }
html[dir="ltr"] #loginScreen .gv5-stat { align-items: flex-start; }
/* الحجاب الكريميّ يتبع جهة النصّ (يسار) في الوضع الفاتح الإنجليزيّ فقط */
html[dir="ltr"]:not([data-theme="dark"]) #loginScreen .gv5-overlay {
  background:
    linear-gradient(90deg, rgba(245,243,235,0.86) 0%, rgba(245,243,235,0.40) 32%, rgba(245,243,235,0) 58%),
    linear-gradient(270deg, rgba(245,243,235,0.55) 0%, rgba(245,243,235,0) 38%),
    linear-gradient(180deg, rgba(15,23,41,0) 55%, rgba(15,23,41,0.20) 100%);
}

/* (7) ضمان انعكاس الشريط العلويّ (اللغة + الثيم) مع تغيّر اللغة.
   flex-end يتبع اتّجاه الصفحة: في العربيّة (rtl) → الزاوية اليسرى،
   وفي الإنجليزيّة (ltr) → الزاوية اليمنى. الأولويّة تمنع أيّ تجاوز خفيّ. */
html[dir="rtl"] #loginScreen .gv5-topbar { justify-content: flex-end !important; }
html[dir="ltr"] #loginScreen .gv5-topbar { justify-content: flex-end !important; }

/* ═══════════════════════════════════════════════════════════════════
   🔎 مكوّن الاختيار المتعدّد بالبحث + Chips (نموذج المسار التدريبيّ)
   واجهة فوق <select multiple> مخفيّ · يدعم RTL والوضعين الفاتح/الداكن.
   ═══════════════════════════════════════════════════════════════════ */
.msc { position: relative; width: 100%; }
.msc-control {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 40px; padding: 6px 10px;
  background: rgba(15,23,42,0.025);
  border: 0.5px solid rgba(15,23,42,0.1); border-radius: 8px;
  cursor: text; transition: border-color .15s, background .15s;
}
.msc-control.is-open { border-color: #7C3AED; background: var(--white); }
.msc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.msc-chips.is-empty { display: none; }
.msc-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 6px 3px 9px;
  background: rgba(124,58,237,0.1); color: #6D28D9;
  border: 0.5px solid rgba(124,58,237,0.25); border-radius: 6px;
  font-size: 11.5px; font-weight: 600; line-height: 1.5;
}
.msc-chip-x {
  border: none; background: rgba(124,58,237,0.15); color: #6D28D9;
  width: 16px; height: 16px; border-radius: 4px; cursor: pointer;
  font-size: 13px; line-height: 1; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.msc-chip-x:hover { background: #7C3AED; color: #fff; }
.msc-search {
  flex: 1; min-width: 120px; border: none; outline: none; background: transparent;
  font-family: inherit; font-size: 12.5px; color: var(--ink-900); padding: 4px 2px;
}
.msc-caret { font-size: 14px; color: var(--ink-500); transition: transform .15s; flex-shrink: 0; }
.msc-control.is-open .msc-caret { transform: rotate(180deg); }
.msc-panel {
  display: none; margin-top: 6px;
  background: var(--white); border: 0.5px solid rgba(15,23,42,0.12);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(15,23,42,0.1); overflow: hidden;
}
.msc-panel.is-open { display: block; }
.msc-actions {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-bottom: 0.5px solid rgba(15,23,42,0.06);
}
.msc-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 8px; border: 0.5px solid rgba(15,23,42,0.12);
  background: rgba(15,23,42,0.02); border-radius: 6px;
  font-size: 11px; font-weight: 600; color: var(--ink-700);
  cursor: pointer; font-family: inherit;
}
.msc-btn:hover { border-color: #7C3AED; color: #7C3AED; }
.msc-count { margin-inline-start: auto; font-size: 10.5px; color: var(--ink-500); font-weight: 600; }
.msc-options { max-height: 220px; overflow-y: auto; padding: 4px; }
.msc-opt {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 9px; border-radius: 6px; cursor: pointer;
}
.msc-opt:hover { background: rgba(124,58,237,0.06); }
.msc-check {
  width: 18px; height: 18px; border-radius: 5px; flex-shrink: 0;
  border: 1.5px solid rgba(15,23,42,0.2); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.msc-check .ti { font-size: 12px; opacity: 0; }
.msc-opt.is-sel .msc-check { background: #7C3AED; border-color: #7C3AED; }
.msc-opt.is-sel .msc-check .ti { opacity: 1; }
.msc-opt-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.msc-opt-label { font-size: 12.5px; font-weight: 600; color: var(--ink-900); }
.msc-opt-sub { font-size: 10.5px; color: var(--ink-500); }
.msc-empty { padding: 16px; text-align: center; font-size: 11.5px; color: var(--ink-500); }
/* الوضع الداكن */
[data-theme="dark"] .msc-control { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.12); }
[data-theme="dark"] .msc-control.is-open { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .msc-panel { background: #0F1729; border-color: rgba(255,255,255,0.12); }
[data-theme="dark"] .msc-actions { border-bottom-color: rgba(255,255,255,0.08); }
[data-theme="dark"] .msc-btn { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.12); }
[data-theme="dark"] .msc-check { border-color: rgba(255,255,255,0.25); }
[data-theme="dark"] .msc-opt:hover { background: rgba(124,58,237,0.18); }
