/* =========================================
   Admin Panel — Design System
   Blue-themed, RTL Arabic
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;600;700;800&display=swap');

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

:root {
  --blue-primary: #2563eb;
  --blue-dark:    #1d4ed8;
  --blue-darker:  #1e3a8a;
  --blue-light:   #3b82f6;
  --blue-50:      #eff6ff;
  --blue-100:     #dbeafe;
  --blue-200:     #bfdbfe;
  --blue-300:     #93c5fd;
  --sky-400:      #38bdf8;
  --sidebar-from: #0a1628;
  --sidebar-to:   #0f2347;
  --text-main:    #1e293b;
  --text-muted:   #64748b;
  --border:       #bfdbfe;
  --bg-page:      #f0f7ff;
}

body { font-family: 'Cairo', sans-serif; direction: rtl; background: var(--bg-page); color: var(--text-main); font-size: 14px; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
.hidden { display: none !important; }

/* ---- LAYOUT ---- */
.app-container { min-height: 100vh; display: flex; flex-direction: row-reverse; }
.sidebar { width: 268px; background: linear-gradient(180deg, var(--sidebar-from) 0%, var(--sidebar-to) 100%); position: fixed; right: 0; height: 100vh; z-index: 1000; overflow-y: auto; border-left: 1px solid rgba(59,130,246,0.12); transition: transform 0.3s ease; }
.main-content { flex: 1; min-height: 100vh; margin-right: 268px; background: var(--bg-page); }

/* ---- SIDEBAR ---- */
.sidebar-header { padding: 1.25rem 1rem; border-bottom: 1px solid rgba(59,130,246,0.15); display: flex; align-items: center; justify-content: space-between; }
.sidebar-logo { display: flex; align-items: center; gap: 0.625rem; text-decoration: none; }
.sidebar-logo-icon { width: 40px; height: 40px; background: linear-gradient(135deg, var(--sky-400), var(--blue-primary)); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; flex-shrink: 0; box-shadow: 0 6px 18px rgba(56,189,248,0.35); }
.sidebar-logo-icon img { width: 28px; height: 28px; object-fit: contain; }
.sidebar-logo-title { font-size: 1.1rem; font-weight: 800; color: white; display: block; }
.sidebar-logo-sub { font-size: 0.68rem; color: var(--blue-300); display: block; margin-top: 1px; }
.sidebar-nav { padding: 0.5rem 0 2rem; }
.nav-section { margin-bottom: 0.2rem; }
.nav-section-title { color: rgba(147,197,253,0.5); font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; padding: 0.7rem 1.1rem 0.3rem; display: block; }
.nav-item { margin: 1px 0.4rem; }
.nav-link { display: flex; align-items: center; gap: 0.625rem; padding: 0.575rem 0.875rem; color: #c7d9f8; text-decoration: none; font-weight: 500; font-size: 0.85rem; border-radius: 10px; transition: all 0.18s; position: relative; }
.nav-link:hover { background: rgba(59,130,246,0.16); color: var(--blue-300); }
.nav-link.active { background: rgba(59,130,246,0.24); color: #60a5fa; }
.nav-link.active::before { content: ''; position: absolute; left: 0; top: 20%; height: 60%; width: 3px; background: var(--sky-400); border-radius: 0 2px 2px 0; }
.nav-link-icon { width: 17px; height: 17px; flex-shrink: 0; opacity: 0.85; }
.nav-link.active .nav-link-icon { opacity: 1; }
.nav-group-btn { display: flex; align-items: center; justify-content: space-between; width: calc(100% - 0.8rem); padding: 0.575rem 0.875rem; color: #c7d9f8; background: none; border: none; font-size: 0.85rem; font-weight: 500; cursor: pointer; border-radius: 10px; margin: 1px 0.4rem; transition: all 0.18s; }
.nav-group-btn:hover { background: rgba(59,130,246,0.14); color: var(--blue-300); }
.nav-group-btn.open { color: #60a5fa; }
.nav-group-left { display: flex; align-items: center; gap: 0.625rem; }
.nav-chevron { width: 13px; height: 13px; transition: transform 0.2s; flex-shrink: 0; }
.nav-chevron.open { transform: rotate(180deg); }
.nav-sub .nav-link { padding-right: 2.75rem; font-size: 0.8125rem; color: #a9c5f0; }
.nav-sub .nav-link:hover { color: var(--blue-300); }
.nav-sub .nav-link.active { color: #60a5fa; }

/* ---- HEADER ---- */
.header { background: white; border-bottom: 1px solid var(--blue-100); padding: 0 1.75rem; height: 66px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 999; box-shadow: 0 1px 4px rgba(37,99,235,0.07); }
.header-left { display: flex; align-items: center; gap: 1rem; }
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text-muted); padding: 0.4rem; border-radius: 8px; }
.mobile-menu-btn:hover { background: var(--blue-50); color: var(--blue-dark); }
.search-container { position: relative; width: 340px; }
.search-input { width: 100%; padding: 0.55rem 2.25rem 0.55rem 0.875rem; border: 1px solid var(--blue-100); border-radius: 10px; background: var(--blue-50); font-size: 0.8125rem; direction: rtl; color: var(--text-main); transition: all 0.2s; font-family: 'Cairo', sans-serif; }
.search-input:focus { outline: none; border-color: var(--blue-primary); background: white; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.search-icon { position: absolute; right: 0.65rem; top: 50%; transform: translateY(-50%); color: var(--blue-300); width: 15px; height: 15px; pointer-events: none; }
.header-right { display: flex; align-items: center; gap: 0.75rem; }
.header-btn { position: relative; background: none; border: none; color: var(--text-muted); padding: 0.4rem; border-radius: 8px; transition: all 0.18s; display: flex; align-items: center; justify-content: center; }
.header-btn:hover { background: var(--blue-50); color: var(--blue-dark); }
.notif-dot { position: absolute; top: 4px; left: 4px; width: 8px; height: 8px; background: var(--blue-primary); border-radius: 50%; border: 2px solid white; }
.user-menu { position: relative; }
.user-menu-btn { display: flex; align-items: center; gap: 0.5rem; padding: 0.3rem 0.5rem 0.3rem 0.3rem; border-radius: 999px; background: white; border: 1px solid var(--blue-100); cursor: pointer; transition: all 0.2s; }
.user-menu-btn:hover { border-color: var(--blue-300); background: var(--blue-50); }
.user-menu-btn[aria-expanded="true"] { border-color: var(--blue-primary); background: linear-gradient(135deg, #f8fbff, #eef5ff); box-shadow: 0 10px 24px rgba(37,99,235,0.12); }
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--sky-400), var(--blue-primary)); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 0.8rem; flex-shrink: 0; }
.user-info { text-align: right; }
.user-name { font-size: 0.8rem; font-weight: 600; color: var(--text-main); display: block; white-space: nowrap; }
.user-role { font-size: 0.68rem; color: var(--blue-primary); display: block; }
.dropdown-menu { position: absolute; top: calc(100% + 6px); left: 0; background: white; border: 1px solid var(--blue-100); border-radius: 12px; box-shadow: 0 10px 32px rgba(37,99,235,0.12); min-width: 200px; z-index: 1050; animation: slideDown 0.15s ease; overflow: hidden; }
.dropdown-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1rem; color: var(--text-muted); font-size: 0.8125rem; background: none; border: none; width: 100%; cursor: pointer; transition: all 0.15s; text-align: right; }
.dropdown-item:hover { background: var(--blue-50); color: var(--blue-dark); }
.dropdown-item.danger:hover { background: #fef2f2; color: #dc2626; }
.dropdown-divider { height: 1px; background: var(--blue-100); margin: 0.2rem 0; }

/* ---- PAGE ---- */
.page-container { padding: 1.625rem 1.875rem; animation: fadeIn 0.25s ease; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.625rem; flex-wrap: wrap; }
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.15rem; }
.page-subtitle { font-size: 0.8125rem; color: var(--blue-primary); font-weight: 500; }
.page-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.status-pill { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.5rem 0.85rem; border-radius: 999px; border: 1px solid var(--blue-100); background: linear-gradient(135deg, #ffffff, #f4f8ff); color: var(--blue-darker); font-size: 0.76rem; font-weight: 700; box-shadow: 0 8px 24px rgba(37,99,235,0.08); }

/* ---- STAT CARDS ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1.375rem; }
.stat-card { background: white; border-radius: 14px; padding: 1.25rem; border: 1px solid var(--blue-100); box-shadow: 0 1px 4px rgba(37,99,235,0.06); transition: all 0.22s; position: relative; overflow: hidden; }
.stat-card::after { content: ''; position: absolute; top: 0; right: 0; left: 0; height: 3px; background: var(--sc, linear-gradient(90deg, var(--sky-400), var(--blue-primary))); }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(37,99,235,0.12); }
.stat-card-link { display: block; text-decoration: none; }
.stat-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 0.75rem; }
.stat-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; flex-shrink: 0; }
.stat-icon.blue   { background: linear-gradient(135deg, var(--sky-400), var(--blue-primary)); box-shadow: 0 5px 14px rgba(37,99,235,0.3); }
.stat-icon.green  { background: linear-gradient(135deg,#10b981,#059669); box-shadow: 0 5px 14px rgba(16,185,129,0.28); }
.stat-icon.amber  { background: linear-gradient(135deg,#f59e0b,#d97706); box-shadow: 0 5px 14px rgba(245,158,11,0.28); }
.stat-icon.red    { background: linear-gradient(135deg,#ef4444,#dc2626); box-shadow: 0 5px 14px rgba(239,68,68,0.28); }
.stat-icon.purple { background: linear-gradient(135deg,#a855f7,#7c3aed); box-shadow: 0 5px 14px rgba(168,85,247,0.28); }
.stat-icon.sky    { background: linear-gradient(135deg,#0ea5e9,#0284c7); box-shadow: 0 5px 14px rgba(14,165,233,0.28); }
.stat-value { font-size: 1.75rem; font-weight: 700; color: var(--text-main); line-height: 1.1; }
.stat-label { font-size: 0.8125rem; color: var(--text-muted); font-weight: 500; margin-top: 0.15rem; }
.stat-trend { display: flex; align-items: center; gap: 0.2rem; font-size: 0.72rem; font-weight: 600; margin-top: 0.5rem; }
.stat-trend.up { color: #10b981; }
.stat-trend.down { color: #ef4444; }
.stat-trend.neutral { color: var(--text-muted); }

/* ---- CARDS ---- */
.card { background: white; border-radius: 14px; border: 1px solid var(--blue-100); box-shadow: 0 1px 4px rgba(37,99,235,0.06); }
.card:hover { box-shadow: 0 4px 16px rgba(37,99,235,0.1); }
.card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--blue-100); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 0.9rem; font-weight: 600; color: var(--text-main); }
.card-subtitle { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.card-body { padding: 1.25rem; }

/* ---- BUTTONS ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.575rem 1.125rem; font-size: 0.8125rem; font-weight: 600; border-radius: 9px; border: none; cursor: pointer; transition: all 0.18s; white-space: nowrap; font-family: 'Cairo', sans-serif; }
.btn-primary { background: linear-gradient(135deg, var(--blue-primary), var(--blue-dark)); color: white; }
.btn-primary:hover { background: linear-gradient(135deg, var(--blue-dark), var(--blue-darker)); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37,99,235,0.38); }
.btn-secondary { background: white; color: var(--text-muted); border: 1px solid var(--blue-100); }
.btn-secondary:hover { background: var(--blue-50); border-color: var(--blue-300); color: var(--blue-dark); }
.btn-success { background: linear-gradient(135deg,#10b981,#059669); color: white; }
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16,185,129,0.32); }
.btn-danger { background: linear-gradient(135deg,#ef4444,#dc2626); color: white; }
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(239,68,68,0.32); }
.btn-warning { background: linear-gradient(135deg,#f59e0b,#d97706); color: white; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid #e2e8f0; }
.btn-ghost:hover { background: var(--blue-50); color: var(--blue-dark); border-color: var(--blue-200); }
.btn-sm { padding: 0.375rem 0.8rem; font-size: 0.75rem; }
.btn-xs { padding: 0.25rem 0.55rem; font-size: 0.7rem; border-radius: 6px; }
.btn-icon { padding: 0.45rem; border-radius: 8px; }
.btn-icon:hover { background: var(--blue-50); color: var(--blue-primary); }

/* ---- TABLES ---- */
.table-container { background: white; border-radius: 14px; border: 1px solid var(--blue-100); overflow: hidden; box-shadow: 0 1px 4px rgba(37,99,235,0.06); }
.table { width: 100%; border-collapse: collapse; }
.table thead th { background: var(--blue-50); padding: 0.75rem 1rem; text-align: right; font-size: 0.7rem; font-weight: 700; color: var(--blue-darker); text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid var(--blue-100); white-space: nowrap; }
.table tbody td { padding: 0.8rem 1rem; border-bottom: 1px solid #f0f7ff; font-size: 0.8125rem; color: var(--text-muted); text-align: right; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--blue-50); }
.table-actions { display: flex; align-items: center; justify-content: center; gap: 0.3rem; }

/* ---- BADGES ---- */
.badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.2rem 0.55rem; font-size: 0.7rem; font-weight: 600; border-radius: 999px; white-space: nowrap; }
.badge-blue   { background: rgba(37,99,235,0.1);   color: #1d4ed8; }
.badge-sky    { background: rgba(56,189,248,0.12);  color: #0284c7; }
.badge-green  { background: rgba(16,185,129,0.1);   color: #047857; }
.badge-amber  { background: rgba(245,158,11,0.1);   color: #b45309; }
.badge-red    { background: rgba(239,68,68,0.1);    color: #b91c1c; }
.badge-purple { background: rgba(168,85,247,0.1);   color: #6d28d9; }
.badge-slate  { background: #f1f5f9; color: #475569; }
.badge-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.8125rem; font-weight: 600; color: #374151; margin-bottom: 0.4rem; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 0.6rem 0.8rem; border: 1px solid var(--blue-100); border-radius: 9px; font-size: 0.8125rem; background: white; color: var(--text-main); transition: all 0.18s; direction: rtl; font-family: 'Cairo', sans-serif; }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--blue-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.form-textarea { min-height: 85px; resize: vertical; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.form-hint { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.3rem; }
.form-error { font-size: 0.72rem; color: #dc2626; margin-top: 0.3rem; }

/* ---- FILTER BAR ---- */
.filter-bar { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 1.125rem; flex-wrap: wrap; }
.filter-inline-action { box-shadow: 0 10px 26px rgba(37,99,235,0.16); }
.filter-search { position: relative; flex: 1; min-width: 220px; }
.filter-search input { width: 100%; padding: 0.55rem 2.1rem 0.55rem 0.8rem; border: 1px solid var(--blue-100); border-radius: 9px; font-size: 0.8125rem; background: white; direction: rtl; transition: all 0.18s; font-family: 'Cairo', sans-serif; color: var(--text-main); }
.filter-search input:focus { outline: none; border-color: var(--blue-primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.filter-search-icon { position: absolute; right: 0.6rem; top: 50%; transform: translateY(-50%); color: var(--blue-300); width: 14px; height: 14px; pointer-events: none; }
.filter-chip-active { background: linear-gradient(135deg, var(--sky-400), var(--blue-primary)); color: white; border-color: transparent; box-shadow: 0 8px 20px rgba(37,99,235,0.22); }
.filter-chip-muted { color: var(--text-muted); }

/* ---- PAGINATION ---- */
.pagination { display: flex; align-items: center; justify-content: space-between; padding: 0.8rem 1.25rem; border-top: 1px solid var(--blue-100); }
.pagination-info { font-size: 0.75rem; color: var(--text-muted); }
.pagination-btns { display: flex; gap: 0.25rem; }
.pagination-btn { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--blue-100); background: white; border-radius: 7px; font-size: 0.75rem; color: var(--text-muted); cursor: pointer; transition: all 0.15s; font-family: 'Cairo', sans-serif; }
.pagination-btn:hover, .pagination-btn.active { background: var(--blue-primary); border-color: var(--blue-primary); color: white; }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---- TABS ---- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--blue-100); margin-bottom: 1.25rem; }
.tab-btn { padding: 0.65rem 1.2rem; font-size: 0.8125rem; font-weight: 500; color: var(--text-muted); background: none; border: none; border-bottom: 2px solid transparent; cursor: pointer; transition: all 0.18s; margin-bottom: -2px; font-family: 'Cairo', sans-serif; }
.tab-btn:hover { color: var(--blue-primary); }
.tab-btn.active { color: var(--blue-primary); border-bottom-color: var(--blue-primary); font-weight: 700; }

/* ---- ALERTS ---- */
.alert { display: flex; align-items: flex-start; gap: 0.625rem; padding: 0.8rem 1rem; border-radius: 10px; margin-bottom: 0.625rem; font-size: 0.8125rem; }
.alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert-danger  { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-info    { background: var(--blue-50); border: 1px solid var(--blue-200); color: var(--blue-darker); }

/* ---- MODAL ---- */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 1rem; animation: fadeIn 0.18s ease; }
.modal { background: white; border-radius: 16px; box-shadow: 0 24px 64px rgba(0,0,0,0.18); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; animation: slideDown 0.2s ease; }
.modal-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--blue-100); display: flex; align-items: center; justify-content: space-between; }
.modal-title { font-size: 0.9rem; font-weight: 600; color: var(--text-main); }
.modal-close { background: none; border: none; color: #94a3b8; padding: 0.3rem; border-radius: 6px; transition: all 0.15s; display: flex; cursor: pointer; }
.modal-close:hover { color: var(--blue-primary); background: var(--blue-50); }
.modal-body { padding: 1.25rem; }
.modal-footer { padding: 0.8rem 1.25rem; border-top: 1px solid var(--blue-100); display: flex; justify-content: flex-end; gap: 0.5rem; }

/* ---- QUICK ACTIONS ---- */
.quick-actions { display: flex; gap: 0.625rem; flex-wrap: wrap; }
.quick-action-btn { display: flex; align-items: center; gap: 0.5rem; padding: 0.65rem 1rem; background: white; border: 1px solid var(--blue-100); border-radius: 10px; color: var(--blue-dark); font-size: 0.8125rem; font-weight: 600; cursor: pointer; transition: all 0.2s; font-family: 'Cairo', sans-serif; }
.quick-action-btn:hover { background: linear-gradient(135deg, var(--sky-400), var(--blue-primary)); color: white; border-color: transparent; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(37,99,235,0.28); }

/* ---- STATUS LIVE DOT ---- */
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #10b981; display: inline-block; box-shadow: 0 0 0 3px rgba(16,185,129,0.22); animation: pulse 1.4s ease-in-out infinite; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.status-dot.online  { background: #10b981; }
.status-dot.offline { background: #94a3b8; }
.status-dot.busy    { background: #f59e0b; }

/* ---- GRIDS ---- */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.125rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.125rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.125rem; }
.overview-grid   { display: grid; grid-template-columns: 2fr 1fr; gap: 1.125rem; margin-top: 1.125rem; }
.overview-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.125rem; margin-top: 1.125rem; }

/* ---- PROGRESS ---- */
.progress-bar { height: 6px; background: var(--blue-100); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--sky-400), var(--blue-primary)); transition: width 0.4s ease; }

/* ---- SPINNER ---- */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--blue-100); border-radius: 50%; border-top-color: var(--blue-primary); animation: spin 0.9s linear infinite; }

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-icon { width: 50px; height: 50px; margin: 0 auto 1rem; color: var(--blue-300); }
.empty-text { font-size: 0.875rem; color: #94a3b8; }

/* ---- AVATAR ---- */
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--sky-400), var(--blue-primary)); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 0.75rem; flex-shrink: 0; }

/* ---- HIGHLIGHT ROW ---- */
.highlight-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem; border-radius: 10px; border: 1px solid var(--blue-50); transition: background 0.15s; }
.highlight-row:hover { background: var(--blue-50); }

/* ---- LOGIN PAGE ---- */
.login-page { min-height: 100vh; background: linear-gradient(135deg, var(--sidebar-from) 0%, var(--sidebar-to) 50%, #0c1e42 100%); display: flex; align-items: center; justify-content: center; padding: 1rem; direction: rtl; font-family: 'Cairo', sans-serif; position: relative; overflow: hidden; }
.login-page::before, .login-page::after { content: ''; position: absolute; border-radius: 999px; filter: blur(8px); opacity: 0.38; pointer-events: none; animation: floatSoft 12s ease-in-out infinite; }
.login-page::before { width: 320px; height: 320px; top: -90px; right: -70px; background: radial-gradient(circle, rgba(56,189,248,0.45), transparent 70%); }
.login-page::after { width: 260px; height: 260px; left: -60px; bottom: -80px; background: radial-gradient(circle, rgba(37,99,235,0.35), transparent 72%); animation-delay: -4s; }
.login-container { display: grid; grid-template-columns: 1.2fr 1fr; max-width: 960px; width: 100%; border-radius: 24px; overflow: hidden; box-shadow: 0 40px 100px rgba(0,0,0,0.4); position: relative; z-index: 1; animation: entranceUp 0.7s ease both; }
.login-hero { background: linear-gradient(145deg, #0f2347, #1d4ed8 55%, #2563eb); padding: 2.75rem 2.25rem; display: flex; flex-direction: column; gap: 1.5rem; color: white; position: relative; overflow: hidden; }
.login-hero::after { content: ''; position: absolute; inset: auto -10% -30% auto; width: 280px; height: 280px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,0.14), transparent 72%); animation: floatSoft 10s ease-in-out infinite; }
.login-hero-brand { width: 180px; max-width: 58%; padding: 0.7rem 0.85rem; border-radius: 18px; background: #072330; border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 14px 34px rgba(0,0,0,0.14); }
.login-hero-brand img { width: 100%; height: auto; object-fit: contain; }
.login-hero-badge { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.35rem 0.75rem; border-radius: 999px; background: rgba(255,255,255,0.12); font-size: 0.75rem; font-weight: 700; width: fit-content; }
.login-hero h1 { font-size: clamp(1.6rem,3vw,2.3rem); font-weight: 800; line-height: 1.25; }
.login-hero p { color: rgba(224,242,254,0.85); font-size: 0.875rem; line-height: 1.8; }
.login-hero-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 0.75rem; margin-top: 0.5rem; }
.login-stat { padding: 0.75rem; border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; background: rgba(255,255,255,0.07); }
.login-stat strong { font-size: 1.3rem; font-weight: 700; display: block; }
.login-stat span { font-size: 0.7rem; color: rgba(224,242,254,0.7); }
.login-form-card { background: white; padding: 2.75rem 2.25rem; display: flex; flex-direction: column; gap: 1.375rem; position: relative; animation: entranceUp 0.8s ease both; }
.login-form-logo { display: flex; align-items: center; gap: 0.625rem; }
.login-form-logo-icon { width: 42px; height: 42px; background: #072330; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: white; }
.login-form-logo-icon img { width: 28px; height: 28px; object-fit: contain; }
.login-form-logo-text strong { display: block; font-size: 1rem; font-weight: 800; color: var(--text-main); }
.login-form-logo-text span { font-size: 0.7rem; color: var(--blue-primary); }
.login-form-title h2 { font-size: 1.4rem; font-weight: 700; color: var(--text-main); margin-bottom: 0.2rem; }
.login-form-title p { font-size: 0.8125rem; color: var(--text-muted); }
.login-form { display: flex; flex-direction: column; gap: 0.875rem; }
.login-input-group { display: flex; flex-direction: column; gap: 0.35rem; }
.login-input-group label { font-size: 0.8125rem; font-weight: 600; color: #374151; }
.login-input-group input { height: 44px; border: 1px solid var(--blue-100); border-radius: 10px; padding: 0 0.8rem; background: var(--blue-50); color: var(--text-main); font-size: 0.8125rem; outline: none; direction: rtl; transition: all 0.2s; font-family: 'Cairo', sans-serif; }
.login-input-group input:focus { border-color: var(--blue-primary); background: white; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.login-submit { height: 44px; background: linear-gradient(135deg, var(--blue-primary), var(--blue-dark)); color: white; border: none; border-radius: 10px; font-size: 0.9rem; font-weight: 700; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 0.5rem; font-family: 'Cairo', sans-serif; }
.login-submit:hover { background: linear-gradient(135deg, var(--blue-dark), var(--blue-darker)); box-shadow: 0 6px 20px rgba(37,99,235,0.38); transform: translateY(-1px); }
.login-error { padding: 0.65rem 0.875rem; border-radius: 8px; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-size: 0.75rem; }
.login-credit { font-size: 0.73rem; color: var(--blue-primary); text-align: center; font-weight: 700; }

/* ---- CAPTIVE PORTAL ---- */
.portal-page { min-height: 100vh; background: linear-gradient(135deg, var(--sidebar-from), #1a3a7c, var(--blue-primary)); display: flex; align-items: center; justify-content: center; padding: 1rem; direction: rtl; font-family: 'Cairo', sans-serif; position: relative; overflow: hidden; }
.portal-page::before, .portal-page::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; animation: floatSoft 11s ease-in-out infinite; opacity: 0.28; }
.portal-page::before { width: 220px; height: 220px; top: 10%; right: 8%; background: radial-gradient(circle, rgba(255,255,255,0.28), transparent 72%); }
.portal-page::after { width: 300px; height: 300px; bottom: -10%; left: -4%; background: radial-gradient(circle, rgba(56,189,248,0.32), transparent 74%); animation-delay: -3s; }
.portal-card { background: white; border-radius: 24px; width: 100%; max-width: 420px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,0.3); animation: entranceUp 0.7s ease both; }
.portal-header { background: linear-gradient(135deg, var(--sky-400), var(--blue-primary)); padding: 2rem 1.75rem 1.5rem; text-align: center; color: white; }
.portal-logo { width: 64px; height: 64px; background: #072330; border-radius: 16px; margin: 0 auto 1rem; display: flex; align-items: center; justify-content: center; }
.portal-logo img { width: 44px; height: 44px; object-fit: contain; }
.portal-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 0.25rem; }
.portal-subtitle { font-size: 0.8125rem; opacity: 0.88; }
.portal-body { padding: 1.75rem; }
.portal-input-group { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.875rem; }
.portal-input-group label { font-size: 0.8125rem; font-weight: 600; color: #374151; }
.portal-input { width: 100%; height: 46px; border: 2px solid var(--blue-100); border-radius: 12px; padding: 0 0.875rem; font-size: 0.9rem; font-family: 'Cairo', sans-serif; color: var(--text-main); direction: rtl; outline: none; transition: all 0.2s; background: var(--blue-50); }
.portal-input:focus { border-color: var(--blue-primary); background: white; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.portal-submit { width: 100%; height: 50px; background: linear-gradient(135deg, var(--sky-400), var(--blue-primary)); color: white; border: none; border-radius: 12px; font-size: 1rem; font-weight: 700; cursor: pointer; font-family: 'Cairo', sans-serif; transition: all 0.2s; margin-top: 0.5rem; }
.portal-submit:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(37,99,235,0.38); }
.portal-footer { padding: 1rem 1.75rem; border-top: 1px solid var(--blue-100); text-align: center; font-size: 0.72rem; color: var(--text-muted); }
.consent-check { display: flex; align-items: flex-start; gap: 0.5rem; margin-bottom: 0.75rem; }
.consent-check input { margin-top: 3px; accent-color: var(--blue-primary); }
.consent-check label { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; }
.consent-check-required label { color: var(--text-main); font-weight: 600; }
.consent-required-label { display: inline-flex; margin-right: 0.35rem; padding: 0.12rem 0.45rem; border-radius: 999px; background: rgba(37,99,235,0.1); color: var(--blue-dark); font-size: 0.65rem; font-weight: 700; }
.ad-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; }
.ad-skip-btn { padding: 0.5rem 1.25rem; background: white; border-radius: 999px; font-size: 0.8125rem; font-weight: 700; color: var(--text-main); border: none; cursor: pointer; font-family: 'Cairo', sans-serif; }

/* ---- ANIMATIONS ---- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes entranceUp { from { opacity: 0; transform: translateY(24px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes floatSoft { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -14px, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(16,185,129,0.22); } 50% { box-shadow: 0 0 0 6px rgba(16,185,129,0.1); } }
.page-container > *,
.stats-grid > *,
.overview-grid > *,
.overview-grid-3 > *,
.quick-actions > *,
.grid-2 > *,
.grid-3 > *,
.table-container,
.card,
.login-form-card > *,
.portal-body > * {
  animation: entranceUp 0.55s ease both;
}
.page-container > *:nth-child(2),
.stats-grid > *:nth-child(2),
.grid-2 > *:nth-child(2),
.grid-3 > *:nth-child(2),
.quick-actions > *:nth-child(2) { animation-delay: 0.05s; }
.page-container > *:nth-child(3),
.stats-grid > *:nth-child(3),
.grid-2 > *:nth-child(3),
.grid-3 > *:nth-child(3),
.quick-actions > *:nth-child(3) { animation-delay: 0.1s; }
.page-container > *:nth-child(4),
.stats-grid > *:nth-child(4),
.grid-2 > *:nth-child(4),
.grid-3 > *:nth-child(4),
.quick-actions > *:nth-child(4) { animation-delay: 0.15s; }
.table tbody tr { animation: entranceUp 0.45s ease both; }
.table tbody tr:nth-child(2) { animation-delay: 0.05s; }
.table tbody tr:nth-child(3) { animation-delay: 0.1s; }
.table tbody tr:nth-child(4) { animation-delay: 0.15s; }

/* ---- NOTIFICATIONS ---- */
.flash-msg { position: fixed; top: 1.25rem; right: 1.5rem; z-index: 3000; max-width: 340px; animation: slideDown 0.25s ease; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .mobile-menu-btn { display: flex; }
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-right: 0; }
  .search-container { width: 240px; }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .login-container { grid-template-columns: 1fr; }
  .login-hero { display: none; }
}
@media (max-width: 768px) {
  .header { padding: 0 1rem; }
  .search-container { display: none; }
  .page-container { padding: 0.875rem 1rem; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .overview-grid-3 { grid-template-columns: 1fr; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 1.25rem; }
  .status-pill { width: 100%; justify-content: center; }
}
