/* MonMap Portal - Main Stylesheet */

:root {
  --primary: #1a56db;
  --primary-dark: #1240a6;
  --primary-light: #e8f0fe;
  --secondary: #c9950c;
  --secondary-light: #fef3c7;
  --success: #059669;
  --success-light: #d1fae5;
  --warning: #d97706;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --white: #ffffff;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
  --sidebar-width: 260px;
  --font: 'Segoe UI', 'Arial Unicode MS', Arial, sans-serif;
}

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

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

body {
  font-family: var(--font);
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

button { cursor: pointer; font-family: var(--font); outline: none; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-sm); }

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 { line-height: 1.3; font-weight: 700; color: var(--gray-900); }
h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }

p { color: var(--gray-600); }

/* ── Utility Classes ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container-sm { max-width: 640px; margin: 0 auto; padding: 0 24px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--gray-500); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  border: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  line-height: 1;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--white); }
.btn-secondary {
  background: var(--secondary);
  color: var(--white);
  border-color: var(--secondary);
}
.btn-secondary:hover:not(:disabled) { background: #b5820a; border-color: #b5820a; color: var(--white); }
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}
.btn-outline:hover:not(:disabled) { background: var(--primary); color: var(--white); }
.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border-color: var(--gray-300);
}
.btn-ghost:hover:not(:disabled) { background: var(--gray-100); color: var(--gray-800); }
.btn-danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) { background: #b91c1c; border-color: #b91c1c; color: var(--white); }
.btn-success {
  background: var(--success);
  color: var(--white);
  border-color: var(--success);
}
.btn-success:hover:not(:disabled) { background: #047857; color: var(--white); }
.btn-sm { padding: 7px 14px; font-size: 0.8125rem; }
.btn-lg { padding: 14px 28px; font-size: 1.0625rem; }
.btn-xl { padding: 16px 36px; font-size: 1.125rem; }
.btn-icon { padding: 10px; }
.btn-icon.btn-sm { padding: 7px; }

/* ── Forms ── */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-label .required { color: var(--danger); margin-left: 3px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: var(--font);
  color: var(--gray-800);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,0.12); }
.form-control::placeholder { color: var(--gray-400); }
.form-control:disabled { background: var(--gray-100); color: var(--gray-500); }
select.form-control { appearance: none; 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/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: 0.8125rem; color: var(--gray-500); margin-top: 4px; }
.form-error { font-size: 0.8125rem; color: var(--danger); margin-top: 4px; display: none; }
.form-group.has-error .form-control { border-color: var(--danger); }
.form-group.has-error .form-error { display: block; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Cards ── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title { font-size: 1rem; font-weight: 700; color: var(--gray-800); }
.card-body { padding: 24px; }
.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  background: var(--gray-50);
}

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-success { background: var(--success-light); color: var(--success); }
.badge-warning { background: var(--warning-light); color: var(--warning); }
.badge-danger { background: var(--danger-light); color: var(--danger); }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ── Alerts ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.alert-icon { flex-shrink: 0; font-size: 1.1rem; }
.alert-info { background: var(--primary-light); color: var(--primary-dark); }
.alert-success { background: var(--success-light); color: var(--success); }
.alert-warning { background: var(--warning-light); color: var(--warning); }
.alert-danger { background: var(--danger-light); color: var(--danger); }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; }
th { font-size: 0.8125rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.04em; background: var(--gray-50); border-bottom: 2px solid var(--gray-200); }
td { font-size: 0.9rem; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* ── Top Navigation (public pages) ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 68px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  z-index: 1000;
  display: flex;
  align-items: center;
}
.navbar .container {
  width: 100%;
  max-width: 1200px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--gray-900);
}
.nav-logo .logo-icon {
  width: 38px; height: 38px;
  background: var(--primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0;
  background-image: url('../assets/logo-mark-white.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70%;
}
.nav-logo span.accent { color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-600);
  transition: all var(--transition);
}
.nav-links a:hover { color: var(--gray-900); background: var(--gray-100); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
}
.nav-hamburger span { display: block; width: 22px; height: 2px; background: var(--gray-700); border-radius: 2px; transition: all var(--transition); }

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

.sidebar {
  width: var(--sidebar-width);
  background: var(--gray-900);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}
.sidebar-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--white);
}
.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  color: transparent;
  flex-shrink: 0;
  background-image: url('../assets/logo-mark-white.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70%;
}
.sidebar-logo span.accent { color: #60a5fa; }

.sidebar-business {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.business-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.07);
  border-radius: var(--radius);
}
.business-avatar {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--secondary), #f59e0b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.business-info { min-width: 0; }
.business-name { font-size: 0.875rem; font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.business-type { font-size: 0.75rem; color: var(--gray-400); }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section-label {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  padding: 0 8px;
  margin: 16px 0 6px;
}
.nav-section-label:first-child { margin-top: 0; }
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--gray-400);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all var(--transition);
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.07); color: var(--white); }
.sidebar-nav a.active { background: rgba(26,86,219,0.25); color: #93c5fd; }
.sidebar-nav a .nav-icon,
.sidebar-footer a .nav-icon,
.sidebar-footer button .nav-icon {
  font-size: 1.1rem;
  width: 20px; height: 20px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sidebar-nav a .nav-icon svg,
.sidebar-footer a .nav-icon svg,
.sidebar-footer button .nav-icon svg { width: 18px; height: 18px; }
.sidebar-nav .nav-disabled {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--gray-600);
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 2px;
  cursor: not-allowed;
  opacity: 0.55;
}
.sidebar-nav .nav-disabled .nav-icon { width: 20px; height: 20px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.sidebar-nav .nav-disabled .nav-icon svg { width: 18px; height: 18px; }
.sidebar-nav .nav-disabled .soon-pill {
  margin-left: auto;
  background: rgba(255,255,255,0.08);
  color: var(--gray-400);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
}
.sidebar-footer button.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--gray-400);
  background: transparent;
  border: none;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
}
.sidebar-footer button.nav-link:hover { background: rgba(255,255,255,0.07); color: var(--white); }
.notification-btn svg { width: 18px; height: 18px; stroke: currentColor; }
.sidebar-nav a .nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  color: var(--gray-400);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
}
.sidebar-footer a:hover { background: rgba(255,255,255,0.07); color: var(--white); }

/* ── Main Content Area ── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.top-bar {
  height: 64px;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.top-bar-left { display: flex; align-items: center; gap: 12px; }
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--gray-600);
  font-size: 1.25rem;
  cursor: pointer;
}
.page-title { font-size: 1.0625rem; font-weight: 700; color: var(--gray-800); }
.top-bar-right { display: flex; align-items: center; gap: 12px; }
.top-bar-avatar {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 0.9rem;
  cursor: pointer;
  flex-shrink: 0;
}
.notification-btn {
  position: relative;
  background: var(--gray-100);
  border: none;
  border-radius: var(--radius);
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-600);
  font-size: 1.1rem;
  transition: all var(--transition);
}
.notification-btn:hover { background: var(--gray-200); }
.notification-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 999px;
  border: 2px solid var(--white);
}

.page-content { padding: 28px; flex: 1; }

/* ── Dashboard Stats ── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 28px; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border: 1px solid var(--gray-100);
  transition: box-shadow var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.375rem;
  flex-shrink: 0;
}
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: var(--success); }
.stat-icon.amber { background: var(--warning-light); color: var(--warning); }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-body { flex: 1; min-width: 0; }
.stat-value { font-size: 1.75rem; font-weight: 800; color: var(--gray-900); line-height: 1; }
.stat-label { font-size: 0.8125rem; color: var(--gray-500); margin-top: 4px; }
.stat-change {
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 3px;
}
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ── Schedule / Timeline ── */
.schedule-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
}
.schedule-item:last-child { border-bottom: none; }
.schedule-time {
  min-width: 70px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-500);
  padding-top: 2px;
}
.schedule-dot {
  width: 10px; height: 10px;
  border-radius: 999px;
  margin-top: 5px;
  flex-shrink: 0;
}
.schedule-dot.confirmed { background: var(--success); }
.schedule-dot.pending { background: var(--warning); }
.schedule-dot.canceled { background: var(--danger); }
.schedule-info { flex: 1; }
.schedule-name { font-size: 0.9375rem; font-weight: 600; color: var(--gray-800); }
.schedule-service { font-size: 0.8125rem; color: var(--gray-500); margin-top: 2px; }
.schedule-actions { display: flex; gap: 6px; align-items: center; }

/* ── Steps (registration) ── */
.steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 40px;
}
.step-item {
  display: flex;
  align-items: center;
}
.step-circle {
  width: 36px; height: 36px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.875rem;
  font-weight: 700;
  border: 2px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-400);
  transition: all var(--transition);
  z-index: 1;
  position: relative;
}
.step-item.active .step-circle { border-color: var(--primary); background: var(--primary); color: var(--white); }
.step-item.done .step-circle { border-color: var(--success); background: var(--success); color: var(--white); }
.step-label { font-size: 0.8125rem; margin-top: 6px; color: var(--gray-500); white-space: nowrap; }
.step-item.active .step-label { color: var(--primary); font-weight: 600; }
.step-item.done .step-label { color: var(--success); }
.step-connector {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  min-width: 40px;
  max-width: 80px;
  margin-bottom: 26px;
}
.step-connector.done { background: var(--success); }
.step-wrapper { display: flex; flex-direction: column; align-items: center; }

/* ── Calendar/Booking grid ── */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.cal-day-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-align: center;
  padding: 6px 0;
}
.cal-day {
  aspect-ratio: 1;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  background: var(--white);
  border: 1px solid var(--gray-100);
}
.cal-day:hover { border-color: var(--primary); background: var(--primary-light); }
.cal-day.today { background: var(--primary); color: var(--white); border-color: var(--primary); font-weight: 700; }
.cal-day.has-bookings::after { content: ''; position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; background: var(--secondary); border-radius: 999px; }
.cal-day.today.has-bookings::after { background: white; }
.cal-day.other-month { color: var(--gray-300); background: var(--gray-50); }
.cal-day.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); font-weight: 700; }

/* ── Modals ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
}
.modal-title { font-size: 1.0625rem; font-weight: 700; color: var(--gray-900); }
.modal-close {
  width: 32px; height: 32px;
  background: var(--gray-100);
  border: none;
  border-radius: var(--radius);
  color: var(--gray-500);
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--gray-200); color: var(--gray-800); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-100); display: flex; gap: 10px; justify-content: flex-end; }

/* ── Toast notifications ── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 380px;
  border-left: 4px solid var(--primary);
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast.show { transform: translateX(0); }
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.toast-body { flex: 1; }
.toast-title { font-size: 0.875rem; font-weight: 700; color: var(--gray-800); }
.toast-msg { font-size: 0.8125rem; color: var(--gray-500); margin-top: 2px; }

/* ── Verification status card ── */
.verify-status {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}
.verify-status.pending { background: var(--warning-light); border: 1px solid rgba(217,119,6,0.2); }
.verify-status.verified { background: var(--success-light); border: 1px solid rgba(5,150,105,0.2); }
.verify-status.rejected { background: var(--danger-light); border: 1px solid rgba(220,38,38,0.2); }
.verify-icon { font-size: 1.75rem; flex-shrink: 0; }
.verify-info .verify-title { font-size: 0.9375rem; font-weight: 700; color: var(--gray-800); }
.verify-info .verify-desc { font-size: 0.8125rem; color: var(--gray-600); margin-top: 2px; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--gray-500);
}
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h4 { font-size: 1rem; color: var(--gray-600); margin-bottom: 8px; }
.empty-state p { font-size: 0.875rem; }

/* ── Search bar ── */
.search-bar {
  position: relative;
  flex: 1;
  max-width: 340px;
}
.search-bar input {
  width: 100%;
  padding: 9px 16px 9px 40px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.9rem;
  background: var(--gray-50);
  color: var(--gray-800);
  outline: none;
  transition: all var(--transition);
}
.search-bar input:focus { border-color: var(--primary); background: var(--white); box-shadow: 0 0 0 3px rgba(26,86,219,0.1); }
.search-bar .search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--gray-400); font-size: 0.9rem; pointer-events: none; }

/* ── Filter chips ── */
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 2px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
  transition: all var(--transition);
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { border-color: var(--primary); background: var(--primary); color: var(--white); }

/* ── Time slot picker ── */
.time-slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.time-slot {
  padding: 8px 4px;
  border-radius: var(--radius);
  border: 2px solid var(--gray-200);
  background: var(--white);
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  transition: all var(--transition);
}
.time-slot:hover { border-color: var(--primary); color: var(--primary); }
.time-slot.active { border-color: var(--primary); background: var(--primary); color: var(--white); }
.time-slot.booked { background: var(--gray-100); color: var(--gray-400); cursor: not-allowed; border-color: transparent; }

