/* ==========================================================================
   منصة ترقية — نمط بوابة الإدارة والتحكم المركزي (Tarqiya Admin Portal Styles)
   Executive Dark & Glassmorphism Theme with Rich Micro-Interactions
   ========================================================================== */

:root {
  --admin-bg-primary: #0a0f1d;
  --admin-bg-secondary: #10192e;
  --admin-bg-surface: #17233f;
  --admin-bg-surface-elevated: #1e2e50;
  --admin-glass: rgba(23, 35, 63, 0.75);
  --admin-glass-border: rgba(255, 255, 255, 0.08);
  --admin-glass-hover: rgba(255, 255, 255, 0.12);

  --admin-primary: #2563eb;
  --admin-primary-hover: #1d4ed8;
  --admin-primary-glow: rgba(37, 99, 235, 0.35);

  --admin-emerald: #10b981;
  --admin-emerald-glow: rgba(16, 185, 129, 0.3);
  --admin-emerald-dark: #065f46;

  --admin-amber: #f59e0b;
  --admin-amber-glow: rgba(245, 158, 11, 0.3);

  --admin-rose: #f43f5e;
  --admin-rose-glow: rgba(244, 63, 94, 0.3);

  --admin-cyan: #06b6d4;
  --admin-purple: #8b5cf6;

  --admin-text-main: #ffffff;
  --admin-text-muted: #cbd5e1;
  --admin-text-dim: #94a3b8;

  --admin-border-subtle: rgba(148, 163, 184, 0.22);
  --admin-radius-sm: 8px;
  --admin-radius-md: 14px;
  --admin-radius-lg: 20px;
  --admin-radius-xl: 28px;

  --admin-shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --admin-shadow-md: 0 10px 30px -5px rgba(0, 0, 0, 0.45);
  --admin-shadow-lg: 0 20px 45px -10px rgba(0, 0, 0, 0.6);
  --admin-shadow-glow: 0 0 25px rgba(37, 99, 235, 0.25);

  --admin-card-inner-bg: rgba(16, 25, 46, 0.75);
  --admin-card-inner-border: rgba(255, 255, 255, 0.12);
  --admin-card-inner-hover: rgba(255, 255, 255, 0.14);
  --admin-chip-bg: rgba(255, 255, 255, 0.08);
  --admin-track-bg: rgba(255, 255, 255, 0.1);
  --admin-avatar-bg: #1e293b;
  --admin-input-bg: rgba(10, 15, 29, 0.85);
  --admin-input-bg-focus: rgba(10, 15, 29, 0.98);
  --admin-table-th-bg: rgba(10, 15, 29, 0.85);
  --admin-table-row-hover: rgba(255, 255, 255, 0.04);

  --admin-font: 'Cairo', system-ui, -apple-system, sans-serif;
  --admin-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables for Admin Portal - Vivid & High Contrast */
:root[data-theme="light"],
html[data-theme="light"],
[data-theme="light"],
[data-theme="light"] body.admin-body,
body.admin-body.theme-light,
body.theme-light {
  --admin-bg-primary: #f8fafc;
  --admin-bg-secondary: #ffffff;
  --admin-bg-surface: #ffffff;
  --admin-bg-surface-elevated: #f1f5f9;
  --admin-glass: #ffffff;
  --admin-glass-border: #cbd5e1;
  --admin-glass-hover: #f1f5f9;

  --admin-primary: #155eef;
  --admin-primary-hover: #0c4ebd;
  --admin-emerald: #059669;
  --admin-emerald-dark: #064e3b;
  --admin-amber: #d97706;
  --admin-rose: #e11d48;
  --admin-cyan: #0284c7;
  --admin-purple: #7c3aed;

  --admin-text-main: #0f172a;
  --admin-text-muted: #334155;
  --admin-text-dim: #475569;

  --admin-border-subtle: #cbd5e1;
  --admin-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --admin-shadow-md: 0 4px 14px rgba(15, 23, 42, 0.12);
  --admin-shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.16);

  --admin-card-inner-bg: #ffffff;
  --admin-card-inner-border: #cbd5e1;
  --admin-card-inner-hover: #f8fafc;
  --admin-chip-bg: #e2e8f0;
  --admin-track-bg: #cbd5e1;
  --admin-avatar-bg: #e2e8f0;
  --admin-input-bg: #ffffff;
  --admin-input-bg-focus: #ffffff;
  --admin-table-th-bg: #f1f5f9;
  --admin-table-row-hover: #f8fafc;

  background-color: #f8fafc;
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(21, 94, 239, 0.08) 0%, transparent 45%),
    radial-gradient(circle at 90% 90%, rgba(5, 150, 105, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(124, 58, 237, 0.05) 0%, transparent 55%);
}

/* --- Light Mode Topbar --- */
[data-theme="light"] .admin-topbar,
body.theme-light .admin-topbar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .admin-topbar-title-box h1,
body.theme-light .admin-topbar-title-box h1 {
  color: #0f172a;
}

[data-theme="light"] .admin-topbar-title-box p,
body.theme-light .admin-topbar-title-box p {
  color: #64748b;
}

[data-theme="light"] .admin-preview-site-btn,
body.theme-light .admin-preview-site-btn {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #1e293b;
}

[data-theme="light"] .admin-preview-site-btn:hover,
body.theme-light .admin-preview-site-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

[data-theme="light"] .admin-live-badge,
body.theme-light .admin-live-badge {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
}

