/* ═══════════════════════════════════════════════════════════════
   AidenTime – Global Meeting Scheduler
   style.css – Material UI (MUI) Native Design System
   ═══════════════════════════════════════════════════════════════ */

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

/* ── Design Tokens (MUI Dark Theme Default) ───────────────── */
:root {
  /* Vibrant Aiden Palette - Refined Primary & Accents */
  --clr-primary:     #6366f1; /* Indigo 500 */
  --clr-primary-h:   #4f46e5; /* Indigo 600 */
  --clr-primary-soft: rgba(99, 102, 241, 0.1);
  --clr-accent:      #f43f5e; /* Rose 500 */
  --clr-secondary:   #8b5cf6; /* Violet 500 */

  /* Dark Theme Surfaces - Deep & Layered */
  --clr-bg:          #09090b; /* Zinc 950 */
  --clr-surface:     #18181b; /* Zinc 900 */
  --clr-surface-2:   #27272a; /* Zinc 800 */
  --clr-border:      rgba(255, 255, 255, 0.08);
  --clr-input-border: rgba(255, 255, 255, 0.1);
  --clr-input-hover:  rgba(255, 255, 255, 0.2);
  
  --clr-text:        #fafafa;
  --clr-muted:       #a1a1aa;
  --clr-danger:      #ef4444;
  --clr-success:     #10b981;
  --clr-warn:        #f59e0b;

  /* Premium Slot Heat Palette */
  --slot-empty:     rgba(255, 255, 255, 0.02);
  --slot-low:       rgba(245, 158, 11, 0.15);
  --slot-mid:       rgba(245, 158, 11, 0.35);
  --slot-high:      rgba(16, 185, 129, 0.4);
  --slot-selected:  rgba(99, 102, 241, 0.3);
  --slot-final:     rgba(244, 63, 94, 0.4);

  --radius:         12px;
  --radius-sm:      8px;
  --radius-full:    9999px;
  
  /* Modern Depth Elevations */
  --shadow-sm:      0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:      0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:      0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --glass-bg:       rgba(24, 24, 27, 0.7);
  --glass-border:   rgba(255, 255, 255, 0.08);
  
  --transition:     200ms cubic-bezier(0.4, 0, 0.2, 1);
  --font-main:      'Inter', 'Roboto', system-ui, sans-serif;
  --font-heading:   'Outfit', 'Inter', sans-serif;
}

/* ── Light Theme (MUI Light Theme) ────────────────────────── */
html[data-theme="light"] {
  --clr-bg:          #f8fafc; /* Slate 50 */
  --clr-surface:     #ffffff;
  --clr-surface-2:   #f1f5f9; /* Slate 100 */
  --clr-border:      rgba(0, 0, 0, 0.06);
  --clr-input-border: rgba(0, 0, 0, 0.1);
  --clr-input-hover:  rgba(0, 0, 0, 0.2);
  
  --clr-primary:     #1976d2; /* MUI Blue 700 */
  --clr-primary-h:   #1565c0; /* MUI Blue 800 */
  --clr-accent:      #00838f; /* Cyan 800 */
  
  --clr-text:        #0f172a; /* Slate 900 */
  --clr-muted:       #64748b; /* Slate 500 */
  
  --slot-empty:      rgba(0,0,0,0.02);
  --slot-low:        rgba(245, 158, 11, 0.1);
  --slot-mid:        rgba(245, 158, 11, 0.2);
  --slot-high:       rgba(16, 185, 129, 0.25);
  --slot-selected:   rgba(99, 102, 241, 0.15);
  --slot-final:      rgba(244, 63, 94, 0.2);

  --shadow-sm:      0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md:      0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg:      0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --glass-bg:       rgba(255, 255, 255, 0.7);
  --glass-border:   rgba(0, 0, 0, 0.06);
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--clr-bg);
  color: var(--clr-text);
  line-height: 1.6;
  letter-spacing: -0.01em;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--clr-primary); text-decoration: none; transition: all var(--transition); border-bottom: 1px solid transparent; }
a:hover { border-bottom-color: var(--clr-primary); text-decoration: none; }
img { max-width: 100%; display: block; border-radius: var(--radius-sm); }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--clr-surface-2); border-radius: 5px; border: 2px solid var(--clr-bg); }
::-webkit-scrollbar-thumb:hover { background: var(--clr-muted); }

/* Selection */
::selection { background: var(--clr-primary); color: #fff; }

/* ── Layout helpers ───────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.container-sm { max-width: 600px; margin: 0 auto; padding: 0 16px; width: 100%; }

/* ── Advanced App Layout (Sidebar + Topbar) ───────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: 240px;
  background: var(--clr-surface);
  border-right: 1px solid var(--clr-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 1200;
  transition: transform 0.3s var(--transition);
}
html[data-theme="dark"] .sidebar {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-right-color: var(--glass-border);
}
.sidebar-header {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  border-bottom: 1px solid var(--clr-border);
}
.sidebar-brand {
  font-family: var(--font-heading);
  font-size: 1.5rem; font-weight: 700;
  color: var(--clr-text); text-decoration: none;
  display: flex; align-items: center; gap: 12px;
  letter-spacing: -0.02em;
}
.sidebar-brand span { color: var(--clr-primary); }

.sidebar-nav {
  display: flex; flex-direction: column; gap: 4px;
  padding: 32px 16px; flex: 1;
}
.sidebar-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  color: var(--clr-muted);
  font-size: 0.9375rem; font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
}
.sidebar-link:hover {
  background: var(--clr-surface-2);
  color: var(--clr-text);
  transform: translateX(4px);
  text-decoration: none;
}
.sidebar-link.active {
  background: var(--clr-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--clr-border);
  font-size: 0.75rem; color: var(--clr-muted);
}

/* ── Main Column & Topbar ─────────────────────────────────── */
.main-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0; /* allows children flex items to shrink below their min-content size */
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 24px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky; top: 0; z-index: 1100;
}
.topbar-title {
  font-family: var(--font-heading);
  font-size: 1.5rem; font-weight: 600;
  color: var(--clr-text);
  letter-spacing: -0.01em;
}
.topbar-tools {
  display: flex; align-items: center; gap: 24px;
}
.nav-greeting { color: var(--clr-muted); font-size: 0.875rem; font-weight: 500; }
.nav-logout { color: var(--clr-danger) !important; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; border: 1px solid rgba(239, 68, 68, 0.2); padding: 6px 14px; border-radius: var(--radius-sm); transition: all 0.2s; }
.nav-logout:hover { background: rgba(239, 68, 68, 0.1); border-bottom-color: var(--clr-danger); }

.page-content {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* ── Minimal / Guest Layout ───────────────────────────────── */
.minimal-layout .topbar { background: var(--clr-surface); box-shadow: var(--elevation-2); padding: 0 24px; border-bottom: none; }
.minimal-layout .topbar-brand { 
  font-size: 1.25rem; font-weight: 500; color: var(--clr-text); text-decoration: none; display: flex; align-items: center; gap: 8px; 
}
.minimal-layout .topbar-brand span { color: var(--clr-primary); font-weight: 700; }
.minimal-layout .nav-link { 
  color: var(--clr-text); font-size: 0.875rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.02857em;
}
.minimal-layout .nav-link:hover { text-decoration: none; opacity: 0.8; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 80px 24px 48px;
}
.hero h1 {
  font-size: clamp(2.125rem, 5vw, 3.75rem);
  font-weight: 300;
  letter-spacing: -0.00833em;
  line-height: 1.2;
  margin-bottom: 16px;
}
.hero h1 span { color: var(--clr-primary); font-weight: 400; }
.hero p { 
  color: var(--clr-muted); 
  font-size: 1.25rem; 
  font-weight: 400;
  letter-spacing: 0.015em;
  max-width: 600px; 
  margin: 0 auto 40px; 
}

/* ── Paper / Cards ────────────────────────────────────────── */
.card {
  background: var(--clr-surface);
  border-radius: var(--radius);
  padding: 24px;
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--clr-primary), var(--clr-secondary));
  opacity: 0;
  transition: opacity 0.3s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--clr-primary-soft);
}
.card:hover::before {
  opacity: 1;
}
.card-sm { padding: 24px; }

input[type="text"],
input[type="email"],
input[type="date"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--clr-bg);
  border: 1px solid var(--clr-input-border);
  border-radius: var(--radius-sm);
  color: var(--clr-text);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: all var(--transition);
  outline: none;
}
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) {
  border-color: var(--clr-primary-soft);
  background: var(--clr-surface);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--clr-primary);
  background: var(--clr-surface);
  box-shadow: 0 0 0 4px var(--clr-primary-soft);
}
textarea { resize: vertical; min-height: 100px; }
select option { background: var(--clr-surface); color: var(--clr-text); }

