/* ============================================================
   QFlow — app.css  (Kramfrei)
   Design system minimal, sans framework externe.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ============================================================
   1. Variables & Reset
   ============================================================ */

:root {
  /* ── QFlow / Kramfrei brand tokens ───────────────────────────
     These are the canonical brand colours. Use --qflow-* in
     brand-specific components (logo areas, kiosk, login).
     Semantic aliases (--primary, --success …) map to them.
     ─────────────────────────────────────────────────────────── */
  --qflow-primary:    #1D4ED8;   /* brand blue */
  --qflow-secondary:  #1E3A8A;   /* brand deep-blue */
  --qflow-accent:     #3B82F6;   /* electric blue */
  --qflow-dark:       #0D1B3E;   /* navy (horizontal logo bg) */
  --qflow-surface:    #F8FAFC;   /* off-white page background */
  --qflow-text:       #0F172A;   /* near-black body text */
  --qflow-muted:      #64748B;   /* muted/secondary text */
  --qflow-border:     #E2E8F0;   /* default border */

  /* Couleurs principales (aliases → brand tokens) */
  --primary:       var(--qflow-primary);
  --primary-light: var(--qflow-accent);
  --primary-dark:  var(--qflow-secondary);
  --primary-bg:    #EFF6FF;

  /* Sémantique */
  --success:    #059669;
  --success-bg: #ECFDF5;
  --warning:    #D97706;
  --warning-bg: #FFFBEB;
  --danger:     #DC2626;
  --danger-bg:  #FEF2F2;
  --info:       #0284C7;
  --info-bg:    #F0F9FF;

  /* Neutres */
  --gray-900: #0F172A;
  --gray-800: #1E293B;
  --gray-700: #334155;
  --gray-500: #64748B;
  --gray-400: #94A3B8;
  --gray-300: #CBD5E1;
  --gray-200: #E2E8F0;
  --gray-100: #F1F5F9;
  --gray-50:  #F8FAFC;
  --white:    #FFFFFF;

  /* Typographie */
  --font: 'Inter', system-ui, -apple-system, sans-serif;

  /* Espacements & rayons */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Ombres */
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1),  0 8px 10px -6px rgba(0,0,0,.05);

  /* Transitions */
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
  min-height: 100vh;
}

/* ============================================================
   2. Typographie
   ============================================================ */

h1, h2, h3 { font-weight: 700; line-height: 1.2; }
h1 { font-size: 2rem; }
h2 { font-size: 1.25rem; }
p  { color: var(--gray-700); }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   3. Navbar
   ============================================================ */

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 56px;
  background: var(--gray-900);
  box-shadow: 0 1px 0 rgba(255,255,255,.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.navbar-brand:hover { text-decoration: none; opacity: 0.88; }

.brand-logo-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Legacy SVG logo (kept for kiosk/book pages) */
.brand-logo {
  width: 20px;
  height: 20px;
  color: var(--primary-light);
}

/* ── Footer ──────────────────────────────────────────────────────────── */
.app-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 1.5rem;
  margin-top: 3rem;
  border-top: 1px solid var(--gray-200);
  font-size: 0.75rem;
  color: var(--gray-400);
}
.footer-brand-link {
  color: var(--gray-400);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-brand-link:hover { color: var(--primary); }

/* ============================================================
   Brand utility components — used across kiosk, book, display
   ============================================================ */

/* ── Kiosk footer brand badge ─────────────────────────────── */
.kiosk-brand-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,.55);
  letter-spacing: 0.02em;
}
.kiosk-brand-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  opacity: 0.75;
}

/* ── Kiosk / Book — "QFlow powered" corner caption ──────── */
.lang-powered {
  font-size: 0.7rem;
  opacity: 0.5;
}
.lang-powered-link {
  color: inherit;
  text-decoration: none;
}
.lang-powered-link:hover { opacity: 0.9; text-decoration: underline; }

/* ── Kiosk lang page — horizontal lockup ─────────────────── */
.lang-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.lang-brand-horizontal {
  max-width: 280px;
  width: 100%;
  height: auto;
  border-radius: 14px;
}
.lang-product-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--qflow-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}

/* ── Book flow brand ──────────────────────────────────────── */
.book-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}
.book-brand-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

/* ── Receipt (kiosk ticket-created) brand ─────────────────── */
.receipt-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 0 0;
  margin-top: 0.5rem;
  border-top: 1px solid var(--qflow-border);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--qflow-muted);
  letter-spacing: 0.04em;
}
.receipt-brand-icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  opacity: 0.65;
}

/* ── Display — brand icon in header ──────────────────────── */
.dsp-brand-icon-img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  opacity: 0.85;
  flex-shrink: 0;
}

/* ── Thermal print ticket — brand section ─────────────────── */
.thermal-brand-section {
  padding: 4px 0 2px;
}
.thermal-brand-icon {
  width: 22px;
  height: 22px;
  margin-bottom: 2px;
}
.thermal-brand-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.thermal-brand-powered {
  font-size: 8px;
  opacity: 0.6;
  letter-spacing: 0.5px;
}
/* Hide monochrome icon on screen, show only for print */
@media screen { .no-screen { display: none; } }
@media print  { .no-screen { display: block; } }

.navbar-links {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  color: var(--gray-400);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
  text-decoration: none;
}
.nav-link:hover {
  color: var(--white);
  background: rgba(255,255,255,.07);
  text-decoration: none;
}
.nav-link--admin {
  color: #93C5FD;
  border: 1px solid rgba(147,197,253,.25);
}
.nav-link--admin:hover {
  color: var(--white);
  background: rgba(147,197,253,.15);
  border-color: rgba(147,197,253,.4);
}

/* ============================================================
   4. Boutons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1.125rem;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn:hover   { transform: translateY(-1px); }
.btn:active  { transform: translateY(0); }

.btn-primary   { background: var(--primary);  color: var(--white); box-shadow: 0 1px 3px rgba(29,78,216,.3); }
.btn-primary:hover  { background: var(--primary-light); }

.btn-success   { background: var(--success);  color: var(--white); }
.btn-success:hover  { background: #047857; }

.btn-danger    { background: var(--danger);   color: var(--white); }
.btn-danger:hover   { background: #B91C1C; }

.btn-secondary { background: var(--gray-200); color: var(--gray-800); }
.btn-secondary:hover{ background: var(--gray-300); }

.btn-sm  { padding: 0.3rem 0.75rem; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg  { padding: 0.75rem 1.75rem; font-size: 1rem; border-radius: var(--radius-lg); }

.btn-call {
  padding: 0.625rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--radius);
  min-width: 140px;
}

/* ============================================================
   5. Formulaires
   ============================================================ */

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.375rem;
  letter-spacing: 0.01em;
}

.form-select {
  display: block;
  width: 100%;
  padding: 0.5625rem 0.875rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  color: var(--gray-900);
  background: var(--white);
  cursor: pointer;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
}
.form-select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}

/* ============================================================
   6. Alertes / Flash messages
   ============================================================ */

.flash-container {
  max-width: 900px;
  margin: 1rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.alert {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  animation: slideDown 200ms ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.alert-success { background: var(--success-bg); color: #065F46; border: 1px solid #A7F3D0; }
.alert-danger  { background: var(--danger-bg);  color: #991B1B; border: 1px solid #FECACA; }
.alert-info    { background: var(--info-bg);    color: #075985; border: 1px solid #BAE6FD; }

.alert-icon { font-weight: 700; font-size: 0.9rem; }

/* ============================================================
   7. Badges de statut
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.625rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-waiting  { background: var(--gray-100); color: var(--gray-600, var(--gray-700)); }
.badge-called   { background: var(--warning-bg); color: #92400E; border: 1px solid #FDE68A; }
.badge-serving  { background: var(--primary-bg); color: var(--primary-dark); border: 1px solid #BFDBFE; }
.badge-done     { background: var(--success-bg); color: #065F46; }
.badge-noshow   { background: var(--danger-bg);  color: #991B1B; }
.badge-priority { background: #FDF4FF; color: #7E22CE; border: 1px solid #E9D5FF; }
.badge-normal   { background: var(--gray-100);   color: var(--gray-500); }
.badge-count    { background: var(--primary-bg); color: var(--primary); font-weight: 600; font-size: 0.8rem; padding: 0.2rem 0.75rem; border-radius: 999px; }

/* ============================================================
   8. Panels (carte agent)
   ============================================================ */

.panel {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--gray-800);
}

.panel-icon {
  color: var(--primary-light);
  font-size: 0.85rem;
}

/* ============================================================
   9. Empty state
   ============================================================ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--gray-500);
}
.empty-state--sm { padding: 2rem 1rem; }
.empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.5; }
.empty-hint { font-size: 0.85rem; color: var(--gray-400); margin-top: 0.25rem; }

/* ============================================================
   10. PAGE KIOSK
   ============================================================ */

.page-kiosk {
  background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 60%, #F0FDF4 100%);
  min-height: 100vh;
}

.kiosk-main {
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 1.5rem 6rem;
}

.kiosk-hero {
  text-align: center;
  margin-bottom: 3rem;
}

.kiosk-title {
  font-size: 2.75rem;
  font-weight: 900;
  color: var(--gray-900);
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.kiosk-subtitle {
  font-size: 1.125rem;
  color: var(--gray-500);
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.service-form { display: contents; }

.service-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-xl);
  cursor: pointer;
  text-align: left;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  box-shadow: var(--shadow-sm);
  font-family: var(--font);
}
.service-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg), 0 0 0 4px var(--primary-bg);
  transform: translateY(-2px);
}
.service-card:active { transform: translateY(0); }

.service-prefix {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-lg);
  font-size: 1.625rem;
  font-weight: 900;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}

.service-info {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  flex: 1;
}

.service-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
}

