/* ============================================================
   LARK MEETING SCHEDULER — Premium Dark-Mode Stylesheet
   ============================================================
   Design System: Deep-space dark theme with indigo accents,
   glassmorphism, and micro-animations.
   ============================================================ */

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

/* ==========================================================
   §2  CSS CUSTOM PROPERTIES (Design Tokens)
   ========================================================== */
:root {
  /* ── Backgrounds ──────────────────────────────────────── */
  --bg-primary:       #0B0D17;
  --bg-secondary:     #131629;
  --bg-tertiary:      #1C1F3A;
  --bg-glass:         rgba(255, 255, 255, 0.03);

  /* ── Borders ──────────────────────────────────────────── */
  --border:           rgba(255, 255, 255, 0.06);
  --border-hover:     rgba(255, 255, 255, 0.12);

  /* ── Brand / Primary ──────────────────────────────────── */
  --primary:          #6366F1;
  --primary-hover:    #818CF8;
  --primary-glow:     rgba(99, 102, 241, 0.15);
  --gradient-primary: linear-gradient(135deg, #6366F1, #8B5CF6);
  --gradient-accent:  linear-gradient(135deg, #06B6D4, #3B82F6);

  /* ── Semantic Colours ─────────────────────────────────── */
  --success:          #10B981;
  --success-bg:       rgba(16, 185, 129, 0.1);
  --warning:          #F59E0B;
  --warning-bg:       rgba(245, 158, 11, 0.1);
  --danger:           #EF4444;
  --danger-bg:        rgba(239, 68, 68, 0.1);

  /* ── Typography ───────────────────────────────────────── */
  --text-primary:     #F1F5F9;
  --text-secondary:   #94A3B8;
  --text-muted:       #64748B;

  /* ── Misc ─────────────────────────────────────────────── */
  --radius-sm:        8px;
  --radius-md:        12px;
  --radius-lg:        16px;
  --radius-xl:        20px;
  --transition:       0.3s ease;
}

/* ==========================================================
   §3  CSS RESET & BASE
   ========================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI',
               Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 1rem;
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

a:hover {
  color: var(--primary-hover);
}

ul, ol {
  list-style: none;
}

/* ==========================================================
   §4  TYPOGRAPHY
   ========================================================== */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--text-primary);
}

h1 { font-size: 2.5rem;  letter-spacing: -0.025em; }
h2 { font-size: 2rem;    letter-spacing: -0.02em;  }
h3 { font-size: 1.5rem;  letter-spacing: -0.015em; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem;  }
h6 { font-size: 1rem;    }

p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.gradient-text {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.gradient-text-accent {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

small {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================
   §5  SCROLLBAR
   ========================================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--bg-tertiary) var(--bg-secondary);
}

/* ==========================================================
   §6  SELECTION
   ========================================================== */
::selection {
  background: var(--primary);
  color: #ffffff;
}

::-moz-selection {
  background: var(--primary);
  color: #ffffff;
}

/* ==========================================================
   §7  NAVBAR
   ========================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 13, 23, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition);
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand-icon {
  font-size: 1.4rem;
}

.navbar-nav {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.nav-link {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  text-decoration: none;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.nav-link.active {
  color: var(--primary-hover);
  background: var(--primary-glow);
}

.navbar-user {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.navbar-user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ==========================================================
   §8  AVATAR
   ========================================================== */
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
  transition: border-color var(--transition);
}

.avatar:hover {
  border-color: var(--primary);
}

.avatar-lg {
  width: 48px;
  height: 48px;
}

.avatar-sm {
  width: 28px;
  height: 28px;
}

/* ==========================================================
   §9  HERO SECTION
   ========================================================== */
.hero {
  text-align: center;
  padding: 4rem 2rem 3rem;
  position: relative;
}

.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  position: relative;
  z-index: 1;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ==========================================================
   §10  CONTAINER
   ========================================================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-sm {
  max-width: 800px;
}

.container-xs {
  max-width: 600px;
}

/* ==========================================================
   §11  GLASS CARDS
   ========================================================== */
.card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: all var(--transition);
}

.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

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

/* ==========================================================
   §12  BUTTONS
   ========================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  font-size: 0.875rem;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

/* Primary */
.btn-primary {
  background: var(--gradient-primary);
  color: #ffffff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.3);
}

