:root{
  --bg:#070b12;
  --panel:#0b1322;
  --panel2:#101824;
  --stroke:rgba(255,255,255,.10);
  --text:#eaf1ff;
  --muted:rgba(234,241,255,.65);
  --accent:#2b77ff;
  --danger:#ff5b5b;
  --radius:18px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: var(--bg);
  color: var(--text);
}
a{color:inherit}

/* --- App layout (from original index) --- */
.topbar{
  background:#0d1b2a;
  padding:12px;
  text-align:center;
  border-bottom:1px solid rgba(255,255,255,.1);
  position:sticky;
  top:0;
  z-index:10;
}
.logo{height:36px}

.main{
  padding:16px;
  padding-bottom:90px;
  max-width:920px;
  margin:0 auto;
}
h1,h2{margin-top:0}
h3{margin:0 0 10px 0; font-size:15px; opacity:.95}

/* Views: only active view is shown */
.view{display:none}
.view.active{display:block}

.cards{display:grid; gap:12px}
.card{
  background:var(--panel2);
  border:1px solid rgba(255,255,255,.08);
  border-radius:16px;
  padding:14px;
  display:flex;
  align-items:center;
  gap:12px;
  color:var(--text);
  text-align:left;
  cursor:pointer;
}
.card span{font-size:22px}
.card strong{display:block; font-size:16px}
.card small{opacity:.7}

/* Generic buttons */
button{
  font:inherit;
  border:none;
  background:none;
  color:inherit;
}
.back{
  background:#121a26;
  border:1px solid rgba(255,255,255,.08);
  border-radius:14px;
  padding:10px 12px;
  cursor:pointer;
}

/* Toasts */
.flc-toast{
  position:fixed;
  left:50%;
  bottom:84px;
  transform:translateX(-50%) translateY(16px);
  opacity:0;
  background: rgba(16,24,36,.92);
  border:1px solid var(--stroke);
  border-radius:14px;
  padding:10px 12px;
  box-shadow:0 10px 30px rgba(0,0,0,.35);
  transition:opacity .2s ease, transform .2s ease;
  max-width:min(520px, calc(100% - 24px));
  pointer-events:none;
}
.flc-toast.show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}
.flc-toast .t{
  font-size:14px;
  color:var(--text);
}
.flc-toast .s{
  font-size:12px;
  color:var(--muted);
  margin-top:2px;
}


/* Profil: settings button + modal */
.settingsBtn{
  margin-top:10px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  background:#121a26;
  border:1px solid rgba(255,255,255,.10);
  border-radius:14px;
  padding:10px 12px;
  cursor:pointer;
  font-weight:700;
}
.settingsBtn:active{transform:scale(.99);}

.modal{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.55);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  padding:14px;
  z-index:9999;
}
.modal.hidden{display:none;}
.modalCard{
  width:min(720px, 100%);
  background:linear-gradient(180deg, rgba(16,24,36,.98), rgba(11,19,34,.98));
  border:1px solid rgba(255,255,255,.12);
  border-radius:18px;
  overflow:hidden;
  box-shadow:0 18px 60px rgba(0,0,0,.45);
}
.modalHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 14px 10px 14px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.modalHeader h3{margin:0;font-size:18px;}
.iconBtn{
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  border-radius:12px;
  padding:8px 10px;
  cursor:pointer;
}
.modalBody{padding:14px;}
.settingsRow{
  display:flex;
  gap:12px;
  align-items:flex-start;
  justify-content:space-between;
  padding:10px 0 14px 0;
}
.settingsTitle{font-weight:800;}
.settingsHint{color:rgba(234,241,255,.65); font-size:13px; margin-top:4px;}
.segmented{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.segBtn{
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  border-radius:14px;
  padding:10px 12px;
  cursor:pointer;
  font-weight:800;
}
.segBtn.active{
  background:rgba(43,119,255,.22);
  border-color:rgba(43,119,255,.55);
}
.settingsGroup{display:flex; flex-direction:column; gap:10px;}
.actionBtn{
  width:100%;
  text-align:left;
  padding:12px 12px;
  border-radius:16px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.06);
  cursor:pointer;
  font-weight:800;
}
.actionBtn:active{transform:scale(.99);}
.actionBtn.danger{
  border-color:rgba(255,91,91,.45);
  background:rgba(255,91,91,.12);
}
.actionBtn.disabled{
  opacity:.45;
  cursor:not-allowed;
}
.settingsFoot{margin-top:12px; color:rgba(234,241,255,.60);}


/* Global topbar v2 (S25 Ultra) */

