/* Intranet Tube2com — charte graphique issue de tube2com.com */
:root {
  --bleu: #2625C3;
  --bleu-fonce: #1c1b96;
  --noir: #140F1A;
  --anthracite: #201B25;
  --anthracite-2: #2C2731;
  --jaune: #FAB72A;
  --gris-clair: #ECEFF1;
  --gris-texte: #ACA9BB;
  --blanc: #FFFFFF;
  --texte: #201B25;
  --vert: #1D9E75;
  --orange: #EF9F27;
  --rouge: #D8442E;
  --bord: #d8dce0;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--gris-clair);
  color: var(--texte);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--bleu); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- En-tête sombre (DA v3) ---- */
.entete { background: #15171F; height: 60px; display: flex; align-items: center; }
.entete-int {
  width: 100%; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo:hover { text-decoration: none; }
.logo-large { height: 24px; display: block; }
.logo-mobile { height: 24px; display: none; }
.logo-suffixe {
  font-family: "Inter", system-ui, sans-serif;
  color: #8A8C97; font-size: 10.5px; font-weight: 600; letter-spacing: 2.5px;
  text-transform: uppercase; border-left: 1px solid #34363F; padding-left: 12px;
}
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a {
  font-family: "Inter", system-ui, sans-serif;
  color: #B7B9C2; padding: 8px 14px; border-radius: 8px; font-size: 13.5px; font-weight: 450;
}
.nav a:hover { color: #fff; text-decoration: none; background: #23252E; }
.nav a.actif { color: #fff; background: #4338CA; font-weight: 500; }
.nav a.deconnexion { color: #8A8C97; font-size: 13px; margin-left: 8px; }

@media (max-width: 760px) {
  .logo-large { display: none; }
  .logo-mobile { display: block; }
}

/* ---- Structure : 80% de largeur, centré ---- */
.contenu { width: 80%; margin: 0 auto; padding: 24px 28px 48px; }
@media (max-width: 1200px) { .contenu { width: 92%; } }
.pied {
  text-align: center; color: var(--gris-texte); font-size: 12px; padding: 18px;
  border-top: 1px solid var(--bord);
}

.entete-page { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
h1 { font-size: 24px; margin: 0; font-weight: 600; }
h2 { font-size: 17px; margin: 28px 0 12px; font-weight: 600; }
.sous-titre { color: var(--gris-texte); font-size: 13px; margin-top: 2px; }

/* ---- Cartes ---- */
.carte {
  background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 16px;
}
.carte-table { padding: 0; overflow-x: auto; }
.grille { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.grille .carte { margin-bottom: 0; }
.carte-titre { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.carte-titre a { font-size: 17px; font-weight: 600; color: var(--texte); }
.carte-titre a:hover { color: var(--bleu); }

.stats-bandeau { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 22px; }
.stat { background: var(--blanc); border: 1px solid var(--bord); border-radius: var(--radius); padding: 14px 18px; }
.stat .stat-valeur { font-size: 24px; font-weight: 600; }
.stat .stat-libelle { font-size: 12.5px; color: var(--gris-texte); text-transform: uppercase; letter-spacing: 0.5px; }

/* ---- Jauges ---- */
.jauge { margin: 8px 0 2px; }
.jauge-barre { background: var(--gris-clair); border-radius: 99px; height: 10px; overflow: hidden; }
.jauge-rempli { height: 100%; border-radius: 99px; transition: width .2s; }
.jauge-ok .jauge-rempli { background: var(--vert); }
.jauge-alerte .jauge-rempli { background: var(--orange); }
.jauge-depasse .jauge-rempli { background: var(--rouge); }
.jauge-haut { display: flex; align-items: baseline; gap: 7px; margin-bottom: 5px; }
.jauge-restant { font-size: 20px; font-weight: 700; line-height: 1.1; }
.jauge-ok .jauge-restant { color: var(--vert); }
.jauge-alerte .jauge-restant { color: var(--orange); }
.jauge-depasse .jauge-restant { color: var(--rouge); }
.jauge-libelle { font-size: 13px; color: var(--gris-texte); }
.jauge-pct { margin-left: auto; font-size: 13px; color: var(--gris-texte); }
.jauge-sous { font-size: 13px; color: var(--gris-texte); margin-top: 5px; }
.jauge-report-negatif { color: var(--rouge); }
.report { background: #f3f0fa; color: var(--bleu); border-radius: 6px; padding: 1px 7px; font-size: 12px; margin-left: 6px; }
.report-negatif { background: #fdeae7; color: var(--rouge); }

/* ---- Pastilles chef de projet ---- */
.pastille { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; font-size: 13.5px; }
.pastille-rond {
  width: 24px; height: 24px; border-radius: 50%; color: var(--blanc);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
}
.pastille a { color: var(--texte); }

/* ---- Badges ---- */
.badge { display: inline-block; border-radius: 6px; padding: 2px 9px; font-size: 12px; font-weight: 600; }
.badge-encours { background: #e3f4ed; color: var(--vert); }
.badge-termine { background: var(--gris-clair); color: var(--gris-texte); }
.badge-report { background: #ececfb; color: var(--bleu); }
.badge-libre { background: #fdf3dd; color: #946a0a; }

/* ---- Tableaux ---- */
table { width: 100%; border-collapse: collapse; background: var(--blanc); border-radius: var(--radius); overflow: hidden; }
.carte table { border-radius: 0; }
th {
  text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--gris-texte); padding: 10px 12px; border-bottom: 2px solid var(--gris-clair);
  background: var(--blanc);
}
td { padding: 10px 12px; border-bottom: 1px solid var(--gris-clair); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
th.triable { cursor: pointer; user-select: none; }
th.triable:hover { color: var(--bleu); }
th.triable::after { content: "↕"; opacity: .35; margin-left: 5px; font-size: 11px; }
th.tri-asc::after { content: "▲"; opacity: 1; color: var(--bleu); }
th.tri-desc::after { content: "▼"; opacity: 1; color: var(--bleu); }
td.num, th.num { text-align: right; white-space: nowrap; }
.ligne-total td { font-weight: 600; background: #f7f8f9; }

/* ---- Formulaires ---- */
input[type=text], input[type=date], input[type=password], select {
  border: 1px solid var(--bord); border-radius: 8px; padding: 8px 10px;
  font-size: 14px; font-family: inherit; background: var(--blanc); color: var(--texte);
  max-width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--bleu); outline-offset: 0; border-color: var(--bleu); }
label { font-size: 13px; color: var(--anthracite-2); display: block; margin-bottom: 4px; }
.champ { display: flex; flex-direction: column; }
.form-ligne { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.aide { font-size: 12px; color: var(--gris-texte); margin-top: 3px; }
.case { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--texte); margin-bottom: 0; }

.btn {
  display: inline-block; background: var(--bleu); color: var(--blanc); border: none;
  border-radius: 8px; padding: 9px 16px; font-size: 14px; font-family: inherit;
  cursor: pointer; font-weight: 600;
}
.btn:hover { background: var(--bleu-fonce); text-decoration: none; color: var(--blanc); }
.btn-secondaire { background: var(--blanc); color: var(--texte); border: 1px solid var(--bord); font-weight: 400; }
.btn-secondaire:hover { background: var(--gris-clair); color: var(--texte); }
.btn-petit { padding: 5px 10px; font-size: 13px; }
.btn-danger { background: none; border: none; color: var(--rouge); cursor: pointer; font-size: 13px; padding: 2px 4px; }
.btn-danger:hover { text-decoration: underline; }

/* ---- Divers ---- */
/* La ligne de saisie quotidienne : légèrement surlignée pour guider l'œil */
.ligne-saisie td { background: #f2f3fd; }

/* Sections de configuration repliables (réglées une fois, pas tous les jours) */
details.repliable > summary {
  font-size: 15px; font-weight: 600; color: var(--gris-texte);
  cursor: pointer; margin: 30px 0 12px; user-select: none;
}
details.repliable > summary:hover { color: var(--texte); }
details.outils > summary {
  font-size: 12.5px; color: var(--gris-texte); cursor: pointer; margin-top: 10px; user-select: none;
}
details.outils > summary:hover { color: var(--texte); }

.flash { border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; font-size: 14px; }
.flash-succes { background: #e3f4ed; color: #0d6b4d; }
.flash-erreur { background: #fdeae7; color: var(--rouge); }

.selecteur-mois { display: flex; align-items: center; gap: 10px; }
.mois-libelle { font-weight: 600; min-width: 130px; text-align: center; text-transform: capitalize; }

.actions-droite { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.entete-section { display: flex; align-items: center; gap: 14px; margin: 28px 0 12px; }
.entete-section h2 { margin: 0; }

/* ---- Identité du site client ---- */
.favicon-client { border-radius: 4px; vertical-align: -3px; margin-right: 7px; object-fit: contain; }
.couleur-site {
  display: inline-block; width: 16px; height: 16px; border-radius: 5px;
  vertical-align: -3px; margin-right: 4px; border: 1px solid rgba(0, 0, 0, .12);
}
.lien-site { font-size: 13px; }

/* ---- Filtres par personne (saisie du jour) ---- */
.filtres-qui { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--blanc); border: 1px solid var(--bord); border-radius: 99px;
  padding: 6px 14px; font-size: 13.5px; color: var(--texte);
}
.chip:hover { border-color: var(--bleu); text-decoration: none; }
.chip-actif { background: var(--bleu); border-color: var(--bleu); color: var(--blanc); font-weight: 600; }
.chip-rond { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ---- Modale ---- */
.modale {
  border: none; border-radius: var(--radius); padding: 22px 24px;
  width: 420px; max-width: 92vw; box-shadow: 0 10px 40px rgba(20, 15, 26, .25);
  color: var(--texte);
}
.modale::backdrop { background: rgba(20, 15, 26, .45); }
.modale-titre { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 16px; }
.modale-fermer {
  background: none; border: none; font-size: 22px; line-height: 1; cursor: pointer;
  color: var(--gris-texte); padding: 2px 6px;
}
.modale-fermer:hover { color: var(--texte); }
.modale select, .modale input[type=text] { width: 100%; }
.vide { color: var(--gris-texte); font-style: italic; padding: 14px 0; }
.inline { display: inline; }

/* ---- Login ---- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--noir); margin: 0;
}
.login-boite { width: 360px; max-width: 92vw; text-align: center; }
.login-boite img { height: 34px; margin-bottom: 8px; }
.login-sous { color: var(--gris-texte); font-size: 13px; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 28px; }
.login-carte { background: var(--anthracite); border-radius: var(--radius); padding: 28px; }
.login-carte input { width: 100%; background: var(--anthracite-2); border-color: var(--anthracite-2); color: var(--blanc); margin-bottom: 14px; }
.login-carte .btn { width: 100%; }
.login-erreur { color: #f5a08e; font-size: 13px; margin-bottom: 12px; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .contenu { width: 100%; padding: 16px 14px 36px; }
  .entete-int { padding: 12px 14px; }
  .entete-page { flex-direction: column; align-items: flex-start; }
  .grille { grid-template-columns: 1fr; }
  .form-ligne { flex-direction: column; align-items: stretch; }
  .form-ligne .champ input[type=text], .form-ligne .champ select { width: 100% !important; }
  th, td { padding: 8px 8px; }
  .mois-libelle { min-width: 100px; }
}