.service-desc {
  font-size: 0.8125rem;
  color: var(--gray-500);
}

.service-arrow {
  color: var(--gray-300);
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: color var(--transition), transform var(--transition);
}
.service-card:hover .service-arrow {
  color: var(--primary-light);
  transform: translateX(3px);
}

/* Service fermé (admin a désactivé l'ouverture) */
.service-card--closed {
  border-color: var(--gray-200);
  background: var(--gray-50);
  cursor: not-allowed;
  opacity: 0.65;
}
.service-card--closed:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--gray-200);
}
.service-closed-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--danger);
  background: var(--danger-bg);
  border: 1px solid #FECACA;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.kiosk-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  justify-content: center;
  padding: 1rem;
  background: rgba(255,255,255,.8);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--gray-200);
}

.kiosk-time {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-600, var(--gray-700));
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

/* ============================================================
   11. PAGE TICKET-CREATED (confirmation kiosk)
   ============================================================ */

.page-ticket-created .kiosk-main { /* inherited */ }

.ticket-created-main {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
  padding: 2rem 1.5rem;
}

.ticket-receipt {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 400px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.receipt-header {
  background: var(--primary);
  padding: 1.25rem 2rem 0;
  text-align: center;
}

.receipt-label {
  display: block;
  color: rgba(255,255,255,.75);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.receipt-number {
  text-align: center;
  background: var(--primary);
  font-size: 5rem;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.04em;
  padding: 0.25rem 2rem 1.5rem;
  line-height: 1;
}

.receipt-body {
  padding: 1.5rem 2rem;
  border-bottom: 2px dashed var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.receipt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.receipt-key {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.receipt-val {
  font-weight: 600;
  color: var(--gray-900);
  font-size: 0.9375rem;
}

.receipt-message {
  padding: 1.25rem 2rem;
  text-align: center;
}

.receipt-message p {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.receipt-footer {
  padding: 1.25rem 2rem 1.75rem;
  text-align: center;
}

/* ============================================================
   12. PAGE AGENT
   ============================================================ */

.page-agent { background: var(--gray-100); }

.agent-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* --- Panel Call Next --- */

.panel-call .panel-header {
  background: var(--primary-bg);
  border-bottom-color: #BFDBFE;
}
.panel-call .panel-title { color: var(--primary-dark); }
.panel-call .panel-icon  { color: var(--primary); }

.call-form { padding: 1.25rem; }

.form-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-group { display: flex; flex-direction: column; flex: 1; min-width: 160px; }
.form-group-action { flex: 0; }

/* --- Ticket rows (active) --- */

.ticket-list {
  display: flex;
  flex-direction: column;
}

.ticket-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
  flex-wrap: wrap;
}
.ticket-row:last-child { border-bottom: none; }

.ticket-row--called  { background: #FFFDF5; }
.ticket-row--serving { background: #F0F9FF; }

.ticket-number-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 140px;
}

.ticket-number {
  font-size: 1.375rem;
  font-weight: 900;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.ticket-meta {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-700);
  flex-wrap: wrap;
}

.ticket-counter {
  padding: 0.125rem 0.5rem;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600, var(--gray-700));
}

.ticket-calls {
  font-size: 0.75rem;
  color: var(--warning);
  font-weight: 600;
}

.ticket-actions {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

/* --- Queue list (waiting) --- */

.queue-list { display: flex; flex-direction: column; }

.queue-header-row {
  display: grid;
  grid-template-columns: 90px 1fr 100px 70px;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  border-bottom: 1px solid var(--gray-100);
}

.queue-row {
  display: grid;
  grid-template-columns: 90px 1fr 100px 70px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.625rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  font-size: 0.875rem;
  transition: background var(--transition);
}
.queue-row:last-child { border-bottom: none; }
.queue-row:hover { background: var(--gray-50); }
.queue-row--priority { background: #FEFBFF; }

.queue-number {
  font-size: 1rem;
  font-weight: 800;
  color: var(--gray-800);
  font-variant-numeric: tabular-nums;
}

.queue-time {
  font-size: 0.8125rem;
  color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   13. SESSION BAR + AGENT SETUP
   ============================================================ */

/* ── Barre de session (affiché au-dessus du dashboard agent) ── */

.session-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.625rem 1.5rem;
  background: var(--primary-dark);
  color: var(--white);
  font-size: 0.875rem;
  flex-wrap: wrap;
}

.session-bar-info {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.session-bar-counter {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
}

.session-bar-files {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #BFDBFE;
}

.session-bar-sep {
  color: #93C5FD;
  font-weight: 300;
}

.session-bar-icon {
  font-size: 0.9rem;
  opacity: 0.7;
}

.session-bar-action .btn-secondary {
  background: rgba(255,255,255,.12);
  color: var(--white);
  border: 1px solid rgba(255,255,255,.2);
}
.session-bar-action .btn-secondary:hover {
  background: rgba(255,255,255,.22);
}

/* ── Bouton "Appeler suivant" en mode session ─────────────── */

.call-session-wrap {
  padding: 1.5rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.btn-call-session {
  font-size: 1.125rem;
  padding: 0.75rem 2.5rem;
  border-radius: var(--radius-lg);
  letter-spacing: 0.01em;
}
.btn-call-session:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.call-session-hint {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin: 0;
}

/* ── Page setup ───────────────────────────────────────────── */

.agent-setup-main {
  min-height: calc(100dvh - 56px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2.5rem 1.5rem;
  background: var(--gray-100);
}

.setup-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 540px;
}

.setup-header {
  text-align: center;
  margin-bottom: 2rem;
}

.setup-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.setup-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-900);
  margin: 0 0 0.375rem;
}

.setup-subtitle {
  font-size: 0.9rem;
  color: var(--gray-500);
  margin: 0;
}

.setup-form {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.setup-section {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.setup-section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-500);
}

.setup-section-hint {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin: -0.25rem 0 0;
}

.setup-select {
  max-width: 100%;
}

/* ── Checkboxes services ──────────────────────────────────── */

.service-checkboxes {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.service-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.service-checkbox-input {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.service-checkbox-body {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  width: 100%;
  transition: border-color var(--transition), background var(--transition);
}
.service-checkbox-label:hover .service-checkbox-body {
  border-color: var(--primary-light);
  background: var(--primary-bg);
}
.service-checkbox-input:checked + .service-checkbox-body {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.service-checkbox-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 800;
  flex-shrink: 0;
}

.service-checkbox-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-800);
}

.btn-setup-start {
  width: 100%;
  padding: 0.875rem;
  font-size: 1rem;
  border-radius: var(--radius-lg);
  justify-content: center;
}

/* ============================================================
   14. PAGE DISPLAY — Premium large-screen public display
       3-column grid · dark elegant · TV/wall-mount optimized
   ============================================================ */

/* ── Base ────────────────────────────────────────────────── */

.page-display {
  background: #080C14;
  color: var(--white);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  overflow: hidden;
  user-select: none;
}

/* ── En-tête ─────────────────────────────────────────────── */

.dsp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.dsp-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255,255,255,.4);
  letter-spacing: -0.01em;
}

.dsp-header-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.dsp-clock {
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(255,255,255,.55);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

/* ── Grille principale ───────────────────────────────────── */

.dsp-main {
  flex: 1;
  display: grid;
  grid-template-columns: 2fr 1.1fr 1.4fr;
  gap: 0;
  min-height: 0;
}

/* ── Colonne 1 : Appel en cours ─────────────────────────── */

.dsp-current {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 2.5rem;
  border-right: 1px solid rgba(255,255,255,.06);
  position: relative;
  text-align: center;
  transition: background 400ms;
}

.dsp-now-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  margin-bottom: 1.75rem;
}

.dsp-call-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.dsp-ticket-number {
  font-size: clamp(5rem, 12vw, 9rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--white);
  font-variant-numeric: tabular-nums;
}

.dsp-call-arrow {
  font-size: clamp(2.5rem, 5vw, 4rem);
  color: var(--primary-light);
  opacity: 0.6;
  line-height: 1;
  margin: 0.25rem 0;
}

.dsp-counter-label {
  font-size: clamp(1.75rem, 3.5vw, 2.75rem);
  font-weight: 800;
  color: rgba(255,255,255,.9);
  letter-spacing: -0.02em;
}

.dsp-call-time {
  margin-top: 0.75rem;
  font-size: 1rem;
  color: rgba(255,255,255,.35);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

/* État idle */
.dsp-idle {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: rgba(255,255,255,.2);
}

.dsp-idle-icon { font-size: 4rem; margin-bottom: 1rem; }
.dsp-idle-text { font-size: 1.25rem; font-weight: 500; }

/* Animation sur nouvel appel */
@keyframes highlight-pulse {
  0%   { background: rgba(59,130,246,.0);  box-shadow: none; }
  15%  { background: rgba(59,130,246,.12); box-shadow: inset 0 0 80px rgba(59,130,246,.15); }
  100% { background: rgba(59,130,246,.0);  box-shadow: none; }
}

.dsp-current.highlight-call {
  animation: highlight-pulse 900ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Multi-counter bar ──────────────────────────────────── */

.dsp-multi-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  padding: 0.75rem 1.25rem 0.25rem;
  width: 100%;
}

.dsp-multi-card {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 0.625rem;
  padding: 0.45rem 0.9rem;
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
  font-weight: 600;
  color: rgba(255,255,255,.88);
  transition: background 0.2s;
}

.dsp-multi-num {
  font-family: 'Courier New', monospace;
  font-size: clamp(0.9rem, 1.8vw, 1.15rem);
  font-weight: 800;
  color: #93c5fd; /* blue-300 */
  letter-spacing: .02em;
}

.dsp-multi-arrow {
  opacity: .55;
  font-size: 0.9em;
}

.dsp-multi-counter {
  color: rgba(255,255,255,.72);
}

@keyframes multi-card-flash {
  0%   { background: rgba(59,130,246,.0);  border-color: rgba(255,255,255,.12);
         box-shadow: none; }
  18%  { background: rgba(59,130,246,.28); border-color: rgba(147,197,253,.6);
         box-shadow: 0 0 18px rgba(59,130,246,.35); }
  100% { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.12);
         box-shadow: none; }
}

.dsp-multi-card--flash {
  animation: multi-card-flash 1200ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Colonne 2 : Files en attente ───────────────────────── */

.dsp-queues {
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  border-right: 1px solid rgba(255,255,255,.06);
  overflow: hidden;
}

.dsp-section-title {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
  margin: 0 0 1.25rem;
}

.dsp-queue-groups {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dsp-queue-group {
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,.035);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 0.875rem;
}

.dsp-queue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.625rem;
}

.dsp-queue-label {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255,255,255,.7);
  letter-spacing: 0.02em;
}

.dsp-queue-badge {
  font-size: 0.875rem;
  font-weight: 800;
  color: var(--white);
  background: rgba(59,130,246,.3);
  border: 1px solid rgba(59,130,246,.4);
  padding: 0.15rem 0.625rem;
  border-radius: 999px;
  min-width: 1.75rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.dsp-queue-badge--empty {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.1);
  color: rgba(255,255,255,.3);
}

.dsp-queue-tickets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.dsp-queue-ticket {
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255,255,255,.55);
  background: rgba(255,255,255,.05);
  padding: 0.2rem 0.6rem;
  border-radius: 0.375rem;
  font-variant-numeric: tabular-nums;
}

.dsp-queue-empty-row {
  font-size: 0.8rem;
  color: rgba(255,255,255,.2);
  font-style: italic;
}

/* ── Colonne 3 : Derniers appels ────────────────────────── */

.dsp-recent {
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  overflow: hidden;
}

.dsp-recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dsp-recent-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  background: rgba(255,255,255,.04);
  border-radius: 0.75rem;
  border: 1px solid rgba(255,255,255,.06);
}

@keyframes slide-in {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.dsp-recent-row--new {
  animation: slide-in 400ms ease;
}

.dsp-recent-num {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  min-width: 3.5rem;
}

.dsp-recent-sep {
  font-size: 1rem;
  color: rgba(255,255,255,.25);
}

.dsp-recent-counter {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255,255,255,.55);
}

.dsp-recent-empty {
  font-size: 0.9rem;
  color: rgba(255,255,255,.2);
  padding: 1rem;
  text-align: center;
}

/* ── Pied de page ────────────────────────────────────────── */

.dsp-footer {
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 2rem;
  padding: 0.875rem 2rem;
  background: rgba(255,255,255,.025);
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.dsp-stat {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.dsp-stat-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--white);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.dsp-stat-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,.35);
  font-weight: 500;
}

