/* =====================================================================
   ClassMind — Design System complet
   Basé sur les maquettes v1 — palette Indigo/Coral, typographie Inter/Sora
   ===================================================================== */

:root {
  /* Couleurs primaires */
  --indigo: #4F46E5;
  --indigo-600: #4338CA;
  --indigo-500: #6366F1;
  --indigo-100: #E0E7FF;
  --indigo-50: #EEF2FF;

  /* Accent */
  --coral: #FB7185;
  --coral-500: #F43F5E;
  --coral-100: #FFE4E6;

  /* Sémantiques */
  --emerald: #10B981;
  --emerald-100: #D1FAE5;
  --amber: #F59E0B;
  --amber-100: #FEF3C7;
  --danger: #EF4444;
  --danger-100: #FEE2E2;

  /* Neutres */
  --slate-900: #0F172A;
  --slate-700: #334155;
  --slate-500: #64748B;
  --slate-400: #94A3B8;
  --slate-300: #CBD5E1;
  --slate-200: #E2E8F0;
  --slate-100: #F1F5F9;
  --slate-50: #F8FAFC;

  /* Base */
  --bg: #FAFAFB;
  --card: #FFFFFF;

  /* Ombres */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px -8px rgba(79, 70, 229, 0.10);
  --shadow-lg: 0 8px 32px -4px rgba(79, 70, 229, 0.14);
  --shadow-hero: 0 20px 60px -20px rgba(79, 70, 229, 0.45);

  /* Radius */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--slate-900);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'tnum';
}
a { color: var(--indigo); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ===== Login (fond dégradé plein écran) ===== */
.login-body {
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #C026D3 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.login-body::before {
  content: '';
  position: absolute; top: -100px; right: -100px;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 113, 133, 0.35) 0%, transparent 70%);
  pointer-events: none;
}
.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 50px -20px rgba(15, 23, 42, 0.4);
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.login-title {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 22px;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  color: var(--slate-900);
}
.login-sub {
  font-size: 13px;
  color: var(--slate-500);
  margin: 0 0 22px;
  line-height: 1.5;
}
.login-form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-700);
}
.field input {
  font-family: inherit;
  font-size: 14px;
  padding: 11px 14px;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  background: #FFFFFF;
  color: var(--slate-900);
  outline: none;
  transition: all 0.15s;
}
.field input:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10);
}

/* ===== Boutons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  padding: 11px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--indigo);
  color: #FFFFFF;
  box-shadow: 0 4px 14px -2px rgba(79, 70, 229, 0.4);
}
.btn-primary:hover {
  background: var(--indigo-600);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -4px rgba(79, 70, 229, 0.5);
  text-decoration: none;
  color: #FFFFFF;
}
.btn-ghost {
  background: var(--card);
  color: var(--slate-700);
  border: 1px solid var(--slate-200);
}
.btn-ghost:hover {
  background: var(--slate-50);
  border-color: var(--slate-300);
  text-decoration: none;
  color: var(--slate-700);
}
.btn-coral {
  background: var(--coral);
  color: #FFFFFF;
  box-shadow: 0 4px 14px -2px rgba(251, 113, 133, 0.4);
}
.btn-coral:hover {
  background: var(--coral-500);
  text-decoration: none;
  color: #FFFFFF;
}
.btn-full { width: 100%; }
.btn-large { padding: 14px 22px; font-size: 15px; }

/* ===== Alerts ===== */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 16px;
}
.alert svg { flex-shrink: 0; }
.alert-coral { background: var(--coral-100); color: #9F1239; border-left: 3px solid var(--coral); }
.alert-success { background: var(--emerald-100); color: #047857; border-left: 3px solid var(--emerald); }
.alert-warning { background: var(--amber-100); color: #92400E; border-left: 3px solid var(--amber); }
.alert-info { background: var(--indigo-50); color: var(--indigo-600); border-left: 3px solid var(--indigo); }

/* ===== App layout (sidebar + main) ===== */
.app-body { background: var(--bg); }
.app {
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: 100vh;
}

/* ===== Sidebar ===== */
.sidebar {
  background: linear-gradient(180deg, #1E1B4B 0%, #312E81 100%);
  color: #FFFFFF;
  padding: 28px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.brand-logo {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--indigo-500) 0%, var(--coral) 100%);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #FFFFFF;
  box-shadow: 0 6px 20px -4px rgba(251, 113, 133, 0.5);
  flex-shrink: 0;
}
.brand-logo svg { width: 22px; height: 22px; }
.brand-name {
  font-family: 'Sora', sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
}
.brand-name span { color: var(--coral); }

.nav-section {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.45);
  margin: 20px 12px 8px;
  font-weight: 600;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  text-decoration: none;
  margin-bottom: 2px;
}
.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #FFFFFF;
  text-decoration: none;
}
.nav-item.active {
  background: rgba(255, 255, 255, 0.10);
  color: #FFFFFF;
  box-shadow: inset 3px 0 0 var(--coral);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.profile-block {
  margin-top: auto;
  padding: 14px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.profile-block .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: 'Sora';
  font-weight: 700;
  color: #FFFFFF;
  font-size: 13px;
  flex-shrink: 0;
}
.profile-info { min-width: 0; }
.profile-block .name {
  font-size: 13px;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-block .role {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.logout-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.15s;
  text-decoration: none;
}
.logout-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #FFFFFF;
  text-decoration: none;
}
.logout-link svg { width: 14px; height: 14px; }

/* ===== Main content ===== */
.main {
  padding: 36px 44px 60px;
  max-width: 1300px;
  width: 100%;
}

/* ===== Topbar (pour les pages internes) ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}
.title-block .eyebrow {
  font-size: 13px;
  color: var(--slate-500);
  font-weight: 500;
  margin-bottom: 4px;
}
.title-block h1 {
  font-family: 'Sora', sans-serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--slate-900);
}
.actions {
  display: flex;
  gap: 10px;
}

/* ===== Hero (dashboard) ===== */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 50%, #C026D3 100%);
  border-radius: var(--radius-xl);
  padding: 36px 38px;
  color: #FFFFFF;
  margin-bottom: 28px;
  box-shadow: var(--shadow-hero);
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 113, 133, 0.4) 0%, transparent 70%);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  position: relative;
  z-index: 1;
}
.hero-greeting {
  font-size: 14px;
  opacity: 0.85;
  font-weight: 500;
  margin-bottom: 6px;
  text-transform: capitalize;
}
.hero-title {
  font-family: 'Sora', sans-serif;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  color: #FFFFFF;
}
.hero-title span { color: #FCA5A5; }
.hero-sub {
  font-size: 15px;
  opacity: 0.9;
  max-width: 460px;
  line-height: 1.5;
  margin: 0 0 20px;
}
.hero-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.hero-pill {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.hero-stat-card {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.hero-stat-label {
  font-size: 12px;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.hero-stat-value {
  font-family: 'Sora', sans-serif;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
}
.hero-stat-meta {
  font-size: 13px;
  opacity: 0.85;
  margin-top: 6px;
}
.hero-stat-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  overflow: hidden;
  margin-top: 14px;
}
.hero-stat-bar > div {
  height: 100%;
  background: linear-gradient(90deg, #FCA5A5, #FB7185);
  border-radius: 100px;
  transition: width 0.4s ease;
}

/* ===== KPI Grid ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.kpi {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--slate-100);
  box-shadow: var(--shadow-sm);
}
.kpi-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.kpi-icon.indigo { background: var(--indigo-100); color: var(--indigo); }
.kpi-icon.coral { background: var(--coral-100); color: var(--coral-500); }
.kpi-icon.emerald { background: var(--emerald-100); color: var(--emerald); }
.kpi-icon.amber { background: var(--amber-100); color: var(--amber); }
.kpi-label {
  font-size: 13px;
  color: var(--slate-500);
  margin-bottom: 4px;
  font-weight: 500;
}
.kpi-value {
  font-family: 'Sora', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--slate-900);
}

/* ===== Cards ===== */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-100);
}
.card-title {
  font-family: 'Sora', sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--slate-900);
}
.card-meta {
  font-family: 'Inter';
  font-weight: 500;
  font-size: 13px;
  color: var(--slate-500);
}

.dash-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 22px;
}