/* --- Light Mode Sidebar --- */
[data-theme="light"] .admin-sidebar,
body.theme-light .admin-sidebar {
  background: #ffffff;
  border-left: 1px solid #e2e8f0;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .admin-sidebar-header,
body.theme-light .admin-sidebar-header {
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .admin-logo-texts h2,
body.theme-light .admin-logo-texts h2 {
  color: #0f172a;
}

[data-theme="light"] .admin-nav-item,
body.theme-light .admin-nav-item {
  color: #475569;
}

[data-theme="light"] .admin-nav-item:hover,
body.theme-light .admin-nav-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .admin-nav-item.active,
body.theme-light .admin-nav-item.active {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

[data-theme="light"] .admin-nav-item.active .nav-icon,
body.theme-light .admin-nav-item.active .nav-icon {
  color: #2563eb;
}

[data-theme="light"] .admin-nav-badge,
body.theme-light .admin-nav-badge {
  background: #e2e8f0;
  color: #475569;
}

[data-theme="light"] .admin-nav-badge.badge-certified,
body.theme-light .admin-nav-badge.badge-certified {
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
}

[data-theme="light"] .admin-nav-badge.badge-primary,
body.theme-light .admin-nav-badge.badge-primary {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

[data-theme="light"] .admin-sidebar-footer,
body.theme-light .admin-sidebar-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

[data-theme="light"] .admin-user-card,
body.theme-light .admin-user-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

[data-theme="light"] .admin-user-name,
body.theme-light .admin-user-name {
  color: #0f172a;
}

[data-theme="light"] .admin-user-role,
body.theme-light .admin-user-role {
  color: #64748b;
}

[data-theme="light"] .admin-logout-btn,
body.theme-light .admin-logout-btn {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #e11d48;
}

[data-theme="light"] .admin-logout-btn:hover,
body.theme-light .admin-logout-btn:hover {
  background: #ffe4e6;
  color: #be123c;
}

/* --- Light Mode KPI Cards --- */
[data-theme="light"] .admin-kpi-card,
body.theme-light .admin-kpi-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .admin-kpi-card:hover,
body.theme-light .admin-kpi-card:hover {
  border-color: #94a3b8;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
}

[data-theme="light"] .admin-kpi-title,
body.theme-light .admin-kpi-title {
  color: #334155;
  font-weight: 700;
}

[data-theme="light"] .admin-kpi-value,
body.theme-light .admin-kpi-value {
  color: #0f172a;
  font-weight: 800;
}

[data-theme="light"] .admin-kpi-desc,
body.theme-light .admin-kpi-desc {
  color: #475569;
  font-weight: 600;
}

[data-theme="light"] .kpi-blue .admin-kpi-icon { background: #eff6ff; color: #155eef; border: 1px solid #bfdbfe; }
[data-theme="light"] .kpi-green .admin-kpi-icon { background: #ecfdf5; color: #059669; border: 1px solid #a7f3d0; }
[data-theme="light"] .kpi-amber .admin-kpi-icon { background: #fffbeb; color: #d97706; border: 1px solid #fde68a; }
[data-theme="light"] .kpi-purple .admin-kpi-icon { background: #faf5ff; color: #7c3aed; border: 1px solid #ddd6fe; }

/* --- Light Mode Card Sections & Stages (Vivid & Crisp) --- */
[data-theme="light"] .admin-card-section,
body.theme-light .admin-card-section {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .admin-card-section-title h3,
body.theme-light .admin-card-section-title h3 {
  color: #0f172a;
  font-weight: 800;
}

[data-theme="light"] .admin-card-section-title span,
body.theme-light .admin-card-section-title span {
  color: #475569;
  font-weight: 600;
}

/* Stage items in light mode */
[data-theme="light"] .stage-progress-item,
body.theme-light .stage-progress-item {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .stage-progress-item:hover,
body.theme-light .stage-progress-item:hover {
  background: #f8fafc;
  border-color: #2563eb;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

[data-theme="light"] .stage-title-tag,
body.theme-light .stage-title-tag {
  color: #0f172a;
  font-weight: 800;
}

[data-theme="light"] .stage-videos-count,
body.theme-light .stage-videos-count {
  background: #e2e8f0;
  color: #1e293b;
  font-weight: 700;
  border: 1px solid #cbd5e1;
}

[data-theme="light"] .admin-bar-track,
body.theme-light .admin-bar-track {
  background: #cbd5e1;
}

/* Recent Activity items in light mode */
[data-theme="light"] .activity-feed-item,
body.theme-light .activity-feed-item {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

[data-theme="light"] .activity-feed-item:hover,
body.theme-light .activity-feed-item:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .activity-title,
body.theme-light .activity-title {
  color: #0f172a;
  font-weight: 800;
}

[data-theme="light"] .activity-subtitle,
body.theme-light .activity-subtitle {
  color: #334155;
  font-weight: 600;
}

[data-theme="light"] .activity-time,
body.theme-light .activity-time {
  color: #475569;
  font-weight: 600;
}

[data-theme="light"] .mod-1 { background: #eff6ff; color: #155eef; border: 1.5px solid #93c5fd; font-weight: 800; }
[data-theme="light"] .mod-2 { background: #ecfdf5; color: #047857; border: 1.5px solid #6ee7b7; font-weight: 800; }
[data-theme="light"] .mod-3 { background: #fffbeb; color: #b45309; border: 1.5px solid #fcd34d; font-weight: 800; }
[data-theme="light"] .mod-4 { background: #fff1f2; color: #be123c; border: 1.5px solid #fda4af; font-weight: 800; }

/* --- Light Mode Governorates Section --- */
[data-theme="light"] .admin-gov-card,
body.theme-light .admin-gov-card {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .admin-gov-card:hover,
body.theme-light .admin-gov-card:hover {
  background: #f8fafc;
  border-color: #2563eb;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.12);
}

[data-theme="light"] .admin-gov-name,
body.theme-light .admin-gov-name {
  color: #0f172a;
  font-weight: 800;
}

[data-theme="light"] .admin-gov-count-badge,
body.theme-light .admin-gov-count-badge {
  background: #eff6ff;
  color: #155eef;
  border: 1.5px solid #93c5fd;
  font-weight: 800;
}

[data-theme="light"] .admin-gov-stats-sub,
body.theme-light .admin-gov-stats-sub {
  color: #334155;
  font-weight: 600;
}

/* --- Light Mode Filter Bar & Table --- */
[data-theme="light"] .admin-filter-bar,
body.theme-light .admin-filter-bar {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

[data-theme="light"] .admin-filter-btn,
body.theme-light .admin-filter-btn {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #1e293b;
  font-weight: 700;
}

[data-theme="light"] .admin-filter-btn:hover,
body.theme-light .admin-filter-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

[data-theme="light"] .admin-filter-btn.active,
body.theme-light .admin-filter-btn.active {
  background: #155eef;
  color: #ffffff;
  border-color: #155eef;
  box-shadow: 0 3px 10px rgba(21, 94, 239, 0.3);
}

[data-theme="light"] .admin-filter-btn.filter-certified.active,
body.theme-light .admin-filter-btn.filter-certified.active {
  background: #059669;
  border-color: #059669;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(5, 150, 105, 0.3);
}

[data-theme="light"] .admin-filter-btn.filter-progress.active,
body.theme-light .admin-filter-btn.filter-progress.active {
  background: #d97706;
  border-color: #d97706;
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(217, 119, 6, 0.3);
}

[data-theme="light"] .admin-search-input-box,
body.theme-light .admin-search-input-box {
  background: #ffffff;
  border: 1.5px solid #94a3b8;
  border-radius: var(--admin-radius-md);
}

[data-theme="light"] .admin-search-input-box input,
body.theme-light .admin-search-input-box input {
  background: transparent;
  color: #0f172a;
  font-weight: 600;
}

[data-theme="light"] .admin-search-input-box input::placeholder,
body.theme-light .admin-search-input-box input::placeholder {
  color: #64748b;
}

[data-theme="light"] .admin-table-container,
body.theme-light .admin-table-container {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
}

[data-theme="light"] .admin-table th,
body.theme-light .admin-table th {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 800;
  border-bottom: 2px solid #cbd5e1;
}

[data-theme="light"] .admin-table td,
body.theme-light .admin-table td {
  border-bottom: 1px solid #e2e8f0;
  color: #0f172a;
  font-weight: 600;
}

[data-theme="light"] .admin-table tr:hover td,
body.theme-light .admin-table tr:hover td {
  background: #f8fafc;
}

[data-theme="light"] .video-title-text,
body.theme-light .video-title-text {
  color: #0f172a;
  font-weight: 800;
}

[data-theme="light"] .video-summary-sub,
body.theme-light .video-summary-sub {
  color: #475569;
  font-weight: 600;
}

[data-theme="light"] .video-id-badge,
body.theme-light .video-id-badge {
  background: #eff6ff;
  border: 1.5px solid #93c5fd;
  color: #155eef;
  font-weight: 800;
}

[data-theme="light"] .trainee-name-title,
body.theme-light .trainee-name-title {
  color: #0f172a;
  font-weight: 800;
}

[data-theme="light"] .trainee-contact-sub,
body.theme-light .trainee-contact-sub {
  color: #334155;
  font-weight: 600;
}

[data-theme="light"] .trainee-status-pill.status-certified,
body.theme-light .trainee-status-pill.status-certified,
[data-theme="light"] .trainee-status-pill.status-eligible,
body.theme-light .trainee-status-pill.status-eligible {
  background: #ecfdf5;
  border: 1.5px solid #34d399;
  color: #047857;
  font-weight: 800;
}

[data-theme="light"] .trainee-status-pill.status-in_progress,
body.theme-light .trainee-status-pill.status-in_progress {
  background: #fffbeb;
  border: 1.5px solid #fbbf24;
  color: #b45309;
  font-weight: 800;
}

[data-theme="light"] .cert-num-badge,
body.theme-light .cert-num-badge {
  background: #eff6ff;
  border: 1.5px solid #93c5fd;
  color: #155eef;
  font-weight: 800;
}

[data-theme="light"] .btn-icon-action,
body.theme-light .btn-icon-action {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #0f172a;
}

[data-theme="light"] .btn-icon-action:hover,
body.theme-light .btn-icon-action:hover {
  background: #e2e8f0;
  border-color: #94a3b8;
  color: #0f172a;
}

/* --- Light Mode Modals & Forms --- */
[data-theme="light"] .admin-modal-box,
body.theme-light .admin-modal-box {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.16);
  color: #0f172a;
}

[data-theme="light"] .admin-modal-header,
body.theme-light .admin-modal-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

[data-theme="light"] .admin-modal-title,
body.theme-light .admin-modal-title {
  color: #0f172a;
}

[data-theme="light"] .admin-modal-close,
body.theme-light .admin-modal-close {
  color: #64748b;
}

[data-theme="light"] .admin-modal-close:hover,
body.theme-light .admin-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

[data-theme="light"] .admin-modal-footer,
body.theme-light .admin-modal-footer {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

[data-theme="light"] .admin-form-label,
body.theme-light .admin-form-label {
  color: #334155;
}

[data-theme="light"] .admin-input,
body.theme-light .admin-input,
[data-theme="light"] .admin-textarea,
body.theme-light .admin-textarea,
[data-theme="light"] .admin-select,
body.theme-light .admin-select {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #cbd5e1;
}

[data-theme="light"] .admin-input:focus,
body.theme-light .admin-input:focus,
[data-theme="light"] .admin-textarea:focus,
body.theme-light .admin-textarea:focus,
[data-theme="light"] .admin-select:focus,
body.theme-light .admin-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

[data-theme="light"] .admin-action-btn.btn-secondary,
body.theme-light .admin-action-btn.btn-secondary {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
}

[data-theme="light"] .admin-action-btn.btn-secondary:hover,
body.theme-light .admin-action-btn.btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a;
}

[data-theme="light"] .admin-upload-dropzone,
body.theme-light .admin-upload-dropzone {
  border-color: #93c5fd;
  background: #eff6ff;
}

[data-theme="light"] .admin-upload-dropzone:hover,
body.theme-light .admin-upload-dropzone:hover {
  border-color: #2563eb;
  background: #dbeafe;
}

[data-theme="light"] .admin-upload-title,
body.theme-light .admin-upload-title {
  color: #0f172a;
}

[data-theme="light"] .admin-upload-desc,
body.theme-light .admin-upload-desc {
  color: #64748b;
}

[data-theme="light"] .admin-stat-card-sub,
body.theme-light .admin-stat-card-sub {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

/* LTR Support for Admin Portal */
html[dir="ltr"] body.admin-body {
  direction: ltr;
  text-align: left;
}

html[dir="ltr"] .admin-sidebar {
  border-left: none;
  border-right: 1px solid var(--admin-border-subtle);
}

html[dir="ltr"] .admin-table {
  text-align: left;
}

html[dir="ltr"] .admin-search-icon {
  right: auto;
  left: 12px;
}

html[dir="ltr"] .admin-search-input-box input {
  padding: 9px 14px 9px 38px;
}

html[dir="ltr"] .admin-input {
  padding: 13px 14px 13px 44px;
}

html[dir="ltr"] .admin-input-icon {
  right: auto;
  left: 14px;
}

html[dir="ltr"] .admin-password-toggle {
  left: auto;
  right: 14px;
}

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

body.admin-body {
  font-family: var(--admin-font);
  background: var(--admin-bg-primary);
  color: var(--admin-text-main);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(16, 185, 129, 0.09) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 55%);
  background-attachment: fixed;
}

/* ==========================================================================
   Admin Authentication Screen (شاشة تسجيل دخول المشرف بالـ Gmail)
   ========================================================================== */
.admin-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #101c3d 0%, #060a14 100%);
  padding: 24px;
}

.admin-login-card {
  width: 100%;
  max-width: 480px;
  background: var(--admin-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--admin-glass-border);
  border-radius: var(--admin-radius-xl);
  padding: 40px 32px;
  box-shadow: var(--admin-shadow-lg), 0 0 50px rgba(37, 99, 235, 0.18);
  animation: modalFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.admin-login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--admin-primary), var(--admin-emerald), var(--admin-amber));
}

.admin-login-header {
  text-align: center;
  margin-bottom: 28px;
}

.admin-login-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  margin-bottom: 16px;
  font-size: 32px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.admin-login-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--admin-text-main);
  margin-bottom: 6px;
}

.admin-login-subtitle {
  font-size: 14px;
  color: var(--admin-text-muted);
}

.admin-form-group {
  margin-bottom: 20px;
}

.admin-form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-text-main);
  margin-bottom: 8px;
}

.admin-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.admin-input-icon {
  position: absolute;
  right: 14px;
  color: var(--admin-text-dim);
  font-size: 16px;
  pointer-events: none;
  transition: var(--admin-transition);
}

.admin-input {
  width: 100%;
  padding: 13px 44px 13px 14px;
  background: var(--admin-input-bg);
  border: 1px solid var(--admin-border-subtle);
  border-radius: var(--admin-radius-md);
  color: var(--admin-text-main);
  font-family: var(--admin-font);
  font-size: 14.5px;
  transition: var(--admin-transition);
}

.admin-input:focus {
  outline: none;
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
  background: var(--admin-input-bg-focus);
}

.admin-input:focus + .admin-input-icon {
  color: var(--admin-primary);
}

.admin-password-toggle {
  position: absolute;
  left: 14px;
  background: none;
  border: none;
  color: var(--admin-text-dim);
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--admin-transition);
}

.admin-password-toggle:hover {
  color: var(--admin-text-main);
}

.admin-btn-primary {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--admin-primary) 0%, #1d4ed8 100%);
  border: none;
  border-radius: var(--admin-radius-md);
  color: white;
  font-family: var(--admin-font);
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--admin-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.admin-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.45);
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.admin-btn-primary:active {
  transform: translateY(0);
}

.admin-login-demo-helper {
  margin-top: 24px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed var(--admin-border-subtle);
  border-radius: var(--admin-radius-md);
  font-size: 12.5px;
  color: var(--admin-text-muted);
}

.admin-login-demo-helper .demo-creds {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-family: monospace;
  direction: ltr;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 10px;
  border-radius: 6px;
  color: #38bdf8;
}

.admin-quick-fill-btn {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--admin-font);
  font-size: 11px;
  cursor: pointer;
  transition: var(--admin-transition);
}

.admin-quick-fill-btn:hover {
  background: rgba(56, 189, 248, 0.25);
}

/* ==========================================================================
   Admin Main Dashboard Layout (تخطيط لوحة التحكم)
   ========================================================================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 280px;
  background: var(--admin-bg-secondary);
  border-left: 1px solid var(--admin-border-subtle);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 50;
  transition: var(--admin-transition);
}

.admin-sidebar-header {
  padding: 20px 18px;
  border-bottom: 1px solid var(--admin-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-sidebar-brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.admin-sidebar-close-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--admin-border-subtle);
  background: rgba(255, 255, 255, 0.06);
  color: var(--admin-text-main);
  font-size: 16px;
  cursor: pointer;
  transition: var(--admin-transition);
}

.admin-sidebar-close-btn:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(244, 63, 94, 0.4);
  color: #f43f5e;
}

.admin-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 45;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.admin-sidebar-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.admin-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--admin-primary), var(--admin-emerald));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  flex-shrink: 0;
}

.admin-logo-texts h2 {
  font-size: 17px;
  font-weight: 800;
  color: var(--admin-text-main);
  line-height: 1.2;
}

.admin-logo-texts span {
  font-size: 11.5px;
  color: var(--admin-emerald);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.admin-logo-texts span::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--admin-emerald);
  box-shadow: 0 0 8px var(--admin-emerald);
}

.admin-sidebar-nav {
  padding: 20px 14px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-radius: var(--admin-radius-md);
  color: var(--admin-text-muted);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  transition: var(--admin-transition);
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
}

.admin-nav-item * {
  pointer-events: none;
}

.admin-nav-item .nav-label-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-nav-item .nav-icon {
  font-size: 18px;
  width: 24px;
  display: flex;
  justify-content: center;
}

.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--admin-text-main);
  transform: translateX(-3px);
}

.admin-nav-item.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(37, 99, 235, 0.08));
  border-color: rgba(37, 99, 235, 0.35);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.15);
}

.admin-nav-item.active .nav-icon {
  color: #60a5fa;
}

.admin-nav-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--admin-text-muted);
}

.admin-nav-badge.badge-certified {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

.admin-nav-badge.badge-primary {
  background: rgba(37, 99, 235, 0.25);
  color: #93c5fd;
}

.admin-sidebar-footer {
  padding: 16px 14px;
  border-top: 1px solid var(--admin-border-subtle);
  background: var(--admin-bg-surface-elevated);
}

.admin-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: var(--admin-radius-md);
  margin-bottom: 10px;
}

.admin-user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.admin-user-info {
  flex: 1;
  min-width: 0;
}

.admin-user-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--admin-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-user-role {
  font-size: 11px;
  color: var(--admin-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: ltr;
  text-align: right;
}

.admin-logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--admin-radius-sm);
  color: #fb7185;
  font-family: var(--admin-font);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--admin-transition);
}

.admin-logout-btn:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #fff;
}

/* ==========================================================================
   Admin Main Area & Topbar
   ========================================================================== */
.admin-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: transparent;
}

.admin-topbar {
  height: 72px;
  padding: 0 32px;
  background: var(--admin-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--admin-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.admin-topbar-title-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-menu-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--admin-border-subtle);
  background: var(--admin-bg-surface);
  color: var(--admin-text-main);
  font-size: 20px;
  cursor: pointer;
  transition: var(--admin-transition);
  flex-shrink: 0;
}

.admin-menu-toggle-btn:hover {
  background: var(--admin-primary-glow);
  border-color: var(--admin-primary);
}

.admin-topbar-title-box h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--admin-text-main);
  line-height: 1.2;
}

.admin-topbar-title-box p {
  font-size: 12px;
  color: var(--admin-text-muted);
}

.admin-topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-live-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #34d399;
}

.admin-live-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
  animation: pulseDot 1.8s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.admin-preview-site-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--admin-border-subtle);
  border-radius: var(--admin-radius-md);
  color: var(--admin-text-main);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: var(--admin-transition);
}

.admin-preview-site-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.admin-content-viewport {
  padding: 32px;
  flex: 1;
}

/* ==========================================================================
   Dashboard View Styles (إحصائيات ولوحة التحكم)
   ========================================================================== */
.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.admin-kpi-card {
  background: var(--admin-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--admin-glass-border);
  border-radius: var(--admin-radius-lg);
  padding: 24px 20px;
  position: relative;
  overflow: hidden;
  transition: var(--admin-transition);
  box-shadow: var(--admin-shadow-sm);
}

.admin-kpi-card:hover {
  transform: translateY(-3px);
  border-color: var(--admin-glass-hover);
  box-shadow: var(--admin-shadow-md);
}

.admin-kpi-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, var(--kpi-glow, rgba(37, 99, 235, 0.15)) 0%, transparent 70%);
  pointer-events: none;
}

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