.topbar#globalTopbar{
  position:sticky; top:0; z-index:60;
  display:grid;
  grid-template-columns:52px 1fr auto;
  align-items:center;
  height:60px;
  padding:0 12px;
  background: #0b1322;
  border-bottom:1px solid var(--stroke);
}
.topbar#globalTopbar.home{
  grid-template-columns:1fr auto;
}
.backBtn{
  height:44px; width:44px;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.04);
  color: var(--text);
  border-radius: 14px;
  font-size:20px;
}
.topLogo{justify-self:center; display:flex; align-items:center; gap:10px}
.logoImg{height:34px; width:auto; display:block}
.topBadges{display:flex; gap:6px; align-items:center; justify-self:end; flex-wrap:wrap}
.badgeChip{
  display:inline-flex; align-items:center; gap:6px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px; font-weight:700;
  border:1px solid var(--stroke);
  background: rgba(255,255,255,.06);
}
.badgeChip.test{background: rgba(43,119,255,.22)}
.badgeChip.prod{background: rgba(46,204,113,.22)}
.badgeChip.offline{background: rgba(255,198,0,.18)}


/* Profil v2 (lecture seule + modifier) */

.profilHead{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin:8px 0 12px}
.profilTitle h2{margin:0 0 4px 0}
.profilTitle .muted{margin:0;color:var(--muted);font-size:13px}
.profilActions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.profilGrid{display:grid;gap:12px}
.profilCard{background:var(--panel);border:1px solid var(--stroke);border-radius:18px;padding:12px}
.profilCardTop{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.profilIdRow{display:grid;grid-template-columns:96px 1fr;gap:12px;align-items:start}
.idPhotoWrap{display:flex;flex-direction:column;gap:8px;align-items:flex-start}
.idPhotoFrame{width:84px;aspect-ratio:9/16;border-radius:10px;background:rgba(255,255,255,.06);border:1px dashed rgba(255,255,255,.16);background-size:cover;background-position:center}
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}
.label{font-size:12px;color:var(--muted)}
.ro{padding:12px 12px;border-radius:14px;background:rgba(255,255,255,.04);border:1px solid var(--stroke);min-height:44px;display:flex;align-items:center;font-weight:650}
.inp{padding:12px 12px;border-radius:14px;background:rgba(255,255,255,.04);border:1px solid var(--stroke);color:var(--text);min-height:44px;outline:none}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.row3{display:grid;grid-template-columns:1fr 1fr 0.7fr;gap:10px}
.permitTable{display:flex;flex-direction:column;gap:10px;margin-top:4px}
.permitRow{display:grid;grid-template-columns:44px 1fr 1fr;gap:10px;align-items:start}
.permitTag{height:44px;display:flex;align-items:center;justify-content:center;border-radius:14px;background:rgba(255,255,255,.06);border:1px solid var(--stroke);font-weight:800}
.docsBlock h4{margin:6px 0 8px 0}
.docGrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.docCard{background:rgba(255,255,255,.03);border:1px solid var(--stroke);border-radius:16px;padding:10px;display:flex;flex-direction:column;gap:8px}
.docLabel{font-size:12px;color:var(--muted)}
.docPhoto{height:110px;border-radius:12px;background:rgba(255,255,255,.06);border:1px dashed rgba(255,255,255,.16);background-size:cover;background-position:center}
.profilFooterBtns{display:flex;gap:10px;flex-wrap:wrap;margin-top:10px}
.btn.small{padding:8px 10px;border-radius:12px;font-size:12px}
@media (max-width:520px){
  .row2,.row3,.permitRow,.docGrid{grid-template-columns:1fr}
  .profilIdRow{grid-template-columns:1fr; }
  .idPhotoFrame{width:96px}
}


/* Settings gear chip */
.badgeChip.gear{cursor:pointer; user-select:none; padding:6px 10px;}
.badgeChip.gear:hover{filter:brightness(1.1);} 


/* Header gear button (step pages) */
.hb-gear{background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.12);color:#fff;border-radius:999px;padding:6px 10px;font-size:16px;line-height:1;}

/* Settings modal actions (shared) */
.settingsAction{
  width:100%;
  text-align:left;
  padding:12px 12px;
  margin:8px 0;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.10);
  background:rgba(255,255,255,.06);
  color:#fff;
  font-weight:700;
}
.settingsAction.danger{
  border-color:rgba(255,80,80,.35);
  background:rgba(255,80,80,.18);
}
.settingsAction.disabled{
  opacity:.55;
}
.settingsFootnote{
  margin-top:10px;
  font-size:12px;
  opacity:.75;
}
.segmented{display:flex;gap:8px;}
.segBtn{
  padding:8px 10px;border-radius:999px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);color:#fff;font-weight:800;
}
.segBtn.active{background:rgba(30,144,255,.35);border-color:rgba(30,144,255,.55);}
