/* EVP Texeï — feuille de style (charte : bleu #04314E dominant,
   turquoise/corail en accents seulement, crème en fond,
   Montserrat = titres, Lato = corps, Arial en substitution) */

@font-face { font-family: 'Montserrat'; font-weight: 600; font-display: swap;
  src: url('fonts/montserrat-600.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap;
  src: url('fonts/montserrat-700.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-weight: 400; font-display: swap;
  src: url('fonts/lato-400.woff2') format('woff2'); }
@font-face { font-family: 'Lato'; font-weight: 700; font-display: swap;
  src: url('fonts/lato-700.woff2') format('woff2'); }

:root {
  --blue:      #04314E;
  --blue-hover:#0A466E;
  --turquoise: #6BD3C5;
  --coral:     #FB6856;
  --cream:     #FCF3EE;
  --ink:       #1C2B36;
  --muted:     #5C6B76;
  --line:      #E5D9D1;
  --card:      #FFFFFF;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.55 Lato, Arial, sans-serif;
  min-height: 100vh;
}
h1, h2, h3 { font-family: Montserrat, Arial, sans-serif; color: var(--blue); }

/* ---- structure ---- */
.topbar {
  background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .8rem 1rem;
}
.topbar .brand { font: 700 1.05rem Montserrat, Arial, sans-serif; letter-spacing: .02em; }
/* la partie droite : une rangée insécable — les actions ne se replient jamais */
.topbar > span { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; white-space: nowrap; }
.topbar .who { font-size: .85rem; opacity: .85; }
@media (max-width: 560px) {
  .topbar .brand { font-size: .95rem; }
  .topbar .who { display: none; }  /* sur mobile, on garde les actions, pas le décorum */
}
.topbar .signout {
  background: none; border: 1px solid rgba(255,255,255,.4); color: #fff;
  border-radius: 6px; padding: .3rem .7rem; font: 700 .8rem Lato, Arial, sans-serif;
  cursor: pointer;
}
.topbar .signout:hover { background: rgba(255,255,255,.12); }

main { max-width: 34rem; margin: 0 auto; padding: 1rem 1rem 4rem; }

section h2 {
  font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; margin: 1.6rem 0 .6rem;
}
/* liseret dégradé de la charte sous le bloc du mois */
.month-nav { display: flex; align-items: center; justify-content: center;
  gap: .5rem; margin: 1.1rem 0 .2rem; }
.month-nav .label {
  font: 700 1.25rem Montserrat, Arial, sans-serif; color: var(--blue);
  min-width: 12rem; text-align: center; text-transform: capitalize;
}
.month-nav button {
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  width: 2.4rem; height: 2.4rem; font-size: 1.1rem; color: var(--blue); cursor: pointer;
}
.month-nav button:hover { background: var(--cream); }
.rule { height: 3px; width: 4.5rem; border: 0; margin: .5rem auto 0;
  background: linear-gradient(90deg, var(--turquoise), var(--coral)); border-radius: 2px; }

/* ---- filtre segmenté ---- */
.segment {
  display: flex; justify-content: center; gap: 0;
  margin: 1rem auto 0; width: fit-content;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff;
}
.segment button {
  font: 700 .85rem Lato, Arial, sans-serif; color: var(--muted);
  background: none; border: none; padding: .45rem 1rem; cursor: pointer;
}
.segment button + button { border-left: 1px solid var(--line); }
.segment button.active { background: var(--blue); color: #fff; }
.segment button:focus-visible { outline: 3px solid var(--turquoise); outline-offset: -3px; }

/* ---- cartes de types ---- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: .85rem 1rem; margin-bottom: .6rem;
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.card .info { min-width: 0; }
.card .title { font-weight: 700; }
.card .sub { font-size: .82rem; color: var(--muted); }
.card .action { flex-shrink: 0; display: flex; align-items: center; gap: .6rem; }

/* détail des dépôts, à l'intérieur de la carte du type */
.deposit-line {
  border-top: 1px solid var(--line); margin-top: .65rem; padding-top: .55rem;
  display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem;
  font-size: .86rem;
}
.deposit-line .amount { font-weight: 700; white-space: nowrap; }
.deposit-line a { color: var(--blue); white-space: nowrap; }
.deposit-line .del {
  background: none; border: none; color: #8C2318; font: 700 .8rem Lato, Arial, sans-serif;
  cursor: pointer; padding: 0; text-decoration: underline; flex-shrink: 0;
}
.deposit-line .note {
  margin-top: .3rem; color: #8C2318;
  background: color-mix(in srgb, var(--coral) 10%, white);
  border-left: 3px solid var(--coral); padding: .25rem .5rem; border-radius: 0 6px 6px 0;
}

/* ---- pastilles ---- */
.badge {
  display: inline-block; font: 700 .72rem Lato, Arial, sans-serif;
  letter-spacing: .04em; padding: .18rem .65rem; border-radius: 99px; white-space: nowrap;
}
.badge-ok      { background: color-mix(in srgb, var(--turquoise) 25%, white); color: #0B5F54; }
.badge-neutral { background: #EEE9E5; color: var(--muted); }
.badge-alert   { background: color-mix(in srgb, var(--coral) 16%, white); color: #8C2318; }
.badge-blue    { background: var(--blue); color: #fff; }

/* ---- boutons (hiérarchie type Lightning, habillage Texeï) ---- */
.btn {
  font: 700 .92rem Lato, Arial, sans-serif; border-radius: 6px;
  padding: .5rem 1rem; cursor: pointer; transition: background .15s;
}
.btn-brand   { background: var(--blue); color: #fff; border: 1px solid var(--blue); }
.btn-brand:hover { background: var(--blue-hover); }
.btn-neutral { background: #fff; color: var(--blue); border: 1px solid var(--line); }
.btn-neutral:hover { background: var(--cream); }
.btn-danger  { background: #fff; color: #8C2318; border: 1px solid var(--coral); }
.btn:focus-visible { outline: 3px solid var(--turquoise); outline-offset: 2px; }
.btn[disabled] { opacity: .55; cursor: default; }

/* ---- formulaire de dépôt (dialog natif) ---- */
dialog {
  border: none; border-radius: 12px; padding: 0;
  width: min(92vw, 26rem); box-shadow: 0 8px 40px rgba(4,49,78,.25);
}
dialog::backdrop { background: rgba(4,49,78,.45); }
dialog form { padding: 1.4rem 1.3rem; }
dialog h3 { margin: 0 0 1rem; font-size: 1.05rem; }
dialog h3:focus, dialog h3:focus-visible { outline: none; -webkit-tap-highlight-color: transparent; }  /* focus initial dirigé sur le titre (iOS ouvre sinon le sélecteur de mois) */
/* iOS : les champs date/mois ont leur habillage natif (valeur centrée, largeur
   intrinsèque qui déborde du width:100%) — on le neutralise pour qu'ils se
   comportent comme les autres champs */
.field input::-webkit-date-and-time-value { text-align: left; }
.field input[type="month"], .field input[type="date"],
.field-row input[type="month"], .field-row input[type="date"] {
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; min-width: 0; min-height: 2.2rem;
}
.field { margin-bottom: .9rem; }
.field label { display: block; font-size: .85rem; font-weight: 700; margin-bottom: .25rem; }
.field label .req { color: var(--coral); }
.field input, .field select {
  width: 100%; font: 1rem Lato, Arial, sans-serif; color: var(--ink);
  border: 1px solid var(--line); border-radius: 6px; padding: .55rem .6rem;
  background: #fff;
}
.field input:focus, .field select:focus { outline: 2px solid var(--turquoise); border-color: var(--turquoise); }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: .2rem; }
.field label.radio { font-weight: 400; font-size: .95rem; display: flex; align-items: center;
  gap: .45rem; margin: .3rem 0 0; cursor: pointer; }
.field label.radio input { width: auto; accent-color: var(--blue); }
.field .error-msg { font-size: .8rem; color: #8C2318; margin-top: .2rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; }
.dialog-warning {
  font-size: .82rem; margin: -.4rem 0 1rem; padding: .45rem .6rem;
  background: color-mix(in srgb, var(--blue) 8%, white);
  border-left: 3px solid var(--blue); border-radius: 0 6px 6px 0;
}

/* ---- divers ---- */
.empty { color: var(--muted); font-size: .9rem; padding: .4rem 0; }
.loading { opacity: .55; pointer-events: none; transition: opacity .15s; }
.hidden { display: none !important; }

#toast {
  position: fixed; top: 1rem; left: 50%; transform: translateX(-50%);
  background: var(--blue); color: #fff; font-weight: 700; font-size: .9rem;
  padding: .6rem 1.1rem; border-radius: 8px; box-shadow: 0 4px 20px rgba(4,49,78,.3);
  z-index: 50; transition: opacity .3s;
}
#toast.error { background: var(--coral); }

/* ---- vue RH ---- */
main.wide { max-width: 56rem; }
.summary { text-align: center; color: var(--muted); font-size: .9rem; margin: .8rem 0 0; }
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
#recap-table { border-collapse: collapse; width: 100%; font-size: .9rem; }
#recap-table th {
  font: 700 .72rem Lato, Arial, sans-serif; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); text-align: center; padding: .6rem .5rem; border-bottom: 1px solid var(--line);
}
#recap-table th:first-child { text-align: left; padding-left: 1rem; }
#recap-table td { text-align: center; padding: .45rem .5rem; border-bottom: 1px solid var(--line); }
#recap-table td.name { text-align: left; padding-left: 1rem; font-weight: 700; white-space: nowrap; }
#recap-table tbody tr { cursor: pointer; }
#recap-table tbody tr:hover { background: var(--cream); }
#recap-table tbody tr.selected { background: color-mix(in srgb, var(--turquoise) 12%, white); }
#recap-table tbody tr:last-child td { border-bottom: none; }
.cell { font-weight: 700; }
.cell.ok { color: #0B5F54; }
.cell.alert { color: var(--coral); }
.cell.off { color: var(--muted); }
.cell.dash { color: var(--line); }
.legend { font-size: .78rem; color: var(--muted); margin-top: .5rem; }
button.copy {
  font: 700 .72rem Lato, Arial, sans-serif; color: var(--blue);
  background: #fff; border: 1px solid var(--line); border-radius: 5px;
  padding: .1rem .5rem; cursor: pointer; vertical-align: 1px;
}
button.copy:hover { background: var(--cream); }
.legend .dash { color: var(--line); font-weight: 700; }
.admin-fields { margin-top: .55rem; display: flex; flex-direction: column; gap: .35rem; }
.field-row {
  display: grid; grid-template-columns: 9.5rem 11rem; gap: .6rem;
  align-items: center; font-size: .85rem; color: var(--muted); cursor: pointer;
}
.field-row input {
  width: 100%; font: .9rem Lato, Arial, sans-serif; color: var(--ink);
  border: 1px solid var(--line); border-radius: 5px; padding: .3rem .5rem; background: #fff;
}
.field-row input:focus { outline: 2px solid var(--turquoise); border-color: var(--turquoise); }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; gap: .15rem; } }
.topbar a {
  display: inline-block; color: #fff; font: 700 .8rem Lato, Arial, sans-serif;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.4); border-radius: 6px; padding: .3rem .7rem;
}
.topbar a:hover { background: rgba(255,255,255,.12); }

/* connexion */
.login-wrap { min-height: 80vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card {
  background: #fff; border-radius: 12px; box-shadow: 0 2px 16px rgba(4,49,78,.08);
  padding: 2.25rem 2rem; width: 100%; max-width: 26rem;
}
.login-card h1 { font-size: 1.35rem; margin: 0 0 .35rem; }
.login-card .rule { margin: 0 0 1.25rem; }
.login-card .btn { width: 100%; margin-top: 1.25rem; font-size: 1rem; padding: .65rem; }
.login-card .muted { color: var(--muted); font-size: .92rem; }
.login-error {
  background: color-mix(in srgb, var(--coral) 14%, white);
  border: 1px solid var(--coral); color: #8C2318;
  border-radius: 6px; padding: .7rem .9rem; font-size: .92rem; margin-top: 1rem;
}
