@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-main: #090a0f;
  --bg-card: rgba(20, 22, 33, 0.7);
  --bg-card-hover: rgba(28, 31, 46, 0.85);
  --bg-input: rgba(15, 17, 26, 0.9);
  --border-light: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(255, 255, 255, 0.12);
  
  /* Primary colors & glows */
  --color-day: #3b82f6;
  --color-day-rgb: 59, 130, 246;
  --color-evening: #a855f7;
  --color-evening-rgb: 168, 85, 247;
  
  --color-success: #10b981;
  --color-success-rgb: 16, 185, 129;
  --color-danger: #f43f5e;
  --color-danger-rgb: 244, 63, 94;
  --color-warning: #f59e0b;
  --color-warning-rgb: 245, 158, 11;
  
  /* Neutral text */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease-out;
}

/* Light / Evening Mode variations dynamically applied */
body.shift-evening {
  --bg-main: #05060a;
  --border-glow: rgba(168, 85, 247, 0.15);
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Background Gradients */
body::before {
  content: '';
  position: fixed;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background: 
    radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.05) 0%, transparent 40%);
  z-index: -1;
  pointer-events: none;
  transition: var(--transition-smooth);
}

body.shift-evening::before {
  background: 
    radial-gradient(circle at 10% 20%, rgba(168, 85, 247, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(244, 63, 94, 0.04) 0%, transparent 40%);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 10, 15, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  background: linear-gradient(135deg, var(--color-day), var(--color-evening));
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.logo-title h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(120deg, #ffffff 40%, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-title p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Main Controls */
.controls-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

/* Date Selector */
.date-selector-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 0.25rem 0.5rem;
}

.date-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.date-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.date-display {
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0 1rem;
  min-width: 140px;
  text-align: center;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
}

.date-display span.day-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: capitalize;
}

.date-picker-input {
  background: transparent;
  border: none;
  color: transparent;
  width: 0;
  height: 0;
  padding: 0;
  position: absolute;
  visibility: hidden;
}

/* Shift Switcher */
.shift-switcher {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 0.25rem;
  position: relative;
}

.shift-option {
  padding: 0.6rem 1.2rem;
  border-radius: 9px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 1;
  transition: var(--transition-smooth);
}

.shift-option.active {
  color: #fff;
}

.shift-slider {
  position: absolute;
  top: 4px;
  left: 4px;
  bottom: 4px;
  width: calc(50% - 4px);
  border-radius: 9px;
  transition: var(--transition-smooth);
  z-index: 0;
}

/* Slide Colors depending on shift */
.shift-switcher.day-active .shift-slider {
  background: linear-gradient(135deg, var(--color-day), #2563eb);
  box-shadow: 0 4px 12px rgba(var(--color-day-rgb), 0.3);
  transform: translateX(0);
}

.shift-switcher.evening-active .shift-slider {
  background: linear-gradient(135deg, var(--color-evening), #7c3aed);
  box-shadow: 0 4px 12px rgba(var(--color-evening-rgb), 0.3);
  transform: translateX(100%);
}

/* Application Container */
.app-container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 2rem;
  flex: 1;
}

@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 1fr;
  }
}

/* Dashboard Panel */
.dashboard-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Stats Overview */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  cursor: pointer;
  user-select: none;
}

.stat-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px -5px rgba(0, 0, 0, 0.2);
}

.stat-card.active-filter {
  background: var(--bg-card-hover);
}

.stat-card.active-filter.stat-total {
  border-color: rgba(var(--color-day-rgb), 0.5);
  box-shadow: 0 0 15px -3px rgba(var(--color-day-rgb), 0.25);
}

.stat-card.active-filter.stat-open {
  border-color: rgba(var(--color-success-rgb), 0.5);
  box-shadow: 0 0 15px -3px rgba(var(--color-success-rgb), 0.25);
}

.stat-card.active-filter.stat-closed {
  border-color: rgba(var(--color-danger-rgb), 0.5);
  box-shadow: 0 0 15px -3px rgba(var(--color-danger-rgb), 0.25);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 40px;
}

.stat-card.stat-total::before { background-color: var(--color-day); }
.stat-card.stat-open::before { background-color: var(--color-success); }
.stat-card.stat-closed::before { background-color: var(--color-danger); }

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
}

/* Tech Grid Section */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-badge {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.6rem;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 600;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

/* Tech Card */
.tech-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 220px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.tech-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.5);
}

.tech-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.25rem;
}

.tech-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tech-avatar {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01));
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 1.1rem;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.05);
}

.tech-info {
  display: flex;
  flex-direction: column;
}