.admin-kpi-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--admin-text-muted);
}

.admin-kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.kpi-blue { --kpi-glow: rgba(37, 99, 235, 0.2); }
.kpi-blue .admin-kpi-icon { background: rgba(37, 99, 235, 0.15); color: #60a5fa; }

.kpi-green { --kpi-glow: rgba(16, 185, 129, 0.2); }
.kpi-green .admin-kpi-icon { background: rgba(16, 185, 129, 0.15); color: #34d399; }

.kpi-amber { --kpi-glow: rgba(245, 158, 11, 0.2); }
.kpi-amber .admin-kpi-icon { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.kpi-purple { --kpi-glow: rgba(139, 92, 246, 0.2); }
.kpi-purple .admin-kpi-icon { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }

.admin-kpi-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--admin-text-main);
  line-height: 1;
  margin-bottom: 8px;
}

.admin-kpi-desc {
  font-size: 12px;
  color: var(--admin-text-dim);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Sections Grid */
.admin-dashboard-split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 1024px) {
  .admin-dashboard-split {
    grid-template-columns: 1fr;
  }
}

.admin-card-section {
  background: var(--admin-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--admin-glass-border);
  border-radius: var(--admin-radius-lg);
  padding: 24px;
  box-shadow: var(--admin-shadow-sm);
}

.admin-card-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.admin-card-section-title h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--admin-text-main);
}

