/* ============================================================
   BADGEUSE L'IMPRIMEUR — Charte sombre (fond noir, accent or,
   dégradé holographique). Mêmes noms de classes que l'ancienne
   feuille : le HTML des pages PHP n'a pas besoin de changer.
   ============================================================ */

:root {
  /* Marque L'Imprimeur — noirs profonds */
  --noir: #050506;
  --surface: #0e0e10;
  --surface-2: #161619;
  --surface-3: #1f1f23;
  --blanc: #F4F4F4;
  --gris: #9A9AA0;
  --gris-fonce: #6f6f76;
  --or: #C9A86A;
  --or-clair: #e0c690;

  /* Compat : anciens noms de variables encore utilisés en inline */
  --white: var(--surface);      /* ancien "fond blanc" -> surface sombre */
  --black: var(--blanc);        /* ancien "texte noir" -> texte clair */
  --gray-light: var(--surface-2);
  --gray-medium: #3a3a40;
  --gray-dark: var(--gris);

  /* États (adoucis pour fond sombre) */
  --success: #64d18a;
  --success-bg: rgba(100, 209, 138, 0.12);
  --warning: #e6b450;
  --warning-bg: rgba(230, 180, 80, 0.12);
  --error: #e86a6a;
  --error-bg: rgba(232, 106, 106, 0.12);

  /* Dégradé holographique (rose → lavande → bleu → menthe → vert) */
  --holo: linear-gradient(90deg, #F4C6D8 0%, #CBB6E8 25%, #A9C8F0 50%, #A8E6CC 75%, #D9EBB0 100%);

  /* Même police que le PDF (Helvetica) */
  --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --space-xs: 0.25rem; --space-sm: 0.5rem; --space-md: 1rem;
  --space-lg: 1.5rem;  --space-xl: 2rem;   --space-xxl: 3rem;

  --border-thin: 1px solid rgba(255,255,255,0.10);
  --border-thick: 1px solid rgba(255,255,255,0.16);
  --border-light: 1px solid rgba(255,255,255,0.07);
  --radius: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }

body {
  font-family: var(--font-family);
  font-size: 14px;
  line-height: 1.6;
  color: var(--blanc);
  background: var(--noir);
  -webkit-font-smoothing: antialiased;
}

/* === Layout === */
.container { max-width: 1200px; margin: 0 auto; padding: var(--space-lg); }

main {
  background: var(--surface);
  border: var(--border-thin);
  border-radius: var(--radius);
  overflow: hidden;
}

/* === Header === */
header {
  position: relative;
  background: var(--surface);
  color: var(--blanc);
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: var(--border-thin);
}
header::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--holo);
}
header h1 { font-size: 1.4rem; font-weight: 800; color: var(--blanc); letter-spacing: 0.3px; }
header .nav-links { display: flex; gap: var(--space-sm); align-items: center; flex-wrap: wrap; }
header a {
  color: var(--blanc);
  text-decoration: none;
  padding: var(--space-sm) var(--space-md);
  border: var(--border-thin);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: all 0.15s ease;
}
header a:hover { background: var(--surface-2); border-color: var(--or); color: var(--or); }

/* === Boutons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  font-size: 14px; font-weight: 700; line-height: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  min-height: 44px;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--or); color: var(--noir); border-color: var(--or); }
.btn-primary:hover:not(:disabled) { background: var(--or-clair); border-color: var(--or-clair); }

.btn-secondary { background: transparent; color: var(--blanc); border-color: rgba(255,255,255,0.18); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--or); color: var(--or); }

.btn-success { background: var(--success); color: var(--noir); border-color: var(--success); }
.btn-success:hover:not(:disabled) { filter: brightness(1.1); }

.btn-warning { background: var(--warning); color: var(--noir); border-color: var(--warning); }
.btn-warning:hover:not(:disabled) { filter: brightness(1.1); }

.btn-error { background: var(--error); color: var(--noir); border-color: var(--error); }
.btn-error:hover:not(:disabled) { filter: brightness(1.1); }

/* Bouton vedette (dégradé holo) — optionnel via .btn-holo */
.btn-holo { background: var(--holo); color: var(--noir); border: none; }
.btn-holo:hover:not(:disabled) { filter: brightness(1.05); }

/* === Formulaires === */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-md);
  margin: var(--space-lg) 0;
}
input, select, textarea {
  width: 100%;
  padding: var(--space-md);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background: var(--surface-2);
  color: var(--blanc);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--or);
  box-shadow: 0 0 0 3px rgba(201,168,106,0.18);
}
input::placeholder { color: var(--gris-fonce); }
select option { background: var(--surface-2); color: var(--blanc); }
label { display: block; margin-bottom: var(--space-sm); font-weight: 700; color: var(--gris); font-size: 13px; }

/* === Cartes stats === */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
}
.stat-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  padding: var(--space-xl);
  border: var(--border-thin);
  border-radius: var(--radius);
  text-align: center;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--holo);
  opacity: .9;
}
.stat-card .number {
  font-size: 2.6rem; font-weight: 800; line-height: 1;
  color: var(--or); margin-bottom: var(--space-sm);
  font-family: var(--font-mono);
}
.stat-card .label {
  font-size: 12px; font-weight: 700; color: var(--gris);
  text-transform: uppercase; letter-spacing: 1px;
}

/* === Onglets === */
.tabs { display: flex; border-bottom: var(--border-thin); background: var(--surface-2); flex-wrap: wrap; }
.tab-btn {
  background: transparent; border: none;
  border-right: var(--border-light);
  padding: var(--space-md) var(--space-lg);
  font-weight: 700; color: var(--gris); cursor: pointer;
  transition: all 0.15s ease;
}
.tab-btn:hover { background: var(--surface-3); color: var(--blanc); }
.tab-btn.active { background: var(--surface); color: var(--or); box-shadow: inset 0 -2px 0 var(--or); }

.tab-content { display: none; padding: var(--space-xl); }
.tab-content.active { display: block; }
.tab-content h2 {
  font-size: 1.4rem; font-weight: 800; color: var(--blanc);
  margin-bottom: var(--space-lg); border-bottom: var(--border-thin); padding-bottom: var(--space-md);
}
.tab-content h3 { font-size: 1.2rem; font-weight: 700; color: var(--blanc); margin: var(--space-lg) 0 var(--space-md) 0; }

/* === Tableaux === */
table {
  width: 100%; border-collapse: collapse;
  background: var(--surface);
  border: var(--border-thin);
  border-radius: var(--radius);
  overflow: hidden;
  margin: var(--space-lg) 0;
}
thead { background: var(--surface-2); }
th {
  padding: var(--space-md) var(--space-lg);
  text-align: left; font-weight: 700; font-size: 12px;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--or);
  border-right: var(--border-light);
}
th:last-child { border-right: none; }
td {
  padding: var(--space-md) var(--space-lg);
  border-bottom: var(--border-light);
  border-right: var(--border-light);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--blanc);
}
td:last-child { border-right: none; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
tfoot { background: var(--surface-2); font-weight: 700; border-top: var(--border-thick); }
tfoot td { color: var(--or); font-weight: 700; }

/* === Messages === */
.error, .success, .warning {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-sm);
  font-weight: 600;
  margin: var(--space-md) 0;
  border: 1px solid;
}
.error   { color: var(--error);   background: var(--error-bg);   border-color: var(--error); }
.success { color: var(--success); background: var(--success-bg); border-color: var(--success); }
.warning { color: var(--warning); background: var(--warning-bg); border-color: var(--warning); }

/* === Contrôles / pagination === */
.controls { margin: var(--space-xl) 0; display: flex; flex-direction: column; gap: var(--space-lg); align-items: center; }
.pagination {
  display: flex; align-items: center; justify-content: center; gap: var(--space-md);
  margin: var(--space-lg) 0; padding: var(--space-md);
  background: var(--surface-2); border: var(--border-thin); border-radius: var(--radius);
}

/* === Responsive === */
@media (max-width: 768px) {
  .container { padding: var(--space-md); }
  header { flex-direction: column; gap: var(--space-md); text-align: center; }
  .tabs { flex-wrap: wrap; }
  .tab-content { padding: var(--space-lg) var(--space-md); }
  .stats-container { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  table { font-size: 12px; }
  th, td { padding: var(--space-sm); }
}

/* === Animations === */
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.fade-in { animation: fadeIn 0.25s ease; }

/* === Utilitaires === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.hidden { display: none; }
.block { display: block; }

/* === Classes badgeuse === */
.employee-code-input {
  max-width: 320px; margin: 0 auto; text-align: center;
  font-family: var(--font-mono); font-size: 1.6rem; font-weight: 700;
  letter-spacing: 4px; background: var(--surface-2);
  border: 2px solid var(--or); color: var(--blanc);
}
.admin-button {
  background: transparent; color: var(--blanc);
  padding: var(--space-sm) var(--space-md);
  border: var(--border-thin); border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 700; transition: all 0.15s ease;
}
.admin-button:hover { background: var(--surface-2); border-color: var(--or); color: var(--or); }
.logout {
  background: transparent; color: var(--error);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--error); border-radius: var(--radius-sm);
  text-decoration: none; font-weight: 700; transition: all 0.15s ease;
}
.logout:hover { background: var(--error); color: var(--noir); }

/* === Statuts === */
.status-active   { color: var(--success); font-weight: 600; }
.status-inactive { color: var(--error);   font-weight: 600; }
.status-warning  { color: var(--warning); font-weight: 600; }

/* === Tables data === */
.table-container { overflow-x: auto; margin: var(--space-lg) 0; }
.data-table { width: 100%; border-collapse: collapse; border: var(--border-thin); border-radius: var(--radius); overflow: hidden; }
.data-table th, .data-table td { padding: var(--space-sm) var(--space-md); text-align: left; border: var(--border-light); }
.data-table th { background: var(--surface-2); color: var(--or); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }
.data-table tr:nth-child(even) { background: rgba(255,255,255,0.02); }
.data-table tr:hover { background: var(--surface-2); }
.data-table code { background: var(--surface-2); padding: var(--space-xs) var(--space-sm); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 0.9rem; color: var(--or-clair); }

/* Barre d'accent holo réutilisable */
.holo-bar { height: 4px; background: var(--holo); border-radius: 2px; }

/* === Logo de marque =========================================== */
/* Les "barres" holo, colorées via masque à partir du SVG blanc.   */
.bars-holo {
  background: var(--holo);
  -webkit-mask: url('/assets/marque_barres.svg') center / contain no-repeat;
  mask: url('/assets/marque_barres.svg') center / contain no-repeat;
}

/* Petites barres holo devant chaque titre de page (toutes les pages). */
header h1 { display: inline-flex; align-items: center; gap: 12px; }
header h1::before {
  content: '';
  width: 26px; height: 28px; flex: 0 0 auto;
  background: var(--holo);
  -webkit-mask: url('/assets/marque_barres.svg') center / contain no-repeat;
  mask: url('/assets/marque_barres.svg') center / contain no-repeat;
}

/* Bloc logo complet (page d'accueil / connexion), façon totem. */
.brand-lockup { text-align: center; padding: var(--space-xxl) 0 var(--space-lg); }
.brand-lockup .bars {
  width: 78px; height: 82px; margin: 0 auto var(--space-lg);
  background: var(--holo);
  -webkit-mask: url('/assets/marque_barres.svg') center / contain no-repeat;
  mask: url('/assets/marque_barres.svg') center / contain no-repeat;
}
.brand-lockup .wordmark { width: 240px; max-width: 74%; height: auto; display: block; margin: 0 auto; }
.brand-lockup .divider { width: 170px; height: 2px; background: var(--holo); border-radius: 2px; margin: var(--space-lg) auto var(--space-sm); opacity: .9; }
.brand-lockup .tagline {
  color: var(--gris); letter-spacing: 4px; font-size: 11px; font-weight: 800;
  text-transform: uppercase; margin-top: 0;
}


/* ============================================================
   ÉCRAN TABLETTE — POINTAGE (employee.php)
   ============================================================ */
.ico {
  width: 1.15em; height: 1.15em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.btn-sm { min-height: 36px; padding: 8px 14px; font-size: 13px; }

/* En-tête : titre | horloge | navigation */
.kiosk-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--space-md); }
.kiosk-header .nav-links { justify-self: end; }
.kiosk-header a { font-size: 13px; }
.kiosk-clock { text-align: center; line-height: 1.15; }
#clock-time {
  display: block; font-size: 1.7rem; font-weight: 800; letter-spacing: 1px;
  font-variant-numeric: tabular-nums; color: var(--blanc);
}
#clock-date {
  font-size: 11px; color: var(--gris); font-weight: 700;
  text-transform: uppercase; letter-spacing: 2px;
}
.kiosk-container { max-width: 940px; }

/* Identification */
.kiosk-login { padding: 0 var(--space-xl) var(--space-xxl); text-align: center; }
.kiosk-login .brand-lockup { padding-top: var(--space-xl); }
.kiosk-login-card {
  max-width: 440px; margin: var(--space-md) auto 0;
  background: var(--surface-2); border: var(--border-thin); border-radius: var(--radius);
  padding: var(--space-xl); text-align: left;
}
.kiosk-login-card h2, .section-head h3, .kiosk-eyebrow, .summary-title {
  font-size: 11px; letter-spacing: 3px; text-transform: uppercase;
  color: var(--or); font-weight: 800;
}
.kiosk-login-card h2 { margin-bottom: var(--space-lg); text-align: center; }
.kiosk-badge-hint {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: var(--space-lg); border: 1px dashed rgba(201,168,106,0.45);
  border-radius: var(--radius-sm); color: var(--blanc); font-weight: 700; font-size: 15px;
}
.kiosk-badge-hint .ico { width: 30px; height: 30px; color: var(--or); }
.kiosk-or {
  display: flex; align-items: center; gap: 12px; margin: var(--space-lg) 0;
  color: var(--gris-fonce); font-size: 11px; font-weight: 800;
  letter-spacing: 2px; text-transform: uppercase;
}
.kiosk-or::before, .kiosk-or::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.10); }
.kiosk-login-card .employee-code-input { max-width: none; margin-bottom: var(--space-md); }
.kiosk-submit { width: 100%; min-height: 54px; font-size: 15px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg .ico { margin-top: 2px; }

/* Panneau employé */
.kiosk-panel { padding: var(--space-xl); }
.kiosk-hello {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: var(--space-lg); flex-wrap: wrap;
  padding-bottom: var(--space-lg); border-bottom: var(--border-thin);
}
.kiosk-name { font-size: 2rem; font-weight: 800; color: var(--blanc); line-height: 1.15; margin-top: 4px; }
.kiosk-meta { color: var(--gris); font-size: 13px; margin-top: 4px; }

.status-pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid;
  font-weight: 700; font-size: 14px; white-space: nowrap;
}
.status-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.status-pill.is-in { color: var(--success); background: var(--success-bg); border-color: rgba(100,209,138,0.35); }
.status-pill.is-in .dot { animation: kiosk-pulse 2s infinite; }
.status-pill.is-out { color: var(--gris); background: var(--surface-2); border-color: rgba(255,255,255,0.12); }
@keyframes kiosk-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(100,209,138,0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(100,209,138,0); }
  100% { box-shadow: 0 0 0 0 rgba(100,209,138,0); }
}

.kiosk-stats { margin: var(--space-lg) 0; }
.kiosk-stats .stat-card .number { font-variant-numeric: tabular-nums; }

.kiosk-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); }
.kiosk-btn {
  min-height: 88px; font-size: 1.3rem; font-weight: 800; letter-spacing: 0.5px;
  border-radius: var(--radius); gap: 14px;
}
.kiosk-btn .ico { width: 28px; height: 28px; }
.kiosk-btn-in { background: var(--success); color: var(--noir); border-color: var(--success); }
.kiosk-btn-out { background: transparent; color: var(--error); border: 2px solid var(--error); }
.kiosk-btn-out:hover:not(:disabled) { background: var(--error); color: var(--noir); }
.kiosk-btn:disabled { opacity: 0.22; filter: grayscale(0.7); }
.kiosk-btn:active:not(:disabled) { transform: scale(0.985); }

.kiosk-idle { margin-top: var(--space-lg); }
.kiosk-idle-bar { height: 3px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.kiosk-idle-bar span { display: block; height: 100%; width: 100%; background: var(--holo); transition: width 1s linear; }
.kiosk-idle-row {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-md);
  margin-top: var(--space-sm); color: var(--gris); font-size: 13px;
}
.kiosk-idle-row strong { color: var(--blanc); font-variant-numeric: tabular-nums; }

/* Sections */
.kiosk-section { padding: var(--space-xl); border-top: var(--border-thin); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--space-md); }
.section-sub { color: var(--gris); font-size: 13px; }
.kiosk-table { margin: 0; }
.kiosk-table td { font-size: 15px; font-variant-numeric: tabular-nums; }
.kiosk-table .num { text-align: right; }
.kiosk-table tfoot td { font-family: var(--font-family); }
.kiosk-table tfoot td:first-child { color: var(--gris); text-transform: uppercase; letter-spacing: 1.5px; font-size: 12px; }
.kiosk-table tr.empty td { text-align: center; color: var(--gris); padding: var(--space-xl); font-family: var(--font-family); }
.kiosk-table tr.empty:hover { background: transparent; }
.kiosk-empty { color: var(--gris); text-align: center; padding: var(--space-xl) 0 0; }

.tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
  font-family: var(--font-family);
}
.tag-live { color: var(--success); background: var(--success-bg); }
.flag { display: inline-flex; color: var(--warning); margin-left: 8px; vertical-align: -2px; }
.flag-text {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 4px;
  color: var(--warning); font-size: 11px; font-weight: 700; font-family: var(--font-family);
}

/* Historique du mois (repliable) */
.kiosk-month summary {
  display: flex; align-items: center; gap: var(--space-md);
  list-style: none; cursor: pointer; user-select: none;
  padding: var(--space-md) var(--space-lg);
  background: var(--surface-2); border: var(--border-thin); border-radius: var(--radius);
}
.kiosk-month summary::-webkit-details-marker { display: none; }
.kiosk-month summary:hover { border-color: rgba(201,168,106,0.5); }
.summary-total { margin-left: auto; color: var(--blanc); font-weight: 700; font-variant-numeric: tabular-nums; }
.ico-chev { color: var(--gris); transition: transform 0.2s ease; }
.kiosk-month[open] .ico-chev { transform: rotate(180deg); }
.month-scroll {
  max-height: 540px; overflow: auto; margin-top: var(--space-md);
  border: var(--border-thin); border-radius: var(--radius);
}
.month-scroll .kiosk-table { border: none; border-radius: 0; }
.month-scroll thead th { position: sticky; top: 0; background: var(--surface-2); z-index: 1; }
.month-day strong { display: block; color: var(--blanc); font-family: var(--font-family); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 6px; background: var(--surface-3);
  font-size: 13px; white-space: nowrap;
}
.chip .arrow { color: var(--gris-fonce); }
.month-table tr.is-today td:first-child { box-shadow: inset 3px 0 0 var(--or); }
.month-table tr.week-row td {
  background: var(--noir); font-family: var(--font-family);
  font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--gris); padding-top: 10px; padding-bottom: 10px;
}
.month-table tr.week-row:hover { background: transparent; }
.week-range { color: var(--gris-fonce); letter-spacing: 1px; }
.month-table tr.week-row td.week-total {
  color: var(--blanc); font-size: 14px; letter-spacing: 0; text-transform: none;
  font-variant-numeric: tabular-nums;
}
.month-table tr.week-row.is-ok td.week-total { color: var(--success); }
.month-table tr.week-row.is-under td.week-total { color: var(--warning); }
.target { color: var(--gris-fonce); font-weight: 600; }

/* Notification (bas d'écran) */
.kiosk-toast {
  position: fixed; left: 50%; bottom: 32px; z-index: 50;
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 26px; border-radius: var(--radius); border: 1px solid;
  background: var(--surface-3); font-size: 1.05rem; font-weight: 700;
  box-shadow: 0 18px 40px rgba(0,0,0,0.55);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.kiosk-toast .ico { width: 22px; height: 22px; }
.kiosk-toast.show { opacity: 1; transform: translate(-50%, 0); }
.kiosk-toast.ok  { color: var(--success); border-color: rgba(100,209,138,0.45); }
.kiosk-toast.err { color: var(--error);   border-color: rgba(232,106,106,0.45); }

/* Page de transition après badge */
.kiosk-welcome { text-align: center; padding: var(--space-xxl) var(--space-xl); }
.kiosk-welcome .kiosk-name { font-size: 2.2rem; margin: var(--space-sm) 0 var(--space-lg); }
.kiosk-loader { width: 180px; height: 3px; margin: 0 auto; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.kiosk-loader span { display: block; height: 100%; width: 40%; background: var(--holo); animation: kiosk-load 0.9s ease-in-out infinite; }
@keyframes kiosk-load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.kiosk-welcome .section-sub { display: block; margin-top: var(--space-md); }

@media (max-width: 680px) {
  .kiosk-hello { align-items: flex-start; }
}


/* ============================================================
   TABLETTE — compteurs, fluidité tactile, petits écrans
   ============================================================ */
body.kiosk {
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.kiosk button, body.kiosk a, body.kiosk summary { touch-action: manipulation; }
body.kiosk .container { padding-left: max(var(--space-md), env(safe-area-inset-left)); padding-right: max(var(--space-md), env(safe-area-inset-right)); }

.kiosk-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md); margin: var(--space-lg) 0;
}
.kiosk-stats .stat-card { padding: var(--space-lg) var(--space-md); }
.kiosk-stats .stat-card .number {
  font-size: clamp(1.7rem, 4.2vw, 2.6rem);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.number-sub { font-size: 0.42em; color: var(--gris); font-weight: 700; margin-left: 6px; }
.stat-live .number { color: var(--blanc); }
.kiosk-note { margin-top: var(--space-sm); color: var(--gris-fonce); font-size: 12px; }

/* Pas d'effet de survol inutile au doigt */
@media (hover: none) {
  tbody tr:hover { background: transparent; }
  .btn-success:hover:not(:disabled), .btn-error:hover:not(:disabled) { filter: none; }
}

/* Tablette portrait (iPad, Galaxy Tab…) */
@media (max-width: 900px) {
  .kiosk-container { padding-top: var(--space-md); }
  .kiosk-panel, .kiosk-section { padding: var(--space-lg); }
  .kiosk-header { padding: var(--space-md) var(--space-lg); }
  .kiosk-header h1 { font-size: 1.15rem; }
  .kiosk-table th, .kiosk-table td { padding: 12px 14px; }
  .month-scroll { max-height: 60vh; }
}

/* Petite tablette / téléphone */
@media (max-width: 600px) {
  .kiosk-header { grid-template-columns: 1fr auto; text-align: left; }
  .kiosk-header .nav-links { justify-self: end; grid-column: 2; grid-row: 1; }
  .kiosk-clock { grid-column: 1 / -1; grid-row: 2; text-align: left; }
  .kiosk-header h1 { grid-column: 1; grid-row: 1; }
  .kiosk-stats { grid-template-columns: 1fr 1fr; }
  .kiosk-stats .stat-live { grid-column: 1 / -1; }
  .kiosk-actions { grid-template-columns: 1fr 1fr; }
  .kiosk-btn { min-height: 72px; font-size: 1.1rem; }
  .kiosk-name { font-size: 1.5rem; }
  .status-pill { width: 100%; justify-content: center; }
  .month-table .chip { font-size: 12px; padding: 3px 8px; }
  .kiosk-idle-row { flex-wrap: wrap; }
  .kiosk-login { padding: 0 var(--space-md) var(--space-xl); }
  .kiosk-login-card { padding: var(--space-lg); }
}

@media (max-width: 600px) {
  .number-sub { display: block; margin: 6px 0 0; font-size: 0.42em; }
  .kiosk-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kiosk-btn { padding: 0 12px; gap: 10px; }
  .kiosk-btn .ico { width: 24px; height: 24px; }
  .kiosk-stats .stat-card .label { letter-spacing: 0.5px; }
}


/* ============================================================
   BORNE 7" (écran 1024 × 600) — tout tient sans défilement.
   Seul l'historique des heures défile, sous les boutons.
   ============================================================ */
@media (max-height: 820px) and (min-width: 700px) {
  body.kiosk header.kiosk-header { padding: 8px 20px; }
  .kiosk-header h1 { font-size: 1.1rem; }
  .kiosk-header h1::before { width: 20px; height: 22px; }
  #clock-time { font-size: 1.35rem; }
  #clock-date { font-size: 10px; letter-spacing: 1.5px; }
  .kiosk-header a { padding: 6px 12px; font-size: 12px; }
  body.kiosk .container.kiosk-container { max-width: 1040px; padding-top: 10px; padding-bottom: 10px; }

  /* Identification : logo à gauche, formulaire à droite */
  .kiosk-login {
    display: grid; grid-template-columns: 0.85fr 1.15fr; align-items: center;
    gap: 32px; padding: 24px 32px; text-align: center;
    min-height: calc(100vh - 96px);
  }
  .kiosk-login .brand-lockup { padding: 0; }
  .brand-lockup .bars { width: 54px; height: 57px; margin-bottom: 18px; }
  .brand-lockup .wordmark { width: 230px; }
  .brand-lockup .divider { width: 130px; margin: 14px auto 6px; }
  .brand-lockup .tagline { font-size: 10px; letter-spacing: 3px; }
  .kiosk-login-card { margin: 0; max-width: none; padding: 20px 24px; }
  .kiosk-login-card h2 { margin-bottom: 14px; }
  .kiosk-badge-hint { padding: 20px 16px; font-size: 17px; }
  .kiosk-or { margin: 12px 0; }
  .kiosk-login-card label { margin-bottom: 6px; }
  .kiosk-login-card .employee-code-input { padding: 10px; font-size: 1.4rem; margin-bottom: 12px; }
  .kiosk-submit { min-height: 52px; }
  .kiosk-login-card .error { margin: 0 0 12px; padding: 10px 14px; }

  /* Pointage : bonjour, compteurs et boutons visibles d'un coup */
  .kiosk-panel { padding: 16px 24px 14px; }
  .kiosk-hello { padding-bottom: 12px; align-items: center; }
  .kiosk-name { font-size: 1.6rem; margin-top: 2px; }
  .kiosk-meta { font-size: 12px; margin-top: 2px; }
  .status-pill { padding: 8px 14px; font-size: 13px; }
  .kiosk-stats { margin: 12px 0; gap: 12px; }
  .kiosk-stats .stat-card { padding: 12px 10px 10px; }
  .kiosk-stats .stat-card .number { font-size: 1.9rem; margin-bottom: 4px; }
  .kiosk-actions { gap: 12px; }
  .kiosk-btn { min-height: 64px; font-size: 1.2rem; }
  .kiosk-idle { margin-top: 10px; }
  .kiosk-idle-row { margin-top: 6px; }

  /* Historique : en dessous, c'est la seule partie qui défile */
  .kiosk-section { padding: 14px 24px; }
  .section-head { margin-bottom: 8px; }
  .kiosk-table th, .kiosk-table td { padding: 8px 14px; }
  .kiosk-table tr.empty td { padding: 14px; }
  .kiosk-month summary { padding: 10px 16px; }
  .month-scroll { max-height: 60vh; }

  /* Page « Badge reconnu » */
  .kiosk-welcome { padding: 32px 24px; }
  .kiosk-welcome .kiosk-name { font-size: 1.9rem; margin: 6px 0 18px; }
}


/* ============================================================
   ÉCRAN EMPLOYÉ — « aujourd'hui » en grand, semaine en petit,
   pointages du jour et du mois dans des listes dépliables.
   ============================================================ */
.stat-card .unit { font-size: 0.42em; color: var(--gris); font-weight: 700; margin-left: 6px; }
.kiosk-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat-live .number { white-space: nowrap; }
.kiosk-week { text-align: center; color: var(--gris); font-size: 13px; margin: 0 0 var(--space-md); }
.kiosk-week strong { color: var(--blanc); font-variant-numeric: tabular-nums; }
.kiosk-week .target { font-weight: 600; }
.kiosk-blocks { border-top: var(--border-thin); }
.kiosk-blocks .kiosk-section { border-top: none; }
.kiosk-blocks .kiosk-section + .kiosk-section { padding-top: 0; }
.today-wrap { margin-top: var(--space-md); }

/* Correction des horaires par l'employé */
.edit-col, .edit-cell { width: 58px; text-align: center; }
.kiosk-table td.edit-cell { padding-top: 4px; padding-bottom: 4px; }
.edit-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 36px; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(201,168,106,0.35); background: var(--surface-3); color: var(--or);
}
.edit-btn .ico { width: 18px; height: 18px; }
.edit-btn:active { transform: scale(0.96); }
.chip.edit-btn {
  width: auto; height: auto; padding: 4px 10px; gap: 6px;
  color: var(--blanc); font: inherit; font-size: 13px;
}
.chip.edit-btn .ico { width: 14px; height: 14px; color: var(--or); }
.edit-modal {
  position: fixed; inset: 0; z-index: 60; display: none;
  align-items: flex-start; justify-content: center; padding-top: 4vh;
  background: rgba(0,0,0,0.65);
}
.edit-modal.show { display: flex; }
.edit-box {
  width: min(480px, 92vw); background: var(--surface-2); border: var(--border-thin);
  border-radius: var(--radius); padding: 20px 22px; box-shadow: 0 18px 40px rgba(0,0,0,0.55);
}
.edit-box h3 { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; color: var(--or); font-weight: 800; }
.edit-date { color: var(--blanc); font-weight: 700; font-size: 1.15rem; margin: 4px 0 14px; }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.edit-grid input { text-align: center; font-size: 1.6rem; font-weight: 700; letter-spacing: 2px; padding: 10px; }
.edit-hint { color: var(--gris); font-size: 12px; margin-top: 10px; line-height: 1.4; }
.edit-err { color: var(--error); font-weight: 700; font-size: 13px; min-height: 18px; margin-top: 6px; }
.edit-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; margin-top: 8px; }

@media (max-height: 820px) and (min-width: 700px) {
  .kiosk-panel { padding: 16px 26px 12px; }
  .kiosk-eyebrow { font-size: 12px; }
  .kiosk-name { font-size: 3.1rem; line-height: 1.1; }
  .status-pill { padding: 12px 22px; font-size: 17px; }
  .status-pill .dot { width: 11px; height: 11px; }
  .kiosk-stats { margin: 14px 0 10px; gap: 14px; }
  .kiosk-stats .stat-card { padding: 18px 12px 14px; }
  .kiosk-stats .stat-card .number { font-size: 3.9rem; }
  .kiosk-stats .stat-card .label { font-size: 13px; }
  .kiosk-week { margin: 0 0 12px; font-size: 14px; }
  .kiosk-btn { min-height: 90px; font-size: 1.5rem; }
  .kiosk-btn .ico { width: 30px; height: 30px; }
  .kiosk-blocks { display: grid; grid-template-columns: 1fr 1fr; align-items: start; gap: 0 16px; padding: 12px 26px 16px; }
  .kiosk-blocks .kiosk-section { padding: 0; }
  .kiosk-blocks .kiosk-section + .kiosk-section { padding-top: 0; }
  .edit-modal { padding-top: 2vh; }
}

/* Bouton « Terminer » en grand, à côté du nom */
.kiosk-hello-side { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; justify-content: flex-end; }
.kiosk-logout {
  min-height: 60px; padding: 0 26px; gap: 10px; font-size: 1.15rem; font-weight: 800;
  background: var(--surface-3); color: var(--blanc); border: 2px solid rgba(255,255,255,0.28);
  border-radius: var(--radius);
}
.kiosk-logout .ico { width: 24px; height: 24px; color: var(--or); }
.kiosk-logout:active { transform: scale(0.97); background: var(--surface-2); }
.kiosk-idle-row { justify-content: center; }
@media (max-height: 820px) and (min-width: 700px) {
  .kiosk-logout { min-height: 64px; padding: 0 30px; font-size: 1.25rem; }
}
@media (max-width: 600px) {
  .kiosk-hello-side { width: 100%; }
  .kiosk-logout { flex: 1; }
}
.kiosk-admin { text-decoration: none; color: var(--or); border-color: rgba(201,168,106,0.55); }

/* Pointage automatique au badge : bandeau de confirmation */
.kiosk-auto {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px 18px; margin-bottom: 14px; border-radius: var(--radius);
  font-size: 1.25rem; font-weight: 800; border: 1px solid;
  animation: fadeIn 0.25s ease;
}
.kiosk-auto .ico { width: 26px; height: 26px; }
.kiosk-auto.is-ok   { color: var(--success); background: var(--success-bg); border-color: rgba(100,209,138,0.45); }
.kiosk-auto.is-out  { color: var(--error);   background: var(--error-bg);   border-color: rgba(232,106,106,0.45); }
.kiosk-auto.is-info { color: var(--warning); background: var(--warning-bg); border-color: rgba(230,180,80,0.45); }

/* Admin : réglage oui / non */
.setting-row {
  display: flex; align-items: center; gap: var(--space-lg); margin: 0 var(--space-xl) var(--space-xl);
  padding: var(--space-md) var(--space-lg); background: var(--surface-2);
  border: var(--border-thin); border-radius: var(--radius); cursor: pointer;
}
.setting-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.setting-text strong { color: var(--blanc); font-size: 15px; }
.setting-text small { color: var(--gris); font-size: 12px; font-weight: 500; }
.setting-msg { min-width: 80px; font-weight: 700; font-size: 13px; }
.switch { position: relative; width: 54px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider { position: absolute; inset: 0; background: var(--surface-3); border: 1px solid rgba(255,255,255,0.18); border-radius: 999px; transition: 0.2s; }
.switch .slider::before { content: ''; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: var(--gris); border-radius: 50%; transition: 0.2s; }
.switch input:checked + .slider { background: var(--success-bg); border-color: var(--success); }
.switch input:checked + .slider::before { transform: translateX(24px); background: var(--success); }


/* ============================================================
   Grand pop-up de confirmation du pointage (entrée / sortie)
   ============================================================ */
.punch-pop { position: fixed; inset: 0; z-index: 2147483000; display: none; align-items: center; justify-content: center;
             background: rgba(0,0,0,.62); }
.punch-pop.show { display: flex; animation: ppFade .18s ease-out both; }
.punch-pop.hide { display: flex; animation: ppOut .28s ease-in both; pointer-events: none; }
.punch-pop .pp-card { min-width: min(560px, 86vw); padding: 38px 48px 34px; border-radius: 28px; text-align: center; color: #fff;
             box-shadow: 0 24px 70px rgba(0,0,0,.55); background: #1c1c1f; border: 3px solid currentColor; }
.punch-pop.show .pp-card { animation: ppPop .42s cubic-bezier(.2,1.5,.4,1) both; }
.punch-pop.hide .pp-card { animation: ppShrink .28s ease-in both; }
.punch-pop .pp-ico { width: 132px; height: 132px; display: block; margin: 0 auto 14px; }
.punch-pop .pp-c { fill: none; stroke: currentColor; stroke-width: 3.5; stroke-dasharray: 145; stroke-dashoffset: 145; }
.punch-pop .pp-p { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; }
.punch-pop.show .pp-c { animation: ppDraw .45s .08s ease-out forwards; }
.punch-pop.show .pp-p { animation: ppDraw .35s .38s ease-out forwards; }
.punch-pop .pp-title { font-size: 3.1rem; font-weight: 900; letter-spacing: .5px; line-height: 1.1; }
.punch-pop .pp-sub { margin-top: 10px; font-size: 1.45rem; font-weight: 600; opacity: .85; color: #fff; }
.punch-pop .pp-title { color: currentColor; }
.punch-pop.pp-in  .pp-card { color: #3ddc84; background: linear-gradient(180deg, #14301f, #121a15); }
.punch-pop.pp-out .pp-card { color: #f0b04a; background: linear-gradient(180deg, #33270f, #1a1610); }
.punch-pop.pp-info .pp-card { color: #6fb3ff; background: linear-gradient(180deg, #102236, #11161d); }
.punch-pop.pp-err .pp-card { color: #ff5d5d; background: linear-gradient(180deg, #3a1414, #1d1111); }
@keyframes ppFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ppOut  { from { opacity: 1; } to { opacity: 0; } }
@keyframes ppPop  { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes ppShrink { to { transform: scale(.9); opacity: 0; } }
@keyframes ppDraw { to { stroke-dashoffset: 0; } }
@media (max-height: 820px) and (min-width: 700px) {
  .punch-pop .pp-ico { width: 116px; height: 116px; }
  .punch-pop .pp-title { font-size: 2.8rem; }
}
