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

:root {
  --bg: #07080c;
  --bg-deep: #040508;
  --bg-card: rgba(18, 20, 29, 0.75);
  --bg-elevated: rgba(25, 28, 40, 0.85);
  --bg-input: rgba(13, 15, 23, 0.85);
  --bg-hover: rgba(155, 89, 182, 0.12);
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(175, 105, 237, 0.65);
  --border-subtle: rgba(255, 255, 255, 0.04);
  
  --purple: #9B59B6;
  --purple-glow: rgba(155, 89, 182, 0.4);
  --purple-light: #C39BD3;
  --purple-dark: #6C3483;
  --accent-gradient: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  --accent-gradient-subtle: linear-gradient(135deg, rgba(168, 85, 247, 0.16) 0%, rgba(236, 72, 153, 0.16) 100%);
  
  --gold: #F1C40F;
  --gold-glow: rgba(241, 196, 15, 0.35);
  --text: #F3F4F6;
  --text-muted: #9CA3AF;
  --text-dim: #6B7280;
  
  --green: #10B981;
  --green-glow: rgba(16, 185, 129, 0.3);
  --red: #EF4444;
  --red-glow: rgba(239, 68, 68, 0.3);
  --blue: #3B82F6;
  --blue-glow: rgba(59, 130, 246, 0.3);
  --orange: #F59E0B;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  
  --glass-blur: blur(16px);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 35px var(--purple-glow);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.bg-glow {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(110px);
  opacity: 0.45;
  z-index: 0;
  animation: pulseGlow 12s infinite alternate ease-in-out;
}

.bg-glow-1 {
  width: 550px;
  height: 550px;
  top: -150px;
  left: -100px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.4) 0%, rgba(139, 92, 246, 0.1) 70%, transparent 100%);
}

.bg-glow-2 {
  width: 650px;
  height: 650px;
  bottom: -200px;
  right: -150px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.35) 0%, rgba(155, 89, 182, 0.1) 70%, transparent 100%);
  animation-duration: 16s;
}

@keyframes pulseGlow {
  0% { transform: scale(1) translate(0, 0); opacity: 0.35; }
  100% { transform: scale(1.15) translate(40px, 30px); opacity: 0.55; }
}

.bg-grid-overlay {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 1;
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  z-index: 10;
}

.login-box {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 44px 38px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: var(--shadow-lg), 0 0 50px rgba(155, 89, 182, 0.15);
  position: relative;
  overflow: hidden;
}

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

.login-box h1 {
  justify-content: center;
  font-size: 1.5rem;
  margin: 0;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.login-box input {
  width: 100%;
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.login-box input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 16px var(--purple-glow);
  background: rgba(18, 20, 28, 0.95);
}

.login-box button {
  width: 100%;
  margin-top: 20px;
  padding: 13px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  color: white;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.35);
}

.login-box button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(168, 85, 247, 0.5);
  filter: brightness(1.08);
}

.login-box button:active {
  transform: translateY(0);
}

.error {
  color: var(--red);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin: 16px 0 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 36px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 12, 18, 0.8);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
}

.brand-icon .icon-brand {
  width: 22px;
  height: 22px;
  stroke: #ffffff;
}

.brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.brand-name {
  font-weight: 800;
  background: var(--accent-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-divider {
  color: var(--text-dim);
  font-weight: 300;
}

.brand-sub {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-weight: 600;
}

.subtitle {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
}

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

.btn-primary, .btn-secondary, .btn-danger, .btn-logout, .btn-danger-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-elevated);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.12);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fff;
  transform: translateY(-1px);
}

.btn-danger-outline {
  background: transparent;
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 6px 10px;
}

.btn-danger-outline:hover {
  background: rgba(239, 68, 68, 0.18);
  border-color: var(--red);
  color: #fff;
}

.btn-logout {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  border: 1px solid var(--border-subtle);
  padding: 9px 12px;
}

.btn-logout:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border);
}

main {
  position: relative;
  z-index: 10;
  padding: 32px 36px 60px;
  max-width: 1440px;
  margin: 0 auto;
}

.stats-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-md);
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-purple {
  background: rgba(168, 85, 247, 0.15);
  color: #C084FC;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.stat-green {
  background: rgba(16, 185, 129, 0.15);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.stat-gold {
  background: rgba(241, 196, 15, 0.15);
  color: #FDE047;
  border: 1px solid rgba(241, 196, 15, 0.3);
}

.stat-blue {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.stat-card-icon .icon-svg {
  width: 22px;
  height: 22px;
}

.stat-card-data {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: -0.02em;
}

.hub-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px 12px 42px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.search-box input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 16px var(--purple-glow);
  background: rgba(22, 25, 36, 0.95);
}

.toolbar-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-dim);
  font-weight: 600;
}

.live-pulse {
  width: 8px;
  height: 8px;
  background-color: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--green);
  animation: pulseLive 2s infinite ease-in-out;
}

@keyframes pulseLive {
  0% { transform: scale(0.95); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.6; }
}

.table-wrapper {
  overflow-x: auto;
  overflow-y: visible;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-md);
  position: relative;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
}

thead th {
  text-align: left;
  padding: 16px 20px;
  background: rgba(10, 12, 17, 0.95);
  color: var(--purple-light);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
}

.col-check {
  width: 50px;
  text-align: center;
}

tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  font-size: 0.9rem;
  transition: background 0.15s ease;
}

tbody tr:last-child td {
  border-bottom: none;
}

.row-summary {
  cursor: pointer;
}

.row-summary:hover td {
  background: var(--bg-hover);
}

.row-summary.row-expanded-active td {
  background: rgba(155, 89, 182, 0.16);
  border-bottom-color: transparent;
}

.check-valide {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: rgba(22, 25, 37, 0.85);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  cursor: pointer;
  display: inline-grid;
  place-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
  vertical-align: middle;
}

.check-valide:hover {
  border-color: rgba(168, 85, 247, 0.5);
  background: rgba(30, 34, 50, 0.95);
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.check-valide::before {
  content: "";
  width: 10px;
  height: 6px;
  border-left: 2px solid #10B981;
  border-bottom: 2px solid #10B981;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: -2px;
}

.check-valide:checked {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.25);
}

.check-valide:checked::before {
  transform: rotate(-45deg) scale(1);
}

.gm-nom-cell {
  min-width: 220px;
}

