/* ==========================================================================
   WEI PLANNING STAFF — DESIGN SYSTEM (Linear / Vercel / Raycast Dark Aesthetic)
   ========================================================================== */

:root {
  --bg: #08080A;
  --bg-subtle: #0E0E12;
  --surface: #141417;
  --surface-hover: #19191E;
  --surface-active: #202027;
  --surface-elevated: #16161B;
  
  --border: rgba(255, 255, 255, 0.07);
  --border-subtle: rgba(255, 255, 255, 0.04);
  --border-hover: rgba(255, 255, 255, 0.14);
  --border-active: rgba(124, 58, 237, 0.45);
  
  --text: #FAFAFA;
  --text-secondary: #A1A1AA;
  --text-muted: #71717A;
  --text-faint: #52525B;
  
  --accent: #7C3AED;
  --accent-hover: #6D28D9;
  --accent-secondary: #4F46E5;
  --accent-light: #A78BFA;
  --accent-gradient: linear-gradient(135deg, #7C3AED, #4F46E5);
  --accent-glow: rgba(124, 58, 237, 0.35);

  /* Subtle Category Tints (Linear style: desaturated background + crisp text) */
  --cat-secu-text: #34D399;
  --cat-secu-bg: rgba(52, 211, 153, 0.08);
  --cat-secu-border: rgba(52, 211, 153, 0.22);
  
  --cat-vss-text: #F472B6;
  --cat-vss-bg: rgba(244, 114, 182, 0.08);
  --cat-vss-border: rgba(244, 114, 182, 0.22);
  
  --cat-bar-text: #FBBF24;
  --cat-bar-bg: rgba(251, 191, 36, 0.08);
  --cat-bar-border: rgba(251, 191, 36, 0.22);
  
  --cat-activite-text: #38BDF8;
  --cat-activite-bg: rgba(56, 189, 248, 0.08);
  --cat-activite-border: rgba(56, 189, 248, 0.22);
  
  --cat-repas-text: #FB923C;
  --cat-repas-bg: rgba(251, 146, 60, 0.08);
  --cat-repas-border: rgba(251, 146, 60, 0.22);
  
  --cat-superstaff-text: #A78BFA;
  --cat-superstaff-bg: rgba(167, 139, 250, 0.08);
  --cat-superstaff-border: rgba(167, 139, 250, 0.22);

  --cat-urgence-text: #F87171;
  --cat-urgence-bg: rgba(248, 113, 113, 0.1);
  --cat-urgence-border: rgba(248, 113, 113, 0.3);

  --cat-logistique-text: #60A5FA;
  --cat-logistique-bg: rgba(96, 165, 250, 0.08);
  --cat-logistique-border: rgba(96, 165, 250, 0.22);

  --cat-repos-text: #A1A1AA;
  --cat-repos-bg: rgba(255, 255, 255, 0.03);
  --cat-repos-border: rgba(255, 255, 255, 0.06);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  --ease-spring: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
}

/* Base reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  padding-bottom: 96px;
}

/* Subtle top atmospheric glow */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  max-width: 100vw;
  height: 480px;
  background: radial-gradient(circle at 50% -10%, rgba(124, 58, 237, 0.18), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

::selection {
  background: rgba(124, 58, 237, 0.35);
  color: #fff;
}

/* Layout Container */
.app-container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ==========================================================================
   1. NAVBAR
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(8, 8, 10, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: 62px;
  display: flex;
  align-items: center;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
}

.brand-logo-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  filter: drop-shadow(0 2px 8px rgba(124, 58, 237, 0.45));
  transition: transform 0.25s var(--ease-spring);
}
.brand-link:hover .brand-logo-img {
  transform: scale(1.1) rotate(-4deg);
}

.hero-brand-top-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.hero-brand-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 6px 22px rgba(124, 58, 237, 0.55));
  animation: floatSubtle 4s ease-in-out infinite;
}

@keyframes floatSubtle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.brand-symbol {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), rgba(79, 70, 229, 0.3));
  border: 1px solid rgba(124, 58, 237, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c4b5fd;
  font-size: 16px;
}

.brand-text-col {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 0.96rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #fff;
  line-height: 1.15;
}

.brand-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-light);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Live Clock Badge */
.clock-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.clock-pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #34D399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.8);
  animation: pulse-dot 2s infinite ease-in-out;
}

.clock-pulse-dot.simulated {
  background-color: #FBBF24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.35); opacity: 1; }
}

/* User Pill Button */
.user-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 6px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
}

