:root{
  /* Light modern 2026 */
  --bg:#f6f8fc;
  --bg2:#eef2ff;
  --card:#ffffff;
  --text:#0b1220;
  --muted:#5b677a;

  --accent:#16a34a;       /* vert moderne */
  --accentSoft:rgba(22,163,74,.12);

  --danger:#ef4444;
  --dangerSoft:rgba(239,68,68,.14);

  --line:rgba(15,23,42,.10);

  --shadow: 0 18px 45px rgba(15,23,42,.10);
  --shadow2: 0 10px 22px rgba(15,23,42,.08);
  --radius: 22px;

  /* Inputs */
  --input-bg:#ffffff;
  --input-text:#0b1220;
  --input-placeholder: rgba(11,18,32,.45);
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background: var(--bg);
  min-height:100vh;
}

a{color:inherit}
.container{max-width:1100px;margin:0 auto;padding:18px}

/* ===== TOP BAR ===== */
.topbar{
  position:sticky;top:0;z-index:10;
  background: rgba(255,255,255,.76);
  backdrop-filter: blur(12px);
  border-bottom:1px solid var(--line);
}

.brand{
  display:flex;align-items:center;gap:14px;
  font-weight:950;letter-spacing:.2px;
  text-decoration:none;font-size:18px;line-height:1.1;
}

.brand .logo{
  height:111px;width:auto;
  filter: drop-shadow(0 10px 18px rgba(15,23,42,.10));
}

.nav{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}

.nav a{
  display:inline-flex;align-items:center;justify-content:center;
  padding:10px 14px;
  border:1px solid var(--line);
  border-radius:16px;
  text-decoration:none;
  color:var(--muted);
  font-weight:900;
  background: rgba(255,255,255,.70);
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  box-shadow: var(--shadow2);
}

.nav a:hover{transform:translateY(-1px)}
.nav a.active{
  border-color: rgba(22,163,74,.35);
  color: var(--text);
  background: var(--accentSoft);
}

/* ===== CARDS ===== */
.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

h1{margin:0 0 14px;font-size:28px;letter-spacing:.2px}
h2{margin:0 0 10px;font-size:18px}
.sub{color:var(--muted);margin:0;font-size:14px}

/* ===== ALERTS ===== */
.alert{
  margin:12px 0;
  padding:14px 16px;
  border-radius:18px;
  border:1px solid var(--line);
  color:var(--muted);
  background: rgba(255,255,255,.75);
}

.alert.ok{
  border-color: rgba(22,163,74,.35);
  background: var(--accentSoft);
  color: var(--text);
}

.alert.err{
  border-color: rgba(239,68,68,.35);
  background: var(--dangerSoft);
  color: var(--text);
}

/* ===== BUTTONS ===== */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:10px;
  padding:12px 16px;
  border-radius:16px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.75);
  color: var(--text);
  cursor:pointer;
  text-decoration:none;
  font-weight:950;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
  box-shadow: var(--shadow2);
}

.btn:hover{transform: translateY(-1px)}
.btn-green{
  background: rgba(22,163,74,.14);
  border-color: rgba(22,163,74,.30);
}
.btn-danger{
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.28);
}
.btn-ghost{
  background: transparent;
  box-shadow:none;
}

/* ===== PAGE HEADER ===== */
.page-head{
  display:flex;align-items:center;gap:16px;
  padding:18px;
}

.page-head .badge{
  width:78px;height:78px;
  border-radius:22px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.85);
  display:flex;align-items:center;justify-content:center;
  box-shadow: var(--shadow2);
}

.page-head .titles h1{margin:0;font-size:26px}
.page-head .titles .sub{margin-top:4px}

/* ===== FORMS ===== */
.form{margin-top: 10px}

.form-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:14px;
}

.field{display:flex;flex-direction:column;gap:8px}

.label{
  display:flex;align-items:center;gap:10px;
  color: var(--muted);
  font-size:13px;
  font-weight:850;
}

.label .ico{
  width:30px;height:30px;border-radius:12px;
  display:flex;align-items:center;justify-content:center;
  border:1px solid var(--line);
  background: rgba(255,255,255,.85);
  color: var(--text);
  font-size:15px;
}

input, select, textarea{
  width:100%;
  padding:14px 14px;
  border-radius:18px;
  border:2px solid rgba(15,23,42,.12);
  background: var(--input-bg);
  color: var(--input-text);
  outline:none;
  font-size:15px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

input::placeholder, textarea::placeholder{
  color: var(--input-placeholder);
}

input:focus, select:focus, textarea:focus{
  border-color: rgba(22,163,74,.50);
  box-shadow: 0 0 0 4px rgba(22,163,74,.14);
}

.is-invalid{
  border-color: rgba(239,68,68,.90) !important;
  box-shadow: 0 0 0 4px rgba(239,68,68,.14) !important;
}

.is-valid{
  border-color: rgba(22,163,74,.90) !important;
  box-shadow: 0 0 0 4px rgba(22,163,74,.12) !important;
}

textarea{min-height:120px;resize:vertical}

.actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:14px;
}

/* ===== HOME MENU ===== */
.menu-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:18px;
}

.menu-card{
  display:flex;align-items:center;gap:18px;
  padding:22px;
  text-decoration:none;
  color:var(--text);
  transition:transform .15s ease, box-shadow .15s ease;
}

.menu-card:hover{
  transform:translateY(-2px);
  box-shadow: 0 18px 40px rgba(15,23,42,.12);
}

.menu-icon{
  font-size:42px;
  width:56px;min-width:56px;
  display:flex;align-items:center;justify-content:center;
  line-height:1;
}

.menu-title{font-size:18px;font-weight:950}

/* ===== TABLES (si tu les gardes) ===== */
.table{width:100%;border-collapse:separate;border-spacing:0 10px}
.table th{color:var(--muted);font-size:12px;text-align:left;padding:0 10px}
.table td{
  background: rgba(255,255,255,.92);
  border:1px solid var(--line);
  padding:12px 10px;
  border-left:none;border-right:none;
  vertical-align:top;
}
.table tr td:first-child{border-left:1px solid var(--line);border-top-left-radius:16px;border-bottom-left-radius:16px}
.table tr td:last-child{border-right:1px solid var(--line);border-top-right-radius:16px;border-bottom-right-radius:16px}

.kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size:12px;
  border:1px solid var(--line);
  border-radius:10px;
  padding:3px 8px;
  background: rgba(255,255,255,.9);
  color:var(--muted);
}

/* ===== CHIPS ===== */
.chip{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,.92);
  font-size:14px;
  font-weight:900;
}

.chip-muted{
  color: var(--muted);
  background: rgba(255,255,255,.75);
}

.chip-strong{
  color: var(--text);
  background: rgba(22,163,74,.12);
  border-color: rgba(22,163,74,.28);
}

.chip-op{
  background: var(--dangerSoft);
  border-color: rgba(239,68,68,.35);
  color: var(--text);
}

.chip-amicale{
  background: rgba(59,130,246,.14);
  border-color: rgba(59,130,246,.35);
  color: var(--text);
}

.footer{
  color:var(--muted);
  font-size:12px;
  padding:22px 0;
}

/* ===== MOBILE ===== */
@media (max-width: 900px), (pointer:coarse){
  .form-grid{ grid-template-columns:1fr !important; }
  .menu-grid{ grid-template-columns:1fr !important; }
  .brand{ font-size:16px; }
  .brand .logo{ height:99px; }
}

/* ===== DIFFÉRENCIATION BANDEAU / MENUS (MOBILE) ===== */
@media (max-width: 720px){

  /* Bandeau de page (Accueil, Débrief, etc.) */
  .page-head{
    background: linear-gradient(
      180deg,
      rgba(22,163,74,.10),
      rgba(22,163,74,.04)
    );
    border-left: 6px solid var(--accent);
    box-shadow: none;
  }

  .page-head .badge{
    background: rgba(255,255,255,.75);
    border-color: rgba(22,163,74,.25);
  }

  .page-head h1{
    font-size: 20px;
  }

  .page-head .sub{
    font-size: 14px;
    color: var(--muted);
  }

  /* Cartes de menu = vraies actions */
  .menu-card{
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(15,23,42,.14);
    border: 1px solid rgba(15,23,42,.08);
  }

  .menu-card:active{
    transform: scale(.985);
  }

  .menu-icon{
    filter: drop-shadow(0 6px 10px rgba(15,23,42,.18));
  }
}

/* ===== CONSULTATION (mobile-first) ===== */

.consult-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}

.consult-card{
  display:block;
  background:#ffffff;
  border:1px solid rgba(15,23,42,.08);
  border-radius:22px;
  padding:16px;
  text-decoration:none;
  color:var(--text);
  box-shadow:0 14px 32px rgba(15,23,42,.12);
  transition:transform .15s ease, box-shadow .15s ease;
}

.consult-card:hover{
  transform:translateY(-2px);
}

.consult-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:10px;
}

.consult-date{
  font-size:13px;
  color:var(--muted);
  font-weight:700;
}

.badge-aisance{
  font-size:12px;
  font-weight:900;
  padding:6px 10px;
  border-radius:999px;
}

.badge-aisance.ok{
  background:rgba(22,163,74,.14);
  color:#166534;
}

.badge-aisance.mid{
  background:rgba(234,179,8,.18);
  color:#854d0e;
}

.badge-aisance.bad{
  background:rgba(239,68,68,.18);
  color:#7f1d1d;
}

.consult-main{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.consult-name{
  font-size:17px;
  font-weight:950;
}

.consult-meta{
  font-size:14px;
  color:var(--muted);
}

/* Desktop : 2 colonnes */
@media (min-width: 900px){
  .consult-grid{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }
}

/* ===== CONSULTATION (cartes mobile-first) ===== */
.consult-filters{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
}

.consult-filters > input{
  flex: 1 1 260px;
}

.table-wrap{ overflow-x:auto; -webkit-overflow-scrolling:touch; }

/* ===== ESPACEMENT COHÉRENT DANS LE DÉTAIL DÉBRIEF ===== */

/* cartes internes du détail */
.debrief-content .card{
  margin-bottom: 16px;
}

/* grid points +/- : garde l’espace même côte à côte */
.debrief-content .row{
  gap: 16px;
}

/* sur mobile : empilement + respiration */
@media (max-width: 720px){
  .debrief-content .card{
    margin-bottom: 14px;
  }
}

/* ===== HEADER RESPONSIVE ICONES ===== */

.topbar-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

/* Déconnexion rouge */
.nav a.logout{
  color:#ef4444;
}

/* Mobile par défaut : nav sous le bandeau */
.nav-mobile{
  display:none;
  justify-content:center;
  gap:16px;
  padding:10px 0 6px;
}

/* Desktop */
.nav-desktop{
  display:flex;
}

/* Responsive */
@media (max-width: 720px){
  .nav-desktop{
    display:none;
  }

  .nav-mobile{
    display:flex;
  }
}

