/* ==========================================================================
   AstElu — Classeur numérique de l'élu d'astreinte
   Commune d'Inzinzac-Lochrist
   Design : sidebar sombre, police DM Sans, cartes blanches sur fond gris-bleu
   ========================================================================== */

/* ── Variables ────────────────────────────────────────────────────────────── */
:root {
  --blue:       #2563eb;
  --blue-dark:  #1d4ed8;
  --green:      #16a34a;
  --red:        #dc2626;
  --orange:     #d97706;
  --purple:     #7c3aed;
  --sidebar-bg: #0a1628;
  --sidebar-w:  256px;
  --bg:         #f1f5f9;
  --white:      #ffffff;
  --text:       #1e293b;
  --muted:      #64748b;
  --border:     #e2e8f0;
  --shadow-sm:  0 1px 4px rgba(0,0,0,.06);
  --shadow-md:  0 6px 20px rgba(0,0,0,.10);
  --radius:     16px;
  --radius-sm:  10px;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

a { color: var(--blue); }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  left: 0; top: 0;
  width: var(--sidebar-w);
  height: 100vh;
  /* !important : offcanvas-lg force un fond transparent au-dessus de 992px */
  background: var(--sidebar-bg) !important;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  border-right: 1px solid rgba(255,255,255,.05);
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  box-shadow: 0 4px 14px rgba(37,99,235,.5);
  flex-shrink: 0;
}

