/* ============================================================
   Easy BS — Style Sheet
   Design moderne, responsive, mode clair/sombre
   ============================================================ */

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

/* ---- VARIABLES : MODE CLAIR ---- */
:root {
  /* Palette PM */
  --pm-navy:    #002366;
  --pm-blue:    #0052CC;
  --pm-cyan:    #0081C6;
  --pm-gold:    #D4A017;
  --pm-red:     #DC2626;
  --pm-green:   #16A34A;

  /* Surfaces */
  --bg:         #F0F2F7;
  --surface:    #FFFFFF;
  --surface-2:  #F8FAFC;
  --border:     #E2E8F0;
  --border-2:   #CBD5E1;

  /* Textes */
  --text:       #0F172A;
  --text-2:     #475569;
  --text-3:     #94A3B8;

  /* Sidebar */
  --sidebar-bg: #001845;
  --sidebar-text: rgba(255,255,255,0.7);
  --sidebar-active-bg: rgba(255,255,255,0.12);
  --sidebar-active-text: #FFFFFF;
  --sidebar-hover-bg: rgba(255,255,255,0.06);

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg:  0 10px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);

  /* Misc */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --font:      'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition: 0.2s ease;
}

/* ---- VARIABLES : MODE SOMBRE ---- */
[data-theme="dark"] {
  --bg:         #0D1117;
  --surface:    #161B22;
  --surface-2:  #1C2128;
  --border:     #30363D;
  --border-2:   #484F58;

  --text:       #E6EDF3;
  --text-2:     #8B949E;
  --text-3:     #6E7681;

  --sidebar-bg: #010409;
  --sidebar-text: rgba(255,255,255,0.6);
  --sidebar-active-bg: rgba(255,255,255,0.1);
  --sidebar-active-text: #FFFFFF;

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg:  0 10px 30px rgba(0,0,0,0.5);
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  transition: background var(--transition), color var(--transition);
}

/* ===== SHELL LAYOUT ===== */
.shell { display: flex; min-height: 100vh; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  transition: transform var(--transition);
  box-shadow: 2px 0 12px rgba(0,0,0,0.2);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-icon { font-size: 24px; }
.logo-title { display: block; font-weight: 700; color: #fff; font-size: 15px; line-height: 1.2; }
.logo-sub   { display: block; font-size: 10px; color: rgba(255,255,255,0.45); text-transform: uppercase; letter-spacing: 0.08em; }

.sidebar-close {
  display: none;
  background: none; border: none; color: rgba(255,255,255,0.5);
  cursor: pointer; font-size: 16px; padding: 4px;
}

.nav-menu {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: none;
  color: var(--sidebar-text);
  cursor: pointer;
  width: 100%;
  text-align: left;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  transition: background var(--transition), color var(--transition);
}
.nav-item:hover   { background: var(--sidebar-hover-bg); color: var(--sidebar-active-text); }
.nav-item.active  { background: var(--sidebar-active-bg); color: var(--sidebar-active-text); }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 60%; background: var(--pm-cyan);
  border-radius: 0 3px 3px 0;
}
.nav-item { position: relative; }
.nav-icon  { font-size: 16px; width: 20px; text-align: center; }
.nav-label { font-size: 13px; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.db-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}
.db-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #64748B;
  flex-shrink: 0;
  transition: background 0.4s;
}
.db-dot.ok      { background: #22C55E; box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.db-dot.error   { background: #EF4444; }
.db-dot.offline { background: #F59E0B; }

/* ===== MAIN WRAPPER ===== */
.main-wrapper {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}

/* ===== TOPBAR ===== */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0; z-index: 100;
  box-shadow: var(--shadow-sm);
}
.burger-btn {
  display: none;
  background: none; border: none; color: var(--text);
  cursor: pointer; font-size: 20px; padding: 4px;
}
.topbar-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}
.topbar-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
}
.icon-btn:hover { background: var(--surface-2); }