.admin-card-section-title span {
  font-size: 12px;
  color: var(--admin-text-muted);
}

/* Stage Progress Overview */
.stage-progress-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stage-progress-item {
  background: var(--admin-card-inner-bg);
  border: 1px solid var(--admin-card-inner-border);
  border-radius: var(--admin-radius-md);
  padding: 16px;
  transition: var(--admin-transition);
}

.stage-progress-item:hover {
  background: var(--admin-card-inner-hover);
  border-color: var(--admin-primary);
}

.stage-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.stage-title-tag {
  font-size: 14px;
  font-weight: 700;
  color: var(--admin-text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage-videos-count {
  font-size: 12px;
  color: var(--admin-text-muted);
  background: var(--admin-chip-bg);
  padding: 2px 8px;
  border-radius: 999px;
}

.admin-bar-track {
  width: 100%;
  height: 8px;
  background: var(--admin-track-bg);
  border-radius: 999px;
  overflow: hidden;
}

.admin-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--admin-primary), var(--admin-cyan));
  transition: width 0.6s ease;
}

/* Recent Activity List */
.activity-feed-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.activity-feed-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--admin-radius-md);
  background: var(--admin-card-inner-bg);
  border: 1px solid var(--admin-card-inner-border);
  transition: var(--admin-transition);
}

.activity-feed-item:hover {
  background: var(--admin-card-inner-hover);
}

.activity-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--admin-avatar-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.activity-details {
  flex: 1;
}

.activity-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--admin-text-main);
}

.activity-subtitle {
  font-size: 11.5px;
  color: var(--admin-text-muted);
  margin-top: 2px;
}

.activity-time {
  font-size: 10.5px;
  color: var(--admin-text-dim);
  margin-top: 4px;
}

/* ==========================================================================
   Videos Management View Styles (إدارة الفيديوهات والمناهج)
   ========================================================================== */
.admin-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--admin-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--admin-glass-border);
  border-radius: var(--admin-radius-lg);
  padding: 18px 24px;
  margin-bottom: 24px;
}

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

.admin-filter-btn {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--admin-border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--admin-text-muted);
  cursor: pointer;
  transition: var(--admin-transition);
  font-family: var(--admin-font);
}

.admin-filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.admin-filter-btn.active {
  background: var(--admin-primary);
  border-color: var(--admin-primary);
  color: #fff;
  box-shadow: 0 4px 12px var(--admin-primary-glow);
}

.admin-filter-btn.filter-certified.active {
  background: var(--admin-emerald);
  border-color: var(--admin-emerald);
  box-shadow: 0 4px 12px var(--admin-emerald-glow);
}

.admin-filter-btn.filter-progress.active {
  background: var(--admin-amber);
  border-color: var(--admin-amber);
  box-shadow: 0 4px 12px var(--admin-amber-glow);
}

.admin-filter-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-search-input-box {
  position: relative;
  min-width: 260px;
}

.admin-search-input-box input {
  width: 100%;
  padding: 9px 38px 9px 14px;
  background: var(--admin-input-bg);
  border: 1px solid var(--admin-border-subtle);
  border-radius: var(--admin-radius-md);
  color: var(--admin-text-main);
  font-family: var(--admin-font);
  font-size: 13px;
}

.admin-search-input-box input:focus {
  outline: none;
  border-color: var(--admin-primary);
}

.admin-search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--admin-text-dim);
  font-size: 14px;
  pointer-events: none;
}

.admin-action-btn {
  padding: 9px 18px;
  border-radius: var(--admin-radius-md);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: var(--admin-transition);
  font-family: var(--admin-font);
  border: none;
}

.admin-action-btn.btn-emerald {
  background: linear-gradient(135deg, var(--admin-emerald) 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 4px 14px var(--admin-emerald-glow);
}

.admin-action-btn.btn-emerald:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--admin-emerald-glow);
}

.admin-action-btn.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--admin-border-subtle);
  color: var(--admin-text-muted);
}

.admin-action-btn.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--admin-text-main);
}

/* Videos Table & Cards */
.admin-table-container {
  background: var(--admin-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--admin-glass-border);
  border-radius: var(--admin-radius-lg);
  overflow: hidden;
  box-shadow: var(--admin-shadow-sm);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
  font-size: 13.5px;
}

.admin-table th {
  background: var(--admin-table-th-bg);
  padding: 16px 20px;
  color: var(--admin-text-muted);
  font-weight: 700;
  border-bottom: 1px solid var(--admin-border-subtle);
  white-space: nowrap;
}

.admin-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--admin-border-subtle);
  color: var(--admin-text-main);
  vertical-align: middle;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: var(--admin-table-row-hover);
}

.video-id-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.18);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: #93c5fd;
  font-weight: 800;
  font-size: 13px;
}

.video-title-cell {
  max-width: 320px;
}

.video-title-text {
  font-weight: 700;
  color: var(--admin-text-main);
  line-height: 1.4;
}

.video-summary-sub {
  font-size: 11.5px;
  color: var(--admin-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
  margin-top: 3px;
}

.badge-module {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
}

.mod-1 { background: rgba(37, 99, 235, 0.2); color: #93c5fd; }
.mod-2 { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.mod-3 { background: rgba(245, 158, 11, 0.2); color: #fde68a; }
.mod-4 { background: rgba(244, 63, 94, 0.2); color: #fca5a5; }

.table-action-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-action {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  color: var(--admin-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--admin-transition);
  font-size: 14px;
}

.btn-icon-action:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-icon-action.edit:hover {
  background: rgba(37, 99, 235, 0.2);
  border-color: rgba(37, 99, 235, 0.4);
  color: #60a5fa;
}

.btn-icon-action.delete:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fb7185;
}

/* ==========================================================================
   Trainees Management View Styles (المتدربون: أتموا الشهادة vs قيد التدريب)
   ========================================================================== */
.trainee-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.trainee-status-pill.status-certified,
.trainee-status-pill.status-eligible {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
}

.trainee-status-pill.status-in_progress {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.trainee-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trainee-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--admin-avatar-bg);
  border: 2px solid var(--admin-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--admin-text-main);
  overflow: hidden;
  flex-shrink: 0;
}

.trainee-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trainee-name-title {
  font-weight: 700;
  color: var(--admin-text-main);
}

.trainee-contact-sub {
  font-size: 11.5px;
  color: var(--admin-text-muted);
  direction: ltr;
  text-align: right;
}

.trainee-progress-cell {
  min-width: 140px;
}

.trainee-progress-text {
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
}

.cert-num-badge {
  font-family: monospace;
  font-size: 11.5px;
  direction: ltr;
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 6px;
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.2);
  display: inline-block;
}

/* ==========================================================================
   Modals (إضافة / تعديل فيديو، عرض تفاصيل المتدرب)
   ========================================================================== */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 18, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.admin-modal-box {
  width: 100%;
  max-width: 680px;
  max-height: calc(100vh - 32px);
  margin: auto;
  background: var(--admin-bg-secondary);
  border: 1px solid var(--admin-border-subtle);
  border-radius: var(--admin-radius-xl);
  box-shadow: var(--admin-shadow-lg), 0 0 50px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.admin-modal-box > form,
#videoEditForm {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: 100% !important;
  overflow: hidden !important;
  height: 100% !important;
  margin: 0 !important;
}

.admin-modal-header {
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--admin-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0 !important;
}

.admin-modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--admin-text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-modal-close {
  background: none;
  border: none;
  color: var(--admin-text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: var(--admin-transition);
}

.admin-modal-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.admin-modal-body {
  padding: 24px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: calc(100vh - 190px) !important;
  scrollbar-width: thin;
  scrollbar-color: #3b82f6 rgba(255, 255, 255, 0.08);
}

.admin-modal-body::-webkit-scrollbar {
  width: 8px;
}

.admin-modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 6px;
}

.admin-modal-body::-webkit-scrollbar-thumb {
  background: #3b82f6;
  border-radius: 6px;
  border: 2px solid rgba(15, 23, 42, 0.6);
}

.admin-modal-body::-webkit-scrollbar-thumb:hover {
  background: #60a5fa;
}

.admin-modal-footer {
  padding: 16px 24px;
  background: var(--admin-bg-surface-elevated);
  border-top: 1px solid var(--admin-border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0 !important;
  position: relative;
  z-index: 5;
}

.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .admin-form-row {
    grid-template-columns: 1fr;
  }
}

.admin-textarea {
  width: 100%;
  padding: 12px 14px;
  background: var(--admin-input-bg);
  border: 1px solid var(--admin-border-subtle);
  border-radius: var(--admin-radius-md);
  color: var(--admin-text-main);
  font-family: var(--admin-font);
  font-size: 13.5px;
  min-height: 80px;
  resize: vertical;
}

.admin-textarea:focus {
  outline: none;
  border-color: var(--admin-primary);
}

.admin-select {
  width: 100%;
  padding: 12px 14px;
  background: var(--admin-input-bg);
  border: 1px solid var(--admin-border-subtle);
  border-radius: var(--admin-radius-md);
  color: var(--admin-text-main);
  font-family: var(--admin-font);
  font-size: 13.5px;
}

.admin-select:focus {
  outline: none;
  border-color: var(--admin-primary);
}

/* Toast Notifications in Admin */
.admin-toast-container {
  position: fixed;
  bottom: 28px;
  left: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.admin-toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  padding: 14px 18px;
  border-radius: var(--admin-radius-md);
  background: #16203a;
  border: 1px solid var(--admin-glass-border);
  box-shadow: var(--admin-shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 13.5px;
  animation: toastSlideIn 0.3s ease-out;
}

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

.admin-toast.toast-success {
  border-right: 4px solid var(--admin-emerald);
}

.admin-toast.toast-error {
  border-right: 4px solid var(--admin-rose);
}

.admin-toast.toast-info {
  border-right: 4px solid var(--admin-cyan);
}

/* ==========================================================================
   Video File Upload & Live Preview Styles
   ========================================================================== */
.admin-video-upload-section {
  margin-top: 14px;
  margin-bottom: 18px;
}

.admin-upload-dropzone {
  border: 2px dashed rgba(37, 99, 235, 0.45);
  background: rgba(37, 99, 235, 0.05);
  border-radius: var(--admin-radius-md);
  padding: 22px 18px;
  text-align: center;
  cursor: pointer;
  transition: var(--admin-transition);
  position: relative;
  overflow: hidden;
}

.admin-upload-dropzone:hover,
.admin-upload-dropzone.dragover {
  border-color: var(--admin-primary);
  background: rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.admin-upload-dropzone input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.admin-upload-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.15);
  color: var(--admin-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 10px;
}

.admin-upload-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--admin-text-main);
  margin-bottom: 4px;
}

.admin-upload-desc {
  font-size: 12px;
  color: var(--admin-text-muted);
}

.admin-upload-status {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--admin-radius-sm);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--admin-emerald);
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-upload-preview-wrap {
  margin-top: 12px;
  border-radius: var(--admin-radius-md);
  overflow: hidden;
  border: 1px solid var(--admin-border-subtle);
  background: #000000;
}

.admin-upload-preview-wrap video {
  width: 100%;
  max-height: 240px;
  display: block;
  object-fit: contain;
  background: #000;
}

/* ==========================================================================
   Egyptian Governorates Distribution Analytics & Visual Chart (الرسم البياني للمحافظات)
   ========================================================================== */
.admin-gov-section {
  margin-top: 28px;
  margin-bottom: 28px;
}

.admin-gov-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

/* Hero Champion Card - أكبر محافظة منزلة الويب سايت */
.admin-gov-hero-champion {
  background: linear-gradient(135deg, rgba(21, 94, 239, 0.12) 0%, rgba(5, 150, 105, 0.1) 50%, rgba(217, 119, 6, 0.12) 100%);
  border: 1.5px solid rgba(217, 119, 6, 0.4);
  border-radius: var(--admin-radius-lg);
  padding: 22px 26px;
  margin-bottom: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(217, 119, 6, 0.12);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

[data-theme="light"] .admin-gov-hero-champion,
body.theme-light .admin-gov-hero-champion {
  background: linear-gradient(135deg, #eff6ff 0%, #ecfdf5 50%, #fffbeb 100%);
  border: 1.5px solid #fcd34d;
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.15);
}

.admin-gov-hero-left {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1;
  min-width: 280px;
}

.admin-gov-crown-badge {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
  flex-shrink: 0;
  animation: crownFloat 2.5s ease-in-out infinite alternate;
}

@keyframes crownFloat {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

.admin-gov-hero-info h4 {
  font-size: 13px;
  font-weight: 800;
  color: var(--admin-amber);
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.admin-gov-hero-info h2 {
  font-size: 22px;
  font-weight: 900;
  color: var(--admin-text-main);
  margin: 4px 0;
}

.admin-gov-hero-info p {
  font-size: 13px;
  color: var(--admin-text-muted);
}

.admin-gov-hero-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.admin-gov-hero-stat-box {
  text-align: center;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--admin-border-subtle);
  border-radius: var(--admin-radius-md);
}

[data-theme="light"] .admin-gov-hero-stat-box,
body.theme-light .admin-gov-hero-stat-box {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.admin-gov-hero-stat-val {
  font-size: 20px;
  font-weight: 900;
  color: var(--admin-text-main);
  line-height: 1.2;
}

.admin-gov-hero-stat-lbl {
  font-size: 11.5px;
  color: var(--admin-text-muted);
  font-weight: 600;
  margin-top: 2px;
}

/* View Mode Toggles */
.admin-gov-toggle-group {
  display: inline-flex;
  padding: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--admin-border-subtle);
  border-radius: 999px;
  gap: 4px;
}

[data-theme="light"] .admin-gov-toggle-group,
body.theme-light .admin-gov-toggle-group {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.admin-gov-toggle-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--admin-text-muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--admin-transition);
  font-family: var(--admin-font);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-gov-toggle-btn.active {
  background: var(--admin-primary);
  color: #ffffff;
  box-shadow: 0 2px 8px var(--admin-primary-glow);
}

/* Visual Bar Chart (الرسم البياني بالأعمدة للمحافظات) */
.admin-gov-chart-wrap {
  background: var(--admin-card-inner-bg);
  border: 1px solid var(--admin-card-inner-border);
  border-radius: var(--admin-radius-lg);
  padding: 24px 20px 16px;
  box-shadow: var(--admin-shadow-sm);
  margin-bottom: 22px;
}

[data-theme="light"] .admin-gov-chart-wrap,
body.theme-light .admin-gov-chart-wrap {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.admin-gov-chart-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-gov-legend-tags {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--admin-text-muted);
  font-weight: 600;
}

.admin-gov-legend-tag {
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-gov-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.admin-gov-chart-stage {
  display: flex;
  height: 290px;
  position: relative;
  align-items: flex-end;
  gap: 12px;
  padding: 30px 10px 42px 35px;
  border-bottom: 2px solid var(--admin-border-subtle);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 540px;
}

/* Y-Axis Grid Lines */
.admin-chart-grid-line {
  position: absolute;
  left: 0;
  right: 0;
  border-top: 1px dashed rgba(148, 163, 184, 0.15);
  pointer-events: none;
}

[data-theme="light"] .admin-chart-grid-line,
body.theme-light .admin-chart-grid-line {
  border-top-color: #e2e8f0;
}

.admin-chart-grid-lbl {
  position: absolute;
  left: 4px;
  transform: translateY(-50%);
  font-size: 10.5px;
  color: var(--admin-text-dim);
  font-family: monospace;
  direction: ltr;
}

/* Individual Bar Column */
.admin-gov-col {
  flex: 1;
  min-width: 48px;
  max-width: 82px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
  z-index: 5;
  transition: transform 0.25s ease;
}

.admin-gov-col:hover {
  transform: translateY(-4px);
}

.admin-gov-col-val {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--admin-text-main);
  margin-bottom: 6px;
  white-space: nowrap;
  transition: var(--admin-transition);
}

.admin-gov-col-bar {
  width: 100%;
  max-width: 44px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--admin-primary) 0%, rgba(37, 99, 235, 0.6) 100%);
  transition: height 0.8s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
  position: relative;
  cursor: pointer;
}