/* ── Buttons (MUI Contained & Outlined) ───────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 24px;
  min-width: 80px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary));
  color: #fff !important;
  border: none;
}
.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--clr-border);
  color: var(--clr-text);
}
.btn-outline:hover {
  background: var(--clr-surface-2);
  border-color: var(--clr-primary);
  color: var(--clr-primary);
}

.btn-danger { background: var(--clr-danger); color: #fff; }
.btn-success { background: var(--clr-success); color: #fff; }

.btn-full { width: 100%; padding: 12px 24px; font-size: 0.9375rem; }
.btn:disabled { 
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

/* ── Badge / Chip ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--clr-text);
  background-color: var(--clr-surface-2);
  white-space: nowrap;
  border: 1px solid var(--clr-border);
}
.badge-primary { background: var(--clr-primary-soft); color: var(--clr-primary); border-color: transparent; }
.badge-success { background: rgba(16, 185, 129, 0.1); color: var(--clr-success); border-color: transparent; }
.badge-warn    { background: rgba(245, 158, 11, 0.1); color: var(--clr-warn); border-color: transparent; }

/* ── Alert (MUI Alert) ────────────────────────────────────── */
.alert {
  display: none;
  padding: 6px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 0.875rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 12px;
}
.alert-error   { background-color: rgba(244, 67, 54, 0.16); color: #ffb4ab; }
html[data-theme="light"] .alert-error { background-color: rgb(253, 237, 237); color: rgb(95, 33, 32); }

.alert-success { background-color: rgba(76, 175, 80, 0.16); color: #a1ef9b; }
html[data-theme="light"] .alert-success { background-color: rgb(237, 247, 237); color: rgb(30, 70, 32); }

.alert-info    { background-color: rgba(33, 150, 243, 0.16); color: #a6c8ff; }
html[data-theme="light"] .alert-info { background-color: rgb(229, 246, 253); color: rgb(1, 67, 97); }

.alert { display: none; }
.alert.show { display: flex; }

/* ── Typography & Headers ─────────────────────────────────── */
.page-header { padding: 16px 0 20px; }
.page-header h1 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; }
.page-header p  { color: var(--clr-muted); font-size: 0.9375rem; margin-top: 4px; }

.section-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--clr-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

/* ── Time Slot Grid ───────────────────────────────────────── */
.slot-grid-wrap { overflow-x: auto; padding-bottom: 8px; }
.slot-day-header {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--clr-muted);
  padding: 8px 0;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.slot-grid { display: grid; gap: 4px; min-width: 600px; }
.slot-cell {
  height: 48px; /* Slightly taller for touch targets */
  border-radius: var(--radius-sm);
  background: var(--slot-empty);
  border: 1px solid var(--clr-border);
  cursor: pointer;
  transition: transform 150ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 150ms cubic-bezier(0.4, 0, 0.2, 1), border-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.slot-cell:hover { border-color: var(--clr-primary); }
.slot-cell.heat-low  { background: var(--slot-low); border-color: transparent; }
.slot-cell.heat-mid  { background: var(--slot-mid); border-color: transparent; }
.slot-cell.heat-high { background: var(--slot-high); border-color: transparent; }
.slot-cell.selected { 
  background: var(--slot-selected); 
  border-color: var(--clr-primary); 
  border-width: 2px;
}
.slot-cell.selected::after {
  content: '✓';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: var(--clr-text); font-weight: 700; font-size: 1.25rem;
}
.slot-cell.final { 
  background: var(--slot-final); 
  border-color: var(--clr-accent); 
  border-width: 2px;
  box-shadow: 0 0 12px rgba(128,222,234,0.3); 
}
.slot-cell.dnd {
  background: repeating-linear-gradient(
    135deg,
    rgba(244,67,54,.08) 0px,
    rgba(244,67,54,.08) 4px,
    transparent 4px,
    transparent 10px
  );
  border-color: rgba(244,67,54,.2);
  cursor: not-allowed;
  opacity: .6;
}
.slot-cell .slot-time {
  position: absolute;
  bottom: 4px; left: 6px;
  font-size: 0.6875rem;
  color: var(--clr-text);
  opacity: 0.7;
  pointer-events: none;
  white-space: nowrap;
}
.slot-cell .slot-count {
  position: absolute;
  top: 4px; right: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--clr-text);
}

/* ── FullCalendar.io Overrides ────────────────────────────── */
.fc {
  font-family: inherit;
  font-size: 0.875rem;
  --fc-border-color: var(--clr-border);
  --fc-page-bg-color: transparent;
  --fc-today-bg-color: var(--clr-primary-soft);
  --fc-event-bg-color: var(--clr-primary);
  --fc-event-border-color: transparent;
  --fc-highlight-color: var(--clr-primary-soft);
}
.fc .fc-toolbar-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--clr-text);
}
.fc .fc-toolbar {
  margin-bottom: 0.75rem !important;
  gap: 0.5rem;
}
.fc .fc-button-primary {
  background: var(--clr-surface-2) !important;
  border-color: transparent !important;
  color: var(--clr-text) !important;
  text-transform: capitalize;
  font-weight: 600;
  padding: 8px 16px !important;
  border-radius: var(--radius-sm) !important;
  transition: all var(--transition) !important;
}
.fc .fc-button-primary:hover {
  background: var(--clr-border) !important;
  transform: translateY(-1px);
}
.fc .fc-button-primary:not(:disabled).fc-button-active, 
.fc .fc-button-primary:not(:disabled):active {
  background: var(--clr-primary) !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}
.fc-theme-standard th, .fc-theme-standard td, .fc-theme-standard .fc-scrollgrid {
  border-color: var(--clr-border) !important;
}
.fc-col-header-cell-cushion {
  color: var(--clr-text);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 12px 4px !important;
}
.fc-timegrid-slot-label-cushion {
  color: var(--clr-muted);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 4px 8px !important;
}
.fc-timegrid-slot {
  height: 32px !important; /* Compact slots */
}
.fc-v-event {
  border-radius: var(--radius-sm) !important;
  padding: 2px 4px !important;
  border: none !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.fc-bg-selected {
  border-radius: var(--radius-sm);
  opacity: 0.85 !important;
}

/* ── Heatmap legend ───────────────────────────────────────── */
.heat-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--clr-muted);
  margin-top: 16px;
}
.heat-legend-swatch {
  width: 16px; height: 16px;
  border-radius: var(--radius-sm);
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

/* ── Suggestion cards (Lists) ─────────────────────────────── */
.suggestion-list { display: flex; flex-direction: column; gap: 8px; }
.suggestion-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--transition);
}
.suggestion-card:hover { background-color: var(--clr-surface-2); }
.suggestion-card.selected-final { border-color: var(--clr-accent); background-color: rgba(128, 222, 234, 0.08); }
.suggestion-rank {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--clr-muted);
  width: 32px;
  text-align: center;
}
.suggestion-info { flex: 1; }
.suggestion-time { font-weight: 500; font-size: 0.9375rem; }
.suggestion-meta { font-size: 0.875rem; color: var(--clr-muted); margin-top: 4px; }
.suggestion-score {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--clr-primary);
}

/* ── Participant table (MUI List Item) ────────────────────── */
.participant-list { display: flex; flex-direction: column; gap: 4px; }
.participant-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: var(--clr-surface);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
}
.participant-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  border: 2px solid var(--clr-bg);
}

/* ── OTP input ────────────────────────────────────────────── */
.otp-input {
  text-align: center;
  letter-spacing: 0.5em;
  font-size: 1.5rem !important;
  font-weight: 500;
  padding: 16.5px 0 !important;
}

/* ── Duration selector (MUI Toggle Button Group) ──────────── */
.duration-group { display: flex; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--clr-border); }
.duration-option {
  flex: 1;
  padding: 8px 12px;
  text-align: center;
  background: transparent;
  border-right: 1px solid var(--clr-border);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--clr-muted);
  text-transform: uppercase;
  transition: all var(--transition);
  user-select: none;
}
.duration-option:last-child { border-right: none; }
.duration-option:hover { background-color: rgba(255, 255, 255, 0.04); color: var(--clr-text); }
html[data-theme="light"] .duration-option:hover { background-color: rgba(0, 0, 0, 0.04); }

