/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', system-ui, Arial, sans-serif; background: #f1f5f9; color: #0f172a; min-height: 100vh; }
.hidden { display: none !important; }
button { cursor: pointer; font-family: inherit; }
input, textarea { font-family: inherit; }

/* ── Écran démarrage ──────────────────────────────────────────────────────── */
#screen-startup {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
}
.startup-card {
  background: white;
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  text-align: center;
}
.startup-logo {
  font-size: 42px;
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
}
.startup-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #0f172a;
  text-transform: uppercase;
}
.startup-subtitle {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 32px;
  margin-top: 4px;
}
#clock-startup {
  font-size: 36px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #1e293b;
  letter-spacing: .04em;
  margin-bottom: 32px;
  padding: 16px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}
.form-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #64748b;
  display: block;
  text-align: left;
  margin-bottom: 8px;
}
.type-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.type-btn {
  flex: 1;
  min-width: 100px;
  padding: 12px 8px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #64748b;
  transition: all .15s;
}
.type-btn-wide  { flex-basis: calc(50% - 5px); }
.type-btn:hover { border-color: #94a3b8; color: #0f172a; }
.type-btn.active[data-type="ROYAN"]    { border-color: #2563eb; background: #eff6ff; color: #1d4ed8; }
.type-btn.active[data-type="CPR"]      { border-color: #dc2626; background: #fef2f2; color: #b91c1c; }
.type-btn.active[data-type="SGD"]      { border-color: #7c3aed; background: #f5f3ff; color: #6d28d9; }
.type-btn.active[data-type="BISITE"]   { border-color: #d97706; background: #fffbeb; color: #92400e; }
.type-btn.active[data-type="NATIONAL"] { border-color: #be123c; background: #fff1f2; color: #9f1239; }
.type-btn-national { border-color: #fecdd3; }
.type-btn-national:hover { border-color: #be123c; color: #9f1239; }

.startup-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 24px;
  transition: border-color .15s;
  outline: none;
}
.startup-input:focus { border-color: #3b82f6; }

.btn-open {
  width: 100%;
  padding: 16px;
  background: #1e293b;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: background .15s, transform .1s;
}
.btn-open:hover { background: #0f172a; transform: translateY(-1px); }
.btn-open:disabled { background: #94a3b8; cursor: default; transform: none; }

.restore-banner {
  background: #fef9c3;
  border: 1px solid #fde047;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  text-align: left;
}
.restore-banner strong { color: #854d0e; }
.restore-actions { display: flex; gap: 8px; margin-top: 8px; }
.btn-restore  { flex:1; padding:8px; background:#f59e0b; color:white; border:none; border-radius:6px; font-size:12px; font-weight:700; }
.btn-discard  { flex:1; padding:8px; background:#e2e8f0; color:#475569; border:none; border-radius:6px; font-size:12px; font-weight:700; }

.admin-link {
  display: block;
  margin-top: 16px;
  font-size: 12px;
  color: #94a3b8;
  text-decoration: none;
}
.admin-link:hover { color: #64748b; }

/* ── Header (écran actif + clôturé) ──────────────────────────────────────── */
#screen-active, #screen-closed {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.crisis-header {
  background: #1e293b;
  color: white;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.header-left { display: flex; align-items: center; gap: 14px; }
.btn-home-header {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: white;
  font-size: 16px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.btn-home-header:hover { background: rgba(255,255,255,.22); }
.crisis-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.badge-ROYAN    { background: #2563eb; color: white; }
.badge-CPR      { background: #dc2626; color: white; }
.badge-SGD      { background: #7c3aed; color: white; }
.badge-BISITE   { background: #d97706; color: white; }
.badge-NATIONAL { background: #be123c; color: white; }

.crisis-header-name {
  font-size: 16px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  border-bottom: 1px dashed transparent;
  transition: border-color .15s;
}
.crisis-header-name:hover { border-bottom-color: rgba(255,255,255,.5); }
.body.membre-mode .crisis-header-name { cursor: default; }
.body.membre-mode .crisis-header-name:hover { border-bottom-color: transparent; }

#header-rename-form {
  display: flex; align-items: center; gap: 6px;
}
.header-rename-input {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 5px;
  color: white;
  font-size: 15px;
  font-weight: 700;
  padding: 3px 8px;
  font-family: inherit;
  outline: none;
  width: 220px;
}
.header-rename-input:focus { border-color: white; background: rgba(255,255,255,.2); }
.btn-rename-ok, .btn-rename-cancel {
  background: none; border: 1px solid rgba(255,255,255,.4);
  color: white; border-radius: 4px;
  padding: 3px 8px; font-size: 13px; cursor: pointer;
  transition: background .12s;
}
.btn-rename-ok:hover     { background: rgba(255,255,255,.2); }
.btn-rename-cancel:hover { background: rgba(255,100,100,.3); }
.header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
#timer {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #f59e0b;
  letter-spacing: .04em;
  line-height: 1;
}
.timer-label { font-size: 10px; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; }
#clock-active, #clock-closed {
  font-size: 14px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

/* ── Layout principal ─────────────────────────────────────────────────────── */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.panel-left {
  width: 340px;
  flex-shrink: 0;
  background: white;
  border-right: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 14px;
  overflow-y: auto;
}
.panel-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Panneau gauche — formulaire ─────────────────────────────────────────── */
.section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #94a3b8;
}
.type-radios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.type-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: all .12s;
  letter-spacing: .04em;
  background: white;
  text-align: left;
  font-family: inherit;
  width: 100%;
}
.type-radio-label .dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  flex-shrink: 0;
  transition: all .12s;
}
.type-radio-label.sel-INFO     { border-color: #3b82f6; background: #eff6ff; color: #1d4ed8; }
.type-radio-label.sel-ACTION   { border-color: #22c55e; background: #f0fdf4; color: #15803d; }
.type-radio-label.sel-ALERTE   { border-color: #ef4444; background: #fef2f2; color: #b91c1c; }
.type-radio-label.sel-DÉCISION { border-color: #8b5cf6; background: #f5f3ff; color: #6d28d9; }
.type-radio-label.sel-INFO     .dot { background: #3b82f6; border-color: #3b82f6; }
.type-radio-label.sel-ACTION   .dot { background: #22c55e; border-color: #22c55e; }
.type-radio-label.sel-ALERTE   .dot { background: #ef4444; border-color: #ef4444; }
.type-radio-label.sel-DÉCISION .dot { background: #8b5cf6; border-color: #8b5cf6; }

#entry-textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 14px;
  resize: vertical;
  min-height: 100px;
  transition: border-color .15s;
  outline: none;
  line-height: 1.5;
}
#entry-textarea:focus { border-color: #3b82f6; }
.hint { font-size: 11px; color: #94a3b8; text-align: right; margin-top: -8px; }

.btn-add {
  width: 100%;
  padding: 13px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  transition: background .15s;
}
.btn-add:hover { background: #1d4ed8; }

.custom-time-row { margin: -2px 0 8px; }
.custom-time-toggle {
  background: none; border: none; padding: 0;
  font-size: 12px; color: #94a3b8; cursor: pointer;
  font-family: inherit; letter-spacing: .01em;
  transition: color .15s;
}
.custom-time-toggle:hover { color: #d97706; }
.custom-time-toggle.active { color: #d97706; font-weight: 700; }
.custom-time-panel {
  display: flex; align-items: center; gap: 8px;
  margin-top: 6px; padding: 8px 10px;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px;
}
.custom-time-input {
  padding: 5px 8px; border: 1px solid #fde68a; border-radius: 5px;
  font-size: 13px; font-family: inherit; background: white;
  color: #92400e; outline: none; width: 100px;
}
.custom-time-input:focus { border-color: #d97706; }
.custom-time-hint { font-size: 11px; color: #92400e; font-style: italic; }

.entry-retro-note {
  display: block; font-size: 11px; color: #d97706;
  font-style: italic; margin-top: 3px; font-weight: 600;
}

.divider { height: 1px; background: #f1f5f9; margin: 4px 0; }

.btn-close-crisis {
  width: 100%;
  padding: 13px;
  background: white;
  color: #dc2626;
  border: 2px solid #fca5a5;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  transition: all .15s;
}
.btn-close-crisis:hover { background: #fef2f2; border-color: #ef4444; }

/* ── Journal (panneau droit) ──────────────────────────────────────────────── */
.journal-header {
  padding: 14px 20px 10px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: white;
}
.journal-count { font-size: 12px; color: #94a3b8; font-weight: 600; }
.journal-actions-bar {
  display: flex;
  gap: 8px;
}
.btn-ai {
  padding: 7px 14px;
  background: #7c3aed;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  transition: background .15s;
}
.btn-ai:hover { background: #6d28d9; }
.btn-end-report {
  padding: 7px 14px;
  background: #0369a1;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.btn-end-report:hover { background: #0284c7; }

.btn-pdf {
  padding: 7px 14px;
  background: #0f172a;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  transition: background .15s;
}
.btn-pdf:hover { background: #1e293b; }

.end-report-header {
  display: flex; align-items: center; gap: 10px;
  background: #e0f2fe; border: 1px solid #bae6fd;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 16px;
  font-size: 13px; font-weight: 700; color: #0369a1;
}
.end-report-badge {
  background: #0369a1; color: white;
  border-radius: 6px; padding: 3px 8px; font-size: 12px;
}

#journal-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.journal-empty {
  text-align: center;
  color: #cbd5e1;
  font-size: 14px;
  padding: 48px 20px;
}

/* ── Entrée journal ───────────────────────────────────────────────────────── */
.entry {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 4px solid transparent;
  background: #f8fafc;
  position: relative;
  animation: slideIn .2s ease;
}
@keyframes slideIn { from { opacity:0; transform:translateY(-8px); } to { opacity:1; transform:none; } }
.entry-INFO        { border-left-color: #3b82f6; }
.entry-ACTION      { border-left-color: #22c55e; }
.entry-ALERTE      { border-left-color: #ef4444; background: #fef9f9; }
.entry-DÉCISION    { border-left-color: #8b5cf6; background: #faf9ff; }
.entry-RÉOUVERTURE {
  border-left: 4px solid #d97706;
  border-top: 2px dashed #d97706;
  border-bottom: 2px dashed #d97706;
  background: #fffbeb;
  justify-content: center;
  gap: 10px;
  padding: 10px 16px;
}
.badge-RÉOUVERTURE  { background: #fef3c7; color: #92400e; }
.reopen-marker-icon { font-size: 16px; flex-shrink: 0; }
.reopen-marker-text { color: #92400e; font-size: 13px; font-style: italic; font-weight: 600; }

.entry-time {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex-shrink: 0;
  width: 54px;
  padding-top: 2px;
  gap: 1px;
}
.entry-date {
  font-size: 9px;
  font-weight: 600;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  letter-spacing: .02em;
}
.entry-time-val {
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.entry-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
}
.badge-INFO     { background: #dbeafe; color: #1d4ed8; }
.badge-ACTION   { background: #dcfce7; color: #15803d; }
.badge-ALERTE   { background: #fee2e2; color: #b91c1c; }
.badge-DÉCISION { background: #ede9fe; color: #6d28d9; }

.entry-text { flex: 1; font-size: 14px; line-height: 1.5; color: #1e293b; word-break: break-word; }
.entry-edit-btn {
  opacity: 0;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: opacity .15s, color .15s;
  flex-shrink: 0;
}
.entry:hover .entry-edit-btn { opacity: 1; }
.entry-edit-btn:hover { color: #475569; background: #e2e8f0; }
.entry.editable { outline: 2px solid #f59e0b; outline-offset: 1px; }

/* Inline edit dans le journal */
.entry-edit-form { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.entry-edit-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 2px solid #f59e0b;
  border-radius: 6px;
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
  outline: none;
}
.entry-edit-actions { display: flex; gap: 6px; }
.btn-save-edit   { padding:5px 12px; background:#22c55e; color:white; border:none; border-radius:5px; font-size:12px; font-weight:700; }
.btn-cancel-edit { padding:5px 12px; background:#e2e8f0; color:#475569; border:none; border-radius:5px; font-size:12px; font-weight:700; }

/* ── Écran clôturé ────────────────────────────────────────────────────────── */
.closed-banner {
  background: #f0fdf4;
  border-bottom: 1px solid #bbf7d0;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 10px;
}
.closed-info { font-size: 13px; color: #166534; }
.closed-info strong { font-weight: 700; font-size: 15px; }
.closed-buttons { display: flex; gap: 8px; }
.btn-reopen-crisis {
  padding: 8px 16px;
  background: #d97706;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}
.btn-reopen-crisis:hover { background: #b45309; }
.btn-new-crisis {
  padding: 8px 16px;
  background: #1e293b;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}
.closed-journal {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ── Modal IA ─────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-box {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 700; color: #0f172a; }
.modal-close { background: none; border: none; font-size: 20px; color: #94a3b8; line-height: 1; padding: 4px; }
.modal-close:hover { color: #475569; }
.btn-contacts-header {
  background: none; border: 1px solid rgba(255,255,255,.3);
  color: rgba(255,255,255,.85); font-size: 12px; font-weight: 700;
  padding: 6px 12px; border-radius: 6px; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.btn-contacts-header:hover { background: rgba(255,255,255,.12); color: white; }
.btn-contact-notified {
  flex-shrink: 0; padding: 6px 13px; border-radius: 7px; border: none;
  background: #dcfce7; color: #15803d; font-size: 12px; font-weight: 800;
  cursor: pointer; font-family: inherit; transition: all .15s; white-space: nowrap;
}
.btn-contact-notified:hover { background: #bbf7d0; }
.btn-print-summary {
  background: none; border: 1px solid #e2e8f0; border-radius: 6px;
  padding: 5px 11px; font-size: 12px; color: #475569; cursor: pointer;
  font-family: inherit; transition: all .12s;
}
.btn-print-summary:hover { background: #f1f5f9; border-color: #94a3b8; color: #1e293b; }
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  font-size: 14px;
  line-height: 1.7;
  color: #1e293b;
}
.modal-body h2 { font-size: 15px; font-weight: 700; color: #0f172a; margin: 20px 0 8px; }
.modal-body h2:first-child { margin-top: 0; }
.modal-body ul { padding-left: 20px; margin: 6px 0; }
.modal-body li { margin: 4px 0; }
.modal-loading { text-align: center; padding: 40px; color: #64748b; }
.modal-spinner {
  width: 40px; height: 40px;
  border: 4px solid #e2e8f0;
  border-top-color: #7c3aed;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Toast ────────────────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 24px; right: 24px;
  background: #1e293b;
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  z-index: 2000;
  transform: translateY(20px);
  opacity: 0;
  transition: all .25s;
  max-width: 320px;
}
#toast.show { transform: translateY(0); opacity: 1; }
#toast.toast-ok   { background: #16a34a; }
#toast.toast-warn { background: #d97706; }
#toast.toast-err  { background: #dc2626; }

/* ── Modale confirmation clôture ─────────────────────────────────────────── */
.confirm-box {
  background: white;
  border-radius: 12px;
  padding: 32px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.confirm-box h3 { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.confirm-box p  { font-size: 14px; color: #64748b; margin-bottom: 24px; line-height: 1.5; }
.confirm-buttons { display: flex; gap: 10px; }
.btn-confirm-close { flex:1; padding:12px; background:#dc2626; color:white; border:none; border-radius:8px; font-weight:700; font-size:14px; }
.btn-confirm-cancel { flex:1; padding:12px; background:#e2e8f0; color:#475569; border:none; border-radius:8px; font-weight:700; font-size:14px; }

/* ── Login overlay ────────────────────────────────────────────────────────── */
#login-overlay {
  position: fixed; inset: 0;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
}
.login-card {
  background: white;
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-card h2 { font-size: 20px; font-weight: 800; color: #0f172a; margin-bottom: 4px; }
.login-card p  { font-size: 13px; color: #64748b; margin-bottom: 24px; }
.login-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 12px;
  outline: none;
  transition: border-color .15s;
}
.login-input:focus { border-color: #2563eb; }
.login-error { color: #dc2626; font-size: 13px; min-height: 18px; margin-bottom: 10px; }
.btn-login {
  width: 100%;
  padding: 14px;
  background: #1e293b;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .15s;
}
.btn-login:hover { background: #0f172a; }

/* ── Bandeau récap ────────────────────────────────────────────────────────── */
.recap-indicator {
  font-size: 11px;
  color: #94a3b8;
  text-align: right;
  padding: 0 4px;
  margin-top: 2px;
}

/* ── Panneau membres ──────────────────────────────────────────────────────── */
.members-toggle {
  width: 100%;
  padding: 10px 12px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all .12s;
}
.members-toggle:hover { border-color: #94a3b8; color: #1e293b; }
.members-toggle.has-members { border-color: #3b82f6; background: #eff6ff; color: #1d4ed8; }
.members-badge {
  background: #3b82f6;
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}
.members-content {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0 0 8px 8px;
  border-top: none;
  margin-top: -2px;
  padding: 10px 12px;
}
.members-list {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 10px;
}
.member-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  border-radius: 5px;
  cursor: pointer;
  transition: background .1s;
}
.member-item:hover { background: #e2e8f0; }
.member-item input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; accent-color: #2563eb; }
.member-name { font-size: 13px; font-weight: 600; color: #1e293b; flex: 1; }
.member-email-small { font-size: 11px; color: #94a3b8; }
.member-item.selected { background: #eff6ff; }
.member-item.selected .member-name { color: #1d4ed8; }

.members-custom-form { display: flex; gap: 6px; margin-bottom: 10px; }
.members-custom-input {
  flex: 1; padding: 7px 10px;
  border: 1px solid #e2e8f0; border-radius: 6px;
  font-size: 12px; outline: none;
}
.members-custom-input:focus { border-color: #3b82f6; }
.btn-add-custom-member {
  padding: 7px 10px; background: #2563eb; color: white;
  border: none; border-radius: 6px; font-size: 12px; font-weight: 700;
  white-space: nowrap; cursor: pointer;
}
.btn-add-custom-member:hover { background: #1d4ed8; }

/* ── Panneau membres au démarrage ──────────────────────────────────────────── */
#startup-members-panel { margin-bottom: 20px; text-align: left; }
#startup-members-panel .form-label { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.startup-members-badge {
  background: #2563eb; color: white;
  font-size: 11px; font-weight: 800;
  padding: 1px 8px; border-radius: 10px; min-width: 22px; text-align: center;
}
.startup-members-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 2px; max-height: 180px; overflow-y: auto;
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 8px; padding: 6px; margin-bottom: 0;
}
.startup-members-grid .member-item { padding: 5px 6px; }
.permanent-badge {
  font-size: 9px; font-weight: 800; letter-spacing: .04em;
  background: #fef3c7; color: #92400e;
  padding: 1px 5px; border-radius: 4px;
  text-transform: uppercase; flex-shrink: 0;
}

.selected-members-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.member-tag {
  display: flex; align-items: center; gap: 4px;
  background: #dbeafe; color: #1d4ed8;
  padding: 3px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 700;
}
.member-tag-remove {
  background: none; border: none; color: #3b82f6;
  font-size: 13px; cursor: pointer; padding: 0; line-height: 1;
}
.member-tag-remove:hover { color: #dc2626; }
.members-empty { font-size: 12px; color: #94a3b8; text-align: center; padding: 8px 0; }

/* ── Déconnexion ─────────────────────────────────────────────────────────── */
.btn-logout {
  background: none;
  border: 1px solid #e2e8f0;
  color: #94a3b8;
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
}
.btn-logout:hover { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }

.btn-logout-header {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.55);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
  line-height: 1;
  text-transform: uppercase;
}
.btn-logout-header:hover { background: rgba(220,38,38,.35); color: white; border-color: rgba(220,38,38,.5); }

/* ── Mode lecture seule (compte MEMBRE) ──────────────────────────────────── */
body.membre-mode .panel-left .type-radios,
body.membre-mode .panel-left .section-title-saisie,
body.membre-mode .panel-left #entry-textarea,
body.membre-mode .panel-left .custom-time-row,
body.membre-mode .panel-left .btn-add,
body.membre-mode .panel-left .divider,
body.membre-mode .panel-left .btn-close-crisis,
body.membre-mode .panel-left .members-custom-form,
body.membre-mode .panel-left .btn-add-custom-member { display: none !important; }
body.membre-mode .panel-left .members-list input[type="checkbox"] { pointer-events: none; opacity: .5; }
body.membre-mode .panel-right { flex: 1 !important; }
body.membre-mode .btn-reopen-crisis { display: none !important; }
body.membre-mode .btn-new-crisis { display: none !important; }
body.membre-mode .btn-discard { display: none !important; }
body.membre-mode .btn-ai { display: none !important; }

#membre-notice { display: none; }
body.membre-mode #membre-notice { display: block !important; }
body.membre-mode #startup-form { display: none !important; }

.membre-notice {
  background: #e0f2fe;
  border: 2px solid #7dd3fc;
  border-radius: 12px;
  padding: 20px 16px;
  margin-bottom: 16px;
  text-align: center;
}

/* Indicateur de rôle dans le header */
.role-indicator {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: rgba(255,255,255,.15);
  color: rgba(255,255,255,.8);
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.25);
}

/* ── Print / Export PDF ───────────────────────────────────────────────────── */
@media print {
  #screen-startup, #screen-active .panel-left,
  .journal-header, .crisis-header .header-right,
  #modal-ai, #toast, #confirm-modal { display: none !important; }

  body { background: white; }
  .crisis-header {
    background: #1e293b !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 16px 20px;
  }
  .main-layout { display: block; height: auto; overflow: visible; }
  .panel-right { overflow: visible; }
  #journal-list { overflow: visible; }
  #screen-closed { min-height: auto; }
  .closed-journal { overflow: visible; }
  .closed-banner .closed-buttons { display: none; }

  .entry { break-inside: avoid; }
  .entry-INFO     { border-left-color: #3b82f6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .entry-ACTION   { border-left-color: #22c55e !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .entry-ALERTE   { border-left-color: #ef4444 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .entry-DÉCISION { border-left-color: #8b5cf6 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .entry-edit-btn { display: none; }
}

.panel-doc-link {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  text-align: center;
}
.panel-doc-btn {
  font-size: 12px; color: #64748b; text-decoration: none;
  padding: 5px 12px; border-radius: 6px; border: 1px solid #e2e8f0;
  transition: all .15s; display: inline-block;
}

/* ── Correcteur orthographe ──────────────────────────────────────────────── */
.btn-correct {
  background: none; border: 1px solid #e2e8f0;
  color: #64748b; font-size: 12px; font-weight: 600;
  padding: 5px 11px; border-radius: 6px;
  cursor: pointer; transition: all .15s;
}
.btn-correct:hover { background: #f1f5f9; color: #1e293b; border-color: #94a3b8; }
.btn-correct:disabled { opacity: .4; cursor: default; }
.btn-import-msg {
  width: 100%; margin-top: 8px;
  background: none; border: 1px dashed #cbd5e1;
  color: #64748b; font-size: 12px; font-weight: 600;
  padding: 7px 12px; border-radius: 8px;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.btn-import-msg:hover { background: #f8fafc; border-color: #94a3b8; color: #1e293b; }
.btn-import-msg-action {
  padding: 8px 16px; border-radius: 8px; border: none;
  font-size: 13px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: all .15s;
  background: #1e293b; color: white;
}
.btn-import-msg-action:hover { background: #0f172a; }
.btn-import-msg-action:disabled { opacity: .5; cursor: default; }
.btn-import-msg-raw { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.btn-import-msg-raw:hover { background: #e2e8f0; color: #1e293b; }
.entry-attachment {
  display: inline-block; margin-top: 5px; margin-left: 0;
  font-size: 11px; font-weight: 700; color: #2563eb;
  background: #dbeafe; border-radius: 5px; padding: 2px 8px;
  text-decoration: none; transition: background .12s;
}
.entry-attachment:hover { background: #bfdbfe; }

/* Icônes compactes sur la ligne */
.entry-icon-ext,
.entry-icon-att {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1;
  margin-right: 4px; flex-shrink: 0;
  cursor: default;
}
.entry-icon-att {
  text-decoration: none;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity .12s;
}
.entry-icon-att:hover { opacity: 1; }

/* ── Recherche dans le journal ───────────────────────────────────────────── */
.journal-search-row { padding: 8px 16px 4px; }
.journal-search-input {
  width: 100%; padding: 7px 12px; font-size: 13px;
  border: 1px solid #e2e8f0; border-radius: 8px; background: #f8fafc;
  outline: none; transition: border-color .15s;
}
.journal-search-input:focus { border-color: #94a3b8; background: white; }
.entry.hidden-by-search { display: none; }

/* ── Conseils plan blanc ─────────────────────────────────────────────────── */
.btn-advice {
  background: rgba(139,92,246,.25); border: 1px solid rgba(139,92,246,.4);
  color: rgba(255,255,255,.9); font-size: 11px; font-weight: 700;
  letter-spacing: .06em; padding: 5px 10px; border-radius: 6px;
  cursor: pointer; transition: all .15s; text-transform: uppercase;
}
.btn-advice:hover { background: rgba(139,92,246,.5); }
body.membre-mode .btn-advice { display: none !important; }

.advice-list { display: flex; flex-direction: column; gap: 10px; }
.advice-card {
  border-radius: 10px; padding: 12px 14px;
  border-left: 4px solid #e2e8f0; background: #f8fafc;
  transition: opacity .2s;
}
.advice-card.dismissed { opacity: .35; pointer-events: none; }
.advice-card.advice-URGENT    { border-left-color: #ef4444; background: #fff5f5; }
.advice-card.advice-IMPORTANT { border-left-color: #f59e0b; background: #fffbeb; }
.advice-card.advice-SURVEILLANCE { border-left-color: #3b82f6; background: #eff6ff; }
.advice-priority {
  font-size: 10px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 10px;
  margin-right: 8px;
}
.advice-URGENT    .advice-priority { background: #fee2e2; color: #dc2626; }
.advice-IMPORTANT .advice-priority { background: #fef3c7; color: #d97706; }
.advice-SURVEILLANCE .advice-priority { background: #dbeafe; color: #2563eb; }
.advice-text { font-size: 13px; color: #1e293b; font-weight: 600; display: block; margin: 6px 0 4px; }
.advice-source { font-size: 11px; color: #64748b; font-style: italic; }
.advice-actions { margin-top: 8px; display: flex; gap: 8px; }
.btn-advice-apply {
  padding: 5px 12px; background: #1e293b; color: white;
  border: none; border-radius: 6px; font-size: 12px; font-weight: 700;
  cursor: pointer; transition: background .12s;
}
.btn-advice-apply:hover { background: #0f172a; }
.btn-advice-dismiss {
  padding: 5px 10px; background: none; color: #94a3b8;
  border: 1px solid #e2e8f0; border-radius: 6px; font-size: 12px;
  cursor: pointer; transition: all .12s;
}
.btn-advice-dismiss:hover { background: #f1f5f9; color: #64748b; }
.panel-doc-btn:hover { color: #1e293b; border-color: #94a3b8; background: #f8fafc; }

/* ── Bandeau point d'étape horaire ─────────────────────────────────────────── */
.checkpoint-banner {
  margin: 0 0 10px 0;
  animation: checkpointSlideIn .35s ease;
}
.checkpoint-banner.hidden { display: none; }

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

.checkpoint-banner-inner {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 2px solid #f59e0b;
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: 0 3px 12px rgba(245,158,11,.25);
}

.checkpoint-icon {
  font-size: 28px; flex-shrink: 0;
  animation: checkpointPulse 1.2s ease-in-out 3;
}

@keyframes checkpointPulse {
  0%,100% { transform: scale(1); }
  50%      { transform: scale(1.25); }
}

.checkpoint-text {
  flex: 1;
  display: flex; flex-direction: column; gap: 2px;
}
.checkpoint-text strong {
  font-size: 15px; color: #92400e; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em;
}
.checkpoint-text span {
  font-size: 13px; color: #78350f;
}

.checkpoint-actions {
  display: flex; gap: 8px; flex-shrink: 0;
}

.btn-checkpoint-log {
  padding: 8px 16px;
  background: #f59e0b; color: white;
  border: none; border-radius: 7px;
  font-size: 13px; font-weight: 700;
  cursor: pointer; transition: background .12s;
  white-space: nowrap;
}
.btn-checkpoint-log:hover { background: #d97706; }

.btn-checkpoint-close {
  padding: 8px 12px;
  background: none; color: #92400e;
  border: 1.5px solid #fbbf24; border-radius: 7px;
  font-size: 13px; cursor: pointer; transition: all .12s;
  white-space: nowrap;
}
.btn-checkpoint-close:hover { background: #fef3c7; }

/* ── Bande renforts disponibles ─────────────────────────────────────────────── */
.helpers-strip {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #162032;
  border-bottom: 2px solid #1e3a5f;
  padding: 7px 20px;
}

.helpers-label {
  font-size: 12px; font-weight: 800; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .07em;
  white-space: nowrap; flex-shrink: 0;
}

.helpers-chips {
  display: flex; flex-wrap: wrap; gap: 7px; flex: 1; align-items: center;
}

.helpers-empty {
  font-size: 12px; color: #475569; font-style: italic;
}

.helper-chip {
  display: inline-flex; align-items: center; gap: 0;
  background: #16a34a; border: none;
  border-radius: 20px; overflow: hidden;
  animation: helperFadeIn .2s ease;
}
@keyframes helperFadeIn {
  from { opacity:0; transform:scale(.85); }
  to   { opacity:1; transform:scale(1); }
}

.helper-name {
  font-size: 13px; font-weight: 700; color: #fff;
  padding: 4px 10px;
  white-space: nowrap;
}

.btn-helper-take {
  background: #15803d; color: white;
  border: none; border-left: 1px solid #166534;
  font-size: 11px; font-weight: 700; padding: 4px 10px;
  cursor: pointer; white-space: nowrap;
  transition: background .12s;
}
.btn-helper-take:hover { background: #166534; }

.btn-helper-remove {
  background: none; color: rgba(255,255,255,.7);
  border: none; border-left: 1px solid rgba(255,255,255,.2);
  font-size: 14px; padding: 4px 9px; line-height: 1;
  cursor: pointer; transition: color .12s, background .12s;
}
.btn-helper-remove:hover { background: #dc2626; color: white; }

.helpers-add {
  display: flex; align-items: center; gap: 7px; flex-shrink: 0;
}
.helper-input {
  background: #1e293b; color: #e2e8f0;
  border: 1.5px solid #334155; border-radius: 6px;
  padding: 5px 11px; font-size: 12px;
  outline: none; width: 140px;
  transition: border-color .15s;
}
.helper-input:focus { border-color: #22c55e; }
.helper-input::placeholder { color: #475569; }

.btn-helper-add {
  background: #166534; color: #bbf7d0;
  border: 1.5px solid #22c55e; border-radius: 6px;
  padding: 5px 12px; font-size: 12px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: background .12s, color .12s;
}
.btn-helper-add:hover { background: #22c55e; color: #052e16; }

/* ── Onglets mobile ────────────────────────────────────────────────────────── */
.mobile-tabs {
  display: none;
}

@media (max-width: 768px) {
  /* ── Onglets ── */
  .mobile-tabs {
    display: flex;
    background: #1e293b;
    border-bottom: 2px solid #334155;
    flex-shrink: 0;
  }
  .mobile-tab {
    flex: 1;
    padding: 11px 8px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: color .15s, border-bottom .15s;
    border-bottom: 3px solid transparent;
  }
  .mobile-tab.active {
    color: #38bdf8;
    border-bottom: 3px solid #38bdf8;
    background: rgba(56,189,248,.07);
  }

  /* ── Layout ── */
  .main-layout {
    flex-direction: column;
    overflow: auto;
  }
  .panel-left {
    width: 100% !important;
    flex-shrink: 0;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    max-height: none;
    overflow-y: visible;
  }
  .panel-right {
    overflow: auto;
    min-height: 300px;
  }
  .panel-left.mobile-hidden,
  .panel-right.mobile-hidden {
    display: none !important;
  }

  /* ── Header : 2 lignes sur mobile ── */
  .crisis-header {
    padding: 8px 12px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .header-left {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    width: 100%;
  }
  .header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: flex-end;
  }
  /* Cacher les boutons secondaires */
  .btn-home-header { display: none !important; }
  .btn-logout-header { display: none !important; }
  /* Boutons essentiels plus compacts */
  .btn-advice, .btn-contacts-header {
    font-size: 12px;
    padding: 5px 10px;
  }
  /* Badge + nom de crise bien visibles */
  .crisis-badge {
    font-size: 12px;
    padding: 3px 8px;
  }
  .crisis-header-name {
    font-size: 14px;
    font-weight: 700;
  }

  /* ── Helpers strip compact ── */
  .helpers-strip {
    flex-wrap: wrap;
    padding: 6px 12px;
    gap: 6px;
  }
  .helper-input {
    width: 120px;
    flex: 1;
    min-width: 100px;
  }
  .btn-helper-add {
    flex-shrink: 0;
  }
}

/* ── Conseils IA — groupement par service ──────────────────────────────────── */
.advice-service-group {
  margin-bottom: 18px;
}
.advice-service-header {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #0369a1;
  background: #e0f2fe;
  border-left: 4px solid #0284c7;
  padding: 5px 12px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 8px;
}
.advice-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

/* ── Boutons Fiches de mission + Communiquer ─────────────────────────────── */
.btn-mission, .btn-communicate {
  width: 100%;
  padding: 10px 0;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background .15s, transform .1s;
}
.btn-mission {
  background: #ede9fe;
  color: #5b21b6;
}
.btn-mission:hover { background: #ddd6fe; transform: translateY(-1px); }
.btn-communicate {
  background: #ecfdf5;
  color: #065f46;
}
.btn-communicate:hover { background: #d1fae5; transform: translateY(-1px); }

/* ── Bouton CR Réunion (journal header) ──────────────────────────────────── */
.btn-meeting-report {
  padding: 6px 12px;
  border: none;
  border-radius: 7px;
  background: #fef3c7;
  color: #92400e;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.btn-meeting-report:hover { background: #fde68a; }

/* ── Badge actions en attente ────────────────────────────────────────────── */
.actions-pending-badge {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.actions-pending-badge.hidden { display: none; }

/* ── Bouton ✓ Fait dans le journal ───────────────────────────────────────── */
.btn-action-done {
  flex-shrink: 0;
  padding: 3px 10px;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  background: #f9fafb;
  color: #6b7280;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
  margin-left: auto;
}
.btn-action-done:hover {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}
.btn-action-done.done {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}
.entry-done .entry-text {
  text-decoration: line-through;
  opacity: .6;
}

/* ── Modal Fiches de mission ─────────────────────────────────────────────── */
.modal-box-fiches {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
}
.fiches-tabs-bar {
  display: flex;
  gap: 4px;
  padding: 10px 24px 0;
  overflow-x: auto;
  flex-shrink: 0;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.fiche-tab {
  padding: 7px 12px;
  border: none;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.fiche-tab:hover { background: #e2e8f0; }
.fiche-tab.active {
  background: white;
  color: #0f172a;
  font-weight: 800;
  border-bottom: 2px solid #0284c7;
}
.fiches-body {
  overflow-y: auto;
  padding: 16px 20px;
}
.fiches-global-progress {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}
.fiches-global-label {
  font-size: 13px;
  font-weight: 700;
  color: #0369a1;
  margin-bottom: 8px;
}
.fiches-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 500px) { .fiches-overview-grid { grid-template-columns: 1fr; } }
.fiche-overview-card {
  background: #f8fafc;
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background .15s;
}
.fiche-overview-card:hover { background: #f1f5f9; }
.fiche-overview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.fiche-overview-emoji { font-size: 18px; flex-shrink: 0; }
.fiche-overview-service { font-size: 12px; font-weight: 700; color: #1e293b; flex: 1; }
.fiche-overview-pct { font-size: 12px; font-weight: 800; white-space: nowrap; }
.fiche-progress-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}
.fiche-progress-bar-global { height: 10px; border-radius: 5px; }
.fiche-progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}
.fiche-service-header {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 4px;
}
.fiche-service-title { font-size: 16px; font-weight: 800; color: #1e293b; }
.fiche-service-progress { font-size: 12px; color: #64748b; margin-top: 2px; }
.fiche-items-list { display: flex; flex-direction: column; gap: 4px; }
.fiche-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
  transition: background .12s;
}
.fiche-item:hover { background: #f1f5f9; }
.fiche-item-done {
  background: #f0fdf4;
  opacity: .75;
}
.fiche-item-done .fiche-item-text { text-decoration: line-through; color: #4ade80; }
.fiche-item-check {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
  color: #94a3b8;
  font-weight: 700;
}
.fiche-item-done .fiche-item-check { color: #22c55e; }
.fiche-item-text { font-size: 13px; color: #374151; line-height: 1.5; }

/* ── Modal Communication ─────────────────────────────────────────────────── */
.commun-tabs-bar {
  display: flex;
  gap: 4px;
  padding: 10px 24px 0;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  overflow-x: auto;
}
.commun-tab {
  padding: 7px 14px;
  border: none;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.commun-tab:hover { background: #e2e8f0; }
.commun-tab.active {
  background: white;
  color: #0f172a;
  font-weight: 800;
  border-bottom: 2px solid #0284c7;
}
.commun-body {
  padding: 16px 20px;
  overflow-y: auto;
  max-height: 65vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.commun-template-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}
.commun-template-header {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f8fafc;
  padding: 10px 16px;
  border-bottom: 1px solid #e2e8f0;
}
.commun-template-emoji { font-size: 20px; }
.commun-template-label { font-size: 13px; font-weight: 800; color: #1e293b; flex: 1; }
.btn-copy-template {
  padding: 5px 12px;
  border: none;
  border-radius: 6px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.btn-copy-template:hover { background: #bfdbfe; }
.commun-template-subject {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  padding: 8px 16px;
  background: #fafafa;
  border-bottom: 1px solid #e2e8f0;
}
.commun-template-body {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #334155;
  background: white;
  margin: 0;
  padding: 14px 16px;
  white-space: pre-wrap;
  line-height: 1.6;
  max-height: 260px;
  overflow-y: auto;
}

/* ── Modal Compte-rendu réunion ──────────────────────────────────────────── */
.meeting-report { display: flex; flex-direction: column; gap: 14px; padding: 4px 0; }
.meeting-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e2e8f0;
}
.meeting-badge {
  background: #1e293b;
  color: white;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
}
.meeting-timestamp { font-size: 12px; color: #64748b; }
.meeting-situation { background: #f0f9ff; border: 1px solid #bae6fd; border-radius: 8px; padding: 12px 14px; }
.meeting-situation p { margin: 6px 0 0; font-size: 13px; color: #0c4a6e; line-height: 1.6; }
.meeting-section {
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px 14px;
}
.meeting-section-title {
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 8px;
}
.meeting-section-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.meeting-section-list li {
  font-size: 13px;
  color: #1e293b;
  line-height: 1.5;
  padding-left: 14px;
  position: relative;
}
.meeting-section-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: #94a3b8;
}