.admin-gov-col.rank-1 .admin-gov-col-bar {
  background: linear-gradient(180deg, #f59e0b 0%, #155eef 100%);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.45);
}

.admin-gov-col.rank-1::before {
  content: "👑";
  font-size: 17px;
  margin-bottom: 2px;
  animation: crownFloat 2s ease-in-out infinite alternate;
}

.admin-gov-col.rank-2 .admin-gov-col-bar {
  background: linear-gradient(180deg, #06b6d4 0%, #2563eb 100%);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.35);
}

.admin-gov-col.rank-3 .admin-gov-col-bar {
  background: linear-gradient(180deg, #10b981 0%, #059669 100%);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
}

.admin-gov-col-bar:hover {
  box-shadow: 0 0 20px var(--admin-primary-glow);
}

.admin-gov-col-label {
  position: absolute;
  bottom: -36px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--admin-text-main);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72px;
}

.admin-gov-col-rank-num {
  display: block;
  font-size: 10px;
  color: var(--admin-text-dim);
  font-weight: 600;
}

/* Tooltip on Chart Bar Hover */
.admin-gov-col-tooltip {
  position: absolute;
  top: -64px;
  left: 50%;
  transform: translateX(-50%) scale(0.85);
  background: #0f172a;
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 20;
}

[data-theme="light"] .admin-gov-col-tooltip,
body.theme-light .admin-gov-col-tooltip {
  background: #1e293b;
  color: #ffffff;
  border-color: #cbd5e1;
}

.admin-gov-col:hover .admin-gov-col-tooltip {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* Podium Top 3 Cards Row */
.admin-gov-podium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.admin-gov-podium-card {
  padding: 16px 18px;
  border-radius: var(--admin-radius-md);
  border: 1px solid var(--admin-border-subtle);
  background: var(--admin-card-inner-bg);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: var(--admin-transition);
}

[data-theme="light"] .admin-gov-podium-card,
body.theme-light .admin-gov-podium-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.admin-gov-podium-card:hover {
  transform: translateY(-2px);
  border-color: var(--admin-primary);
}

.admin-gov-podium-card.first-place {
  border-color: rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, var(--admin-card-inner-bg) 100%);
}

.admin-gov-podium-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.admin-gov-podium-badge.gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.admin-gov-podium-badge.silver {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  box-shadow: 0 4px 12px rgba(100, 116, 139, 0.35);
}

.admin-gov-podium-badge.bronze {
  background: linear-gradient(135deg, #d97706, #b45309);
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
}

/* Governorates Grid Cards */
.admin-gov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.admin-gov-card {
  background: var(--admin-card-inner-bg);
  border: 1px solid var(--admin-card-inner-border);
  border-radius: var(--admin-radius-md);
  padding: 14px 16px;
  box-shadow: var(--admin-shadow-sm);
  transition: var(--admin-transition);
  position: relative;
  overflow: hidden;
}

.admin-gov-card:hover {
  transform: translateY(-2px);
  border-color: var(--admin-primary);
  box-shadow: var(--admin-shadow-md);
}

.admin-gov-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.admin-gov-name {
  font-weight: 800;
  font-size: 14px;
  color: var(--admin-text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-gov-count-badge {
  font-size: 12.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--admin-radius-sm);
  background: rgba(37, 99, 235, 0.15);
  color: var(--admin-primary);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.admin-gov-bar-track {
  width: 100%;
  height: 8px;
  background: var(--admin-track-bg);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.admin-gov-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--admin-primary), #60a5fa);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-gov-card:nth-child(1) .admin-gov-bar-fill {
  background: linear-gradient(90deg, #f59e0b, #d97706);
}

.admin-gov-card:nth-child(2) .admin-gov-bar-fill {
  background: linear-gradient(90deg, #06b6d4, #2563eb);
}

.admin-gov-card:nth-child(3) .admin-gov-bar-fill {
  background: linear-gradient(90deg, #10b981, #059669);
}

.admin-gov-stats-sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--admin-text-muted);
}

/* ==========================================================================
   Comprehensive Responsive System (الموبايل والتابلت والشاشات الصغيرة)
   Tested for: 320px, 375px, 390px, 430px, 768px, 1024px, 1366px
   ========================================================================== */

html, body {
  max-width: 100vw;
  overflow-x: hidden;
}

body.sidebar-open {
  overflow: hidden;
}

/* Tablet & Mobile Breakpoint (<= 1024px) */
@media (max-width: 1024px) {
  .admin-menu-toggle-btn {
    display: inline-flex;
  }

  .admin-sidebar-close-btn {
    display: inline-flex;
  }

  /* Off-canvas Drawer Sidebar in RTL */
  .admin-sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    right: -310px;
    left: auto;
    width: 290px;
    max-width: 86vw;
    z-index: 50;
    height: 100vh;
    box-shadow: none;
    transition: right 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .admin-sidebar.open {
    right: 0;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.75);
  }

  /* Off-canvas Drawer Sidebar in LTR */
  html[dir="ltr"] .admin-sidebar {
    right: auto;
    left: -310px;
    transition: left 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  }

  html[dir="ltr"] .admin-sidebar.open {
    left: 0;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.75);
  }

  .admin-topbar {
    padding: 0 20px;
  }

  .admin-content-viewport {
    padding: 22px 18px;
  }

  .admin-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

/* Mobile Breakpoint (<= 768px) */
@media (max-width: 768px) {
  .admin-topbar {
    height: auto;
    min-height: 62px;
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .admin-topbar-title-wrap {
    flex: 1;
    min-width: 180px;
  }

  .admin-topbar-title-box h1 {
    font-size: 16px;
  }

  .admin-topbar-title-box p {
    font-size: 11.5px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .admin-topbar-actions {
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
  }

  .admin-preview-site-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .admin-live-badge {
    padding: 5px 10px;
    font-size: 11px;
  }

  .admin-content-viewport {
    padding: 14px 10px;
  }

  .admin-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
  }

  .admin-kpi-card {
    padding: 16px 12px;
  }

  .admin-kpi-value {
    font-size: 24px;
  }

  .admin-kpi-title {
    font-size: 12px;
  }

  .admin-kpi-icon {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .admin-kpi-desc {
    font-size: 11px;
  }

  .admin-charts-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    margin-bottom: 20px !important;
  }

  .admin-card-section {
    padding: 16px;
    border-radius: var(--admin-radius-md);
  }

  /* Table Horizontal Scrolling */
  .admin-table-container {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--admin-radius-md);
  }

  .admin-table {
    min-width: 600px;
  }

  /* Videos view filters on mobile: show ALL stage buttons clearly without clipping */
  .admin-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 12px;
  }

  .admin-filter-pills {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
    overflow: visible;
  }

  /* Make 'كافة الدروس' span full width on top */
  .admin-filter-pills .admin-filter-btn:first-child {
    grid-column: 1 / -1;
  }

  .admin-filter-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 10px 8px;
    font-size: 12px;
    font-weight: 700;
    white-space: normal;
    display: flex;
    align-items: center;
    border-radius: var(--admin-radius-md);
    min-height: 42px;
  }

  .admin-filter-actions {
    flex-wrap: wrap;
    width: 100%;
    gap: 8px;
  }

  .admin-search-input-box {
    width: 100%;
  }

  /* Modals responsiveness */
  .admin-modal-card {
    width: 95vw !important;
    max-width: 95vw !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    padding: 18px !important;
  }

  .admin-login-card {
    width: 92vw;
    padding: 24px 18px;
  }
}

/* Small Smartphone Breakpoint (<= 480px, including 430px, 390px, 375px, 320px) */
@media (max-width: 480px) {
  .admin-topbar {
    padding: 8px 10px;
  }

  .admin-topbar-title-box h1 {
    font-size: 14.5px;
  }

  .admin-topbar-title-box p {
    display: none;
  }

  .admin-topbar-actions {
    justify-content: space-between;
  }

  .admin-kpi-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .admin-kpi-card {
    padding: 14px 12px;
  }

  .admin-card-section {
    padding: 12px;
  }

  .admin-sidebar {
    width: 270px;
    max-width: 88vw;
  }

  .admin-nav-item {
    padding: 12px 14px;
    font-size: 14px;
  }

  .btn-icon-action {
    width: 38px;
    height: 38px;
  }
}

/* ==========================================================================
   Activation Codes View (Admin) — أكواد تفعيل الامتحان النهائي
   ========================================================================== */

.admin-activations-view {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ── KPI Row ── */
.act-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.act-kpi-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--admin-radius-lg);
  border: 1px solid var(--admin-border);
  background: var(--admin-bg-surface);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.act-kpi-box:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
.act-kpi-icon { font-size: 28px; flex-shrink: 0; }
.act-kpi-val { font-size: 28px; font-weight: 900; color: var(--admin-text-main); line-height: 1; }
.act-kpi-lbl { font-size: 11.5px; color: var(--admin-text-muted); font-weight: 600; margin-top: 3px; }

.act-kpi-total { border-color: rgba(37,99,235,0.3); }
.act-kpi-active { border-color: rgba(16,185,129,0.3); }
.act-kpi-used   { border-color: rgba(245,158,11,0.3); }
.act-kpi-trainees { border-color: rgba(139,92,246,0.3); }

/* ── Generate Panel ── */
.act-generate-panel {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-lg);
  background: var(--admin-bg-surface);
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.act-generate-panel.expanded { border-color: rgba(37,99,235,0.4); }

.act-generate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}
.act-generate-header:hover { background: var(--admin-bg-surface-elevated); }

.act-toggle-arrow {
  font-size: 13px;
  color: var(--admin-text-muted);
  transition: transform 0.25s ease;
}
.act-toggle-arrow.open { transform: rotate(180deg); }

.act-generate-form {
  padding: 0 22px 22px;
  border-top: 1px solid var(--admin-border);
  animation: fadeSlideDown 0.25s ease;
}

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

.act-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.act-form-group { display: flex; flex-direction: column; gap: 6px; }
.act-form-label { font-size: 12.5px; font-weight: 700; color: var(--admin-text-secondary); }

.act-form-select,
.act-form-input {
  background: var(--admin-bg-primary);
  border: 1.5px solid var(--admin-border);
  border-radius: var(--admin-radius-md);
  color: var(--admin-text-main);
  font-size: 13px;
  padding: 10px 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: inherit;
}
.act-form-select:focus,
.act-form-input:focus {
  border-color: var(--admin-primary);
  box-shadow: 0 0 0 3px var(--admin-primary-glow);
}
.act-form-select option { background: var(--admin-bg-secondary); }

/* Preview Box */
.act-generate-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--admin-bg-primary);
  border: 1px dashed rgba(37,99,235,0.4);
  border-radius: var(--admin-radius-md);
}
.act-preview-user { display: flex; align-items: center; gap: 10px; }
.act-preview-avatar { font-size: 28px; }
.act-preview-exam { display: flex; flex-direction: column; gap: 2px; text-align: end; }