/* ===== MAIN CONTENT ===== */
.main {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.page { display: none; }
.page.active { display: block; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title  { font-size: 20px; font-weight: 700; color: var(--text); }
.page-subtitle { font-size: 13px; color: var(--text-2); margin-top: 2px; }

/* ===== CARDS ===== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  font-family: var(--font);
  transition: all var(--transition);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn-primary  { background: var(--pm-navy); color: #fff; border-color: var(--pm-navy); }
.btn-primary:hover { background: var(--pm-blue); border-color: var(--pm-blue); }
.btn-secondary { background: var(--surface); color: var(--text); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--pm-red); border-color: var(--pm-red); }
.btn-danger:hover { background: #FEF2F2; }
.btn-generate {
  width: 100%;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--pm-navy), var(--pm-blue));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 15px rgba(0,82,204,0.35);
}
.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,82,204,0.45);
}
.btn-generate:active { transform: translateY(0); }

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-btn {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  transition: all var(--transition);
}
.filter-btn:hover { border-color: var(--pm-cyan); color: var(--pm-cyan); }
.filter-btn.active { background: var(--pm-navy); color: #fff; border-color: var(--pm-navy); }

/* ===== AGENT GRID ===== */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.agent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  position: relative;
  border-left: 4px solid var(--border-2);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.agent-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.agent-card.absent { border-left-color: var(--pm-red); background: #FFF5F5; }
[data-theme="dark"] .agent-card.absent { background: rgba(220,38,38,0.08); }
.agent-card.absent .agent-name { text-decoration: line-through; opacity: 0.6; }

.agent-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.agent-name { font-weight: 700; font-size: 13px; color: var(--text); margin: 4px 0 2px; }
.agent-prenom { font-size: 11px; color: var(--text-2); margin-bottom: 8px; }
.agent-matricule { font-family: var(--font-mono); font-size: 10px; color: var(--text-3); }
.agent-abs-dots { display: flex; gap: 3px; margin-top: 8px; flex-wrap: wrap; }
.abs-dot {
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 700; font-family: var(--font-mono);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-3);
}
.abs-dot.absent { background: #FEE2E2; border-color: #FCA5A5; color: var(--pm-red); }

/* ===== STATUS BADGES ===== */
.status-badge {
  font-size: 9px; font-weight: 700;
  padding: 2px 7px; border-radius: 12px;
  text-transform: uppercase; letter-spacing: 0.05em;
  display: inline-block; white-space: nowrap;
}
.badge-chef     { background: var(--pm-navy); color: #fff; }
.badge-adjoint  { background: var(--pm-cyan); color: #fff; }
.badge-titulaire { background: #DCFCE7; color: #15803D; }
.badge-stagiaire { background: #FEF3C7; color: #92400E; }
[data-theme="dark"] .badge-titulaire { background: rgba(21,128,61,0.25); color: #4ADE80; }
[data-theme="dark"] .badge-stagiaire { background: rgba(146,64,14,0.25); color: #FCD34D; }

/* ===== EQUIPMENT DOTS ===== */
.equip-dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 8px; }
.edot {
  font-size: 8px; font-weight: 700;
  padding: 1px 5px; border-radius: 3px;
  font-family: var(--font-mono);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-3);
}
.edot.on-pie { background: #EDE9FE; border-color: #C4B5FD; color: #6D28D9; }
.edot.on-bat { background: #FEF3C7; border-color: #FDE68A; color: #92400E; }
.edot.on-arm { background: #FEE2E2; border-color: #FCA5A5; color: #991B1B; }
.edot.on-gaz { background: #D1FAE5; border-color: #6EE7B7; color: #065F46; }
.edot.on-cam { background: #DBEAFE; border-color: #93C5FD; color: #1E40AF; }
.edot.on-vtt { background: #FCE7F3; border-color: #F9A8D4; color: #9D174D; }
[data-theme="dark"] .edot.on-pie { background: rgba(109,40,217,0.2); color: #C4B5FD; }
[data-theme="dark"] .edot.on-bat { background: rgba(146,64,14,0.2); color: #FDE68A; }
[data-theme="dark"] .edot.on-arm { background: rgba(153,27,27,0.2); color: #FCA5A5; }
[data-theme="dark"] .edot.on-gaz { background: rgba(6,95,70,0.2); color: #6EE7B7; }
[data-theme="dark"] .edot.on-cam { background: rgba(30,64,175,0.2); color: #93C5FD; }
[data-theme="dark"] .edot.on-vtt { background: rgba(157,23,77,0.2); color: #F9A8D4; }

/* ===== DAY NAV (Absences) ===== */
.day-nav {
  display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap;
}
.day-btn {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer; font-weight: 600; font-size: 13px;
  font-family: var(--font);
  transition: all var(--transition);
}
.day-btn:hover  { border-color: var(--pm-cyan); color: var(--pm-cyan); }
.day-btn.active { background: var(--pm-navy); color: #fff; border-color: var(--pm-navy); }

.abs-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-2);
  display: flex; gap: 20px; flex-wrap: wrap;
}
.abs-info strong { color: var(--text); }

/* ===== GÉNÉRATION PAGE ===== */
.gen-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.gen-description { font-size: 13px; color: var(--text-2); margin-bottom: 20px; line-height: 1.6; }

.horaires-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.day-param-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 0;
  transition: border-color var(--transition);
}
.day-param-card:focus-within {
  border-color: var(--pm-cyan);
}
.day-param-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.vtt-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.vtt-toggle-label input[type="checkbox"] {
  cursor: pointer;
  accent-color: #0284C7;
  width: 15px;
  height: 15px;
}
.vtt-badge-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
}
.vtt-toggle-label input[type="checkbox"]:checked ~ .vtt-badge-label {
  color: #0284C7;
}
.form-group { margin-bottom: 12px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-label { display: block; font-size: 11px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.04em; }
.form-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  transition: border-color var(--transition);
}
.form-input:focus { outline: none; border-color: var(--pm-cyan); box-shadow: 0 0 0 3px rgba(0,129,198,0.12); }
[data-theme="dark"] .form-input { background: var(--surface-2); }

.effectif-preview {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  margin-bottom: 20px;
}
.eff-day-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: center;
}
.eff-day-label { font-size: 10px; font-weight: 700; color: var(--text-2); text-transform: uppercase; }
.eff-day-count { font-size: 22px; font-weight: 700; color: var(--pm-blue); line-height: 1.2; }
.eff-day-sub   { font-size: 10px; color: var(--text-3); }

/* ===== BULLETINS ===== */
.bulletin-wrap {
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.bulletin-header {
  background: linear-gradient(135deg, var(--pm-navy), var(--pm-blue));
  color: #fff;
  padding: 14px 20px;
  display: flex; justify-content: space-between; align-items: center;
}
.bulletin-header h3 { font-size: 15px; font-weight: 700; }
.bulletin-header p  { font-size: 12px; opacity: 0.8; }
.bulletin-date { font-size: 12px; opacity: 0.7; text-align: right; }

.bulletin-body { padding: 16px; background: var(--surface); }
.equipe-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }

/* Équipage Card */
.equipe-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--transition);
}
.equipe-card.drop-over {
  outline: 2px dashed var(--pm-cyan);
  background: rgba(0,129,198,0.05);
}
.equipe-header {
  padding: 7px 12px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.equipe-header.type-v { background: var(--pm-navy); color: #fff; }
.equipe-header.type-p { background: #065F46; color: #fff; }
.equipe-header.type-b { background: #0284C7; color: #fff; }
.equipe-header.type-a { background: #4B5563; color: #fff; }
.equipe-count {
  background: rgba(255,255,255,0.2);
  padding: 1px 7px; border-radius: 10px;
  font-size: 10px;
}

/* Agent row dans le bulletin */
.agent-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  cursor: grab;
  transition: background var(--transition);
  background: var(--surface);
}
.agent-row:last-child { border-bottom: none; }
.agent-row:hover { background: var(--surface-2); }
.agent-row:active { cursor: grabbing; }
.agent-row.dragging { opacity: 0.4; }

.agent-role-icon { font-size: 14px; width: 20px; text-align: center; flex-shrink: 0; }
.agent-row-info { flex: 1; min-width: 0; }
.agent-row-name { font-weight: 600; font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-row-sub  { font-size: 10px; color: var(--text-3); font-family: var(--font-mono); }
.agent-row-badges { display: flex; gap: 2px; flex-wrap: wrap; }
.rbadge {
  font-size: 7px; font-weight: 700; padding: 1px 4px;
  border-radius: 2px; font-family: var(--font-mono);
}
.rb-pie { background: #EDE9FE; color: #6D28D9; border: 1px solid #C4B5FD; }
.rb-bat { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.rb-arm { background: #FEE2E2; color: #991B1B; border: 1px solid #FCA5A5; }
.rb-gaz { background: #D1FAE5; color: #065F46; border: 1px solid #6EE7B7; }
.rb-cam { background: #DBEAFE; color: #1E40AF; border: 1px solid #93C5FD; }
.rb-vtt { background: #FCE7F3; color: #9D174D; border: 1px solid #F9A8D4; }
[data-theme="dark"] .rb-pie { background: rgba(109,40,217,0.2); color: #C4B5FD; }
[data-theme="dark"] .rb-arm { background: rgba(153,27,27,0.2); color: #FCA5A5; }
[data-theme="dark"] .rb-gaz { background: rgba(6,95,70,0.2); color: #6EE7B7; }
[data-theme="dark"] .rb-cam { background: rgba(30,64,175,0.2); color: #93C5FD; }

/* Zone ADMIN */
.admin-zone {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 12px;
}
.admin-agents {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 10px 12px;
  background: var(--surface);
  min-height: 40px;
}
.admin-pill {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px; font-weight: 600;
  cursor: grab;
  transition: all var(--transition);
}
.admin-pill:hover { border-color: var(--pm-cyan); }

/* Drop zone highlight */
.drop-zone { min-height: 50px; }
.drop-zone.drop-over .equipe-card { outline: 2px dashed var(--pm-cyan); background: rgba(0,129,198,0.04); }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-2);
  display: none;
}
.empty-state.visible { display: block; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.empty-state p  { margin-bottom: 20px; }

/* ===== MODAL ===== */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  z-index: 500;
  padding: 16px;
}
.modal-bg.open { display: flex; animation: fadeIn 0.15s ease; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalSlide 0.2s ease;
}
@keyframes modalSlide { from { transform: translateY(-16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none; border: none; color: var(--text-2);
  cursor: pointer; font-size: 18px; padding: 2px; line-height: 1;
  transition: color var(--transition);
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 20px; }

.modal-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.modal-footer-right { display: flex; gap: 8px; }

/* Equipment grid in modal */
.equip-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.equip-label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 6px;
  border-radius: 4px;
  transition: background var(--transition);
}
.equip-label:hover { background: var(--border); }
.equip-cb { display: none; }
.equip-badge {
  font-size: 9px; font-weight: 700; padding: 2px 6px;
  border-radius: 3px; font-family: var(--font-mono);
  flex-shrink: 0;
}
.equip-pie { background: #EDE9FE; color: #6D28D9; }
.equip-bat { background: #FEF3C7; color: #92400E; }
.equip-arm { background: #FEE2E2; color: #991B1B; }
.equip-gaz { background: #D1FAE5; color: #065F46; }
.equip-cam { background: #DBEAFE; color: #1E40AF; }
.equip-vtt { background: #FCE7F3; color: #9D174D; }
.equip-cb:checked + .equip-badge { filter: saturate(2) brightness(0.9); outline: 2px solid currentColor; outline-offset: 1px; }
.equip-name { font-size: 11px; color: var(--text-2); }

/* ===== TOAST ===== */
#toast-container {
  position: fixed; top: 16px; right: 16px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 600; font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease;
  pointer-events: none;
  min-width: 280px;
}
.toast.toast-success { background: #16A34A; }
.toast.toast-error   { background: #DC2626; }
.toast.toast-info    { background: var(--pm-navy); }
.toast.toast-out     { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn  { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(110%); opacity: 0; } }

/* ===== PRINT ===== */
@media print {
  .no-print { display: none !important; }
  .sidebar { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  .topbar { display: none !important; }
  .main { padding: 0 !important; }
  .bulletin-wrap { page-break-after: always; box-shadow: none !important; border: 1px solid #000 !important; border-radius: 0 !important; }
  .bulletin-wrap:last-child { page-break-after: auto; }
  .agent-row { padding: 5px 8px; }
  .equipe-card { break-inside: avoid; }
  body { font-size: 11px; color: #000 !important; background: #fff !important; }
  .bulletin-header { background: #002366 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .equipe-header.type-v { background: #002366 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .equipe-header.type-p { background: #065F46 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .equipe-header.type-b { background: #0284C7 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .equipe-header.type-a { background: #4B5563 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .gen-layout { grid-template-columns: 1fr; }
  .equipe-grid { grid-template-columns: 1fr; }
  .horaires-grid { grid-template-columns: 1fr; }
  .effectif-preview { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-close { display: flex; }
  .main-wrapper { margin-left: 0; }
  .burger-btn { display: flex; }
  .agent-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .form-row { grid-template-columns: 1fr; }
  .equip-grid { grid-template-columns: 1fr; }
  .main { padding: 16px; }
}

@media (max-width: 480px) {
  .agent-grid { grid-template-columns: 1fr 1fr; }
  .effectif-preview { grid-template-columns: repeat(2, 1fr); }
  .page-header { flex-direction: column; }
  .modal { max-width: 100%; margin: 8px; }
}

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
}
.sidebar-overlay.visible { display: block; }

/* ===== ALERT (validation) ===== */
.form-input.error { border-color: var(--pm-red); box-shadow: 0 0 0 3px rgba(220,38,38,0.12); }