/* =========================================================================
   WATERGATE — Intranet · refonte design 10/07/2026
   Look premium « water-tech » : plus grand, plus aéré, plus lisible.
   Toutes les classes historiques sont conservées (rien ne casse).
   ========================================================================= */
:root {
  /* Bleus (identité eau, modernisée) */
  --bleu: #1668c4;
  --bleu-fonce: #0f3f78;
  --bleu-clair: #5aa8e6;
  --bleu-moyen: #2f7cc9;
  --bleu-tres-clair: #e9f2fc;
  --bleu-pale: #eff6fd;
  --indigo: #3a4db0;
  /* Sémantiques */
  --vert: #1a935a;
  --rouge: #d5382c;
  --orange: #c9820a;
  /* Neutres (légère teinte froide, choisis pas subis) */
  --ink: #16212e;
  --gris: #647589;
  --gris-clair-charte: #eef1f6;
  --fond: #eef3f9;
  --surface: #ffffff;
  --bord: #dce6f1;
  /* Ombres & rayons */
  --ombre-s: 0 1px 2px rgba(15,45,85,.05);
  --ombre: 0 1px 2px rgba(15,45,85,.05), 0 10px 30px rgba(15,45,85,.08);
  --ombre-menu: 0 16px 40px rgba(15,40,70,.20);
  --rayon: 14px;
  --rayon-s: 9px;
}

* { box-sizing: border-box; }

body {
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  color: var(--ink);
  margin: 0;
  background:
    radial-gradient(1100px 480px at 100% -8%, rgba(90,168,230,.12), transparent 60%),
    radial-gradient(900px 480px at -8% 108%, rgba(22,104,196,.07), transparent 55%),
    var(--fond);
  background-attachment: fixed;
}

h1, h2, h3, h4 {
  font-family: "Bricolage Grotesque", "Inter", sans-serif;
  color: var(--bleu-fonce);
  letter-spacing: -0.01em;
  text-wrap: balance;
  line-height: 1.2;
}
h2 { font-size: 26px; margin: 0 0 14px; }
h3 { font-size: 19px; margin: 22px 0 10px; }
p { margin: .5em 0; }
a { color: var(--bleu); }

::selection { background: rgba(22,104,196,.18); }
:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }

/* =========================== EN-TÊTE ============================ */
header.topbar {
  background: linear-gradient(115deg, #0e3c74 0%, #17559e 46%, #1668c4 100%);
  color: #fff;
  padding: 13px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  position: relative;
  z-index: 500;
  box-shadow: 0 2px 18px rgba(12,40,80,.20);
}

/* Bulles d'eau flottantes (discrètes) */
.bulles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.bulles span {
  position: absolute; bottom: -20px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.5), rgba(255,255,255,0.04) 70%);
  animation: monter-bulle linear infinite;
}
.bulles span:nth-child(1) { left: 6%;  width: 14px; height: 14px; animation-duration: 7s;  animation-delay: 0s; }
.bulles span:nth-child(2) { left: 18%; width: 8px;  height: 8px;  animation-duration: 5.5s; animation-delay: 1.2s; }
.bulles span:nth-child(3) { left: 34%; width: 18px; height: 18px; animation-duration: 8.5s; animation-delay: 0.4s; }
.bulles span:nth-child(4) { left: 52%; width: 10px; height: 10px; animation-duration: 6s;   animation-delay: 2s; }
.bulles span:nth-child(5) { left: 68%; width: 16px; height: 16px; animation-duration: 9s;   animation-delay: 0.8s; }
.bulles span:nth-child(6) { left: 82%; width: 9px;  height: 9px;  animation-duration: 5s;    animation-delay: 1.6s; }
.bulles span:nth-child(7) { left: 92%; width: 13px; height: 13px; animation-duration: 7.5s;  animation-delay: 2.4s; }
@keyframes monter-bulle {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  10% { opacity: 0.85; } 90% { opacity: 0.45; }
  100% { transform: translateY(-92px) scale(1.15); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .bulles span { animation: none; opacity: 0.2; } }

.vagues { line-height: 0; margin-top: -4px; }
.vagues svg { width: 100%; height: 30px; display: block; }

.marque {
  display: flex; align-items: baseline; gap: 7px;
  font-family: "Bricolage Grotesque", sans-serif; font-weight: 800;
  font-size: 24px; line-height: 1;
}
.marque-water { color: #fff; letter-spacing: .3px; }
.marque-gate {
  color: #0e3c74; background: #fff; padding: 3px 9px; border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,.14);
}
.marque-sous {
  font-family: "Inter", sans-serif; font-weight: 700; font-size: 10px;
  letter-spacing: 2.5px; color: rgba(233,242,252,.85); align-self: center;
}

header.topbar nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
header.topbar nav a {
  color: #eaf3fc; text-decoration: none; font-size: 14.5px; font-weight: 500;
  padding: 7px 11px; border-radius: 8px; transition: background .15s, color .15s;
}
header.topbar nav a:hover { background: rgba(255,255,255,.15); color: #fff; text-decoration: none; }

/* Menus déroulants */
.menu-grp { position: relative; display: inline-block; }
.menu-grp > .menu-top { cursor: pointer; }
.menu-grp .sous {
  display: none; position: absolute; top: 100%; left: 0; margin-top: 8px;
  background: var(--surface); border: 1px solid var(--bord); border-radius: 14px;
  min-width: 232px; z-index: 200; box-shadow: var(--ombre-menu); padding: 8px;
}
.menu-grp:hover .sous, .menu-grp.open .sous { display: block; animation: menu-in .14s ease; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.menu-grp .sous::before { content: ""; position: absolute; top: -12px; left: 0; right: 0; height: 14px; }
.menu-grp .sous a {
  display: block; color: var(--bleu-fonce) !important; margin: 0 !important;
  padding: 9px 13px; border-radius: 9px; font-weight: 600; font-size: 14px;
  text-decoration: none; white-space: nowrap; opacity: 1;
}
.menu-grp .sous a:hover { background: var(--bleu-pale); text-decoration: none; }

.user-box { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.user-box input {
  padding: 7px 11px; border-radius: 8px; border: 1px solid rgba(255,255,255,.55);
  background: rgba(255,255,255,.96); font-size: 13.5px; width: 150px; color: var(--ink);
}
.user-box select {
  padding: 7px 10px; border-radius: 8px; border: none; font-size: 13.5px; color: var(--ink);
}

main { padding: 26px 22px 60px; max-width: 1320px; margin: 0 auto; }

/* =========================== CARTES ============================ */
.cards { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.card {
  background: var(--surface);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: 18px 20px;
  min-width: 168px;
  flex: 1;
  box-shadow: var(--ombre-s);
}
.cards > .card { transition: transform .16s ease, box-shadow .16s ease; }
.cards > .card:hover { transform: translateY(-2px); box-shadow: var(--ombre); }
.card .value {
  font-size: 32px; font-weight: 800; color: var(--bleu);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.1;
}
.card .label { font-size: 13.5px; color: var(--gris); margin-top: 5px; }
.card.alerte { border-color: #f2c4bf; background: linear-gradient(180deg, #fff, #fff6f5); }
.card.alerte .value { color: var(--rouge); }

/* Carte thème « eau » */
.card-eau {
  position: relative;
  background: linear-gradient(160deg, #ffffff 0%, var(--bleu-pale) 100%);
  border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 18px 20px; overflow: hidden; box-shadow: var(--ombre-s);
}
.card-eau::before {
  content: ""; position: absolute; top: -34px; right: -34px; width: 108px; height: 108px;
  border-radius: 50%; background: radial-gradient(circle, rgba(90,168,230,.28), transparent 70%);
}
.card-eau::after {
  content: ""; position: absolute; bottom: -44px; left: 28%; width: 150px; height: 150px;
  border-radius: 50%; background: radial-gradient(circle, rgba(22,104,196,.09), transparent 70%);
}
.card-eau > * { position: relative; z-index: 1; }
a.card-eau, a.card { text-decoration: none; color: inherit; transition: transform .16s, box-shadow .16s, border-color .16s; }
a.card-eau:hover, a.card:hover { transform: translateY(-2px); box-shadow: var(--ombre); border-color: var(--bleu-clair); }

/* =========================== BOUTONS ============================ */
.btn {
  display: inline-block; background: var(--bleu); color: #fff; border: none;
  padding: 9px 16px; border-radius: var(--rayon-s); cursor: pointer;
  font-size: 14.5px; font-weight: 600; font-family: inherit; text-decoration: none;
  box-shadow: 0 1px 2px rgba(15,45,85,.14); transition: background .15s, box-shadow .15s, transform .1s;
}
.btn:hover { background: var(--bleu-moyen); box-shadow: 0 4px 12px rgba(22,104,196,.30); transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--bleu-clair); outline-offset: 2px; }
.btn.secondaire { background: var(--surface); color: var(--bleu); border: 1px solid var(--bord); box-shadow: none; }
.btn.secondaire:hover { background: var(--bleu-pale); border-color: var(--bleu-clair); box-shadow: none; }
.btn.vert { background: var(--vert); }
.btn.vert:hover { background: #157a4a; box-shadow: 0 4px 12px rgba(26,147,90,.30); }
.btn.rouge { background: var(--surface); color: var(--rouge); border: 1px solid #e3b3ad; box-shadow: none; }
.btn.rouge:hover { background: var(--rouge); color: #fff; }
.btn.btn-lg { padding: 12px 20px; font-size: 15.5px; }

/* =========================== BARRE OUTILS / CHAMPS ============================ */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar input[type=text], .toolbar select {
  padding: 9px 12px; border: 1px solid var(--bord); border-radius: var(--rayon-s);
  font-size: 14.5px; background: var(--surface); font-family: inherit; color: var(--ink);
}
input, select, textarea { color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: none; }
.toolbar input:focus, .toolbar select:focus,
form.form-panel input:focus, form.form-panel select:focus, form.form-panel textarea:focus {
  border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(22,104,196,.15);
}

/* =========================== TABLEAUX ============================ */
table {
  width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface);
  border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre-s);
}
thead th {
  background: var(--bleu-pale); text-align: left; padding: 11px 13px;
  font-size: 12.5px; font-weight: 700; letter-spacing: .02em; color: var(--bleu-fonce);
  border-bottom: 1px solid var(--bord); position: sticky; top: 0;
}
tbody td {
  padding: 11px 13px; border-bottom: 1px solid #eef2f7; font-size: 14.5px;
  vertical-align: top; font-variant-numeric: tabular-nums;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f6f9fd; }
tbody tr.fait { background: #f0f9f4; }

.pill {
  display: inline-block; padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .01em;
  background: var(--gris-clair-charte); color: var(--gris);
}
.pill.oui { background: #d9f5e5; color: #147a48; }
.pill.non { background: #fde5e2; color: var(--rouge); }

.check-toggle { width: 21px; height: 21px; cursor: pointer; accent-color: var(--bleu); }

textarea.note-inline {
  width: 100%; min-height: 64px; border: 1px solid transparent; border-radius: 8px;
  padding: 6px 8px; font-size: 13.5px; font-family: inherit; resize: vertical; background: transparent;
}
textarea.note-inline:hover { border-color: var(--bord); }
textarea.note-inline:focus { border-color: var(--bleu); background: #fffdf5; box-shadow: 0 0 0 3px rgba(22,104,196,.12); }

input.jour-inline {
  width: 58px; border: 1px solid transparent; border-radius: 8px; padding: 5px 6px;
  font-size: 13.5px; font-family: inherit; text-align: center; color: var(--bleu-fonce); font-weight: 700;
}
input.jour-inline:hover { border-color: var(--bord); }
input.jour-inline:focus { border-color: var(--bleu); background: #fffdf5; box-shadow: 0 0 0 3px rgba(22,104,196,.12); }
input.jour-inline::placeholder { color: var(--gris); font-weight: 400; }

.badge-stock-bas { color: var(--rouge); font-weight: 800; }
.badge-stock-ok { color: var(--vert); font-weight: 700; }

/* =========================== FORMULAIRES ============================ */
form.form-panel {
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  padding: 22px; max-width: 580px; box-shadow: var(--ombre-s);
}
form.form-panel label {
  display: block; font-size: 12.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--gris); margin: 14px 0 5px;
}
form.form-panel input, form.form-panel select, form.form-panel textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--bord); border-radius: var(--rayon-s);
  font-size: 15px; font-family: inherit; background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.titre-section {
  margin-top: 24px; margin-bottom: 6px; padding-top: 14px; border-top: 1px solid var(--bord);
  font-size: 17px; font-family: "Bricolage Grotesque", "Inter", sans-serif; color: var(--bleu-fonce);
}
.grille-fiche { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 14px; }
.checkbox-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.checkbox-grid label { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink); margin: 0; }
.checkbox-grid input { width: auto; accent-color: var(--bleu); }

/* =========================== FICHE CR ============================ */
.fiche-cr {
  background: linear-gradient(180deg, #fff, var(--bleu-pale));
  border: 1px solid var(--bord); border-radius: var(--rayon); padding: 16px 18px; margin-bottom: 16px;
  box-shadow: var(--ombre-s);
}
.fiche-entete { display: flex; gap: 24px; flex-wrap: wrap; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--bord); }
.fiche-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 18px; margin-bottom: 8px; }
.fiche-label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--indigo); font-weight: 800; }
.fiche-valeur { font-size: 14.5px; }
.fiche-bloc { margin-top: 10px; }
.fiche-bloc p { margin: 3px 0 0; font-size: 14.5px; white-space: pre-wrap; }
.fiche-cases { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.fiche-case-ok { background: #d9f5e5; color: #147a48; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.fiche-photos { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.fiche-photos img { width: 94px; height: 94px; object-fit: cover; border-radius: 10px; border: 1px solid var(--bord); }

/* =========================== DIVERS ============================ */
.toast {
  position: fixed; bottom: 22px; right: 22px; background: var(--bleu-fonce); color: #fff;
  padding: 12px 18px; border-radius: 11px; font-size: 14px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(12,40,80,.32); opacity: 0; transform: translateY(8px);
  transition: opacity .25s, transform .25s; pointer-events: none; z-index: 9998;
}
.toast.show { opacity: 1; transform: none; }

.muted { color: var(--gris); font-size: 13.5px; }
a.discret { color: var(--bleu); font-size: 13.5px; text-decoration: none; }
a.discret:hover { text-decoration: underline; }

/* Légende + planning de maintenance */
.legende-planning { display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; margin: -2px 0 14px; font-size: 13px; color: var(--gris); }
.legende-planning span { display: inline-flex; align-items: center; gap: 6px; }
.statut-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }
.statut-dot.statut-retard { background: var(--rouge); }
.statut-dot.statut-maintenant { background: var(--orange); }
.statut-dot.statut-avenir { background: var(--bleu-clair); }
.statut-dot.statut-fait { background: var(--vert); }

.table-planning tbody tr.groupe-b { background: #f4f8fc; }
.table-planning tbody tr.groupe-b:hover { background: #eaf2fa; }
.table-planning tbody tr.groupe-a:hover { background: #f6f9fd; }
.table-planning tbody tr td:first-child { border-left: 4px solid transparent; transition: border-color .2s; }
.table-planning tbody tr.statut-retard td:first-child { border-left-color: var(--rouge); }
.table-planning tbody tr.statut-maintenant td:first-child { border-left-color: var(--orange); }
.table-planning tbody tr.statut-avenir td:first-child { border-left-color: var(--bleu-clair); }
.table-planning tbody tr.statut-fait td:first-child { border-left-color: var(--vert); }
.table-planning tbody tr.statut-fait { background-image: linear-gradient(to right, rgba(26,147,90,.06), transparent 40%); }

.goutte { display: inline-block; width: 34px; height: 34px; margin-right: 4px; vertical-align: middle; }

/* Responsive : sur mobile, l'en-tête s'empile et les cartes passent en pleine largeur */
@media (max-width: 720px) {
  header.topbar { padding: 12px 16px; }
  header.topbar nav a { padding: 6px 9px; font-size: 14px; }
  main { padding: 18px 14px 50px; }
  .card { min-width: 100%; }
  h2 { font-size: 22px; }
}
