/* ══════════════════════════════════════════════════════════════════════
   TIME — Design system inspiré de KLARIO 2026
   Mobile-first. Tokens light + dark. Sidebar sombre type KLARIO.
   ══════════════════════════════════════════════════════════════════════ */

:root {
  /* Light mode (défaut) */
  --bg-page:        #f8fafc;
  --bg-elev:        #ffffff;
  --bg-card:        #ffffff;
  --bg-card-hover:  #f1f5f9;
  --bg-input:       #ffffff;
  --bg-muted:       #f1f5f9;
  --text-primary:   #0f172a;
  --text-secondary: #334155;
  --text-muted:     #64748b;
  --text-subtle:    #94a3b8;
  --border:         #e2e8f0;
  --border-strong:  #cbd5e1;
  --shadow-sm:      0 1px 2px rgba(15,23,42,.05);
  --shadow-md:      0 4px 14px rgba(15,23,42,.08);
  --shadow-lg:      0 18px 50px rgba(15,23,42,.14);

  /* Brand : Bleu marine */
  --primary:        #1d4ed8;
  --primary-hover:  #1e40af;
  --primary-soft:   #dbeafe;
  --primary-softer: #eff6ff;
  --primary-text:   #1e3a8a;
  --primary-fg:     #ffffff;

  /* Status */
  --success:       #16a34a;
  --success-soft:  #dcfce7;
  --success-text:  #15803d;
  --warning:       #d97706;
  --warning-soft:  #fef3c7;
  --warning-text:  #b45309;
  --danger:        #dc2626;
  --danger-soft:   #fee2e2;
  --danger-text:   #b91c1c;
  --info:          #0891b2;
  --info-soft:     #cffafe;
  --info-text:     #155e75;

  --radius:    12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --sb-w:      240px;
  --topbar-h:  52px;

  /* Compat */
  --text:   var(--text-primary);
  --muted:  var(--text-muted);
  --accent: var(--primary);
}

[data-theme="dark"] {
  --bg-page:        #0b0f1a;
  --bg-elev:        #131826;
  --bg-card:        #1a1f2e;
  --bg-card-hover:  #20263a;
  --bg-input:       rgba(255,255,255,.04);
  --bg-muted:       rgba(255,255,255,.04);
  --text-primary:   #e9eef8;
  --text-secondary: #cbd5e1;
  --text-muted:     #94a3b8;
  --text-subtle:    rgba(226,232,240,.55);
  --border:         rgba(255,255,255,.08);
  --border-strong:  rgba(255,255,255,.18);
  --shadow-sm:      0 1px 2px rgba(0,0,0,.3);
  --shadow-md:      0 4px 14px rgba(0,0,0,.35);
  --shadow-lg:      0 14px 40px rgba(0,0,0,.5);

  --primary:        #60a5fa;
  --primary-hover:  #93c5fd;
  --primary-soft:   rgba(29,78,216,.22);
  --primary-softer: rgba(29,78,216,.10);
  --primary-text:   #bfdbfe;
  --primary-fg:     #0b1120;

  --success-soft:   rgba(22,163,74,.18);
  --success-text:   #86efac;
  --warning-soft:   rgba(217,119,6,.18);
  --warning-text:   #fcd34d;
  --danger-soft:    rgba(220,38,38,.15);
  --danger-text:    #fca5a5;
  --info-soft:      rgba(8,145,178,.15);
  --info-text:      #67e8f9;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  transition: background-color .25s ease, color .25s ease;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

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

/* ══════ TOPBAR MOBILE ══════════════════════════════════════════════ */
.topbar {
  position: sticky; top: 0; z-index: 198;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: linear-gradient(90deg, rgba(8,14,28,.97), rgba(20,14,40,.93));
  border-bottom: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(16px);
  color: #e9eef8;
}
.topbar::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, #4f8cff 30%, #a78bfa 60%, #25c2a0 85%, transparent);
  opacity: .6;
}
.topbar .brand-name { font-size: 18px; }
.topbar-clock {
  font-size: 12px; font-weight: 700; font-family: ui-monospace, monospace; margin-left: auto;
  background: linear-gradient(135deg, #4f8cff, #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
@media (min-width: 900px) { .topbar { display: none; } }

/* Hamburger */
.sb-toggle {
  display: flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 36px; height: 36px; padding: 6px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.10);
  border-radius: 10px; cursor: pointer; flex-shrink: 0;
}
.sb-toggle span { display: block; height: 2px; background: #e9eef8; border-radius: 2px; transition: transform .2s, opacity .2s; }
body.sb-open .sb-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.sb-open .sb-toggle span:nth-child(2) { opacity: 0; }
body.sb-open .sb-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (min-width: 900px) { .sb-toggle { display: none; } }

.sb-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 199; backdrop-filter: blur(2px); }
@media (max-width: 899px) { body.sb-open .sb-overlay { display: block; } }

/* ══════ SIDEBAR ══════════════════════════════════════════════════════ */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sb-w);
  background: linear-gradient(180deg, #06090f 0%, #080e1c 50%, #060b18 100%);
  border-right: 1px solid rgba(255,255,255,.07);
  z-index: 200;
  display: flex; flex-direction: column;
  overflow: hidden;
  transition: transform .28s cubic-bezier(.22,1,.36,1);
  color: rgba(233,238,248,.85);
}
.sidebar::before {
  content: ''; position: absolute; top: 0; right: 0; bottom: 0; width: 1px;
  background: linear-gradient(180deg, transparent, rgba(79,140,255,.25) 25%, rgba(167,139,250,.18) 70%, transparent);
  pointer-events: none;
}
@media (max-width: 899px) {
  .sidebar { transform: translateX(-100%); box-shadow: none; }
  body.sb-open .sidebar { transform: translateX(0); box-shadow: 16px 0 60px rgba(0,0,0,.6); }
}