/* Secondary */
.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(28, 31, 58, 0.8);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* Success */
.btn-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
  background: rgba(16, 185, 129, 0.2);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.15);
}

/* Danger */
.btn-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.15);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

/* Sizes */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

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

.btn-icon-sm {
  width: 32px;
  height: 32px;
  font-size: 0.8rem;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ==========================================================
   §13  FORM ELEMENTS
   ========================================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.form-label .required {
  color: var(--danger);
  margin-left: 0.15rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--border-hover);
}

.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
  line-height: 1.6;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.form-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 0.35rem;
}

.form-input.error,
.form-select.error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-bg);
}

/* Checkbox / Radio custom */
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

/* ==========================================================
   §14  MONTH CALENDAR
   ========================================================== */
.date-selector {
  padding: 1rem 0;
  max-width: 420px;
  margin: 0 auto;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0 0.25rem;
}

.cal-month-label {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cal-nav-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.cal-nav-btn:hover {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary-hover);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-dow {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.5rem 0;
}

.cal-day {
  text-align: center;
  padding: 0.6rem 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--transition);
  background: var(--bg-tertiary);
  border: 1px solid transparent;
}

.cal-day:hover:not(.empty):not(.past) {
  background: var(--primary-glow);
  border-color: var(--primary);
  transform: scale(1.05);
}

.cal-day.empty {
  background: transparent;
  cursor: default;
}

.cal-day.past {
  color: var(--text-muted);
  opacity: 0.4;
  cursor: not-allowed;
  background: transparent;
}

.cal-day.today {
  border: 2px solid var(--primary);
  font-weight: 700;
  color: var(--primary-hover);
}

.cal-day.active {
  background: var(--gradient-primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 20px var(--primary-glow);
  border-color: transparent;
}

/* ==========================================================
   §15  SLOT CARDS
   ========================================================== */
.slot-card {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  border-left: 4px solid transparent;
  transition: all var(--transition);
  animation: fadeIn 0.3s ease;
}

.slot-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.slot-card.available {
  border-left-color: var(--success);
}

.slot-card.available:hover {
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.1);
}

.slot-card.booked {
  border-left-color: var(--warning);
}

.slot-card.booked:hover {
  box-shadow: 0 8px 32px rgba(245, 158, 11, 0.1);
}

.slot-card.cancelled {
  border-left-color: var(--danger);
  opacity: 0.6;
}

.slot-card.cancelled:hover {
  opacity: 0.8;
}

/* ==========================================================
   §16  SLOTS GRID
   ========================================================== */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

/* ==========================================================
   §17  SLOT CARD INNER ELEMENTS
   ========================================================== */
.slot-time {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slot-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  flex-wrap: wrap;
}

.slot-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.slot-meta-item i,
.slot-meta-item .icon {
  font-size: 0.9rem;
  opacity: 0.7;
}

.slot-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
}

.slot-description {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================
   §18  STATUS BADGE
   ========================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-available {
  background: var(--success-bg);
  color: var(--success);
}

.badge-booked {
  background: var(--warning-bg);
  color: var(--warning);
}

.badge-cancelled {
  background: var(--danger-bg);
  color: var(--danger);
}

.badge-info {
  background: var(--primary-glow);
  color: var(--primary-hover);
}

.badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ==========================================================
   §19  STATS GRID
   ========================================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-glass);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

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

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
}

.stat-card:nth-child(2)::before {
  background: var(--gradient-accent);
}

.stat-card:nth-child(3)::before {
  background: linear-gradient(135deg, var(--success), #34D399);
}

.stat-card:nth-child(4)::before {
  background: linear-gradient(135deg, var(--warning), #FBBF24);
}

.stat-card .stat-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  opacity: 0.8;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
}

.stat-card .stat-label {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  font-weight: 400;
}

.stat-card .stat-change {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  font-weight: 500;
}

.stat-card .stat-change.positive {
  color: var(--success);
}

.stat-card .stat-change.negative {
  color: var(--danger);
}

/* ==========================================================
   §20  DATA TABLE
   ========================================================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  text-align: left;
  padding: 1rem;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  white-space: nowrap;
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-secondary);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: var(--bg-glass);
}

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

/* ==========================================================
   §21  MODAL
   ========================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
  padding: 1rem;
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  animation: slideUp 0.3s ease;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

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

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
  padding: 0.25rem;
  line-height: 1;
  transition: color var(--transition);
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-tertiary);
}

.modal-body {
  margin-bottom: 1rem;
}

.modal-footer {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* ==========================================================
   §22  TOAST NOTIFICATIONS
   ========================================================== */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.875rem;
  animation: slideRight 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 300px;
  max-width: 420px;
  pointer-events: auto;
}

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
  flex-shrink: 0;
}