/* ── Auth pages ── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
}
.auth-left {
  flex: 1;
  background: linear-gradient(145deg, var(--gray-900) 0%, #1a3a6b 50%, #1a56db 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px;
  min-height: 100vh;
}
.auth-right {
  width: 480px;
  flex-shrink: 0;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}
.auth-form-wrap { width: 100%; max-width: 380px; }
.auth-title { font-size: 1.625rem; font-weight: 800; color: var(--gray-900); margin-bottom: 8px; }
.auth-subtitle { font-size: 0.9375rem; color: var(--gray-500); margin-bottom: 32px; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--gray-400); font-size: 0.875rem; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }

/* ── Landing page sections ── */
.hero {
  padding: 140px 0 80px;
  background: linear-gradient(160deg, #f8faff 0%, #eef2ff 60%, #f8faff 100%);
  overflow: hidden;
  position: relative;
}
.hero::before {
  content: '';
  position: absolute;
  top: -100px; right: -200px;
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(26,86,219,0.08) 0%, transparent 70%);
  border-radius: 999px;
  pointer-events: none;
}
.hero-content { max-width: 560px; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.hero h1 { font-size: 3rem; line-height: 1.15; color: var(--gray-900); margin-bottom: 20px; }
.hero h1 span { color: var(--primary); }
.hero p { font-size: 1.0625rem; color: var(--gray-600); line-height: 1.7; margin-bottom: 36px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-image {
  flex: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 420px;
  width: 100%;
}
.hero-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
}
.hero-card.wide { grid-column: 1 / -1; }
.hero-card-label { font-size: 0.75rem; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.hero-card-value { font-size: 1.625rem; font-weight: 800; color: var(--gray-900); }
.hero-card-sub { font-size: 0.8125rem; color: var(--success); font-weight: 600; margin-top: 4px; }

.section { padding: 80px 0; }
.section-alt { background: var(--white); }
.section-header { text-align: center; max-width: 600px; margin: 0 auto 56px; }
.section-eyebrow {
  display: inline-block;
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
.section-header h2 { font-size: 2.25rem; color: var(--gray-900); margin-bottom: 16px; }
.section-header p { font-size: 1rem; color: var(--gray-500); line-height: 1.7; }

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.feature-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--gray-200);
  transition: all var(--transition);
}
.feature-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.feature-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  background: var(--primary-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 18px;
}
.feature-card h3 { font-size: 1.0625rem; color: var(--gray-900); margin-bottom: 10px; }
.feature-card p { font-size: 0.9rem; color: var(--gray-500); line-height: 1.65; }

.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.how-item { text-align: center; }
.how-number {
  width: 56px; height: 56px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), #3b82f6);
  color: white;
  font-size: 1.25rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
}
.how-item h3 { font-size: 1.0625rem; color: var(--gray-800); margin-bottom: 10px; }
.how-item p { font-size: 0.9rem; color: var(--gray-500); }

.testimonials-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.testimonial-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
}
.testimonial-stars { color: var(--secondary); font-size: 0.9rem; margin-bottom: 12px; }
.testimonial-text { font-size: 0.9rem; color: var(--gray-600); line-height: 1.7; margin-bottom: 16px; font-style: italic; }
.testimonial-author { display: flex; align-items: center; gap: 10px; }
.testimonial-avatar {
  width: 40px; height: 40px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.875rem; color: white;
}
.testimonial-name { font-size: 0.875rem; font-weight: 700; color: var(--gray-800); }
.testimonial-biz { font-size: 0.8125rem; color: var(--gray-500); }

.cta-section {
  background: linear-gradient(135deg, var(--gray-900) 0%, #1a3a6b 100%);
  padding: 80px 0;
  text-align: center;
  color: white;
}
.cta-section h2 { color: white; font-size: 2.25rem; margin-bottom: 16px; }
.cta-section p { color: rgba(255,255,255,0.7); font-size: 1.0625rem; margin-bottom: 36px; max-width: 520px; margin-left: auto; margin-right: auto; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 56px 0 32px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 48px; }
.footer-brand .footer-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.25rem; font-weight: 800; color: white;
  margin-bottom: 14px;
}
.footer-brand p { font-size: 0.875rem; line-height: 1.7; max-width: 280px; }
.footer-col h5 { font-size: 0.875rem; font-weight: 700; color: white; margin-bottom: 16px; }
.footer-col a { display: block; font-size: 0.875rem; color: var(--gray-400); margin-bottom: 10px; transition: color var(--transition); }
.footer-col a:hover { color: white; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 28px; display: flex; align-items: center; justify-content: space-between; font-size: 0.8125rem; }

/* ── Progress bar ── */
.progress-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #3b82f6);
  border-radius: 999px;
  transition: width 0.5s ease;
}