.sidebar-brand-name {
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.sidebar-brand-sub {
  color: #3d5f7a;
  font-size: 11px;
  line-height: 1.2;
}

/* Bouton de fermeture du panneau (mobile uniquement) */
.sidebar-close {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: #5a7d9a;
  font-size: 18px;
}
.sidebar-close:hover,
.sidebar-close:focus-visible { color: #93c5fd; background: rgba(59,130,246,.1); }

.sidebar-nav {
  flex: 1;
  padding: 8px 10px;
  overflow-y: auto;
}

.sidebar-section-label {
  color: #253d52;
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  padding: 8px 8px 4px;
  display: block;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8.5px 10px;
  margin-bottom: 1px;
  border-radius: 9px;
  color: #5a7d9a;
  font-size: 13.5px;
  font-weight: 400;
  text-decoration: none;
  transition: all .12s;
  border: none;
  background: transparent;
}

.sidebar-link i { font-size: 16px; flex-shrink: 0; }

.sidebar-link:hover {
  color: #93c5fd;
  background: rgba(59,130,246,.1);
}

.sidebar-link.is-active {
  background: rgba(59,130,246,.16);
  color: #93c5fd;
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--blue);
}

.sidebar-divider {
  height: 1px;
  background: rgba(255,255,255,.05);
  margin: 8px 4px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.sidebar-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -.01em;
}

.sidebar-user-info { flex: 1; min-width: 0; }

.sidebar-user-name {
  color: #dde8f5;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role { color: #3a5972; font-size: 11px; }

.sidebar-logout {
  color: #3a5972;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  border-radius: 7px;
  font-size: 17px;
  text-decoration: none;
  transition: color .12s;
  flex-shrink: 0;
}

.sidebar-logout:hover { color: #ef4444; }

/* ── Main wrapper ─────────────────────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  padding: 28px 32px;
}

.main-footer {
  padding: 10px 32px;
  color: var(--muted);
  font-size: 11.5px;
  border-top: 1px solid var(--border);
  background: var(--white);
  text-align: center;
}

/* ── Topbar (mobile uniquement) ───────────────────────────────────────────── */
.topbar {
  display: none;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}

.topbar-logo {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.topbar-title {
  flex: 1;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ── Bottom tabs (mobile uniquement) ─────────────────────────────────────── */
.bottom-tabs {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--white);
  border-top: 1px solid #e8edf3;
  padding: 5px 0 max(6px, env(safe-area-inset-bottom));
  box-shadow: 0 -6px 24px rgba(0,0,0,.07);
}

.bottom-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 5px 0;
  text-decoration: none;
  font-size: 10px;
  font-weight: 400;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: color .12s;
  line-height: 1;
}

.bottom-tab i { font-size: 20px; }
.bottom-tab.is-active { color: var(--blue); font-weight: 700; }

/* ── Bootstrap cards ──────────────────────────────────────────────────────── */
.card {
  border: none !important;
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-sm) !important;
}

.card-header {
  background: var(--white) !important;
  border-bottom: 1px solid var(--border) !important;
  font-size: 13.5px;
  padding: 12px 16px !important;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0 !important;
  font-weight: 600;
}

/* ── Bootstrap tables ─────────────────────────────────────────────────────── */
.table { font-size: 13.5px; }

.table thead th {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--border) !important;
  padding: .75rem 1rem;
}

.table > :not(caption) > * > * {
  padding: .72rem 1rem;
  border-bottom-color: var(--border);
}

.table-light { --bs-table-bg: #f8fafc; }
.table-hover > tbody > tr:hover > * { background: #f8fbff; }

/* ── Bootstrap buttons ────────────────────────────────────────────────────── */
.btn {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 600;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  transition: all .14s;
}

.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }

.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #15803d; border-color: #15803d; color: #fff; }

.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; color: #fff; }

.btn-outline-primary { color: var(--blue); border-color: var(--blue); }
.btn-outline-primary:hover { background: var(--blue); border-color: var(--blue); color: #fff; }

.btn-outline-secondary { color: var(--muted); border-color: var(--border); }
.btn-outline-secondary:hover { background: #f1f5f9; border-color: #cbd5e1; color: var(--text); }

.btn-outline-danger { color: var(--red); border-color: var(--red); }
.btn-outline-danger:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* ── Bootstrap forms ──────────────────────────────────────────────────────── */
.form-control, .form-select {
  font-family: 'DM Sans', system-ui, sans-serif;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #f8fafc;
  color: var(--text);
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}

.form-control:focus, .form-select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
  background: var(--white);
  color: var(--text);
}

.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 5px;
}

.form-text { font-size: 12px; color: var(--muted); }

.input-group .input-group-text {
  background: #f8fafc;
  border: 1.5px solid var(--border);
  border-right: none;
  color: var(--muted);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group .form-control {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ── Bootstrap badges ─────────────────────────────────────────────────────── */
.badge {
  font-family: 'DM Sans', system-ui, sans-serif;
  font-weight: 700;
  border-radius: 999px;
  font-size: 11.5px;
  padding: 3px 10px;
  letter-spacing: .01em;
}

.text-bg-success  { background: var(--green) !important; color: #fff !important; }
.text-bg-danger   { background: var(--red)   !important; color: #fff !important; }
.text-bg-primary  { background: var(--blue)  !important; color: #fff !important; }
.text-bg-secondary{ background: #64748b !important; color: #fff !important; }
.text-bg-light    { background: #f1f5f9 !important; color: var(--text) !important; }

/* ── Bootstrap alerts ─────────────────────────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  border: none;
}

.alert-success { background: #dcfce7; color: #15803d; }
.alert-danger  { background: #fef2f2; color: #b91c1c; }
.alert-warning { background: #fffbeb; color: #b45309; }
.alert-info    { background: #eff6ff; color: #1d4ed8; }
.alert-light   { background: var(--bg); color: var(--text); border: 1px solid var(--border) !important; }

.alert-flash { animation: fade-up .22s ease; }

/* ── Bootstrap modal ──────────────────────────────────────────────────────── */
.modal-content {
  border: none !important;
  border-radius: 22px !important;
  box-shadow: 0 28px 70px rgba(0,0,0,.22) !important;
}

.modal-header {
  border-bottom: 1px solid var(--border) !important;
  padding: 20px 24px 16px !important;
  border-radius: 22px 22px 0 0 !important;
}

.modal-footer {
  border-top: 1px solid var(--border) !important;
  padding: 14px 24px !important;
}

.modal-title { font-weight: 800 !important; font-size: 17px !important; }

.btn-group .btn { border-radius: var(--radius-sm) !important; }
.btn-group > .btn:not(:first-child) { margin-left: -1px; }
.btn-group > .btn:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm) !important; }
.btn-group > .btn:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0 !important; }

/* ── Dropdown ─────────────────────────────────────────────────────────────── */
.dropdown-menu {
  border: none;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  font-size: 13.5px;
  padding: 6px;
}

.dropdown-item {
  border-radius: 7px;
  padding: 7px 12px;
  font-weight: 500;
  color: var(--text);
}

.dropdown-item:hover { background: #eff6ff; color: var(--blue); }

/* ── Page de connexion ────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #080f1e 0%, #0d1f36 40%, #122b4a 70%, #080f1e 100%);
  padding: 20px;
  font-family: 'DM Sans', system-ui, sans-serif;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--white) !important;
  border-radius: 24px !important;
  padding: 40px 36px !important;
  box-shadow: 0 32px 90px rgba(0,0,0,.4) !important;
}

.login-card .card-body { padding: 0 !important; }

.login-logo {
  width: 62px; height: 62px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 14px;
  box-shadow: 0 8px 24px rgba(37,99,235,.45);
  color: #fff;
}

.login-card .btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  box-shadow: 0 4px 14px rgba(37,99,235,.4);
  border: none;
  padding: 13px;
  font-size: 15px;
}

.login-card .btn-primary:hover {
  box-shadow: 0 6px 20px rgba(37,99,235,.5);
  transform: translateY(-1px);
}

/* ── Mode astreinte ───────────────────────────────────────────────────────── */
.mode-astreinte {
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: astreinte-pulse 3s ease-in-out infinite;
}

@keyframes astreinte-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,.35); }
  55%       { box-shadow: 0 0 0 16px rgba(220,38,38,0); }
}

@media (prefers-reduced-motion: reduce) { .mode-astreinte { animation: none; } }

.card-astreinte { border-left: 4px solid var(--green) !important; }

/* ── Gros boutons (accueil mobile) ───────────────────────────────────────── */
.btn-xl {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  width: 100%;
  min-height: 96px;
  padding: 1rem .75rem;
  font-size: .98rem;
  font-weight: 600;
  border-radius: var(--radius);
}
.btn-xl i, .btn-xl .fs-xl { font-size: 1.75rem; }

/* ── Statistiques (accueil desktop) ─────────────────────────────────────── */
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: all .15s;
  text-decoration: none;
  color: inherit;
}

.stat-card:hover {
  box-shadow: 0 8px 28px rgba(0,0,0,.1);
  transform: translateY(-2px);
  color: inherit;
}

.stat-icon {
  width: 50px; height: 50px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 2px; text-wrap: balance; }

/* ── Légende planning ─────────────────────────────────────────────────────── */
.dot {
  display: inline-block;
  width: .75rem; height: .75rem;
  border-radius: 50%;
  vertical-align: -1px;
}
.dot-vert  { background: var(--green); }
.dot-rouge { background: var(--red); }
/* Pastille de legende des conges elus : chaque elu a sa propre teinte pastel */
.dot-conges { background: conic-gradient(#e35d6a, #f0ad4e, #5b9bd5, #9b6bc9, #d16ba5, #e35d6a); }
/* Pastille de legende des conges CODIR : multicolore, contour pointille */
.dot-codir { background: conic-gradient(#e35d6a, #f0ad4e, #5b9bd5, #9b6bc9, #d16ba5, #e35d6a); border: 1.5px dashed #5f5e5a; }

/* ── Liste élus draggable ─────────────────────────────────────────────────── */
.elu-draggable {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  margin-bottom: 4px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--white);
  cursor: grab;
  user-select: none;
  font-size: 13px;
  color: #334155;
  font-weight: 500;
  transition: all .1s;
}

.elu-draggable:hover { background: #eff6ff; border-color: #bfdbfe; }
.elu-draggable:active { cursor: grabbing; }
.elu-draggable[data-verrouille] { opacity: .45; cursor: not-allowed; }

/* ── FullCalendar ─────────────────────────────────────────────────────────── */
#calendrier { min-height: 560px; }

.fc .fc-toolbar-title {
  font-size: 1.1rem !important;
  font-weight: 800 !important;
  color: var(--text) !important;
  font-family: 'DM Sans', system-ui, sans-serif !important;
}

.fc .fc-button-primary {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  border-radius: 8px !important;
  font-family: 'DM Sans', system-ui, sans-serif !important;
  font-weight: 600 !important;
  font-size: 13px !important;
}

.fc .fc-button-primary:hover { background: var(--blue-dark) !important; }
.fc .fc-button-primary:not(:disabled).fc-button-active { background: var(--blue-dark) !important; border-color: var(--blue-dark) !important; }
.fc .fc-button-primary:disabled { background: #93c5fd !important; border-color: #93c5fd !important; }

.fc .fc-event { cursor: pointer; border-radius: 5px !important; font-size: 12px !important; }

/* Barre d'événement : période (début → fin) en gras, puis nom tronqué si besoin */
.fc .fc-event .astelu-ev-bar {
  display: flex;
  gap: 5px;
  align-items: baseline;
  overflow: hidden;
  white-space: nowrap;
  padding: 1px 4px;
  line-height: 1.3;
}
.fc .fc-event .astelu-ev-periode { font-weight: 700; flex: 0 0 auto; }
.fc .fc-event .astelu-ev-nom     { font-weight: 400; overflow: hidden; text-overflow: ellipsis; }
/* Conges elus : fond pastel par elu (couleurs servies par l'API), lisere
   gauche appuye pour reperer le debut de chaque bande d'un coup d'oeil. */
.fc .fc-event.ev-conge { border-left-width: 4px !important; }
/* Conges CODIR : meme traitement pastel par personne, contour pointille
   (lisere gauche plein) pour les distinguer des conges des elus. */
.fc .fc-event.ev-conge_codir { border-style: dashed; border-left-style: solid; border-left-width: 4px !important; }
.fc .fc-event.ev-conge .astelu-ev-nom,
.fc .fc-event.ev-conge_codir .astelu-ev-nom { font-weight: 600; }

.fc .fc-day-today { background: rgba(37,99,235,.05) !important; }

.fc .fc-col-header-cell-cushion {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .05em !important;
  color: var(--muted) !important;
  text-decoration: none !important;
}

.fc .fc-daygrid-day-number {
  font-size: 12.5px !important;
  font-weight: 500 !important;
  color: var(--text) !important;
  text-decoration: none !important;
}

.fc .fc-daygrid-day-number:hover { color: var(--blue) !important; }

.fc-theme-standard td, .fc-theme-standard th { border-color: var(--border) !important; }
.fc-theme-standard .fc-scrollgrid { border-color: var(--border) !important; }

/* ── Fiches réflexes ──────────────────────────────────────────────────────── */
.fiche-card {
  transition: transform .12s ease, box-shadow .12s ease;
  text-decoration: none !important;
  color: inherit !important;
  display: block;
}

.fiche-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0,0,0,.1) !important;
  color: inherit;
}

.fiche-card .card-body { border-top: 4px solid var(--blue); border-radius: 0 0 var(--radius) var(--radius); }

.fiche-detail h2 { font-size: 1rem; font-weight: 700; margin-top: 1.25rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.fiche-procedure {
  white-space: pre-line;
  background: #fffbeb;
  border-left: 4px solid #fbbf24;
  border-radius: 0 12px 12px 0;
  padding: 14px 18px;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.6;
}

/* ── Contacts (annuaire) ──────────────────────────────────────────────────── */
.contact-card { transition: transform .14s, box-shadow .14s; }
.contact-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.1) !important; }

/* ── Flash messages ───────────────────────────────────────────────────────── */
@keyframes fade-up {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Print ────────────────────────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .bottom-tabs, .main-footer { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  .main-content { padding: 0 !important; }
  body { background: #fff; }
  .card { box-shadow: none !important; border: 1px solid #dee2e6 !important; }
}

/* ── Mobile ───────────────────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  /* Sidebar → panneau coulissant ouvert par l'onglet « Plus » (offcanvas-lg) */
  .sidebar {
    --bs-offcanvas-width: min(300px, 85vw);
    --bs-offcanvas-border-width: 0;
    height: auto;   /* hauteur donnée par top:0 / bottom:0 de l'offcanvas */
    z-index: 1045;  /* au-dessus du fond grisé (1040) et des onglets du bas */
  }
  .sidebar-link   { padding: 11px 12px; font-size: 14.5px; }  /* cibles tactiles */
  .sidebar-footer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .topbar     { display: flex !important; }
  .bottom-tabs{ display: flex !important; }
  .main-wrapper { margin-left: 0; }
  .main-content { padding: 18px 14px 84px; }
  .main-footer  { display: none; }

  h1.h4 { font-size: 1.1rem; }

  #calendrier, #calCeremonies { min-height: 380px; }
  .fc .fc-toolbar { flex-direction: column; gap: .4rem; }
  .fc .fc-toolbar-chunk { display: flex; justify-content: center; }
}

@media (max-width: 575.98px) {
  .login-card { padding: 32px 24px !important; }
}

/* ── Annuaire : onglets de filtre ─────────────────────────────────────────── */
.contact-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px 10px;
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.contact-filter-tab {
  padding: 6px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 12.5px;
  font-family: 'DM Sans', system-ui, sans-serif;
  transition: all .12s;
  line-height: 1.4;
}

.contact-filter-tab:hover { background: var(--bg); color: var(--text); }

.contact-filter-tab.active {
  background: var(--blue);
  color: #fff;
}

/* ── Annuaire : icône catégorie ───────────────────────────────────────────── */
.contact-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* ── Annuaire : bouton appel coloré ──────────────────────────────────────── */
.btn-call {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border-radius: 12px;
  border: none;
  color: #fff !important;
  font-weight: 700;
  font-size: 13.5px;
  font-family: 'DM Sans', system-ui, sans-serif;
  text-decoration: none !important;
  transition: opacity .15s, transform .12s;
  width: 100%;
}

.btn-call:hover { opacity: .88; transform: translateY(-1px); }

.btn-call-empty {
  padding: 11px;
  border-radius: 12px;
  border: 1.5px dashed var(--border);
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

/* ── Annuaire : petits boutons icônes (modifier / supprimer) ─────────────── */
.btn-icon-muted {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  transition: all .1s;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}

.btn-icon-muted:hover { background: #eff6ff; border-color: #bfdbfe; color: var(--blue); }

.btn-icon-danger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 1.5px solid #fecaca;
  background: transparent;
  color: var(--red);
  font-size: 13px;
  transition: all .1s;
  padding: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-icon-danger:hover { background: #fef2f2; border-color: var(--red); }

/* ── Fiches : cards redessinées ──────────────────────────────────────────── */
.fiche-card .card-body { border-top: none; }  /* override ancienne règle générique */
.color-inherit { color: inherit !important; }

/* ── Emoji picker ─────────────────────────────────────────────────────────── */
.ep-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: #f8fafc;
  cursor: pointer;
  font-family: 'DM Sans', system-ui, sans-serif;
  font-size: 13.5px;
  color: var(--muted);
  transition: border-color .15s;
  width: 100%;
}
.ep-trigger:hover { border-color: var(--blue); }
.ep-current { font-size: 26px; line-height: 1; }
.ep-trigger-label { flex: 1; text-align: left; font-size: 13px; }

.ep-panel {
  position: absolute;
  z-index: 300;
  margin-top: 4px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,.15);
  border: 1px solid var(--border);
  padding: 12px;
  width: 320px;
  max-width: 90vw;
}

.ep-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}
.ep-tab {
  padding: 4px 10px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  font-family: 'DM Sans', system-ui, sans-serif;
  cursor: pointer;
  transition: all .1s;
}
.ep-tab:hover  { background: var(--bg); color: var(--text); }
.ep-tab.active { background: var(--blue); color: #fff; }

.ep-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}
.ep-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  border-radius: 7px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: background .1s;
  line-height: 1;
}
.ep-btn:hover { background: var(--bg); }

/* ── Color palette ────────────────────────────────────────────────────────── */
.cp-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cp-swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform .12s, border-color .12s;
  outline: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.cp-swatch:hover    { transform: scale(1.15); }
.cp-swatch.selected { border-color: #fff; box-shadow: 0 0 0 3px var(--text); transform: scale(1.1); }

/* ── Fiche preview card ───────────────────────────────────────────────────── */
.fiche-preview-card {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1.5px solid var(--border);
  background: var(--white);
}
.fiche-preview-bar  { height: 5px; }
.fiche-preview-body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  font-size: 20px;
}

/* ── Position relative pour le picker ────────────────────────────────────── */
.emoji-picker-wrapper { position: relative; }

/* ── Planning : avatar élu ────────────────────────────────────────────────── */
.elu-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -.01em;
  user-select: none;
}

.elu-draggable { gap: 6px; }

/* Membres du CODIR : avatar violet + survol assorti pour distinguer des élus */
.elu-avatar-codir { background: #6f42c1; }
#liste-codir .elu-draggable:hover { background: #f5f0fb; border-color: #d9c8f0; }

/* ── Planning : masquage des couches via interrupteurs ────────────────────── */
#calendrier.masque-astreinte  .ev-astreinte,
#calendrier.masque-conge      .ev-conge,
#calendrier.masque-conge_codir .ev-conge_codir { display: none !important; }

/* Interrupteur d'affichage ferme : le libelle est barre et mis en garde,
   pour qu'un filtre actif ne passe jamais inapercu (des evenements sont
   alors masques sur le calendrier). */
#planning-filtres .filtre-masque .form-check-label {
  color: #b45309;
  text-decoration: line-through;
}