.toast-success {
  border-left: 4px solid var(--success);
}

.toast-error {
  border-left: 4px solid var(--danger);
}

.toast-info {
  border-left: 4px solid var(--primary);
}

.toast-warning {
  border-left: 4px solid var(--warning);
}

.toast.removing {
  animation: slideRight 0.3s ease reverse forwards;
}

/* ==========================================================
   §23  LOADING SPINNER
   ========================================================== */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 2px;
}

.spinner-lg {
  width: 60px;
  height: 60px;
  border-width: 4px;
}

.spinner-container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  flex-direction: column;
  gap: 1rem;
}

.spinner-container p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ==========================================================
   §24  SKELETON LOADING
   ========================================================== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-secondary) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
  width: 100%;
}

.skeleton-text:last-child {
  width: 70%;
}

.skeleton-title {
  height: 24px;
  width: 60%;
  margin-bottom: 12px;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
}

.skeleton-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.skeleton-btn {
  height: 40px;
  width: 120px;
  border-radius: var(--radius-md);
}

/* ==========================================================
   §25  EMPTY STATE
   ========================================================== */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.empty-state-sub {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 auto;
}

.empty-state .btn {
  margin-top: 1.5rem;
}

/* ==========================================================
   §26  SECTION STYLES
   ========================================================== */
.section {
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.section-title .icon {
  opacity: 0.7;
}

.section-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}

/* ==========================================================
   §27  LOGIN PROMPT
   ========================================================== */
.login-prompt {
  text-align: center;
  padding: 4rem 2rem;
}

.login-prompt h2 {
  margin-bottom: 0.75rem;
}

.login-prompt p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
}

.login-prompt .btn {
  font-size: 1rem;
  padding: 1rem 2rem;
}

.login-prompt .login-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.6;
}

/* ==========================================================
   §28  SLOT DETAIL IN MODAL
   ========================================================== */
.slot-detail {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.slot-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
}

.slot-detail-row:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