/* Generated Code Result */
.act-code-result {
  margin-top: 16px;
  padding: 16px;
  background: rgba(16,185,129,0.06);
  border: 1.5px solid rgba(16,185,129,0.3);
  border-radius: var(--admin-radius-md);
  animation: fadeSlideDown 0.3s ease;
}
.act-code-result-inner { display: flex; flex-direction: column; gap: 6px; }
.act-code-display { display: flex; align-items: center; gap: 12px; }
.act-code-text {
  font-family: 'Courier New', monospace;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--admin-emerald);
  background: var(--admin-bg-primary);
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid rgba(16,185,129,0.3);
}
.act-copy-btn {
  background: var(--admin-bg-surface-elevated);
  border: 1px solid var(--admin-border);
  color: var(--admin-text-secondary);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}
.act-copy-btn:hover { background: var(--admin-primary); color: #fff; border-color: var(--admin-primary); }

/* ── Table Header (Filter + Search) ── */
.act-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px;
  background: var(--admin-bg-surface);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius-lg);
}

/* ── Main Table ── */
.act-table-scroll { overflow-x: auto; }
.act-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.act-table thead tr {
  background: var(--admin-bg-surface-elevated);
  border-bottom: 2px solid var(--admin-border);
}
.act-table th {
  padding: 12px 16px;
  text-align: start;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--admin-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.act-table td { padding: 13px 16px; border-bottom: 1px solid var(--admin-border); vertical-align: middle; }
.act-row:last-child td { border-bottom: none; }
.act-row { transition: background 0.15s ease; }
.act-row:hover { background: var(--admin-bg-surface-elevated); }
.act-row.row-used { opacity: 0.8; }

/* Code Cell */
.act-code-cell { display: flex; align-items: center; gap: 8px; }
.act-code-badge {
  font-family: 'Courier New', monospace;
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--admin-primary);
  background: rgba(37,99,235,0.1);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(37,99,235,0.25);
}
.act-mini-copy {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 3px 5px;
  border-radius: 5px;
  opacity: 0.6;
  transition: opacity 0.2s, background 0.2s;
}
.act-mini-copy:hover { opacity: 1; background: var(--admin-bg-surface-elevated); }

/* Status Badges */
.act-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.status-active {
  background: rgba(16,185,129,0.15);
  color: var(--admin-emerald);
  border: 1px solid rgba(16,185,129,0.3);
}
.status-used {
  background: rgba(245,158,11,0.12);
  color: var(--admin-amber);
  border: 1px solid rgba(245,158,11,0.25);
}

/* Action Buttons in Table */
.act-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
}
.btn-deactivate {
  background: rgba(245,158,11,0.1);
  color: var(--admin-amber);
  border-color: rgba(245,158,11,0.3);
}
.btn-deactivate:hover { background: var(--admin-amber); color: #000; }
.btn-delete {
  background: rgba(244,63,94,0.1);
  color: var(--admin-rose);
  border-color: rgba(244,63,94,0.3);
}
.btn-delete:hover { background: var(--admin-rose); color: #fff; }

/* Responsive */
@media (max-width: 900px) {
  .act-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .act-form-grid { grid-template-columns: 1fr; }
  .act-table-header { flex-direction: column; align-items: stretch; }
}
@media (max-width: 560px) {
  .act-kpi-row { grid-template-columns: 1fr; }
}

/* loadProgress animation for activation success screen */
@keyframes loadProgress {
  from { width: 0%; }
  to   { width: 100%; }
}

