/* RH-Tempo : charte administrative, couleurs Educape PROVISOIRES (tâche T26 : à remplacer quand la charte sera arrêtée).
   Toutes les couleurs passent par les jetons --rt-* ci-dessous ; Bootstrap 5.3 en reçoit l'accent par --bs-*.
   Jour par défaut, nuit via [data-bs-theme="dark"] (préférence du système ou bouton, mémorisé dans le navigateur). */

:root, [data-bs-theme="light"] {
  --rt-marque: #243777;        /* bleu nuit Educape */
  --rt-accent: #0570b0;        /* bleu Educape assombri pour le contraste AA sur blanc */
  --rt-accent-clair: #08b9ed;  /* cyan Educape (décor) */
  --rt-violet: #5d256f;        /* violet Educape (décor) */
  --rt-fond: #f3f6fa;
  --rt-surface: #ffffff;
  --rt-bordure: #d5deea;
  --rt-texte: #1b2440;
  --rt-attenue: #56627a;
  --rt-accent-doux: #e2f1fa;
  --rt-ombre: 0 1px 2px rgba(36, 55, 119, .07), 0 2px 8px rgba(36, 55, 119, .05);

  --bs-primary: var(--rt-accent);
  --bs-primary-rgb: 5, 112, 176;
  --bs-link-color: var(--rt-accent);
  --bs-link-color-rgb: 5, 112, 176;
  --bs-link-hover-color: var(--rt-marque);
  --bs-body-bg: var(--rt-fond);
  --bs-body-color: var(--rt-texte);
  --bs-secondary-color: var(--rt-attenue);
  --bs-border-color: var(--rt-bordure);
  --bs-font-sans-serif: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

[data-bs-theme="dark"] {
  --rt-marque: #8fa3e6;
  --rt-accent: #4cb3ea;
  --rt-accent-clair: #08b9ed;
  --rt-violet: #b884c9;
  --rt-fond: #0f1420;
  --rt-surface: #171e2d;
  --rt-bordure: #2e3a4f;
  --rt-texte: #e3e8f1;
  --rt-attenue: #9aa6bb;
  --rt-accent-doux: #13304a;
  --rt-ombre: 0 1px 2px rgba(0, 0, 0, .35);

  --bs-primary: var(--rt-accent);
  --bs-primary-rgb: 76, 179, 234;
  --bs-link-color: var(--rt-accent);
  --bs-link-color-rgb: 76, 179, 234;
  --bs-link-hover-color: #9fd6f4;
  --bs-body-bg: var(--rt-fond);
  --bs-body-color: var(--rt-texte);
  --bs-secondary-color: var(--rt-attenue);
  --bs-border-color: var(--rt-bordure);
}

body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

/* Bandeau : fin filet dégradé aux couleurs Educape, fond sobre */
.rt-bandeau { background: var(--rt-surface); border-bottom: 1px solid var(--rt-bordure); position: relative; }
.rt-bandeau::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--rt-marque), var(--rt-accent) 40%, var(--rt-accent-clair) 70%, var(--rt-violet)); }
.rt-marque { font-weight: 700; color: var(--rt-marque); letter-spacing: .01em; }
.rt-marque:hover { color: var(--rt-marque); }
.rt-marque .bi { color: var(--rt-accent); }
.rt-bandeau .nav-link { color: var(--rt-attenue); font-weight: 500; border-radius: 6px; white-space: nowrap; }
.rt-bandeau .nav-link:hover { color: var(--rt-texte); background: var(--rt-accent-doux); }
.rt-bandeau .nav-link.active { color: var(--rt-accent); background: var(--rt-accent-doux); }

.btn-primary { --bs-btn-bg: var(--rt-accent); --bs-btn-border-color: var(--rt-accent); --bs-btn-hover-bg: var(--rt-marque); --bs-btn-hover-border-color: var(--rt-marque);
  --bs-btn-active-bg: var(--rt-marque); --bs-btn-active-border-color: var(--rt-marque); --bs-btn-disabled-bg: var(--rt-accent); --bs-btn-disabled-border-color: var(--rt-accent); }
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0f1420; --bs-btn-hover-color: #0f1420; --bs-btn-active-color: #0f1420; --bs-btn-hover-bg: #9fd6f4; --bs-btn-hover-border-color: #9fd6f4; }

.rt-carte { background: var(--rt-surface); border: 1px solid var(--rt-bordure); border-radius: 10px; box-shadow: var(--rt-ombre); }
.rt-titre { font-size: 1.5rem; font-weight: 700; color: var(--rt-texte); margin-bottom: .25rem; }
.rt-sous-titre { color: var(--rt-attenue); margin-bottom: 1.25rem; }
.rt-chiffre { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--rt-marque); }
.rt-chiffre-lib { color: var(--rt-attenue); font-size: .9rem; }
a.rt-carte { display: block; text-decoration: none; color: inherit; }
a.rt-carte:hover { border-color: var(--rt-accent); }

.table { --bs-table-bg: var(--rt-surface); }
.table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--rt-attenue); font-weight: 600; }
.rt-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rt-mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9em; }

.rt-recette { background: repeating-linear-gradient(45deg, #fff3cd, #fff3cd 12px, #ffe69c 12px, #ffe69c 24px); color: #5c4400; text-align: center; font-weight: 700; font-size: .85rem; padding: .25rem; }
.rt-reponse { white-space: pre-wrap; }
.rt-connexion { max-width: 420px; margin: 8vh auto 2rem; }
.rt-pied { color: var(--rt-attenue); font-size: .85rem; }
.rt-json { font-size: .8rem; white-space: pre-wrap; word-break: break-word; margin: 0; }

:focus-visible { outline: 2px solid var(--rt-accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- Calendrier annuel du prévisionnel (types de jour : texte dans la case + couleur ; jamais la couleur seule) ---- */
.rt-annee { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 1rem; }
.rt-mois-titre { display: flex; justify-content: space-between; font-size: .95rem; font-weight: 700; margin: 0 0 .35rem; color: var(--rt-marque); }
.rt-mois-titre .rt-num { font-weight: 600; color: var(--rt-attenue); font-size: .85rem; }
.rt-cal { width: 100%; border-collapse: separate; border-spacing: 2px; table-layout: fixed; }
.rt-cal th { font-size: .7rem; font-weight: 600; color: var(--rt-attenue); text-align: center; }
.rt-cal td { height: 2.4rem; padding: 1px 2px; border-radius: 4px; vertical-align: top; font-size: .7rem; line-height: 1.1; }
.tj { --tj-fond: transparent; --tj-texte: var(--rt-texte); background: var(--tj-fond); color: var(--tj-texte); border: 1px solid transparent; }
.tj-j { display: block; color: var(--rt-attenue); font-variant-numeric: tabular-nums; }
.tj-v { display: block; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.tj-VIDE { --tj-fond: transparent; border-color: var(--rt-bordure); }
.tj-TRAV { --tj-fond: #e6eef8; --tj-texte: #1b2440; }
.tj-CP   { --tj-fond: #1f4fbf; --tj-texte: #ffffff; }
.tj-ZERO { --tj-fond: #d9f0e1; --tj-texte: #14532d; }
.tj-MAL  { --tj-fond: #3d6f99; --tj-texte: #ffffff; }
.tj-FAM, .tj-MAT, .tj-PAR { --tj-fond: #f3e8f8; --tj-texte: #5d256f; }
.tj-SS   { --tj-fond: #f1e4d9; --tj-texte: #6b3410; }
.tj-ABS  { --tj-fond: #fbe1e0; --tj-texte: #8a1c17; }
.tj-CP .tj-j, .tj-MAL .tj-j { color: rgba(255, 255, 255, .85); }
.ctx-VAC  { box-shadow: inset 0 -3px 0 #8ec3e8; }
.ctx-FER  { box-shadow: inset 0 -3px 0 #e59866; }
.ctx-FERM { box-shadow: inset 0 -3px 0 #c0392b; }
.tj-ecart { outline: 2px dashed #b7791f; outline-offset: -2px; }
.tj-hors { background: transparent; }
.tj-pastille { display: inline-block; min-width: 2rem; padding: 0 .3rem; border-radius: 4px; text-align: center; font-weight: 700; font-size: .75rem; }
[data-bs-theme="dark"] .tj-TRAV { --tj-fond: #22324b; --tj-texte: #e3e8f1; }
[data-bs-theme="dark"] .tj-ZERO { --tj-fond: #183a28; --tj-texte: #b6e6c8; }
[data-bs-theme="dark"] .tj-FAM, [data-bs-theme="dark"] .tj-MAT, [data-bs-theme="dark"] .tj-PAR { --tj-fond: #3a2546; --tj-texte: #e7cdf2; }
[data-bs-theme="dark"] .tj-SS { --tj-fond: #3d2a1d; --tj-texte: #f1d3bd; }
[data-bs-theme="dark"] .tj-ABS { --tj-fond: #4a1f1e; --tj-texte: #f7c8c5; }
.rt-semaine input[type="time"] { min-width: 6.2rem; }

/* ---- Feuille de semaine ---- */
.rt-feuille input[type="time"] { min-width: 6.2rem; }
.rt-feuille select { min-width: 11rem; }
.rt-weekend th[scope="row"] { color: var(--rt-attenue); }
.rt-ligne-ecart { box-shadow: inset 3px 0 0 var(--rt-accent); }
.rt-progression-0 { width: 0%; }
.rt-progression-1 { width: 10%; }
.rt-progression-2 { width: 20%; }
.rt-progression-3 { width: 30%; }
.rt-progression-4 { width: 40%; }
.rt-progression-5 { width: 50%; }
.rt-progression-6 { width: 60%; }
.rt-progression-7 { width: 70%; }
.rt-progression-8 { width: 80%; }
.rt-progression-9 { width: 90%; }
.rt-progression-10 { width: 100%; }

/* Mode suggestion : désigner d'un clic l'élément concerné par une suggestion */
.rt-mode-suggestion, .rt-mode-suggestion * { cursor: crosshair !important; }
.rt-vise { outline: 2px dashed var(--bs-primary) !important; outline-offset: 2px; }
.rt-bandeau-suggestion { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 2000; max-width: calc(100% - 2rem);
  padding: .6rem 1rem; border-radius: 8px; background: var(--bs-primary); color: #fff; box-shadow: 0 4px 16px rgba(0, 0, 0, .25); cursor: default !important; }
