/* ══════════════════════════════════════════════════════
   EventHub – Global Design System
   ══════════════════════════════════════════════════════ */

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

/* ── Variables ───────────────────────────────────────── */
:root {
  --bg-dark:       #0d1117;
  --bg-card:       #161b22;
  --bg-sidebar:    #0d1117;
  --border:        rgba(255,255,255,0.08);
  --accent:        #6e40f2;
  --accent-hover:  #5a32d8;
  --accent2:       #22d3ee;
  --success:       #22c55e;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --text-primary:  #e6edf3;
  --text-muted:    #7d8590;
  --sidebar-w:     240px;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 4px 24px rgba(0,0,0,.4);
}

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

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

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

/* ── Global Custom Scrollbar ─────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb {
  background: rgba(110, 64, 242, 0.4);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(34, 211, 238, 0.6);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(110, 64, 242, 0.4) rgba(0, 0, 0, 0.1);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

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

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  padding: 0 0 24px;
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 18px;
}

.sidebar-logo span {
  font-weight: 700;
  font-size: 1.1rem;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

img[src*="logo.png"] {
  background: transparent !important;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 12px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .18s;
  border: 1px solid transparent;
}

.nav-item:hover {
  background: rgba(110,64,242,.12);
  color: var(--accent);
  border-color: rgba(110,64,242,.2);
}

.nav-item.active {
  background: rgba(110,64,242,.18);
  color: #fff;
  border-color: rgba(110,64,242,.35);
}

.nav-item .nav-icon { font-size: 1rem; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
}

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

.sidebar-user:hover { background: var(--bg-card); }

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: grid; place-items: center;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: .82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .7rem; color: var(--text-muted); }

/* ── Main Content ────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px 32px;
  min-height: 100vh;
}

/* ── Topbar ──────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
}

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

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

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

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

.card-title { font-size: 1rem; font-weight: 600; }

/* ── Stats Grid ──────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}

.stat-label { font-size: .78rem; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 2rem; font-weight: 800; margin: 8px 0 4px; }
.stat-icon { font-size: 1.6rem; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); opacity: .2; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  border: none;
  outline: none;
  font-family: inherit;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(110,64,242,.4); }

.btn-success { background: rgba(34,197,94,.15); color: var(--success); border: 1px solid rgba(34,197,94,.3); }
.btn-success:hover { background: rgba(34,197,94,.25); }

.btn-danger { background: rgba(239,68,68,.15); color: var(--danger); border: 1px solid rgba(239,68,68,.3); }
.btn-danger:hover { background: rgba(239,68,68,.25); }

.btn-warning { background: rgba(245,158,11,.15); color: var(--warning); border: 1px solid rgba(245,158,11,.3); }
.btn-warning:hover { background: rgba(245,158,11,.25); }

.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); }

.btn-sm { padding: 5px 12px; font-size: .78rem; }
.btn-logout { background: rgba(239,68,68,.12); color: var(--danger); border: 1px solid rgba(239,68,68,.2); width: 100%; justify-content: center; margin-top: 6px; }

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

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

thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: middle;
}

tbody tr:hover { background: rgba(255,255,255,.02); }
tbody tr:last-child td { border-bottom: none; }

/* ── Badges ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-pending  { background: rgba(245,158,11,.15); color: var(--warning); }
.badge-approved { background: rgba(34,197,94,.15);  color: var(--success); }
.badge-rejected { background: rgba(239,68,68,.15);  color: var(--danger); }
.badge-accepted { background: rgba(34,197,94,.15);  color: var(--success); }
.badge-used     { background: rgba(110,64,242,.15); color: #a78bfa; }
.badge-unused   { background: rgba(255,255,255,.08); color: var(--text-muted); }
.badge-negotiating { background: rgba(34,211,238,.15); color: var(--accent2); border: 1px solid rgba(34,211,238,.25); }
.badge-cancelled { background: rgba(239,68,68,.1); color: #ef4444; border: 1px solid rgba(239,68,68,.15); }
.badge-pending-cancellation { background: rgba(245,158,11,.1); color: #f59e0b; border: 1px solid rgba(245,158,11,.2); }

.badge-upcoming { background: rgba(34,211,238,.15); color: var(--accent2); }
.badge-live     { background: rgba(34,197,94,.25);  color: #fff; box-shadow: 0 0 0 rgba(34,197,94, 0.4); animation: pulseLive 2s infinite; }
.badge-ended    { background: rgba(255,255,255,.05); color: var(--text-muted); opacity: 0.8; }
@keyframes pulseLive { 0% { box-shadow: 0 0 0 0 rgba(34,197,94, 0.4); } 70% { box-shadow: 0 0 0 5px rgba(34,197,94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94, 0); } }

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 600;
}

.role-admin   { background: rgba(239,68,68,.15); color: var(--danger); }
.role-manager { background: rgba(110,64,242,.15); color: #a78bfa; }
.role-sponsor { background: rgba(34,211,238,.15); color: var(--accent2); }
.role-company { background: rgba(59,130,246,.15); color: #60a5fa; }
.role-user    { background: rgba(34,197,94,.15); color: var(--success); }
.role-assistant { background: rgba(245,158,11,.15); color: var(--warning); }

/* ── Forms ───────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.form-control {
  width: 100%;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: .9rem;
  font-family: inherit;
  transition: border-color .18s, background .18s;
  outline: none;
}

.form-control:focus {
  border-color: var(--accent);
  background: rgba(110,64,242,.06);
}

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

textarea.form-control { resize: vertical; min-height: 90px; }

select.form-control option { background: var(--bg-card); }

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

/* ── Modal ───────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  z-index: 999;
  opacity: 0; pointer-events: none;
  transition: opacity .22s;
}

.modal-overlay.open { opacity: 1; pointer-events: all; }


.modal {
  background: linear-gradient(135deg, rgba(25,28,36,0.85) 60%, rgba(35,38,58,0.92) 100%);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  padding: 38px 32px 32px 32px;
  width: 100%;
  max-width: 720px;
  min-width: 340px;
  box-shadow: 0 24px 64px 0 rgba(0,0,0,.85), 0 2px 16px 0 rgba(110,64,242,0.10) inset;
  transform: translateY(32px) scale(0.98);
  transition: transform .33s cubic-bezier(.4,1.6,.4,1), box-shadow .33s;
  position: relative;
  backdrop-filter: blur(16px) saturate(1.2);
  border-top: 3.5px solid var(--accent2);
  animation: modalPop .5s cubic-bezier(.4,1.6,.4,1);
  word-break: break-word;
}

@keyframes modalPop {
  0% { opacity: 0; transform: translateY(80px) scale(0.95); }
  80% { opacity: 1; transform: translateY(-8px) scale(1.03); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.modal .event-icon {
  font-size: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--accent2);
  filter: drop-shadow(0 2px 12px #22d3ee55);
  background: linear-gradient(135deg, #6e40f2 30%, #22d3ee 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 12px #22d3ee33;
}

.modal-body.event-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 1.08rem;
  background: rgba(255,255,255,0.01);
  border-radius: 14px;
  box-shadow: 0 2px 16px 0 rgba(110,64,242,0.04) inset;
  padding: 8px 2px 2px 2px;
  word-break: break-word;
}
.event-details-row {
  display: flex;
  flex-direction: row;
  gap: 48px;
  margin-bottom: 10px;
  background: linear-gradient(90deg, rgba(34,211,238,0.10) 0%, rgba(110,64,242,0.10) 100%);
  border-radius: 10px;
  padding: 10px 18px 10px 18px;
  align-items: center;
}
.event-details-row > div {
  flex: 1 1 0;
  min-width: 120px;
  color: #fff;
  font-size: 1.04em;
}
.modal-body.event-details b {
  color: #aeeaff;
  min-width: 110px;
  font-weight: 600;
  letter-spacing: 0.2px;
  font-size: 1.01em;
  white-space: nowrap;
  display: inline-block;
}
.modal-body.event-details span {
  color: #fff;
  font-weight: 400;
  font-size: 1.01em;
}
.modal-body.event-details > div > div > span {
  color: #fff;
  font-weight: 400;
  font-size: 1.01em;
  word-break: break-word;
  white-space: pre-line;
}
.modal-body.event-details h3 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: var(--accent2);
  letter-spacing: 0.7px;
  text-shadow: 0 2px 8px #22d3ee22;
  grid-column: 1 / -1;
}
.modal-body.event-details h3 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 2px;
  color: var(--accent2);
  letter-spacing: 0.7px;
  text-shadow: 0 2px 8px #22d3ee22;
}
.modal-body.event-details .event-status {
  margin-bottom: 6px;
}
.modal-body.event-details div {
  display: flex;
  gap: 10px;
  align-items: baseline;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  padding-bottom: 3px;
}
.modal-body.event-details div:last-child {
  border-bottom: none;
}
.modal-body.event-details b {
  color: var(--accent);
  min-width: 110px;
  font-weight: 600;
  letter-spacing: 0.2px;
  font-size: 1.01em;
}
.modal-body.event-details span {
  color: var(--text-primary);
  font-weight: 400;
  font-size: 1.01em;
}
.modal-close {
  background: linear-gradient(135deg, #23263a 60%, #191c24 100%);
  border: none;
  color: var(--accent2);
  font-size: 1.3rem;
  cursor: pointer;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s, box-shadow .2s;
  box-shadow: 0 2px 8px #22d3ee22;
}
.modal-close:hover {
  background: linear-gradient(135deg, #22d3ee 60%, #6e40f2 100%);
  color: #fff;
  box-shadow: 0 4px 16px #22d3ee55;
}

.modal .event-icon {
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  color: var(--accent);
  filter: drop-shadow(0 2px 8px #6e40f244);
}

.modal-body.event-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 1.01rem;
}
.modal-body.event-details h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--accent2);
  letter-spacing: 0.5px;
}
.modal-body.event-details .event-status {
  margin-bottom: 6px;
}
.modal-body.event-details div {
  display: flex;
  gap: 8px;
  align-items: baseline;
}
.modal-body.event-details b {
  color: var(--text-muted);
  min-width: 90px;
  font-weight: 500;
}
.modal-body.event-details span {
  color: var(--text-primary);
  font-weight: 400;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
}

.modal-title { font-size: 1.1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.2rem; cursor: pointer; }
.modal-close:hover { color: var(--danger); }

.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

/* ── Toast notifications ─────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideUp .25s ease;
  max-width: 320px;
}

.toast-success { background: rgba(34,197,94,.25); border: 1px solid rgba(34,197,94,.4); color: #86efac; }
.toast-error   { background: rgba(239,68,68,.25);  border: 1px solid rgba(239,68,68,.4);  color: #fca5a5; }
.toast-info    { background: rgba(110,64,242,.25); border: 1px solid rgba(110,64,242,.4); color: #c4b5fd; }

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

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

.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; opacity: .5; }
.empty-state p { font-size: .95rem; }

/* ── Loading spinner ─────────────────────────────────── */
.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

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

.loading-row td { text-align: center; padding: 40px; }

/* ── Topbar notification bell ────────────────────────── */
.notif-btn {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 38px; height: 38px;
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  transition: all .18s;
}

.notif-btn:hover { border-color: var(--accent); color: var(--accent); }

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

.notif-count {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 18px; height: 18px;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 700;
  display: grid; place-items: center;
  padding: 0 4px;
  border: 2px solid var(--bg-dark);
  line-height: 1;
}

/* ── Notification Dropdown ──────────────────────────── */
.notif-dropdown {
  position: fixed;
  top: 60px;
  right: 32px;
  width: 380px;
  max-height: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0,0,0,.6), 0 0 0 1px rgba(110,64,242,.08);
  z-index: 9998;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(.97);
  transition: opacity .2s, transform .2s;
}

.notif-dropdown.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

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

.notif-dropdown-title {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.notif-mark-all {
  background: none;
  border: none;
  color: var(--accent);
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .15s;
}

.notif-mark-all:hover {
  background: rgba(110,64,242,.12);
}

.notif-dropdown-body {
  overflow-y: auto;
  max-height: 400px;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,.03);
  cursor: pointer;
  transition: background .15s;
  position: relative;
}

.notif-item:hover {
  background: rgba(110,64,242,.06);
}

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

.notif-item-unread {
  background: rgba(110,64,242,.04);
}

.notif-item-icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  display: grid; place-items: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.notif-item-content {
  flex: 1;
  min-width: 0;
}

.notif-item-title {
  font-size: .82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-item-message {
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notif-item-time {
  font-size: .68rem;
  color: rgba(125,133,144,.7);
  margin-top: 4px;
}

.notif-item-unread-dot {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 8px;
}

.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: .85rem;
}

/* RTL dropdown */
[dir="rtl"] .notif-dropdown {
  right: auto;
  left: 0;
}

[dir="rtl"] .notif-item {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .notif-dropdown-header {
  flex-direction: row-reverse;
}

/* ── Auth page ───────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: var(--bg-dark);
  position: relative;
  overflow: hidden;
}

.auth-bg-glow {
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: .15;
  pointer-events: none;
  background: var(--accent);
  top: -150px; left: -150px;
}

.auth-bg-glow-2 {
  background: var(--accent2);
  top: auto; bottom: -200px;
  right: -200px; left: auto;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  position: relative;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
}

.auth-logo .logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 22px;
}

.auth-logo h1 {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-heading { font-size: 1.25rem; font-weight: 700; margin-bottom: 4px; }
.auth-subheading { font-size: .85rem; color: var(--text-muted); margin-bottom: 28px; }

.auth-footer { text-align: center; margin-top: 20px; font-size: .84rem; color: var(--text-muted); }
.auth-footer a { color: var(--accent); font-weight: 600; }

.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: .95rem; }

/* ── Search bar ──────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  gap: 8px;
  color: var(--text-muted);
}

.search-bar input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: .875rem;
  font-family: inherit;
  width: 220px;
}

.search-bar input::placeholder { color: var(--text-muted); }

/* ── Attendance bar ──────────────────────────────────── */
.progress-bar-bg {
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width .5s ease;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { width: 0; overflow: hidden; }
  .main-content { margin-left: 0; padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .notif-dropdown {
    width: calc(100vw - 32px) !important;
    right: 16px !important;
    left: auto !important;
  }
}

/* ══════════════════════════════════════════════════════
   RTL  –  Arabic layout overrides
   Applied when <html dir="rtl"> is set by i18n.js
   ══════════════════════════════════════════════════════ */

/* Sidebar moves to the RIGHT */
[dir="rtl"] .sidebar {
  left:  auto !important;
  right: 0    !important;
  border-right: none !important;
  border-left: 1px solid var(--border) !important;
}

/* Main content margin flips */
[dir="rtl"] .main-content {
  margin-left:  0                    !important;
  margin-right: var(--sidebar-w)     !important;
}

/* Sidebar internals */
[dir="rtl"] .sidebar-logo   { flex-direction: row-reverse; }
[dir="rtl"] .nav-item       { flex-direction: row-reverse; }
[dir="rtl"] .nav-item .nav-icon { margin-right: 0 !important; margin-left: 10px !important; }
[dir="rtl"] .nav-section-label { text-align: right; }
[dir="rtl"] .sidebar-user   { flex-direction: row-reverse; }
[dir="rtl"] .user-info      { text-align: right; }

/* Topbar */
[dir="rtl"] .topbar         { flex-direction: row-reverse; }
[dir="rtl"] .topbar > div:first-child { text-align: right; }
[dir="rtl"] .topbar-actions { flex-direction: row-reverse; }
[dir="rtl"] .page-title,
[dir="rtl"] .page-subtitle  { text-align: right; }

/* Cards and typography */
[dir="rtl"] .card           { text-align: right; }
[dir="rtl"] .card-header    { flex-direction: row-reverse; }
[dir="rtl"] .stat-icon      { right: auto !important; left: 20px !important; }

/* Tables */
[dir="rtl"] thead th,
[dir="rtl"] tbody td        { text-align: right; }
[dir="rtl"] .table-wrap     { direction: rtl; }

/* Forms */
[dir="rtl"] .form-group     { text-align: right; }
[dir="rtl"] .form-label     { text-align: right; }
[dir="rtl"] .form-control   { text-align: right; direction: rtl; }
[dir="rtl"] .form-control::placeholder { text-align: right; }
[dir="rtl"] .form-grid      { direction: rtl; }

/* Modals */
[dir="rtl"] .modal-header   { flex-direction: row-reverse; }
[dir="rtl"] .modal-body     { text-align: right; direction: rtl; }
[dir="rtl"] .modal-footer   { flex-direction: row-reverse; justify-content: flex-start; }

/* Toasts */
[dir="rtl"] #toast-container {
  right: auto  !important;
  left: 24px   !important;
}
[dir="rtl"] .toast { direction: rtl; text-align: right; }

/* Auth pages (login/register) */
[dir="rtl"] .auth-logo      { flex-direction: row-reverse; }
[dir="rtl"] .auth-card      { text-align: right; direction: rtl; }
[dir="rtl"] .auth-footer    { text-align: center; }

/* Badges – keep LTR inside RTL */
[dir="rtl"] .badge,
[dir="rtl"] .role-badge     { direction: ltr; }

/* RTL responsive override */
@media (max-width: 768px) {
  [dir="rtl"] .main-content { margin-right: 0 !important; }
}

/* ── Language Toggle Buttons ─────────────────────────── */
.lang-buttons-wrap {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 26px;
  border-radius: 50px;
  border: 2px solid var(--border);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 700;
  transition: all .22s;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  line-height: 1;
}

.lang-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(110,64,242,.08);
}

.lang-btn.active {
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color: #fff !important;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(110,64,242,.45);
}

.lang-btn .flag { font-size: 1.15rem; line-height: 1; }

/* ── Custom Flatpickr Design ─────────────────────────── */
.flatpickr-calendar {
  background: #131620 !important;
  border: 1px solid #2d3342 !important;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,0.6), 0 16px 40px rgba(0, 0, 0, 0.7) !important;
  border-radius: 16px !important;
  padding: 24px !important;
  font-family: 'Inter', system-ui, sans-serif !important;
  width: 480px !important;
}

.flatpickr-calendar.open {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  right: auto !important;
  bottom: auto !important;
  z-index: 999999 !important;
  margin: 0 !important;
}

.flatpickr-months {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-bottom: 24px !important;
  position: relative !important;
  height: 40px !important;
}

.flatpickr-current-month {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: #fff !important;
  padding: 0 !important;
  height: 100% !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
  appearance: none !important;
  -webkit-appearance: none !important;
  background: transparent !important;
  border: none !important;
  color: #e2e8f0 !important;
  font-weight: 700 !important;
  font-size: 1.15rem !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin: 0 !important;
}

.flatpickr-current-month .numInputWrapper {
  width: 5ch !important;
  background: transparent !important;
}

.flatpickr-current-month .numInputWrapper input.cur-year {
  font-weight: 700 !important;
  color: #e2e8f0 !important;
  font-size: 1.15rem !important;
  padding: 0 !important;
  margin: 0 !important;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 38px !important;
  height: 38px !important;
  border: 1px solid #2d3342 !important;
  border-radius: 8px !important;
  padding: 0 !important;
  fill: #828a99 !important;
  color: #828a99 !important;
  transition: all 0.2s !important;
  background: transparent !important;
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
  width: 14px !important;
  height: 14px !important;
}

html[lang="ar"] .flatpickr-months .flatpickr-prev-month { right: 0 !important; left: auto !important; }
html[lang="ar"] .flatpickr-months .flatpickr-next-month { left: 0 !important; right: auto !important; }

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  background: #1a1d27 !important;
  border-color: #3b4255 !important;
  fill: #fff !important;
  color: #fff !important;
}

.flatpickr-innerContainer, .flatpickr-rContainer, .dayContainer, .flatpickr-days {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 100% !important;
}

.flatpickr-weekdays {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  margin-bottom: 20px !important;
  width: 100% !important;
  height: auto !important;
  border-bottom: 1px solid #2d3342 !important;
  padding-bottom: 10px !important;
}

.flatpickr-weekdaycontainer {
  display: contents !important;
}

span.flatpickr-weekday {
  color: #e2e8f0 !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  text-align: center !important;
  text-transform: uppercase;
  padding-bottom: 12px !important;
}

.dayContainer {
  display: grid !important;
  grid-template-columns: repeat(7, 1fr) !important;
  gap: 8px !important;
  justify-items: center !important;
}

.flatpickr-day {
  width: 100% !important;
  max-width: 100% !important;
  height: 46px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #1a1d27 !important;
  border: 1px solid #2d3342 !important;
  border-radius: 8px !important;
  color: #e2e8f0 !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  transition: all 0.2s !important;
  position: relative !important;
  margin: 0 !important;
  line-height: 1 !important;
}

.flatpickr-day:hover, .flatpickr-day:focus {
  background: #232736 !important;
  border-color: #3b4255 !important;
  z-index: 2;
}

.flatpickr-day.today {
  border: 2px solid #8b5cf6 !important;
  background: transparent !important;
}

.flatpickr-day.selected, .flatpickr-day.selected:hover {
  background: #8b5cf6 !important;
  border-color: #8b5cf6 !important;
  color: #fff !important;
  z-index: 5;
}

.flatpickr-day.prevMonthDay, .flatpickr-day.nextMonthDay {
  opacity: 0.2 !important;
  background: transparent !important;
  border-color: #2d3342 !important;
  cursor: default !important;
}

.flatpickr-day.date-fully-booked {
  background: #ef4444 !important;
  border-color: #ef4444 !important;
  color: #fff !important;
}

.flatpickr-day.date-partially-booked {
  background: #f59e0b !important;
  border-color: #f59e0b !important;
  color: #fff !important;
}

.flatpickr-calendar.arrowTop:before, .flatpickr-calendar.arrowTop:after {
  display: none !important;
}

html[lang="ar"] .flatpickr-calendar {
  direction: rtl;
}

