/* ============================================================
   BAL DES 3E - STYLESHEET
   Police : Inter | Design institutionnel moderne
   ============================================================ */

/* ---------- RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:        #0369a1;
  --blue-dark:   #075985;
  --blue-light:  #e0f2fe;
  --blue-mid:    #0284c7;
  --green:       #16a34a;
  --green-light: #dcfce7;
  --orange:      #ea580c;
  --orange-light:#fff7ed;
  --red:         #dc2626;
  --red-light:   #fee2e2;
  --teal:        #0d9488;
  --teal-light:  #ccfbf1;
  --gray-50:     #f8fafc;
  --gray-100:    #f1f5f9;
  --gray-200:    #e2e8f0;
  --gray-300:    #cbd5e1;
  --gray-400:    #94a3b8;
  --gray-500:    #64748b;
  --gray-600:    #475569;
  --gray-700:    #334155;
  --gray-800:    #1e293b;
  --gray-900:    #0f172a;
  --white:       #ffffff;
  --shadow-sm:   0 1px 2px rgba(0,0,0,.05);
  --shadow:      0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:   0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.05);
  --shadow-xl:   0 20px 25px rgba(0,0,0,.10), 0 10px 10px rgba(0,0,0,.04);
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --sidebar-w:   240px;
  --header-h:    64px;
}

html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--gray-800);
  background: var(--gray-100);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: 'SFMono-Regular', Consolas, monospace; font-size: .85em;
       background: var(--gray-100); padding: 2px 6px; border-radius: 4px; }

/* ---------- LAYOUT PUBLIC ---------- */
.public-body { background: var(--gray-100); }

.public-header {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  height: 64px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; }
.header-brand { display: flex; align-items: center; gap: 12px; color: var(--white); }
.header-brand .material-icons { font-size: 26px; }
.header-brand strong { display: block; font-size: 16px; font-weight: 700; line-height: 1.2; }
.header-brand small { font-size: 11px; opacity: .75; }

.public-main { max-width: 960px; margin: 0 auto; padding: 32px 24px 64px; min-height: calc(100vh - 64px - 60px); }

.public-footer {
  background: var(--gray-800);
  color: var(--gray-400);
  text-align: center;
  padding: 16px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.public-footer a { color: var(--gray-400); }

/* ---------- FORMULAIRE INSCRIPTION ---------- */
.form-container { max-width: 640px; margin: 0 auto; }
.form-header { text-align: center; margin-bottom: 32px; }
.form-header h1 { font-size: 26px; font-weight: 800; color: var(--gray-900); }
.form-header p { color: var(--gray-500); margin-top: 6px; font-size: 14px; }

/* Steps */
.steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
}
.step { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--gray-200);
  color: var(--gray-400);
  font-weight: 700;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s;
}
.step.active .step-num  { background: var(--blue); color: var(--white); }
.step.done .step-num    { background: var(--green); color: var(--white); }
.step-label { font-size: 12px; color: var(--gray-400); white-space: nowrap; }
.step.active .step-label { color: var(--blue); font-weight: 600; }
.step-line { flex: 1; height: 2px; background: var(--gray-200); min-width: 40px; margin: 0 4px; margin-bottom: 22px; }
.step-line.active { background: var(--blue); }

/* Form card */
.form-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-lg);
}
.form-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--blue);
  border-bottom: 1px solid var(--gray-200);
  padding-bottom: 10px;
  margin-bottom: 20px;
  margin-top: 24px;
}
.form-section-title:first-child { margin-top: 0; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.field-help { font-size: 12px; color: var(--gray-500); margin-bottom: 10px; line-height: 1.5; }

input[type="text"], input[type="email"], input[type="tel"], input[type="date"],
input[type="password"], input[type="number"], select, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  color: var(--gray-800);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(3,105,161,.15);
}
input::placeholder { color: var(--gray-400); }
select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%2364748b'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea { resize: vertical; min-height: 120px; }

/* Upload zone */
.upload-zone {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  transition: border-color .2s, background .2s;
  margin-bottom: 20px;
  position: relative;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--blue);
  background: var(--blue-light);
}
.upload-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-label { display: flex; flex-direction: column; align-items: center; gap: 8px;
                cursor: pointer; pointer-events: none; }
.upload-label .material-icons { font-size: 40px; color: var(--blue); }
.upload-label strong { color: var(--gray-700); font-size: 14px; }
.upload-label small { color: var(--gray-400); font-size: 12px; }
.upload-preview { margin-top: 12px; font-size: 13px; color: var(--green); font-weight: 600; }

