/* Diwane - Branding Bleu & Blanc */

:root {
  --blue-primary: #1565c0;
  --blue-dark: #0d47a1;
  --blue-light: #42a5f5;
  --blue-bg: #e3f2fd;
  --white: #ffffff;
  --gray-light: #f5f5f5;
  --gray-text: #546e7a;
  --red-error: #c62828;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--blue-bg) 0%, var(--white) 200px);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #1d2939;
  font-weight: 500;
  overflow-x: hidden;
}

main {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0 24px 40px;
  min-height: 100vh;
}

/* Header & Nav */
.site-header {
  background: var(--blue-primary);
  color: var(--white);
  padding: 0 24px;
  margin: 0 -24px 24px -24px;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 12px rgba(21, 101, 192, 0.25);
}

.site-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 10px;
}

/* Hamburger — masqué sur PC */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none !important;
  border: none !important;
  cursor: pointer;
  flex-shrink: 0;
  min-height: 0 !important;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 2.5px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}

/* Side nav — masqué sur PC */
.sidenav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
}
.sidenav-overlay.open {
  display: block;
  opacity: 1;
}

.sidenav {
  position: fixed;
  top: 0;
  left: -280px;
  width: 280px;
  height: 100%;
  background: var(--white);
  z-index: 1000;
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  transition: left 0.3s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.sidenav.open {
  left: 0;
}

.sidenav-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  background: var(--blue-primary);
  color: var(--white);
  flex-shrink: 0;
}
.sidenav-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--white);
  padding: 3px;
  flex-shrink: 0;
}
.sidenav-user {
  flex: 1;
  min-width: 0;
}
.sidenav-user strong {
  display: block;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidenav-user small {
  font-size: 0.8rem;
  opacity: 0.85;
}
.sidenav-close {
  background: none !important;
  border: none !important;
  color: var(--white) !important;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  min-height: 0 !important;
  width: auto;
}

.sidenav-links {
  flex: 1;
  padding: 12px 0;
}
.sidenav-links a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  color: #263238;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.sidenav-links a:hover,
.sidenav-links a:focus {
  background: var(--blue-bg);
  color: var(--blue-primary);
  border-left-color: var(--blue-primary);
}
.sidenav-links a svg {
  flex-shrink: 0;
  color: var(--blue-primary);
}

.sidenav-footer {
  border-top: 1px solid #e0e0e0;
  padding: 8px 0;
  flex-shrink: 0;
}
.sidenav-footer a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  color: #263238;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s;
}
.sidenav-footer a:hover {
  background: var(--blue-bg);
}
.sidenav-footer .sidenav-logout {
  color: var(--red-error);
}
.sidenav-footer .sidenav-logout svg {
  color: var(--red-error);
}

body.sidenav-open {
  overflow: hidden;
}

.site-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--white);
  padding: 3px;
  flex-shrink: 0;
}

.site-header h2 {
  margin: 0;
  padding: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding-bottom: 14px;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}

.site-nav a:hover {
  color: var(--white);
  border-bottom-color: var(--white);
}

.site-nav .user-info {
  margin-left: auto;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.9rem;
}

.site-nav .logout {
  color: rgba(255, 255, 255, 0.9);
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 0;
  font-size: 0.88rem;
}
.breadcrumb a {
  color: var(--blue-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}
.breadcrumb a:hover {
  color: var(--blue-dark);
  text-decoration: underline;
}
.breadcrumb-sep {
  color: #b0bec5;
  font-size: 0.8rem;
}
.breadcrumb-current {
  color: var(--gray-text);
  font-weight: 600;
}

/* Contenu */
h3 {
  color: var(--blue-dark);
  margin-top: 0;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--blue-bg);
}

/* Liens */
a {
  color: var(--blue-primary);
}

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

/* Boutons - override Milligram */
button,
.button,
input[type="submit"] {
  background: var(--blue-primary) !important;
  border-color: var(--blue-primary) !important;
  color: var(--white) !important;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
}

button:hover,
.button:hover,
input[type="submit"]:hover {
  background: var(--blue-dark) !important;
  border-color: var(--blue-dark) !important;
  color: var(--white) !important;
}

.button-outline,
button.button-outline {
  background: transparent !important;
  color: var(--blue-primary) !important;
  border: 2px solid var(--blue-primary) !important;
}

.button-outline:hover,
button.button-outline:hover {
  background: var(--blue-bg) !important;
  color: var(--blue-dark) !important;
  border-color: var(--blue-dark) !important;
}

/* Bouton Ajouter / Créer — vert */
.btn-add,
a.btn-add,
button.btn-add,
.list-header-btn {
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: var(--white) !important;
}
.btn-add:hover,
a.btn-add:hover,
button.btn-add:hover,
.list-header-btn:hover {
  background: #15803d !important;
  border-color: #15803d !important;
}

/* Bouton Annuler / Supprimer — rouge */
.btn-cancel,
a.btn-cancel,
button.btn-cancel,
.btn-danger,
a.btn-danger,
button.btn-danger {
  background: transparent !important;
  border: 2px solid var(--red-error) !important;
  color: var(--red-error) !important;
}
.btn-cancel:hover,
a.btn-cancel:hover,
button.btn-cancel:hover,
.btn-danger:hover,
a.btn-danger:hover,
button.btn-danger:hover {
  background: var(--red-error) !important;
  color: var(--white) !important;
}

/* Formulaires */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="tel"],
select,
textarea {
  border-color: #b0bec5 !important;
  border-radius: 6px;
  font-weight: 500;
  color: #1d2939;
}

select {
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475467' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center !important;
  background-size: 12px !important;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 32px !important;
}

label {
  font-weight: 600;
  color: #344054;
}

input:focus,
select:focus {
  border-color: var(--blue-primary) !important;
  box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.2);
}

.hint {
  font-size: 0.875rem;
  color: var(--gray-text);
  margin: 4px 0 0;
}

/* Comboselect (liste à choix multiple type combobox) */
.comboselect {
  position: relative;
  max-width: 100%;
}
.comboselect-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #b0bec5;
  border-radius: 6px;
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.comboselect-trigger:hover {
  border-color: var(--blue-light);
}
.comboselect-trigger:focus {
  outline: none;
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.2);
}
.comboselect-values {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.comboselect-placeholder {
  color: var(--gray-text);
  font-size: 0.95rem;
}
.comboselect-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.comboselect-chip {
  display: inline-block;
  padding: 2px 8px;
  background: var(--blue-bg);
  color: var(--blue-dark);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
}
.comboselect-arrow {
  margin-left: 8px;
  font-size: 0.7rem;
  color: var(--gray-text);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.comboselect.open .comboselect-arrow {
  transform: rotate(180deg);
}
.comboselect-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid #b0bec5;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  z-index: 100;
  display: none;
}
.comboselect-dropdown.open {
  display: block;
}
.comboselect-option {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.comboselect-option:hover {
  background: var(--blue-bg);
}
.comboselect-option input[type="checkbox"] {
  margin-right: 10px;
  flex-shrink: 0;
}
.comboselect-option span {
  flex: 1;
}

/* ========== DESIGN LISTES MODERNISÉ ========== */

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.list-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}
.list-header-title svg {
  color: var(--blue-primary);
  flex-shrink: 0;
}
.list-header-title h3 {
  margin: 0;
  padding: 0;
  border: none;
  font-size: 1.4rem;
}
.list-header-btn {
  white-space: nowrap;
  border-radius: 8px !important;
  font-weight: 600 !important;
  padding: 10px 20px !important;
  font-size: 0.9rem !important;
}

.list-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.list-filter-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 200px;
  background: var(--white);
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  padding: 0 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.list-filter-search:focus-within {
  border-color: var(--blue-primary);
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.12);
}
.list-filter-search svg {
  color: #98a2b3;
  flex-shrink: 0;
}
.list-filter-search input {
  border: none !important;
  box-shadow: none !important;
  padding: 10px 4px !important;
  margin: 0 !important;
  flex: 1;
  font-size: 0.9rem;
  background: transparent;
}
.list-filter-search input:focus {
  box-shadow: none !important;
}
.list-filter-select {
  border: 1px solid #d0d5dd !important;
  border-radius: 8px !important;
  padding: 10px 32px 10px 12px !important;
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 160px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475467' stroke-width='3'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center !important;
  background-size: 12px !important;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
}
.list-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 8px !important;
  padding: 10px 18px !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  white-space: nowrap;
}
.list-filter-reset {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--gray-text);
  transition: background 0.15s, color 0.15s;
}
.list-filter-reset:hover {
  background: #ffebee;
  color: var(--red-error);
}

.list-card-container {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  border: 1px solid #eaecf0;
  overflow: hidden;
}
.list-card-inner {
  padding: 16px 20px;
}

.list-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible;
  margin: 0;
}
.list-table thead {
  background: #f9fafb !important;
  color: #475467 !important;
}
.list-table thead th {
  border: none !important;
  border-bottom: 1px solid #eaecf0 !important;
  padding: 14px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475467;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.list-table-blue thead {
  background: var(--blue-primary) !important;
}
.list-table-blue thead th {
  color: var(--white) !important;
  border-bottom-color: var(--blue-dark) !important;
}
.list-table tbody td {
  padding: 14px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1d2939;
  border-bottom: 1px solid #f2f4f7;
  vertical-align: middle;
}
.list-table tbody tr:last-child td {
  border-bottom: none;
}
.list-table tbody tr:hover {
  background: #f9fafb;
}
.list-table-empty {
  text-align: center;
  color: var(--gray-text);
  padding: 40px 16px !important;
  font-size: 0.95rem;
}

.list-table-user {
  display: flex;
  align-items: center;
  gap: 10px;
}
.list-table-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--blue-primary);
  flex-shrink: 0;
}
.list-table-user strong {
  font-weight: 600;
  color: #1d2939;
}

.list-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: 600;
}
.list-status-active {
  background: #ecfdf3;
  color: #067647;
}
.list-status-inactive {
  background: #fef3f2;
  color: #b42318;
}

.list-table-actions {
  text-align: center;
  white-space: nowrap;
}
.list-table-actions .btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}
.list-table-actions .btn-icon-form button {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.list-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  margin-top: 4px;
  gap: 12px;
  flex-wrap: wrap;
}
.list-pagination-info {
  font-size: 0.88rem;
  color: var(--gray-text);
  font-weight: 500;
}
.list-pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}
.list-pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  color: #344054;
  text-decoration: none;
  border: 1px solid #d0d5dd;
  background: var(--white);
  transition: all 0.15s;
}
.list-pagination-btn:hover {
  background: var(--blue-bg);
  border-color: var(--blue-primary);
  color: var(--blue-primary);
}
.list-pagination-btn.active {
  background: var(--blue-primary) !important;
  border-color: var(--blue-primary) !important;
  color: var(--white) !important;
  font-weight: 700;
}
.list-pagination-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  color: var(--gray-text);
  font-size: 0.88rem;
}

/* ========== FIN DESIGN LISTES ========== */

/* Liste adaptative : tableau (PC) / cartes (mobile) — un seul mode affiché */
.list-adaptive {
  position: relative;
}
/* Mobile par défaut : cartes uniquement */
.list-desktop {
  display: none !important;
}
.list-mobile {
  display: block !important;
}
/* PC : tableau uniquement */
@media (min-width: 769px) {
  .list-desktop {
    display: block !important;
  }
  .list-mobile {
    display: none !important;
  }
}

.list-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 4px;
}
.list-empty {
  text-align: center;
  color: var(--gray-text);
  padding: 24px;
  margin: 0;
}

/* Card mobile — style thème client */
.list-card {
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #e8ecf2;
  overflow: visible;
  transition: box-shadow 0.2s;
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
}
.list-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* Avatar circulaire */
.list-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-bg);
  color: var(--blue-primary);
  overflow: hidden;
}
.list-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.list-card-avatar svg {
  width: 24px;
  height: 24px;
}

/* Contenu central */
.list-card-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.list-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1d2939;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-card-detail {
  font-size: 0.82rem;
  color: #667085;
  font-weight: 400;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-card-detail strong {
  font-weight: 600;
  color: #344054;
}

/* Colonne droite : statut + menu */
.list-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* Badge statut compact */
.list-card-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Menu "..." kebab */
.card-menu {
  position: relative;
}
.card-menu-toggle {
  background: none !important;
  border: none !important;
  padding: 4px 8px !important;
  cursor: pointer;
  font-size: 1.4rem;
  color: #98a2b3 !important;
  line-height: 1;
  letter-spacing: 2px;
  min-height: auto !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  height: auto !important;
  border-radius: 6px !important;
  transition: background 0.15s;
  box-shadow: none !important;
}
.card-menu-toggle:hover {
  background: #f2f4f7 !important;
  color: #475467 !important;
}
.card-menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 160px;
  background: var(--white);
  border: 1px solid #e8ecf2;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 100;
  padding: 6px 0;
  animation: cardMenuFadeIn 0.15s ease-out;
}
@keyframes cardMenuFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.card-menu.open .card-menu-dropdown {
  display: block;
}
.card-menu-dropdown a,
.card-menu-dropdown button {
  display: flex !important;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  color: #344054 !important;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
  min-height: auto !important;
  text-align: left;
  justify-content: flex-start;
}
.card-menu-dropdown a:hover,
.card-menu-dropdown button:hover {
  background: #f2f4f7 !important;
}
.card-menu-dropdown .card-menu-danger {
  color: var(--red-error) !important;
}
.card-menu-dropdown .card-menu-danger:hover {
  background: #fef3f2 !important;
}
.card-menu-dropdown svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.card-menu-dropdown form {
  margin: 0;
  padding: 0;
}

/* Carte cliquable */
.list-card[data-href] {
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
}
.list-card[data-href]:active {
  transform: scale(0.98);
}

/* Ancien support — masquer les anciens sous-composants */
.list-card-header,
.list-card-body,
.list-card-actions,
.list-card-photo,
.list-card-photo-placeholder,
.list-card-title,
.list-card-meta,
.list-card-label {
  display: none;
}

/* Sélection participants (activités) */
.participants-list .participant-item.participant-filtered {
  display: none;
}
.participants-list .participant-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 4px 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.participants-list .participant-item:hover {
  background: var(--blue-bg);
}
.participants-list .participant-item input[type="checkbox"] {
  flex-shrink: 0;
}

/* Tableaux */
table {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

thead {
  background: var(--blue-primary) !important;
  color: var(--white) !important;
}

thead th {
  border-color: var(--blue-dark) !important;
  font-weight: 600;
  font-size: 0.95rem;
}

tbody td {
  font-size: 0.95rem;
  font-weight: 500;
  color: #1d2939;
}

tbody tr:nth-child(even) {
  background: var(--blue-bg);
}

tbody tr:hover {
  background: rgba(66, 165, 245, 0.15);
}

/* Badges */
.badge {
  display: inline-block;
  padding: 4px 10px;
  background: var(--blue-bg);
  color: var(--blue-dark);
  border-radius: 16px;
  margin-right: 6px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--blue-light);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-actif, .badge-publiee, .badge-confirme, .badge-present, .badge-publie {
  background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7;
}
.badge-inactif, .badge-annulee, .badge-absent {
  background: #ffebee; color: #c62828; border-color: #ef9a9a;
}
.badge-suspendu, .badge-brouillon, .badge-invite {
  background: #fff3e0; color: #e65100; border-color: #ffcc80;
}
.badge-cloturee, .badge-decede, .badge-archive {
  background: #eceff1; color: #546e7a; border-color: #b0bec5;
}
.badge-urgent {
  background: #ffebee; color: #c62828; border-color: #ef9a9a; font-weight: 700;
}
.badge-normal {
  background: #e3f2fd; color: #1565c0; border-color: #90caf9;
}
.badge-ndiguel {
  background: #f3e5f5; color: #6a1b9a; border-color: #ce93d8;
}
.badge-annonce, .badge-communique {
  background: #e3f2fd; color: #1565c0; border-color: #90caf9;
}
.badge-compte_rendu {
  background: #e0f2f1; color: #00695c; border-color: #80cbc4;
}
.badge-deuil {
  background: #37474f; color: #ffffff; border-color: #546e7a;
}
.badge-bapteme, .badge-mariage {
  background: #fff8e1; color: #f57f17; border-color: #ffe082;
}

/* Liste entités - mode card */
.entites-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.entite-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(21, 101, 192, 0.1);
  border: 1px solid var(--blue-bg);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.entite-card:hover {
  box-shadow: 0 4px 20px rgba(21, 101, 192, 0.15);
  border-color: var(--blue-light);
}

.entite-card-body {
  padding: 20px;
  flex: 1;
}

.entite-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.entite-card-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--blue-dark);
  flex: 1;
  min-width: 0;
}

.entite-card-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  margin: 0 0 12px;
  font-size: 0.9rem;
}

.entite-card-meta dt {
  margin: 0;
  color: var(--gray-text);
  font-weight: 500;
}

.entite-card-meta dd {
  margin: 0;
}

.entite-card-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.entite-card-status.actif {
  background: #e8f5e9;
  color: #2e7d32;
}

.entite-card-status.inactif,
.entite-card-status.statut-inactif {
  background: #ffebee;
  color: var(--red-error);
}

.entite-card-status.statut-suspendu {
  background: #fff3e0;
  color: #e65100;
}

@media (max-width: 768px) {
  .membre-entite-row {
    grid-template-columns: 1fr 1fr auto !important;
  }
  .membre-entite-row > div:last-child {
    grid-column: 1 / -1;
  }
}

.entite-card-status.statut-decede {
  background: #eceff1;
  color: #546e7a;
}

.entite-card-actions {
  display: flex;
  gap: 4px;
  padding: 12px 20px;
  background: var(--blue-bg);
  border-top: 1px solid rgba(21, 101, 192, 0.1);
}

.btn-icon,
.btn-icon-form {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--blue-primary);
  transition: background 0.2s, color 0.2s;
}

.btn-icon:hover {
  background: var(--blue-primary);
  color: var(--white);
}

.btn-icon-form button {
  background: none !important;
  border: none !important;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--blue-primary) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}

.btn-icon-form button:hover {
  background: var(--red-error) !important;
  color: var(--white) !important;
  border-color: transparent !important;
}

.btn-icon-danger:hover {
  background: var(--red-error) !important;
  color: var(--white) !important;
}

/* Pagination */
.pagination-nav {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination-info {
  color: var(--gray-text);
  margin-right: 12px;
}

/* Messages d'erreur / succès */
.alert-error {
  background: #ffebee;
  color: var(--red-error);
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid var(--red-error);
  margin-bottom: 16px;
}

.alert-success {
  background: #e8f5e9;
  color: #2e7d32;
  padding: 12px 16px;
  border-radius: 8px;
  border-left: 4px solid #2e7d32;
  margin-bottom: 16px;
}

/* Profil */
.profile-section {
  margin-bottom: 32px;
  padding: 20px;
  background: var(--white);
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}
.profile-section h4 {
  margin-top: 0;
  margin-bottom: 16px;
  color: var(--blue-dark);
}
.profile-dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
}
.profile-dl dt {
  margin: 0;
  font-weight: 600;
  color: var(--gray-text);
}
.profile-dl dd {
  margin: 0;
}

/* Formulaire membre */
.membre-form-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  margin-bottom: 24px;
}
@media (max-width: 640px) {
  .membre-form-layout { grid-template-columns: 1fr; }
}
.membre-form-photo-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.photo-preview-wrap {
  width: 160px;
  height: 160px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid #e0e0e0;
  background: #f5f5f5;
  flex-shrink: 0;
}
.photo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-upload-label input[type="file"] { display: none; }
.form-section {
  margin-bottom: 24px;
  padding: 20px;
  background: var(--white);
  border-radius: 8px;
  border: 1px solid #e8e8e8;
}
.form-section-title {
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--blue-bg);
  color: var(--blue-dark);
  font-size: 1rem;
}
.form-section label { display: block; margin-top: 12px; }
.form-section label:first-of-type { margin-top: 0; }
.input-readonly {
  background: #f0f0f0 !important;
  cursor: not-allowed;
  color: #666;
}
.form-section-entities { margin-top: 24px; }
.form-section-entities .form-section-title { margin-bottom: 12px; }
.membre-entite-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto auto auto auto;
  gap: 8px 12px;
  align-items: end;
  margin-bottom: 12px;
}
.membre-entite-row > div { min-width: 0; }
.form-actions { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 900px) {
  .membre-entite-row { grid-template-columns: 1fr 1fr auto; }
}

/* Footer */
.site-footer {
  margin-top: 48px;
  padding: 20px 0;
  border-top: 1px solid var(--blue-bg);
  color: var(--gray-text);
  font-size: 0.85rem;
  text-align: center;
}

/* Page login - centrage */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: 70vh;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.login-logo-img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--white);
  padding: 36px 32px;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(21, 101, 192, 0.15);
  border: 1px solid var(--blue-bg);
}

.login-box h3 {
  text-align: center;
  margin-top: 0;
  font-size: 1.4rem;
}

.login-box button[type="submit"] {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  font-size: 1rem;
  border-radius: 8px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-hint {
  color: var(--gray-text);
  font-size: 0.85rem;
  margin-top: 16px;
  text-align: center;
}

/* Fiche détail (show) */
.detail-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(21, 101, 192, 0.08);
  border: 1px solid var(--blue-bg);
  padding: 24px;
  margin-bottom: 24px;
}
.detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px 20px;
}
.detail-grid dt {
  margin: 0;
  font-weight: 700;
  color: #475467;
  font-size: 0.9rem;
}
.detail-grid dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 500;
  color: #1d2939;
}
@media (max-width: 480px) {
  .detail-grid { grid-template-columns: 1fr; gap: 4px 0; }
  .detail-grid dt { margin-top: 10px; }
}

/* Onglets (tabs) — Parcours membre */
.tabs-wrap {
  margin-top: 4px;
}
.tabs-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.tabs-nav-item {
  margin: 0;
  padding: 0;
}
.tabs-nav-item button {
  display: block;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-text);
  background: var(--blue-bg);
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.tabs-nav-item button:hover {
  background: #d6e9ff;
  color: var(--blue-primary);
  box-shadow: 0 1px 4px rgba(21, 101, 192, 0.18);
}
.tabs-nav-item.is-active button {
  background: var(--blue-primary);
  color: #ffffff;
  border-color: var(--blue-primary);
  box-shadow: 0 2px 6px rgba(21, 101, 192, 0.25);
}
.tabs-panel {
  padding: 20px 0 0;
  display: none;
}
.tabs-panel.is-active {
  display: block;
}
.tabs-panel .table-wrapper {
  margin: 0;
}
.tabs-panel .list-table,
.tabs-panel table {
  width: 100%;
}
@media (max-width: 600px) {
  .tabs-nav-item button {
    padding: 10px 14px;
    font-size: 0.88rem;
  }
}

.tabs-empty {
  color: var(--gray-text);
  font-size: 0.9rem;
  margin: 0;
  padding: 8px 0;
}

.tabs-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tabs-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--blue-bg);
}
.tabs-list li:last-child {
  border-bottom: none;
}
.tabs-list-link {
  font-weight: 600;
  color: var(--blue-primary);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 2px;
}
.tabs-list-link:hover {
  text-decoration: underline;
}
.tabs-list-urgent {
  color: var(--red-error);
}
.tabs-list-meta {
  font-size: 0.82rem;
  color: var(--gray-text);
  display: block;
}
.tabs-list-meta .badge {
  margin-right: 4px;
}

/* Formulaire fieldset amélioré */
fieldset {
  border: 1px solid var(--blue-bg);
  border-radius: 10px;
  padding: 16px;
}
fieldset legend {
  font-weight: 600;
  color: var(--blue-dark);
  padding: 0 8px;
}

/* Dashboard - Menu modules */
.dashboard-modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.module-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(21, 101, 192, 0.12);
  border: 2px solid var(--blue-bg);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.module-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(21, 101, 192, 0.2);
  border-color: var(--blue-primary);
}

.module-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--blue-bg);
  color: var(--blue-primary);
}

.module-card:hover .module-icon {
  background: var(--blue-primary);
  color: var(--white);
}

.module-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--blue-dark);
  margin-bottom: 6px;
}

.module-desc {
  font-size: 0.85rem;
  color: var(--gray-text);
  text-align: center;
}

/* ========== DASHBOARD ========== */

.dash-section {
  margin-bottom: 32px;
}
.dash-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blue-dark);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--blue-bg);
  display: flex;
  align-items: center;
}

/* Compteurs */
.dash-counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.dash-counter {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border-left: 4px solid var(--blue-primary);
  transition: transform 0.2s, box-shadow 0.2s;
}
.dash-counter:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.dash-counter-blue  { border-left-color: #1565c0; }
.dash-counter-green { border-left-color: #2e7d32; }
.dash-counter-purple { border-left-color: #6a1b9a; }
.dash-counter-orange { border-left-color: #e65100; }

.dash-counter-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  flex-shrink: 0;
}
.dash-counter-blue .dash-counter-icon  { background: #e3f2fd; color: #1565c0; }
.dash-counter-green .dash-counter-icon { background: #e8f5e9; color: #2e7d32; }
.dash-counter-purple .dash-counter-icon { background: #f3e5f5; color: #6a1b9a; }
.dash-counter-orange .dash-counter-icon { background: #fff3e0; color: #e65100; }

.dash-counter-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.dash-counter-value {
  font-size: 1.8rem;
  font-weight: 800;
  color: #263238;
  line-height: 1.1;
}
.dash-counter-label {
  font-size: 0.85rem;
  color: var(--gray-text);
  font-weight: 500;
  margin-top: 2px;
}

/* Grille 2 colonnes pour top/flop */
.dash-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Cartes dashboard */
.dash-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid var(--blue-bg);
  overflow: hidden;
}
.dash-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--white);
}
.dash-card-header-green { background: linear-gradient(135deg, #2e7d32, #43a047); }
.dash-card-header-red   { background: linear-gradient(135deg, #c62828, #e53935); }
.dash-card-body {
  padding: 16px 20px;
}

/* Tableaux dashboard */
.dash-table {
  width: 100%;
  border-collapse: collapse;
  box-shadow: none !important;
  margin: 0;
  border-radius: 0 !important;
  overflow: visible;
  table-layout: auto;
}
.dash-table thead {
  background: var(--blue-bg) !important;
  color: var(--blue-dark) !important;
}
.dash-table thead th {
  border: none !important;
  padding: 8px 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue-dark);
  white-space: nowrap;
}
.dash-table tbody td {
  padding: 8px 10px;
  font-size: 0.88rem;
  border-bottom: 1px solid #f0f0f0;
  word-break: break-word;
}
.dash-table tbody tr:last-child td {
  border-bottom: none;
}
.dash-table tbody tr:hover {
  background: rgba(66, 165, 245, 0.06);
}

/* Pastilles rang */
.dash-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
}
.dash-rank-top  { background: #e8f5e9; color: #2e7d32; }
.dash-rank-flop { background: #ffebee; color: #c62828; }

.dash-empty {
  text-align: center;
  color: var(--gray-text);
  padding: 20px;
  margin: 0;
}

/* Projets en cours — grille dashboard */
.dash-projets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.dash-projet-card {
  display: block;
  background: var(--white);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  text-decoration: none !important;
  color: inherit !important;
  transition: box-shadow 0.15s, transform 0.15s;
  border-left: 4px solid var(--blue-primary);
}
.dash-projet-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.dash-projet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.dash-projet-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1d2939;
  line-height: 1.3;
}
.dash-projet-pct {
  font-weight: 800;
  font-size: 1.1rem;
  white-space: nowrap;
}
.dash-projet-bar {
  width: 100%;
  height: 10px;
  background: #e0e0e0;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}
.dash-projet-bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.4s ease;
}
.dash-projet-amounts {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #667085;
}
.dash-projet-amounts strong {
  font-weight: 700;
}
.dash-projet-dates {
  margin-top: 8px;
  font-size: 0.78rem;
  color: #98a2b3;
}

/* Événements à venir */
.dash-events-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dash-event-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--white);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  text-decoration: none !important;
  color: inherit !important;
  transition: box-shadow 0.15s, transform 0.15s;
}
.dash-event-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}
.dash-event-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  min-width: 52px;
  background: var(--blue-bg);
  border-radius: 10px;
  border-top: 3px solid var(--blue-primary);
}
.dash-event-day {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--blue-dark);
  line-height: 1.1;
}
.dash-event-month {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--blue-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.dash-event-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dash-event-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: #1d2939;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-event-meta {
  font-size: 0.78rem;
  color: #667085;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-event-time {
  font-size: 0.78rem;
  color: #98a2b3;
  font-weight: 600;
}
.dash-event-status {
  flex-shrink: 0;
}

/* Dernières informations */
.dash-infos-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-info-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  text-decoration: none !important;
  color: inherit !important;
  transition: box-shadow 0.15s, transform 0.15s;
  border-left: 4px solid var(--blue-primary);
}
.dash-info-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  transform: translateY(-1px);
}
.dash-info-urgent {
  border-left-color: #c62828;
  background: #fffbfb;
}
.dash-info-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--blue-bg);
}
.dash-info-urgent .dash-info-icon {
  background: #ffebee;
}
.dash-info-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-info-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: #1d2939;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-info-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.dash-info-date {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: 0.82rem;
  font-weight: 600;
  color: #344054;
}

/* Calendrier dashboard */
.dash-calendar-wrap {
  background: var(--white);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.dash-calendar {
  margin-bottom: 16px;
}
.dash-cal-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}
.dash-cal-day-name {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #667085;
  padding: 6px 0;
  text-transform: uppercase;
}
.dash-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dash-cal-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 8px;
  transition: background 0.12s;
  cursor: default;
}
.dash-cal-cell.dash-cal-empty {
  background: transparent;
}
.dash-cal-cell.dash-cal-has-event {
  background: #f0f5ff;
  cursor: pointer;
}
.dash-cal-cell.dash-cal-has-event:hover {
  background: #dbeafe;
}
.dash-cal-cell.dash-cal-today {
  background: var(--blue-primary);
}
.dash-cal-cell.dash-cal-today .dash-cal-num {
  color: #fff;
  font-weight: 800;
}
.dash-cal-cell.dash-cal-today.dash-cal-has-event {
  background: var(--blue-dark);
}
.dash-cal-num {
  font-size: 0.88rem;
  font-weight: 600;
  color: #344054;
  line-height: 1;
}
.dash-cal-dots {
  display: flex;
  gap: 3px;
  margin-top: 3px;
}
.dash-cal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.dash-cal-dot-activite { background: #2e7d32; }
.dash-cal-dot-info { background: #1565c0; }
.dash-cal-dot-urgent { background: #c62828; }

.dash-cal-legend {
  display: flex;
  gap: 18px;
  margin-bottom: 16px;
  padding-top: 8px;
  border-top: 1px solid var(--blue-bg);
}
.dash-cal-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #667085;
  font-weight: 600;
}
.dash-cal-legend-item .dash-cal-dot {
  width: 8px;
  height: 8px;
}

.dash-cal-events {
  border-top: 1px solid var(--blue-bg);
  padding-top: 12px;
}
.dash-cal-event-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none !important;
  color: inherit !important;
  transition: background 0.12s;
}
.dash-cal-event-row:hover {
  background: #f0f5ff;
}
.dash-cal-event-date {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--blue-dark);
  min-width: 42px;
}
.dash-cal-event-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.dash-cal-event-title {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  color: #344054;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-cal-event-type {
  flex-shrink: 0;
}

