/* ================================================================
   POINTAGE PRO — Design System
   ================================================================ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
  --brand:        #6366F1;
  --brand-50:     #EEF2FF;
  --brand-100:    #E0E7FF;
  --brand-600:    #4F46E5;
  --brand-700:    #4338CA;

  --emerald:      #10B981;
  --emerald-bg:   #ECFDF5;
  --rose:         #F43F5E;
  --rose-bg:      #FFF1F2;
  --amber:        #F59E0B;
  --amber-bg:     #FFFBEB;
  --sky:          #0EA5E9;
  --sky-bg:       #F0F9FF;
  --violet:       #8B5CF6;
  --violet-bg:    #F5F3FF;

  --bg:           #F8FAFC;
  --surface:      #FFFFFF;
  --surface-2:    #F1F5F9;
  --border:       #E2E8F0;
  --text:         #0F172A;
  --text-2:       #475569;
  --text-3:       #64748B;

  --nav-bg:       #1E293B;
  --nav-border:   #334155;
  --nav-h:        60px;
  --bottom-h:     64px;

  --radius-sm:    8px;
  --radius:       12px;
  --radius-lg:    18px;
  --radius-xl:    24px;

  --shadow-sm:    0 1px 2px rgba(0,0,0,.05);
  --shadow:       0 1px 3px rgba(0,0,0,.07), 0 4px 16px rgba(0,0,0,.07);
  --shadow-md:    0 4px 12px rgba(0,0,0,.10), 0 8px 32px rgba(0,0,0,.08);
  --shadow-lg:    0 8px 24px rgba(0,0,0,.14), 0 24px 64px rgba(0,0,0,.10);

  --ease:         180ms cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --bg:           #0F172A;
  --surface:      #1E293B;
  --surface-2:    #283548;
  --border:       #334155;
  --text:         #F1F5F9;
  --text-2:       #94A3B8;
  --text-3:       #64748B;

  --emerald-bg:   #052e16;
  --rose-bg:      #1c0514;
  --amber-bg:     #1c1000;
  --sky-bg:       #082032;
  --violet-bg:    #150d2e;
  --brand-50:     #1e1b4b;
  --brand-100:    #312e81;

  --shadow-sm:    0 1px 2px rgba(0,0,0,.25);
  --shadow:       0 1px 3px rgba(0,0,0,.35), 0 4px 16px rgba(0,0,0,.25);
  --shadow-md:    0 4px 12px rgba(0,0,0,.45), 0 8px 32px rgba(0,0,0,.35);
  --shadow-lg:    0 8px 24px rgba(0,0,0,.55), 0 24px 64px rgba(0,0,0,.45);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { min-height: 100%; }

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background var(--ease), color var(--ease);
}

main { flex: 1; }

/* ── Smooth theme transitions ───────────────────────────────── */
.box, .input, .select select, .textarea, .button,
.tag, .notification, .modal-card, .modal-card-head,
.modal-card-foot, .navbar, .stat-card, .action-card,
.pin-modal-content, .kiosk-card, .table td, .table th {
  transition: background-color var(--ease), color var(--ease),
              border-color var(--ease), box-shadow var(--ease);
}

/* ── Bulma overrides ────────────────────────────────────────── */
.box {
  background: var(--surface) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
}

.title  { color: var(--text) !important; }
.label  { color: var(--text-2) !important; font-weight: 500; font-size: .875rem; }
.subtitle, .has-text-grey { color: var(--text-2) !important; }

.input, .textarea, .select select {
  background: var(--surface) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-sm) !important;
  font-size: .9375rem;
  height: 2.75rem;
}
.input::placeholder, .textarea::placeholder { color: var(--text-3) !important; }
.input:focus, .select select:focus, .textarea:focus {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,.18) !important;
  outline: none;
}
[data-theme="dark"] .select::after { border-color: var(--text-3) !important; }

/* Tables */
.table { background: transparent !important; color: var(--text); }
.table thead th {
  background: var(--surface-2) !important;
  color: var(--text-2) !important;
  border-color: var(--border) !important;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.table td {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
  vertical-align: middle;
}
.table.is-striped tbody tr:nth-child(even) td { background: var(--surface-2) !important; }
.table.is-hoverable tbody tr:hover td { background: var(--brand-50) !important; }

/* Tags */
.tag { border-radius: 6px !important; font-weight: 500; font-size: .75rem; }
.tag.is-success.is-light { background: var(--emerald-bg) !important; color: var(--emerald) !important; }
.tag.is-danger.is-light  { background: var(--rose-bg) !important;    color: var(--rose) !important; }
.tag.is-info.is-light    { background: var(--sky-bg) !important;      color: var(--sky) !important; }
.tag.is-warning.is-light { background: var(--amber-bg) !important;    color: var(--amber) !important; }
.tag.is-primary.is-light { background: var(--brand-50) !important;    color: var(--brand) !important; }
.tag.is-light            { background: var(--surface-2) !important;   color: var(--text-2) !important; }

/* Buttons */
.button {
  border-radius: var(--radius-sm) !important;
  font-weight: 500;
  transition: all var(--ease) !important;
}
.button.is-primary {
  background: var(--brand) !important;
  border-color: var(--brand) !important;
}
.button.is-primary:hover {
  background: var(--brand-600) !important;
  border-color: var(--brand-600) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,.35) !important;
}
.button.is-light {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
  color: var(--text-2) !important;
}
.button.is-light:hover { background: var(--border) !important; color: var(--text) !important; }

.button.is-success { background: var(--emerald) !important; border-color: var(--emerald) !important; }
.button.is-danger  { background: var(--rose) !important;    border-color: var(--rose) !important; }

.button.is-success.is-light { background: var(--emerald-bg) !important; color: var(--emerald) !important; border-color: transparent !important; }
.button.is-danger.is-light  { background: var(--rose-bg) !important;    color: var(--rose) !important;    border-color: transparent !important; }
.button.is-info.is-light    { background: var(--sky-bg) !important;     color: var(--sky) !important;     border-color: transparent !important; }
.button.is-primary.is-light { background: var(--brand-50) !important;   color: var(--brand) !important;   border-color: transparent !important; }

/* Notifications */
.notification { border-radius: var(--radius) !important; }
[data-theme="dark"] .notification {
  background: var(--surface-2) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
.notification.is-success.is-light { background: var(--emerald-bg) !important; color: var(--emerald) !important; }
.notification.is-danger.is-light  { background: var(--rose-bg) !important;    color: var(--rose) !important; }

/* Modal */
[data-theme="dark"] .modal-card         { background: var(--surface) !important; }
[data-theme="dark"] .modal-card-head,
[data-theme="dark"] .modal-card-foot    { background: var(--surface-2) !important; border-color: var(--border) !important; }
[data-theme="dark"] .modal-card-title   { color: var(--text) !important; }
.modal { display: none; }
.modal.is-active { display: flex; }

/* Checkbox */
.checkbox, .radio { color: var(--text-2) !important; }

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  background: var(--nav-bg) !important;
  border-bottom: 1px solid var(--nav-border);
  min-height: var(--nav-h);
  box-shadow: 0 1px 0 rgba(255,255,255,.04), 0 2px 8px rgba(0,0,0,.2);
}
.navbar-brand .navbar-item,
.navbar-item, .navbar-link {
  color: #CBD5E1 !important;
  font-size: .9rem;
  font-weight: 500;
}
.navbar-brand .navbar-item { color: #F1F5F9 !important; font-weight: 700; font-size: 1rem; }
.navbar-item:hover, .navbar-link:hover { background: rgba(255,255,255,.07) !important; color: #fff !important; }
.navbar-item.is-active { background: rgba(99,102,241,.25) !important; color: #fff !important; }

.navbar-burger span { background: #CBD5E1 !important; }
.navbar-burger:hover { background: rgba(255,255,255,.08) !important; }

.navbar-dropdown {
  background: #1A2744 !important;
  border-top: 2px solid var(--brand) !important;
  border-radius: 0 0 var(--radius) var(--radius) !important;
  box-shadow: var(--shadow-md) !important;
}
.navbar-dropdown .navbar-item { color: #CBD5E1 !important; }
.navbar-dropdown .navbar-item:hover { background: rgba(255,255,255,.07) !important; color: #fff !important; }
.navbar-divider { background: rgba(255,255,255,.08) !important; }

#mainNavbar { background: transparent !important; }
@media screen and (max-width: 1023px) {
  #mainNavbar.is-active {
    background: #1a2744 !important;
    padding: .5rem 0 1rem;
    border-top: 1px solid var(--nav-border);
  }
}

/* Theme toggle */
.theme-toggle-btn {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 20px;
  color: #CBD5E1;
  cursor: pointer;
  font-size: .85rem;
  padding: .35rem .8rem;
  transition: all var(--ease);
  line-height: 1.5;
}
.theme-toggle-btn:hover { background: rgba(255,255,255,.15); color: #fff; }
.theme-toggle-btn .fas { transition: transform .4s ease; }
.theme-toggle-btn:active .fas { transform: rotate(25deg); }

/* ── Bottom nav (mobile admin) ──────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--bottom-h);
  background: var(--nav-bg);
  border-top: 1px solid var(--nav-border);
  z-index: 50;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (max-width: 768px) {
  .bottom-nav { display: flex; }
  main { padding-bottom: calc(var(--bottom-h) + 8px); }
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px 6px;
  text-decoration: none;
  color: #64748B;
  font-size: 10px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color var(--ease);
  letter-spacing: .02em;
}
.bottom-nav-item i { font-size: 1.15rem; }
.bottom-nav-item.active { color: #818CF8; }
.bottom-nav-item:hover { color: #94A3B8; }

/* ── Auth pages ─────────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 2.5rem 2.25rem;
}
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  margin-bottom: 2rem;
  text-decoration: none;
}
.auth-logo-icon {
  width: 44px; height: 44px;
  background: var(--brand-50);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-size: 1.2rem;
}
.auth-logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}
.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .25rem;
  line-height: 1.2;
}
.auth-subtitle {
  font-size: .875rem;
  color: var(--text-3);
  margin-bottom: 2rem;
}
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: .875rem;
  color: var(--text-3);
}
.auth-footer a { color: var(--brand); font-weight: 500; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

.field + .field { margin-top: .875rem; }
.field .label { margin-bottom: .4rem; }
.input-icon-wrap { position: relative; }
.input-icon-wrap .input { padding-left: 2.75rem; }
.input-icon-wrap .icon {
  position: absolute; left: 0; top: 0;
  height: 100%; width: 2.75rem;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
  pointer-events: none;
}

.btn-primary {
  width: 100%;
  padding: .8rem;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: all var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}
.btn-primary:hover { background: var(--brand-600); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(99,102,241,.4); }
.btn-primary:active { transform: translateY(0); }

/* ── Select entreprise ──────────────────────────────────────── */
.company-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}
.company-btn {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  cursor: pointer;
  transition: all var(--ease);
  text-align: center;
  width: 100%;
  color: var(--text);
}
.company-btn:hover {
  border-color: var(--brand);
  background: var(--brand-50);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.company-btn .co-icon {
  width: 52px; height: 52px;
  background: var(--brand-50);
  border-radius: 14px;
  margin: 0 auto .875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-size: 1.25rem;
  transition: background var(--ease);
}
.company-btn:hover .co-icon { background: var(--brand-100); }
.company-btn .co-name { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.company-btn .co-role {
  display: inline-block;
  background: var(--brand-50);
  color: var(--brand);
  font-size: .7rem;
  font-weight: 600;
  padding: .2rem .6rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ── Dashboard ──────────────────────────────────────────────── */
.dashboard-welcome {
  background: linear-gradient(135deg, var(--brand) 0%, #8B5CF6 100%);
  border-radius: var(--radius-xl);
  padding: 2rem 2.25rem;
  color: #fff;
  box-shadow: 0 4px 24px rgba(99,102,241,.35);
  margin-bottom: 1.75rem;
  position: relative;
  overflow: hidden;
}
.dashboard-welcome::after {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  pointer-events: none;
}
.dashboard-greeting {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: .25rem;
  position: relative;
}
.dashboard-greeting strong { color: #fff; }
.dashboard-subline {
  font-size: .9rem;
  opacity: .85;
  margin: 0;
  color: rgba(255,255,255,.9) !important;
  position: relative;
}

/* Stat cards */
.stat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1; color: var(--text); }
.stat-label {
  font-size: .7rem;
  color: var(--text-3);
  margin-top: .25rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}

.stat-card--blue   .stat-icon { background: var(--sky-bg);    color: var(--sky); }
.stat-card--green  .stat-icon { background: var(--emerald-bg); color: var(--emerald); }
.stat-card--purple .stat-icon { background: var(--violet-bg);  color: var(--violet); }

/* Action cards */
.action-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--text) !important;
  transition: transform var(--ease), box-shadow var(--ease), background var(--ease);
}
.action-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.action-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}
.action-title { font-weight: 700; font-size: .95rem; margin: 0 0 .15rem; color: var(--text); }
.action-desc  { font-size: .8rem; color: var(--text-3); margin: 0; }
.action-arrow { margin-left: auto; color: var(--text-3); font-size: .75rem; flex-shrink: 0; }

.action-card--primary .action-icon { background: var(--sky-bg);    color: var(--sky); }
.action-card--info    .action-icon { background: var(--brand-50);  color: var(--brand); }
.action-card--success .action-icon { background: var(--emerald-bg); color: var(--emerald); }
.action-card--warning .action-icon { background: var(--amber-bg);  color: var(--amber); }

/* ── Suivi table responsive ─────────────────────────────────── */
.suivi-filters {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}
.export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
}
.export-bar-count { font-size: .8rem; color: var(--text-3); }

@media (max-width: 768px) {
  .table-wrap { overflow-x: auto; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block !important; }
  .table tr {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    margin-bottom: .75rem;
    padding: .75rem !important;
    background: var(--surface) !important;
  }
  .table td {
    border: none !important;
    padding: .3rem .5rem !important;
    display: flex !important;
    align-items: center;
    gap: .5rem;
    background: transparent !important;
  }
  .table td::before {
    content: attr(data-label);
    font-size: .7rem;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .05em;
    min-width: 70px;
  }
}

/* ── Employees page ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  gap: .6rem;
}
.page-title .icon-badge {
  width: 36px; height: 36px;
  background: var(--brand-50);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-size: .9rem;
}

/* Employee cards on mobile */
@media (max-width: 768px) {
  .employee-table thead { display: none; }
  .employee-table, .employee-table tbody,
  .employee-table tr, .employee-table td { display: block !important; }
  .employee-table tr {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    margin-bottom: .75rem;
    padding: .875rem !important;
    background: var(--surface) !important;
    position: relative;
  }
  .employee-table td {
    border: none !important;
    padding: .2rem .5rem !important;
    background: transparent !important;
    font-size: .875rem;
  }
  .employee-table td:first-child { font-weight: 700; font-size: 1rem; color: var(--text); }
  .employee-table td.actions-cell {
    display: flex !important;
    gap: .5rem;
    margin-top: .5rem;
    padding-top: .625rem;
    border-top: 1px solid var(--border) !important;
  }
}

/* ── Settings form ──────────────────────────────────────────── */
.settings-grid {
  display: grid;
  gap: 1.5rem;
  max-width: 580px;
}
.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.settings-section-head {
  padding: 1rem 1.5rem;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: .625rem;
  font-weight: 600;
  font-size: .875rem;
  color: var(--text-2);
}
.settings-section-head i { color: var(--brand); }
.settings-section-body { padding: 1.5rem; }
.settings-section-body .field + .field { margin-top: 1rem; }

/* ── PIN Modals ─────────────────────────────────────────────── */
.pin-modal {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  visibility: hidden;
  opacity: 0;
  transition: opacity .25s, visibility .25s;
  z-index: 200;
}
.pin-modal.is-active { visibility: visible; opacity: 1; }
.pin-modal.is-active .pin-modal-content { transform: translateY(0); }

.pin-modal-content {
  position: relative;
  z-index: 1;
  background: var(--surface);
  padding: 1.75rem 1.5rem 2rem;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  text-align: center;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
  transform: translateY(60px);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
@media (min-width: 480px) {
  .pin-modal {
    align-items: center;
    padding: 1rem;
  }
  .pin-modal-content {
    border-radius: var(--radius-xl);
    transform: scale(.94);
    max-width: 340px;
  }
  .pin-modal.is-active .pin-modal-content { transform: scale(1); }
}

.pin-modal-handle {
  width: 36px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 1.25rem;
}
@media (min-width: 480px) { .pin-modal-handle { display: none; } }

.pin-modal-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: .5rem;
}
.pin-display {
  display: flex;
  justify-content: center;
  gap: .625rem;
  margin: 1rem 0;
}
.pin-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border);
  transition: all .15s;
}
.pin-dot.filled { background: var(--brand); border-color: var(--brand); transform: scale(1.1); }
.pin-dot.error  { background: var(--rose);  border-color: var(--rose); }

.pin-input {
  font-size: 2rem;
  text-align: center;
  width: 100%;
  margin-bottom: .75rem;
  letter-spacing: .5rem;
  display: none;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
  margin-top: 1rem;
}
.pin-key {
  padding: 0;
  height: 60px;
  font-size: 1.25rem;
  font-weight: 600;
  border-radius: var(--radius) !important;
  background: var(--surface-2) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  cursor: pointer;
  transition: all .1s !important;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-shadow: 0 2px 0 var(--border) !important;
}
.pin-key:active {
  transform: scale(.94) translateY(2px) !important;
  box-shadow: none !important;
}
.pin-key.is-clear { background: var(--rose-bg) !important; color: var(--rose) !important; border-color: var(--rose-bg) !important; }
.pin-key.is-submit { background: var(--emerald) !important; color: #fff !important; border-color: var(--emerald) !important; }
.pin-key.is-submit:hover { background: #059669 !important; }

/* ── Kiosk ──────────────────────────────────────────────────── */
.kiosk-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--bg);
  overflow: hidden;
}
.kiosk-top {
  text-align: center;
  padding: 2rem 1rem 1rem;
  background: var(--nav-bg);
  color: #F1F5F9;
}
.kiosk-date {
  font-size: .875rem;
  color: #94A3B8;
  text-transform: capitalize;
  font-weight: 500;
  letter-spacing: .02em;
}
.kiosk-time {
  font-size: 3.5rem;
  font-weight: 700;
  color: #F1F5F9;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  margin-top: .25rem;
}

.kiosk-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}
.kiosk-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  animation: fadeUp .4s ease both;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.kiosk-select {
  font-size: 1rem !important;
  height: 3.25rem !important;
  border-radius: var(--radius) !important;
}

.kiosk-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .875rem;
  margin-top: 1.5rem;
}
.kiosk-btn {
  height: 3.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: var(--radius-lg) !important;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  transition: all .15s !important;
  color: #fff;
  box-shadow: 0 3px 0 rgba(0,0,0,.2) !important;
}
.kiosk-btn:active { transform: translateY(2px) !important; box-shadow: none !important; }
.kiosk-btn.btn-arrive { background: var(--emerald); }
.kiosk-btn.btn-arrive:hover { background: #059669; }
.kiosk-btn.btn-leave  { background: var(--rose); }
.kiosk-btn.btn-leave:hover  { background: #E11D48; }

.kiosk-notif {
  margin: 0 1rem;
  text-align: center;
  border-radius: var(--radius-lg) !important;
  font-weight: 500;
  animation: fadeUp .25s ease;
}

.kiosk-footer {
  text-align: center;
  padding: .875rem 1rem;
  padding-bottom: calc(.875rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
}
.kiosk-admin-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  color: var(--text-3);
  font-size: .75rem;
  text-decoration: none;
  opacity: .5;
  transition: opacity var(--ease);
}
.kiosk-admin-link:hover { opacity: 1; }

.idle-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--nav-bg);
  color: #F1F5F9;
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease, visibility 0s linear .5s;
}
.idle-screen.is-active {
  opacity: 1;
  visibility: visible;
  transition: opacity .5s ease;
}
/* Le contenu dérive lentement dans l'écran pour ne pas marquer les pixels
   (écran laissé allumé en continu sur un poste kiosque). */
.idle-screen-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: idleDrift 50s ease-in-out infinite;
}
@keyframes idleDrift {
  0%   { top: 22%; left: 25%; }
  20%  { top: 20%; left: 75%; }
  40%  { top: 78%; left: 78%; }
  60%  { top: 75%; left: 22%; }
  80%  { top: 40%; left: 50%; }
  100% { top: 22%; left: 25%; }
}
.idle-screen-time {
  font-size: clamp(3.5rem, 12vw, 7rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.idle-screen-date {
  margin-top: .5rem;
  font-size: 1.1rem;
  color: #94A3B8;
  text-transform: capitalize;
  font-weight: 500;
}
.idle-screen-hint {
  margin-top: 2.5rem;
  font-size: .875rem;
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: .5rem;
  animation: idlePulse 2s ease-in-out infinite;
}
@keyframes idlePulse {
  0%, 100% { opacity: .4; }
  50%      { opacity: 1; }
}

/* Shake animation */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  15%      { transform: translateX(-8px); }
  30%      { transform: translateX(8px); }
  45%      { transform: translateX(-5px); }
  60%      { transform: translateX(5px); }
  75%      { transform: translateX(-3px); }
  90%      { transform: translateX(3px); }
}
.shake { animation: shake .5s ease; }

/* ── PWA install banner ──────────────────────────────────────── */
#pwa-banner {
  display: none;
  position: fixed;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--nav-bg);
  color: #F1F5F9;
  border: 1px solid var(--nav-border);
  border-radius: var(--radius-lg);
  padding: .875rem 1.25rem;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  align-items: center;
  gap: 1rem;
  width: calc(100% - 2rem);
  max-width: 420px;
  animation: slideUp .35s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
#pwa-banner.visible { display: flex; }
#pwa-banner img { width: 36px; height: 36px; border-radius: 8px; }
#pwa-banner p { margin: 0; font-size: .875rem; line-height: 1.4; }
#pwa-banner strong { color: #fff; }
.pwa-banner-actions { display: flex; gap: .5rem; margin-left: auto; flex-shrink: 0; }
.pwa-install-btn {
  background: var(--brand); color: #fff; border: none;
  border-radius: var(--radius-sm); padding: .5rem .875rem;
  font-size: .8rem; font-weight: 600; cursor: pointer;
  white-space: nowrap;
  transition: background var(--ease);
}
.pwa-install-btn:hover { background: var(--brand-600); }
.pwa-dismiss-btn {
  background: transparent; color: #94A3B8; border: none;
  font-size: 1.25rem; cursor: pointer; line-height: 1;
  padding: .25rem;
}

/* ── Helpers ────────────────────────────────────────────────── */
.has-text-primary { color: var(--brand) !important; }
[data-theme="dark"] .has-text-primary { color: #818CF8 !important; }
[data-theme="dark"] .has-text-grey    { color: var(--text-2) !important; }
[data-theme="dark"] .title            { color: var(--text) !important; }
[data-theme="dark"] .subtitle         { color: var(--text-2) !important; }

.section-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-3);
  margin-bottom: .875rem;
}

/* Password toggle */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 2.75rem; }
.pw-toggle {
  position: absolute;
  right: 0; top: 0;
  height: 100%; width: 2.75rem;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--text-3);
  transition: color var(--ease);
  font-size: .9rem;
}
.pw-toggle:hover { color: var(--text-2); }

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: var(--text-3);
  font-size: .8rem;
  margin: 1.25rem 0;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Plan badges (nav) ───────────────────────────────────────── */
.plan-badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .5rem;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.plan-badge--starter  { background: var(--surface-2); color: var(--text-3); }
.plan-badge--pro      { background: rgba(99,102,241,.15); color: #818CF8; }
.plan-badge--business { background: rgba(245,158,11,.15); color: #F59E0B; }

/* ── Pricing cards ───────────────────────────────────────────── */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  align-items: start;
}
.pricing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 1.75rem 1.5rem;
  position: relative;
  transition: box-shadow .2s;
}
.pricing-card:hover { box-shadow: var(--shadow-lg); }
.pricing-card.is-current { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.pricing-card--featured {
  border-color: var(--brand);
  background: linear-gradient(160deg, rgba(99,102,241,.06) 0%, var(--surface) 60%);
}
.pricing-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .2rem .65rem;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--text-3);
  margin-bottom: .875rem;
}
.pricing-badge--pro      { background: rgba(99,102,241,.15); color: #818CF8; }
.pricing-badge--business { background: rgba(245,158,11,.15); color: #F59E0B; }
.pricing-plan-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: .35rem;
}
.pricing-price {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: .2rem;
}
.pricing-price span { font-size: 1rem; font-weight: 500; color: var(--text-3); }
.pricing-annual { font-size: .78rem; color: var(--text-3); margin-bottom: 1.25rem; }
.pricing-annual em { color: var(--emerald); font-style: normal; }
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.pricing-features li {
  font-size: .875rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.pricing-features li.ok  { color: var(--text); }
.pricing-features li.no  { color: var(--text-3); }
.pricing-features li.ok .fas { color: var(--emerald); font-size: .8rem; }
.pricing-features li.no .fas { color: var(--rose);    font-size: .8rem; }
.pricing-cta {
  display: block;
  text-align: center;
  padding: .7rem 1rem;
  border-radius: var(--radius-lg);
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
}
.pricing-cta--primary {
  background: var(--brand);
  color: #fff;
}
.pricing-cta--primary:hover { background: #4F46E5; color: #fff; }
.pricing-cta--outline {
  border: 1.5px solid var(--border);
  color: var(--text);
}
.pricing-cta--outline:hover { border-color: var(--brand); color: var(--brand); }
.pricing-cta--current {
  background: var(--surface-2);
  color: var(--text-3);
  font-size: .8rem;
  cursor: default;
}