/* ── Tabs ── */
.tabs { border-bottom: 2px solid var(--gray-200); display: flex; gap: 0; margin-bottom: 24px; }
.tab {
  padding: 12px 20px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all var(--transition);
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
}
.tab:hover { color: var(--gray-800); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

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

@media (max-width: 900px) {
  .features-grid, .how-grid, .testimonials-grid { grid-template-columns: 1fr 1fr; }
  .hero { padding: 120px 0 60px; }
  .hero-image { display: none; }
  .auth-left { display: none; }
  .auth-right { width: 100%; padding: 32px 24px; }
  .auth-page { min-height: 100vh; display: block; }
}

@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.625rem; }
  .section { padding: 56px 0; }
  .section-header h2 { font-size: 1.75rem; }
  .container { padding: 0 16px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
    display: none;
  }
  .sidebar-backdrop.open { display: block; }
  .main-content { margin-left: 0; }
  .mobile-menu-btn { display: flex; }

  .page-content { padding: 20px 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .features-grid, .how-grid, .testimonials-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .time-slots { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { font-size: 2.25rem; }
  .top-bar { padding: 0 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .steps-bar { gap: 0; }
  .step-connector { min-width: 20px; }
  .auth-right { padding: 24px 16px; }
  .cta-actions { flex-direction: column; align-items: center; }
  .tabs { overflow-x: auto; }
  .filter-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
}

/* ── Mobile nav overlay ── */
.mobile-nav {
  display: none;
  position: fixed;
  top: 68px; left: 0; right: 0;
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 16px;
  z-index: 999;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--gray-700);
  transition: all var(--transition);
}
.mobile-nav a:hover { background: var(--gray-100); }

/* ── Skeleton loaders ──
   Use while waiting for Supabase data: drop in a .skel block with the rough
   shape of the final content. Pages should remove these once data arrives
   (or just overwrite the container's innerHTML). */
@keyframes skel-shimmer {
  0%   { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.skel {
  display: block;
  background: var(--gray-100);
  background-image: linear-gradient(
    90deg,
    var(--gray-100) 0px,
    var(--gray-200) 80px,
    var(--gray-100) 160px
  );
  background-size: 200px 100%;
  background-repeat: no-repeat;
  border-radius: var(--radius-sm);
  animation: skel-shimmer 1.4s ease-in-out infinite;
  color: transparent;
  user-select: none;
}
.skel-text  { height: 0.875rem; width: 100%; margin: 6px 0; }
.skel-title { height: 1.25rem; width: 60%;  margin: 8px 0; }
.skel-line-sm { height: 0.75rem;  width: 40%;  margin: 4px 0; }
.skel-line-lg { height: 1rem;     width: 80%;  margin: 6px 0; }
.skel-circle { border-radius: 999px; }
.skel-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.skel-stat {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.skel-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
}
.skel-row:last-child { border-bottom: none; }
.skel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

/* ── Dark mode ──
   Triggered by adding data-theme="dark" to <html>. The bootstrap snippet in
   each authenticated page checks localStorage('mm_theme') and writes the
   attribute before paint to avoid flash. We override the token layer only,
   so every component (buttons, badges, alerts, forms, tables) inherits the
   new palette without touching their selectors. */
:root[data-theme="dark"] {
  --primary:        #5b8def;
  --primary-dark:   #3b6fd8;
  --primary-light:  #1c2740;
  --secondary:      #d4a73a;
  --secondary-light:#2a2210;
  --success:        #34d399;
  --success-light:  #0f2a1f;
  --warning:        #fbbf24;
  --warning-light:  #2a200d;
  --danger:         #f87171;
  --danger-light:   #2a1414;
  --gray-50:        #0d1219;
  --gray-100:       #151b25;
  --gray-200:       #1f2733;
  --gray-300:       #2c3645;
  --gray-400:       #5a6678;
  --gray-500:       #8a93a3;
  --gray-600:       #b0b8c5;
  --gray-700:       #cdd3dc;
  --gray-800:       #e3e7ec;
  --gray-900:       #f5f7fa;
  --white:          #161c26;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.40), 0 1px 2px rgba(0,0,0,0.30);
  --shadow:    0 4px 12px rgba(0,0,0,0.45), 0 2px 4px rgba(0,0,0,0.30);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.55), 0 4px 8px rgba(0,0,0,0.35);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.60);
  color-scheme: dark;
}
:root[data-theme="dark"] body { background: var(--gray-50); color: var(--gray-700); }
:root[data-theme="dark"] img:not([src*=".svg"]) { filter: brightness(0.92); }
/* Sidebar uses --gray-900 which inverts to near-white in dark mode; pin it to
   a dark panel tone so it stays dark in both themes. */
:root[data-theme="dark"] .sidebar { background: var(--gray-100); }
:root[data-theme="dark"] .skel {
  background: var(--gray-100);
  background-image: linear-gradient(
    90deg,
    var(--gray-100) 0px,
    var(--gray-200) 80px,
    var(--gray-100) 160px
  );
}

/* Theme toggle button — drop a <button class="theme-toggle"> in any header. */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
}
.theme-toggle:hover { background: var(--gray-200); }
.theme-toggle:active { transform: scale(0.92); }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-sun  { display: inline; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.mobile-nav .divider { height: 1px; background: var(--gray-200); margin: 8px 0; }