/* ── SSE + audio controls ────────────────────────────────── */

.sse-status {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
}

.sse-connecting {
  color: rgba(255,255,255,.35);
  background: rgba(255,255,255,.05);
}

.sse-live {
  color: #10B981;
  background: rgba(16,185,129,.12);
  border: 1px solid rgba(16,185,129,.25);
}

.sse-offline {
  color: #F59E0B;
  background: rgba(245,158,11,.1);
  border: 1px solid rgba(245,158,11,.2);
  animation: blink-status 1.2s step-end infinite;
}

@keyframes blink-status {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.35; }
}

@keyframes highlight-pulse-glow {
  0%   { transform: scale(1); box-shadow: 0 0 0 0 rgba(59,130,246,.55); }
  40%  { transform: scale(1.025); box-shadow: 0 0 0 28px rgba(59,130,246,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59,130,246,0); }
}

.dsp-audio-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dsp-mode-pick {
  display: flex;
  gap: 0.35rem;
}

.dsp-mode-btn {
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.45);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: background .15s, color .15s;
}

.dsp-mode-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

.dsp-mode-btn--active {
  background: rgba(29,78,216,.3) !important;
  border-color: rgba(29,78,216,.5) !important;
  color: #fff !important;
}

.dsp-mode-exp-tag {
  font-size: 0.55rem;
  background: rgba(245,158,11,.2);
  color: #F59E0B;
  padding: 0.05rem 0.3rem;
  border-radius: 4px;
  margin-left: 0.2rem;
}

.dsp-volume-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,.4);
  font-size: 0.8rem;
}

.dsp-volume-slider { width: 80px; accent-color: #1D4ED8; }

.dsp-audio-hidden { display: none !important; }

.dsp-lang-pick {
  display: flex;
  gap: 0.25rem;
}

.dsp-lang-btn {
  padding: 0.25rem 0.5rem;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.4);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 700;
  transition: background .15s, color .15s;
}

.dsp-lang-btn:hover { background: rgba(255,255,255,.1); color: #fff; }

.dsp-lang-btn--active {
  background: rgba(29,78,216,.3) !important;
  border-color: rgba(29,78,216,.5) !important;
  color: #fff !important;
}

/* ── UI Language picker (display labels) ──────────────────── */
.dsp-ui-lang-pick {
  display: flex;
  gap: 0.2rem;
  align-items: center;
}

.dsp-ui-lang-btn {
  padding: 0.25rem 0.35rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background .15s, border-color .15s, transform .1s;
  opacity: 0.55;
}

.dsp-ui-lang-btn:hover {
  background: rgba(255,255,255,.1);
  opacity: 0.85;
}

.dsp-ui-lang-btn--active {
  background: rgba(29,78,216,.25) !important;
  border-color: rgba(59,130,246,.5) !important;
  opacity: 1 !important;
  transform: scale(1.1);
}

.hidden { display: none !important; }

/* ============================================================
   15. Stats — page /stats
   ============================================================ */

/* ---- Layout ---- */
.page-stats .stats-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* ---- Page header ---- */
.stats-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.stats-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.stats-date {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
  text-transform: capitalize;
}

/* ---- KPI grid ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-left-width: 4px;
  transition: box-shadow 150ms ease;
}

.kpi-card:hover { box-shadow: var(--shadow-md); }

.kpi-card--blue  { border-left-color: #3B82F6; }
.kpi-card--green { border-left-color: #10B981; }
.kpi-card--red   { border-left-color: #EF4444; }
.kpi-card--amber { border-left-color: #F59E0B; }

.kpi-icon-wrap {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon-wrap svg {
  width: 1.25rem;
  height: 1.25rem;
}

.kpi-card--blue  .kpi-icon-wrap { background: rgba(59,130,246,.1);  color: #3B82F6; }
.kpi-card--green .kpi-icon-wrap { background: rgba(16,185,129,.1);  color: #10B981; }
.kpi-card--red   .kpi-icon-wrap { background: rgba(239,68,68,.1);   color: #EF4444; }
.kpi-card--amber .kpi-icon-wrap { background: rgba(245,158,11,.1);  color: #F59E0B; }

.kpi-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.kpi-value {
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.kpi-sub {
  font-size: 0.75rem;
  color: #10B981;
  font-weight: 600;
  margin-top: 0.2rem;
}

/* ---- Highlight panel (avg wait) ---- */
.stats-highlight-panel {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.stats-highlight-icon {
  font-size: 2.5rem;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.5;
}

.stats-highlight-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.stats-highlight-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  line-height: 1;
}

.stats-highlight-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.375rem;
}

