/* Design system aqoba : couleurs, Oswald (titres) + Barlow (texte), angles arrondis, cercles, pas d'ombre ni de dégradé */
:root {
  --menthe: #c0e1d7; --menthe-25: #eff8f5;
  --turquoise: #42bbc6; --turquoise-25: #d0eef1;
  --azur: #009bd6;
  --canard: #00919d; --canard-50: #80c8ce; --canard-25: #bfe4e6;
  --marine: #005083; --marine-25: #bfd3e0;
  --sable: #ebdfbe; --sable-25: #faf7ef;
  --ocre: #ca9c52; --ocre-25: #f2e6d4;
  --brique: #852819;
  --noir: #000000; --blanc: #ffffff;
  --texte: var(--noir); --fond: var(--blanc);
  --texte-doux: #4a4a4a;      /* gris neutre pour les libellés secondaires (9:1 sur blanc) */
  --trait: #dcdcdc;           /* filets et grilles, récessifs */
  --font-titre: "Oswald", "Arial Narrow", sans-serif;
  --font-texte: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-condense: "Barlow Semi Condensed", "Barlow", "Arial Narrow", sans-serif;
  --space-1: 4px; --space-2: 8px; --space-3: 16px; --space-4: 24px; --space-5: 40px;
  --radius-sm: 6px; --radius-md: 12px; --radius-full: 9999px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--fond); }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 400 16px/1.35 var(--font-texte);
  overflow-x: hidden; position: relative; min-height: 100vh;
}
a { color: var(--marine); }
a:hover { color: var(--brique); }

/* Cercles décoratifs, coupés par le bord, jamais sous le texte (masqués sur petit écran) */
.cercle { position: absolute; border-radius: var(--radius-full); pointer-events: none; z-index: 0; }
.cercle-1 { width: 320px; height: 320px; top: -170px; right: -120px; background: var(--turquoise-25); }
.cercle-2 { width: 180px; height: 180px; top: 60px; right: -110px; border: 3px solid var(--ocre); }
@media (max-width: 1280px) { .cercle { display: none; } }

.wrap { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: var(--space-4) var(--space-3) var(--space-5); }

/* En-tête */
.top { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.cartouche { display: inline-flex; align-items: center; background: var(--marine); border-radius: var(--radius-sm); padding: 7px 12px; }
.cartouche img { height: 18px; display: block; }
.top .appname { font: 600 15px/1 var(--font-condense); letter-spacing: .08em; text-transform: uppercase; color: var(--marine); }
.top .spacer { flex: 1; }
.top .logout { font-size: 14px; color: var(--texte-doux); }

/* Barre de filtres : une seule ligne au-dessus des graphiques */
.filters { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; margin: var(--space-4) 0 var(--space-3); }
.pills { display: inline-flex; flex-wrap: wrap; gap: var(--space-1); }
.pill {
  display: inline-block; padding: 6px 12px; border-radius: var(--radius-full);
  border: 1px solid var(--marine-25); color: var(--texte); text-decoration: none; font-size: 14px; white-space: nowrap;
}
.pill:hover { border-color: var(--marine); color: var(--marine); }
.pill.on { background: var(--marine); border-color: var(--marine); color: var(--blanc); }
.filters .label { font-size: 13px; color: var(--texte-doux); text-transform: uppercase; letter-spacing: .06em; margin-right: var(--space-1); }
.btn {
  display: inline-block; padding: 6px 14px; border-radius: var(--radius-full); background: var(--sable);
  color: var(--texte); text-decoration: none; font-size: 14px; font-weight: 600;
}
.btn:hover { background: var(--ocre); color: var(--texte); }

/* Titres */
h1 { font: 600 33px/1.1 var(--font-titre); text-transform: uppercase; color: var(--marine); margin: var(--space-3) 0 var(--space-1); }
h2 { font: 600 19px/1.25 var(--font-texte); color: var(--marine); margin: 0 0 var(--space-3); }
.sub { color: var(--texte-doux); margin: 0 0 var(--space-4); }
.back { font-size: 14px; }

/* Tuiles chiffres clés */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.tile { border-radius: var(--radius-md); padding: var(--space-3); background: var(--menthe-25); }
.tile:nth-child(2) { background: var(--sable-25); }
.tile:nth-child(3) { background: var(--turquoise-25); }
.tile:nth-child(4) { background: var(--ocre-25); }
.tile .k { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-doux); }
.tile .v { font: 600 34px/1.15 var(--font-titre); color: var(--marine); margin-top: var(--space-1); }
.tile .n { font-size: 13px; color: var(--texte-doux); }

