/* ============================================================
   Admin Panel — Global CSS
   Premium Dark Glassmorphism Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;1,14..32,400&display=swap');

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

:root {
  /* Color Palette */
  --bg-primary:    #0a0e1a;
  --bg-secondary:  #0f1628;
  --bg-card:       rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --border:        rgba(255, 255, 255, 0.10);
  --border-focus:  rgba(99, 179, 237, 0.60);

  /* Text */
  --text-primary:   #f0f4ff;
  --text-secondary: rgba(240, 244, 255, 0.60);
  --text-muted:     rgba(240, 244, 255, 0.35);

  /* Accent Colors */
  --accent-blue:   #4f9eff;
  --accent-purple: #a78bfa;
  --accent-gold:   #f5c842;
  --accent-green:  #4ade80;
  --accent-red:    #f87171;
  --accent-pink:   #f472b6;

  /* Org Type Colors */
  --color-wedding:      #c9a96e;
  --color-engagement:   #e8a0c0;
  --color-circumcision: #4a7db5;
  --color-graduation:   #7c5cbf;
  --color-meeting:      #3a6ea8;

  /* Gradients */
  --gradient-main:   linear-gradient(135deg, #0a0e1a 0%, #0f1628 50%, #161d35 100%);
  --gradient-card:   linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  --gradient-accent: linear-gradient(135deg, #4f9eff, #a78bfa);
  --gradient-gold:   linear-gradient(135deg, #f5c842, #f59542);
  --gradient-green:  linear-gradient(135deg, #4ade80, #22d3ee);

  /* Shadows */
  --shadow-card:  0 8px 32px rgba(0, 0, 0, 0.40);
  --shadow-btn:   0 4px 15px rgba(79, 158, 255, 0.30);
  --shadow-input: 0 0 0 3px rgba(79, 158, 255, 0.15);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--gradient-main);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  background: rgba(10, 14, 26, 0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  padding: 1.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-brand .brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.sidebar-brand .brand-icon {
  width: 40px; height: 40px;
  background: var(--gradient-accent);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.sidebar-brand .brand-name {
  font-size: 1rem;
  font-weight: 700;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-brand .brand-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
}

.sidebar-nav {
  flex: 1;
  padding: 1.25rem 0.75rem;
  overflow-y: auto;
}

.nav-section-title {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 1.25rem 0.75rem 0.5rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 0.25rem;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  transform: translateX(4px);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(79,158,255,0.2), rgba(167,139,250,0.2));
  color: var(--accent-blue);
  border: 1px solid rgba(79,158,255,0.25);
}

.nav-item .nav-icon { font-size: 1.1rem; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto;
  background: var(--accent-blue);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

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

/* ── Main Content ─────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  background: rgba(10, 14, 26, 0.80);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 1rem; }
.page-title  { font-size: 1.125rem; font-weight: 600; }
.page-sub    { font-size: 0.8rem; color: var(--text-muted); }

.topbar-right { display: flex; align-items: center; gap: 1rem; }

.topbar-clock {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 36px; height: 36px;
  background: var(--gradient-accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: 700;
  cursor: pointer;
}

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

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--gradient-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

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

.card-title {
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Stat Cards ───────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: all var(--transition);
  cursor: default;
}

.stat-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.blue   { background: rgba(79,158,255,0.15); }
.stat-icon.purple { background: rgba(167,139,250,0.15); }
.stat-icon.gold   { background: rgba(245,200,66,0.15); }
.stat-icon.green  { background: rgba(74,222,128,0.15); }
.stat-icon.red    { background: rgba(248,113,113,0.15); }

.stat-info { flex: 1; }
.stat-value { font-size: 1.75rem; font-weight: 700; line-height: 1; margin-bottom: 0.25rem; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); }

.settings-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.settings-summary-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.025));
}

.settings-summary-card span {
  display: block;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.settings-summary-card strong {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-primary);
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-summary-card small {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-muted);
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: inherit;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79,158,255,0.40);
}

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255,255,255,0.20);
}

.btn-danger  { background: rgba(248,113,113,0.2); color: var(--accent-red);   border: 1px solid rgba(248,113,113,0.30); }
.btn-success { background: rgba(74,222,128,0.2);  color: var(--accent-green); border: 1px solid rgba(74,222,128,0.30); }
.btn-gold    { background: rgba(245,200,66,0.2);  color: var(--accent-gold);  border: 1px solid rgba(245,200,66,0.30); }

.btn-danger:hover  { background: rgba(248,113,113,0.35); }
.btn-success:hover { background: rgba(74,222,128,0.35); }
.btn-gold:hover    { background: rgba(245,200,66,0.35); }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }
.btn-lg { padding: 0.875rem 2rem; font-size: 1rem; }

/* ── Forms ────────────────────────────────────────────────── */
.form-group   { margin-bottom: 1.25rem; }
.form-label   { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; }
.form-control {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-input);
  background: rgba(255,255,255,0.09);
}

.form-control.is-invalid {
  border-color: rgba(248,113,113,0.72);
  box-shadow: 0 0 0 3px rgba(248,113,113,0.12);
}

.form-control.is-valid {
  border-color: rgba(74,222,128,0.72);
  box-shadow: 0 0 0 3px rgba(74,222,128,0.10);
}

.form-control::placeholder { color: var(--text-muted); }
select.form-control option { background: #1a2240; color: var(--text-primary); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.35rem; }
.form-error { font-size: 0.75rem; color: var(--accent-red); margin-top: 0.35rem; }
.field-feedback {
  min-height: 1rem;
  margin-top: 0.35rem;
  font-size: 0.75rem;
  line-height: 1.35;
}
.field-feedback.is-invalid { color: var(--accent-red); }
.field-feedback.is-valid { color: var(--accent-green); }

.switch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.switch-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.045);
  cursor: pointer;
  transition: all var(--transition);
}

.switch-card:hover {
  border-color: rgba(79,158,255,0.35);
  background: rgba(255,255,255,0.07);
}

.switch-card input {
  width: 20px;
  height: 20px;
  margin-top: 0.1rem;
  accent-color: var(--accent-blue);
  flex-shrink: 0;
}

.switch-card strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.switch-card span {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.qr-download-link {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  max-width: 150px;
  color: var(--accent-blue);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
}

.qr-download-link:hover {
  color: var(--accent-gold);
  text-decoration: underline;
}

.qr-download-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  flex: 0 0 1.65rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-card);
  font-size: 0.72rem;
}

/* ── Schedule Picker ─────────────────────────────────────── */
.schedule-planner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.schedule-column {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255,255,255,0.055), rgba(255,255,255,0.025));
  overflow: hidden;
}