.stats-highlight-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Success rate circle */
.stats-highlight-rate {
  flex-shrink: 0;
}

.rate-circle {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: conic-gradient(#10B981 0%, transparent 0%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--border);
  position: relative;
}

.rate-value {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.rate-label {
  font-size: 0.5625rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---- Per-service table ---- */
.stats-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.stats-table th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.stats-table td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

.stats-table .col-num {
  text-align: right;
  white-space: nowrap;
}

.stats-table .col-wide {
  min-width: 160px;
}

.stats-table tbody tr:last-child td { border-bottom: none; }

.stats-table tbody tr.row-empty td { opacity: 0.45; }

.stats-table tfoot tr.row-total td {
  border-top: 2px solid var(--border);
  background: var(--surface-alt, var(--bg));
  font-size: 0.875rem;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}

/* Service badge (prefix letter) */
.cell-service {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 600;
}

.service-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: rgba(99,102,241,.12);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 800;
  flex-shrink: 0;
}

/* Colored counters */
.num-done   { color: #10B981; font-weight: 600; }
.num-noshow { color: var(--text-muted); font-weight: 500; }
.num-noshow.has-noshow { color: #EF4444; font-weight: 700; }

/* Progress bar */
.progress-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.progress-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 400ms ease;
  background: #94A3B8;
}

.progress-fill--good { background: #10B981; }
.progress-fill--mid  { background: #F59E0B; }
.progress-fill--low  { background: #EF4444; }

.progress-pct {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 2.5rem;
  text-align: right;
}

/* ---- Footnote ---- */
.stats-footnote {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

/* ==========================================================================
   Section 16 — Kiosk: Language selection + Search bar
   ========================================================================== */

/* Language selection page */
.page-lang { background: var(--bg); }

.lang-main {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  padding: 2rem 1rem;
}

.lang-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lang-brand-logo {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--primary);
}

.lang-brand-name {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.lang-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
}

.lang-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 2.5rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-decoration: none;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
  min-width: 9rem;
}

.lang-card:hover,
.lang-card:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
  transform: translateY(-2px);
  outline: none;
}

.lang-flag {
  font-size: 3rem;
  line-height: 1;
}

.lang-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.lang-footer {
  margin-top: auto;
  padding-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Kiosk search bar */
.kiosk-search-wrap {
  position: relative;
  width: 100%;
  max-width: 36rem;
  margin: 0 auto 1.5rem;
}

.kiosk-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-muted);
  pointer-events: none;
}

.kiosk-search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  font-size: 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 150ms, box-shadow 150ms;
  box-sizing: border-box;
}

.kiosk-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent);
}

/* Back-to-lang link in kiosk footer */
.kiosk-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.kiosk-back-lang {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 150ms;
}

.kiosk-back-lang:hover { color: var(--primary); }

/* ============================================================
   16. PAGE ADMIN
   ============================================================ */

.page-admin { background: var(--gray-100); }

.admin-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* ── En-tête de page ─────────────────────────────────────── */

.admin-page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-breadcrumb {
  font-size: 0.8rem;
  color: var(--gray-400);
  text-decoration: none;
  display: block;
  margin-bottom: 0.25rem;
}
.admin-breadcrumb:hover { color: var(--primary); }

.admin-page-title {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--gray-900);
  margin: 0;
  letter-spacing: -0.02em;
}
.admin-page-subtitle {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin: 0.25rem 0 0;
}

/* ── KPIs dashboard ──────────────────────────────────────── */

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.admin-kpi-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.375rem 1.5rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid transparent;
}
.admin-kpi-card--blue   { border-left-color: var(--primary); }
.admin-kpi-card--indigo { border-left-color: #6366F1; }
.admin-kpi-card--amber  { border-left-color: var(--warning); }
.admin-kpi-card--green  { border-left-color: var(--success); }

.admin-kpi-value {
  font-size: 2.25rem;
  font-weight: 900;
  color: var(--gray-900);
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.admin-kpi-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 500;
  margin-top: 0.375rem;
}

/* ── Accès rapides dashboard ─────────────────────────────── */

.admin-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.admin-quick-card {
  display: flex;
  align-items: center;
  gap: 1.125rem;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-xl);
  padding: 1.375rem 1.5rem;
  text-decoration: none;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  box-shadow: var(--shadow-sm);
}
.admin-quick-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md), 0 0 0 3px var(--primary-bg);
  transform: translateY(-2px);
  text-decoration: none;
}

.admin-quick-icon {
  font-size: 1.75rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-bg);
  border-radius: var(--radius);
  flex-shrink: 0;
  color: var(--primary);
}

.admin-quick-body { flex: 1; }

.admin-quick-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--gray-900);
}
.admin-quick-hint {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 0.125rem;
}
.admin-quick-arrow {
  color: var(--gray-300);
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Tableau de liste ────────────────────────────────────── */

.admin-table-wrap {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.admin-table thead tr {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.admin-table th {
  padding: 0.625rem 1rem;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray-400);
}

.admin-table td {
  padding: 0.75rem 1rem;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: var(--gray-50); }

.admin-row--inactive td { color: var(--gray-400); }
.admin-row--inactive .admin-prefix-badge,
.admin-row--inactive .admin-number-badge {
  background: var(--gray-200);
  color: var(--gray-500);
}

/* ── Cellules spéciales ──────────────────────────────────── */

.admin-prefix-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: var(--primary);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 800;
}

.admin-number-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  background: var(--gray-100);
  color: var(--gray-700);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.admin-code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.78rem;
  background: var(--gray-100);
  color: var(--gray-700);
  padding: 0.125rem 0.4rem;
  border-radius: var(--radius-sm);
}

.admin-name-cell {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.admin-name-sub {
  font-size: 0.75rem;
  color: var(--gray-400);
}

.admin-empty-cell {
  text-align: center;
  color: var(--gray-400);
  padding: 2.5rem !important;
  font-size: 0.875rem;
}
.admin-empty-cell a { color: var(--primary); }

/* ── Badges statut ───────────────────────────────────────── */

.admin-status-badge {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
  font-family: var(--font);
  transition: opacity var(--transition);
}
.admin-status-badge:hover { opacity: 0.8; }

.admin-status-badge--active    { background: var(--success-bg);  color: #065F46; border: 1px solid #A7F3D0; }
.admin-status-badge--inactive  { background: var(--gray-100);    color: var(--gray-500); border: 1px solid var(--gray-200); }
.admin-status-badge--open      { background: var(--primary-bg);  color: var(--primary-dark); border: 1px solid #BFDBFE; }
.admin-status-badge--closed    { background: var(--danger-bg);   color: #991B1B; border: 1px solid #FECACA; }
.admin-status-badge--neutral    { background: #F3F4F6; color: #374151; border: 1px solid #D1D5DB; }
.admin-status-badge--completed  { background: #EDE9FE; color: #5B21B6; border: 1px solid #C4B5FD; }
.admin-status-badge--scheduled  { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }

.admin-toggle-form { display: inline; }

/* ── Formulaire admin ────────────────────────────────────── */

.admin-alert { margin-bottom: 0; }

.admin-form-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.admin-fieldset {
  border: none;
  border-bottom: 1px solid var(--gray-100);
  margin: 0;
  padding: 1.5rem 2rem;
}
.admin-fieldset:last-of-type { border-bottom: none; }

.admin-fieldset-legend {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-400);
  margin-bottom: 1rem;
  padding: 0;
  width: 100%;
}

.admin-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 600px) {
  .admin-form-row { grid-template-columns: 1fr; }
}

.admin-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.admin-form-group--sm { max-width: 140px; }
@media (max-width: 600px) {
  .admin-form-group--sm { max-width: 100%; }
}

.admin-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-700);
}
.admin-required { color: var(--danger); margin-left: 0.125rem; }
.admin-optional { font-weight: 400; color: var(--gray-400); }

.admin-input {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
  box-sizing: border-box;
}
.admin-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}
.admin-input--error { border-color: var(--danger); }
.admin-input--error:focus { box-shadow: 0 0 0 3px var(--danger-bg); }
.admin-input--center { text-align: center; text-transform: uppercase; }

.admin-textarea {
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-family: var(--font);
  color: var(--gray-900);
  resize: vertical;
  width: 100%;
  box-sizing: border-box;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.admin-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.admin-field-error {
  font-size: 0.75rem;
  color: var(--danger);
  font-weight: 500;
}
.admin-field-hint {
  font-size: 0.72rem;
  color: var(--gray-400);
}

.admin-checkbox-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.admin-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  cursor: pointer;
}

.admin-checkbox {
  width: 1rem;
  height: 1rem;
  margin-top: 0.125rem;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.admin-checkbox-text {
  font-size: 0.875rem;
  color: var(--gray-700);
  line-height: 1.5;
}

.admin-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.25rem 2rem;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
}

/* =====================================================================
   Section 17 — Bannière avertissement impression (ticket-created)
   ===================================================================== */

.print-warning-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 480px;
  margin: 0 auto 1.25rem;
  padding: 0.875rem 1.25rem;
  background: #FEF3C7;
  border: 1px solid #F59E0B;
  border-left: 4px solid #F59E0B;
  border-radius: var(--radius);
  color: #92400E;
  font-size: 0.9rem;
  line-height: 1.4;
}