.tech-name {
  font-weight: 700;
  font-size: 1rem;
}

.tech-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Status Indicator */
.status-badge {
  padding: 0.25rem 0.6rem;
  border-radius: 30px;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-open {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.status-open::before { background-color: var(--color-success); }

.status-closed {
  background: rgba(244, 63, 94, 0.1);
  color: var(--color-danger);
  border: 1px solid rgba(244, 63, 94, 0.2);
}
.status-closed::before { background-color: var(--color-danger); }

/* Closed details inside Card */
.closed-details {
  background: rgba(244, 63, 94, 0.03);
  border: 1px solid rgba(244, 63, 94, 0.1);
  border-radius: 12px;
  padding: 0.75rem;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  animation: fadeIn 0.3s ease-out;
}

.closed-details p {
  margin-bottom: 0.25rem;
  display: flex;
  justify-content: space-between;
}

.closed-details p:last-child {
  margin-bottom: 0;
}

.closed-label {
  color: var(--text-muted);
}

.closed-val {
  font-weight: 600;
  color: var(--text-primary);
}

.closed-reason {
  background: rgba(244, 63, 94, 0.08);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--color-danger);
  font-weight: 700;
}

.closed-note {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(244, 63, 94, 0.15);
  font-style: italic;
  color: var(--text-secondary);
  word-break: break-word;
}

/* Card Actions */
.card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

.btn {
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-fast);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
}

.btn-primary {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-day);
  border-color: rgba(59, 130, 246, 0.2);
}
.btn-primary:hover {
  background: var(--color-day);
  color: white;
  box-shadow: 0 4px 12px rgba(var(--color-day-rgb), 0.2);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.1);
  color: var(--color-danger);
  border-color: rgba(244, 63, 94, 0.2);
}
.btn-danger:hover {
  background: var(--color-danger);
  color: white;
  box-shadow: 0 4px 12px rgba(var(--color-danger-rgb), 0.2);
}

.btn-success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.2);
}
.btn-success:hover {
  background: #10b981;
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

/* Glow button for evening shifts */
.btn-evening-reopen {
  background: linear-gradient(135deg, var(--color-evening), #8b5cf6);
  color: white;
  box-shadow: 0 4px 14px rgba(var(--color-evening-rgb), 0.3);
  animation: glowPulse 2s infinite alternate;
}
.btn-evening-reopen:hover {
  transform: scale(1.02);
  box-shadow: 0 6px 18px rgba(var(--color-evening-rgb), 0.5);
}

/* Glow animation for re-opening button for night shift */
@keyframes glowPulse {
  0% {
    box-shadow: 0 4px 10px rgba(var(--color-evening-rgb), 0.3), 0 0 0 0px rgba(var(--color-evening-rgb), 0.4);
  }
  100% {
    box-shadow: 0 4px 16px rgba(var(--color-evening-rgb), 0.5), 0 0 0 6px rgba(var(--color-evening-rgb), 0);
  }
}

/* Timeline Panel */
.sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sidebar-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.sidebar-box-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-height: 350px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.timeline-item {
  display: flex;
  gap: 0.75rem;
  position: relative;
  font-size: 0.8rem;
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 24px;
  left: 11px;
  bottom: -16px;
  width: 2px;
  background: rgba(255, 255, 255, 0.05);
}

.timeline-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
  z-index: 1;
}

.timeline-icon.icon-close {
  background: rgba(244, 63, 94, 0.1);
  color: var(--color-danger);
  border: 1px solid rgba(244, 63, 94, 0.2);
}

.timeline-icon.icon-reopen {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.timeline-text {
  color: var(--text-primary);
  line-height: 1.4;
}

.timeline-text strong {
  font-weight: 600;
}

.timeline-time {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.timeline-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0;
  font-style: italic;
}

/* Admin Panel (Manage Techs) */
.admin-input-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.input-text {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.8rem;
  flex: 1;
  transition: var(--transition-fast);
}

.input-text:focus {
  outline: none;
  border-color: var(--color-day);
  box-shadow: 0 0 0 2px rgba(var(--color-day-rgb), 0.15);
}

.admin-tech-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.admin-tech-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 0.8rem;
}

.btn-icon-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.btn-icon-delete:hover {
  color: var(--color-danger);
  background: rgba(244, 63, 94, 0.1);
}

/* Modals */

/* ==========================================================================
   🌞 Light Theme - Complet
   ========================================================================== */
body.theme-light {
  --bg-main: #f0f4f8;
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-input: rgba(255, 255, 255, 0.9);
  --border-light: rgba(0, 0, 0, 0.08);
  --border-glow: rgba(59, 130, 246, 0.2);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --color-success: #059669;
  --color-success-rgb: 5, 150, 105;
  --color-danger: #dc2626;
  --color-danger-rgb: 220, 38, 38;
  --color-warning: #d97706;
  --color-warning-rgb: 217, 119, 6;
}

body.theme-light::before {
  background:
    radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.04) 0%, transparent 40%);
}

body.theme-light header {
  background: rgba(240, 244, 248, 0.85);
  border-bottom-color: rgba(0,0,0,0.08);
}

body.theme-light .stat-card,
body.theme-light .tech-card,
body.theme-light .sidebar-box,
body.theme-light .tab-content-box {
  background: var(--bg-card);
  border-color: var(--border-light);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

body.theme-light .stat-card:hover,
body.theme-light .tech-card:hover {
  background: var(--bg-card-hover);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

body.theme-light .btn-primary {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.25);
}
body.theme-light .btn-primary:hover {
  background: #2563eb;
  color: white;
}

body.theme-light .btn-danger {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.2);
}

body.theme-light .input-text,
body.theme-light select,
body.theme-light textarea {
  background: var(--bg-input);
  border-color: rgba(0,0,0,0.12);
  color: var(--text-primary);
}

body.theme-light .tab-btn {
  color: var(--text-secondary);
}
body.theme-light .tab-btn.active {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-day);
}

body.theme-light .modal-box {
  background: #ffffff;
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 25px 50px rgba(0,0,0,0.15);
}

body.theme-light .timeline-item:not(:last-child)::before {
  background: rgba(0,0,0,0.08);
}

body.theme-light .status-open {
  background: rgba(5, 150, 105, 0.08);
}
body.theme-light .status-closed {
  background: rgba(220, 38, 38, 0.08);
}

body.theme-light ::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.05);
}
body.theme-light ::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
}

body.theme-light .chat-bubble-wrapper.received .chat-bubble {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: var(--text-primary);
}

/* ==========================================================================
   📱 Mobile Responsive - < 768px
   ========================================================================== */
@media (max-width: 768px) {
  /* Header compact */
  header {
    padding: 0.75rem 1rem;
    gap: 0.75rem;
  }

  .logo-title h1 {
    font-size: 1rem;
  }
  .logo-title p {
    display: none;
  }
  .logo-icon {
    width: 34px;
    height: 34px;
    font-size: 1rem;
    border-radius: 9px;
  }

  .controls-header {
    gap: 0.5rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .controls-header::-webkit-scrollbar { display: none; }

  .date-selector-wrapper {
    flex-shrink: 0;
  }
  .date-display {
    min-width: 100px;
    font-size: 0.8rem;
  }

  .shift-option {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }

  /* App layout */
  .app-container {
    padding: 1rem;
    gap: 1rem;
  }

  /* Tabs scroll horizontal */
  .tab-navigation {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-nowrap: nowrap;
    padding-bottom: 2px;
  }
  .tab-navigation::-webkit-scrollbar { display: none; }

  .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 0.78rem;
    padding: 0.55rem 0.85rem;
  }

  /* Tech grid 1 colonne */
  .tech-grid {
    grid-template-columns: 1fr;
  }

  /* Stats 2 colonnes */
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Boutons min 44px touch */
  .btn {
    min-height: 44px;
    font-size: 0.85rem;
  }
  .date-btn {
    min-width: 40px;
    min-height: 40px;
  }

  /* Modales plein écran */
  .modal-overlay {
    align-items: flex-end;
  }
  .modal-box {
    width: 100%;
    max-width: 100%;
    border-radius: 24px 24px 0 0;
    padding: 1.5rem 1.25rem;
    max-height: 90vh;
    overflow-y: auto;
  }

  /* Sidebar en dessous */
  .sidebar-panel {
    order: -1;
  }

  .sidebar-box {
    padding: 1rem;
  }

  /* OT cards */
  .ot-card {
    padding: 1rem;
  }

  /* Planning table scroll */
  .planning-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Notification params columns */
  .notif-columns {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  header {
    padding: 0.6rem 0.75rem;
  }

  #theme-toggle,
  #notification-toggle {
    min-width: 38px;
    height: 38px;
    padding: 0.4rem;
  }
}


.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 6, 10, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-smooth);
}

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

