/* ══════════════════════════════════════════════════════════════════════
   Najah — identité visuelle « maquette » (refonte)
   Appliquée aux pages : espace agence Wave, connexion, inscription, offre,
   administration et connexion administrateur.
   Feuille de présentation uniquement : aucun calcul, aucun identifiant,
   aucune règle métier n'est défini ici.
   ══════════════════════════════════════════════════════════════════════ */

:root{
  --nuit:#0B1F4B;
  --nuit-2:#0E2A63;
  --bleu:#2563EB;
  --bleu-fonce:#1E40AF;
  --bleu-clair:#EAF2FF;
  --vert:#16A34A;
  --orange:#F97316;
  --violet:#7C3AED;
  --rouge:#DC2626;
  --encre:#0E1A2E;
  --gris:#5F6F86;
  --ligne:#E4EAF3;
  --fond:#EEF3FA;
  --ombre:0 6px 18px rgba(11,31,75,.07);
  --rayon:18px;
}

body{ background:var(--fond); color:var(--encre); }

/* ── Titres et textes ───────────────────────────────────────────────── */
h1,h2{ color:var(--nuit); }
.sub{ color:var(--gris); }

/* ── Barre latérale bleu nuit ───────────────────────────────────────── */
.barre{
  background:linear-gradient(180deg,var(--nuit-2) 0%,var(--nuit) 100%) !important;
  color:#E6EEFB;
  box-shadow:6px 0 22px rgba(11,31,75,.18);
  border:0;
  padding:20px 14px;
}
.barre .marque{ padding:4px 8px 0; }
.barre .marque img{ height:38px; width:auto; display:block; }
.barre .marque-nom{ display:none; }
.barre .marque-sous{ color:#A9BEE0 !important; font-size:12.5px; margin-top:6px; padding-left:2px; }
.agence-carte{
  background:rgba(255,255,255,.08) !important;
  border:1px solid rgba(255,255,255,.14) !important;
  border-radius:16px !important;
  padding:14px !important;
}
.agence-titre{ color:#fff !important; }
.agence-resp{ color:#C9D8F2 !important; opacity:1 !important; }
.barre .badge{ border-radius:999px; font-weight:600; }

.barre nav{ gap:2px; }
.barre nav .nav-groupe{
  color:#7F97C4 !important;
  font-size:11px;
  letter-spacing:.06em;
  margin:16px 0 4px;
  padding:0 12px;
}
.barre nav button{
  display:flex;
  align-items:center;
  gap:12px;
  color:#C9D8F2 !important;
  font-size:14px;
  border-radius:12px;
  padding:10px 12px;
  min-height:40px;
}
.barre nav button:hover{ background:rgba(255,255,255,.08) !important; color:#fff !important; }
.barre nav button.actif{
  background:linear-gradient(90deg,var(--bleu),#3B82F6) !important;
  color:#fff !important;
  font-weight:600;
  box-shadow:0 8px 18px rgba(37,99,235,.35);
}
/* Icônes des rubriques (sprite SVG, trait fin, couleur du texte). */
.ico{
  width:18px; height:18px; flex:0 0 auto;
  fill:none; stroke:currentColor; stroke-width:1.9;
  stroke-linecap:round; stroke-linejoin:round;
}

/* ── En-tête de page ────────────────────────────────────────────────── */
.haut{
  background:#fff;
  border-bottom:0;
  box-shadow:0 4px 16px rgba(11,31,75,.05);
  padding:16px 26px;
}
.haut h1{ font-size:21px; font-weight:700; }
.haut .sub{ font-size:13px; }
.haut-actions{ gap:10px; }
.langue{ border-radius:999px; border:1px solid #D5DEEB; }
.langue button{ padding:7px 13px; font-weight:600; }
.langue button.actif{ background:var(--bleu); color:#fff; }

/* ── Contenu ─────────────────────────────────────────────────────────── */
.contenu main{ padding:24px 26px 40px; max-width:1180px; }

/* Bandeau d'accueil : dégradé bleu, forme arrondie. */
.heros{
  background:linear-gradient(120deg,var(--nuit) 0%,var(--bleu-fonce) 55%,var(--bleu) 100%);
  border-radius:22px;
  padding:22px 26px;
  box-shadow:0 14px 34px rgba(30,64,175,.28);
  margin-bottom:18px;
}

/* ── Cartes ─────────────────────────────────────────────────────────── */
.carte{
  background:#fff;
  border:1px solid var(--ligne);
  border-radius:var(--rayon);
  box-shadow:var(--ombre);
  padding:20px 22px;
  margin-bottom:18px;
}
.carte h2{ font-size:17px; font-weight:700; margin-bottom:6px; }
.carte h3{ font-size:14.5px; font-weight:700; color:var(--nuit); margin:16px 0 8px; }

/* ── Indicateurs (cartes de synthèse) ───────────────────────────────── */
.kpis{ gap:16px; margin-bottom:18px; }
.kpi{
  position:relative;
  overflow:hidden;
  background:#fff;
  border:1px solid var(--ligne);
  border-radius:20px;
  padding:18px 20px;
  box-shadow:var(--ombre), inset 5px 0 0 var(--kc,var(--bleu));
  color:var(--encre);
}
.kpi small{ font-size:13px; font-weight:600; color:var(--gris); }
.kpi b{ font-size:24px; font-weight:700; letter-spacing:-.3px; color:var(--encre); margin-top:8px; }
.kpi > span{ font-size:12px; color:var(--gris); }

/* Quatre indicateurs principaux : cartes pleines colorées, icône et vague décorative. */
.kpis:not(.kpis-jour) .kpi{
  background:linear-gradient(135deg,var(--kc) 0%,color-mix(in srgb,var(--kc) 70%,#000) 100%);
  border:0;
  color:#fff;
  box-shadow:0 12px 26px -12px var(--kc);
  min-height:124px;
}
.kpis:not(.kpis-jour) .kpi:has(> .kpi-ico){ padding-left:86px; display:flex; flex-direction:column; justify-content:center; }
.kpis:not(.kpis-jour) .kpi::after{
  content:"";
  position:absolute; left:0; right:0; bottom:0; height:46%;
  background:radial-gradient(120% 90% at 50% 120%,rgba(255,255,255,.22),transparent 70%);
  pointer-events:none;
}
.kpis:not(.kpis-jour) .kpi small,
.kpis:not(.kpis-jour) .kpi b,
.kpis:not(.kpis-jour) .kpi > span{ color:#fff; }

.kpis:not(.kpis-jour) .kpi small{ font-size:13.5px; font-weight:600; opacity:.95; }
.kpis:not(.kpis-jour) .kpi b{ font-size:23px; margin-top:4px; }
.kpis:not(.kpis-jour) .kpi > span{ font-size:12px; opacity:.85; margin-top:4px; }
.kpi-ico{
  position:absolute; left:20px; top:50%; transform:translateY(-50%);
  width:50px; height:50px; border-radius:14px;
  background:rgba(255,255,255,.22);
  display:grid; place-items:center;
}
.kpi-ico .ico{ width:26px; height:26px; stroke:#fff; stroke-width:2; }
.kpi.k-caisse{ --kc:#2563EB; }
.kpi.k-wave{ --kc:#16A34A; }
.kpi.k-frais{ --kc:#F97316; }
.kpi.k-ops{ --kc:#7C3AED; }

/* Synthèse du jour : cartes blanches à liseré coloré. */
.kpis-jour .kpi.k-ventes{ --kc:#2563EB; }
.kpis-jour .kpi.k-retraits{ --kc:#E2725B; }
.kpis-jour .kpi.k-entrees{ --kc:#16A34A; }
.kpis-jour .kpi.k-sorties{ --kc:#F97316; }
.kpis-jour .kpi.k-benefice{ --kc:#7C3AED; }
.kpis-jour .kpi.k-solde{ --kc:#0E7490; }

/* ── Raccourcis : grandes tuiles rectangulaires arrondies et colorées ── */
.acces-grille.ronds{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  margin-top:6px;
  justify-items:stretch;
}
@media (min-width:600px){ .acces-grille.ronds{ grid-template-columns:repeat(4,minmax(0,1fr)); } }
@media (min-width:1100px){ .acces-grille.ronds{ grid-template-columns:repeat(4,minmax(0,1fr)); } }
.rond{
  background:linear-gradient(160deg,var(--c) 0%,color-mix(in srgb,var(--c) 75%,#000) 100%);
  color:#fff;
  border:0;
  border-radius:18px;
  padding:18px 12px;
  min-height:116px;
  max-width:none;
  width:100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:12px;
  box-shadow:0 12px 22px -12px var(--c);
  transition:transform .14s, box-shadow .14s;
}
.rond:hover{ transform:translateY(-2px); box-shadow:0 16px 26px -12px var(--c); }
.rond i{ background:none; width:auto; height:auto; box-shadow:none; display:block; }
.rond svg{ width:34px; height:34px; stroke:#fff; stroke-width:1.9; }
.rond b{ color:#fff; font-size:14px; font-weight:700; line-height:1.25; text-align:center; }
.rond:focus-visible{ outline:3px solid #fff; outline-offset:-6px; box-shadow:0 0 0 4px var(--bleu); }

/* ── Boutons ────────────────────────────────────────────────────────── */
button.btn{
  background:linear-gradient(135deg,var(--bleu),var(--bleu-fonce));
  border:0;
  color:#fff;
  border-radius:12px;
  min-height:44px;
  padding:10px 20px;
  font-weight:600;
  box-shadow:0 8px 16px -6px rgba(37,99,235,.55);
}
button.btn:hover:not(:disabled){ filter:brightness(1.07); }
button.btn.secondaire{
  background:#fff;
  color:var(--bleu-fonce);
  border:1px solid #CFE0FA;
  box-shadow:none;
}
button.btn.secondaire:hover:not(:disabled){ background:var(--bleu-clair); }
button.btn.danger{
  background:#fff;
  color:#B42318;
  border:1px solid #F5C2B3;
  box-shadow:none;
}
button.btn:disabled{ opacity:.5; box-shadow:none; }
.periodes button{ border-radius:999px; border-color:#D5DEEB; color:var(--nuit); }
.periodes button[aria-pressed="true"]{ background:var(--bleu); border-color:var(--bleu); color:#fff; }

/* ── Formulaires ────────────────────────────────────────────────────── */
label{ color:#4B5B75; font-size:13px; font-weight:600; gap:6px; }
input,select,textarea{
  border:1px solid #D5DEEB;
  border-radius:12px;
  background:#fff;
  min-height:44px;
  padding:10px 13px;
  color:var(--encre);
  transition:border-color .15s, box-shadow .15s;
}
input:focus,select:focus,textarea:focus{
  outline:0;
  border-color:var(--bleu);
  box-shadow:0 0 0 4px rgba(37,99,235,.14);
}
.formulaire{ gap:14px; }

/* ── Tableaux ───────────────────────────────────────────────────────── */
.table-defil{ border-radius:14px; border:1px solid var(--ligne); }
table{ background:#fff; font-size:13.5px; }
table th{
  background:#F5F8FD;
  color:#4B5B75;
  font-size:11.5px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.04em;
  padding:12px 12px;
  border-bottom:1px solid var(--ligne);
}
table td{ padding:12px 12px; border-bottom:1px solid #EEF2F8; }
table tbody tr:hover td{ background:#FAFCFF; }
table tbody tr:last-child td{ border-bottom:0; }

/* ── Badges et messages ─────────────────────────────────────────────── */
.badge{ border-radius:999px; font-weight:600; padding:3px 10px; }
.badge.ok{ background:#E7F7EE; color:#0E6B36; }
.badge.attente{ background:#FFF4DB; color:#7A5300; }
.badge.ko{ background:#FDECE8; color:#9A3B26; }
.msg{ border-radius:12px; }
.bandeau{ border-radius:14px; }

/* ── Fenêtre de confirmation d'une opération ────────────────────────── */
#o-confirmation{
  background:#FFF9E8;
  border:1px solid #F5D98B;
  border-left:5px solid #F59E0B;
  border-radius:16px;
  padding:16px 18px;
  margin-top:14px;
  box-shadow:0 10px 24px -14px rgba(180,120,0,.45);
}

/* ── Téléphone : barre du bas bleu nuit, cibles tactiles confortables ── */
@media (max-width:820px){
  .contenu main{ padding:16px 14px 0; }
  .haut{ padding:14px 16px; }
  .barre{ padding:0 !important; box-shadow:none; }
  .barre .marque{ display:none; }
  .barre .agence-carte{ display:none; }
  .barre nav{
    background:var(--nuit) !important;
    border-top:0 !important;
    box-shadow:0 -8px 22px rgba(11,31,75,.28) !important;
  }
  .barre nav button{ color:#C9D8F2 !important; font-size:11.5px; border-radius:14px; }
  .barre nav button.principal.actif{ background:rgba(37,99,235,.5) !important; color:#fff !important; box-shadow:none; }
  .barre nav button.plus{ color:#C9D8F2 !important; }
  .barre nav.ouvert{ background:var(--nuit) !important; }
  .barre nav.ouvert button{ background:rgba(255,255,255,.06) !important; }
  .barre nav.ouvert button.actif{ background:linear-gradient(90deg,var(--bleu),#3B82F6) !important; }
  .barre nav .nav-groupe{ color:#8FA6D0 !important; }
  .kpis:not(.kpis-jour) .kpi{ min-height:112px; }
  .kpi-ico{ width:42px; height:42px; left:16px; }
  .kpis:not(.kpis-jour) .kpi:has(> .kpi-ico){ padding-left:74px; }
  .rond{ min-height:104px; padding:14px 8px; }
  .rond svg{ width:30px; height:30px; }
}
@media (max-width:640px){
  .kpis.kpis-jour{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .kpis.kpis-jour .kpi{ padding:14px 14px 14px 16px; }
  .kpis.kpis-jour .kpi b{ font-size:18px; margin-top:4px; }
  .kpis.kpis-jour .kpi > span{ font-size:11.5px; }
  .kpis:not(.kpis-jour){ grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .kpis:not(.kpis-jour) .kpi{ padding-left:14px !important; min-height:0; }
  .kpis:not(.kpis-jour) .kpi:has(> .kpi-ico){ padding-left:14px !important; padding-top:52px; }
  .kpis:not(.kpis-jour) .kpi-ico{ left:14px; top:14px; transform:none; }
  .acces-grille.ronds{ gap:10px; }
  .rond b{ font-size:13px; }
  .kpis:not(.kpis-jour) .kpi b{ font-size:21px; }
  .kpis-jour .kpi b{ font-size:22px; }
}

/* ── Pages de connexion (espace Wave et administration) ─────────────── */
body:not(.avec-barre){ background:linear-gradient(160deg,#EAF2FF 0%,#EEF3FA 55%,#F8FAFD 100%); min-height:100vh; }
.wrap{ max-width:440px; }
.entete .logo-page{ height:52px; width:auto; border-radius:0; margin:0 auto; display:block; }
.entete h1{ color:var(--nuit); font-size:24px; font-weight:700; margin-top:14px; }
.carte{
  border:1px solid var(--ligne) !important;
  border-top:0 !important;
  border-radius:22px !important;
  padding:24px 24px 22px !important;
  box-shadow:0 18px 40px -18px rgba(11,31,75,.28);
  position:relative;
}
.carte::before{
  content:""; position:absolute; left:0; right:0; top:0; height:6px;
  border-radius:22px 22px 0 0;
  background:linear-gradient(90deg,var(--bleu),#3B82F6,#16A34A);
}
form{ gap:16px !important; }
.bouton{
  background:linear-gradient(135deg,var(--bleu),var(--bleu-fonce)) !important;
  border:0 !important;
  border-radius:12px !important;
  box-shadow:0 10px 20px -8px rgba(37,99,235,.6);
  color:#fff !important;
  width:100%;
}
.bouton:hover:not(:disabled){ filter:brightness(1.07); }
.erreur{ border-radius:12px; }
input{ border-radius:12px !important; border:1px solid #D5DEEB !important; min-height:46px; }
input:focus{ outline:0 !important; border-color:var(--bleu) !important; box-shadow:0 0 0 4px rgba(37,99,235,.14); }
label{ color:#4B5B75 !important; font-weight:600; }
.liens a{ color:var(--bleu-fonce) !important; }

/* ── Connexion administrateur (classes propres à cette page) ───────── */
.card{
  background:#fff !important;
  border:1px solid var(--ligne) !important;
  border-radius:22px !important;
  box-shadow:0 18px 40px -18px rgba(11,31,75,.28) !important;
}
.logo-page{ display:block; height:52px; width:auto; margin:0 0 14px; }
#panneau-mdp button[type="submit"], #valider, button.primaire{
  background:linear-gradient(135deg,var(--bleu),var(--bleu-fonce)) !important;
  color:#fff !important;
  border:0 !important;
  border-radius:12px !important;
  box-shadow:0 10px 20px -8px rgba(37,99,235,.6);
  min-height:46px;
}

/* Groupes de champs : ne dépassent jamais la largeur de l'écran (téléphone). */
fieldset{ min-width:0; max-width:100%; }

/* Recherche du tableau de bord administrateur : un seul cadre, pas de double bordure. */
#ba-recherche{ border:0 !important; box-shadow:none !important; min-height:0 !important; padding:6px 4px !important; background:transparent !important; border-radius:0 !important; }
#ba-recherche:focus{ box-shadow:none !important; }

/* Maquettes par espace (feuille de maquettes) */
.ah-sh-ancre{ position:absolute; left:0; width:1px; height:1px; scroll-margin-top:90px; }
