/* ══════════════════════════════════════════════════════════
   UniCloud — Design System
   Thème : Fond sombre #1a0a2e / Violet #5D288F / Vert #008F68
   ══════════════════════════════════════════════════════════ */

:root {
  --bg:          #1a0a2e;
  --bg2:         #241040;
  --bg3:         #2d1054;
  --card:        #1f0d3a;
  --border:      #3d1a6e;
  --primary:     #5D288F;
  --primary-h:   #7034b0;
  --secondary:   #008F68;
  --secondary-h: #00a87c;
  --accent:      #0BBBBB;
  --accent-h:    #0dd6d6;
  --text:        #ffffff;
  --text-m:      #b0a8c8;
  --text-d:      #7a6e9a;
  --danger:      #e53e3e;
  --danger-h:    #f05050;
  --warning:     #d69e2e;
  --success:     #38a169;
  --radius:      10px;
  --radius-l:    16px;
  --shadow:      0 4px 24px rgba(93,40,143,.25);
  --shadow-l:    0 8px 40px rgba(93,40,143,.4);
  --sidebar:     220px;
  --topbar:      60px;
  --bottombar:   60px;
  --transition:  .2s ease;
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden; /* bloque le scroll horizontal au niveau du document */
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* sécurité supplémentaire */
  max-width: 100vw;
}

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

img { max-width: 100%; }

/* ── SCROLLBAR ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ══════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════ */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  grid-template-rows: var(--topbar) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ── TOP BAR ────────────────────────────────────────────── */
.topbar {
  grid-column: 1 / -1;
  grid-row: 1;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 100;
  position: sticky;
  top: 0;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  min-width: 180px;
}

.topbar-brand .logo-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 8px var(--accent);
  flex-shrink: 0;
}

.topbar-app-name {
  flex: 1;
  font-size: .95rem;
  color: var(--text-m);
  min-width: 0;          /* permet la troncature si trop long */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(93,40,143,.2);
  border: 1px solid var(--border);
  color: var(--text-m);
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: .85rem;
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
}

.btn-back:hover { background: rgba(93,40,143,.4); color: var(--text); }

/* ── SIDEBAR ────────────────────────────────────────────── */
.sidebar {
  grid-column: 1;
  grid-row: 2;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: 16px 0;
}

.nav-section-title {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-d);
  padding: 8px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--text-m);
  font-size: .9rem;
  cursor: pointer;
  border-radius: 0;
  transition: var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  position: relative;
}

.nav-item:hover { background: rgba(93,40,143,.15); color: var(--text); }

.nav-item.active {
  background: rgba(93,40,143,.25);
  color: var(--text);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--accent));
  border-radius: 0 3px 3px 0;
}

.nav-icon { width: 20px; text-align: center; flex-shrink: 0; }

/* ── MAIN CONTENT ───────────────────────────────────────── */
.main {
  grid-column: 2;
  grid-row: 2;
  overflow-y: auto;
  overflow-x: hidden; /* empêche le débordement horizontal */
  padding: 28px;
  min-width: 0;       /* permet à la cellule grille de rétrécir */
}

.section { display: none; }
.section.active { display: block; }

/* ══════════════════════════════════════════════════════════
   COMPONENTS
   ══════════════════════════════════════════════════════════ */