/* Sidebar header */
.sb-head {
  padding: 18px 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: linear-gradient(180deg, rgba(79,140,255,.04), transparent);
  flex-shrink: 0;
}
.brand-name {
  font-weight: 900; font-size: 22px; letter-spacing: .04em;
  background: linear-gradient(90deg, #4f8cff, #25c2a0);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  animation: brand-glow 4s ease-in-out infinite;
  display: inline-block;
}
@keyframes brand-glow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(79,140,255,.5)); }
  50%      { filter: drop-shadow(0 0 10px rgba(37,194,160,.7)); }
}
.brand-greet { font-size: 11px; color: rgba(136,152,184,.85); margin-top: 4px; }
.sb-clock {
  font-size: 12px; font-weight: 700; font-family: ui-monospace, monospace; margin-top: 8px;
  background: linear-gradient(135deg, #4f8cff, #a78bfa);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Nav items */
.sb-nav { flex: 1; overflow-y: auto; padding: 10px 8px 4px; scrollbar-width: none; }
.sb-nav::-webkit-scrollbar { display: none; }
.sb-group-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: rgba(136,152,184,.4);
  padding: 12px 8px 4px;
}
.sb-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px; border-radius: 8px; border: 1px solid transparent;
  font-size: 13.5px; color: rgba(136,152,184,.9);
  transition: background .12s, color .12s, border-color .12s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none;
}
.sb-item:hover {
  background: rgba(255,255,255,.06); color: #e9eef8;
  text-decoration: none;
}
.sb-item.active {
  background: linear-gradient(135deg, rgba(79,140,255,.15), rgba(167,139,250,.10));
  border-color: rgba(79,140,255,.22);
  color: #e9eef8; font-weight: 600;
}
.sb-item-icon { font-size: 15px; flex-shrink: 0; width: 18px; text-align: center; line-height: 1; }
.sb-item.sb-danger { color: rgba(255,92,92,.6); }
.sb-item.sb-danger:hover { background: rgba(255,92,92,.10); color: #ff8080; border-color: rgba(255,92,92,.18); }

/* Sidebar footer */
.sb-footer {
  padding: 8px 8px 14px;
  border-top: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}
.sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px;
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.06);
}
.sb-user .avatar { width: 32px; height: 32px; flex-shrink: 0; }
.sb-user .who { flex: 1; font-size: 13px; color: #e9eef8; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sb-user .who small { display: block; font-size: 10px; color: rgba(136,152,184,.6); }
.sb-user a.icon-btn {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: 7px; color: rgba(233,238,248,.8); font-size: 14px; text-decoration: none;
  transition: all .15s;
}
.sb-user a.icon-btn:hover { background: rgba(255,92,92,.18); border-color: rgba(255,92,92,.4); color: #ff8080; }

/* ══════ MAIN CONTENT ══════════════════════════════════════════════ */
.main-wrap { min-height: 100vh; }
@media (min-width: 900px) { .main-wrap { margin-left: var(--sb-w); } }

.container {
  padding: 16px 14px 60px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
@media (min-width: 600px) { .container { padding: 22px 22px 60px; } }
@media (min-width: 900px) { .container { padding: 26px 28px 60px; } }

/* ══════ TYPO ══════════════════════════════════════════════════════ */
h1 {
  margin: 0 0 18px;
  font-size: 22px; font-weight: 800;
  background: linear-gradient(120deg, var(--text-primary) 0%, var(--primary) 60%, #25c2a0 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
h2 { margin: 0 0 14px; font-size: 16px; color: var(--text-secondary); font-weight: 700; }
@media (min-width: 600px) { h1 { font-size: 26px; } h2 { font-size: 18px; } }
.muted { color: var(--text-muted); }

.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; flex: 1 1 100%; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; width: 100%; }
.page-head .actions .btn { flex: 1 1 auto; }
@media (min-width: 600px) {
  .page-head h1 { flex: 0 1 auto; }
  .page-head .actions { width: auto; margin-left: auto; }
  .page-head .actions .btn { flex: 0 0 auto; }
}

/* ══════ CARDS ══════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 14px;
}
.card h2 { margin-top: 0; }

[data-theme="dark"] .card {
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  border-color: rgba(255,255,255,.08);
  position: relative; overflow: hidden;
}
[data-theme="dark"] .card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.10), transparent);
}

/* ══════ GRID ══════════════════════════════════════════════════════ */
.grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) {
  .grid { gap: 14px; }
  .grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .grid { gap: 16px; }
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ══════ KPI ══════════════════════════════════════════════════════ */
.kpi {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
}
.kpi .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.kpi .value { font-size: 24px; font-weight: 800; margin-top: 4px; color: var(--text-primary); }
.kpi .sub   { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.kpi.success { border-left-color: var(--success); }
.kpi.warn    { border-left-color: var(--warning); }
.kpi.danger  { border-left-color: var(--danger); }
@media (min-width: 600px) { .kpi .value { font-size: 28px; } }

[data-theme="dark"] .kpi {
  background: linear-gradient(145deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
}

/* ══════ FORMS ══════════════════════════════════════════════════════ */
form .row { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
@media (min-width: 600px) {
  form .row { grid-template-columns: repeat(2, 1fr); }
  form .row.single { grid-template-columns: 1fr; }
}
label { display: block; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

input[type=text], input[type=email], input[type=tel], input[type=number], input[type=date],
input[type=datetime-local], input[type=time], input[type=password], input[type=color],
select, textarea {
  width: 100%; padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; font-size: 16px;
  color: var(--text-primary);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
@media (min-width: 900px) {
  input, select, textarea { font-size: 14px; }
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-softer);
}
textarea { min-height: 80px; resize: vertical; }
input[type=color] { height: 40px; padding: 2px; cursor: pointer; }
input[type=file] { padding: 8px; cursor: pointer; }

/* ══════ BUTTONS ══════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--primary); color: var(--primary-fg); border: 0; cursor: pointer;
  font: inherit; font-weight: 600; font-size: 14px; text-decoration: none;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-1px); background: var(--primary-hover); color: var(--primary-fg); text-decoration: none; box-shadow: 0 4px 16px var(--primary-shadow, rgba(29,78,216,.25)); }
.btn:active { transform: scale(.97); box-shadow: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

.btn.secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--bg-card-hover); color: var(--text-primary); box-shadow: var(--shadow-md); }
.btn.accent  { background: var(--primary); }
.btn.success { background: var(--success); color: #fff; }
.btn.success:hover { background: #15803d; box-shadow: 0 4px 16px rgba(22,163,74,.3); }
.btn.warn    { background: var(--warning); color: #fff; }
.btn.warn:hover { background: #b45309; box-shadow: 0 4px 16px rgba(217,119,6,.3); }
.btn.danger  { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #b91c1c; box-shadow: 0 4px 16px rgba(220,38,38,.3); }
.btn.sm { padding: 6px 10px; font-size: 12.5px; }

/* ══════ TABLES ══════════════════════════════════════════════════════ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: -4px; padding: 4px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 10px 12px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--border); }
th {
  background: var(--bg-muted); color: var(--text-muted);
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
tbody tr { transition: background .12s; }
tbody tr:hover td { background: var(--bg-card-hover); }
.right { text-align: right; }
.center { text-align: center; }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Sur mobile : on enveloppe la table dans son card pour permettre scroll-X SANS forcer nowrap */
@media (max-width: 768px) {
  .card { padding: 12px; }
  .card > table { font-size: 13px; }
  th, td { padding: 8px 10px; font-size: 13px; }
  /* Wrap des longs textes plutôt que scroll quand possible */
  td a { word-break: break-word; }
}

/* ══════ BADGES ══════════════════════════════════════════════════════ */
.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: var(--bg-muted); color: var(--text-secondary);
  border: 1px solid var(--border);
}
.badge.success { background: var(--success-soft); color: var(--success-text); border-color: transparent; }
.badge.warn    { background: var(--warning-soft); color: var(--warning-text); border-color: transparent; }
.badge.danger  { background: var(--danger-soft);  color: var(--danger-text);  border-color: transparent; }
.badge.info    { background: var(--info-soft);    color: var(--info-text);    border-color: transparent; }

/* ══════ FLASH ══════════════════════════════════════════════════════ */
.flash {
  padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 14px;
  background: var(--info-soft); color: var(--info-text);
  border-left: 3px solid var(--info);
}
.flash.success { background: var(--success-soft); color: var(--success-text); border-color: var(--success); }
.flash.error   { background: var(--danger-soft);  color: var(--danger-text);  border-color: var(--danger); }
.flash.warn    { background: var(--warning-soft); color: var(--warning-text); border-color: var(--warning); }

/* ══════ AVATARS ══════════════════════════════════════════════════════ */
.avatar {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; background: linear-gradient(135deg, #4f8cff, #a78bfa);
  flex-shrink: 0;
}
.avatar.lg { width: 64px; height: 64px; font-size: 1.4rem; }
.avatar.xl { width: 96px; height: 96px; font-size: 2rem; }

/* ══════ LOGIN ══════════════════════════════════════════════════════ */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 70% 50% at 15% 15%, rgba(79,140,255,.18), transparent),
    radial-gradient(ellipse 55% 45% at 85% 80%, rgba(167,139,250,.16), transparent),
    radial-gradient(ellipse 50% 60% at 70% 5%,  rgba(37,194,160,.12), transparent),
    #080e1c;
  padding: 16px;
  color: #e9eef8;
}
.login-card {
  background: linear-gradient(145deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.10);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 80px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.06);
  padding: 28px 24px;
  width: 100%; max-width: 420px;
  text-align: center;
  position: relative; overflow: hidden;
}
.login-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
}
.login-card .brand-name { font-size: 28px; }
.login-card .brand-greet { font-size: 13px; color: rgba(136,152,184,.8); margin-bottom: 22px; }
.login-card h2 { color: #e9eef8; margin: 22px 0 12px; }

.profile-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 16px; margin: 16px 0;
}
.profile-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 12px; border-radius: 14px; cursor: pointer;
  background: transparent; border: 2px solid transparent;
  text-decoration: none; color: inherit;
  transition: transform .15s, background .15s, border-color .15s;
}
.profile-card:hover { transform: translateY(-3px); background: rgba(255,255,255,.05); }
.profile-card:hover .profile-ava { border-color: rgba(79,140,255,.7); box-shadow: 0 6px 22px rgba(79,140,255,.4); transform: scale(1.03); }
.profile-card:hover .profile-name { color: #4f8cff; }
.profile-card.selected { border-color: rgba(79,140,255,.5); background: rgba(79,140,255,.10); }

.profile-ava {
  width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #4f8cff, #a78bfa);
  border: 3px solid transparent;
  box-shadow: 0 4px 14px rgba(0,0,0,.3);
  transition: all .15s;
  overflow: hidden;
}
.profile-ava img { width: 100%; height: 100%; object-fit: cover; }
.profile-name { font-weight: 600; color: #e9eef8; font-size: 14px; }

/* PIN pad */
.pin-display { display: flex; justify-content: center; gap: 14px; margin: 18px 0 12px; }
.pin-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(79,140,255,.6); background: transparent;
  transition: all .12s;
}
.pin-dot.filled { background: linear-gradient(135deg, #4f8cff, #25c2a0); border-color: transparent; box-shadow: 0 0 12px rgba(79,140,255,.5); }

.pin-pad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 14px auto 0; max-width: 260px;
}
.pin-pad button {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  height: 56px; font-size: 1.4rem; font-weight: 700; cursor: pointer;
  color: #e9eef8;
  transition: background .12s, border-color .12s, transform .1s;
}
.pin-pad button:hover { background: rgba(79,140,255,.15); border-color: rgba(79,140,255,.4); }
.pin-pad button:active { transform: scale(.95); }
.pin-pad button.action { color: #a78bfa; }

.login-error { color: #ff8080; margin-top: 12px; font-size: 14px; }

/* ══════ CHRONO ══════════════════════════════════════════════════════ */
.chrono-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; margin-bottom: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
}
.chrono-card .avatar { width: 48px; height: 48px; }
.chrono-card .info { flex: 1; min-width: 140px; }
.chrono-card .name { font-weight: 700; color: var(--text-primary); }
.chrono-card .since { font-size: 12px; color: var(--text-muted); }
.chrono-card .timer {
  font-size: 1.6rem; font-weight: 800; color: var(--success);
  font-variant-numeric: tabular-nums; font-family: ui-monospace, monospace;
}
@media (max-width: 600px) {
  .chrono-card .timer { flex: 1 1 100%; text-align: center; padding-top: 6px; border-top: 1px dashed var(--border); }
  .chrono-card form { width: 100%; }
  .chrono-card form .btn { width: 100%; }
}

[data-theme="dark"] .chrono-card {
  background: linear-gradient(145deg, rgba(34,197,94,.08), rgba(255,255,255,.02));
}

/* ══════ THEME TOGGLE (simple) ══════════════════════════════════════ */
.theme-toggle {
  width: 30px; height: 30px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.10);
  border-radius: 7px; cursor: pointer; color: rgba(233,238,248,.8);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; padding: 0; transition: all .15s;
}
.theme-toggle:hover { background: rgba(79,140,255,.18); color: #4f8cff; border-color: rgba(79,140,255,.4); }
[data-theme="light"] .theme-toggle .ico-light { display: none; }
[data-theme="dark"]  .theme-toggle .ico-dark  { display: none; }

/* ══════ UTIL ══════════════════════════════════════════════════════ */
.flex { display: flex; gap: 8px; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.spacer { flex: 1; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.tag {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  vertical-align: middle; margin-right: 6px;
}
.muted { color: var(--text-muted); }
code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .9em;
  background: var(--bg-muted); padding: 1px 6px; border-radius: 4px;
}
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }

/* ══════ FOOTER (blagues Fabien) ══════════════════════════════════════ */
.time-foot {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 20px 14px 28px;
  margin: 28px 14px 0;
  border-top: 1px dashed var(--border);
  font-style: italic;
  line-height: 1.6;
}
.time-foot .time-foot-sub { font-size: 11.5px; opacity: .85; margin-top: 4px; }
.time-foot .muted-quote { color: var(--text-muted); }
.time-foot .sep { opacity: .4; }
.time-foot strong { color: var(--primary); font-style: normal; font-weight: 700; }
@media (min-width: 900px) { .time-foot { margin-left: calc(var(--sb-w) + 14px); } }

/* Petit mot de bas de page dans certains modules */
.joke-inline {
  display: block; margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-muted); border-left: 3px solid var(--primary-soft);
  border-radius: var(--radius-sm);
  font-size: 12.5px; color: var(--text-muted); font-style: italic;
}
[data-theme="dark"] .joke-inline { background: rgba(79,140,255,.06); border-left-color: rgba(79,140,255,.3); }
.joke-inline::before { content: '🐾 '; opacity: .75; font-style: normal; }