.print-warning-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* alert-warning (réutilisable dans les fragments flash) */
.alert-warning {
  background: #FEF3C7;
  border-color: #F59E0B;
  color: #92400E;
}

/* =====================================================================
   Section 18 — Prévisualisation ticket thermique (/tickets/{id}/print-preview)
   ===================================================================== */

/* Page hôte */
.thermal-page {
  min-height: 100vh;
  background: #E5E7EB;
  font-family: 'Courier New', Courier, monospace;
}

/* ── Barre d'outils dev ─────────────────────────────────────────────── */
.thermal-toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #1E293B;
  color: #F1F5F9;
  padding: 0.6rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
}
.thermal-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 720px;
  margin: 0 auto;
}
.thermal-toolbar-left  { display: flex; align-items: center; gap: 0.75rem; }
.thermal-toolbar-right { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.thermal-back-link {
  color: #93C5FD;
  text-decoration: none;
}
.thermal-back-link:hover { text-decoration: underline; }

.thermal-toolbar-label {
  color: #94A3B8;
  font-size: 0.75rem;
}

.thermal-lang-label { color: #94A3B8; }
.thermal-lang-btn {
  color: #CBD5E1;
  text-decoration: none;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-weight: 500;
}
.thermal-lang-btn:hover        { background: #334155; color: #F1F5F9; }
.thermal-lang--active          { background: #3B82F6; color: #fff !important; }

.thermal-print-btn {
  background: #3B82F6;
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  cursor: pointer;
  font-family: var(--font-sans);
  margin-left: 0.5rem;
}
.thermal-print-btn:hover { background: #2563EB; }

/* ── Centrage du reçu ───────────────────────────────────────────────── */
.thermal-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1rem 3rem;
}

/* ── Traits de coupe ────────────────────────────────────────────────── */
.thermal-cut {
  display: flex;
  align-items: center;
  width: 320px;
  gap: 0.4rem;
  color: #9CA3AF;
  font-size: 1rem;
}
.thermal-cut-line {
  flex: 1;
  border-top: 1px dashed #9CA3AF;
}
.thermal-scissors      { user-select: none; line-height: 1; }
.thermal-scissors--flip { transform: scaleX(-1); display: inline-block; }

/* ── Corps du reçu ──────────────────────────────────────────────────── */
.thermal-receipt {
  width: 320px;
  background: #fff;
  box-shadow: 0 2px 16px rgba(0,0,0,.15);
  padding: 1.25rem 1.5rem;
}

.thermal-section {
  margin-bottom: 0.75rem;
}
.thermal-section--center { text-align: center; }
.thermal-section--left   { text-align: left; }

.thermal-establishment {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.thermal-rule {
  border: none;
  border-top: 1px dashed #9CA3AF;
  margin: 0.6rem 0;
}

.thermal-label-sm {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: #6B7280;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.thermal-ticket-number {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #111827;
  margin: 0.25rem 0;
}

.thermal-queue-label {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.thermal-datetime {
  font-size: 0.8rem;
  color: #6B7280;
  margin-top: 0.2rem;
}

.thermal-wait-msg {
  font-size: 0.78rem;
  line-height: 1.5;
  color: #374151;
  margin: 0;
}

/* ── QR code ────────────────────────────────────────────────────────── */
.thermal-qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}
.thermal-qr-placeholder {
  width: 80px;
  height: 80px;
  border: 1px solid #D1D5DB;
  padding: 6px;
  background: #fff;
}
.thermal-qr-svg {
  width: 100%;
  height: 100%;
  color: #111827;
}
.thermal-qr-url {
  font-size: 0.55rem;
  color: #9CA3AF;
  word-break: break-all;
  max-width: 200px;
  text-align: center;
}

/* ── Media print ────────────────────────────────────────────────────── */
@media print {
  .no-print { display: none !important; }

  body, .thermal-page { background: white; }

  .thermal-wrapper { padding: 0; }

  .thermal-receipt {
    box-shadow: none;
    width: 72mm;      /* largeur papier 80 mm − marges */
    padding: 4mm 6mm;
  }

  .thermal-cut    { width: 72mm; }
  .thermal-ticket-number { font-size: 28pt; }
  .thermal-establishment { font-size: 9pt; }
  .thermal-queue-label   { font-size: 9pt; }
  .thermal-datetime      { font-size: 7pt; }
  .thermal-wait-msg      { font-size: 7pt; }
  .thermal-qr-url        { font-size: 5pt; }

  @page {
    size: 80mm auto;
    margin: 4mm;
  }
}

/* =====================================================================
   Section 19 — Contrôles audio (display /display)
   Modes : OFF | DING_ONLY (défaut) | BROWSER_VOICE_EXPERIMENTAL
   ===================================================================== */

.dsp-audio-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ── Sélecteur de mode ─────────────────────────────────────────────── */
.dsp-mode-pick {
  display: flex;
  gap: 0.15rem;
}

.dsp-mode-btn {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 4px;
  color: #64748B;
  font-size: 0.72rem;
  font-family: var(--font-sans);
  padding: 0.22rem 0.55rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.dsp-mode-btn:hover {
  background: rgba(255,255,255,.12);
  color: #94A3B8;
}
.dsp-mode-btn--active {
  background: rgba(59,130,246,.22);
  border-color: rgba(59,130,246,.45);
  color: #93C5FD;
}

/* Bouton "Voix (exp)" — légèrement ambre pour signaler le caractère expérimental */
.dsp-mode-btn--exp          { color: #78716C; }
.dsp-mode-btn--exp:hover    { color: #A8A29E; }
.dsp-mode-btn--exp.dsp-mode-btn--active {
  background: rgba(251,191,36,.15);
  border-color: rgba(251,191,36,.4);
  color: #FCD34D;
}

.dsp-mode-exp-tag {
  font-size: 0.6rem;
  opacity: 0.7;
  vertical-align: super;
}

/* ── Volume ────────────────────────────────────────────────────────── */
.dsp-volume-wrap {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: default;
}
.dsp-volume-icon {
  font-size: 0.85rem;
  opacity: 0.6;
  user-select: none;
}
.dsp-volume-slider {
  -webkit-appearance: none;
  width: 68px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,.2);
  outline: none;
  cursor: pointer;
}
.dsp-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #60A5FA;
  cursor: pointer;
}
.dsp-volume-slider::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: none;
  border-radius: 50%;
  background: #60A5FA;
  cursor: pointer;
}

/* ── Sélecteur de langue (visible seulement en mode VOICE) ─────────── */
.dsp-lang-pick {
  display: flex;
  gap: 0.15rem;
}
.dsp-lang-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 4px;
  color: #64748B;
  font-size: 0.68rem;
  font-weight: 600;
  font-family: var(--font-sans);
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.dsp-lang-btn:hover   { background: rgba(255,255,255,.08); color: #94A3B8; }
.dsp-lang-btn--active { background: #3B82F6; border-color: #3B82F6; color: #fff; }

/* ── Utilitaire : masqué visuellement mais conserve l'espace ───────── */
.dsp-audio-hidden {
  visibility: hidden;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.18s;
}

/* ============================================================
   Slot Calendar — créneaux de rendez-vous
   ============================================================ */

/* ── Couleurs de créneau ─────────────────────────────────────── */
.slot-free    { --slot-bg: #ECFDF5; --slot-border: #6EE7B7; --slot-text: #065F46; }
.slot-partial { --slot-bg: #FFFBEB; --slot-border: #FCD34D; --slot-text: #92400E; }
.slot-full    { --slot-bg: #FEF2F2; --slot-border: #FCA5A5; --slot-text: #991B1B; }
.slot-blocked { --slot-bg: #F1F5F9; --slot-border: #CBD5E1; --slot-text: #64748B; }

/* ── Légende ─────────────────────────────────────────────────── */
.slot-legend {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.slot-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--slot-bg);
  border: 1px solid var(--slot-border);
  color: var(--slot-text);
}

/* ── Vue journalière : grille de cartes ──────────────────────── */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.slot-card {
  border: 1px solid var(--slot-border);
  background: var(--slot-bg);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.slot-time {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slot-text);
}
.slot-occupancy {
  font-size: 0.75rem;
  color: var(--slot-text);
  opacity: 0.75;
}

/* ── Vue hebdomadaire : grille colonnes ──────────────────────── */
.slot-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  overflow-x: auto;
  margin-top: 0.75rem;
}
.slot-week-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 90px;
}
.slot-week-day-header {
  text-align: center;
  padding: 0.4rem;
  background: var(--gray-100);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  border-bottom: 2px solid var(--gray-300);
}
.slot-week-day-name {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gray-500);
  letter-spacing: 0.05em;
}
.slot-week-day-date {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.slot-week-day-date:hover { text-decoration: underline; }

.slot-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  border: 1px solid var(--slot-border);
  background: var(--slot-bg);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--slot-text);
  cursor: default;
}
.slot-mini--empty {
  justify-content: center;
  opacity: 0.5;
}

/* ── Header calendrier ───────────────────────────────────────── */
.admin-calendar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-800);
}
.admin-calendar-date {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-600, #4B5563);
  text-transform: capitalize;
}

/* ── Navigation date ─────────────────────────────────────────── */
.admin-date-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.admin-date-range {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gray-700);
  padding: 0 0.5rem;
}

/* ── Horaires hebdo : card par jour ──────────────────────────── */
.admin-schedule-day-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow-sm);
}
.admin-schedule-day-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.admin-schedule-day-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  text-transform: capitalize;
  margin: 0;
  flex: 1;
}
.admin-schedule-form { width: 100%; }
.admin-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}
.admin-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 140px;
}
.admin-form-group--action { justify-content: flex-end; }

/* ── Admin card ──────────────────────────────────────────────── */
.admin-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.admin-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 1rem;
}

/* ============================================================
   Public Booking Flow — /book/**
   ============================================================ */

.page-book {
  background: linear-gradient(135deg, #EFF6FF 0%, #F8FAFC 60%, #F0FDF4 100%);
  min-height: 100vh;
}

/* ── Conteneur principal ─────────────────────────────────────── */
.book-main {
  max-width: 520px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}
.book-main--wide { max-width: 700px; }

/* ── Marque ──────────────────────────────────────────────────── */
.book-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.book-brand-logo {
  width: 36px;
  height: 36px;
  color: var(--primary);
}
.book-brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.03em;
}

/* ── Titres ──────────────────────────────────────────────────── */
.book-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--gray-900);
  text-align: center;
  margin: 0;
}
.book-subtitle {
  font-size: 0.9rem;
  color: var(--gray-500);
  text-align: center;
  margin: 0;
}

/* ── Barre de progression ────────────────────────────────────── */
.book-progress {
  display: flex;
  gap: 0.25rem;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}
.book-progress-step {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--gray-400);
  padding: 0.2rem 0.75rem;
  border-radius: 9999px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
}
.book-progress-step--active {
  color: var(--primary);
  background: var(--primary-bg);
  border-color: var(--primary-light);
}
.book-progress-step--done {
  color: var(--success);
  background: var(--success-bg);
  border-color: #6EE7B7;
}

/* ── Sélection langue ────────────────────────────────────────── */
.book-lang-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  width: 100%;
}
.book-lang-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--gray-800);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.book-lang-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.book-lang-flag  { font-size: 2.5rem; line-height: 1; }
.book-lang-name  { font-size: 0.9rem; }

/* ── Grille de services ──────────────────────────────────────── */
.book-service-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}
.book-service-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--gray-800);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.book-service-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow);
  transform: translateX(4px);
}
.book-service-prefix {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--primary);
  width: 2.5rem;
  text-align: center;
  flex-shrink: 0;
}
.book-service-prefix-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.book-service-body   { flex: 1; min-width: 0; }
.book-service-name   { font-weight: 700; font-size: 1rem; color: var(--gray-900); }
.book-service-desc   { font-size: 0.8rem; color: var(--gray-500); margin-top: 0.15rem; }
.book-service-arrow  { font-size: 1.2rem; color: var(--gray-400); flex-shrink: 0; }
.book-selected-service {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--gray-800);
  font-size: 1.05rem;
}
.book-selected-name { color: var(--primary-dark); }

/* ── Navigation de date ──────────────────────────────────────── */
.book-date-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  justify-content: center;
}
.book-date-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--white);
  border: 1.5px solid var(--gray-300);
  color: var(--gray-700);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition);
}
.book-date-nav-btn:hover:not(.book-date-nav-btn--disabled) {
  background: var(--primary-bg);
  border-color: var(--primary-light);
  color: var(--primary);
}
.book-date-nav-btn--disabled {
  opacity: 0.3;
  pointer-events: none;
}
.book-date-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-800);
  text-transform: capitalize;
  text-align: center;
  flex: 1;
}
.book-date-error {
  color: var(--danger);
  font-size: 0.85rem;
  text-align: center;
  padding: 0.5rem;
}

/* ── Grille des créneaux (vue publique) ──────────────────────── */
.book-slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
  width: 100%;
}
.book-slot-form { display: contents; }
.book-slot-btn {
  padding: 0.6rem 0.25rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--slot-border);
  background: var(--slot-bg);
  color: var(--slot-text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.book-slot-btn:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
/* Slot-free and slot-partial are bookable — slot-full is excluded by the service */

/* ── Review card ─────────────────────────────────────────────── */
.book-review-card, .book-confirmation-card {
  width: 100%;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.book-review-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
}
.book-review-row:last-child { border-bottom: none; }
.book-review-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.book-review-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-900);
  text-align: right;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.book-review-notice {
  font-size: 0.82rem;
  color: var(--gray-500);
  text-align: center;
  max-width: 400px;
  margin: 0;
}

/* ── E-mail capture (review page) ────────────────────────────── */
.book-email-section {
  width: 100%;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 0.875rem;
  padding: 1.25rem 1.25rem 1rem;
  margin-bottom: 1rem;
}

.book-email-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.35rem;
  cursor: default;
}

.book-email-icon { font-size: 1.05rem; }

.book-email-optional {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--gray-400);
}

.book-email-hint {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.book-email-input {
  width: 100%;
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  border: 1.5px solid var(--gray-300);
  border-radius: 0.625rem;
  background: #fff;
  color: var(--gray-800);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.book-email-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,.12);
}

/* ── Confirm button ──────────────────────────────────────────── */
.book-confirm-form { width: 100%; }
.book-confirm-btn  { width: 100%; font-size: 1.05rem; padding: 0.9rem; }

/* ── QR code ─────────────────────────────────────────────────── */
.book-qr-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.25rem;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
}
.book-qr-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 500;
  margin: 0;
}
.book-qr-img {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* ── Success banner ──────────────────────────────────────────── */
.book-success-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--success-bg);
  border: 1.5px solid #6EE7B7;
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.5rem;
  width: 100%;
}
.book-success-icon {
  font-size: 1.75rem;
  line-height: 1;
  color: var(--success);
  flex-shrink: 0;
}
.book-success-title {
  font-weight: 800;
  color: var(--success);
  font-size: 1.05rem;
}
.book-success-sub {
  font-size: 0.82rem;
  color: #065F46;
}

/* ── Reference code ──────────────────────────────────────────── */
.book-ref {
  background: var(--primary-bg);
  color: var(--primary-dark);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ── Instructions ────────────────────────────────────────────── */
.book-instructions {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.book-instructions-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 0.75rem;
}
.book-instructions-list {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.book-instructions-list li {
  font-size: 0.875rem;
  color: var(--gray-700);
  line-height: 1.5;
}

/* ── Empty state ─────────────────────────────────────────────── */
.book-empty {
  text-align: center;
  color: var(--gray-500);
  padding: 2rem;
  font-size: 0.9rem;
}
.book-empty p { margin: 0.25rem 0; }

/* ── Footer ──────────────────────────────────────────────────── */
.book-footer {
  margin-top: 0.5rem;
  width: 100%;
  text-align: center;
}
.book-footer-link {
  color: var(--gray-500);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}
.book-footer-link:hover { color: var(--primary); text-decoration: underline; }

/* ── btn-lg override ─────────────────────────────────────────── */
.btn-lg { padding: 0.875rem 1.5rem; font-size: 1rem; }

/* =============================================================================
   Kiosk — QR Check-In Scanner (Phase C)
   ============================================================================= */

/* ── Tabs ─────────────────────────────────────────────────────── */
.appt-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1.25rem auto;
  max-width: 480px;
  width: 100%;
}
.appt-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--gray-600);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.appt-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.appt-tab--active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--white);
}
.appt-tab-icon { font-size: 1.25rem; }

/* ── Panels ───────────────────────────────────────────────────── */
.appt-panel {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  gap: 1rem;
}
.appt-panel--active { display: flex; }

/* ── Alert variants (extended) ────────────────────────────────── */
.appt-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  max-width: 480px;
  width: 100%;
  margin: 0 auto 0.5rem;
}
.appt-alert--warning  { background: #fff8e1; border-left: 4px solid #f59e0b; }
.appt-alert--error    { background: #fef2f2; border-left: 4px solid var(--danger); }
.appt-alert--info     { background: #eff6ff; border-left: 4px solid var(--info, #3b82f6); }
.appt-alert--cancelled{ background: #f3f4f6; border-left: 4px solid var(--gray-500); }
.appt-alert-icon { font-size: 1.5rem; flex-shrink: 0; line-height: 1; }
.appt-alert-body { flex: 1; }
.appt-alert-body p   { margin: 0 0 0.25rem; line-height: 1.4; }
.appt-alert-hint     { font-size: 0.85rem; color: var(--gray-600); }

/* ── QR Camera ────────────────────────────────────────────────── */
.qr-camera-wrap {
  position: relative;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #000;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.qr-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Animated viewfinder corners */
.qr-viewfinder {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.qr-corner {
  position: absolute;
  width: 36px;
  height: 36px;
  border-color: var(--primary);
  border-style: solid;
}
.qr-corner--tl { top: 16px; left: 16px; border-width: 3px 0 0 3px; border-radius: 4px 0 0 0; }
.qr-corner--tr { top: 16px; right: 16px; border-width: 3px 3px 0 0; border-radius: 0 4px 0 0; }
.qr-corner--bl { bottom: 16px; left: 16px; border-width: 0 0 3px 3px; border-radius: 0 0 0 4px; }
.qr-corner--br { bottom: 16px; right: 16px; border-width: 0 3px 3px 0; border-radius: 0 0 4px 0; }

.qr-hint {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.5rem;
  text-align: center;
  color: rgba(255,255,255,0.9);
  font-size: 0.85rem;
  font-weight: 500;
  background: linear-gradient(transparent, rgba(0,0,0,0.55));
}

/* Camera unavailable fallback */
.qr-unavailable {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem;
  background: var(--gray-50);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--gray-600);
  max-width: 380px;
  width: 100%;
}
.qr-unavail-icon { font-size: 3rem; opacity: 0.4; }

.qr-or-divider {
  color: var(--gray-400);
  font-size: 0.85rem;
  margin: 0.25rem 0;
}

/* ── Manual entry ─────────────────────────────────────────────── */
.appt-subtitle {
  color: var(--gray-600);
  text-align: center;
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

/* ============================================================
   AGENT DESKTOP — professionalized UI
   ============================================================ */

/* ── Session bar actions (compact toggle + change files) ────── */
.session-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── SSE status indicator ────────────────────────────────────── */
.sse-status {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 1000;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: background 0.3s, color 0.3s;
}
.sse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.sse-status--connected    { background: rgba(220,252,231,0.95); color: #166534; }
.sse-status--connected    .sse-dot { background: #22c55e; }
.sse-status--connecting   { background: rgba(254,249,195,0.95); color: #854d0e; }
.sse-status--connecting   .sse-dot { background: #eab308; animation: sse-pulse 1s infinite; }
.sse-status--disconnected { background: rgba(254,226,226,0.95); color: #991b1b; }
.sse-status--disconnected .sse-dot { background: #ef4444; }

@keyframes sse-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ── Metrics panel ───────────────────────────────────────────── */
.panel-metrics {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.metric-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.5rem;
  text-align: center;
}
.metric-card--appt       { border-color: #93c5fd; background: #eff6ff; }
.metric-card--walkin     { border-color: #a3e635; background: #f7fee7; }
.metric-card--saturated  { border-color: #fca5a5; background: #fef2f2; }
.metric-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
}
.metric-label {
  font-size: 0.72rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Saturation bar */
.saturation-bar-wrap {
  margin-top: 0.75rem;
}
.saturation-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 999px;
  overflow: hidden;
}
.saturation-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.4s ease;
  max-width: 100%;
}
.saturation-bar-fill--full { background: #ef4444; }

/* ── Shortcut hints ──────────────────────────────────────────── */
.shortcut-hint {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 0.7rem;
  font-family: monospace;
  color: var(--gray-600);
  margin-left: 0.25rem;
}
.shortcut-hints {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ── Source badges ───────────────────────────────────────────── */
.badge-appt {
  background: #dbeafe;
  color: #1d4ed8;
  border: 1px solid #93c5fd;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}
.badge-appt--expired {
  background: var(--gray-100);
  color: var(--gray-500);
  border-color: var(--gray-300);
}
.badge-walkin {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* ── Ticket meta — appointment time display ──────────────────── */
.ticket-appt-time {
  font-size: 0.8rem;
  color: #1d4ed8;
  font-weight: 500;
}

/* ── Compact mode ────────────────────────────────────────────── */
.compact-mode .panel-metrics   { display: none; }
.compact-mode .panel-queue     { display: none; }
.compact-mode .ticket-meta     { font-size: 0.78rem; }
.compact-mode .ticket-actions  { gap: 0.25rem; }
.compact-mode .btn-call        { padding: 0.5rem 1rem; font-size: 0.9rem; }
.compact-mode .panel           { padding: 0.75rem; margin-bottom: 0.5rem; }
.compact-mode .ticket-row      { padding: 0.5rem; }

/* ============================================================
   OPS DASHBOARD
   ============================================================ */

.page-ops { background: var(--gray-50); }

.ops-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

/* ── Header ─────────────────────────────────────────────────── */
.ops-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.ops-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 0.2rem;
}
.ops-date { color: var(--gray-500); font-size: 0.9rem; }
.ops-header-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ── KPI grid ────────────────────────────────────────────────── */
.ops-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.ops-kpi-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1rem;
  text-align: center;
}
.ops-kpi-card--appt    { border-color: #93c5fd; background: #eff6ff; }
.ops-kpi-card--walkin  { border-color: #a3e635; background: #f7fee7; }
.ops-kpi-card--alert   { border-color: #fca5a5; background: #fef2f2; }
.ops-kpi-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
}
.ops-kpi-label {
  font-size: 0.72rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Panel ───────────────────────────────────────────────────── */
.ops-panel { margin-bottom: 1.25rem; }

/* ── Metrics table ───────────────────────────────────────────── */
.ops-table-wrap { overflow-x: auto; }
.ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.ops-table th {
  background: var(--gray-50);
  color: var(--gray-600);
  font-weight: 600;
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 2px solid var(--gray-200);
  white-space: nowrap;
}
.ops-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.ops-table .col-num { text-align: right; }
.ops-table .col-wide { min-width: 130px; }
.ops-table .num-appt   { color: #1d4ed8; font-weight: 600; }
.ops-table .num-noshow { color: #dc2626; font-weight: 600; }
.ops-row--saturated td { background: #fef2f2 !important; }

.policy-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  background: var(--gray-100);
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--gray-600);
  font-weight: 500;
  white-space: nowrap;
}

/* ── Device grid ─────────────────────────────────────────────── */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.device-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.device-card--online  { border-color: #86efac; }
.device-card--offline { border-color: #fca5a5; background: #fef2f2; }
.device-icon { font-size: 1.5rem; }
.device-label { font-weight: 600; font-size: 0.9rem; color: var(--gray-800); }
.device-id    { font-size: 0.75rem; color: var(--gray-500); font-family: monospace; }
.device-state { display: flex; align-items: center; gap: 0.4rem; }
.state-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.state-dot--online  { background: #22c55e; }
.state-dot--offline { background: #ef4444; }
.state-label { font-size: 0.8rem; font-weight: 600; }
.device-card--online  .state-label { color: #166534; }
.device-card--offline .state-label { color: #991b1b; }
.device-lastseen { font-size: 0.72rem; color: var(--gray-400); }

/* ── Counter chips ────────────────────────────────────────────── */
.counter-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.25rem 0; }
.counter-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  font-size: 0.85rem;
}
.counter-chip-num {
  font-weight: 700;
  background: var(--primary);
  color: var(--white);
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
}
.counter-chip-label { color: var(--gray-700); }

/* ── Footnote ─────────────────────────────────────────────────── */
.ops-footnote {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--gray-400);
  text-align: center;
}

.ops-flash {
  margin: 0 0 1rem;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
}
.ops-flash--success {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #6ee7b7;
}
.ops-flash--error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
}

/* ============================================================
   TRACKING PAGE  (/track/{id})
   Mobile-first — scanned from a QR code on a phone
   ============================================================ */

.page-track {
  background: var(--qflow-surface);
  min-height: 100vh;
  font-family: 'Inter', sans-serif;
}

.track-main {
  max-width: 440px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.track-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
}

.track-brand-icon { border-radius: 6px; }

.track-card {
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
  padding: 2rem 1.75rem 1.5rem;
  width: 100%;
}

.track-number {
  font-size: clamp(3rem, 15vw, 4.5rem);
  font-weight: 900;
  color: var(--primary);
  text-align: center;
  letter-spacing: -0.04em;
  line-height: 1;
}

.track-service {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-top: 0.25rem;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Progress steps ───────────────────────────────────────── */

.track-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.track-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
}

.track-step-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  background: #fff;
  transition: all .25s;
}

.track-step--active .track-step-dot {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(29,78,216,.15);
  transform: scale(1.3);
}

.track-step--done .track-step-dot {
  border-color: var(--success);
  background: var(--success);
}

.track-step-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--gray-400);
  text-align: center;
  white-space: nowrap;
}

.track-step--active .track-step-label { color: var(--primary); }
.track-step--done   .track-step-label { color: var(--success); }

.track-step-line {
  flex: 1;
  height: 2px;
  background: var(--gray-200);
  margin: 0 4px;
  margin-top: -1rem; /* align with dot center */
  transition: background .25s;
}

.track-step-line--done { background: var(--success); }

/* ── Status blocks ─────────────────────────────────────────── */

.track-info { margin-bottom: 1rem; }

.track-status-block {
  text-align: center;
  padding: 1.25rem 1rem;
  border-radius: 0.875rem;
}

.track-status-icon {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
}

.track-status-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 0.75rem;
}

.track-status-waiting { background: #FFF7ED; }
.track-status-called  { background: #FFFBEB; }
.track-status-serving { background: #F0FDF4; }
.track-status-done    { background: #F0FDF4; }
.track-status-noshow  { background: #FEF2F2; }

.track-queue-pos {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.track-pos-num {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--warning);
  line-height: 1;
}

.track-pos-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-600);
}

.track-est-wait {
  font-size: 0.875rem;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.track-hint {
  font-size: 0.82rem;
  color: var(--gray-500);
  margin: 0.5rem 0 0;
}

.track-counter-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  padding: 0.4rem 1.25rem;
  border-radius: 999px;
  margin-bottom: 0.5rem;
}

.track-refresh-notice {
  text-align: center;
  font-size: 0.72rem;
  color: var(--gray-400);
  margin-top: 0.75rem;
}

.track-footer {
  font-size: 0.75rem;
  color: var(--gray-400);
}
.track-footer a { color: var(--gray-400); text-decoration: none; }
.track-footer a:hover { color: var(--primary); }

/* ── QR code block in kiosk ticket receipt ────────────────── */

.receipt-qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem 0 0.5rem;
  border-top: 1px dashed var(--gray-200);
  margin-top: 0.5rem;
}

.receipt-qr-img {
  border-radius: 8px;
  border: 1px solid var(--gray-200);
}

.receipt-qr-hint {
  font-size: 0.72rem;
  color: var(--gray-400);
  text-align: center;
}

/* ── Kiosk — notify (contact info) step ───────────────────── */

.page-kiosk-notify .kiosk-notify-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.25rem 6rem;
  min-height: 100dvh;
  gap: 1.5rem;
}

.notify-bell {
  font-size: 3rem;
  margin-bottom: 0.25rem;
}

.kiosk-hero--sm { padding: 1.5rem 1rem; }
.kiosk-title--sm { font-size: clamp(1.4rem, 4vw, 2rem); }

.notify-service-name {
  font-weight: 700;
  color: var(--primary);
}

.notify-optional {
  font-size: 0.8em;
  color: var(--gray-400);
  font-weight: 400;
}

.notify-form {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.notify-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notify-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notify-label-icon { font-size: 1.2rem; }

.notify-input {
  width: 100%;
  padding: 0.9rem 1.1rem;
  font-size: clamp(1rem, 3vw, 1.15rem);
  border: 2px solid var(--gray-300);
  border-radius: 0.75rem;
  background: #fff;
  color: var(--gray-800);
  outline: none;
  transition: border-color 0.18s;
}

.notify-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,.12);
}

.notify-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.notify-btn-confirm {
  background: var(--primary);
  color: #fff;
  font-size: clamp(1rem, 3vw, 1.15rem);
  font-weight: 700;
  padding: 1rem 1.5rem;
  border-radius: 0.875rem;
  border: none;
  cursor: pointer;
  transition: background 0.18s, transform 0.12s;
}

.notify-btn-confirm:active { transform: scale(0.98); }

.notify-btn-skip {
  background: transparent;
  color: var(--gray-500);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--gray-300);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.notify-btn-skip:hover {
  color: var(--gray-700);
  border-color: var(--gray-400);
}

/* ── Stats — chart section ─────────────────────────────────── */

.stats-chart-section { margin-top: 1.5rem; }

.stats-chart-wrap {
  background: #fff;
  border-radius: 0.875rem;
  border: 1px solid var(--gray-200);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

/* ═══════════════════════════════════════════════════════════════
   PROFILE PAGE
   ═══════════════════════════════════════════════════════════════ */

.profile-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 768px) {
  .profile-layout { grid-template-columns: 1fr; }
}

/* ── Avatar card (left column) ─────────────────────────────── */
.profile-avatar-card {
  background: var(--white);
  border-radius: 1rem;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  position: sticky;
  top: 1.5rem;
}

.profile-avatar-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #0a58ca 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.5rem;
  box-shadow: 0 4px 14px rgba(13,110,253,.35);
}

.profile-avatar-initials {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.02em;
}

.profile-avatar-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-top: 0.25rem;
}

.profile-avatar-username {
  font-size: 0.8rem;
  color: var(--gray-400);
  font-family: 'Courier New', monospace;
}

.profile-avatar-meta {
  width: 100%;
  margin-top: 1.25rem;
  border-top: 1px solid var(--gray-100);
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.profile-meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.profile-meta-icon { font-size: 0.9rem; flex-shrink: 0; }

.profile-meta-label {
  color: var(--gray-400);
  flex: 1;
  text-align: left;
}

.profile-meta-value {
  font-weight: 600;
  color: var(--gray-700);
}

/* ── Section cards (right column) ──────────────────────────── */
.profile-form-area {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.profile-section-card {
  background: var(--white);
  border-radius: 1rem;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.profile-section-header {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.profile-section-icon {
  font-size: 1.3rem;
  line-height: 1;
  margin-top: 0.1rem;
  flex-shrink: 0;
}

.profile-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gray-800);
}

.profile-section-desc {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 0.15rem;
}

.profile-section-body {
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
@media (max-width: 600px) {
  .profile-section-body { grid-template-columns: 1fr; }
}

/* ── Fields ─────────────────────────────────────────────────── */
.profile-field-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.profile-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.profile-input {
  padding: 0.6rem 0.875rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 0.625rem;
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  box-sizing: border-box;
}
.profile-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13,110,253,.12);
}
.profile-input.admin-input--error {
  border-color: var(--danger);
}

.profile-select-wrap {
  position: relative;
}
.profile-select {
  appearance: none;
  padding-right: 2rem;
  cursor: pointer;
}
.profile-select-arrow {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-400);
  pointer-events: none;
  font-size: 0.75rem;
}

.profile-hint {
  font-size: 0.72rem;
  color: var(--gray-400);
  line-height: 1.4;
}

/* ── Password toggle ────────────────────────────────────────── */
.profile-password-wrap {
  position: relative;
}
.profile-password-wrap .profile-input {
  padding-right: 2.5rem;
}
.profile-toggle-pw {
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.profile-toggle-pw:hover { color: var(--gray-700); }

/* ── Actions bar ────────────────────────────────────────────── */
.profile-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
}

.profile-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.6rem 1.4rem;
  font-size: 0.9rem;
}


/* ============================================================
   RESPONSIVE — Mobile fixes (max 640px)
   ============================================================ */

@media (max-width: 640px) {
  /* Ops dashboard */
  .ops-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .ops-header-actions { flex-wrap: wrap; }
  .ops-table-wrap { font-size: 0.75rem; }
  .ops-kpi-grid { grid-template-columns: 1fr 1fr; }

  /* Booking flow */
  .book-main { padding: 1rem; }
  .book-review-card { padding: 1rem; }
  .book-confirm-form { width: 100%; }
  .book-confirm-btn { width: 100%; }

  /* Kiosk notify */
  .notify-form { padding: 1rem; }
  .notify-actions { flex-direction: column; }
  .notify-btn-confirm, .notify-btn-skip { width: 100%; }

  /* Agent */
  .session-bar { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .ticket-row { flex-wrap: wrap; gap: 0.5rem; }
  .ticket-actions { flex-wrap: wrap; }
}