.user-pill-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.user-pill-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.72rem;
  font-weight: 800;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
  border: 1px solid transparent;
  outline: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.35);
}
.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
  color: var(--text);
  transform: translateY(-1px);
}

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

/* ==========================================================================
   2. HERO SECTION
   ========================================================================== */
.hero-section {
  padding: 38px 0 24px;
  position: relative;
}

.hero-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.hero-chip-event {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: #c4b5fd;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-chip-countdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

/* Staff summary strip inside hero */
.staff-summary-strip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  backdrop-filter: blur(12px);
}

.staff-info-col {
  display: flex;
  align-items: center;
  gap: 12px;
}

.staff-avatar-box {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: white;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.staff-details-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.staff-badges-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.badge-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* ==========================================================================
   3. ACTIVE NOW CARD (Hero Card)
   ========================================================================== */
.active-now-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-top: 18px;
  overflow: hidden;
  transition: all 0.3s var(--ease-spring);
}

.active-now-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--now-accent, var(--accent));
  box-shadow: 0 0 16px var(--now-accent, var(--accent));
}

.active-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--now-accent, #34D399);
}

.live-slot-hours {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.active-card-main {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.active-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--now-icon-bg, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--now-icon-border, var(--border));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--now-accent, #fff);
  flex-shrink: 0;
}

.active-card-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.25;
}

.active-card-category {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  margin-top: 4px;
}

.active-card-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

/* Progress indicator */
.card-progress-wrapper {
  margin-bottom: 16px;
}

.card-progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.card-progress-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.card-progress-bar {
  height: 100%;
  background: var(--now-accent, var(--accent));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* Teammates row */
.card-teammates-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.teammates-lead {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-right: 4px;
}

.teammate-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.teammate-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
}

/* Upcoming next strip */
.upcoming-next-strip {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.upcoming-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.upcoming-icon {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.upcoming-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-light);
}

.upcoming-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upcoming-time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

/* ==========================================================================
   4. STICKY DAY SEGMENTED NAVIGATION & VIEW TABS
   ========================================================================== */
.navigation-bar-sticky {
  position: sticky;
  top: 62px;
  z-index: 50;
  background: rgba(8, 8, 10, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--border);
  margin-top: 24px;
}

.nav-controls-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Segmented day control */
.segmented-day-control {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.segmented-day-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
  outline: none;
}

.segmented-day-btn:hover {
  color: var(--text);
}

.segmented-day-btn.active {
  background: var(--surface-active);
  color: #fff;
  border: 1px solid var(--border-active);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* View tabs */
.view-tabs-group {
  display: flex;
  gap: 6px;
}

.view-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.view-tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.view-tab-btn.active {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.3);
  color: #c4b5fd;
}

/* ==========================================================================
   5. VERTICAL TIMELINE PLANNING
   ========================================================================== */
.timeline-container {
  padding-top: 24px;
  position: relative;
}

.day-separator-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 28px 0 16px;
}

.day-separator-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* The vertical tree */
.timeline-track-list {
  display: flex;
  flex-direction: column;
  position: relative;
}

/* The vertical spine line */
.timeline-track-list::before {
  content: '';
  position: absolute;
  top: 14px;
  bottom: 24px;
  left: 98px;
  width: 1px;
  background: var(--border);
  z-index: 0;
}

.timeline-item-row {
  display: flex;
  align-items: flex-start;
  position: relative;
  margin-bottom: 14px;
  z-index: 1;
}

/* Left Time Column */
.timeline-item-time {
  width: 82px;
  flex-shrink: 0;
  text-align: right;
  padding-top: 16px;
}

.time-slot-label {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.time-duration-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Center timeline node dot */
.timeline-node-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border-hover);
  margin: 21px 12px 0;
  flex-shrink: 0;
  transition: all 0.2s var(--ease-spring);
}

.timeline-item-row.is-live .timeline-node-dot {
  background: #34D399;
  border-color: #34D399;
  box-shadow: 0 0 14px #34D399;
}

.timeline-item-row.is-important .timeline-node-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 14px var(--accent-glow);
}

/* Right Card */
.timeline-event-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  transition: all 0.22s var(--ease-spring);
  cursor: pointer;
  min-width: 0;
}

.timeline-event-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.timeline-item-row.is-live .timeline-event-card {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.05);
  box-shadow: 0 0 24px rgba(52, 211, 153, 0.08);
}

.timeline-item-row.is-repos .timeline-event-card {
  opacity: 0.6;
}

