/* ══════════════════════════════════════════════════════════════
   Law Office Management System — Main Stylesheet
   Direction: RTL | Font: Cairo | Theme: Legal Dark Gold
   ══════════════════════════════════════════════════════════════ */

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

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --primary:        #1B3A6B;
  --primary-dark:   #122A52;
  --primary-light:  #2B5BA8;
  --gold:           #C9A84C;
  --gold-light:     #E8C97A;
  --gold-dark:      #A07C2A;
  --sidebar-bg:     #0F1F3D;
  --sidebar-hover:  #1B3A6B;
  --sidebar-active: #C9A84C;
  --sidebar-text:   #B8C8E0;
  --sidebar-width:  260px;
  --topbar-height:  64px;
  --bg:             #F0F4F8;
  --card-bg:        #FFFFFF;
  --border:         #E2E8F0;
  --text:           #1A2B4A;
  --text-muted:     #64748B;
  --text-light:     #94A3B8;
  --success:        #10B981;
  --danger:         #EF4444;
  --warning:        #F59E0B;
  --info:           #3B82F6;
  --secondary:      #6B7280;
  --dark:           #1F2937;
  --radius:         10px;
  --radius-sm:      6px;
  --radius-lg:      16px;
  --shadow-sm:      0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:         0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:      0 10px 25px rgba(0,0,0,.1), 0 4px 10px rgba(0,0,0,.08);
  --transition:     all .2s ease;
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Cairo', sans-serif;
  direction: rtl;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--gold); }

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

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

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform .3s ease;
  border-left: 1px solid rgba(201,168,76,.15);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(201,168,76,.3); border-radius: 4px; }

.sidebar-logo {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--topbar-height);
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(201,168,76,.4);
}

.sidebar-logo-text { flex: 1; min-width: 0; }
.sidebar-logo-text strong {
  display: block;
  color: #fff;
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.3;
}
.sidebar-logo-text span {
  color: var(--gold);
  font-size: .72rem;
  font-weight: 500;
}

.sidebar-section-label {
  padding: 20px 20px 6px;
  color: rgba(255,255,255,.3);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sidebar-nav { padding: 8px 12px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: .9rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

.nav-item:hover {
  background: rgba(255,255,255,.07);
  color: #fff;
}

.nav-item.active {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: #1a1a1a;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(201,168,76,.35);
}

.nav-item.active .nav-icon { color: #1a1a1a; }

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.nav-badge {
  margin-right: auto;
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 20px;
  text-align: center;
}

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

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-user:hover { background: rgba(255,255,255,.07); }

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--gold));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-info strong { display: block; color: #fff; font-size: .85rem; font-weight: 600; truncate: ellipsis; white-space: nowrap; overflow: hidden; }
.user-info span { color: var(--gold); font-size: .72rem; }

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

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

.topbar-title { font-size: 1.05rem; font-weight: 700; color: var(--text); flex: 1; }
.topbar-subtitle { font-size: .8rem; color: var(--text-muted); font-weight: 400; }

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

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

.topbar-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

.notif-dot {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--card-bg);
}

/* ── Page Content ─────────────────────────────────────────── */
.page-content {
  padding: 24px;
  flex: 1;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
}

.page-header h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
}

.page-header .breadcrumb {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.page-header .breadcrumb a { color: var(--text-muted); }
.page-header .breadcrumb a:hover { color: var(--primary); }

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  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: var(--card-bg);
}

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

.card-body { padding: 20px; }
.card-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: rgba(240,244,248,.5);
}

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 24px; }

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

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

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

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: var(--stat-bg, rgba(27,58,107,.1));
  color: var(--stat-color, var(--primary));
  flex-shrink: 0;
}

.stat-info { flex: 1; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: .8rem; color: var(--text-muted); font-weight: 500; margin-top: 4px; }
.stat-change { font-size: .75rem; font-weight: 600; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: 'Cairo', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-gold { background: var(--gold); color: #1a1a1a; border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-dark); color: #1a1a1a; }

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #059669; color: #fff; }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #DC2626; color: #fff; }

.btn-warning { background: var(--warning); color: #1a1a1a; border-color: var(--warning); }
.btn-warning:hover { background: #D97706; color: #1a1a1a; }

.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }

.btn-outline-primary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 24px; font-size: 1rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-label .req { color: var(--danger); margin-right: 2px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Cairo', sans-serif;
  font-size: .9rem;
  color: var(--text);
  background: var(--card-bg);
  transition: var(--transition);
  direction: rtl;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27,58,107,.12);
}

.form-control::placeholder { color: var(--text-light); }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

.form-text { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: .78rem; color: var(--danger); margin-top: 4px; }
.form-control.is-invalid { border-color: var(--danger); }

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

/* ── Tables ───────────────────────────────────────────────── */
.table-container { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}

.table thead tr {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.table thead th {
  padding: 12px 16px;
  color: #fff;
  font-weight: 600;
  font-size: .82rem;
  white-space: nowrap;
  text-align: right;
}

.table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.table tbody tr:hover { background: rgba(27,58,107,.04); }
.table tbody tr:last-child { border-bottom: none; }

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

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

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
}

.badge-primary   { background: rgba(27,58,107,.12);  color: var(--primary); }
.badge-success   { background: rgba(16,185,129,.12); color: #059669; }
.badge-danger    { background: rgba(239,68,68,.12);  color: #DC2626; }
.badge-warning   { background: rgba(245,158,11,.12); color: #D97706; }
.badge-info      { background: rgba(59,130,246,.12); color: #2563EB; }
.badge-secondary { background: rgba(107,114,128,.1); color: var(--secondary); }
.badge-dark      { background: rgba(31,41,55,.1);    color: var(--dark); }
.badge-gold      { background: rgba(201,168,76,.15); color: var(--gold-dark); }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: .88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
}

.alert-success { background: rgba(16,185,129,.1);  color: #065f46; border-color: rgba(16,185,129,.2); }
.alert-danger  { background: rgba(239,68,68,.1);   color: #991b1b; border-color: rgba(239,68,68,.2); }
.alert-warning { background: rgba(245,158,11,.1);  color: #92400e; border-color: rgba(245,158,11,.2); }
.alert-info    { background: rgba(59,130,246,.1);  color: #1e40af; border-color: rgba(59,130,246,.2); }

/* ── Pagination ───────────────────────────────────────────── */
.pagination { display: flex; gap: 4px; align-items: center; }

.page-link {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.page-link:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-link.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-link.disabled { opacity: .4; cursor: not-allowed; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: scale(.95);
  transition: transform .2s ease;
}

.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: none;
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: var(--transition);
}
.modal-close:hover { background: var(--danger); color: #fff; }

.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── Timeline ─────────────────────────────────────────────── */
.timeline { position: relative; padding: 8px 0; }
.timeline::before {
  content: '';
  position: absolute;
  right: 28px;
  top: 0; bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  position: relative;
}

.timeline-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-sm);
}

.timeline-content {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  flex: 1;
  box-shadow: var(--shadow-sm);
}

.timeline-content h4 { font-size: .9rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.timeline-content p  { font-size: .82rem; color: var(--text-muted); }
.timeline-time { font-size: .75rem; color: var(--text-light); margin-top: 6px; }

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

.search-input-wrap { position: relative; flex: 1; min-width: 200px; }
.search-input-wrap .search-icon {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.search-input-wrap .form-control { padding-right: 38px; }

/* ── Tags ─────────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 600;
  background: rgba(27,58,107,.1);
  color: var(--primary);
  margin: 2px;
}

.tag-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.tag-remove { cursor: pointer; font-size: 12px; opacity: .7; }
.tag-remove:hover { opacity: 1; color: var(--danger); }

/* ── Dashboard Widgets ────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.dashboard-grid .span-2 { grid-column: span 2; }
.dashboard-grid .span-3 { grid-column: span 3; }

.mini-chart { height: 200px; position: relative; overflow: hidden; }

/* Calendar widget */
.session-calendar .session-day {
  padding: 8px;
  text-align: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: .82rem;
  transition: var(--transition);
}

.session-day:hover { background: var(--bg); }
.session-day.has-session { background: rgba(201,168,76,.15); color: var(--gold-dark); font-weight: 700; }
.session-day.today { background: var(--primary); color: #fff; font-weight: 700; }

/* Activity feed */
.activity-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 6px;
}

/* ── Auth Layout ──────────────────────────────────────────── */
.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 80% 20%, rgba(201,168,76,.15) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgba(27,58,107,.2)   0%, transparent 50%),
    linear-gradient(135deg, #0F1F3D 0%, #1B3A6B 50%, #0F1F3D 100%);
  padding: 20px;
}

.auth-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 60px rgba(0,0,0,.3);
  border: 1px solid rgba(201,168,76,.2);
}

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

.auth-logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px rgba(201,168,76,.4);
}

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

/* ── Dropdown ─────────────────────────────────────────────── */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 200px;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: var(--transition);
  overflow: hidden;
}

.dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text);
  font-size: .88rem;
  transition: var(--transition);
  cursor: pointer;
}

.dropdown-item:hover { background: var(--bg); color: var(--primary); }
.dropdown-item.danger:hover { background: rgba(239,68,68,.08); color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Tabs ─────────────────────────────────────────────────── */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }

.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  font-family: 'Cairo', sans-serif;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0; right: 0;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: var(--transition);
}

.tab-btn:hover { color: var(--primary); }
.tab-btn.active { color: var(--primary); }
.tab-btn.active::after { transform: scaleX(1); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: .5; }
.empty-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.empty-text { font-size: .85rem; margin-bottom: 20px; }

/* ── Print ────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .topbar-actions, .table-actions, .btn, .filter-bar { display: none !important; }
  .main-content { margin-right: 0 !important; }
  .page-content { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-right: 0; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid .span-2 { grid-column: span 1; }
  .form-row.cols-2, .form-row.cols-3 { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
}

/* ── Animations ───────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse  { 0%,100% { opacity: 1; } 50% { opacity: .5; } }
@keyframes spin   { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.fade-in   { animation: fadeIn .3s ease forwards; }
.animate-pulse { animation: pulse 2s infinite; }
.spinner   { animation: spin 1s linear infinite; }

/* ── Utilities ────────────────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-gold    { color: var(--gold); }
.text-sm      { font-size: .82rem; }
.text-xs      { font-size: .72rem; }
.fw-700       { font-weight: 700; }
.fw-600       { font-weight: 600; }
.d-flex       { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8        { gap: 8px; }
.gap-12       { gap: 12px; }
.gap-16       { gap: 16px; }
.mt-8         { margin-top: 8px; }
.mt-16        { margin-top: 16px; }
.mt-24        { margin-top: 24px; }
.mb-8         { margin-bottom: 8px; }
.mb-16        { margin-bottom: 16px; }
.mb-24        { margin-bottom: 24px; }
.p-16         { padding: 16px; }
.p-20         { padding: 20px; }
.w-100        { width: 100%; }
.text-center  { text-align: center; }
.text-end     { text-align: left; } /* RTL */
.nowrap       { white-space: nowrap; }
.truncate     { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hidden       { display: none !important; }
.visible      { display: block !important; }
.rounded      { border-radius: var(--radius); }
.rounded-sm   { border-radius: var(--radius-sm); }
.rounded-full { border-radius: 50%; }
.shadow       { box-shadow: var(--shadow); }
.shadow-sm    { box-shadow: var(--shadow-sm); }
.border       { border: 1px solid var(--border); }
.bg-white     { background: var(--card-bg); }
.bg-light     { background: var(--bg); }
