/* ============================================================
   CarePro — Design System
   Arabic RTL · Professional · Modern
   ============================================================ */

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

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --primary:       #1B4F72;
  --primary-dark:  #154360;
  --primary-light: #2980B9;
  --accent:        #1ABC9C;
  --accent-dark:   #17A589;
  --accent-light:  #A9DFBF;

  --sidebar-bg:    #0F2A44;
  --sidebar-w:     265px;
  --topbar-h:      64px;

  --success:   #27AE60;
  --danger:    #E74C3C;
  --warning:   #F39C12;
  --info:      #2980B9;
  --secondary: #95A5A6;

  --bg:        #F0F4F8;
  --bg-card:   #FFFFFF;
  --border:    #E2E8F0;
  --text:      #2C3E50;
  --text-muted:#718096;
  --text-light:#A0AEC0;

  --shadow-sm: 0 1px 4px rgba(0,0,0,.07);
  --shadow:    0 2px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.15);

  --radius:    10px;
  --radius-sm: 6px;
  --radius-lg: 16px;

  --font:      'Cairo', 'Tajawal', sans-serif;
  --transition: .2s ease;
}

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

html { direction: rtl; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #C5D3E0; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ── Layout ────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--sidebar-bg);
  position: fixed;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  text-decoration: none;
  min-height: var(--topbar-h);
}

.sidebar-brand-logo {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  flex-shrink: 0;
}

.sidebar-brand-text {
  color: white;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .5px;
}

.sidebar-brand-sub {
  color: rgba(255,255,255,.45);
  font-size: 11px;
  font-weight: 400;
  display: block;
  margin-top: -2px;
}

.sidebar-nav {
  padding: 16px 0;
  overflow-y: auto;
  flex: 1;
}

.nav-section {
  padding: 6px 20px 4px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,.3);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 8px;
}

.nav-item { display: block; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  border-radius: 0;
  transition: all var(--transition);
  font-size: 13.5px;
  font-weight: 500;
  position: relative;
}

.nav-link:hover {
  color: white;
  background: rgba(255,255,255,.07);
}

.nav-link.active {
  color: white;
  background: var(--primary);
  font-weight: 600;
}

.nav-link.active::before {
  content: '';
  position: absolute;
  right: 0;
  top: 4px;
  bottom: 4px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.nav-link .nav-icon {
  width: 20px;
  font-size: 16px;
  text-align: center;
  flex-shrink: 0;
  opacity: .8;
}

.nav-link.active .nav-icon { opacity: 1; }

.nav-badge {
  margin-right: auto;
  background: var(--accent);
  color: white;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 20px;
  font-weight: 700;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,.15);
}

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

.sidebar-user-name {
  color: white;
  font-size: 13px;
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  color: rgba(255,255,255,.4);
  font-size: 11px;
}

/* ── Main Content ──────────────────────────────────────────── */
.main-content {
  margin-right: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: var(--shadow-sm);
}

.topbar-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.topbar-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

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

.topbar-btn {
  width: 38px;
  height: 38px;
  border: none;
  background: var(--bg);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  font-size: 16px;
  text-decoration: none;
}

.topbar-btn:hover {
  background: var(--primary);
  color: white;
}

.notif-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 16px;
  height: 16px;
  background: var(--danger);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

.topbar-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
}

/* ── Page Body ─────────────────────────────────────────────── */
.page-body {
  padding: 28px;
  flex: 1;
}

/* ── Page Header ───────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header-info h1 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 2px;
}

.page-header-info p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

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

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

.card-title i {
  color: var(--primary-light);
  font-size: 16px;
}

.card-body { padding: 20px; }

.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: #FAFBFC;
}

/* ── Stat Cards ────────────────────────────────────────────── */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: var(--stat-color, var(--primary));
  border-radius: 0 var(--radius) var(--radius) 0;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: white;
  flex-shrink: 0;
  background: var(--stat-color, var(--primary));
}

.stat-info { flex: 1; min-width: 0; }
.stat-label { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.2; }
.stat-change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.stat-change.up   { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── Tables ────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
}

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

.table th {
  background: #F7F9FB;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

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

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

.table tbody tr:hover { background: #F7FAFE; }

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

/* ── Badges ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  gap: 4px;
}

.badge.bg-success  { background: rgba(39,174,96,.12)  !important; color: #1A7A42  !important; }
.badge.bg-danger   { background: rgba(231,76,60,.12)  !important; color: #C0392B  !important; }
.badge.bg-warning  { background: rgba(243,156,18,.12) !important; color: #B7770D  !important; }
.badge.bg-info     { background: rgba(41,128,185,.12) !important; color: #1A6FA0  !important; }
.badge.bg-primary  { background: rgba(27,79,114,.12)  !important; color: #154360  !important; }
.badge.bg-secondary{ background: rgba(149,165,166,.15)!important; color: #566573  !important; }
.badge.bg-dark     { background: rgba(44,62,80,.12)   !important; color: #2C3E50  !important; }

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13.5px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-dark); color: white; }

.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:hover { background: var(--accent-dark); color: white; }

.btn-outline-primary {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: white;
}

.btn-outline-secondary {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
}
.btn-outline-secondary:hover {
  background: var(--bg);
  color: var(--text);
}

.btn-danger  { background: var(--danger);  color: white; }
.btn-success { background: var(--success); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-info    { background: var(--info);    color: white; }

.btn-sm { padding: 6px 13px; font-size: 12.5px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

.btn-icon {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

/* ── Forms ─────────────────────────────────────────────────── */
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  display: block;
}

.form-control, .form-select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13.5px;
  color: var(--text);
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  direction: rtl;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27,79,114,.1);
}