/* ── PAGE HEADER ────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.page-subtitle { font-size: .85rem; color: var(--text-m); margin-top: 2px; }

/* ── CARDS ──────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 20px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-d);
  margin-bottom: 6px;
}

/* ── STAT CARDS ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 4px; height: 100%;
  background: linear-gradient(180deg, var(--primary), var(--accent));
}

.stat-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-l); }

.stat-label { font-size: .75rem; color: var(--text-d); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--text); }
.stat-sub { font-size: .75rem; color: var(--text-m); margin-top: 4px; }
.stat-icon { font-size: 1.5rem; margin-bottom: 8px; }

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  outline: none;
}

.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) { background: var(--primary-h); border-color: var(--primary-h); }

.btn-secondary {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary);
}
.btn-secondary:hover:not(:disabled) { background: var(--secondary-h); }

.btn-accent {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-accent:hover:not(:disabled) { background: var(--accent-h); }

.btn-ghost {
  background: transparent;
  color: var(--text-m);
  border-color: var(--border);
}
.btn-ghost:hover { background: rgba(255,255,255,.05); color: var(--text); }

.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) { background: var(--danger-h); }

.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-icon { padding: 8px; width: 36px; height: 36px; }

/* ── FORMS ──────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  font-size: .83rem;
  color: var(--text-m);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-control {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: .9rem;
  transition: var(--transition);
  outline: none;
}

.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(93,40,143,.2); }
.form-control::placeholder { color: var(--text-d); }

select.form-control option { background: var(--bg3); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.form-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }

/* ── TABLES ─────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-l); border: 1px solid var(--border); }

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

thead th {
  background: var(--bg3);
  color: var(--text-m);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid rgba(61,26,110,.4);
  transition: var(--transition);
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(93,40,143,.08); }

tbody td {
  padding: 12px 16px;
  color: var(--text);
  vertical-align: middle;
}

.td-actions { display: flex; gap: 6px; }

/* ── BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.badge-primary   { background: rgba(93,40,143,.25);  color: #c084fc; }
.badge-success   { background: rgba(0,143,104,.2);   color: #6ee7b7; }
.badge-accent    { background: rgba(11,187,187,.2);  color: #0BBBBB; }
.badge-warning   { background: rgba(214,158,46,.2);  color: #fcd34d; }
.badge-danger    { background: rgba(229,62,62,.2);   color: #fc8181; }
.badge-neutral   { background: rgba(255,255,255,.08); color: var(--text-m); }

/* ── MODALS ─────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,4,20,.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-l);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalIn .2s ease;
}

.modal-lg { max-width: 800px; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(-10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-title { font-size: 1.05rem; font-weight: 700; }

.modal-close {
  background: none; border: none; color: var(--text-m);
  font-size: 1.3rem; cursor: pointer; padding: 4px;
  line-height: 1; transition: var(--transition);
  border-radius: 6px;
}
.modal-close:hover { background: rgba(255,255,255,.1); color: var(--text); }

.modal-body { padding: 20px 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

/* ── TOAST ──────────────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: .87rem;
  box-shadow: var(--shadow-l);
  animation: toastIn .3s ease;
  max-width: 320px;
  pointer-events: all;
}

.toast.success { border-left: 3px solid var(--secondary); }
.toast.error   { border-left: 3px solid var(--danger); }
.toast.info    { border-left: 3px solid var(--accent); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── EMPTY STATE ────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-d);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state h3 { font-size: 1rem; color: var(--text-m); margin-bottom: 6px; }
.empty-state p { font-size: .85rem; }

/* ── SEARCH BAR ─────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 160px;
}

.search-input-wrap .search-icon {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-d);
  pointer-events: none;
}

.search-input-wrap .form-control { padding-left: 36px; }

/* ── TOGGLE / SWITCH ────────────────────────────────────── */
.switch {
  position: relative; display: inline-block;
  width: 44px; height: 24px; flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch-slider {
  position: absolute; inset: 0;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 24px;
  cursor: pointer;
  transition: var(--transition);
}

.switch-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 2px; top: 2px;
  background: var(--text-d);
  border-radius: 50%;
  transition: var(--transition);
}

.switch input:checked + .switch-slider { background: var(--primary); border-color: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); background: #fff; }

/* ── DASHBOARD TILES (portail) ──────────────────────────── */
.tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.app-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text);
  display: block;
}

.app-tile:hover {
  border-color: var(--primary);
  background: var(--bg3);
  transform: translateY(-4px);
  box-shadow: var(--shadow-l);
  color: var(--text);
}

.app-tile-icon { font-size: 2.5rem; margin-bottom: 12px; }
.app-tile-name { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.app-tile-desc { font-size: .78rem; color: var(--text-m); }

/* ── LOGIN PAGE ─────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(ellipse at 30% 40%, rgba(93,40,143,.3) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 60%, rgba(11,187,187,.1) 0%, transparent 50%),
              var(--bg);
}

.login-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 44px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-l);
  text-align: center;
}

.login-logo { font-size: 3rem; margin-bottom: 8px; }
.login-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 4px; }
.login-sub { font-size: .85rem; color: var(--text-m); margin-bottom: 32px; }

/* ── ADMIN TABLE ────────────────────────────────────────── */
.admin-header {
  background: linear-gradient(135deg, var(--bg2), var(--bg3));
  border-bottom: 1px solid var(--border);
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ── POINTAGE SPECIFIC ──────────────────────────────────── */
.pointage-btn {
  width: 100%;
  padding: 20px;
  font-size: 1.1rem;
  border-radius: var(--radius-l);
  margin-bottom: 12px;
  font-weight: 700;
}

.time-display {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  text-align: center;
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

/* ── FACTURATION LIGNES ─────────────────────────────────── */
.ligne-row {
  display: grid;
  grid-template-columns: 1fr 80px 100px 80px auto;
  gap: 8px;
  align-items: end;
  padding: 10px 0;
  border-bottom: 1px solid rgba(61,26,110,.3);
}

/* ══════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE FIRST
   ══════════════════════════════════════════════════════════ */

/* ── HAMBURGER BUTTON ───────────────────────────────────── */
.hamburger {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: var(--transition);
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}
.hamburger:hover { background: rgba(255,255,255,.07); }

/* ── SIDEBAR OVERLAY BACKDROP ───────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 150;
  backdrop-filter: blur(2px);
}
.sidebar-backdrop.active { display: block; }

/* ── SIDEBAR CLOSE BUTTON ───────────────────────────────── */
.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-m);
  font-size: .85rem;
  cursor: pointer;
  padding: 10px 16px 10px;
  text-align: right;
  width: 100%;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  font-weight: 600;
}
.sidebar-close-btn:hover { color: var(--text); }

/* ── DASHBOARD BOTTOM NAV ───────────────────────────────── */
.dash-bottomnav { display: none; }

.dash-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: .65rem;
  color: var(--text-m);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  padding: 4px;
  transition: var(--transition);
}
.dash-nav-item:hover { color: var(--accent); }
.dash-nav-item .dash-nav-icon { font-size: 1.2rem; }