/* Consent */
.consent-block { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; }
.checkbox-label {
  display: flex; gap: 12px; cursor: pointer;
  background: var(--gray-50); border-radius: var(--radius-sm);
  padding: 14px; border: 1.5px solid var(--gray-200);
  font-size: 13px; line-height: 1.6; color: var(--gray-700);
  transition: border-color .15s;
}
.checkbox-label:hover { border-color: var(--blue); }
.checkbox-label input[type="checkbox"] {
  width: 18px; height: 18px; min-width: 18px;
  accent-color: var(--blue); cursor: pointer;
  margin-top: 2px;
}

.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }

/* ---------- BOUTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn .material-icons { font-size: 18px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-sm .material-icons { font-size: 16px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }

.btn-primary   { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border: 1.5px solid var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-success   { background: var(--green); color: var(--white); }
.btn-success:hover { background: #15803d; }
.btn-danger    { background: var(--red); color: var(--white); }
.btn-danger:hover { background: #b91c1c; }

/* ---------- CARTES GENERIQUES ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
}
.card + .card { margin-top: 16px; }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
}
.card-header h3 { font-size: 15px; font-weight: 700; color: var(--gray-900); }

.card-center { text-align: center; max-width: 480px; margin: 80px auto; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.card-center h2 { font-size: 22px; font-weight: 800; }
.card-center p { color: var(--gray-500); line-height: 1.7; }

.card-text { max-width: 720px; margin: 0 auto; }
.card-text h1 { font-size: 26px; font-weight: 800; margin-bottom: 24px; }
.card-text h2 { font-size: 17px; font-weight: 700; color: var(--blue); margin: 24px 0 8px; }
.card-text p  { color: var(--gray-600); line-height: 1.75; margin-bottom: 8px; }

/* ---------- ALERTES ---------- */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.6;
}
.alert p + p { margin-top: 4px; }
.alert-error  { background: var(--red-light);    color: #991b1b; border-left: 3px solid var(--red); }
.alert-success { background: var(--green-light); color: #166534; border-left: 3px solid var(--green); }

/* ---------- BADGES ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--gray-600);
}
.badge-blue   { background: var(--blue-light);   color: var(--blue-dark); }
.badge-green  { background: var(--green-light);  color: #166534; }
.badge-orange { background: var(--orange-light); color: #9a3412; }
.badge-red    { background: var(--red-light);    color: #991b1b; }
.badge-teal   { background: var(--teal-light);   color: #134e4a; }

/* ---------- TOAST NOTIFICATION ---------- */
.toast {
  position: fixed; top: 80px; right: 24px; z-index: 1000;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl);
  font-size: 14px; font-weight: 600;
  animation: slideIn .25s ease;
  max-width: 360px;
}
.toast-success { border-left: 4px solid var(--green); color: #166534; }
.toast-success .material-icons { color: var(--green); }
.toast-error   { border-left: 4px solid var(--red);   color: #991b1b; }
.toast-error .material-icons   { color: var(--red); }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------- PAGE VALIDATION PARENTALE ---------- */
.validation-card {
  max-width: 520px;
  margin: 40px auto;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}
.validation-header {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  padding: 32px;
  text-align: center;
  color: var(--white);
}
.validation-header .material-icons { font-size: 48px; margin-bottom: 12px; }
.validation-header h2 { font-size: 20px; font-weight: 800; }
.validation-body { padding: 32px; }
.validation-body p { color: var(--gray-600); margin-bottom: 16px; }

.participant-info { background: var(--gray-50); border-radius: var(--radius); padding: 16px; margin-bottom: 24px; }
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
.info-row:last-child { border-bottom: none; }
.info-label { font-size: 12px; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; }
.info-value { font-size: 14px; font-weight: 600; color: var(--gray-800); }

.success-icon { width: 72px; height: 72px; background: var(--green-light); border-radius: 50%;
                display: flex; align-items: center; justify-content: center; }
.success-icon .material-icons { font-size: 36px; color: var(--green); }

/* ---------- LAYOUT ADMIN ---------- */
.admin-body { background: var(--gray-100); }
.admin-body .public-body { background: none; }

.sidebar {
  position: fixed; top: 0; left: 0; height: 100vh;
  width: var(--sidebar-w);
  background: var(--gray-900);
  display: flex; flex-direction: column;
  z-index: 200;
  transition: transform .25s;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 16px;
  color: var(--white);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand .material-icons { font-size: 24px; color: var(--blue-mid); }
.sidebar-brand strong { display: block; font-size: 14px; font-weight: 700; }
.sidebar-brand small { font-size: 11px; color: var(--gray-400); }

.sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--gray-400);
  font-size: 14px; font-weight: 500;
  transition: all .15s;
  cursor: pointer;
  text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: var(--white); text-decoration: none; }
.nav-item.active { background: var(--blue); color: var(--white); }
.nav-item .material-icons { font-size: 20px; min-width: 20px; }

.sidebar-footer { padding: 12px 8px; border-top: 1px solid rgba(255,255,255,.08); }
.user-info {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  color: var(--gray-300);
  font-size: 13px;
}
.user-info .material-icons { font-size: 22px; color: var(--gray-500); }
.user-info strong { display: block; font-size: 13px; font-weight: 600; }
.user-info small  { font-size: 11px; color: var(--gray-500); }
.nav-item-logout { color: var(--gray-500); }
.nav-item-logout:hover { color: #fca5a5; background: rgba(239,68,68,.1); }

.admin-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.admin-header {
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.page-title { flex: 1; font-size: 17px; font-weight: 700; color: var(--gray-900); }
.header-actions { display: flex; gap: 8px; align-items: center; }
.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; padding: 6px; border-radius: var(--radius-sm); }
.sidebar-toggle .material-icons { font-size: 22px; color: var(--gray-600); }

.admin-content { flex: 1; padding: 24px; max-width: 1400px; width: 100%; }

/* ---------- STATS DASHBOARD ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-icon { width: 48px; height: 48px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; }
.stat-icon .material-icons { font-size: 22px; }
.stat-value { font-size: 28px; font-weight: 800; color: var(--gray-900); line-height: 1; }
.stat-label { font-size: 12px; color: var(--gray-500); font-weight: 500; margin-top: 4px; }
.stat-blue   .stat-icon { background: var(--blue-light);   color: var(--blue); }
.stat-green  .stat-icon { background: var(--green-light);  color: var(--green); }
.stat-teal   .stat-icon { background: var(--teal-light);   color: var(--teal); }
.stat-orange .stat-icon { background: var(--orange-light); color: var(--orange); }

.dashboard-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.progress-track { height: 8px; background: var(--gray-100); border-radius: 4px; overflow: hidden; }
.progress-bar   { height: 100%; background: linear-gradient(90deg, var(--blue), var(--blue-mid)); border-radius: 4px; transition: width .5s; }

.list-items { display: flex; flex-direction: column; gap: 2px; }
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: background .1s;
}
.list-item:hover { background: var(--gray-50); }
.list-item div { flex: 1; }
.list-item strong { display: block; font-size: 14px; }
.list-item small  { font-size: 12px; color: var(--gray-500); }

/* ---------- TABLEAU ---------- */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px; flex-wrap: wrap;
}
.toolbar-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar-actions { display: flex; gap: 8px; }
.field-inline {
  display: flex; align-items: center;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  gap: 8px;
}
.field-inline .material-icons { font-size: 18px; color: var(--gray-400); }
.field-inline input {
  border: none; box-shadow: none; padding: 8px 0;
  width: 200px;
}
.field-inline input:focus { box-shadow: none; }

.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.data-table thead tr {
  background: var(--gray-50);
  border-bottom: 1.5px solid var(--gray-200);
}
.data-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--gray-500);
  white-space: nowrap;
}
.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table tbody tr:last-child td { border-bottom: none; }
.actions-cell { white-space: nowrap; display: flex; gap: 6px; }
.text-center { text-align: center; }
.text-muted { color: var(--gray-400); }
.text-green { color: var(--green); }
.text-error { color: var(--red); }
.small { font-size: 12px; }

/* ---------- PAGINATION ---------- */
.pagination { display: flex; gap: 4px; padding: 16px; justify-content: flex-end; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-100);
  text-decoration: none;
  transition: all .15s;
}
.page-btn:hover, .page-btn.active { background: var(--blue); color: var(--white); text-decoration: none; }

/* ---------- DETAIL PARTICIPANT ---------- */
.detail-layout { display: grid; grid-template-columns: 1fr 280px; gap: 16px; }
.detail-sidebar .card { position: sticky; top: 84px; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.info-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.info-item:nth-child(odd)  { padding-right: 16px; }
.info-item:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--gray-100); }
.info-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--gray-400); }

/* ---------- SCANNER ---------- */
.scanner-layout { display: grid; grid-template-columns: 1fr 360px; gap: 20px; }
.scanner-viewport {
  position: relative;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4/3;
}
#scannerVideo { width: 100%; height: 100%; object-fit: cover; }
.scan-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.scan-frame {
  width: 200px; height: 200px;
  border: 3px solid rgba(255,255,255,.8);
  border-radius: 16px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,.45);
  animation: scanPulse 2s infinite;
}
@keyframes scanPulse {
  0%, 100% { border-color: rgba(255,255,255,.8); }
  50%       { border-color: var(--blue); }
}
.scanner-controls { display: flex; gap: 10px; margin-top: 12px; }
.scanner-manual .field-inline input { width: 160px; }

/* Résultats scan */
.result-panel .scan-result {
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 300px;
  gap: 12px;
  transition: all .3s;
}
.scan-result-icon { font-size: 64px !important; }
.scan-result-idle { background: var(--white); color: var(--gray-400); box-shadow: var(--shadow); }
.scan-result-valid {
  background: var(--green-light);
  color: #166534;
  animation: scanSuccess .4s ease;
}
.scan-result-valid .scan-result-icon { color: var(--green); }
.scan-result-used {
  background: var(--orange-light);
  color: #9a3412;
  animation: scanBounce .4s ease;
}
.scan-result-used .scan-result-icon { color: var(--orange); }
.scan-result-invalid {
  background: var(--red-light);
  color: #991b1b;
  animation: scanShake .4s ease;
}
.scan-result-invalid .scan-result-icon { color: var(--red); }
@keyframes scanSuccess { 0% { transform: scale(.92); } 100% { transform: scale(1); } }
@keyframes scanBounce  { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes scanShake   { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

.scan-result-name { font-size: 22px; font-weight: 800; }
.scan-result-class { font-size: 14px; font-weight: 600; opacity: .7; }
.scan-result-dob   { font-size: 13px; opacity: .6; }
.scan-result-status-msg { font-size: 16px; font-weight: 700; }

/* ---------- TABS ---------- */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--gray-200); }
.tab {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-500);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
  text-decoration: none;
}
.tab:hover { color: var(--blue); text-decoration: none; }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }

/* Code editor */
.code-editor {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  background: var(--gray-900);
  color: #e2e8f0;
  border: none;
  border-radius: var(--radius);
  padding: 16px;
  min-height: 400px;
  resize: vertical;
}
.code-editor:focus { box-shadow: 0 0 0 3px rgba(3,105,161,.3); }

/* ---------- MODAL ---------- */
.modal {
  border: none;
  border-radius: var(--radius-xl);
  padding: 0;
  box-shadow: var(--shadow-xl);
  max-width: 560px;
  width: 90vw;
  background: var(--white);
}
.modal::backdrop { background: rgba(0,0,0,.5); backdrop-filter: blur(4px); }
.modal-content { padding: 0; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-100);
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.btn-close { background: none; border: none; cursor: pointer; padding: 4px; border-radius: var(--radius-sm); transition: background .15s; }
.btn-close:hover { background: var(--gray-100); }
.btn-close .material-icons { font-size: 20px; color: var(--gray-500); display: block; }
.modal-form { padding: 20px 24px; }
.modal-form .form-grid { gap: 12px; }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; padding-top: 16px; border-top: 1px solid var(--gray-100); margin-top: 16px; }

/* ---------- LOGIN ---------- */
.login-body { background: linear-gradient(135deg, var(--blue-dark) 0%, #0c4a6e 100%); display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrapper { width: 100%; max-width: 400px; padding: 24px; }
.login-card {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-xl);
}
.login-header { text-align: center; margin-bottom: 32px; }
.login-header .material-icons { font-size: 44px; color: var(--blue); margin-bottom: 12px; display: block; }
.login-header h1 { font-size: 22px; font-weight: 800; color: var(--gray-900); }
.login-header p { color: var(--gray-500); font-size: 13px; margin-top: 4px; }

/* ---------- UTILITAIRES ---------- */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }

.icon-xl .material-icons { font-size: 48px; }
.icon-xl { font-size: 48px; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .stats-grid      { grid-template-columns: repeat(2, 1fr); }
  .dashboard-row   { grid-template-columns: 1fr; }
  .scanner-layout  { grid-template-columns: 1fr; }
  .detail-layout   { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-240px); width: 240px; }
  .sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: 1; }
  .admin-content { padding: 16px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-form { flex-wrap: wrap; }
  .info-grid { grid-template-columns: 1fr; }
  .info-item:nth-child(even) { padding-left: 0; border-left: none; }
  .form-actions { flex-direction: column; }
  .modal { width: 95vw; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .public-main { padding: 16px 16px 48px; }
  .form-card { padding: 20px; }
  .steps-bar { gap: 4px; }
  .step-label { display: none; }
  .step-line { min-width: 20px; }
}

/* ---------- SCROLLBAR ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }