/* ===========================
   THEME GLOBAL & DESIGN SYSTEM
   =========================== */

:root{
  --mainColor: #f6f2ee;
  --secondColor: #f08a5d;
  --thirdColor: #f4a261;
  --accentColor: #e76f51;

  --cardBg: #ffffff;
  --cardText: #333333;
  --textOnDark: #ffffff;
  --mutedText: rgba(255,255,255,0.85);
}

/* ===========================
   BASE
   =========================== */

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

html{
  font-size: 16px;
}

body{
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.45;
  color: #333;
  background: var(--mainColor);
}

a{
  color: inherit;
  text-decoration: none;
}

/* ===========================
   LAYOUT
   =========================== */

#container{
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

/* ===========================
   SIDEBAR — ATLAS (DESKTOP)
   =========================== */

aside{
  background: linear-gradient(180deg, var(--secondColor), var(--thirdColor));
  color: var(--textOnDark);
  padding: 32px 22px;

  display: flex;
  flex-direction: column;
}

/* ===========================
   UTILISATEUR
   =========================== */

aside .user-box{
  font-size: 0.95rem;
  color: var(--mutedText);
  margin-bottom: 42px;
}

/* ===========================
   NAVIGATION PRINCIPALE
   =========================== */

aside nav{
  display: flex;
  flex-direction: column;
  gap: 26px;
}

aside nav a{
  padding: 14px 14px;

  font-size: 1.35rem;
  font-weight: 600;

  color: #fff;
  border-radius: 12px;
  transition: background 0.15s ease;
}

aside nav a:hover{
  background: rgba(255,255,255,0.18);
}

/* ===========================
   ZONE ACTIONS
   =========================== */

/* Base commune pour tous les boutons d’action */
.action-btn{
  width: 100%;
  max-width: 230px;
  min-height: 52px;

  padding: 0 18px;
  border-radius: 14px;

  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;
  cursor: pointer;
}

.actions-box{
  margin: 48px 0 40px;
  padding: 28px 0;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;

  border-top: 1px solid rgba(255,255,255,0.25);
  border-bottom: 1px solid rgba(255,255,255,0.25);
}

/* Action métier — discrète mais cliquable */
.action-secondary{
  background: rgba(255,255,255,0.22);
  color: #fff;

  border: 1px solid rgba(255,255,255,0.45);

  transition: background 0.15s ease;
}

.action-secondary:hover{
  background: rgba(255,255,255,0.30);
}

/* ===========================
   MENU DÉROULANT – ACTIONS
   =========================== */

.action-dropdown{
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px; /* espace entre les 2 boutons */
}

.action-menu{
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);

  width: 260px;
  max-height: 320px;
  overflow-y: auto;

  background: rgba(255,255,255,0.96);
  border-radius: 14px;

  box-shadow: 0 14px 40px rgba(0,0,0,0.2);

  display: none;
  flex-direction: column;
  padding: 8px 0;

  z-index: 20;
}

.action-menu a{
  padding: 10px 18px;
  font-size: 0.9rem;
  color: #333;
  white-space: nowrap;
}

.action-menu a:hover{
  background: rgba(0,0,0,0.06);
}

/* Action admin — principale */
aside form{
  margin: 0;
  display: flex;
  justify-content: center;
}

aside .menu-btn{
  background: #a33;
  color: #fff;

  border: 1px solid rgba(255,255,255,0.25);
  box-shadow: none;               /* ⬅️ clé */

  transition: background 0.15s ease;
}

aside .menu-btn:hover{
  background: #922;
}

/* ===========================
   SESSION
   =========================== */

.logout-box{
  margin-top: 48px;
  padding-top: 32px;
  text-align: center;
}

.logout-link{
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;

  background: rgba(0,0,0,0.25);
  color: #fff;

  font-size: 0.95rem;
}

.logout-link:hover{
  background: rgba(200,0,0,0.45);
}

/* ===========================
   MODAL — ATLAS
   =========================== */

/* Overlay */
.indalo-modal{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 1000;
}

/* Contenu du modal */
.indalo-modal-content{
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);

  width: 100%;
  max-width: 520px;

  padding: 36px 40px 40px;
  border-radius: 22px;

  box-shadow: 0 28px 70px rgba(0,0,0,0.25);

  position: relative;
}

/* Bouton fermer */
.indalo-modal-close{
  position: absolute;
  top: 18px;
  right: 20px;

  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;

  color: #999;
  transition: color 0.15s ease, transform 0.15s ease;
}

.indalo-modal-close:hover{
  color: #333;
  transform: scale(1.1);
}

/* Titre */
.indalo-modal-content h2{
  margin: 0 0 28px 0;
  font-size: 1.45rem;
  font-weight: 600;
  color: #333;
  text-align: center;
}

/* Formulaire */
.indalo-modal-content form{
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Labels */
.indalo-modal-content label{
  font-size: 0.9rem;
  color: #555;
  margin-top: 8px;
}

/* Champs date */
.indalo-modal-content input[type="date"]{
  width: 100%;
  padding: 10px 12px;

  border-radius: 10px;
  border: 1px solid #ddd;

  font-size: 0.95rem;
  font-family: inherit;

  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.indalo-modal-content input[type="date"]:focus{
  outline: none;
  border-color: var(--accentColor);
  box-shadow: 0 0 0 2px rgba(231,111,81,0.15);
}

/* Boutons helpers (mois) */
.helper-buttons{
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 10px;
}

.helper-buttons button{
  background: rgba(0,0,0,0.06);
  color: #444;

  border: none;
  border-radius: 999px;

  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 500;

  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease;
}

.helper-buttons button:hover{
  background: rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

/* Bouton principal */
.indalo-modal-content button[type="submit"]{
  margin-top: 18px;

  background: var(--accentColor);
  color: #fff;

  border: none;
  border-radius: 14px;

  padding: 14px 18px;

  font-size: 1rem;
  font-weight: 600;

  cursor: pointer;

  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.indalo-modal-content button[type="submit"]:hover{
  background: #d85f45;
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.22);
}

/* ===========================
   CONTENT (ZONE PRINCIPALE)
   =========================== */

/* BASE — portable / MacBook Air */
#content{
  background: var(--mainColor);
  min-height: 100vh;

  display: flex;
  justify-content: center;
  align-items: center;

  padding: 40px;
}

/* ===========================
   HEADINGS
   =========================== */

h1, h2, h3{
  margin: 0 0 14px 0;
  font-weight: 600;
  color: #333;
}

h1{ font-size: 2.1rem; }
h2{ font-size: 1.45rem; }
h3{ font-size: 1.05rem; }

/* ===========================
   HOME PAGE
   =========================== */

.home-wrapper{
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;

  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
}

.home-panel{
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(2px);
  border-radius: 28px;
  padding: 56px 72px 64px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.10);
  text-align: center;

  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.home-brand{
  font-size: 3.2rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--accentColor);
  margin-bottom: 18px;
  text-transform: uppercase;
}

.home-subtitle{
  font-size: 1.1rem;
  color: #777;
  margin-bottom: 56px;
}

.home-cards{
  display: flex;
  justify-content: center;
  gap: 48px;
}

.home-card{
  background: #fff;
  border-radius: 18px;
  padding: 36px;
  width: 380px;
  box-shadow: 0 12px 30px rgba(0,0,0,0.12);
  transition: transform .15s ease, box-shadow .15s ease;
}

.home-card:hover{
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.16);
}

.home-card h2{
  font-size: 1.55rem;
  margin-bottom: 14px;
}

.home-card p{
  color: #666;
  font-size: 1.05rem;
  line-height: 1.5;
}

/* ===========================
   BREAKPOINTS ÉCRANS
   =========================== */

/* Desktop 1440px */
@media (min-width: 1300px){
  #content{
    padding-left: 200px;
  }
}

/* Très grands écrans */
@media (min-width: 1800px){
  #content{
    padding-left: 250px;
  }
}

/* ===========================
   MOBILE
   =========================== */

@media (max-width: 900px){
  #container{
    grid-template-columns: 1fr;
  }

  #content{
    padding-left: 24px;
    padding-right: 24px;
    align-items: flex-start;
  }

  .home-cards{
    flex-direction: column;
    align-items: center;
  }

  .home-card{
    width: 100%;
    max-width: 420px;
  }
}
/* ===========================
   BLOC — SOCLE COMMUN
   =========================== */

.block{
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(2px);

  border-radius: 28px;
  padding: 48px 56px;

  width: 100%;
  max-width: 1100px;
  margin: 0 auto;

  box-shadow: 0 24px 60px rgba(0,0,0,0.10);
}

/* Titres principaux */
.block h2{
  font-size: 1.7rem;
  margin-bottom: 28px;
  color: #333;
}

/* Sous-titres */
.block h3{
  font-size: 1.25rem;
  margin: 38px 0 18px;
  color: #444;
}

/* Boutons génériques */
.block .btn{
  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 10px 18px;
  border-radius: 999px;

  background: var(--accentColor);
  color: #fff;

  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;

  cursor: pointer;

  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.12s ease;
}

.block .btn:hover{
  background: #d85f45;
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(0,0,0,0.22);
}

/* ===========================
   LISTE BÉNÉFICIAIRES
   =========================== */

.table{
  width: 100%;
  border-collapse: collapse;
  margin-top: 28px;
}

.table thead th{
  text-align: left;
  padding: 14px 12px;

  font-size: 0.9rem;
  font-weight: 600;
  color: #555;

  border-bottom: 2px solid rgba(0,0,0,0.12);
}

.table tbody tr{
  transition: background 0.12s ease;
}

.table tbody tr:hover{
  background: rgba(0,0,0,0.04);
}

.table td{
  padding: 14px 12px;
  font-size: 0.95rem;
  color: #333;

  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.table td:last-child{
  white-space: nowrap;
}

.table td a{
  color: var(--accentColor);
  font-weight: 500;
  text-decoration: none;
  margin-right: 10px;
}

.table td a:hover{
  color: #d85f45;
  text-decoration: underline;
}

/* ===========================
   VIEW BÉNÉFICIAIRE
   =========================== */

.fiche-beneficiaire{
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(2px);

  border-radius: 28px;
  padding: 48px 56px;

  width: 100%;
  max-width: 1100px;
  margin: 0 auto;

  box-shadow: 0 24px 60px rgba(0,0,0,0.10);
}

.fiche-beneficiaire h2{
  font-size: 1.8rem;
  margin-bottom: 28px;
}

.fiche-beneficiaire .actions{
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 36px;
}

.fiche-beneficiaire .actions .btn{
  background: rgba(0,0,0,0.08);
  color: #333;
}

.fiche-beneficiaire .actions .btn:hover{
  background: rgba(0,0,0,0.14);
}

.card-section{
  margin-top: 32px;
}

.card-section + .card-section{
  padding-top: 28px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.grid-2{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 48px;
  row-gap: 12px;
}


/* ===========================
   SUPPRESSION BÉNÉFICIAIRE
   =========================== */

.block p{
  text-align: center;
}

/* ===========================
   DELETE — ACTIONS
   =========================== */

.block p:last-child{
  display: flex;
  justify-content: center;   /* centre horizontal */
  align-items: center;
  gap: 18px;                 /* espace entre boutons */
  margin-top: 28px;
}

/* Boutons delete */
.block p:last-child .btn{
  border: none;              /* ❌ supprime contour noir */
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
}

/* Bouton supprimer (danger) */
.block .btn[style*="#d9534f"]{
  background: #d9534f;
  color: #fff;
}

.block .btn[style*="#d9534f"]:hover{
  background: #c64541;
}

/* Bouton annuler (plus soft) */
.block p:last-child .btn:not([style*="#d9534f"]){
  background: rgba(0,0,0,0.08);
  color: #333;
}

.block p:last-child .btn:not([style*="#d9534f"]):hover{
  background: rgba(0,0,0,0.14);
}

.block .btn[style*="#d9534f"]{
  background: #d9534f;
}

.block .btn[style*="#d9534f"]:hover{
  background: #c64541;
}

/* Bouton principal formulaire */
.form-submit {
  grid-column: 2;
  justify-self: start;

  margin-top: 32px;
  padding: 12px 28px;

  border-radius: 999px;
  border: none;

  background: var(--accentColor);
  color: #fff;

  font-size: 0.95rem;
  font-weight: 600;

  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  transition: background 0.15s ease, transform 0.12s ease;
}

.form-submit:hover {
  background: #d85f45;
  transform: translateY(-1px);
}

/* barre haute formulaire */
.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

/* bouton retour discret */
.btn-back {
  padding: 8px 18px;
  border-radius: 999px;

  background: rgba(0,0,0,0.08);
  color: #333;

  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;

  transition: background 0.15s ease;
}

.btn-back:hover {
  background: rgba(0,0,0,0.14);
}

.delete-actions{
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 28px;
}

/* ===========================
   FORMULAIRE MODERNE ATLAS
   =========================== */

.benef-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px 40px;

  margin-top: 20px;
}

/* Sections */
.benef-form h3 {
  grid-column: 1 / -1;

  margin: 40px 0 10px;
  padding-bottom: 6px;

  font-size: 1.2rem;
  font-weight: 600;
  color: #444;

  border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* Champ complet */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Labels */
.form-field label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #777;
}

/* Inputs */
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 11px 12px;

  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.15);

  font-size: 0.95rem;
  background: #fff;

  transition: all 0.15s ease;
}

/* Focus */
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accentColor);
  box-shadow: 0 0 0 2px rgba(240,120,80,0.15);
}

/* Textarea */
.form-field textarea {
  min-height: 90px;
}

/* Checkbox */
.form-field input[type="checkbox"] {
  width: auto;
  transform: scale(1.2);
}

/* Submit */
.form-submit-wrapper {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

.form-submit {
  padding: 14px 34px;

  border-radius: 999px;
  border: none;

  background: var(--accentColor);
  color: #fff;

  font-size: 1rem;
  font-weight: 600;

  cursor: pointer;

  box-shadow: 0 10px 24px rgba(0,0,0,0.18);
  transition: all 0.15s ease;
}

.form-submit:hover {
  background: #d85f45;
  transform: translateY(-1px);
}