.schedule-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.035);
}

.schedule-column-head strong {
  color: var(--text-primary);
  font-size: 0.9rem;
}

.schedule-column-head span {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.schedule-stack {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.picker-field {
  min-width: 0;
}

.picker-trigger {
  width: 100%;
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  text-align: left;
  padding: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.picker-trigger:hover,
.picker-trigger:focus {
  border-color: rgba(79,158,255,0.45);
  background: rgba(255,255,255,0.09);
  box-shadow: var(--shadow-input);
  outline: none;
}

.picker-copy {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.picker-copy span {
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.picker-copy strong {
  color: var(--text-primary);
  font-size: 0.98rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: rgba(79,158,255,0.14);
  color: var(--accent-blue);
  font-size: 1.05rem;
}

.date-time-popover {
  position: fixed;
  z-index: 100000;
  padding: 0.9rem;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-lg);
  background: rgba(15,22,40,0.98);
  box-shadow: 0 24px 70px rgba(0,0,0,0.6);
  backdrop-filter: blur(18px);
}

.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.picker-head strong {
  color: var(--text-primary);
  font-size: 0.95rem;
}

.picker-head-compact {
  justify-content: center;
}

.picker-nav {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.picker-nav:hover {
  background: rgba(79,158,255,0.15);
  border-color: rgba(79,158,255,0.35);
}

.picker-weekdays,
.picker-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.35rem;
}

.picker-weekdays {
  margin-bottom: 0.4rem;
}

.picker-weekdays span {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.picker-day,
.picker-time,
.picker-quick button {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.055);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.picker-day {
  height: 36px;
  font-size: 0.82rem;
}

.picker-day:hover,
.picker-time:hover,
.picker-quick button:hover {
  background: rgba(79,158,255,0.16);
  border-color: rgba(79,158,255,0.35);
  color: var(--text-primary);
}

.picker-day.is-muted {
  opacity: 0.35;
}

.picker-day.is-selected,
.picker-time.is-selected,
.picker-quick button.is-selected {
  background: var(--gradient-accent);
  border-color: transparent;
  color: #fff;
}

.picker-quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-bottom: 0.7rem;
}

.picker-quick button {
  min-height: 34px;
  font-size: 0.8rem;
  font-weight: 700;
}

.picker-times {
  max-height: 220px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
  padding-right: 0.2rem;
}

.picker-time {
  min-height: 34px;
  font-size: 0.8rem;
  font-weight: 700;
}

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

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
}

tbody td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: var(--text-secondary);
  vertical-align: middle;
}

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

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-active  { background: rgba(74,222,128,0.15);  color: var(--accent-green); border: 1px solid rgba(74,222,128,0.30); }
.badge-past    { background: rgba(148,163,184,0.15); color: #94a3b8;             border: 1px solid rgba(148,163,184,0.20); }
.badge-future  { background: rgba(79,158,255,0.15);  color: var(--accent-blue);  border: 1px solid rgba(79,158,255,0.20); }
.badge-warning { background: rgba(245,200,66,0.15);  color: var(--accent-gold);  border: 1px solid rgba(245,200,66,0.25); }
.badge-danger  { background: rgba(248,113,113,0.15); color: var(--accent-red);   border: 1px solid rgba(248,113,113,0.25); }

/* Org type badges */
.badge-wedding      { background: rgba(201,169,110,0.15); color: var(--color-wedding);      border: 1px solid rgba(201,169,110,0.25); }
.badge-engagement   { background: rgba(232,160,192,0.15); color: var(--color-engagement);   border: 1px solid rgba(232,160,192,0.25); }
.badge-circumcision { background: rgba(74,125,181,0.15);  color: var(--color-circumcision); border: 1px solid rgba(74,125,181,0.25); }
.badge-graduation   { background: rgba(124,92,191,0.15);  color: var(--color-graduation);   border: 1px solid rgba(124,92,191,0.25); }
.badge-meeting      { background: rgba(58,110,168,0.15);  color: var(--color-meeting);      border: 1px solid rgba(58,110,168,0.25); }

/* ── Alerts ───────────────────────────────────────────────── */
.alert {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.alert-success { background: rgba(74,222,128,0.12);  border: 1px solid rgba(74,222,128,0.25);  color: #86efac; }
.alert-error   { background: rgba(248,113,113,0.12); border: 1px solid rgba(248,113,113,0.25); color: #fca5a5; }
.alert-warning { background: rgba(245,200,66,0.12);  border: 1px solid rgba(245,200,66,0.25);  color: #fde68a; }
.alert-info    { background: rgba(79,158,255,0.12);  border: 1px solid rgba(79,158,255,0.25);  color: #93c5fd; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.modal {
  background: #0f1628;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.60);
  transform: scale(0.95);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: scale(1); }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.modal-title { font-size: 1.1rem; font-weight: 600; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.25rem; cursor: pointer; transition: color var(--transition); }
.modal-close:hover { color: var(--text-primary); }

/* ── Org Type Selector ───────────────────────────────────── */
.type-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.75rem; margin-bottom: 1.5rem; }
.type-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
}
.type-card:hover { border-color: rgba(255,255,255,0.25); background: var(--bg-card-hover); }
.type-card.selected { border-color: var(--accent-blue); background: rgba(79,158,255,0.12); }
.type-card .type-emoji { font-size: 1.75rem; display: block; margin-bottom: 0.4rem; }
.type-card .type-name  { font-size: 0.72rem; font-weight: 600; color: var(--text-secondary); }

/* ── Template Selector ───────────────────────────────────── */
.template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 1rem; }
.template-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition);
}
.template-card:hover { border-color: rgba(255,255,255,0.30); transform: translateY(-2px); }
.template-card.selected { border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(79,158,255,0.20); }
.template-preview { height: 80px; }
.template-name { font-size: 0.75rem; font-weight: 600; padding: 0.5rem; text-align: center; color: var(--text-secondary); }

/* ── QR Display ───────────────────────────────────────────── */
.qr-display {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: inline-block;
  box-shadow: 0 8px 32px rgba(0,0,0,0.30);
}
.qr-display img { display: block; width: 200px; height: 200px; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination { display: flex; gap: 0.5rem; align-items: center; }
.page-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  text-decoration: none;
}
.page-btn:hover, .page-btn.active { background: var(--accent-blue); color: #fff; border-color: var(--accent-blue); }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-secondary); }
.empty-text { font-size: 0.875rem; }

/* ── Mobile Sidebar Toggle ────────────────────────────────── */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex; }
  .main-content { margin-left: 0; }
  .page-content { padding: 1rem; }
  .topbar { padding: 0 1rem; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .switch-grid { grid-template-columns: 1fr; }
  .schedule-planner { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: repeat(3, 1fr); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .settings-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
  .type-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr; }
  .settings-summary-grid { grid-template-columns: 1fr; }
  .picker-times { grid-template-columns: repeat(3, 1fr); }
  .picker-copy strong { font-size: 0.9rem; }
}
