/* ===== Apparence « Site » : même direction artistique que le site vitrine (site-vente/) =====
   Active quand <html> a les classes theme-new ET theme-site (script du <head> de index.html).
   Fond crème, cartes blanches très arrondies, noir profond, vert menthe ; titres en Urbanist, texte en Inter Tight,
   petites étiquettes en Geist Mono ; boutons en pilule ; animations douces (les cartes montent à l'ouverture d'une page,
   les éléments cliquables se soulèvent au survol). Le mode sombre est dans theme-dark.css (fabriqué par scripts/dark-css.js). */
html.theme-new.theme-site {
  --bg: #f6f6ee; --surface: #ffffff; --surface-2: #fafaf4; --text: #141713; --muted: #74786f; --line: #e8e7dc; --line-strong: #d6d5c8;
  --accent: #0b6b47; --accent-soft: #e3fbef; --accent-ink: #ffffff; --danger: #c4320a; --danger-soft: #fff1e8;
  --mint: #22e58a; --mint-hover: #1fd27f; --mint-ink: #141713;
  --warn-bg: #fff6e0; --warn: #a65c00; --ok: #0b6b47; --ok-soft: #e3fbef;
  --side: #f6f6ee; --side-2: #efeee4; --side-text: #3b3f3a; --side-muted: #9a9d93;
  --ink: #141713; --ink-2: #3b3f3a;
  --radius: 20px; --shadow: 0 1px 2px rgba(20, 23, 19, .04), 0 18px 40px -32px rgba(20, 40, 30, .28);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "Inter Tight", system-ui, "Segoe UI", sans-serif;
  --title: "Urbanist", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}
html.theme-site body { font: 14.5px/1.55 var(--font); background: var(--bg); color: var(--text); }
html.theme-site h1, html.theme-site h2, html.theme-site h3, html.theme-site h4 { font-family: var(--title); font-weight: 600; letter-spacing: -.025em; }
html.theme-site ::selection { background: var(--mint); color: var(--ink); }

/* ----- Barre latérale : crème, menu en pilules, page active en noir avec l'icône menthe ----- */
html.theme-site .sidebar { background: var(--bg); border-right: 1px solid var(--line); }
html.theme-site .side-brand .logo { filter: brightness(0); }
html.theme-site .side-sub { font: 500 10.5px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
html.theme-site .nav-label { font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--side-muted); padding: 20px 14px 8px; }
html.theme-site .nav { background: transparent; border: 0; box-shadow: none; border-radius: 999px; padding: 9px 14px; color: var(--ink-2); font-weight: 500; transition: background .25s var(--ease), color .25s, transform .25s var(--ease); }
html.theme-site .nav svg { color: var(--muted); transition: color .25s, transform .4s var(--ease); }
html.theme-site .nav:hover { background: rgba(20, 23, 19, .05); color: var(--ink); }
html.theme-site .nav:hover svg { transform: translateX(2px); }
html.theme-site .nav.on { background: var(--ink); color: #fff; font-weight: 600; }
html.theme-site .nav.on svg { color: var(--mint); }
html.theme-site .site-switch { background: rgba(20, 23, 19, .06); border-radius: 999px; }
html.theme-site .site-switch button { border-radius: 999px; }
html.theme-site .site-switch button.on { background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }

/* ----- En-tête : verre crème flou, grand titre ----- */
html.theme-site .topbar { background: rgba(246, 246, 238, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
html.theme-site .page-title h1 { font-family: var(--title); font-size: 30px; font-weight: 600; letter-spacing: -.035em; line-height: 1.05; }
html.theme-site .page-title p { color: var(--muted); font-size: 14px; }

/* ----- Boutons : pilules ; le principal en menthe avec une ombre verte ; on se soulève au survol ----- */
html.theme-site button, html.theme-site .btn { border-radius: 999px; padding: 9px 18px; font-weight: 500; color: var(--ink); border-color: var(--line-strong); background: #fff;
  transition: transform .3s var(--ease), box-shadow .3s, background .2s, border-color .2s; }
html.theme-site button:hover:not(:disabled), html.theme-site .btn:hover { transform: translateY(-1px); background: #fff; border-color: #bdbcae; box-shadow: 0 8px 20px -14px rgba(0, 0, 0, .35); }
html.theme-site button:active:not(:disabled) { transform: translateY(0) scale(.98); }
html.theme-site button.primary, html.theme-site .btn.primary { background: var(--mint); border-color: var(--mint); color: var(--ink); font-weight: 600; box-shadow: 0 10px 26px -12px rgba(34, 229, 138, .75); }
html.theme-site button.primary:hover:not(:disabled), html.theme-site .btn.primary:hover { background: var(--mint-hover); border-color: var(--mint-hover); box-shadow: 0 14px 30px -12px rgba(34, 229, 138, .85); }
html.theme-site button.ghost { background: transparent; border-color: transparent; box-shadow: none; }
html.theme-site button.ghost:hover:not(:disabled) { background: rgba(20, 23, 19, .05); border-color: transparent; box-shadow: none; }
html.theme-site button.danger { color: var(--danger); border-color: #f3c9b5; }
html.theme-site .icon-btn { border-radius: 999px; border: 0; background: transparent; box-shadow: none; }
html.theme-site .icon-btn:hover:not(:disabled) { background: rgba(20, 23, 19, .06); box-shadow: none; }
html.theme-site .dark-btn, html.theme-site .bell-btn { border-radius: 999px; }
html.theme-site .nav, html.theme-site .nav:hover:not(:disabled) { transform: none; box-shadow: none; border-color: transparent; }
html.theme-site .nav:hover:not(.on) { background: rgba(20, 23, 19, .05); }
html.theme-site .nav.on:hover { background: var(--ink); }

/* ----- Champs ----- */
html.theme-site input, html.theme-site select, html.theme-site textarea { border-radius: 12px; border-color: var(--line-strong); background: #fff; font-family: var(--font); box-shadow: none; transition: border-color .2s, box-shadow .2s; }
html.theme-site input:focus, html.theme-site select:focus, html.theme-site textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ----- Cartes : blanches, très arrondies, ombre douce ----- */
html.theme-site .card, html.theme-site .kpi, html.theme-site .daycard { border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
html.theme-site .card h3 { font-family: var(--title); font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
html.theme-site .kpi-label, html.theme-site .stats th, html.theme-site .list th { font: 500 10.5px/1.3 var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
html.theme-site .kpi-value { font-family: var(--title); font-weight: 600; letter-spacing: -.04em; }
/* Éléments cliquables (raccourcis, cartes RH, cartes de stats…) : ils se soulèvent au survol */
html.theme-site .q, html.theme-site .hrx-card, html.theme-site .kpi[data-go], html.theme-site .znow-person, html.theme-site .pay-steps li, html.theme-site .ag-item {
  transition: transform .45s var(--ease), box-shadow .45s var(--ease), border-color .3s; }
html.theme-site .q:hover, html.theme-site .hrx-card:hover, html.theme-site .kpi[data-go]:hover { transform: translateY(-4px); box-shadow: 0 30px 50px -36px rgba(0, 0, 0, .35); border-color: #d9d8cb; }
html.theme-site .hrx-card { border-radius: var(--radius); }

/* ----- Sélecteurs (mois, vues, onglets) : pilules ----- */
html.theme-site .monthnav, html.theme-site .weeknav { border-radius: 999px; background: #fff; border: 1px solid var(--line-strong); box-shadow: none; }
html.theme-site .monthnav h2 { font-family: var(--title); font-weight: 600; }
html.theme-site .viewswitch, html.theme-site .me-scope { border-radius: 999px; background: rgba(20, 23, 19, .05); border: 0; padding: 3px; }
html.theme-site .viewswitch button, html.theme-site .me-scope button { border-radius: 999px; transition: background .3s var(--ease), color .2s; }
html.theme-site .viewswitch button:hover:not(:disabled) { transform: none; box-shadow: none; background: rgba(255, 255, 255, .6); }
html.theme-site .viewswitch button.on { background: var(--ink); color: #fff; box-shadow: none; }

/* ----- Étiquettes, pastilles, petits textes en Geist Mono ----- */
html.theme-site .chip, html.theme-site .badge, html.theme-site .tag { border-radius: 999px; }
html.theme-site .card-head .chip, html.theme-site .pub-bar .chip { font: 500 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 6px 10px; }
html.theme-site .hint, html.theme-site .muted.small { font-size: 12.5px; }

/* ----- Horaire ----- */
html.theme-site #tableView { border-radius: var(--radius); }
html.theme-site #grid thead th { background: #fff; }
html.theme-site #grid thead th .d { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; }
html.theme-site #grid thead th.today .n { background: var(--ink); color: var(--mint); }
html.theme-site #grid th.name, html.theme-site #grid td.name { background: #fff; }
html.theme-site #grid td.cell span { border-radius: 10px; transition: transform .3s var(--ease); }
html.theme-site #grid td.cell:hover span { transform: scale(1.04); }
html.theme-site #grid td.cell:hover { box-shadow: inset 0 0 0 2px var(--mint); }
html.theme-site #grid tr.chef td { background: var(--surface-2); }
html.theme-site .av { font-family: var(--title); font-weight: 700; }

/* ----- Petits messages, fenêtres, menu d'une case ----- */
html.theme-site .toast { background: var(--ink); color: #fff; border-radius: 999px; padding: 12px 20px 12px 16px; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .45); }
html.theme-site .toast::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(34, 229, 138, .2); margin-right: 10px; vertical-align: middle; }
html.theme-site .toast:not([hidden]) { animation: siteToast .5s var(--ease) both; }
@keyframes siteToast { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } }
html.theme-site dialog { border-radius: 24px; border: 1px solid var(--line); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .35); }
html.theme-site dialog[open] { animation: siteDialog .45s var(--ease) both; }
@keyframes siteDialog { from { opacity: 0; transform: translateY(18px) scale(.97); } }
html.theme-site .popover { border-radius: 16px; box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .35); animation: siteDialog .3s var(--ease) both; }
html.theme-site .popover button { border-radius: 10px; }

/* ----- Connexion ----- */
html.theme-site .login { background: radial-gradient(600px 380px at 78% 20%, rgba(34, 229, 138, .18), transparent 70%), radial-gradient(500px 300px at 10% 70%, rgba(34, 229, 138, .08), transparent 70%), var(--bg); }
html.theme-site .login-card { border-radius: 26px; box-shadow: 0 50px 100px -40px rgba(20, 40, 30, .35); animation: siteDialog .7s var(--ease) both; }
html.theme-site .login-card h2 { font-family: var(--title); font-size: 26px; letter-spacing: -.03em; }

/* ----- Animations à l'ouverture d'une page : le titre puis les cartes montent l'une après l'autre ----- */
html.theme-site .page:not([hidden]) > * { animation: siteRise .7s var(--ease) both; }
html.theme-site .page:not([hidden]) > *:nth-child(2) { animation-delay: .06s; }
html.theme-site .page:not([hidden]) > *:nth-child(3) { animation-delay: .12s; }
html.theme-site .page:not([hidden]) > *:nth-child(4) { animation-delay: .18s; }
html.theme-site .page:not([hidden]) > *:nth-child(n+5) { animation-delay: .24s; }
html.theme-site .page-title h1 { animation: siteRise .7s var(--ease) both; }
html.theme-site .page-title p { animation: siteRise .7s .08s var(--ease) both; }
@keyframes siteRise { from { opacity: 0; transform: translateY(18px); } }
/* Pastille « en direct » (créneau en cours, aujourd'hui) qui respire, comme sur le site */
html.theme-site .me-path li.now { animation: sitePulse 2.4s ease-in-out infinite; }
@keyframes sitePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(34, 229, 138, .45); } 50% { box-shadow: 0 0 0 8px rgba(34, 229, 138, 0); } }

/* Moins d'animations si l'appareil le demande */
@media (prefers-reduced-motion: reduce) {
  html.theme-site *, html.theme-site *::before, html.theme-site *::after { animation: none !important; transition: none !important; }
}
/* Impression : sobre */
@media print { html.theme-site .page > * { animation: none !important; } }

/* ===== Téléphone ===== */
@media (max-width: 700px) {
  /* Boutons ronds de l'en-tête (lune, cloche) : l'icône prend toute la place */
  html.theme-site .dark-btn, html.theme-site .bell-btn { padding: 0; width: 40px; height: 40px; flex: 0 0 40px; }
  html.theme-site .page-title h1 { font-size: 26px; }
  /* Onglets (Horaire fixe, Zones, RH…) : une seule ligne qui défile avec le doigt, jamais de texte coupé */
  html.theme-site .viewswitch { display: flex; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  html.theme-site .viewswitch::-webkit-scrollbar { display: none; }
  html.theme-site .viewswitch button { flex: 0 0 auto; white-space: nowrap; padding: 8px 14px; }
  /* Horaire, vue Semaine : les 7 jours tiennent dans l'écran (prénom, horaire court, codes courts) */
  html.theme-site #tableView { overflow-x: hidden; }
  html.theme-site #grid.week { table-layout: fixed; width: 100%; }
  html.theme-site #grid.week th.name, html.theme-site #grid.week td.name { width: 64px; min-width: 0; padding: 6px 4px 6px 8px; }
  html.theme-site #grid.week td.name .namebox > span { font-size: 12px; line-height: 1.2; word-break: break-word; }
  html.theme-site #grid.week td.name small, html.theme-site #grid .edit-emp, html.theme-site #grid .edit-chef { display: none !important; }
  html.theme-site #grid.week thead th { padding: 6px 0; font-size: 11px; }
  html.theme-site #grid.week thead th .d { display: block; font-size: 9px; }
  html.theme-site #grid.week thead th .n { font-size: 12px; }
  html.theme-site #grid.week thead th .o, html.theme-site #grid.week thead th .f, html.theme-site #grid.week thead th .m { display: block; font-size: 8.5px; }
  html.theme-site #grid.week td.cell { height: 40px; padding: 0; }
  html.theme-site #grid.week td.cell span { margin: 2px; padding: 6px 0; text-align: center; border-radius: 8px; }
  html.theme-site #grid.week td.cell span .t { font-size: 10.5px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: clip; }
  html.theme-site #grid.week td.cell span .dur { display: none; }
  html.theme-site #grid.week td.cell span.c-REPOS, html.theme-site #grid.week td.cell span.c-WE, html.theme-site #grid.week td.cell span.c-NONE { font-size: 10.5px; }
  html.theme-site #grid.week td.cell:hover span { transform: none; }
  html.theme-site #grid.week tr.sum td { font-size: 10.5px; padding: 6px 0; }
  html.theme-site #grid tr.addrow { display: none; }
  html.theme-site #grid.week .add-emp { font-size: 11px; padding: 6px 8px; white-space: normal; }
  html.theme-site .weeknav span { font-size: 12.5px; }
  /* Tableaux des zones et de l'horaire fixe : première colonne étroite et collée à gauche pendant qu'on fait défiler */
  html.theme-site .ztable th.name, html.theme-site .ztable td.name { min-width: 84px; width: 84px; padding: 6px 8px; font-size: 12px; position: sticky; left: 0; z-index: 2; background: var(--surface); }
  html.theme-site .ztable td.zcell, html.theme-site .ztable th:not(.name) { min-width: 78px; }
}