@media (max-width: 768px) {

  /* ── LAYOUT : topbar / contenu / barre de nav ─────────── */
  .layout {
    grid-template-columns: minmax(0, 1fr); /* min:0 = la piste peut rétrécir */
    grid-template-rows: var(--topbar) 1fr var(--bottombar);
    overflow-x: hidden;
  }

  /* Masquer le hamburger (on utilise la barre du bas) */
  .hamburger       { display: none !important; }
  .sidebar-backdrop { display: none !important; }
  .sidebar-close-btn { display: none !important; }

  /* ── SIDEBAR → BARRE DE NAVIGATION BASSE ─────────────── */
  .sidebar {
    grid-column: 1;
    grid-row: 3;
    display: flex;
    flex-direction: row;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    top: auto;
    width: 100%;
    height: var(--bottombar);
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: none;
    border-top: 1px solid var(--border);
    z-index: 90;
    background: var(--bg2);
    transition: none;
    /* reset overlay styles */
    transform: none;
  }

  .nav-section-title { display: none; }

  /* Icône seule — libère de la place pour 5-6 onglets */
  .nav-item {
    flex-direction: column;
    gap: 0;
    padding: 0;
    font-size: 0;          /* cache le label texte */
    flex: 1;
    min-width: 44px;
    height: var(--bottombar);
    justify-content: center;
    align-items: center;
    border-radius: 0;
    border-top: 2px solid transparent;
    color: var(--text-d);
  }

  .nav-item:hover { background: rgba(93,40,143,.12); color: var(--text-m); }

  .nav-item.active {
    border-top-color: var(--accent);
    color: var(--accent);
    background: rgba(11,187,187,.06);
  }
  .nav-item.active::before { display: none; }

  .nav-icon { width: auto; font-size: 1.4rem; }

  /* ── CONTENU PRINCIPAL ────────────────────────────────── */
  .main {
    grid-column: 1;
    grid-row: 2;
    padding: 12px;
    margin-bottom: var(--bottombar);
    overflow-y: auto;
    overflow-x: hidden; /* bloque tout débordement à droite */
    max-width: 100vw;
  }

  /* ── TOPBAR : compact ────────────────────────────────── */
  .topbar              { padding: 0 10px; gap: 8px; }
  #user-name           { display: none; }           /* cache le prénom */
  #role-badge          { display: none !important; } /* cache le badge rôle */
  #btn-manage-users    { display: none !important; } /* accessible via bottom nav 👥 */
  .topbar-brand        { min-width: auto; }
  .btn-back            { padding: 5px 8px; font-size: .8rem; }
  .btn-back span       { display: none; }           /* garde juste ← */
  .topbar-user         { flex-shrink: 0; gap: 6px; }
  /* Bouton Déconnexion : compact */
  .topbar-user .btn    { padding: 5px 8px; font-size: .72rem; min-height: 32px; }

  /* ── PAGE HEADER : empilé sur petit écran ─────────────── */
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
  }

  /* ── TUILES DASHBOARD ─────────────────────────────────── */
  .tiles-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── FORMULAIRES : 1 colonne ──────────────────────────── */
  .form-grid { grid-template-columns: 1fr; }

  /* ── STATS : 2 colonnes ───────────────────────────────── */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── TABLEAUX ─────────────────────────────────────────── */
  .table-wrap { font-size: .8rem; }

  .ligne-row {
    grid-template-columns: 1fr 60px 80px 60px auto;
    gap: 4px;
  }

  /* ── TOAST au-dessus de la barre ──────────────────────── */
  #toast-container { bottom: 72px; right: 16px; }

  /* ── MODAL : bottom-sheet ─────────────────────────────── */
  .modal         { max-width: 100%; margin: 0; border-radius: var(--radius-l) var(--radius-l) 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }

  /* ── LOGIN ────────────────────────────────────────────── */
  .login-card { padding: 32px 24px; }

  /* ── CIBLES TACTILES 44 px ────────────────────────────── */
  .btn    { min-height: 44px; }
  .btn-sm { min-height: 36px; }

  /* Empêche le zoom auto iOS sur focus input */
  .form-control { font-size: 16px; }

  /* ── DASHBOARD BOTTOM NAV ─────────────────────────────── */
  .dash-bottomnav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: var(--bottombar);
    background: var(--bg2);
    border-top: 1px solid var(--border);
    z-index: 90;
    align-items: stretch;
  }
}

/* ── LOADING ─────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(10,4,20,.8);
  display: flex; align-items: center; justify-content: center;
  z-index: 9998;
}

.loading-overlay.hidden { display: none; }

/* ── HIGHLIGHT STATS COLORS ─────────────────────────────── */
.text-primary   { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.text-accent    { color: var(--accent) !important; }
.text-danger    { color: var(--danger) !important; }
.text-warning   { color: var(--warning) !important; }
.text-muted     { color: var(--text-m) !important; }
.text-success   { color: var(--success) !important; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-2 { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