.duration-option.active {
  background-color: var(--clr-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}
html[data-theme="light"] .duration-option.active { background-color: var(--clr-primary); }


/* ── Shareable link (Paper) ───────────────────────────────── */
.share-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--clr-surface-2);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
}
.share-box input {
  background: none;
  border: none;
  color: var(--clr-text);
  font-weight: 400;
  flex: 1;
  outline: none;
  font-size: 0.9375rem;
  padding: 0;
}
.share-box input:focus { padding: 0; border: none; }

/* ── Modal overlay (Dialog) ───────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(2px);
  z-index: 1300; /* MUI Dialog Z */
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--clr-surface);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--elevation-4); /* Highest shadow for modals */
}
.modal-box h2 { font-size: 1.25rem; font-weight: 500; margin-bottom: 24px; letter-spacing: 0.0075em; }

/* ── Spinner (MUI CircularProgress) ───────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid transparent;
  border-top-color: var(--clr-primary);
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Divider ──────────────────────────────────────────────── */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--clr-muted);
  font-size: 0.875rem;
  margin: 24px 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--clr-border);
}

/* ── Locked banner ────────────────────────────────────────── */
.locked-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--clr-surface);
  border-left: 4px solid var(--clr-accent);
  border-radius: var(--radius-sm);
  box-shadow: var(--elevation-1);
  margin-bottom: 24px;
}
.locked-banner .icon { font-size: 1.5rem; }
.locked-banner strong { font-weight: 500; font-size: 1rem; }

/* ── Responsive breakpoints (MUI) ─────────────────────────── */
@media (max-width: 900px) { /* MUI 'md' Breakpoint */
  .sidebar { position: fixed; inset: 0; width: 280px; transform: translateX(-100%); z-index: 2000; }
  .sidebar.open { transform: translateX(0); box-shadow: var(--elevation-4); }
  /* A hamburger menu would go in topbar here normally, but assuming desktop focus right now */

  /* Stack dashboard grid */
  .idx-wrap {
    grid-template-columns: 1fr; /* Single column */
  }
  .idx-right {
    position: static; /* Remove sticky */
    max-height: none; /* Let it grow naturally */
    overflow: visible; /* Prevent scroll lock */
  }
}
@media (max-width: 600px) { /* MUI 'sm' Breakpoint */
  .topbar { padding: 0 16px; min-height: 56px; }
  .page-content { padding: 16px; }
  .hero { padding: 48px 16px 32px; }
  .card { padding: 24px 16px; }
  .stats-bar { gap: 16px; }
  .page-wrap { display: flex; flex-direction: column !important; }
  .history-sidebar { width: 100% !important; margin-bottom: 24px; }
  .main-card { max-width: 100% !important; }
}