.form-control::placeholder { color: var(--text-light); }

.form-control.is-invalid { border-color: var(--danger); }
.invalid-feedback { color: var(--danger); font-size: 12px; margin-top: 4px; }

.form-group { margin-bottom: 18px; }

.input-group {
  display: flex;
  gap: 0;
}

.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .input-group-text {
  padding: 10px 14px;
  background: #F0F4F8;
  border: 1.5px solid var(--border);
  border-right: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* ── Alert / Flash ─────────────────────────────────────────── */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  border: none;
}

.alert-success { background: rgba(39,174,96,.12);  color: #1A7A42; }
.alert-danger  { background: rgba(231,76,60,.12);  color: #C0392B; }
.alert-warning { background: rgba(243,156,18,.12); color: #B7770D; }
.alert-info    { background: rgba(41,128,185,.12); color: #1A6FA0; }

.alert i { font-size: 18px; }

/* ── Modals ────────────────────────────────────────────────── */
.modal-dialog { margin: 1.75rem auto; }
.modal-content {
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  direction: rtl;
}
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-title { color: white; font-weight: 700; font-size: 16px; }
.modal-body  { padding: 24px; }
.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid var(--border);
  gap: 10px;
}
.btn-close-white { filter: invert(1); }

/* ── Filters Bar ───────────────────────────────────────────── */
.filters-bar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}

.filters-bar .form-group { margin-bottom: 0; flex: 1; min-width: 150px; }

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state i { font-size: 56px; opacity: .3; margin-bottom: 16px; display: block; }
.empty-state h4 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.empty-state p  { font-size: 13px; }

/* ── Unit Card ─────────────────────────────────────────────── */
.unit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}
.unit-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.unit-card .unit-status {
  position: absolute;
  top: 14px;
  left: 14px;
}
.unit-number { font-size: 18px; font-weight: 800; color: var(--primary); }
.unit-type   { font-size: 12px; color: var(--text-muted); }

/* ── Timeline ──────────────────────────────────────────────── */
.timeline { position: relative; padding-right: 28px; }
.timeline::before {
  content: '';
  position: absolute;
  right: 9px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-item {
  position: relative;
  padding-bottom: 20px;
}
.timeline-dot {
  position: absolute;
  right: -28px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid white;
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-content {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
}

/* ── Setup Wizard ──────────────────────────────────────────── */
.wizard-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.wizard-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  width: 100%;
  max-width: 700px;
  overflow: hidden;
}

.wizard-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  padding: 30px 36px;
  text-align: center;
  color: white;
}

.wizard-logo {
  width: 64px;
  height: 64px;
  background: rgba(255,255,255,.15);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 16px;
  backdrop-filter: blur(10px);
}

.wizard-header h1 { font-size: 26px; font-weight: 800; }
.wizard-header p  { opacity: .75; font-size: 14px; margin-top: 6px; }

.wizard-steps {
  display: flex;
  gap: 0;
  background: #F7F9FB;
  border-bottom: 1px solid var(--border);
}

.wizard-step {
  flex: 1;
  padding: 14px 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
}

.wizard-step.active { color: var(--primary); }
.wizard-step.done   { color: var(--success); }

.wizard-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.wizard-step.active .wizard-step-num { background: var(--primary); color: white; }
.wizard-step.done   .wizard-step-num { background: var(--success); color: white; }

.wizard-body { padding: 36px; }
.wizard-footer {
  padding: 20px 36px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  background: #F7F9FB;
}

/* ── Auth Pages ────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--primary-dark) 50%, var(--primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.auth-wrapper::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: rgba(255,255,255,.03);
  border-radius: 50%;
  top: -200px;
  right: -200px;
}

.auth-wrapper::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: rgba(26,188,156,.08);
  border-radius: 50%;
  bottom: -100px;
  left: -100px;
}

.auth-card {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  width: 100%;
  max-width: 440px;
  padding: 44px 40px;
  position: relative;
  z-index: 1;
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: white;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(27,79,114,.4);
}

.auth-logo h1 { font-size: 24px; font-weight: 800; color: var(--text); }
.auth-logo p  { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.auth-divider {
  text-align: center;
  position: relative;
  margin: 20px 0;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.auth-divider span {
  position: relative;
  background: white;
  padding: 0 12px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ── Avatar ────────────────────────────────────────────────── */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 56px; height: 56px; }
.avatar-xl { width: 80px; height: 80px; }

/* ── Progress ──────────────────────────────────────────────── */
.progress {
  height: 8px;
  border-radius: 10px;
  background: var(--border);
  overflow: hidden;
}
.progress-bar {
  border-radius: 10px;
  transition: width .6s ease;
}

/* ── Quick Actions ─────────────────────────────────────────── */
.quick-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  background: var(--bg);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  border: 1px solid transparent;
  text-align: center;
}
.quick-action:hover {
  background: rgba(27,79,114,.07);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-2px);
}
.quick-action-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.quick-action span { font-size: 12.5px; font-weight: 600; }

/* ── Notifications Dropdown ────────────────────────────────── */
.notif-dropdown {
  width: 360px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.notif-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 14px;
}
.notif-item {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: background var(--transition);
  cursor: pointer;
}
.notif-item:hover  { background: var(--bg); }
.notif-item.unread { background: rgba(27,79,114,.04); }
.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.notif-text { font-size: 13px; font-weight: 600; }
.notif-sub  { font-size: 11.5px; color: var(--text-muted); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(100%);
    right: 0;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-right: 0;
  }
  .sidebar-toggle {
    display: flex;
  }
  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 999;
  }
  .sidebar-overlay.show { display: block; }
}

@media (max-width: 768px) {
  .page-body { padding: 16px; }
  .topbar { padding: 0 16px; }
  .stat-value { font-size: 20px; }
  .page-header { flex-direction: column; align-items: flex-start; }
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-body > * {
  animation: fadeInUp .3s ease forwards;
}

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

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 0 auto;
}

/* ── Utilities ─────────────────────────────────────────────── */
.text-primary-cp { color: var(--primary); }
.text-accent    { color: var(--accent); }
.text-muted-cp  { color: var(--text-muted); }
.bg-primary-cp  { background: var(--primary); }
.bg-accent      { background: var(--accent); }
.fw-800 { font-weight: 800; }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }
.gap-2  { gap: 8px; }
.gap-3  { gap: 12px; }

/* ── Custom Scrollbar in Sidebar ───────────────────────────── */
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); }

/* ── Dropdown Menu ─────────────────────────────────────────── */
.dropdown-menu {
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  padding: 6px;
  font-size: 13.5px;
  direction: rtl;
}
.dropdown-item {
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.dropdown-item:hover { background: var(--bg); color: var(--primary); }
.dropdown-divider { border-color: var(--border); margin: 4px 0; }

/* ── Search ────────────────────────────────────────────────── */
.search-box {
  position: relative;
  flex: 1;
  max-width: 360px;
}
.search-box input {
  padding-right: 42px;
  background: var(--bg);
  border-color: transparent;
}
.search-box input:focus { background: white; border-color: var(--primary); }
.search-box i {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
}

/* ── Nav Sub Menu ──────────────────────────────────────────── */
.nav-sub { display: none; }
.nav-sub.show { display: block; }
.nav-sub .nav-link {
  padding-right: 56px;
  font-size: 13px;
}
.nav-link .nav-arrow {
  margin-right: auto;
  transition: transform var(--transition);
  font-size: 12px;
  opacity: .5;
}
.nav-link.has-sub.open .nav-arrow { transform: rotate(-90deg); }

/* ── Overrides Bootstrap 5 RTL ─────────────────────────────── */
.me-auto { margin-left: auto !important; margin-right: 0 !important; }
.ms-auto { margin-right: auto !important; margin-left: 0 !important; }


/* ── Sidebar Accordion Menu (+ / -) ──────────────────────── */
.nav-group {
  margin: 8px 12px 0;
  border: 1px solid rgba(255,255,255,.05);
  border-radius: 14px;
  background: rgba(255,255,255,.03);
  overflow: hidden;
}

.nav-group:first-of-type {
  margin-top: 14px;
}

.nav-group summary {
  list-style: none;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  color: rgba(255,255,255,.88);
  user-select: none;
  transition: background var(--transition), color var(--transition);
}

.nav-group-toggle:hover {
  background: rgba(255,255,255,.05);
}

.nav-group[open] .nav-group-toggle {
  background: rgba(255,255,255,.07);
}

.nav-group-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-group-icon {
  width: 18px;
  text-align: center;
  color: rgba(255,255,255,.9);
  flex-shrink: 0;
}

.nav-group-title {
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(255,255,255,.88);
}

.nav-group-sign {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.08);
  color: white;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}

.nav-group-sign::before {
  content: '+';
  font-size: 16px;
}

.nav-group[open] .nav-group-sign::before {
  content: '−';
  font-size: 18px;
}

.nav-group-menu {
  padding: 6px 8px 10px;
  border-top: 1px solid rgba(255,255,255,.05);
}

.nav-link-sub {
  padding: 9px 12px;
  border-radius: 10px;
  margin: 4px 0;
  font-size: 13px;
}

.nav-link-sub.active::before {
  width: 0;
}

.nav-link-sub.active {
  background: rgba(21,101,192,.95);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08);
}

.nav-link-sub .nav-icon {
  width: 18px;
  font-size: 15px;
}

.nav-section {
  display: none;
}