.modal-box {
  background: #141722;
  border: 1px solid var(--border-glow);
  width: 90%;
  max-width: 440px;
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  transform: scale(0.9);
  transition: var(--transition-smooth);
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.select-custom {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  transition: var(--transition-fast);
}

.select-custom:focus {
  outline: none;
  border-color: var(--color-day);
}

.textarea-custom {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  width: 100%;
  resize: vertical;
  min-height: 80px;
  transition: var(--transition-fast);
}

.textarea-custom:focus {
  outline: none;
  border-color: var(--color-day);
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.75rem;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 2000;
}

.toast {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-glow);
  padding: 0.85rem 1.25rem;
  border-radius: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  animation: slideInRight 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(10px);
}

@keyframes slideInRight {
  0% {
    transform: translateX(100%);
    opacity: 0;
  }
  100% {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Utility Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Footer styling */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--border-light);
  margin-top: auto;
}

/* Light Theme Override classes */
body.theme-light {
  --bg-main: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: #ffffff;
  --bg-input: #ffffff;
  --border-light: rgba(15, 23, 42, 0.08);
  --border-glow: rgba(59, 130, 246, 0.2);
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  background-color: var(--bg-main);
  color: var(--text-primary);
}

body.theme-light::before {
  background: 
    radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.06) 0%, transparent 40%);
}

body.theme-light.shift-evening::before {
  background: 
    radial-gradient(circle at 10% 20%, rgba(168, 85, 247, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(244, 63, 94, 0.04) 0%, transparent 40%);
}

body.theme-light header {
  background: rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

body.theme-light .logo-title h1 {
  background: linear-gradient(120deg, #0f172a 40%, #475569);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.theme-light .modal-box {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

body.theme-light .admin-tech-item {
  background: rgba(0, 0, 0, 0.015);
}

body.theme-light .toast {
  background: rgba(255, 255, 255, 0.97);
  color: var(--text-primary);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.12);
  border-color: rgba(15, 23, 42, 0.1);
}

body.theme-light .input-text {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.12);
  color: var(--text-primary);
}

body.theme-light .input-text::placeholder {
  color: #94a3b8;
}

body.theme-light .input-text:focus {
  border-color: var(--color-day);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

body.theme-light .select-custom {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%230f172a' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
}

body.theme-light .timeline-item:not(:last-child)::before {
  background: rgba(0, 0, 0, 0.06);
}

body.theme-light .date-selector-wrapper {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(15, 23, 42, 0.08);
}

body.theme-light .shift-switcher {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(15, 23, 42, 0.08);
}

body.theme-light .sidebar-box {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

body.theme-light .live-user-row {
  background: rgba(15, 23, 42, 0.02);
  border-color: rgba(15, 23, 42, 0.06);
}

body.theme-light .live-user-row:hover {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(59, 130, 246, 0.2);
}

body.theme-light .modal-box {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.1);
}

body.theme-light .modal-close:hover {
  background: rgba(15, 23, 42, 0.06);
}

/* Tabs Navigation Styling */
.tab-navigation {
  display: flex;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0.6rem 1rem;
  border-bottom: 3px solid transparent;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--text-primary);
  font-weight: 700;
}

body.shift-day .tab-btn.active {
  border-bottom-color: var(--color-day);
}

body.shift-evening .tab-btn.active {
  border-bottom-color: var(--color-evening);
}

/* OT Pool Card Styling */
.ot-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 210px;
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.ot-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.5);
}

.ot-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.ot-card-cid {
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-day);
  letter-spacing: 0.5px;
}

body.shift-evening .ot-card-cid {
  color: var(--color-evening);
}

.ot-city-badge {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
  padding: 0.25rem 0.6rem;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.ot-tech-holder {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.ot-tech-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.ot-tech-info {
  display: flex;
  flex-direction: column;
}

.ot-tech-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.ot-tech-id {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.ot-notes-box {
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed var(--border-light);
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-style: italic;
  margin-bottom: 1rem;
  word-break: break-word;
}

/* Light Theme overrides for OTs */
body.theme-light .ot-card {
  background: var(--bg-card);
  border-color: rgba(15, 23, 42, 0.08);
}

body.theme-light .ot-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(59, 130, 246, 0.2);
}

body.theme-light .ot-tech-avatar {
  background: rgba(0, 0, 0, 0.03);
}

body.theme-light .ot-notes-box {
  background: rgba(0, 0, 0, 0.01);
  border-color: rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   Coach Planning Grid, Badges & Theme Styles
   ========================================================================= */

.planning-container {
  background: rgba(20, 22, 33, 0.45);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 1.5rem;
  overflow-x: auto;
  margin-top: 1rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.week-nav-btn {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  height: 38px;
  width: auto;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.week-nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-glow);
}

.planning-table {
  width: 100%;
  font-size: 0.85rem;
  border-spacing: 0;
  color: var(--text-primary);
}

.planning-table th, .planning-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
}

.planning-table th {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.planning-table td {
  text-align: center;
  vertical-align: middle;
  min-height: 48px;
}

.planning-table tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

/* Coach Badges with color mapping matching screenshot (Dark Mode defaults) */
.coach-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  margin: 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  user-select: none;
}

.coach-badge:hover {
  transform: translateY(-1px);
}

/* Blue for Laurent */
.coach-badge.coach-laurent {
  background-color: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

/* Peach/Light-Orange for Pierrot */
.coach-badge.coach-pierrot {
  background-color: rgba(254, 215, 170, 0.15);
  color: #fdba74;
  border: 1px solid rgba(254, 215, 170, 0.35);
}

/* Indigo for Pierre */
.coach-badge.coach-pierre {
  background-color: rgba(129, 140, 248, 0.15);
  color: #818cf8;
  border: 1px solid rgba(129, 140, 248, 0.35);
}

/* Green for Pilou */
.coach-badge.coach-pilou {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* Grey/Slate for Polo */
.coach-badge.coach-polo {
  background-color: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.35);
}

/* Yellow/Amber for Greg */
.coach-badge.coach-greg {
  background-color: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

/* Orange for Cedric */
.coach-badge.coach-cedric {
  background-color: rgba(249, 115, 22, 0.15);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.35);
}

/* Purple for Ilias */
.coach-badge.coach-ilias {
  background-color: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.35);
}

/* Cyan for Taoufik */
.coach-badge.coach-taoufik {
  background-color: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

/* Default Grey/Secondary for other custom names */
.coach-badge.coach-default {
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

/* ==========================================================================
   Light Theme Override Styles for Coach Planning
   ========================================================================= */

body.theme-light .planning-container {
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 32px 0 rgba(15, 23, 42, 0.05);
}

body.theme-light .week-nav-btn {
  background: rgba(15, 23, 42, 0.03);
}

body.theme-light .week-nav-btn:hover {
  background: rgba(15, 23, 42, 0.06);
}

body.theme-light .planning-table {
  background: #ffffff !important;
}

body.theme-light .planning-table tr {
  background: #ffffff !important;
}

body.theme-light .planning-table th, 
body.theme-light .planning-table td {
  background: #ffffff !important;
}

body.theme-light .planning-table tr:hover {
  background: rgba(15, 23, 42, 0.02) !important;
}

/* Light mode specific badge color adjustments (Darker texts for readability) */
body.theme-light .coach-badge.coach-laurent {
  background-color: rgba(59, 130, 246, 0.08);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.2);
}

body.theme-light .coach-badge.coach-pierrot {
  background-color: rgba(249, 115, 22, 0.08);
  color: #c2410c;
  border-color: rgba(249, 115, 22, 0.2);
}

body.theme-light .coach-badge.coach-pierre {
  background-color: rgba(99, 102, 241, 0.08);
  color: #4f46e5;
  border-color: rgba(99, 102, 241, 0.2);
}

body.theme-light .coach-badge.coach-pilou {
  background-color: rgba(16, 185, 129, 0.08);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.2);
}

body.theme-light .coach-badge.coach-polo {
  background-color: rgba(107, 114, 128, 0.08);
  color: #374151;
  border-color: rgba(107, 114, 128, 0.2);
}

body.theme-light .coach-badge.coach-greg {
  background-color: rgba(245, 158, 11, 0.08);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.2);
}

body.theme-light .coach-badge.coach-cedric {
  background-color: rgba(249, 115, 22, 0.08);
  color: #c2410c;
  border-color: rgba(249, 115, 22, 0.2);
}

body.theme-light .coach-badge.coach-ilias {
  background-color: rgba(139, 92, 246, 0.08);
  color: #6d28d9;
  border-color: rgba(139, 92, 246, 0.2);
}

body.theme-light .coach-badge.coach-taoufik {
  background-color: rgba(6, 182, 212, 0.08);
  color: #0891b2;
  border-color: rgba(6, 182, 212, 0.2);
}

body.theme-light .coach-badge.coach-default {
  background-color: rgba(15, 23, 42, 0.03);
  color: var(--text-secondary);
  border-color: var(--border-light);
}

/* Editable cells in the grid */
.planning-edit-input {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.8rem;
  text-align: center;
  width: 95%;
  max-width: 140px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.planning-edit-input:focus {
  outline: none;
  border-color: var(--color-day);
  box-shadow: 0 0 0 2px rgba(var(--color-day-rgb), 0.15);
}

.planning-day-row {
  transition: background-color 0.2s ease;
}

.planning-day-name {
  font-weight: 700;
  color: var(--text-secondary);
}

/* Style for Saturday/Sunday greyed-out cells */
.planning-weekend-empty {
  color: var(--text-muted);
  font-style: italic;
  opacity: 0.5;
  background: rgba(255, 255, 255, 0.01);
}

body.theme-light .planning-weekend-empty {
  background: rgba(0, 0, 0, 0.015);
}

/* Fill row helper button styling */
.fill-row-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 4px;
  font-size: 0.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.4;
  margin-left: 4px;
}

.fill-row-btn:hover {
  opacity: 1;
  color: var(--color-day);
  background: rgba(255,255,255,0.03);
}

body.theme-light .fill-row-btn:hover {
  background: rgba(0, 0, 0, 0.03);
}

/* ==========================================================================
   Sélecteur Interactif de Coachs & Statistiques
   ========================================================================= */

.planning-cell-edit-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.planning-cell-badges {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 24px;
  width: 100%;
}

.planning-edit-select {
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 4px 20px 4px 6px;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.75rem;
  width: 100%;
  max-width: 140px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 14px;
  transition: border-color 0.2s ease;
  margin-top: 4px;
  cursor: pointer;
}

body.theme-light .planning-edit-select {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%231e293b' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
}

.planning-edit-select:focus {
  outline: none;
  border-color: var(--color-day);
}

.coach-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0.5rem;
}

.coach-stat-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.coach-stat-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-glow);
  background: rgba(255, 255, 255, 0.04);
}

.coach-stat-count {
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.75rem;
  color: var(--text-primary);
}

body.theme-light .coach-stat-card {
  background: rgba(15, 23, 42, 0.02);
}

body.theme-light .coach-stat-card:hover {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(59, 130, 246, 0.3);
}

body.theme-light .coach-stat-count {
  background: rgba(15, 23, 42, 0.05);
}

.remove-coach-btn:hover {
  color: #ef4444 !important;
  opacity: 1 !important;
}

body.theme-light .btn-success {
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.2);
}
body.theme-light .btn-success:hover {
  background: #10b981;
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* Live Activity dot and status classes */
.live-pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: livePulse 1.8s infinite;
}

@keyframes livePulse {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.live-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-light);
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  font-size: 0.75rem;
  transition: all 0.2s;
}

.live-user-row:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.1);
}

.live-indicator-online {
  width: 6px;
  height: 6px;
  background-color: var(--color-success);
  border-radius: 50%;
}

.live-indicator-offline {
  width: 6px;
  height: 6px;
  background-color: var(--text-muted);
  border-radius: 50%;
  opacity: 0.5;
}

/* ==========================================================================
   Searchable Tech Dropdown (OT Form)
   ========================================================================= */

.ot-tech-dropdown-item {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: 7px;
  transition: background 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ot-tech-dropdown-item:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--color-day);
}

body.theme-light .ot-tech-dropdown-item:hover {
  background: rgba(59, 130, 246, 0.08);
  color: var(--color-day);
}

/* Light mode: OT add box */
body.theme-light #ot-add-box {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: rgba(59, 130, 246, 0.2) !important;
}

/* Light mode: OT visitor alert */
body.theme-light #ot-visitor-alert {
  background: rgba(245, 158, 11, 0.05);
  border-color: rgba(245, 158, 11, 0.2);
}

/* Light mode: info banner */
body.theme-light #info-banner {
  background: rgba(59, 130, 246, 0.04);
  border-color: rgba(59, 130, 246, 0.15);
}

/* Light mode: date-btn hover */
body.theme-light .date-btn:hover {
  background: rgba(15, 23, 42, 0.05);
  color: var(--text-primary);
}

/* Light mode: section-badge */
body.theme-light .section-badge {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text-secondary);
}

/* Light mode: tech-card */
body.theme-light .tech-card {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

body.theme-light .tech-card:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(59, 130, 246, 0.25);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
}

/* Light mode: stat-card */
body.theme-light .stat-card {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

body.theme-light .stat-card:hover {
  background: rgba(255, 255, 255, 0.98);
}

/* Light mode: tab navigation */
body.theme-light .tab-navigation {
  border-bottom-color: rgba(15, 23, 42, 0.1);
}

body.theme-light .tab-btn {
  color: #475569;
}

body.theme-light .tab-btn:hover {
  color: var(--text-primary);
}

body.theme-light .tab-btn.active {
  color: var(--text-primary);
}

/* Light mode: admin-live-activity-box */
body.theme-light #admin-live-activity-box {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(16, 185, 129, 0.25);
}

/* Light mode: closed-details */
body.theme-light .closed-details {
  background: rgba(244, 63, 94, 0.03);
}

/* ==========================================================================
   Coach Tasks Styles
   ========================================================================= */

.task-card {
  position: relative;
  transition: all 0.22s ease-in-out;
}

.task-card:hover {
  border-color: var(--color-day) !important;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.08);
  transform: translateY(-1px);
}

.task-badge {
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.priority-high {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.priority-medium {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.priority-low {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-done {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-todo {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.task-card.done {
  border-color: rgba(255, 255, 255, 0.03) !important;
  box-shadow: none;
}

.task-card.done:hover {
  transform: none;
}

.task-card.overdue {
  animation: taskPulseOverdue 2s infinite ease-in-out;
}

@keyframes taskPulseOverdue {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.15); }
  50% { box-shadow: 0 0 8px 2px rgba(239, 68, 68, 0.3); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.15); }
}

/* Light mode overrides for coach tasks */
body.theme-light #coach-task-add-box {
  background: rgba(255, 255, 255, 0.85) !important;
  border-color: rgba(59, 130, 246, 0.2) !important;
}

body.theme-light .task-card {
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

body.theme-light .task-card:hover {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
}

body.theme-light .priority-high {
  background: rgba(239, 68, 68, 0.08);
  color: #b91c1c;
  border-color: rgba(239, 68, 68, 0.2);
}

body.theme-light .priority-medium {
  background: rgba(245, 158, 11, 0.08);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.2);
}

body.theme-light .priority-low {
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.2);
}

body.theme-light .status-done {
  background: rgba(16, 185, 129, 0.08);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.2);
}

/* Shared badge for specific coaches */
.coach-shared {
  background: rgba(244, 63, 94, 0.12);
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.3);
}

/* Coach color classes */
.coach-mauve {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
  border-color: rgba(139, 92, 246, 0.3);
}

.coach-blue {
  background: rgba(59, 130, 246, 0.12);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.3);
}

.coach-rose {
  background: rgba(236, 72, 153, 0.12);
  color: #ec4899;
  border-color: rgba(236, 72, 153, 0.3);
}

.coach-red {
  background: rgba(244, 63, 94, 0.12);
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.3);
}

.coach-orange {
  background: rgba(249, 115, 22, 0.12);
  color: #f97316;
  border-color: rgba(249, 115, 22, 0.3);
}


/* Green badge for Cédric and Greg */
.coach-green {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

body.theme-light .status-todo {
  background: rgba(59, 130, 246, 0.08);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.2);
}

/* Light mode overrides for dashboard metrics & charts */
body.theme-light #dash-top-techs-chart div div, 
body.theme-light #dash-reasons-chart div div {
  color: #0f172a !important; /* darker text for labels and values */
}
body.theme-light #dash-top-techs-chart div div div, 
body.theme-light #dash-reasons-chart div div div {
  background: rgba(15, 23, 42, 0.05) !important; /* cleaner bar track background */
}
body.theme-light #dash-closures-tbody tr {
  border-bottom-color: rgba(15, 23, 42, 0.06) !important;
}
body.theme-light #dash-closures-tbody tr td {
  color: #334155 !important;
}
body.theme-light #dash-closures-tbody tr td strong {
  color: #0f172a !important;
}
body.theme-light #dash-coaches-performance div {
  background: rgba(255, 255, 255, 0.8) !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05) !important;
}
body.theme-light #dash-coaches-performance div h4 {
  color: #0f172a !important;
}
body.theme-light #dash-coaches-performance div p {
  color: #64748b !important;
}
body.theme-light #dash-total-closures, 
body.theme-light #dash-main-reason, 
body.theme-light #dash-reopen-rate {
  color: #0f172a !important;
}
body.theme-light #tab-content-dashboard h3 {
  color: #0f172a !important;
}

body.theme-light #tab-content-dashboard .sidebar-box {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

body.theme-light #tab-content-dashboard .stat-card {
  background: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.08) !important;
}

/* Extra coach base classes */
.coach-amber {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}

.coach-cyan {
  background: rgba(6, 182, 212, 0.12);
  color: #06b6d4;
  border-color: rgba(6, 182, 212, 0.3);
}

.coach-grey {
  background: rgba(156, 163, 175, 0.12);
  color: #9ca3af;
  border-color: rgba(156, 163, 175, 0.3);
}

/* Light theme overrides for unified coach classes */
body.theme-light .coach-mauve {
  background-color: rgba(139, 92, 246, 0.08);
  color: #6d28d9;
  border-color: rgba(139, 92, 246, 0.25);
}
body.theme-light .coach-blue {
  background-color: rgba(59, 130, 246, 0.08);
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.25);
}
body.theme-light .coach-rose {
  background-color: rgba(236, 72, 153, 0.08);
  color: #be185d;
  border-color: rgba(236, 72, 153, 0.25);
}
body.theme-light .coach-red {
  background-color: rgba(244, 63, 94, 0.08);
  color: #be123c;
  border-color: rgba(244, 63, 94, 0.25);
}
body.theme-light .coach-orange {
  background-color: rgba(249, 115, 22, 0.08);
  color: #c2410c;
  border-color: rgba(249, 115, 22, 0.25);
}
body.theme-light .coach-green {
  background-color: rgba(16, 185, 129, 0.08);
  color: #047857;
  border-color: rgba(16, 185, 129, 0.25);
}
body.theme-light .coach-amber {
  background-color: rgba(245, 158, 11, 0.08);
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.25);
}
body.theme-light .coach-cyan {
  background-color: rgba(6, 182, 212, 0.08);
  color: #0891b2;
  border-color: rgba(6, 182, 212, 0.25);
}
body.theme-light .coach-grey {
  background-color: rgba(156, 163, 175, 0.08);
  color: #4b5563;
  border-color: rgba(156, 163, 175, 0.25);
}

/* Print Styling for clean PDF Export */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  /* Hide header, sidebars, and other tab contents */
  header, 
  .sidebar-panel, 
  .tab-navigation, 
  #tab-content-status, 
  #tab-content-ot, 
  #tab-content-coach-tasks, 
  #tab-content-dashboard {
    display: none !important;
  }
  
  /* Reset container/section borders and backgrounds for print */
  .app-container,
  .dashboard-panel,
  #tab-content-coach-planning {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }
  #tab-content-coach-planning * {
    visibility: visible !important;
  }
  /* Hide interactive buttons and navigation while printing */
  .week-nav-btn, 
  #btn-print-planning,
  #coach-planning-admin-actions, 
  #coach-planning-edit-actions {
    display: none !important;
  }
  /* Formatting table for print with colors preserved */
  .planning-table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 15px !important;
    background: transparent !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  .planning-table th, 
  .planning-table td {
    border: 1px solid var(--border-light) !important;
    padding: 10px !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    .coach-badge {
      font-weight: 700 !important;
      padding: 4px 8px !important;
      border-radius: 6px !important;
      display: inline-flex !important;
      -webkit-print-color-adjust: exact !important;
      print-color-adjust: exact !important;
    }
  }
}

/* ==========================================================================
   💬 Coach Chat UI Styling
   ========================================================================= */

.chat-contact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s ease;
  font-size: 0.825rem;
  font-weight: 600;
  border: 1px solid transparent;
}

.chat-contact-item:hover {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.chat-contact-item.active {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.2);
}

body.shift-evening .chat-contact-item.active {
  background: rgba(244, 63, 94, 0.1);
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.2);
}

.chat-contact-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  display: inline-block;
  box-shadow: 0 0 8px #10b981;
}

.chat-bubble-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 70%;
  gap: 0.25rem;
}

.chat-bubble-wrapper.sent {
  align-self: flex-end;
}

.chat-bubble-wrapper.received {
  align-self: flex-start;
}

.chat-bubble {
  padding: 0.65rem 0.95rem;
  border-radius: 14px;
  font-size: 0.825rem;
  line-height: 1.45;
  word-break: break-word;
  white-space: pre-wrap;
  border: 1px solid transparent;
}

.chat-bubble-wrapper.sent .chat-bubble {
  background: var(--color-day);
  color: white;
  border-bottom-right-radius: 4px;
  border-color: rgba(var(--color-day-rgb), 0.2);
}

body.shift-evening .chat-bubble-wrapper.sent .chat-bubble {
  background: var(--color-evening);
  border-color: rgba(var(--color-evening-rgb), 0.2);
}

.chat-bubble-wrapper.received .chat-bubble {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  border-top-left-radius: 4px;
  border-color: var(--border-light);
}

body.theme-light .chat-bubble-wrapper.received .chat-bubble {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.chat-bubble-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.chat-bubble-wrapper.sent .chat-bubble-meta {
  justify-content: flex-end;
}

.chat-bubble-wrapper.received .chat-bubble-meta {
  justify-content: flex-start;
}