/* Cartes */
.card { border: 1px solid var(--trait); border-radius: var(--radius-md); padding: var(--space-4); margin-bottom: var(--space-4); }
.card .hint { font-size: 13px; color: var(--texte-doux); margin: calc(-1 * var(--space-2)) 0 var(--space-3); }
.scroll { overflow-x: auto; }
.empty { color: var(--texte-doux); font-style: italic; }

/* Graphique en barres (une série, pas de légende : le titre la nomme) */
.chart { display: grid; grid-template-columns: 28px 1fr; height: 180px; }
.chart-y { position: relative; font-size: 12px; color: var(--texte-doux); }
.chart-y span { position: absolute; right: 6px; transform: translateY(50%); }
.chart-plot { position: relative; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--texte-doux); }
.chart-plot .grid i { position: absolute; left: 0; right: 0; border-top: 1px solid var(--trait); }
.bar { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; min-width: 2px; }
.bar span { display: block; width: 100%; background: var(--marine); border-radius: 4px 4px 0 0; min-height: 0; }
.bar:hover span { background: var(--azur); }
.chart-x { display: flex; justify-content: space-between; margin-left: 28px; font-size: 12px; color: var(--texte-doux); padding-top: 4px; }

/* Carte de chaleur : jours de présence par semaine */
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--trait); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-doux); font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr:hover td { background: var(--menthe-25); }
.heat td, .heat th { border-bottom: none; padding: 2px; }
.heat th.w { text-align: center; font-weight: 400; font-size: 11px; }
.heat td.name { padding: 2px 12px 2px 0; white-space: nowrap; }
.heat td.num { padding-left: 12px; }
.heat tr:hover td { background: none; }
.cell {
  display: block; min-width: 30px; height: 26px; border-radius: 6px; text-align: center; line-height: 26px;
  font-size: 13px; font-variant-numeric: tabular-nums; font-weight: 600;
}
.h0 { border: 1px solid var(--trait); }
.h1 { background: var(--canard-25); color: var(--noir); }
.h2 { background: var(--canard-50); color: var(--noir); }
.h3 { background: var(--canard); color: var(--noir); }
.h4 { background: var(--marine); color: var(--blanc); }
.legend { display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--texte-doux); margin-top: var(--space-3); }
.legend .cell { display: inline-block; min-width: 26px; height: 20px; line-height: 20px; font-size: 12px; margin-right: 4px; vertical-align: middle; }

/* Frise d'une réunion */
.gantt { min-width: 560px; }
.g-row { display: grid; grid-template-columns: minmax(140px, 220px) 1fr; align-items: center; min-height: 30px; }
.g-name { padding-right: var(--space-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-track { position: relative; height: 30px; }
.g-track .tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--trait); }
.g-axis .g-track span { position: absolute; transform: translateX(-50%); font-size: 12px; color: var(--texte-doux); top: 8px; }
.g-axis .g-track span.end { transform: translateX(-100%); }
.g-axis .g-track span.start { transform: none; }
.g-track .seg { position: absolute; top: 7px; height: 16px; background: var(--canard); border-radius: 4px; border: 1px solid var(--blanc); }
.g-track .seg:hover { background: var(--marine); }

/* Liste des réunions */
.names { color: var(--texte-doux); font-size: 14px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: var(--radius-full); background: var(--sable-25); color: var(--texte-doux); }

/* Connexion */
.login { max-width: 360px; margin: 12vh auto 0; padding: 0 var(--space-3); position: relative; z-index: 1; }
.login form { border: 1px solid var(--trait); border-radius: var(--radius-md); padding: var(--space-4); margin-top: var(--space-4); }
.login label { display: block; font-weight: 600; margin-bottom: var(--space-2); }
.login input[type=password] {
  width: 100%; padding: 10px 12px; font: inherit; border: 1px solid var(--texte-doux); border-radius: var(--radius-sm);
}
.login input:focus, .pill:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid var(--azur); outline-offset: 2px; }
.login button {
  margin-top: var(--space-3); width: 100%; padding: 10px; font: 600 16px var(--font-texte); color: var(--blanc);
  background: var(--marine); border: 0; border-radius: var(--radius-full); cursor: pointer;
}
.login button:hover { background: var(--brique); }
.login .error { color: var(--brique); font-weight: 600; margin: var(--space-2) 0 0; }

@media (max-width: 600px) {
  h1 { font-size: 27px; }
  .card { padding: var(--space-3); }
  .tile .v { font-size: 28px; }
}