.timeline-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.card-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.card-title-text {
  font-size: 1.02rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.015em;
  margin-bottom: 4px;
}

.card-desc-text {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 8px;
}

.card-teammates-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* ==========================================================================
   6. TEAM VIEW (Qui fait quoi ?)
   ========================================================================== */
.team-view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding-top: 18px;
}

.team-card-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s var(--ease-spring);
  cursor: pointer;
}

.team-card-item:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.team-card-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-active);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}

.team-card-info {
  flex: 1;
  min-width: 0;
}

.team-card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.team-card-current-task {
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* ==========================================================================
   7. ESSENTIAL INFO SECTION ("À SAVOIR")
   ========================================================================== */
.info-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
  padding-top: 18px;
}

.info-box-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: all 0.2s var(--ease-spring);
}

.info-box-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-hover);
}

.info-box-card.danger {
  background: rgba(248, 113, 113, 0.06);
  border-color: rgba(248, 113, 113, 0.25);
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.info-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
}

.info-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
}

.info-card-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ==========================================================================
   8. SIMULATOR DRAWER / COLLAPSIBLE PANEL
   ========================================================================== */
.simulator-drawer {
  background: var(--bg-subtle);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-top: 16px;
  box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.6);
}

.sim-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.sim-tag-lead {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #FBBF24;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sim-day-selector {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.sim-day-btn {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.sim-day-btn.active {
  background: rgba(251, 191, 36, 0.15);
  border-color: #FBBF24;
  color: #FBBF24;
}

.sim-time-slider-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.sim-time-tag {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  min-width: 65px;
}

.range-slider {
  flex: 1;
  -webkit-appearance: none;
  height: 6px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}
.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #FBBF24;
  cursor: pointer;
  box-shadow: 0 0 10px #FBBF24;
}

.sim-quick-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s;
}
.quick-chip:hover {
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.35);
  color: #FDE68A;
}

/* ==========================================================================
   9. MODALS (User picker & Role Guide)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease-spring);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-window {
  background: var(--surface-elevated);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 28px 60px -15px rgba(0, 0, 0, 0.8);
  transform: scale(0.96);
  transition: transform 0.2s var(--ease-spring);
}

.modal-overlay.open .modal-window {
  transform: scale(1);
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-title-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #fff;
}

.modal-close-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.modal-close-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.search-box-input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  color: #fff;
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  transition: all 0.2s;
}
.search-box-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.25);
}

.staff-grid-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 16px;
  max-height: 280px;
  overflow-y: scroll; /* 'scroll' is more reliable than 'auto' on iOS */
  -webkit-overflow-scrolling: touch; /* momentum scrolling on older iOS */
  overscroll-behavior: contain; /* prevents scroll from leaking to the page */
  padding-right: 4px;
}

.staff-option-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.staff-option-pill:hover {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.35);
}

.staff-option-pill.active {
  background: var(--accent-gradient);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* ==========================================================================
   10. MOBILE OPTIMIZATIONS (Strict Mobile First)
   ========================================================================== */
@media (max-width: 640px) {
  .app-container {
    padding: 0 14px;
  }

  .site-header {
    height: 56px;
  }

  .brand-title {
    font-size: 0.88rem;
  }

  .clock-chip {
    padding: 4px 8px;
    font-size: 0.72rem;
  }

  .hero-section {
    padding: 24px 0 16px;
  }

  .hero-title {
    font-size: 1.65rem;
  }

  .active-now-card {
    padding: 16px;
  }

  .active-card-title {
    font-size: 1.15rem;
  }

  /* Mobile Timeline: compact vertical layout */
  .timeline-track-list::before {
    left: 20px;
  }

  .timeline-item-row {
    flex-direction: column;
    margin-left: 34px;
    margin-bottom: 16px;
  }

  .timeline-item-time {
    width: auto;
    text-align: left;
    padding-top: 0;
    margin-bottom: 6px;
    display: flex;
    gap: 8px;
    align-items: baseline;
  }

  .timeline-node-dot {
    position: absolute;
    left: -25px;
    top: 5px;
    margin: 0;
  }

  .timeline-event-card {
    width: 100%;
    padding: 14px;
  }

  .navigation-bar-sticky {
    top: 56px;
    padding: 8px 0;
  }

  .segmented-day-btn {
    padding: 5px 10px;
    font-size: 0.75rem;
  }

  /* Info & team: single column */
  .info-section-grid {
    grid-template-columns: 1fr;
  }

  .team-view-grid {
    grid-template-columns: 1fr;
  }

  /* Staff strip: stack vertically on mobile */
  .staff-summary-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  /* Upcoming strip: ensure title wraps and doesn't scroll */
  .upcoming-title {
    white-space: normal;
  }

  /* Active card top: allow wrapping */
  .active-card-top {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Active card main: compact */
  .active-card-main {
    gap: 12px;
  }

  /* Card teammates: smaller padding */
  .card-teammates-row {
    padding: 8px 10px;
  }

  /* Hero meta row: tighter gap */
  .hero-meta-row {
    gap: 6px;
  }

  /* Hero brand logo: slightly smaller on mobile */
  .hero-brand-logo {
    width: 52px;
    height: 52px;
  }

  /* Nav controls: stack day/tab controls on 2 rows */
  .nav-controls-row {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .segmented-day-control {
    display: flex;
    width: 100%;
    justify-content: space-between;
  }

  .segmented-day-btn {
    flex: 1;
    text-align: center;
    padding: 5px 6px;
    font-size: 0.72rem;
  }

  .view-tabs-group {
    display: flex;
    width: 100%;
    justify-content: stretch;
    gap: 4px;
  }

  .view-tab-btn {
    flex: 1;
    justify-content: center;
    font-size: 0.75rem;
    padding: 5px 6px;
  }

  /* Simulator: compact layout */
  .sim-top-bar {
    flex-wrap: wrap;
    gap: 4px;
  }

  .sim-tag-lead {
    font-size: 0.72rem;
  }

  .sim-time-slider-row {
    gap: 8px;
  }

  .sim-time-tag {
    font-size: 1.05rem;
    min-width: 52px;
  }

  /* Modal: taller on mobile, touch-scroll */
  .modal-window {
    max-height: 92svh;
    max-height: 92vh; /* fallback */
    padding: 18px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* Staff grid picker in modal: 2 columns */
  .staff-grid-picker {
    grid-template-columns: repeat(2, 1fr);
    max-height: 52vh;
  }

  /* Calendar modal: single column cards */
  .calendar-options-grid {
    grid-template-columns: 1fr;
  }

  /* Countdown card header */
  .countdown-header-row {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* First slot preview box */
  .first-slot-preview-box {
    padding: 12px 14px;
  }

  /* Btn-secondary in calendar modal */
  .btn-secondary {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--text);
  }
}

/* ==========================================================================
   11. PRE-EVENT COUNTDOWN CARD (Jeudi -> Vendredi)
   ========================================================================== */
.countdown-hero-card {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(124, 58, 237, 0.35);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 18px;
  overflow: hidden;
  box-shadow: 0 16px 36px -12px rgba(124, 58, 237, 0.18);
  backdrop-filter: blur(14px);
}

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

.countdown-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.countdown-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #c4b5fd;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.28);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.countdown-main-clock {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.1;
  margin-bottom: 6px;
}

.countdown-lead-sub {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.first-slot-preview-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
}

.first-slot-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-light);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.first-slot-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.first-slot-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ==========================================================================
   12. UNASSIGNED ONBOARDING CARD & CALENDAR MODAL
   ========================================================================== */
.welcome-onboarding-card {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(124, 58, 237, 0.4);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-top: 18px;
  text-align: center;
  box-shadow: 0 16px 40px -15px rgba(124, 58, 237, 0.25);
  backdrop-filter: blur(14px);
}

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

.welcome-title {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 12px 0 6px;
}

.welcome-subtitle {
  color: var(--text-secondary);
  font-size: 0.94rem;
  max-width: 520px;
  margin: 0 auto 20px;
  line-height: 1.5;
}

.calendar-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.cal-card-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s var(--ease-spring);
  color: inherit;
  text-decoration: none;
}
.cal-card-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.cal-card-icon {
  font-size: 28px;
}

.cal-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.cal-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.staff-summary-strip.unassigned {
  border-style: dashed;
  border-color: rgba(124, 58, 237, 0.4);
  background: rgba(124, 58, 237, 0.04);
}

.team-card-item.is-current-user {
  border-color: rgba(124, 58, 237, 0.6);
  background: rgba(124, 58, 237, 0.1);
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.2);
}

.btn-cal-single {
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease-spring);
}
.btn-cal-single:hover {
  color: var(--accent-light);
  background: rgba(124, 58, 237, 0.15);
}

@media (max-width: 640px) {
  .welcome-title {
    font-size: 1.25rem;
  }
  .welcome-onboarding-card {
    padding: 20px 14px;
  }
  .calendar-options-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   COVOITURAGE CARD
   ========================================================================== */

.covoit-section-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #60A5FA;
  margin-bottom: 10px;
}