.slot-detail-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.slot-detail-value {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

/* ==========================================================
   §29  CREATE FORM SECTION
   ========================================================== */
.create-form {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 200px;
}

.form-divider {
  height: 1px;
  background: var(--border);
  margin: 1.5rem 0;
}

/* ==========================================================
   §30  FILTER BAR
   ========================================================== */
.filter-bar {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-btn {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.8rem;
  font-weight: 500;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.filter-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.filter-btn.active {
  background: var(--primary-glow);
  border-color: var(--primary);
  color: var(--primary);
}

.filter-count {
  background: var(--bg-secondary);
  padding: 0.1rem 0.4rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* ==========================================================
   §31  SUCCESS ANIMATION
   ========================================================== */
.success-checkmark {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  background: var(--success-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 0.5s ease;
  font-size: 2rem;
  color: var(--success);
}

/* ==========================================================
   §32  PREVIEW SECTION
   ========================================================== */
.preview-section {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
  border-left: 3px solid var(--primary);
}

.preview-section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.preview-section p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

/* ==========================================================
   §33  FOOTER
   ========================================================== */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}

.footer a {
  color: var(--text-secondary);
  transition: color var(--transition);
}

.footer a:hover {
  color: var(--primary);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.75rem;
}

/* ==========================================================
   §34  KEYFRAME ANIMATIONS
   ========================================================== */
@keyframes fadeIn {
  0%   { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes slideUp {
  0%   { opacity: 0; transform: translateY(20px);  }
  100% { opacity: 1; transform: translateY(0);     }
}

@keyframes slideRight {
  0%   { opacity: 0; transform: translateX(100px); }
  100% { opacity: 1; transform: translateX(0);     }
}

@keyframes pulse {
  0%   { transform: scale(0.8); opacity: 0;  }
  50%  { transform: scale(1.1);              }
  100% { transform: scale(1);   opacity: 1;  }
}

@keyframes spin {
  0%   { transform: rotate(0deg);   }
  100% { transform: rotate(360deg); }
}

@keyframes shimmer {
  0%   { background-position: 200% 0;  }
  100% { background-position: -200% 0; }
}

@keyframes countUp {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0);    }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px var(--primary-glow); }
  50%      { box-shadow: 0 0 20px var(--primary-glow), 0 0 40px rgba(99, 102, 241, 0.05); }
}

/* ==========================================================
   §35  RESPONSIVE — Tablet (≤ 1024px)
   ========================================================== */
@media (max-width: 1024px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .slots-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

/* ==========================================================
   §36  RESPONSIVE — Mobile (≤ 768px)
   ========================================================== */
@media (max-width: 768px) {
  .hero {
    padding: 2rem 1rem 1.5rem;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .hero p {
    font-size: 0.85rem;
  }

  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }

  .container {
    padding: 0 0.75rem;
  }

  /* ── Navbar compact ─────────────────────────── */
  .navbar {
    padding: 0.6rem 0.75rem;
  }

  .navbar-left {
    gap: 0.75rem;
  }

  .navbar-brand {
    font-size: 1rem;
  }

  .navbar-brand span {
    display: none;
  }

  .navbar-icon {
    width: 24px;
    height: 24px;
  }

  .navbar-nav {
    gap: 0.15rem;
  }

  .nav-link {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
  }

  .navbar-user-name {
    display: none;
  }

  .navbar-user {
    gap: 0.5rem;
  }

  /* ── Section spacing ────────────────────────── */
  .section {
    margin-bottom: 1.25rem;
  }

  .section-title {
    font-size: 1rem;
    margin-bottom: 0.75rem;
  }

  /* ── Calendar compact ───────────────────────── */
  .date-selector {
    max-width: 100%;
    padding: 0.5rem 0;
  }

  .calendar-grid {
    gap: 3px;
  }

  .cal-day {
    padding: 0.4rem 0;
    font-size: 0.8rem;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .cal-dow {
    font-size: 0.65rem;
    padding: 0.3rem 0;
  }

  .cal-nav-btn {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  .cal-month-label {
    font-size: 0.9rem;
  }

  /* ── Slots grid — full width cards ──────────── */
  .slots-grid {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .slot-card {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
  }

  .slot-card:hover {
    transform: none;
  }

  .slot-time {
    font-size: 1rem;
  }

  .slot-meta {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    gap: 0.75rem;
  }

  .slot-actions {
    margin-top: 0.6rem;
  }

  .slot-actions .btn {
    width: 100%;
    padding: 0.65rem;
    font-size: 0.85rem;
    justify-content: center;
  }

  /* ── Stats ──────────────────────────────────── */
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-card .stat-value {
    font-size: 1.5rem;
  }

  /* ── Modal — bottom sheet style ─────────────── */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 90vh;
    margin-top: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-secondary);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .modal-header h3 {
    font-size: 1rem;
  }

  .modal-body {
    padding: 1rem;
  }

  /* Form 1-column on mobile */
  .modal-body [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  .form-group {
    margin-bottom: 0.5rem;
  }

  .form-group label {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 0.85rem;
    padding: 0.55rem 0.65rem;
  }

  .form-group textarea {
    min-height: 60px;
  }

  .modal-footer {
    flex-direction: column-reverse;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
    position: sticky;
    bottom: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
  }

  .modal-footer .btn {
    width: 100%;
    padding: 0.7rem;
    font-size: 0.9rem;
  }

  /* ── Slot detail in modal ───────────────────── */
  .slot-detail {
    padding: 0.75rem;
    font-size: 0.85rem;
  }

  .slot-detail [style*="display: flex"] {
    flex-direction: column !important;
    gap: 0.35rem !important;
  }

  /* ── Filter bar ─────────────────────────────── */
  .filter-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
  }

  .filter-bar::-webkit-scrollbar {
    display: none;
  }

  .filter-btn {
    flex-shrink: 0;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  /* ── Cards ──────────────────────────────────── */
  .card {
    padding: 1rem;
    border-radius: var(--radius-sm);
  }

  .create-form {
    padding: 1rem;
  }

  /* ── Toast ──────────────────────────────────── */
  .toast-container {
    top: auto;
    bottom: 1rem;
    right: 0.75rem;
    left: 0.75rem;
  }

  .toast {
    min-width: unset;
    width: 100%;
    font-size: 0.85rem;
  }

  /* ── Data table ─────────────────────────────── */
  .data-table th,
  .data-table td {
    padding: 0.6rem;
    font-size: 0.75rem;
  }

  /* ── Login prompt ───────────────────────────── */
  .login-prompt {
    padding: 2.5rem 1.25rem;
  }

  .login-prompt-icon {
    font-size: 2.5rem;
  }

  /* ── Success modal ──────────────────────────── */
  .success-checkmark {
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
  }

  /* ── Empty state ────────────────────────────── */
  .empty-state {
    padding: 2rem 1rem;
  }

  .empty-state-icon {
    font-size: 2rem;
  }
}

/* ==========================================================
   §37  RESPONSIVE — Small Phone (≤ 380px)
   ========================================================== */
@media (max-width: 380px) {
  body {
    font-size: 0.875rem;
  }

  .hero {
    padding: 1.5rem 0.75rem 1rem;
  }

  .hero h1 {
    font-size: 1.25rem;
  }

  .container {
    padding: 0 0.5rem;
  }

  .navbar {
    padding: 0.5rem;
  }

  .slot-card {
    padding: 0.75rem;
  }

  .slot-time {
    font-size: 0.9rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }

  .cal-day {
    font-size: 0.75rem;
    min-height: 32px;
  }

  .modal-body {
    padding: 0.75rem;
  }
}

/* ==========================================================
   §38  UTILITY CLASSES
   ========================================================== */

/* ── Display ────────────────────────────────────────────── */
.hidden       { display: none !important; }
.visible      { visibility: visible; }
.invisible    { visibility: hidden; }

/* ── Text ───────────────────────────────────────────────── */
.text-center  { text-align: center; }
.text-left    { text-align: left; }
.text-right   { text-align: right; }

.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger  { color: var(--danger) !important; }
.text-primary { color: var(--primary) !important; }
.text-muted   { color: var(--text-muted) !important; }

.text-sm      { font-size: 0.8rem; }
.text-xs      { font-size: 0.7rem; }
.text-lg      { font-size: 1.1rem; }

.font-bold    { font-weight: 700; }
.font-medium  { font-weight: 500; }
.font-light   { font-weight: 300; }

/* ── Spacing ────────────────────────────────────────────── */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.ml-1 { margin-left: 0.5rem; }
.mr-1 { margin-right: 0.5rem; }

.p-1  { padding: 0.5rem; }
.p-2  { padding: 1rem; }
.p-3  { padding: 1.5rem; }

/* ── Flexbox ────────────────────────────────────────────── */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.flex-wrap     { flex-wrap: wrap; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.flex-between  { display: flex; justify-content: space-between; align-items: center; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-end   { justify-content: flex-end; }

.gap-1  { gap: 0.5rem; }
.gap-2  { gap: 1rem; }
.gap-3  { gap: 1.5rem; }

/* ── Borders ────────────────────────────────────────────── */
.rounded       { border-radius: var(--radius-md); }
.rounded-lg    { border-radius: var(--radius-lg); }
.rounded-full  { border-radius: 50%; }

/* ── Width ──────────────────────────────────────────────── */
.w-full        { width: 100%; }

/* ── Overflow ───────────────────────────────────────────── */
.overflow-hidden   { overflow: hidden; }
.overflow-x-auto   { overflow-x: auto; }

/* ── Transitions ────────────────────────────────────────── */
.transition-all    { transition: all var(--transition); }

/* ── Cursor ─────────────────────────────────────────────── */
.cursor-pointer    { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* ── Opacity ────────────────────────────────────────────── */
.opacity-50  { opacity: 0.5; }
.opacity-75  { opacity: 0.75; }

/* ── Truncation ─────────────────────────────────────────── */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Divider ────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 1rem 0;
}

/* ==========================================================
   END OF STYLESHEET
   ========================================================== */