/* ===== Session list (programme du jour) ===== */
.session-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.session {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  background: var(--slate-50);
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.15s;
}
.session:hover {
  border-color: var(--indigo-100);
  background: #FFFFFF;
  box-shadow: var(--shadow);
}
.session-time {
  text-align: center;
  padding: 8px 0;
  background: #FFFFFF;
  border-radius: 10px;
  border: 1px solid var(--slate-200);
}
.session-time .start {
  font-weight: 700;
  font-size: 15px;
  font-family: 'Sora', sans-serif;
}
.session-time .duration {
  font-size: 11px;
  color: var(--slate-500);
  margin-top: 2px;
}
.session-info .title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
  color: var(--slate-900);
}
.session-info .meta {
  font-size: 13px;
  color: var(--slate-500);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.session-action {
  background: var(--indigo);
  color: #FFFFFF;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  text-decoration: none;
}
.session-action:hover {
  background: var(--indigo-600);
  color: #FFFFFF;
  text-decoration: none;
}
.session-action.secondary {
  background: var(--slate-100);
  color: var(--slate-700);
}
.session-action.secondary:hover {
  background: var(--slate-200);
  color: var(--slate-700);
}

/* ===== Module progress ===== */
.module-progress {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.module-row .module-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  gap: 12px;
}
.module-row .module-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--slate-900);
}
.module-row .module-pct {
  font-family: 'Sora', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--indigo);
  flex-shrink: 0;
}
.module-row .module-pct.warn { color: var(--coral-500); }
.module-bar {
  height: 8px;
  background: var(--slate-100);
  border-radius: 100px;
  overflow: hidden;
}
.module-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--indigo) 0%, var(--indigo-500) 100%);
  border-radius: 100px;
  transition: width 0.4s ease;
}
.module-bar > div.warn {
  background: linear-gradient(90deg, var(--coral) 0%, var(--coral-500) 100%);
}
.module-row .module-meta {
  font-size: 12px;
  color: var(--slate-500);
  margin-top: 4px;
}

/* ===== Empty state ===== */
.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--slate-500);
}
.empty-state svg {
  color: var(--slate-300);
  margin: 0 auto 12px;
  display: block;
}
.empty-state p {
  font-size: 13px;
  margin: 0;
  max-width: 320px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .app { grid-template-columns: 80px 1fr; }
  .sidebar { padding: 20px 12px; }
  .brand-name, .nav-item span, .nav-section, .profile-info, .logout-link { display: none; }
  .brand { justify-content: center; }
  .nav-item { justify-content: center; padding: 12px; }
  .profile-block { padding: 8px; justify-content: center; }
  .main { padding: 24px 28px 40px; }
}

@media (max-width: 880px) {
  .dash-grid, .hero-grid, .field-row { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 28px 22px; }
  .hero-title { font-size: 26px; }
  .main { padding: 20px 16px 40px; }
}

@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .session { grid-template-columns: 60px 1fr; }
  .session-action { grid-column: 1 / -1; justify-content: center; margin-top: 4px; }
}

/* ===================================================================
   AJOUTS LIVRAISON 2 : Admin, Planning, Modal, Forms
   =================================================================== */

/* ===== Forms verticaux ===== */
.form-vertical {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}
.field select, .field textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 11px 14px;
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  background: #FFFFFF;
  color: var(--slate-900);
  outline: none;
  transition: all 0.15s;
}
.field select:focus, .field textarea:focus {
  border-color: var(--indigo);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.10);
}
.field input[type="date"], .field input[type="time"], .field input[type="number"] {
  font-family: inherit;
}
.field input:disabled {
  background: var(--slate-50);
  color: var(--slate-500);
  cursor: not-allowed;
}
.field-checkbox label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}
.field-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--indigo);
  cursor: pointer;
}

/* ===== Admin layout ===== */
.admin-grid-2 {
  display: grid;
  grid-template-columns: 1.2fr 1.8fr;
  gap: 22px;
  align-items: start;
}
.admin-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.admin-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--slate-50);
  border: 1px solid var(--slate-100);
  border-radius: 14px;
  text-decoration: none;
  transition: all 0.15s;
  color: var(--slate-900);
}
.admin-tile:hover {
  background: #FFFFFF;
  border-color: var(--indigo-100);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--slate-900);
}
.admin-tile-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.admin-tile-icon.indigo { background: var(--indigo-100); color: var(--indigo); }
.admin-tile-icon.coral { background: var(--coral-100); color: var(--coral-500); }
.admin-tile-icon.emerald { background: var(--emerald-100); color: var(--emerald); }
.admin-tile-icon.amber { background: var(--amber-100); color: var(--amber); }
.admin-tile-title {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--slate-900);
  margin-bottom: 2px;
}
.admin-tile-desc {
  font-size: 12px;
  color: var(--slate-500);
}

/* ===== Data table ===== */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-500);
  border-bottom: 1px solid var(--slate-200);
  background: var(--slate-50);
}
.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-900);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--slate-50); }
.actions-cell {
  text-align: right;
  white-space: nowrap;
}
.link-btn {
  background: none;
  border: none;
  color: var(--indigo);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s;
}
.link-btn:hover {
  background: var(--indigo-50);
  text-decoration: none;
}
.link-btn.danger { color: var(--danger); }
.link-btn.danger:hover { background: var(--danger-100); }

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.badge.primary { background: var(--indigo-100); color: var(--indigo); }
.badge.success { background: var(--emerald-100); color: #047857; }
.badge.warning { background: var(--amber-100); color: #92400E; }
.badge.coral { background: var(--coral-100); color: #9F1239; }
.badge.muted { background: var(--slate-100); color: var(--slate-500); }

/* ===== Avatar mini ===== */
.avatar-mini {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #FFFFFF;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}

/* ===== Planning toolbar & calendar ===== */
.planning-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--card);
  padding: 14px 20px;
  border-radius: var(--radius);
  margin-bottom: 22px;
  border: 1px solid var(--slate-100);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.week-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.week-nav-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  display: grid;
  place-items: center;
  color: var(--slate-700);
  text-decoration: none;
  transition: all 0.15s;
}
.week-nav-btn:hover {
  background: var(--indigo-50);
  border-color: var(--indigo-100);
  color: var(--indigo);
  text-decoration: none;
}
.week-label {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--slate-900);
}

.calendar {
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--slate-100);
  box-shadow: var(--shadow-sm);
}
.cal-header {
  display: grid;
  grid-template-columns: 60px repeat(5, 1fr);
  background: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
}
.cal-header .day {
  padding: 14px 10px;
  text-align: center;
  border-left: 1px solid var(--slate-200);
}
.cal-header .day:first-child { border-left: none; }
.cal-header .day-name {
  font-size: 11px;
  color: var(--slate-500);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.cal-header .day-num {
  font-family: 'Sora', sans-serif;
  font-size: 22px;
  font-weight: 800;
  margin-top: 2px;
  color: var(--slate-900);
}
.cal-header .day.today .day-num,
.cal-header .day.today .day-name { color: var(--indigo); }
.cal-body {
  display: grid;
  grid-template-columns: 60px repeat(5, 1fr);
}
.cal-time-col {
  display: flex;
  flex-direction: column;
}
.cal-time-slot {
  height: 60px;
  font-size: 11px;
  color: var(--slate-400);
  text-align: right;
  padding: 4px 8px 0 0;
  border-top: 1px solid var(--slate-100);
  font-weight: 500;
}
.cal-day-col {
  border-left: 1px solid var(--slate-100);
  position: relative;
}
.cal-slot {
  display: block;
  height: 60px;
  border-top: 1px solid var(--slate-100);
  cursor: pointer;
  transition: background 0.1s;
}
.cal-slot:hover {
  background: var(--indigo-50);
}
.cal-event {
  position: absolute;
  left: 4px; right: 4px;
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  overflow: hidden;
  text-decoration: none;
  z-index: 2;
}
.cal-event:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px -4px rgba(79, 70, 229, 0.25);
  z-index: 3;
  text-decoration: none;
}
.cal-event.indigo { background: var(--indigo-100); border-left: 3px solid var(--indigo); color: var(--indigo-600); }
.cal-event.coral { background: var(--coral-100); border-left: 3px solid var(--coral); color: #BE123C; }
.cal-event.emerald { background: var(--emerald-100); border-left: 3px solid var(--emerald); color: #047857; }
.cal-event.amber { background: var(--amber-100); border-left: 3px solid var(--amber); color: #B45309; }
.cal-event.muted { background: var(--slate-100); border-left: 3px solid var(--slate-400); color: var(--slate-500); }
.cal-event.cancelled { opacity: 0.5; text-decoration: line-through; }
.cal-event .ev-title { font-weight: 700; }
.cal-event .ev-meta { font-size: 11px; opacity: 0.85; margin-top: 2px; }

/* ===== Modal ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 1000;
  overflow-y: auto;
  animation: fadeIn 0.15s ease-out;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 560px;
  box-shadow: 0 20px 50px -10px rgba(15, 23, 42, 0.4);
  animation: slideUp 0.2s ease-out;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-head h3 {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 18px;
  margin: 0;
  color: var(--slate-900);
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--slate-50);
  display: grid;
  place-items: center;
  color: var(--slate-500);
  text-decoration: none;
  transition: all 0.15s;
}
.modal-close:hover {
  background: var(--slate-100);
  color: var(--slate-700);
  text-decoration: none;
}
.modal-info {
  background: var(--indigo-50);
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  color: var(--indigo-600);
  border-left: 3px solid var(--indigo);
}
.modal-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--slate-100);
  flex-wrap: wrap;
}

/* Responsive planning */
@media (max-width: 900px) {
  .admin-grid-2 { grid-template-columns: 1fr; }
  .admin-tiles { grid-template-columns: 1fr; }
  .field-row-3 { grid-template-columns: 1fr; }
  .calendar { overflow-x: auto; }
  .cal-header, .cal-body { min-width: 700px; }
}