.covoit-depart-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #60A5FA;
  background: rgba(96, 165, 250, 0.1);
  border: 1px solid rgba(96, 165, 250, 0.25);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
}

.covoit-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 4px;
}

.covoit-car-col {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  min-width: 110px;
  flex: 1 1 110px;
  max-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.2s;
}

.covoit-car-col:hover {
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(96, 165, 250, 0.04);
}

.covoit-vehicle-tag {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #60A5FA;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: var(--radius-full);
  padding: 1px 7px;
  display: inline-block;
  width: fit-content;
}

.covoit-driver {
  font-size: 0.9rem;
  font-weight: 800;
  color: #93C5FD;
  letter-spacing: -0.01em;
  padding: 4px 8px;
  background: rgba(96, 165, 250, 0.12);
  border-radius: var(--radius-sm);
  border-left: 2px solid #60A5FA;
}

.covoit-passengers {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.covoit-passengers span {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding: 2px 4px;
  border-radius: 4px;
}

.covoit-bus-col {
  border-style: dashed;
  border-color: rgba(167, 139, 250, 0.3);
}

@media (max-width: 640px) {
  .covoit-grid {
    gap: 8px;
  }
  .covoit-car-col {
    min-width: 90px;
    max-width: none;
    padding: 8px 10px;
  }
  .covoit-driver {
    font-size: 0.82rem;
  }
}

/* ==========================================================================
   13. BUTTON SECONDARY (missing global definition — used in calendar modal)
   ========================================================================== */
.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

/* ==========================================================================
   14. SAFE-AREA INSETS (iPhone notch / Dynamic Island / home indicator)
   ========================================================================== */

/* Sticky header: respect side insets in landscape (notched iPhone) */
.site-header .app-container {
  padding-left: max(20px, env(safe-area-inset-left));
  padding-right: max(20px, env(safe-area-inset-right));
}

@media (max-width: 640px) {
  .site-header .app-container {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }
}

/* Home indicator clearance on iPhone */
body {
  padding-bottom: max(96px, calc(env(safe-area-inset-bottom) + 80px));
}

/* Modal overlay: respect safe areas on iPhone (avoids status bar overlap) */
.modal-overlay {
  padding: max(16px, env(safe-area-inset-top))
           max(16px, env(safe-area-inset-right))
           max(16px, env(safe-area-inset-bottom))
           max(16px, env(safe-area-inset-left));
}

/* iOS: prevent rubber-band scroll leaking to the page behind open modals */
.modal-window {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ==========================================================================
   15. EXTRA SMALL SCREENS (≤ 400px — iPhone SE, Galaxy A05 etc.)
   ========================================================================== */
@media (max-width: 400px) {
  /* Navbar: hide the clock text; keep only the live dot to save space */
  #liveClockText {
    display: none;
  }

  .clock-chip {
    padding: 6px;
    gap: 0;
  }

  /* Smaller brand title */
  .brand-title {
    font-size: 0.82rem;
  }

  .brand-tag {
    font-size: 0.62rem;
  }

  /* Compact user pill button */
  .user-pill-btn {
    padding: 5px 8px 5px 5px;
    gap: 5px;
    font-size: 0.76rem;
  }

  /* Nav icon buttons: tighter */
  .btn.btn-icon-only {
    width: 32px;
    height: 32px;
  }

  /* Nav actions: reduce gap */
  .nav-actions {
    gap: 5px;
  }

  /* Hero title: slightly smaller */
  .hero-title {
    font-size: 1.45rem;
  }

  /* Segmented day buttons: shortest possible */
  .segmented-day-btn {
    padding: 4px 4px;
    font-size: 0.68rem;
    letter-spacing: -0.01em;
  }

  /* View tab buttons */
  .view-tab-btn {
    font-size: 0.68rem;
    padding: 4px 4px;
    gap: 4px;
  }

  /* Staff picker in modal: 2 columns but smaller */
  .staff-option-pill {
    font-size: 0.78rem;
    padding: 7px 9px;
  }

  /* Timeline: even tighter on 375px- */
  .timeline-item-row {
    margin-left: 28px;
  }

  .timeline-track-list::before {
    left: 14px;
  }

  .timeline-node-dot {
    left: -20px;
  }

  /* Onboarding card */
  .welcome-onboarding-card {
    padding: 18px 12px;
  }
}