/* ── Page transitions ─────────────────────────────────────── */
.fade-in {
  animation: fadeIn 300ms cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Index / Dashboard Grid Layout ── */
.idx-wrap {
  display: grid;
  grid-template-columns: minmax(0, 480px) 300px;
  gap: 1.5rem;
  align-items: start;
}
.main-card { min-width: 0; }
.wordmark { text-align: left; margin-bottom: 2.5rem; }
.wordmark h1 { 
  font-family: var(--font-heading);
  font-size: 2.5rem; 
  font-weight: 800; 
  letter-spacing: -0.04em; 
  line-height: 1.1;
  margin-bottom: 0.75rem; 
}
.wordmark p { 
  font-size: 1.125rem; 
  color: var(--clr-muted); 
  max-width: 500px;
  line-height: 1.5;
}

/* Duration pills */
.dur-row { display: flex; gap: .5rem; }
.dur-pill {
  flex: 1; padding: .45rem; text-align: center;
  background: var(--clr-surface); border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm); font-size: .82rem; font-weight: 500;
  cursor: pointer; transition: all .15s; user-select: none;
}
.dur-pill:hover { border-color: var(--clr-primary); }
.dur-pill.active { background: var(--clr-primary); border-color: var(--clr-primary); color: #fff; }

/* ── Calendar view toggle ── */
.view-toggle { display: flex; gap: .5rem; margin-bottom: 1rem; }
.view-toggle-btn {
  padding: .35rem .8rem; border-radius: var(--radius-sm); border: 1px solid var(--clr-border);
  background: var(--clr-surface); color: var(--clr-muted); font-size: .78rem; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.view-toggle-btn.active { 
  background: var(--clr-primary); 
  border-color: var(--clr-primary); 
  color: #fff; 
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

/* List view navigation */
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.cal-arrow {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  background: var(--clr-surface); border: 1px solid var(--clr-border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: .9rem; transition: all .15s; user-select: none;
}
.cal-arrow:hover { border-color: var(--clr-primary); color: var(--clr-primary); }
.cal-arrow.disabled { opacity: .3; pointer-events: none; }
.cal-day-label { font-size: .9rem; font-weight: 600; }
.cal-day-sub { font-size: .75rem; color: var(--clr-muted); text-align: center; }

.cal-slots { display: flex; flex-direction: column; gap: .3rem; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.cal-slots::-webkit-scrollbar { width: 4px; }
.cal-slots::-webkit-scrollbar-thumb { background: var(--clr-border); border-radius: 2px; }

.cal-slot {
  display: flex; align-items: center; justify-content: space-between;
  padding: .45rem .8rem; border-radius: var(--radius-sm);
  border: 1px solid var(--clr-border); background: var(--clr-surface);
  cursor: pointer; font-size: .83rem; user-select: none; transition: all .15s;
}
.cal-slot:hover { border-color: var(--clr-primary); }
.cal-slot.selected { 
  background: var(--clr-primary-soft); 
  border-color: var(--clr-primary); 
  box-shadow: 0 0 0 3px var(--clr-primary-soft);
}
.cal-slot.selected::after { content: '✓'; color: var(--clr-primary); font-weight: 700; }
.cal-slot.dnd { opacity: .4; cursor: not-allowed; background: repeating-linear-gradient(135deg, rgba(248, 113, 113, .06) 0, rgba(248, 113, 113, .06) 4px, transparent 4px, transparent 10px); }
.cal-slot.past { opacity: .35; pointer-events: none; }

.cal-summary { font-size: .78rem; color: var(--clr-muted); }
.cal-summary strong { color: var(--clr-text); }

/* Share card */
.share-card { text-align: center; padding: 1.5rem; }
.share-url {
  display: flex; gap: .5rem; align-items: center;
  background: var(--clr-surface); border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm); padding: .45rem .8rem; margin-bottom: .75rem;
}
.share-url input { background: none; border: none; color: var(--clr-primary); font-size: .83rem; font-weight: 500; flex: 1; outline: none; min-width: 0; }
.share-actions { display: flex; gap: .5rem; justify-content: center; margin-top: .75rem; }

/* ── Sticky Activity Panel ── */
.idx-right {
  position: sticky; top: 1.5rem;
  display: flex; flex-direction: column; gap: 1rem;
  max-height: calc(100vh - 120px); 
  overflow: hidden;
}
.panel-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  overflow: hidden;
  flex: 1;
}
.panel-title {
  padding: 0.875rem 1rem; border-bottom: 1px solid var(--clr-border);
  font-size: .75rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--clr-text);
  background: var(--clr-surface-2);
}
.panel-sub {
  padding: .75rem 1rem .25rem;
  font-size: .625rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--clr-muted);
}

/* Scrollable lists */
.hist-list { overflow-y: auto; padding: 0.25rem 1rem 1rem; }
.hist-list::-webkit-scrollbar { width: 4px; }
.hist-list::-webkit-scrollbar-thumb { background: var(--clr-border); border-radius: 2px; }

/* Ultra-dense items */
.hist-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: .75rem 0; border-bottom: 1px solid var(--clr-border);
  text-decoration: none; color: var(--clr-text); transition: background-color 0.2s;
}
.hist-item:last-child { border-bottom: none; }
.hist-item:hover { opacity: .7; }

.hist-item-title { font-size: .8125rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-item-meta { font-size: .6875rem; color: var(--clr-muted); display: flex; gap: .5rem; align-items: center; }

/* Minimal indicators */
.hist-indicator { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.hist-indicator.open   { background: #3b82f6; box-shadow: 0 0 0 2px rgba(59, 130, 246, .2); }
.hist-indicator.locked { background: #10b981; box-shadow: 0 0 0 2px rgba(16, 185, 129, .2); }

.hist-empty { font-size: .75rem; color: var(--clr-muted); padding: 1.5rem; text-align: center; font-style: italic; }

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

.dnd-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.dnd-preview {
  display: flex; align-items: center; gap: .6rem;
  padding: .75rem 1rem;
  background: rgba(244, 67, 54, 0.08);
  border: 1px solid rgba(244, 67, 54, 0.15);
  border-radius: var(--radius-sm);
  font-size: .8125rem; font-weight: 500;
  color: var(--clr-danger);
  margin-top: .75rem;
}

/* ═══════════════════════════════════════════════════════════════
   Dashboard Redesign — Phase 13 (High-Density Workspace)
   ═══════════════════════════════════════════════════════════════ */

/* ── Compact Dashboard Header ── */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: .75rem;
}
.dash-header-left { flex: 1; min-width: 0; }
.dash-header-left h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: .15rem;
  line-height: 1.3;
}
.dash-header-left .dash-subtitle {
  font-size: .8125rem;
  color: var(--clr-muted);
  margin-bottom: .5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-header-right {
  display: flex;
  gap: .5rem;
  flex-shrink: 0;
  align-items: center;
}

/* ── Stat Chips Row ── */
.stat-chips {
  display: flex;
  gap: .6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.stat-chip {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .85rem;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  box-shadow: var(--elevation-1);
  font-size: .8125rem;
  white-space: nowrap;
  transition: box-shadow var(--transition), transform var(--transition);
}
.stat-chip:hover {
  box-shadow: var(--elevation-2);
  transform: translateY(-1px);
}
.stat-chip .chip-icon {
  color: var(--clr-primary);
  display: flex;
  align-items: center;
}
.stat-chip .chip-value {
  font-weight: 700;
  font-size: .9rem;
  color: var(--clr-text);
}
.stat-chip .chip-label {
  color: var(--clr-muted);
  font-size: .75rem;
}
.stat-chip select {
  background: none;
  border: none;
  color: var(--clr-text);
  font-size: .78rem;
  padding: 0;
  cursor: pointer;
  outline: none;
  max-width: 200px;
}

/* ── Dashboard Grid ── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1.25rem;
  align-items: start;
}

/* ── Dashboard Sidebar (sticky) ── */
.dash-sidebar {
  position: sticky;
  top: 60px;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}
.dash-sidebar::-webkit-scrollbar { width: 4px; }
.dash-sidebar::-webkit-scrollbar-thumb { background: var(--clr-border); border-radius: 2px; }

/* ── Dense panel card variant ── */
.panel-card--dense .panel-title {
  padding: .6rem .75rem;
  font-size: .7rem;
}
.panel-card--dense .panel-body {
  padding: .6rem .75rem;
}

/* ── Compact Suggestion Rows ── */
.sugg-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.sugg-row:hover { background: var(--clr-surface-2); }
.sugg-row.selected-final {
  border-left-color: var(--clr-accent);
  background: rgba(128, 222, 234, 0.06);
}
.sugg-rank {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--clr-primary);
  color: var(--clr-bg);
  font-size: .7rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.sugg-info { flex: 1; min-width: 0; }
.sugg-time { font-size: .8rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sugg-meta { font-size: .7rem; color: var(--clr-muted); }
.sugg-pct {
  font-size: .75rem; font-weight: 600;
  color: var(--clr-primary);
  flex-shrink: 0;
}

/* ── Compact Participants ── */
.ptc-list {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.ptc-list::-webkit-scrollbar { width: 4px; }
.ptc-list::-webkit-scrollbar-thumb { background: var(--clr-border); border-radius: 2px; }
.ptc-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .6rem;
  font-size: .8rem;
}
.ptc-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-primary), var(--clr-secondary));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700;
  flex-shrink: 0;
  border: 1px solid var(--clr-bg);
}
.ptc-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptc-tz { font-size: .7rem; color: var(--clr-muted); }

/* ── Dashboard Responsive ── */
@media (max-width: 900px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }
  .dash-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .stat-chips { gap: .4rem; }
  .stat-chip { padding: .35rem .6rem; font-size: .75rem; }
}

/* ── Sticky Actions Bar ── */
.sticky-actions {
  position: fixed;
  bottom: 0;
  left: 240px;
  right: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--glass-border);
  padding: 12px 32px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.sticky-actions.show {
  transform: translateY(0);
}
@media (max-width: 900px) {
  .sticky-actions { left: 0; padding: 12px 20px; }
}