/* ========== RESPONSIVE - Mobile & Tablet ========== */

@media (max-width: 768px) {
  main {
    padding: 0 12px 24px;
  }

  .site-header {
    margin: 0 -12px 16px;
    padding: 0 16px;
    border-radius: 0 0 8px 8px;
  }

  .site-header-top {
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 0;
  }

  .site-header h2 {
    font-size: 1.1rem;
    padding: 0;
  }

  .site-header-brand {
    gap: 10px;
    padding-top: 0;
  }

  .site-logo {
    width: 40px;
    height: 40px;
  }

  /* Dashboard responsive */
  .dash-counters {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .dash-counter {
    padding: 14px;
    gap: 12px;
  }
  .dash-counter-icon {
    width: 42px;
    height: 42px;
  }
  .dash-counter-icon svg {
    width: 22px;
    height: 22px;
  }
  .dash-counter-value {
    font-size: 1.4rem;
  }
  .dash-grid-2 {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .dash-projets-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .dash-projet-card {
    padding: 14px 16px;
  }
  .dash-event-card {
    padding: 12px 14px;
    gap: 12px;
  }
  .dash-event-date {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
  .dash-event-day {
    font-size: 1rem;
  }
  .dash-event-title {
    font-size: 0.85rem;
  }
  .dash-info-card {
    padding: 12px 14px;
    gap: 10px;
    border-left-width: 3px;
  }
  .dash-info-icon {
    width: 36px;
    height: 36px;
  }
  .dash-info-icon svg {
    width: 18px;
    height: 18px;
  }
  .dash-info-title {
    font-size: 0.85rem;
  }
  .dash-info-date {
    font-size: 0.75rem;
  }
  .dash-calendar-wrap {
    padding: 14px;
  }
  .dash-cal-cell {
    min-height: 38px;
  }
  .dash-cal-num {
    font-size: 0.78rem;
  }
  .dash-cal-day-name {
    font-size: 0.65rem;
  }
  .dash-cal-legend {
    gap: 12px;
    flex-wrap: wrap;
  }
  .dash-cal-legend-item {
    font-size: 0.72rem;
  }
  .dash-cal-event-row {
    padding: 6px 8px;
    gap: 6px;
  }
  .dash-cal-event-title {
    font-size: 0.8rem;
  }
  .dash-cal-event-type .badge {
    font-size: 0.6rem;
    padding: 2px 6px;
  }
  .dash-card-header {
    padding: 10px 10px;
    font-size: 0.78rem;
    gap: 4px;
  }
  .dash-card-header svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }
  .dash-card-body {
    padding: 4px 0;
  }
  .dash-table thead th,
  .dash-table tbody td {
    padding: 6px 6px;
    font-size: 0.75rem;
  }
  .dash-rank {
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
  }

  /* Header liste mobile — barre bleue */
  .list-header {
    background: var(--blue-primary);
    margin: 0 -12px 16px;
    padding: 14px 16px;
    border-radius: 0 0 12px 12px;
    gap: 12px;
  }
  .list-header-title svg {
    color: var(--white);
  }
  .list-header-title h3 {
    color: var(--white);
    font-size: 1.15rem;
  }
  .list-header-btn {
    background: var(--white) !important;
    color: #16a34a !important;
    border-color: var(--white) !important;
    padding: 8px 14px !important;
    font-size: 0.85rem !important;
    border-radius: 20px !important;
  }
  .list-header-btn:hover {
    background: #f0fdf4 !important;
  }

  /* Liste modernisée mobile */
  .list-card-inner {
    padding: 10px 12px;
  }
  .list-filters {
    gap: 8px;
  }
  .list-filter-search {
    min-width: 0;
    flex: 1 1 100%;
  }
  .list-filter-select {
    min-width: 0;
    flex: 1;
  }
  .list-filter-btn {
    flex: 0;
  }
  .list-table thead th,
  .list-table tbody td {
    padding: 10px 10px;
    font-size: 0.82rem;
  }
  .list-table thead th {
    font-size: 0.75rem;
  }
  .list-pagination {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
  .list-pagination-btn {
    min-width: 32px;
    height: 32px;
    font-size: 0.82rem;
  }

  /* Breadcrumb mobile */
  .breadcrumb {
    font-size: 0.8rem;
    padding: 8px 0;
    gap: 4px;
  }

  /* Masquer la nav desktop, afficher le hamburger */
  #site-nav-desktop {
    display: none !important;
  }
  .hamburger {
    display: flex;
  }

  h3 {
    font-size: 1.2rem;
  }

  /* Tableaux - scroll horizontal */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -12px;
    padding: 0 12px;
  }

  .table-wrapper table {
    min-width: 600px;
    font-size: 0.9rem;
  }
  .table-wrapper table.dash-table {
    min-width: 0;
    font-size: 0.82rem;
  }

  .table-wrapper th,
  .table-wrapper td {
    padding: 10px 8px !important;
  }

  .table-wrapper .actions-cell {
    white-space: normal;
  }

  .table-wrapper .actions-cell a {
    display: inline-block;
    margin: 2px 4px 2px 0;
    font-size: 0.85rem;
  }

  .table-wrapper .actions-cell form {
    display: inline-block;
    margin: 2px 0;
  }

  .table-wrapper .actions-cell button {
    font-size: 0.85rem;
    padding: 6px 10px;
  }

  /* Formulaire recherche */
  /* Formulaire recherche entités */
  .search-form {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .search-form > div {
    width: 100%;
  }

  .search-form input,
  .search-form select {
    width: 100%;
  }

  .search-form .button,
  .search-form a.button {
    width: 100%;
    margin-bottom: 4px;
  }

  /* Formulaires généraux */
  form label {
    display: block;
  }

  form input[type="text"],
  form input[type="email"],
  form input[type="password"],
  form select {
    width: 100%;
  }

  /* Pagination */
  .pagination-nav {
    gap: 6px;
    justify-content: center;
  }

  .pagination-info {
    width: 100%;
    text-align: center;
    margin-right: 0;
    margin-bottom: 4px;
    order: -1;
  }

  /* Cartes entités - 1 colonne sur mobile */
  .entites-cards {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .entite-card-body {
    padding: 16px;
  }

  .entite-card-actions {
    padding: 10px 16px;
  }

  .btn-icon,
  .btn-icon-form button {
    width: 44px;
    height: 44px;
  }

  /* Dashboard - 2 colonnes sur mobile */
  .dashboard-modules {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .module-card {
    padding: 16px 10px;
  }

  .module-icon {
    width: 64px;
    height: 64px;
  }

  .module-icon svg {
    width: 36px;
    height: 36px;
  }

  /* Login */
  .login-container {
    padding: 24px 12px;
    min-height: 50vh;
  }

  .login-box {
    padding: 24px 20px;
  }

  /* Boutons - zone tactile */
  button,
  .button,
  input[type="submit"],
  a.button {
    min-height: 44px;
    padding: 10px 16px;
  }

  /* Boutons d'action (Modifier, Retour) */
  p > a.button {
    display: inline-block;
    margin-bottom: 8px;
  }
}

@media (max-width: 480px) {
  main {
    padding: 0 10px 20px;
  }

  .site-header {
    margin: 0 -10px 12px;
    padding: 0 12px;
  }

  .site-header h2 {
    font-size: 0.95rem;
  }

  .table-wrapper {
    margin: 0 -10px;
    padding: 0 10px;
  }

  .table-wrapper table {
    min-width: 500px;
    font-size: 0.85rem;
  }
  .table-wrapper table.dash-table {
    min-width: 0;
    font-size: 0.78rem;
  }

  .dashboard-modules {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .module-card {
    padding: 14px 8px;
  }

  .module-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
  }

  .module-icon svg {
    width: 28px;
    height: 28px;
  }

  .module-title {
    font-size: 0.9rem;
  }

  .module-desc {
    font-size: 0.75rem;
  }

  .dash-counters {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .dash-counter {
    padding: 10px;
    gap: 8px;
  }
  .dash-counter-icon {
    width: 36px;
    height: 36px;
  }
  .dash-counter-icon svg {
    width: 18px;
    height: 18px;
  }
  .dash-counter-value {
    font-size: 1.2rem;
  }
  .dash-counter-label {
    font-size: 0.75rem;
  }
  .dash-card-header {
    font-size: 0.82rem;
    padding: 10px 12px;
    gap: 6px;
  }
  .dash-card-body {
    padding: 4px 0;
  }
  .dash-table thead th,
  .dash-table tbody td {
    padding: 6px 6px;
    font-size: 0.78rem;
  }
  .dash-table .dash-rank {
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
  }
}

/* ══════ PAGE 404 ══════ */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  gap: 16px;
}
.error-code {
  font-size: 6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--blue-primary);
  opacity: 0.15;
  letter-spacing: -4px;
  margin-bottom: -20px;
}
.error-icon {
  color: var(--blue-primary);
  opacity: 0.7;
}
.error-page h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1d2939;
  margin: 0;
}
.error-page p {
  color: var(--gray-text);
  margin: 0;
  font-size: 0.95rem;
}
.error-actions {
  margin-top: 8px;
}
.error-actions .button {
  background: var(--blue-primary);
  color: var(--white);
  border: none;
  padding: 10px 28px;
  border-radius: 6px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s;
}
.error-actions .button:hover {
  background: var(--blue-dark);
  color: var(--white);
}
