/* =============================================================================
   MIC — MyClinicIA
   Design System — MyAlfred.ai Visual Identity
   ============================================================================= */

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

/* ─── Variables ──────────────────────────────────────────────────────────── */
:root {
  /* Couleurs de fond */
  --bg-primary:   #07070f;
  --bg-secondary: #0e0e1c;
  --bg-elevated:  #14142a;
  --bg-card:      rgba(255, 255, 255, 0.03);
  --bg-card-hover:rgba(255, 255, 255, 0.055);

  /* Bordures */
  --border:       rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.15);
  --border-focus: rgba(124, 58, 237, 0.5);

  /* Couleurs principales */
  --primary:       #7c3aed;
  --primary-hover: #8b5cf6;
  --primary-light: rgba(124, 58, 237, 0.15);
  --accent:        #ec4899;
  --accent-hover:  #f472b6;
  --accent-light:  rgba(236, 72, 153, 0.15);

  /* Dégradés */
  --gradient:         linear-gradient(135deg, #7c3aed 0%, #ec4899 100%);
  --gradient-subtle:  linear-gradient(135deg, rgba(124,58,237,0.12) 0%, rgba(236,72,153,0.12) 100%);
  --gradient-text:    linear-gradient(135deg, #a78bfa 0%, #f472b6 100%);

  /* Texte */
  --text:         #f1f5f9;
  --text-2:       #94a3b8;
  --text-muted:   #475569;
  --text-inverse: #07070f;

  /* Statuts */
  --success:        #10b981;
  --success-light:  rgba(16, 185, 129, 0.15);
  --warning:        #f59e0b;
  --warning-light:  rgba(245, 158, 11, 0.15);
  --danger:         #ef4444;
  --danger-light:   rgba(239, 68, 68, 0.15);
  --info:           #3b82f6;
  --info-light:     rgba(59, 130, 246, 0.15);

  /* Statuts des créneaux */
  --slot-available: #10b981;
  --slot-booked:    #3b82f6;
  --slot-blocked:   #ef4444;
  --slot-done:      #475569;
  --slot-cancelled: #f59e0b;

  /* Typographie */
  --font:      'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Fira Code', 'Cascadia Code', ui-monospace, monospace;

  /* Rayons */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 9999px;

  /* Ombres */
  --shadow-sm:   0 2px 8px  rgba(0,0,0,0.4);
  --shadow-md:   0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg:   0 20px 60px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 40px rgba(124,58,237,0.2);

  /* Transitions */
  --t:      all 0.18s ease;
  --t-slow: all 0.3s ease;

  /* Layout */
  --sidebar-w:  260px;
  --header-h:   64px;
  --content-mw: 1200px;
}

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

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

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ─── Typographie ────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p { color: var(--text-2); line-height: 1.7; }

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

.text-muted  { color: var(--text-muted); }
.text-2      { color: var(--text-2); }
.text-sm     { font-size: 0.8125rem; }
.text-xs     { font-size: 0.75rem; }
.text-lg     { font-size: 1.125rem; }
.text-center { text-align: center; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold   { font-weight: 700; }

/* ─── Layout public (page d'accueil, login) ──────────────────────────────── */
.layout-public {
  min-height: 100vh;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
}

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar-logo {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-logo .logo-mark {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-md);
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.sidebar-logo .logo-text {
  display: flex;
  flex-direction: column;
}

.sidebar-logo .logo-text span:first-child {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.sidebar-logo .logo-text span:last-child {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Navigation sidebar */
.sidebar-nav {
  flex: 1;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.sidebar-section-label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.75rem 0.5rem 0.25rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5625rem 0.75rem;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--t);
  text-decoration: none;
}

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

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

.nav-link .nav-icon {
  width: 18px; height: 18px;
  opacity: 0.7;
  flex-shrink: 0;
}

.nav-link.active .nav-icon { opacity: 1; }

.nav-link .nav-badge {
  margin-left: auto;
  background: var(--primary-light);
  color: var(--primary-hover);
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.125rem 0.4375rem;
  border-radius: var(--r-full);
}

/* Utilisateur en bas du sidebar */
.sidebar-user {
  padding: 0.75rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem;
  border-radius: var(--r-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.user-avatar {
  width: 32px; height: 32px;
  border-radius: var(--r-full);
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

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

.btn-logout-sm {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 0.25rem;
  border-radius: var(--r-sm);
  transition: var(--t);
  display: flex; align-items: center;
}
.btn-logout-sm:hover { color: var(--danger); background: var(--danger-light); }

/* Main content admin */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.admin-header {
  height: var(--header-h);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.admin-header .page-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.admin-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-content {
  flex: 1;
  padding: 1.75rem;
  max-width: var(--content-mw);
  width: 100%;
}

/* ─── Layout Client ──────────────────────────────────────────────────────── */
.layout-client { min-height: 100vh; display: flex; flex-direction: column; }

.client-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky; top: 0; z-index: 50;
}

.client-logo {
  display: flex; align-items: center; gap: 0.625rem;
  text-decoration: none;
}
.client-logo .logo-icon {
  width: 32px; height: 32px;
  border-radius: var(--r-md);
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem; font-weight: 800; color: #fff;
}
.client-logo span {
  font-size: 1.0625rem; font-weight: 800; color: var(--text);
}

.client-nav {
  display: flex; align-items: center; gap: 0.25rem;
}
.client-nav a {
  padding: 0.375rem 0.75rem;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-2);
}
.client-nav a:hover, .client-nav a.active { color: var(--text); background: var(--bg-card-hover); }

.client-header-right {
  display: flex; align-items: center; gap: 0.75rem;
}

.client-main { flex: 1; padding: 1.75rem; }

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  transition: var(--t);
}

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

.card-glass {
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--r-lg);
}

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

.card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

/* Stat cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: var(--t);
}

.stat-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

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

.stat-icon.purple { background: var(--primary-light); }
.stat-icon.pink   { background: var(--accent-light); }
.stat-icon.green  { background: var(--success-light); }
.stat-icon.blue   { background: var(--info-light); }

.stat-body { flex: 1; min-width: 0; }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.25rem; }
.stat-delta { font-size: 0.75rem; margin-top: 0.375rem; }
.stat-delta.up   { color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* ─── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5625rem 1.125rem;
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: var(--font);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--t);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

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

.btn-primary {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(124,58,237,0.35);
}
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(124,58,237,0.45);
  transform: translateY(-1px);
  color: #fff;
}

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

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border-color: rgba(239,68,68,0.3);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: transparent;
}

.btn-success {
  background: var(--success-light);
  color: var(--success);
  border-color: rgba(16,185,129,0.3);
}
.btn-success:hover {
  background: var(--success);
  color: #fff;
  border-color: transparent;
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text); }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }

.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--r-md); }
.btn-icon.btn-sm { width: 30px; height: 30px; }

.btn-google {
  background: #fff;
  color: #1a1a1a;
  border-color: rgba(0,0,0,0.15);
  font-weight: 600;
  gap: 0.625rem;
}
.btn-google:hover { background: #f5f5f5; color: #1a1a1a; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-google img { width: 18px; height: 18px; }

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 0.375rem;
}

.form-control {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9375rem;
  padding: 0.625rem 0.875rem;
  transition: var(--t);
  outline: none;
  appearance: none;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}

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

select.form-control {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}

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

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

.form-control.error { border-color: rgba(239,68,68,0.5); }

/* ─── Badges / Statuts ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3125rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

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

.badge-booked { background: var(--info-light); color: var(--info); }
.badge-booked::before { background: var(--info); }

.badge-blocked { background: var(--danger-light); color: var(--danger); }
.badge-blocked::before { background: var(--danger); }

.badge-done { background: rgba(71,85,105,0.2); color: var(--text-muted); }
.badge-done::before { background: var(--text-muted); }

.badge-cancelled { background: var(--warning-light); color: var(--warning); }
.badge-cancelled::before { background: var(--warning); }

.badge-confirmed { background: var(--success-light); color: var(--success); }
.badge-confirmed::before { background: var(--success); }

.badge-primary { background: var(--primary-light); color: var(--primary-hover); }
.badge-primary::before { background: var(--primary-hover); }

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

table { width: 100%; border-collapse: collapse; }

thead { background: var(--bg-elevated); }

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

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--t);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-card-hover); }

tbody td {
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: var(--text);
  vertical-align: middle;
}

.td-muted { color: var(--text-2); }
.td-sm    { font-size: 0.8125rem; }

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

.alert-success { background: var(--success-light); color: var(--success); border-color: rgba(16,185,129,0.3); }
.alert-error   { background: var(--danger-light);  color: var(--danger);  border-color: rgba(239,68,68,0.3); }
.alert-warning { background: var(--warning-light); color: var(--warning); border-color: rgba(245,158,11,0.3); }
.alert-info    { background: var(--info-light);    color: var(--info);    border-color: rgba(59,130,246,0.3); }

/* ─── Toast notifications ────────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--r-md);
  min-width: 280px;
  max-width: 380px;
  font-size: 0.875rem;
  font-weight: 500;
  pointer-events: auto;
  animation: toastIn 0.25s ease forwards;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  border: 1px solid;
}

.toast-success { background: rgba(16,185,129,0.15);  color: var(--success); border-color: rgba(16,185,129,0.3); }
.toast-error   { background: rgba(239,68,68,0.15);   color: var(--danger);  border-color: rgba(239,68,68,0.3); }
.toast-warning { background: rgba(245,158,11,0.15);  color: var(--warning); border-color: rgba(245,158,11,0.3); }
.toast-info    { background: rgba(59,130,246,0.15);  color: var(--info);    border-color: rgba(59,130,246,0.3); }

.toast-dismiss {
  margin-left: auto;
  background: none; border: none;
  cursor: pointer; color: inherit; opacity: 0.6;
  padding: 0;
  transition: var(--t);
}
.toast-dismiss:hover { opacity: 1; }

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

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

/* ─── Page sections ──────────────────────────────────────────────────────── */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.25rem;
}

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

.page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

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

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; }

/* ─── Slots visuels ──────────────────────────────────────────────────────── */
.slot-list { display: flex; flex-direction: column; gap: 0.5rem; }

.slot-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: var(--t);
}

.slot-item:hover { border-color: var(--border-hover); }

.slot-time {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 90px;
}

.slot-subject { flex: 1; font-size: 0.875rem; color: var(--text-2); }

.slot-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.slot-dot.available { background: var(--slot-available); }
.slot-dot.booked    { background: var(--slot-booked); }
.slot-dot.blocked   { background: var(--slot-blocked); }
.slot-dot.done      { background: var(--slot-done); }
.slot-dot.cancelled { background: var(--slot-cancelled); }

.slot-item.available:hover { border-color: rgba(16,185,129,0.3); cursor: pointer; }

/* ─── Page d'accueil publique ────────────────────────────────────────────── */
.public-hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.public-hero::before {
  content: '';
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  background: radial-gradient(ellipse, rgba(124,58,237,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.public-hero::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(ellipse, rgba(236,72,153,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 1;
  max-width: 680px;
}

.hero-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.hero-logo-icon {
  width: 56px; height: 56px;
  border-radius: var(--r-lg);
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.hero-logo-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-logo-text .brand {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.hero-logo-text .tagline-sm {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.05em;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary-light);
  border: 1px solid rgba(124,58,237,0.3);
  color: var(--primary-hover);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.375rem 0.875rem;
  border-radius: var(--r-full);
  margin-bottom: 1.25rem;
}

.hero-title {
  font-size: 3rem;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
  color: var(--text);
}

.hero-subtitle {
  font-size: 1.0625rem;
  color: var(--text-2);
  margin-bottom: 2.5rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.hero-features {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.hero-feature {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.hero-feature-icon {
  width: 28px; height: 28px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem;
}

/* ─── Page auth (login) ──────────────────────────────────────────────────── */
.auth-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  overflow: hidden;
}

.auth-wrapper::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 500px; height: 500px;
  background: radial-gradient(ellipse, rgba(124,58,237,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.auth-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 2rem;
}

.auth-logo .logo-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 800; color: #fff;
  box-shadow: var(--shadow-glow);
}

.auth-logo .logo-name { font-size: 1.25rem; font-weight: 800; color: var(--text); }

.auth-card h2 { font-size: 1.375rem; font-weight: 700; margin-bottom: 0.375rem; }
.auth-card .auth-desc { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1.75rem; }

.auth-divider {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 1.25rem 0;
}
.auth-divider span { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-footer {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ─── Public footer ──────────────────────────────────────────────────────── */
.public-footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* ─── Dashboard widgets ──────────────────────────────────────────────────── */
.upcoming-list { display: flex; flex-direction: column; gap: 0.625rem; }

.visit-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: var(--t);
}
.visit-item:hover { border-color: var(--border-hover); }

.visit-date-block {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--primary-light);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.visit-date-block .day   { font-size: 1.25rem; font-weight: 800; color: var(--primary-hover); line-height: 1; }
.visit-date-block .month { font-size: 0.5625rem; font-weight: 600; color: var(--primary-hover); text-transform: uppercase; }

.visit-info { flex: 1; min-width: 0; }
.visit-info .company { font-size: 0.9375rem; font-weight: 600; color: var(--text); }
.visit-info .session { font-size: 0.8125rem; color: var(--text-muted); }

.visit-slots { text-align: right; flex-shrink: 0; }
.visit-slots .count  { font-size: 1rem; font-weight: 700; color: var(--text); }
.visit-slots .label  { font-size: 0.6875rem; color: var(--text-muted); }

/* ─── Empty states ───────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h4 { font-size: 1rem; color: var(--text-2); margin-bottom: 0.375rem; }
.empty-state p  { font-size: 0.875rem; max-width: 300px; }

/* ─── Filters / Search ───────────────────────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.search-input-wrapper .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input-wrapper .form-control { padding-left: 2.25rem; }

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 1.25rem;
}

.pagination a, .pagination span {
  padding: 0.375rem 0.625rem;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  border: 1px solid var(--border);
  color: var(--text-2);
  background: var(--bg-card);
}
.pagination a:hover { border-color: var(--border-hover); color: var(--text); }
.pagination .active { background: var(--primary-light); border-color: transparent; color: var(--primary-hover); }

/* ─── Modals ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 1.75rem;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  transition: transform 0.2s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.modal-header h3 { font-size: 1.125rem; font-weight: 700; }

.modal-close {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--r-sm);
  cursor: pointer; color: var(--text-muted);
  transition: var(--t);
}
.modal-close:hover { color: var(--text); background: var(--bg-card-hover); }

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

/* ─── FullCalendar overrides ─────────────────────────────────────────────── */
.fc {
  --fc-border-color: var(--border);
  --fc-button-bg-color: var(--bg-elevated);
  --fc-button-border-color: var(--border);
  --fc-button-hover-bg-color: var(--bg-card-hover);
  --fc-button-hover-border-color: var(--border-hover);
  --fc-button-active-bg-color: var(--primary-light);
  --fc-button-active-border-color: transparent;
  --fc-button-text-color: var(--text);
  --fc-today-bg-color: rgba(124,58,237,0.07);
  --fc-page-bg-color: transparent;
  --fc-neutral-bg-color: var(--bg-elevated);
  --fc-list-event-hover-bg-color: var(--bg-card-hover);
  --fc-small-font-size: 0.8125rem;
  font-family: var(--font);
  font-size: 0.875rem;
}

.fc .fc-toolbar-title { font-size: 1.125rem; font-weight: 700; color: var(--text); }
.fc .fc-col-header-cell-cushion { color: var(--text-2); font-weight: 600; font-size: 0.8125rem; text-decoration: none; }
.fc .fc-daygrid-day-number { color: var(--text-2); font-size: 0.875rem; text-decoration: none; }
.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number { color: var(--primary-hover); font-weight: 700; }
.fc .fc-button { font-family: var(--font); font-size: 0.8125rem; font-weight: 600; border-radius: var(--r-sm); }
.fc .fc-event { border-radius: var(--r-sm); border: none; font-size: 0.8125rem; cursor: pointer; }
.fc .fc-event-available { background: rgba(16,185,129,0.8); }
.fc .fc-event-booked    { background: rgba(59,130,246,0.85); }
.fc .fc-event-blocked   { background: rgba(239,68,68,0.75); }
.fc .fc-event-done      { background: rgba(71,85,105,0.7); }
.fc .fc-event-cancelled { background: rgba(245,158,11,0.75); }

/* ─── Utilities ──────────────────────────────────────────────────────────── */
.flex    { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1  { gap: 0.25rem; }
.gap-2  { gap: 0.5rem; }
.gap-3  { gap: 0.75rem; }
.gap-4  { gap: 1rem; }
.gap-5  { gap: 1.25rem; }
.gap-6  { gap: 1.5rem; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-auto { margin-left: auto; }

.w-full  { width: 100%; }
.hidden  { display: none; }

.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3     { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    z-index: 200;
  }
  .sidebar.open { transform: translateX(0); }

  .admin-main { margin-left: 0; }

  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }

  .hero-title { font-size: 2.25rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }

  .page-header-row { flex-direction: column; }

  .sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    cursor: pointer;
    color: var(--text);
  }
}

@media (min-width: 769px) {
  .sidebar-toggle { display: none; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .admin-content { padding: 1rem; }
  .auth-card { padding: 1.5rem; }
  .hero-title { font-size: 1.875rem; }
}

/* ─── Scrollbar ──────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ─── Sidebar overlay (mobile) ───────────────────────────────────────────── */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 150;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }
