/* ===== Thème « Nouveau » (épuré, inspiré de Shyfter) =====
   Actif quand <html> a la classe theme-new (Paramètres › Apparence ; le thème « Classique » reste disponible).
   Blanc et aéré : barre latérale blanche, traits gris très légers, couleurs douces, boutons principaux vert menthe sans
   effet. Horaire en vue « Semaine » : grandes cases avec les heures complètes et la durée. */
html.theme-new {
  --bg: #f7f8fa; --surface: #ffffff; --surface-2: #f9fafb; --text: #101828; --muted: #667085; --line: #eaecf0; --line-strong: #d0d5dd;
  --accent: #079455; --accent-soft: #ecfdf3; --accent-ink: #ffffff; --danger: #d92d20; --danger-soft: #fef3f2;
  --mint: #22ef84; --mint-hover: #1ad975; --mint-ink: #053321;
  --warn-bg: #fffaeb; --warn: #b54708; --ok: #067647; --ok-soft: #ecfdf3;
  --side: #ffffff; --side-2: #f9fafb; --side-text: #344054; --side-muted: #98a2b3;
  /* Couleurs des horaires : fond très clair, texte plus foncé de la même teinte */
  --s8: #eef4ff; --s8-ink: #3538cd; --s10: #ecfdf3; --s10-ink: #067647; --s12: #fff6ed; --s12-ink: #c4320a;
  --foot: #f4f3ff; --foot-ink: #5925dc; --chef: #f0f9ff; --rtt: #f0fdf9; --rtt-ink: #107569;
  --off: #f2f4f7; --off-ink: #667085; --we: #f2f4f7; --conge: #fdf2fa; --conge-ink: #c11574; --closed: #f9fafb;
  --radius: 12px; --shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
html.theme-new body { font: 14px/1.5 Inter, system-ui, "Segoe UI", sans-serif; color: var(--text); }
html.theme-new h1, html.theme-new h2, html.theme-new h3, html.theme-new h4 { letter-spacing: -.015em; }

/* ----- Boutons et champs ----- */
html.theme-new button, html.theme-new .btn { border-radius: 8px; border-color: var(--line-strong); padding: 8px 14px; font-weight: 600; font-size: 13.5px; color: #344054;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05); transition: background .12s, border-color .12s; }
html.theme-new button:hover, html.theme-new .btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
html.theme-new button.primary, html.theme-new .btn.primary { background: var(--mint); border-color: var(--mint); color: var(--mint-ink); }
html.theme-new button.primary:hover, html.theme-new .btn.primary:hover { background: var(--mint-hover); border-color: var(--mint-hover); }
html.theme-new button.ghost { box-shadow: none; border-color: transparent; background: transparent; }
html.theme-new button.ghost:hover { background: var(--surface-2); }
html.theme-new button.danger { color: var(--danger); border-color: #fecdca; }
html.theme-new input, html.theme-new select, html.theme-new textarea { border-radius: 8px; border-color: var(--line-strong); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
html.theme-new input:focus, html.theme-new select:focus, html.theme-new textarea:focus { outline: 0; border-color: #75e0a7; box-shadow: 0 0 0 4px #dcfae6; }
html.theme-new input[type=checkbox] { accent-color: var(--accent); box-shadow: none; }

/* ----- Barre latérale blanche ----- */
html.theme-new .sidebar { background: #fff; border-right: 1px solid var(--line); color: var(--side-text); padding: 20px 14px; }
html.theme-new .side-brand { border-bottom: 0; padding: 4px 10px 18px; }
html.theme-new .side-brand .logo { filter: brightness(0) saturate(100%) invert(10%) sepia(25%) saturate(1800%) hue-rotate(195deg); height: 22px; }
html.theme-new .side-sub { color: var(--muted); }
html.theme-new .nav-label { color: var(--side-muted); font-size: 11px; letter-spacing: .06em; padding: 18px 12px 6px; }
html.theme-new .nav { color: #344054; border-radius: 8px; padding: 8px 12px; font-weight: 500; box-shadow: none; }
html.theme-new .nav svg { color: #667085; stroke-width: 1.7; }
html.theme-new .nav:hover { background: var(--surface-2); color: var(--text); }
html.theme-new .nav.on { background: var(--accent-soft); color: var(--ok); font-weight: 600; box-shadow: none; }
html.theme-new .nav.on svg { color: var(--ok); }
html.theme-new .side-foot { border-top: 1px solid var(--line); }
html.theme-new .menu-btn { box-shadow: none; }

/* ----- En-tête, cartes, onglets ----- */
html.theme-new .topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 20px 32px; }
html.theme-new .page-title h1 { font-size: 22px; font-weight: 600; }
html.theme-new .page-title p { color: var(--muted); }
html.theme-new .page { padding: 28px 32px 56px; gap: 20px; }
html.theme-new .monthnav { background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; padding: 2px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
html.theme-new .monthnav h2 { font-size: 14px; font-weight: 600; }
html.theme-new .icon-btn { box-shadow: none; border: 0; border-radius: 6px; color: #475467; }
html.theme-new .icon-btn:hover { background: var(--surface-2); }
html.theme-new .card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
html.theme-new .card h3 { font-size: 15px; font-weight: 600; }
html.theme-new .viewswitch { background: #f2f4f7; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
html.theme-new .viewswitch button { border: 0; box-shadow: none; border-radius: 7px; color: var(--muted); padding: 6px 14px; }
html.theme-new .viewswitch button.on { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(16, 24, 40, .1); }
html.theme-new .chip, html.theme-new .badge, html.theme-new .tag { border-radius: 999px; font-weight: 500; }
html.theme-new .kpi { border-radius: var(--radius); box-shadow: var(--shadow); }
html.theme-new .kpi::before { display: none; }
html.theme-new .kpi-label { color: var(--muted); font-weight: 500; }
html.theme-new .kpi-value { font-weight: 600; letter-spacing: -.02em; }
html.theme-new dialog { border-radius: 16px; box-shadow: 0 20px 48px rgba(16, 24, 40, .18); }
html.theme-new .legend { color: var(--muted); }
html.theme-new .alert-chip { border-radius: 999px; }

/* ----- Horaire ----- */
html.theme-new .planning-bar { gap: 12px; }
html.theme-new .weeknav { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; padding: 2px 4px; box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
html.theme-new .weeknav span { font-weight: 600; font-size: 14px; padding: 0 8px; min-width: 210px; text-align: center; }
html.theme-new .weeknav .ghost { font-weight: 500; color: var(--ok); }
html.theme-new #tableView { border-radius: var(--radius); }
html.theme-new #grid { font-size: 12px; }
html.theme-new #grid th, html.theme-new #grid td { border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
html.theme-new #grid thead th { background: #fff; color: var(--text); font-weight: 600; padding: 10px 4px; }
html.theme-new #grid thead th .d { display: inline; color: var(--muted); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; }
html.theme-new #grid thead th.today .n { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 50%; background: var(--mint); color: var(--mint-ink); }
html.theme-new #grid th.name, html.theme-new #grid td.name { background: #fff; border-left: 0; }
html.theme-new #grid td.closed, html.theme-new #grid th.closed { background: var(--surface-2); }
html.theme-new #grid td.outside { opacity: .45; }
html.theme-new #grid td.cell:hover { box-shadow: inset 0 0 0 2px #abefc6; }
html.theme-new #grid td.cell span { border-radius: 6px; font-weight: 600; line-height: 1.2; }
html.theme-new #grid td.cell span .t { font-weight: 600; }
html.theme-new #grid tr.sep td { border-top: 1px solid var(--line-strong); }
html.theme-new #grid tr.chef td { background: #fcfcfd; }
html.theme-new #grid tr.student td.name { color: var(--muted); }
html.theme-new #grid tr.sum td { background: var(--surface-2); color: var(--muted); }
html.theme-new #grid tr.sum td.bad { background: var(--danger-soft); color: var(--danger); }
html.theme-new #grid tr.addrow td { background: #fff; }
html.theme-new #grid .add-emp { border-style: dashed; box-shadow: none; color: var(--muted); }
/* Nom : avatar à initiales de couleur douce + nom + heures */
html.theme-new .namebox { display: flex; align-items: center; gap: 10px; }
html.theme-new .namebox > span { min-width: 0; flex: 1; font-weight: 600; font-size: 13px; }
html.theme-new #grid td.name small { font-weight: 400; color: var(--muted); }
html.theme-new .av { display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%; font-size: 11.5px; font-weight: 600; font-style: normal; }
html.theme-new .av.av0 { background: #eef4ff; color: #3538cd; } html.theme-new .av.av1 { background: #ecfdf3; color: #067647; }
html.theme-new .av.av2 { background: #fff6ed; color: #c4320a; } html.theme-new .av.av3 { background: #fdf2fa; color: #c11574; }
html.theme-new .av.av4 { background: #f4f3ff; color: #5925dc; } html.theme-new .av.av5 { background: #f0f9ff; color: #026aa2; }
html.theme-new .hrs { display: block !important; font-size: 11.5px; }
html.theme-new #grid .edit-emp, html.theme-new #grid .edit-chef { box-shadow: none; }
/* Vue Mois : cases compactes */
html.theme-new #grid:not(.week) td.cell { height: 38px; min-width: 50px; }
html.theme-new #grid:not(.week) td.cell span { margin: 4px 3px; padding: 5px 2px; }
html.theme-new #grid:not(.week) td.cell span .dur { display: none; }
/* Vue Semaine : grandes cases lisibles, heures complètes et durée */
html.theme-new #grid.week { width: 100%; table-layout: fixed; }
html.theme-new #grid.week th.name, html.theme-new #grid.week td.name { width: 200px; min-width: 200px; padding: 10px 14px; }
html.theme-new #grid.week thead th { padding: 12px 6px; font-size: 13px; }
html.theme-new #grid.week td.cell { height: 64px; min-width: 0; vertical-align: middle; }
html.theme-new #grid.week thead th:not(.name) { min-width: 0; }
html.theme-new #grid.week td.cell span { margin: 6px; padding: 8px 10px; text-align: left; border-radius: 8px; }
html.theme-new #grid.week td.cell span .t { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html.theme-new #grid.week td.cell span .dur { display: block; font-size: 11.5px; font-weight: 500; opacity: .75; margin-top: 2px; }
html.theme-new #grid.week td.cell span.c-REPOS, html.theme-new #grid.week td.cell span.c-WE, html.theme-new #grid.week td.cell span.c-NONE { text-align: center; background: transparent; color: var(--muted); font-weight: 500; }
html.theme-new #grid.week tr.sum td { font-size: 12.5px; padding: 8px; }
html.theme-new #grid.week td.cell.lock::after { top: 6px; right: 8px; font-size: 9px; }

/* ----- Autres pages : mêmes arrondis et accents doux ----- */
html.theme-new .daycard { border-radius: var(--radius); box-shadow: var(--shadow); }
html.theme-new .q, html.theme-new .hr-person, html.theme-new .theme-pick button { border-radius: 10px; }
html.theme-new .log-types button, html.theme-new .zs-motifs button { border-radius: 10px; box-shadow: none; }
html.theme-new .log-types button.on, html.theme-new .zs-motifs button.on { background: var(--accent-soft); color: var(--ok); border-color: #75e0a7; box-shadow: 0 0 0 1px #75e0a7 inset; }
html.theme-new .znow-card { border-radius: 14px; }
html.theme-new .znow-person { border-radius: 10px; box-shadow: none; }
html.theme-new .ag-form { border-color: #75e0a7; box-shadow: 0 0 0 4px #dcfae6; }
html.theme-new .ag-status.ok { background: var(--ok-soft); color: var(--ok); }
html.theme-new .ag-date, html.theme-new .ag-day.today { color: var(--ok); }
html.theme-new .ag-more summary { border-radius: 8px; }
html.theme-new .ag-preview { background: var(--surface-2); border-color: var(--line-strong); }
html.theme-new .stats th, html.theme-new .list th { background: var(--surface-2); color: var(--muted); font-weight: 500; }
html.theme-new #dutyFoot tr.next td, html.theme-new #dutySunday tr.next td { background: var(--accent-soft); }
html.theme-new .badge.foot { background: var(--accent-soft); color: var(--ok); }
html.theme-new .inv-store { border-top-color: var(--line); }

/* ----- Choix de l'apparence (Paramètres) : visible dans les deux thèmes ----- */
.theme-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.theme-pick button { flex-direction: column; align-items: stretch; text-align: left; gap: 8px; padding: 12px; border-radius: 12px; }
.theme-pick button.on { box-shadow: 0 0 0 2px var(--accent) inset; }
.theme-pick .prev { height: 64px; border-radius: 8px; display: grid; grid-template-columns: 26% 1fr; overflow: hidden; border: 1px solid var(--line); }
.theme-pick .prev i { display: block; }
.theme-pick .prev i:last-child { background: #f7f8fa linear-gradient(90deg, transparent 10%, #eef4ff 10% 30%, transparent 30% 36%, #ecfdf3 36% 56%, transparent 56% 62%, #fff6ed 62% 82%, transparent 82%) no-repeat 0 22px / 100% 18px; }
.theme-pick .p-new i:first-child { background: #fff; border-right: 1px solid #eaecf0; }
.theme-pick .p-classic i:first-child { background: #161b33; }
/* Vue Semaine (barre de navigation) : aussi utilisable dans le thème Classique */
.weeknav { display: inline-flex; align-items: center; gap: 4px; }
.weeknav span { font-weight: 600; padding: 0 6px; }

/* ----- Téléphone ----- */
@media (max-width: 700px) {
  html.theme-new .topbar { padding: 12px 16px; }
  /* Titre de la page en entier sur la 1re ligne, mois et boutons en dessous */
  html.theme-new .page-title { flex: 1 1 200px; }
  html.theme-new .topbar .monthnav { flex: 1 1 auto; }
  html.theme-new .page { padding: 16px 14px 40px; }
  html.theme-new #grid .av, html.theme-new #grid .hrs { display: none !important; }
  html.theme-new #grid:not(.week) td.cell { height: auto; min-width: 0; }
  html.theme-new #grid.week { table-layout: auto; }
  html.theme-new #grid.week th.name, html.theme-new #grid.week td.name { width: 84px; min-width: 84px; padding: 8px; }
  html.theme-new #grid.week td.cell { min-width: 64px; height: 54px; }
  html.theme-new #grid.week td.cell span { margin: 4px; padding: 6px; }
  html.theme-new #grid.week td.cell span .t { font-size: 11px; white-space: normal; }
  html.theme-new .weeknav { width: 100%; justify-content: space-between; }
  html.theme-new .weeknav span { min-width: 0; font-size: 13px; }
}
/* Menu de gauche en groupes (Planning, Terrain, Absences, Équipe, Gestion) : un peu plus serré pour tout voir sans défiler */
html.theme-new .sidebar { padding: 16px 12px; }
html.theme-new .side-brand { padding: 4px 10px 12px; }
html.theme-new .nav { padding: 7px 12px; }
html.theme-new .nav-label { padding: 12px 12px 3px; font-size: 10.5px; }
html.theme-new .side-foot { padding-top: 8px; }
