/* ===== Fenêtre Scadouch (scripts/scadouch-vue.js), refaite le 12 nov. 2026 ==========
   D'après la maquette d'Aaron : en-tête avec photo, quatre compteurs en cartes colorées
   SÉPARÉES (cadre + espace), onglets avec recherche, cartes de relance à barre orange,
   tableau à en-tête bleu nuit, bande « En pause · Chez nous ». Règles statiques : aucune
   classe Tailwind ajoutée après coup. Mode sombre : body[data-mode="dark"]. */
.scv-fenetre {
  --scv-nuit: #0C3A5C; --scv-ciel: #60C0ED; --scv-ciel-doux: #CFEBF9; --scv-fond: #F2FAFE;
  --scv-orange: #F09C63; --scv-orange-txt: #B4561A; --scv-orange-doux: #FDEBDD;
  --scv-carte: var(--card-bg, #fff); --scv-trait: #DCE9F2; --scv-texte: var(--text-strong, #0C3A5C);
  --scv-doux: var(--text-muted, #5B7186); --scv-pastille: #E4F3FB;
  background: var(--scv-carte); color: var(--scv-texte); border-radius: 22px; box-shadow: 0 24px 60px rgba(12, 58, 92, .28);
}
body[data-mode="dark"] .scv-fenetre {
  --scv-carte: var(--card-bg, #0f1f2d); --scv-nuit: #9ED8F5; --scv-fond: #12283a; --scv-trait: #24405a; --scv-pastille: #183650;
  --scv-orange-doux: #3d2717; --scv-orange-txt: #F6B98C; --scv-texte: var(--text-strong, #E6F1F8); --scv-doux: var(--text-muted, #93A9BC);
}

/* --- En-tête -------------------------------------------------------------------- */
.scv-entete { display: flex; align-items: center; gap: 16px; padding: 18px 24px 6px; flex-shrink: 0; }
.scv-photo { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 0 2px var(--scv-carte), 0 0 0 4px var(--scv-nuit); }
.scv-qui { min-width: 0; flex: 1; }
.scv-qui h2 { font-size: 26px; line-height: 1.1; font-weight: 800; color: var(--scv-nuit); margin: 0; }
.scv-qui p { font-size: 15px; color: var(--scv-doux); margin: 3px 0 0; }
.scv-boutons { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* --- Boutons -------------------------------------------------------------------- */
.scv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 9px;
  font-size: 14px; font-weight: 700; white-space: nowrap; cursor: pointer; border: 1px solid transparent; transition: filter .15s, background .15s, border-color .15s; text-decoration: none; }
.scv-btn:disabled { opacity: .45; cursor: not-allowed; }
.scv-btn:focus-visible, .scv-onglet:focus-visible, .scv-tuile:focus-visible, .scv-bas button:focus-visible, .scv-nom:focus-visible { outline: 2px solid var(--scv-ciel); outline-offset: 2px; }
.scv-btn-ciel { height: 46px; padding: 0 22px; font-size: 16px; background: var(--scv-ciel); color: var(--scv-nuit); border-radius: 11px; }
body[data-mode="dark"] .scv-btn-ciel { color: #0C3A5C; }
.scv-btn-ciel:hover, .scv-btn-nuit:hover, .scv-btn-vert:hover { filter: brightness(1.07); }
.scv-btn-icone { width: 46px; height: 46px; padding: 0; border-radius: 11px; background: var(--scv-carte); border-color: var(--scv-trait); color: var(--scv-nuit); box-shadow: 0 1px 2px rgba(12, 58, 92, .08); }
.scv-btn-icone:hover { background: var(--scv-fond); }
.scv-btn-fermer { width: 40px; height: 40px; padding: 0; background: transparent; color: var(--scv-nuit); }
.scv-btn-fermer:hover { background: var(--scv-fond); }
.scv-btn-nuit { background: #0C3A5C; color: #fff; height: 40px; padding: 0 20px; }
body[data-mode="dark"] .scv-btn-nuit { background: #1d5f8f; }
.scv-btn-vert { background: #12805C; color: #fff; }
.scv-btn-clair { background: var(--scv-carte); color: var(--scv-nuit); border-color: var(--scv-trait); }
.scv-btn-clair:hover { background: var(--scv-fond); }
.scv-btn-contour { background: var(--scv-carte); color: var(--scv-nuit); border-color: var(--scv-nuit); }
.scv-btn-contour:hover { background: var(--scv-fond); }
.scv-btn-carre { width: 40px; padding: 0; background: var(--scv-carte); color: var(--scv-nuit); border-color: var(--scv-trait); font-size: 18px; letter-spacing: 1px; list-style: none; }
.scv-btn-carre::-webkit-details-marker { display: none; }
.scv-tourne svg { animation: scv-tourne 1s linear infinite; }
@keyframes scv-tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .scv-tourne svg { animation: none; } }
.scv-lien { background: none; border: 0; padding: 0; color: #1A7FC1; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
.scv-lien:hover { text-decoration: underline; }

/* --- Corps ---------------------------------------------------------------------- */
.scv-defile { overflow-y: auto; padding: 0 24px 20px; }
.scv-h1 { font-size: 26px; font-weight: 800; color: var(--scv-nuit); margin: 8px 0 14px; }

/* Les quatre compteurs : cartes séparées, cadre coloré, espace entre elles. */
.scv-tuiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.scv-tuile { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1.5px solid; text-align: left; cursor: pointer;
  transition: transform .15s, box-shadow .15s; }
.scv-tuile:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(12, 58, 92, .10); }
.scv-tuile b { display: block; font-size: 28px; line-height: 1; font-weight: 800; color: var(--scv-nuit); font-variant-numeric: tabular-nums; }
.scv-tuile small { display: block; font-size: 15px; font-weight: 600; color: var(--scv-nuit); margin-top: 4px; }
.scv-t-ico { width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.scv-t-orange { background: #FFF6EF; border-color: #F7CBA8; } .scv-t-orange .scv-t-ico { background: #FDE3CF; color: #E07A2E; }
.scv-t-bleu   { background: #F2F8FE; border-color: #BFDDF5; } .scv-t-bleu .scv-t-ico { background: #DCEEFC; color: #1A7FC1; }
.scv-t-vert   { background: #F1FAF5; border-color: #B9E3CB; } .scv-t-vert .scv-t-ico { background: #D6F1E2; color: #16925F; }
.scv-t-ciel   { background: #F2FAFE; border-color: #B8E1F5; } .scv-t-ciel .scv-t-ico { background: #D8EFFA; color: #2B8FC4; }
body[data-mode="dark"] .scv-t-orange { background: #2b1e14; border-color: #7a4a26; }
body[data-mode="dark"] .scv-t-bleu, body[data-mode="dark"] .scv-t-ciel { background: #13283b; border-color: #2c5576; }
body[data-mode="dark"] .scv-t-vert { background: #122a21; border-color: #2a6249; }
body[data-mode="dark"] .scv-t-ico { background: rgba(255, 255, 255, .08) !important; }
.scv-zero b { color: var(--scv-doux); }

/* Onglets et recherche */
.scv-barre { display: flex; align-items: center; gap: 16px; margin-top: 18px; border-bottom: 1px solid var(--scv-trait); }
.scv-onglets { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; }
.scv-onglet { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px 11px; font-size: 16px; font-weight: 600; color: var(--scv-nuit);
  background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.scv-onglet:hover { color: #1A7FC1; }
.scv-onglet.scv-actif { font-weight: 800; border-bottom-color: var(--scv-ciel); }
.scv-recherche { display: flex; align-items: center; gap: 10px; width: 290px; max-width: 100%; height: 42px; padding: 0 14px; margin-bottom: 8px;
  border: 1px solid var(--scv-trait); border-radius: 10px; color: var(--scv-doux); background: var(--scv-carte); }
.scv-recherche:focus-within { border-color: var(--scv-ciel); box-shadow: 0 0 0 3px rgba(96, 192, 237, .25); }
.scv-recherche input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--scv-texte); }
/* 14 nov. 2026 : la recherche n'est qu'une loupe tant qu'on ne clique pas dessus. */
.scv-loupe { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; margin-bottom: 8px; flex-shrink: 0;
  border: 1px solid var(--scv-trait); border-radius: 10px; background: var(--scv-carte); color: var(--scv-doux); cursor: pointer; }
.scv-loupe:hover { color: var(--scv-nuit); border-color: var(--scv-ciel); }
.scv-loupe:focus-visible { outline: 2px solid var(--scv-ciel); outline-offset: 2px; }
/* Onglet « Dossiers à risque » : la note sur 100. */
.scv-risque { flex-shrink: 0; width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 800; }
.scv-risque-rouge { background: #FADDE2; color: #B42339; }
.scv-risque-orange { background: var(--scv-orange-doux); color: var(--scv-orange-txt); }
.scv-risque-bleu { background: #E2F4FC; color: #1A7FC1; }
body[data-mode="dark"] .scv-risque-rouge { background: #3a1820; color: #F49AA8; }
body[data-mode="dark"] .scv-risque-bleu { background: #13283b; color: #8CCBF0; }

/* Titres de partie */
.scv-contenu { padding-top: 4px; }
.scv-titre { display: flex; align-items: center; gap: 10px; font-size: 22px; font-weight: 800; color: var(--scv-nuit); margin: 18px 0 10px; scroll-margin-top: 8px; }
.scv-nb { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 26px; padding: 0 8px; border-radius: 9px;
  background: var(--scv-ciel-doux); color: var(--scv-nuit); font-size: 15px; font-weight: 800; }
body[data-mode="dark"] .scv-nb { background: #1d4766; color: #E6F1F8; }
.scv-aide { font-size: 13px; color: var(--scv-doux); margin: -4px 0 8px; }
.scv-vide { padding: 14px 16px; border-radius: 12px; border: 1px dashed var(--scv-trait); font-size: 14px; color: var(--scv-doux); }
.scv-avis { display: grid; gap: 4px; margin-top: 14px; padding: 9px 13px; border-radius: 10px; background: #FFFBEB; border: 1px solid #FDE68A; font-size: 13px; color: #78350F; }
body[data-mode="dark"] .scv-avis { background: #2e2610; border-color: #6b5716; color: #f5dc8b; }
.scv-groupe { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 6px; font-size: 13px; font-weight: 700; color: var(--scv-doux); text-transform: uppercase; letter-spacing: .03em; }
.scv-groupe small { font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; }
.scv-groupe .scv-btn { margin-left: auto; height: 32px; font-size: 13px; text-transform: none; letter-spacing: 0; }

/* Cartes */
.scv-liste { display: grid; gap: 0; border: 1px solid var(--scv-trait); border-radius: 14px; background: var(--scv-carte); }
.scv-carte { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 16px 14px 22px; }
.scv-carte + .scv-carte { border-top: 1px solid var(--scv-trait); }
.scv-carte::before { content: ''; position: absolute; left: 10px; top: 16px; bottom: 16px; width: 4px; border-radius: 4px; background: transparent; }
.scv-orange::before { background: var(--scv-orange); } .scv-bleu::before { background: var(--scv-ciel); }
.scv-vert::before { background: #34B37A; } .scv-rouge::before { background: #E05252; } .scv-gris::before { background: var(--scv-trait); }
.scv-alerte { background: #FFF8F1; } body[data-mode="dark"] .scv-alerte { background: #2b1e14; }
.scv-terne { opacity: .6; }
.scv-case { width: 18px; flex-shrink: 0; display: flex; justify-content: center; }
.scv-case input { width: 16px; height: 16px; accent-color: #1A7FC1; }
.scv-ico-doc { color: #2B8FC4; flex-shrink: 0; display: inline-flex; }
.scv-corps { min-width: 0; flex: 1; display: grid; gap: 5px; }
.scv-ligne { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.scv-nom { font-size: 19px; font-weight: 800; color: var(--scv-nuit); background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
button.scv-nom:hover { text-decoration: underline; }
.scv-maj { text-transform: uppercase; font-size: 16px; }
.scv-manque { font-size: 15px; color: var(--scv-texte); }
.scv-quand { display: flex; align-items: center; gap: 8px; font-size: 15px; color: #1A6FAE; }
body[data-mode="dark"] .scv-quand { color: #8fcdf0; }
.scv-quand-gris { color: var(--scv-doux) !important; font-size: 13.5px; }
.scv-etape { font-size: 14px; font-weight: 600; color: var(--scv-texte); }
.scv-detail { display: block; font-size: 12.5px; color: var(--scv-doux); overflow: hidden; text-overflow: ellipsis; }
.scv-ok { color: #12805C; } .scv-warn { color: #C2410C; }
.scv-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.scv-pas { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 8px; font-size: 14px; font-weight: 500; white-space: nowrap; }
.scv-pas-bleu { background: var(--scv-pastille); color: var(--scv-texte); }
.scv-pas-orange { background: var(--scv-orange-doux); color: var(--scv-orange-txt); font-weight: 700; }
.scv-pas-vert { background: #DDF4E8; color: #12805C; font-weight: 700; }
.scv-pas-rouge { background: #FDE2E2; color: #B42318; font-weight: 700; }
.scv-pas-gris { background: #EEF2F6; color: #5B7186; }
body[data-mode="dark"] .scv-pas-vert { background: #173a2b; color: #7fdcae; }
body[data-mode="dark"] .scv-pas-rouge { background: #3d1818; color: #f5a3a3; }
body[data-mode="dark"] .scv-pas-gris { background: #22313f; color: #a9bccd; }

/* Menu « ⋯ » */
.scv-menu { position: relative; }
.scv-menu > div { position: absolute; right: 0; top: 100%; margin-top: 4px; width: 270px; z-index: 10; padding: 4px; border-radius: 10px;
  background: var(--scv-carte); border: 1px solid var(--scv-trait); box-shadow: 0 10px 24px rgba(12, 58, 92, .16); }
.scv-menu > div button { display: block; width: 100%; text-align: left; padding: 7px 9px; border-radius: 7px; font-size: 13px; background: none; border: 0; color: var(--scv-texte); cursor: pointer; }
.scv-menu > div button:hover { background: var(--scv-fond); }

/* Liste d'appels */
.scv-appels { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 12px 16px; border: 1px solid var(--scv-trait); border-radius: 14px; font-size: 14px; }
.scv-ico-rond { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #D6F1E2; color: #16925F; flex-shrink: 0; }
.scv-puce { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 10px; border-radius: 99px; border: 1px solid var(--scv-trait); }
.scv-puce .scv-nom { font-size: 13px; font-weight: 700; }
.scv-puce button:not(.scv-nom) { background: none; border: 0; padding: 2px 5px; border-radius: 99px; cursor: pointer; font-size: 13px; }
.scv-puce button:not(.scv-nom):hover { background: var(--scv-fond); }

/* Tableau « À vérifier en interne » */
.scv-tableau { border: 1px solid var(--scv-trait); border-radius: 14px; overflow: hidden; }
.scv-tete, .scv-rang { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.1fr) minmax(0, 1.2fr); gap: 12px; align-items: center; padding: 0 22px; }
.scv-tete { background: #0C3A5C; color: #fff; font-size: 15px; font-weight: 700; height: 44px; }
body[data-mode="dark"] .scv-tete { background: #0a2c46; }
.scv-rang { min-height: 58px; padding-top: 8px; padding-bottom: 8px; }
.scv-rang + .scv-rang { border-top: 1px solid var(--scv-trait); }
.scv-cli { display: flex; align-items: center; gap: 12px; min-width: 0; }
.scv-act { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-start; }
.scv-act .scv-btn { height: 36px; padding: 0 13px; }
.scv-plus { padding: 10px 22px 12px; border-top: 1px solid var(--scv-trait); width: 100%; font-size: 15px; }

/* Bande du bas : En pause · Chez nous */
.scv-bas { display: flex; align-items: center; gap: 18px; margin-top: 18px; padding: 10px 22px; border-radius: 12px; background: var(--scv-fond); }
.scv-bas button { display: inline-flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 600; color: var(--scv-nuit); background: none; border: 0; padding: 6px 4px; cursor: pointer; border-radius: 8px; }
.scv-bas button:hover, .scv-bas button.scv-actif { text-decoration: underline; text-underline-offset: 4px; }
.scv-sep { width: 1px; align-self: stretch; background: var(--scv-trait); }

/* --- Écrans étroits ------------------------------------------------------------- */
@media (max-width: 900px) {
  .scv-tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scv-barre { flex-wrap: wrap; } .scv-recherche { width: 100%; }
}
@media (max-width: 640px) {
  .scv-entete { flex-wrap: wrap; padding: 14px 16px 4px; gap: 12px; }
  .scv-photo { width: 48px; height: 48px; } .scv-qui h2 { font-size: 21px; } .scv-qui p { font-size: 13px; }
  .scv-boutons { width: 100%; justify-content: flex-end; }
  .scv-btn-ciel { height: 40px; font-size: 14px; padding: 0 14px; } .scv-btn-icone { width: 40px; height: 40px; }
  .scv-defile { padding: 0 16px 16px; }
  .scv-h1 { font-size: 20px; } .scv-titre { font-size: 18px; }
  .scv-tuiles { gap: 10px; } .scv-tuile { padding: 11px 12px; gap: 10px; } .scv-t-ico { width: 38px; height: 38px; }
  .scv-tuile b { font-size: 23px; } .scv-tuile small { font-size: 13px; }
  .scv-onglet { font-size: 14px; padding: 9px 10px; }
  .scv-carte { flex-wrap: wrap; padding-left: 20px; } .scv-actions { width: 100%; justify-content: flex-end; }
  .scv-nom { font-size: 17px; }
  .scv-tete { display: none; } .scv-rang { grid-template-columns: 1fr; gap: 6px; padding: 12px 16px; }
  .scv-appels { flex-wrap: wrap; }
}