.gm-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gm-avatar-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.gm-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(168, 85, 247, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.row-summary:hover .gm-avatar {
  transform: scale(1.08);
  border-color: var(--purple-light);
}

.gm-avatar-fallback {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  border: 2px solid rgba(168, 85, 247, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.gm-user-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gm-nom {
  font-weight: 700;
  font-size: 0.96rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.gm-grade {
  font-size: 0.78rem;
  color: var(--purple-light);
  margin-top: 3px;
  font-weight: 600;
}

.grade-vide {
  color: var(--text-dim);
  font-style: italic;
  font-weight: 400;
}

.badge-gm-semaine {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(241, 196, 15, 0.16);
  color: #FDE047;
  border: 1px solid rgba(241, 196, 15, 0.35);
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.75rem;
  white-space: nowrap;
  margin-top: 6px;
  box-shadow: 0 0 12px var(--gold-glow);
}

.row-gm-semaine td {
  background: rgba(241, 196, 15, 0.04);
}

.row-gm-semaine td:first-child {
  border-left: 3px solid var(--gold);
}

.quota-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 32px;
  padding: 0 12px;
  background: var(--accent-gradient-subtle);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #E9D5FF;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.92rem;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.18);
}

.champ-editable {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 12px;
  font-size: 0.88rem;
  width: 100%;
  font-family: inherit;
  transition: all 0.18s ease;
}

.champ-editable:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 12px var(--purple-glow);
  background: rgba(20, 22, 32, 0.95);
}

select.champ-editable {
  min-width: 140px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A855F7' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  background-color: rgba(18, 20, 29, 0.95);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
}

select.champ-editable:hover {
  border-color: rgba(168, 85, 247, 0.5);
  background-color: rgba(24, 27, 39, 0.98);
}

.custom-select-wrap {
  position: relative;
  min-width: 150px;
  font-family: inherit;
  user-select: none;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(18, 20, 29, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.custom-select-trigger:hover {
  border-color: rgba(168, 85, 247, 0.55);
  background: rgba(26, 29, 42, 0.98);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.25);
}

.custom-select-wrap.active .custom-select-trigger {
  border-color: var(--purple-light);
  box-shadow: 0 0 16px var(--purple-glow);
  background: rgba(28, 31, 46, 1);
}

.custom-select-arrow {
  width: 14px;
  height: 14px;
  stroke: var(--purple-light);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}

.custom-select-wrap.active .custom-select-arrow {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 175px;
  background: rgba(15, 17, 26, 0.98);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.65), 0 0 20px rgba(168, 85, 247, 0.18);
  padding: 6px;
  z-index: 1000;
  display: none;
  max-height: 270px;
  overflow-y: auto;
  animation: fadeInDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.custom-select-wrap.active .custom-select-dropdown {
  display: block;
}

.custom-select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 0.86rem;
  font-weight: 600;
  color: #D1D5DB;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.custom-select-item:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.28), rgba(99, 102, 241, 0.28));
  color: #FFFFFF;
  transform: translateX(3px);
}

.custom-select-item.selected {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(99, 102, 241, 0.4));
  color: #FFFFFF;
  font-weight: 700;
}

.custom-select-item.couleur-neutre { color: var(--text-dim); }
.custom-select-item.couleur-bien { color: #60A5FA; }
.custom-select-item.couleur-excellent { color: #34D399; }
.custom-select-item.couleur-alerte { color: #FBBF24; }
.custom-select-item.couleur-danger { color: #F87171; }

.custom-select-trigger.couleur-neutre { color: var(--text-dim); }
.custom-select-trigger.couleur-bien { color: #60A5FA; border-color: rgba(96, 165, 250, 0.4); background: rgba(96, 165, 250, 0.08); }
.custom-select-trigger.couleur-excellent { color: #34D399; border-color: rgba(52, 211, 153, 0.4); background: rgba(52, 211, 153, 0.08); }
.custom-select-trigger.couleur-alerte { color: #FBBF24; border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.08); }
.custom-select-trigger.couleur-danger { color: #F87171; border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.08); }

.custom-select-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 8px;
  display: inline-block;
}
.custom-select-dot.couleur-neutre { background: var(--text-dim); }
.custom-select-dot.couleur-bien { background: #60A5FA; box-shadow: 0 0 6px #60A5FA; }
.custom-select-dot.couleur-excellent { background: #34D399; box-shadow: 0 0 6px #34D399; }
.custom-select-dot.couleur-alerte { background: #FBBF24; box-shadow: 0 0 6px #FBBF24; }
.custom-select-dot.couleur-danger { background: #F87171; box-shadow: 0 0 6px #F87171; }

.row-detail td {
  padding: 0;
  background: rgba(9, 10, 15, 0.95);
}

.detail-panel {
  padding: 24px 28px;
  border-left: 3px solid var(--purple);
  animation: slideDown 0.18s cubic-bezier(0, 0, 0.2, 1);
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.5);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px 22px;
  margin-bottom: 20px;
}

.detail-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 7px;
}

.detail-static {
  padding-top: 3px;
  font-weight: 600;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
}

.stats-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.82rem;
  font-family: 'JetBrains Mono', monospace;
}

.badge-neutre {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.detail-field-full textarea {
  width: 100%;
  min-height: 72px;
  line-height: 1.5;
}

.flash-saved {
  outline: 2px solid var(--green) !important;
  box-shadow: 0 0 12px var(--green-glow) !important;
}

.cards-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gm-card {
  background: var(--bg-card);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.gm-card:hover {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: var(--shadow-md);
}

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

.gm-card-identite {
  flex: 1;
}

.gm-card-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gm-card-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.gm-card-field label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
}

.gm-card-toggle {
  width: 100%;
  margin-top: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--purple-light);
  font-weight: 700;
  padding: 11px;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.gm-card-toggle:hover {
  background: rgba(155, 89, 182, 0.18);
  border-color: var(--border-focus);
}

.gm-card-detail {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-box {
  background: rgba(20, 23, 33, 0.95);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 90%;
  max-width: 520px;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 0, 0, 0.8);
  position: relative;
  overflow: hidden;
}

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

.modal-box h2 {
  margin: 0 0 8px;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-sub {
  color: var(--text-muted);
  margin: 0 0 20px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.modal-box-wide {
  max-width: 760px;
}

.logs-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.logs-list {
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}

.log-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: all 0.15s ease;
}

.log-item:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(20, 24, 34, 0.8);
}

.log-nom-input {
  font-weight: 700;
}

.log-meta {
  color: var(--text-dim);
  font-size: 0.82rem;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
}

.log-actions {
  display: flex;
  gap: 8px;
}

.loading, .empty {
  color: var(--text-muted);
  text-align: center;
  margin-top: 60px;
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(168, 85, 247, 0.2);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 80vh;
  color: var(--text-muted);
}

.icon-svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
}

.badge-gm-semaine .icon-svg {
  stroke: var(--gold);
  width: 14px;
  height: 14px;
}

@media (max-width: 900px) {
  .stats-overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .topbar {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .topbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
    justify-content: flex-start;
  }
  .topbar-actions button,
  .topbar-actions form {
    flex-grow: 1;
  }
  .topbar-actions button {
    justify-content: center;
    font-size: 0.8rem;
    padding: 8px 12px;
  }
  main {
    padding: 16px 12px 40px;
  }
  .hub-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .search-box {
    max-width: 100%;
  }
  .modal-box {
    width: 95%;
    padding: 20px 16px;
  }
  .theme-preset-bar {
    flex-wrap: wrap;
  }
}

@media (max-width: 550px) {
  .stats-overview {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .brand-title {
    font-size: 1rem;
  }
  .brand-icon {
    width: 36px;
    height: 36px;
  }
  .brand-icon .icon-brand {
    width: 18px;
    height: 18px;
  }
  .stat-card {
    padding: 14px 16px;
  }
  .stat-value {
    font-size: 1.25rem;
  }
  .gm-card {
    padding: 14px;
  }
  .login-box {
    padding: 28px 20px;
  }
}

::-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.14);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
}

.modal-box-large {
  max-width: 900px;
  width: 94%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.theme-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.theme-preset-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.theme-preset-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 4px;
}

.btn-preset {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  font-family: inherit;
}

.btn-preset:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--purple-light);
  transform: translateY(-1px);
}

.theme-grid-container {
  overflow-y: auto;
  max-height: 52vh;
  padding-right: 6px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.theme-category-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--purple-light);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

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

.theme-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.theme-color-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.theme-color-card:hover {
  border-color: rgba(168, 85, 247, 0.45);
  transform: translateY(-1px);
}

.theme-color-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.theme-color-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-color-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.theme-picker-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.theme-picker-input {
  appearance: none;
  -webkit-appearance: none;
  border: 1.5px solid var(--border);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.theme-picker-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.theme-picker-input::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.theme-picker-input:hover {
  transform: scale(1.08);
  border-color: #fff;
}

.theme-hex-input {
  width: 78px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 6px 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.theme-hex-input:focus {
  outline: none;
  border-color: var(--purple-light);
}

.theme-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
