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

:root {
  --primary: #2563eb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --moyenne: #ca8a04;
  --moyenne-light: #fefce8;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --text2: #475569;
  --text3: #94a3b8;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --radius: 10px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 64px;
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 520px; margin: 0 auto; }

/* Header */
.header {
  background: var(--text);
  color: white;
  padding: 14px 16px 10px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h1 { font-size: 22px; font-weight: 800; letter-spacing: 2px; }
.header-right { display: flex; align-items: center; gap: 10px; }
.header-count { font-size: 12px; opacity: 0.7; }
.date { font-size: 11px; opacity: 0.5; margin-top: 2px; }

.worker-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #64748b; display: inline-block;
}
.worker-dot.active { background: #22c55e; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Search */
.search-bar {
  display: flex;
  padding: 10px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.search-bar input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}

.search-bar input:focus { border-color: var(--primary); }

.search-btn {
  padding: 10px 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}

/* Quick Filters */
.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
}

.qf {
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: white;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.qf span { font-weight: 700; }
.qf.active { color: white; }
.qf[data-filtre="critique"] span { color: var(--danger); }
.qf[data-filtre="haute"] span { color: var(--warning); }
.qf[data-filtre="moyenne"] span { color: var(--moyenne); }

.qf.active[data-filtre="critique"] { background: var(--danger); border-color: var(--danger); }
.qf.active[data-filtre="critique"] span { color: white; }
.qf.active[data-filtre="haute"] { background: var(--warning); border-color: var(--warning); }
.qf.active[data-filtre="haute"] span { color: white; }
.qf.active[data-filtre="moyenne"] { background: var(--moyenne); border-color: var(--moyenne); }
.qf.active[data-filtre="moyenne"] span { color: white; }
.qf.active[data-filtre="tous"] { background: var(--primary); border-color: var(--primary); }
.qf.active[data-filtre="aucun"] { background: var(--success); border-color: var(--success); }
.qf[data-filtre="non_analyse"] span { color: #64748b; }
.qf[data-filtre="changement_gerant"] span { color: #7c3aed; }
.qf.active[data-filtre="changement_gerant"] { background: #7c3aed; border-color: #7c3aed; }
.qf.active[data-filtre="changement_gerant"] span { color: white; }
.qf.active[data-filtre="non_analyse"] { background: #64748b; border-color: #64748b; }
.qf.active[data-filtre="non_analyse"] span { color: white; }
.qf[data-filtre="fermees"] span { color: #6b7280; }
.qf.active[data-filtre="fermees"] { background: #6b7280; border-color: #6b7280; }
.qf.active[data-filtre="fermees"] span { color: white; }
.qf[data-filtre="creances_en_cours"] span { color: #0284c7; }
.qf.active[data-filtre="creances_en_cours"] { background: #0284c7; border-color: #0284c7; }
.qf.active[data-filtre="creances_en_cours"] span { color: white; }
.qf[data-filtre="creances"] span { color: #0ea5e9; }
.qf.active[data-filtre="creances"] { background: #0ea5e9; border-color: #0ea5e9; }
.qf.active[data-filtre="creances"] span { color: white; }
.qf[data-filtre="dossiers_infogreffe"] span { color: #059669; }
.qf.active[data-filtre="dossiers_infogreffe"] { background: #059669; border-color: #059669; }
.qf.active[data-filtre="dossiers_infogreffe"] span { color: white; }
.qf[data-filtre="radiations"] span { color: #b45309; }
.qf.active[data-filtre="radiations"] { background: #b45309; border-color: #b45309; }
.qf.active[data-filtre="radiations"] span { color: white; }

/* Filtre activite */
.activite-filter {
  padding: 4px 12px 8px;
}
.activite-filter select {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  background: white;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  -webkit-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='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.activite-filter select:focus {
  outline: none;
  border-color: var(--primary);
}

.contact-filters {
  display: flex;
  gap: 6px;
  padding: 0 12px 8px;
  overflow-x: auto;
}
.cf {
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: white;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text2);
  transition: all 0.15s;
}
.cf.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Fiches list */
.fiches-list { padding: 8px 12px; }

.fiche-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--success);
  cursor: pointer;
  transition: transform 0.1s;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.fiche-card:active { transform: scale(0.98); }
.fiche-card.niveau-critique { border-left-color: var(--danger); }
.fiche-card.niveau-haute { border-left-color: var(--warning); }
.fiche-card.niveau-moyenne { border-left-color: var(--moyenne); }
.fiche-card.niveau-non_analyse { border-left-color: #94a3b8; }

.fiche-indicator {
  width: 10px; height: 10px; border-radius: 50%;
  margin-top: 5px; flex-shrink: 0;
  background: var(--success);
}
.fiche-card.niveau-critique .fiche-indicator { background: var(--danger); }
.fiche-card.niveau-haute .fiche-indicator { background: var(--warning); }
.fiche-card.niveau-moyenne .fiche-indicator { background: var(--moyenne); }
.fiche-card.niveau-non_analyse .fiche-indicator { background: #94a3b8; }

.fiche-content { flex: 1; min-width: 0; }
.fiche-nom { font-size: 15px; font-weight: 600; margin-bottom: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fiche-dirigeant { font-size: 12px; color: var(--primary); font-weight: 500; }
.fiche-qualite { font-weight: 400; color: var(--text3); font-size: 11px; }
.fiche-ville { font-size: 12px; color: var(--text2); }
.fiche-activite { font-size: 11px; color: var(--primary); opacity: 0.7; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.fiche-cat { font-size: 11px; color: var(--text3); margin-top: 1px; }
.fiche-date-chg { font-size: 11px; color: #7c3aed; font-weight: 500; margin-top: 2px; }
.fiche-date-proc { font-size: 11px; color: var(--danger); font-weight: 500; margin-top: 2px; }
.fiche-date-crea { font-size: 11px; color: var(--success); font-weight: 500; margin-top: 2px; }
.tag-gerant { background: #ede7f6; color: #7c3aed; }
.tag-creances { background: #e0f2fe; color: #0ea5e9; }
.tag-fermee { background: #f3f4f6; color: #6b7280; }
.tag-radiation { background: #fef3c7; color: #b45309; }

/* Tri bar */
.tri-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  margin-bottom: 6px;
}

.tri-label { font-size: 12px; color: var(--text2); }

.tri-btn {
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: white;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.tri-btn.active {
  background: #7c3aed;
  color: white;
  border-color: #7c3aed;
}

.fiche-right {
  text-align: right; flex-shrink: 0;
}

.fiche-tel {
  font-size: 12px; font-weight: 600; color: var(--primary);
  white-space: nowrap;
}

.fiche-alerte-tag {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 2px 6px; border-radius: 4px;
  display: inline-block; margin-top: 4px;
}

.tag-critique { background: var(--danger-light); color: var(--danger); }
.tag-haute { background: var(--warning-light); color: var(--warning); }
.tag-moyenne { background: var(--moyenne-light); color: var(--moyenne); }

/* Fiche detail panel */
.fiche-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg); z-index: 100;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}

.fiche-overlay.active { transform: translateX(0); }

.fiche-panel { max-width: 520px; margin: 0 auto; padding-bottom: 80px; }

.fiche-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  background: var(--text); color: white;
  position: sticky; top: 0; z-index: 10;
}

.fiche-back {
  background: none; border: none; color: white;
  font-size: 14px; font-weight: 600; cursor: pointer;
}

.fiche-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  padding: 4px 10px; border-radius: 12px; letter-spacing: 0.5px;
}

.badge-critique { background: var(--danger); color: white; }
.badge-haute { background: var(--warning); color: white; }
.badge-moyenne { background: var(--moyenne); color: white; }
.badge-aucun { background: var(--success); color: white; }
.badge-non_analyse { background: #64748b; color: white; }

.fiche-body { padding: 12px 16px; }

.fiche-section {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.fiche-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text3); margin-bottom: 10px;
}

.fiche-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

.fiche-row:last-child { border-bottom: none; }
.fiche-label { color: var(--text2); }
.fiche-value { font-weight: 500; text-align: right; max-width: 60%; word-break: break-all; }

.fiche-tel-link {
  display: flex; align-items: center; gap: 8px;
  background: var(--primary); color: white;
  padding: 12px 16px; border-radius: var(--radius);
  font-size: 16px; font-weight: 700;
  text-decoration: none; justify-content: center;
  margin-bottom: 10px;
}

.btn-refresh-fiche {
  width: 100%;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: white;
  font-size: 13px;
  font-weight: 600;
  color: var(--text2);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-refresh-fiche:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f0f7ff;
}

.fiche-email-link {
  display: block; text-align: center;
  padding: 10px; border-radius: var(--radius);
  border: 1.5px solid var(--primary); color: var(--primary);
  font-weight: 600; font-size: 14px;
  text-decoration: none; margin-bottom: 10px;
}

.probleme-card {
  background: var(--danger-light);
  border-radius: 8px; padding: 10px;
  margin-bottom: 6px; font-size: 12px;
}

.probleme-card.haute { background: var(--warning-light); }
.probleme-card.moyenne { background: var(--moyenne-light); }

.probleme-title { font-weight: 700; color: var(--danger); font-size: 13px; }
.probleme-card.haute .probleme-title { color: var(--warning); }
.probleme-card.moyenne .probleme-title { color: var(--moyenne); }
.probleme-meta { color: var(--text2); margin-top: 3px; }

.changement-card {
  background: #f0f0ff; border-radius: 8px; padding: 10px;
  margin-bottom: 6px; font-size: 12px;
}

.annonce-card {
  background: #f8fafc; border-radius: 8px; padding: 10px;
  margin-bottom: 6px; font-size: 12px;
}

.annonce-type { font-weight: 600; color: var(--primary); font-size: 12px; }
.annonce-meta { color: var(--text3); font-size: 11px; margin-top: 2px; }

/* Bottom nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex; z-index: 50;
  max-width: 520px; margin: 0 auto;
}

.nav-btn {
  flex: 1; padding: 8px 0; border: none; background: none;
  display: flex; flex-direction: column; align-items: center;
  font-size: 10px; color: var(--text3); cursor: pointer;
  gap: 2px;
}

.nav-btn.active { color: var(--primary); }
.nav-icon { font-size: 20px; }

/* Settings overlay */
.settings-overlay, .scanner-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: var(--bg); z-index: 100;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}

.settings-overlay.active, .scanner-overlay.active { transform: translateY(0); }

.settings-panel, .scanner-panel { max-width: 520px; margin: 0 auto; padding-bottom: 80px; }

.settings-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; background: var(--text); color: white;
  position: sticky; top: 0; z-index: 10;
}

.settings-header h2 { font-size: 16px; }

.settings-close {
  background: none; border: none; color: white;
  font-size: 24px; cursor: pointer;
}

.settings-body, .scanner-body { padding: 12px 16px; }

.settings-card {
  background: var(--card); border-radius: var(--radius);
  padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow);
}

.settings-card h3 { font-size: 14px; margin-bottom: 8px; }
.settings-card p { font-size: 12px; color: var(--text2); line-height: 1.5; }

.settings-stat {
  display: flex; justify-content: space-between;
  padding: 6px 0; border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}

.settings-stat:last-child { border-bottom: none; }

.btn { padding: 10px 18px; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-primary { background: var(--primary); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-warning { background: var(--warning); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-sm { padding: 8px 14px; font-size: 12px; }

.upload-zone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 24px; text-align: center; cursor: pointer;
  transition: all 0.2s; margin-top: 8px;
}
.upload-zone:hover { border-color: var(--primary); background: #f0f7ff; }
.upload-zone p { font-size: 13px; color: var(--text2); }
.upload-zone.bodacc-upload { border-color: #7c3aed; }
.upload-zone.bodacc-upload:hover { border-color: #6d28d9; background: #f5f3ff; }
.upload-zone.dragover { border-color: var(--primary); background: #eff6ff; transform: scale(1.01); }
.bodacc-status { padding: 8px 0; }
.bodacc-step { font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.bodacc-result { background: var(--success-light); border-radius: var(--radius); padding: 10px; }
.bodacc-main-card { border: 1px solid #7c3aed33; }

/* BODACC file de traitement */
.bodacc-queue-title { font-size: 12px; font-weight: 700; color: var(--text3); text-transform: uppercase; margin-bottom: 6px; }
.queue-job { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; transition: all 0.3s; }
.queue-job.active { border-left: 3px solid #7c3aed; background: #faf5ff; animation: pulse-border 2s infinite; }
.queue-job.done { border-left: 3px solid #16a34a; background: #f0fdf4; }
.queue-job.error { border-left: 3px solid var(--danger); background: #fef2f2; }
.queue-job.pending { border-left: 3px solid var(--border); opacity: 0.7; }
.queue-job-header { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.queue-icon { font-size: 15px; }
.queue-filename { font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-status-text { font-size: 11px; color: var(--text3); text-transform: capitalize; }
.queue-job-stats { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--text2); margin-top: 3px; }
.btn-x { background: none; border: none; font-size: 18px; color: var(--text3); cursor: pointer; padding: 0 4px; line-height: 1; }
.btn-x:hover { color: var(--danger); }
@keyframes pulse-border { 0%, 100% { box-shadow: 0 0 0 0 rgba(124,58,237,0.15); } 50% { box-shadow: 0 0 0 4px rgba(124,58,237,0.1); } }

/* BODACC historique */
.bodacc-annees-box { margin-top: 10px; }
.bodacc-annees-title { font-size: 12px; font-weight: 700; color: var(--text3); text-transform: uppercase; margin-bottom: 6px; }
.bodacc-annees-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.annee-tag { border-radius: 8px; padding: 6px 10px; text-align: center; min-width: 80px; }
.annee-tag.ok { background: var(--success-light); border: 1px solid #bbf7d0; }
.annee-tag.missing { background: #fef2f2; border: 1px dashed #fca5a5; }
.annee-num { display: block; font-weight: 700; font-size: 14px; }
.annee-tag.ok .annee-num { color: #16a34a; }
.annee-tag.missing .annee-num { color: #dc2626; }
.annee-count { display: block; font-size: 10px; color: var(--text3); margin-top: 1px; }
.import-row { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-top: 6px; }
.import-row.ok { border-left: 3px solid #16a34a; }
.import-row.err { border-left: 3px solid var(--danger); }
.import-row.pending { border-left: 3px solid var(--primary); }
.import-row-top { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.import-status { font-size: 14px; }
.import-name { font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.import-annee { background: #e0e7ff; color: #4338ca; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; }
.import-row-bottom { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--text3); margin-top: 4px; }
.import-alertes { display: flex; gap: 4px; font-weight: 600; }

/* Pagination */
.pagination { display: flex; gap: 4px; justify-content: center; padding: 8px 12px; flex-wrap: wrap; }
.pag-btn { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: white; font-size: 12px; cursor: pointer; }
.pag-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

/* Loading */
.loading { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.9); z-index: 200; align-items: center; justify-content: center; }
.loading.active { display: flex; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast { position: fixed; bottom: 74px; left: 50%; transform: translateX(-50%); background: #1e293b; color: white; padding: 10px 20px; border-radius: 8px; font-size: 13px; z-index: 300; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text3); font-size: 14px; }

/* Scan results */
.scan-card {
  background: var(--card); border-radius: var(--radius); padding: 12px;
  margin-bottom: 8px; box-shadow: var(--shadow);
  border-left: 4px solid var(--danger);
}
.scan-card .scan-name { font-weight: 600; font-size: 14px; }
.scan-card .scan-meta { font-size: 12px; color: var(--text2); margin-top: 2px; }
.scan-card .scan-detail { font-size: 11px; color: var(--text3); margin-top: 4px; }

/* Worker status banner */
.worker-status-banner {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.worker-status-banner .eta {
  margin-left: auto;
  font-weight: 400;
  font-size: 12px;
  opacity: 0.8;
}

.worker-status-banner.running { background: #ecfdf5; color: #065f46; }
.worker-status-banner.stopped { background: #fef2f2; color: #991b1b; }
.worker-status-banner.done { background: #f0f9ff; color: #0c4a6e; }

.status-dot-green, .status-dot-red {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.status-dot-green { background: #22c55e; animation: pulse 2s infinite; }
.status-dot-red { background: #ef4444; }

/* Progress sections */
.progress-section { margin-bottom: 14px; }

.progress-label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; font-weight: 600; margin-bottom: 5px; color: var(--text);
}

.progress-numbers { font-weight: 400; color: var(--text2); }

.progress-track {
  height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden;
}

.progress-fill-enrichi {
  height: 100%; background: linear-gradient(90deg, #3b82f6, #06b6d4);
  border-radius: 4px; transition: width 1s ease;
}

.progress-fill-bodacc {
  height: 100%; background: linear-gradient(90deg, #8b5cf6, #ec4899);
  border-radius: 4px; transition: width 1s ease;
}

.progress-pct {
  font-size: 11px; color: var(--text3); text-align: right; margin-top: 2px;
}

/* Worker details grid */
.worker-details-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin: 14px 0;
}

.wd-item { text-align: center; }
.wd-value { font-size: 18px; font-weight: 700; color: var(--text); }
.wd-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.3px; margin-top: 2px; }

/* Speed section */
.speed-section {
  display: flex; gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #f1f5f9;
}

.speed-item { flex: 1; text-align: center; }
.speed-label { font-size: 10px; color: var(--text3); display: block; }
.speed-value { font-size: 13px; font-weight: 600; color: var(--primary); }

/* Alerte grid */
.alerte-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
}

.alerte-box {
  text-align: center; padding: 10px 6px; border-radius: 8px;
}

.alerte-count { font-size: 22px; font-weight: 800; }
.alerte-label { font-size: 10px; font-weight: 600; color: var(--text2); margin-top: 2px; }

.mini-stat {
  background: var(--bg);
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.mini-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: 0.3px; }
.mini-value { font-size: 16px; font-weight: 700; color: var(--text); margin-top: 2px; }

/* PIN Lock */
.pin-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: #0f172a; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
}
.pin-overlay.hidden { display: none; }
.pin-box { text-align: center; width: 280px; }
.pin-title { font-size: 22px; font-weight: 700; color: white; margin-bottom: 4px; }
.pin-subtitle { font-size: 13px; color: #94a3b8; margin-bottom: 24px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin-bottom: 12px; }
.pin-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid #475569; background: transparent; display: inline-block; transition: background 0.15s; }
.pin-dot.filled { background: #3b82f6; border-color: #3b82f6; }
.pin-dot.error { background: #ef4444; border-color: #ef4444; }
.pin-error { color: #ef4444; font-size: 12px; height: 20px; margin-bottom: 8px; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 240px; margin: 0 auto; }
.pin-key {
  width: 70px; height: 56px; border-radius: 12px; border: none;
  background: #1e293b; color: white; font-size: 22px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.pin-key:active { background: #3b82f6; }
.pin-del { font-size: 18px; }
