/* ═══════════════════════════════════════════
   RENOTRACE PRO — DESIGN SYSTEM
   v3.0 INDUSTRIAL PRO — Noir + Jaune sécurité
   ═══════════════════════════════════════════ */

:root {
  /* Palette Industrial Pro */
  --bg:      #0A0A0A;   /* fond principal */
  --bg2:     #141414;   /* fond panneau */
  --bg3:     #1F1F1F;   /* fond input */
  --card:    #141414;
  --text:    #F5F5F5;   /* texte principal */
  --text1:   #F5F5F5;
  --text2:   #8B8B8B;
  --text3:   #555555;
  --border:  #2A2A2A;
  --border2: #3A3A3A;

  /* Accent jaune sécurité — remplace --blue (gardé pour compat avec app.js) */
  --blue:    #FFD60A;
  --blue-d:  #E5C209;
  --blue-l:  #1A1500;   /* fond jaune transparent */
  --blue-m:  #4A3F00;
  --navy:    #0A0A0A;
  --navy2:   #141414;

  /* Statuts */
  --green:   #4ADE80;
  --green-l: #0F2A18;
  --green-m: #1F4A30;
  --orange:  #FB923C;
  --orange-l:#2A1908;
  --red:     #F87171;
  --red-l:   #2A0F0F;
  --yellow:  #FFD60A;
  --yellow-l:#1A1500;
  --purple:  #C084FC;
  --purple-l:#1F1430;

  /* Rayons (carrés Industrial) */
  --r:  2px;
  --rs: 2px;
  --rl: 4px;

  /* Ombres (épaisses, contrastées) */
  --sh:  0 2px 0 rgba(0,0,0,.5), 0 0 0 1px var(--border);
  --sh2: 0 6px 24px rgba(0,0,0,.6);
  --sh3: 0 12px 40px rgba(0,0,0,.7);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  max-width: 430px;
  margin: 0 auto;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11','ss01','ss03';
  position: relative;
}

/* Hi-vis stripes pattern décoratif (subtil, en fond) */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: repeating-linear-gradient(45deg,
    rgba(255,214,10,.015) 0,
    rgba(255,214,10,.015) 2px,
    transparent 2px,
    transparent 16px);
}

/* ═══ SCREENS ═══ */
.screen { display: none; flex-direction: column; min-height: 100vh; }
.screen.active { display: flex; animation: screenIn .25s cubic-bezier(.4,0,.2,1) both; }
@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.screen-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* ═══ LOGIN ═══ */
.login-bg {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: -1;
}
.login-content { display: flex; flex-direction: column; min-height: 100vh; }
.login-top {
  flex: 1; display: flex; flex-direction: column;
  align-items: flex-start; justify-content: center;
  padding: 60px 24px 30px; gap: 12px;
}
.login-mark {
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
  /* Liseré sharp 2px Industrial Pro */
  box-shadow: 0 0 0 2px rgba(255, 214, 10, .15);
}
.login-logo {
  font-size: 48px; font-weight: 900; color: white;
  letter-spacing: -2px; line-height: .9;
  text-transform: uppercase;
}
.login-logo span { color: #FFD60A; }
.login-version {
  background: #FFD60A;
  color: #0A0A0A; border: none;
  border-radius: 0; padding: 4px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 800;
  letter-spacing: 2px; text-transform: uppercase;
}
.login-tagline {
  color: var(--text2); font-size: 13px; font-weight: 500;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 1px; text-transform: uppercase;
}
.login-byline {
  color: var(--text3); font-size: 10px; font-weight: 500;
  font-style: italic; letter-spacing: .8px;
  opacity: .65; margin-top: 2px;
}
.login-form {
  background: var(--bg2);
  border-radius: 0;
  border-top: 2px solid var(--border);
  padding: 32px 22px calc(32px + env(safe-area-inset-bottom));
  position: relative;
}
.login-form::before, .login-form::after {
  content: ''; position: absolute; top: -2px; width: 16px; height: 16px;
  border: 2px solid #FFD60A; border-bottom: none;
}
.login-form::before { left: 0; border-right: none; }
.login-form::after  { right: 0; border-left: none; }

.login-form h2 {
  font-size: 22px; font-weight: 900; margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: -.5px;
}
.login-form p {
  color: var(--text2); font-size: 12px; margin-bottom: 20px;
  font-family: 'JetBrains Mono', monospace; letter-spacing: 1px; text-transform: uppercase;
}
.login-error {
  margin-top: 10px; padding: 12px 14px;
  background: var(--red-l); color: var(--red);
  border: 2px solid var(--red); border-radius: 0;
  font-size: 12px; font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase; letter-spacing: .5px;
  display: none;
}
.login-error.show { display: block; }
.pwd-wrap { position: relative; }
.pwd-toggle {
  position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none; border: none; cursor: pointer; font-size: 16px;
  padding: 4px; color: var(--text2);
}

/* ═══ LOGIN LINKS & PANELS ═══ */
.login-links {
  display: flex; flex-direction: column; gap: 4px;
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.login-link {
  background: none; border: none; cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 700; color: #FFD60A;
  padding: 6px 0; text-align: left;
  text-transform: uppercase; letter-spacing: 1px;
  transition: color .15s;
}
.login-link::before { content: '> '; color: #FFD60A; }
.login-link:hover { color: white; }
.login-back {
  background: none; border: none; cursor: pointer;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700; color: var(--text2);
  margin-bottom: 18px; display: block; padding: 0;
  letter-spacing: 1px; text-transform: uppercase;
}
.login-back:hover { color: #FFD60A; }
.forgot-result {
  margin-top: 14px; padding: 16px;
  background: var(--bg3);
  border: 2px solid #FFD60A;
  border-radius: 0; text-align: center;
}
.forgot-result-title {
  font-weight: 800; color: #FFD60A; margin-bottom: 8px;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase; letter-spacing: 1px; font-size: 11px;
}
.forgot-temp-pwd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 28px; font-weight: 800; letter-spacing: 6px;
  color: #FFD60A; margin: 10px 0; user-select: all;
}
.forgot-result-note { font-size: 11px; color: var(--text2); }
.request-success {
  margin-top: 14px; padding: 20px;
  background: var(--bg3); border: 2px solid #FFD60A;
  border-radius: 0; text-align: center;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
}

/* ═══ TOPBAR ═══ */
.topbar {
  background: var(--bg2);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 2px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  /* hi-vis bottom edge */
  box-shadow: 0 2px 0 0 rgba(255,214,10,.15);
}
.topbar-brand {
  font-size: 20px; font-weight: 900; color: white;
  letter-spacing: -.5px; text-transform: uppercase;
}
.topbar-brand span { color: #FFD60A; }
.topbar-title {
  font-size: 16px; font-weight: 900;
  text-transform: uppercase; letter-spacing: -.3px;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.back-btn {
  width: 38px; height: 38px; border-radius: 0;
  background: var(--bg3); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; color: var(--text);
  transition: all .12s;
}
.back-btn:hover { border-color: #FFD60A; color: #FFD60A; }
.back-btn:active { transform: scale(.94); }
.avatar-btn {
  width: 38px; height: 38px; border-radius: 0;
  background: #FFD60A; border: 2px solid #FFD60A;
  color: #0A0A0A; font-size: 13px; font-weight: 900;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  transition: all .12s;
}
.avatar-btn:active { transform: scale(.94); }
.icon-btn {
  width: 38px; height: 38px; border-radius: 0;
  background: var(--bg3); border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 16px; color: var(--text2); font-weight: 700;
  transition: all .12s;
}
.icon-btn:hover { border-color: #FFD60A; color: #FFD60A; }
.icon-btn:active { transform: scale(.94); }

/* ═══ BOTTOM NAV (mobile-first, gros tap targets) ═══ */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  background: var(--bg2);
  border-top: 2px solid var(--border);
  border-radius: 0;
  display: flex; align-items: stretch;
  padding: 0 0 env(safe-area-inset-bottom);
  z-index: 200;
  box-shadow: 0 -8px 30px rgba(0,0,0,.6);
}
/* Yellow top stripe */
.bottom-nav::before {
  content: ''; position: absolute; top: -2px; left: 0; right: 0; height: 2px;
  background: repeating-linear-gradient(90deg,
    #FFD60A 0, #FFD60A 12px,
    transparent 12px, transparent 18px);
  opacity: .6;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  color: var(--text3);
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; font-weight: 700;
  padding: 10px 4px 12px;
  text-transform: uppercase; letter-spacing: 1px;
  transition: color .15s;
  position: relative;
  min-height: 64px;
}
.nav-item.active { color: #FFD60A; }
.nav-item.active::before {
  content: ''; position: absolute; top: 0; left: 12%; right: 12%; height: 3px;
  background: #FFD60A;
}
.nav-item:active { background: rgba(255,214,10,.05); }
.nav-icon { font-size: 20px; line-height: 1; }
.nav-cam {
  background: #FFD60A;
  border: 3px solid var(--bg);
  border-radius: 0; width: 60px; height: 60px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; margin-top: -22px;
  color: #0A0A0A;
  box-shadow: 0 4px 20px rgba(255,214,10,.4),
              inset 0 -4px 0 rgba(0,0,0,.15);
  transition: all .15s;
  flex-shrink: 0;
  position: relative;
}
.nav-cam svg { color: #0A0A0A; }
.nav-cam::before {
  content: ''; position: absolute; inset: -2px;
  border: 2px solid #FFD60A; border-radius: 0;
  opacity: 0; transition: opacity .15s;
}
.nav-cam:hover::before { opacity: .5; }
.nav-cam:active { transform: scale(.92); box-shadow: 0 2px 10px rgba(255,214,10,.3); }
.nav-cam-icon { font-size: 26px; color: #0A0A0A; }

/* ═══ FORMS ═══ */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text2); margin-bottom: 8px;
}
.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 13px 14px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px; font-weight: 500;
  outline: none;
  transition: border-color .15s, background .15s;
  -webkit-appearance: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #FFD60A;
  background: var(--bg2);
}
.field textarea { resize: vertical; min-height: 80px; }
.field select { cursor: pointer; }
.field select option { background: var(--bg2); color: var(--text); }

/* ═══ BUTTONS ═══ */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Inter', sans-serif;
  font-weight: 800; font-size: 13px;
  letter-spacing: 1.5px; text-transform: uppercase;
  border: 2px solid transparent;
  cursor: pointer;
  border-radius: 0;
  padding: 14px 18px;
  transition: all .12s;
  text-decoration: none;
  width: 100%;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: #FFD60A; color: #0A0A0A;
  border-color: #FFD60A;
  box-shadow: 0 3px 0 rgba(255,214,10,.3);
}
.btn-primary:hover {
  background: #FFE54D; border-color: #FFE54D;
}
.btn-secondary {
  background: transparent; color: #FFD60A;
  border-color: #FFD60A;
}
.btn-secondary:hover {
  background: rgba(255,214,10,.08);
}
.btn-danger {
  background: var(--red-l); color: var(--red);
  border-color: var(--red);
}
.btn-success {
  background: var(--green-l); color: var(--green);
  border-color: var(--green);
}
.btn-purple {
  background: var(--purple-l); color: var(--purple);
  border-color: var(--purple);
}
.btn-ghost {
  background: transparent; color: #FFD60A; border: none; font-weight: 700;
}
.btn-sm {
  font-size: 11px; padding: 10px 14px; letter-spacing: 1px;
}
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }

/* ═══ CARDS (panels Industrial) ═══ */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 18px;
  box-shadow: var(--sh);
  margin-bottom: 12px;
  position: relative;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 13px; font-weight: 900;
  text-transform: uppercase; letter-spacing: 1px;
  display: flex; align-items: center; gap: 8px;
}
.card-title::before {
  content: ''; width: 3px; height: 14px; background: #FFD60A;
  display: inline-block;
}
.card-subtitle {
  font-size: 11px; color: var(--text2); font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase; letter-spacing: 1px;
}

/* ═══ DASHBOARD ═══ */
.greeting { padding: 18px 0 8px; }
.greeting-name {
  font-size: 24px; font-weight: 900;
  letter-spacing: -.5px;
}
.greeting-date {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text2); font-weight: 700;
  margin-top: 4px; text-transform: uppercase; letter-spacing: 1.5px;
}

.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 18px;
}
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 16px 14px;
  position: relative;
  overflow: hidden;
}
/* Yellow accent stripe at top */
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0;
  width: 32px; height: 3px; background: #FFD60A;
}
.stat-value {
  font-size: 32px; font-weight: 900; line-height: 1;
  letter-spacing: -1px;
}
.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--text2); font-weight: 700;
  margin-top: 6px; text-transform: uppercase; letter-spacing: 1.5px;
}
.stat-icon {
  font-size: 22px; margin-bottom: 8px;
  filter: grayscale(.3);
}
.stat-card-link { cursor: pointer; transition: all .15s; }
.stat-card-link:hover {
  border-color: #FFD60A;
  background: var(--bg3);
}
.stat-card-link:active { transform: scale(.98); }

.section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 2px;
  color: var(--text2); margin: 22px 0 12px;
  display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: ''; width: 3px; height: 14px; background: #FFD60A;
  display: block;
}

/* ═══ CHANTIER CARDS ═══ */
.chantier-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.chantier-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: transparent; transition: background .15s;
}
.chantier-card:hover {
  border-color: #FFD60A;
  background: var(--bg3);
}
.chantier-card:hover::before { background: #FFD60A; }
.chantier-card:active { transform: translateY(1px); }
.chantier-card-top {
  display: flex; align-items: flex-start;
  justify-content: space-between; margin-bottom: 12px;
}
.chantier-name {
  font-size: 16px; font-weight: 800;
  margin-bottom: 4px; letter-spacing: -.3px;
}
.chantier-client {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text2); font-weight: 600;
}
.chantier-address {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text3); margin-top: 4px;
}
.chantier-meta {
  display: flex; gap: 12px;
  margin-top: 12px; align-items: center;
  flex-wrap: wrap;
}
.chantier-stat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text2); font-weight: 700;
  display: flex; align-items: center; gap: 4px;
  text-transform: uppercase; letter-spacing: 1px;
}

/* ═══ BADGES ═══ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 800;
  letter-spacing: 1px; text-transform: uppercase;
  border: 1px solid transparent;
}
.badge-blue   { background: #FFD60A; color: #0A0A0A; }
.badge-green  { background: var(--green-l); color: var(--green); border-color: var(--green); }
.badge-orange { background: var(--orange-l); color: var(--orange); border-color: var(--orange); }
.badge-red    { background: var(--red-l); color: var(--red); border-color: var(--red); }
.badge-purple { background: var(--purple-l); color: var(--purple); border-color: var(--purple); }
.badge-gray   { background: var(--bg3); color: var(--text2); border-color: var(--border); }

/* ═══ PROGRESS BAR ═══ */
.progress-wrap { margin-top: 12px; }
.progress-label { display: flex; justify-content: space-between; margin-bottom: 6px; }
.progress-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700; color: var(--text2);
  text-transform: uppercase; letter-spacing: 1.5px;
}
.progress-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 900; color: #FFD60A;
}
.progress-bar {
  height: 8px; background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 0; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 0;
  background: #FFD60A;
  background-image: repeating-linear-gradient(45deg,
    rgba(0,0,0,.15) 0, rgba(0,0,0,.15) 4px,
    transparent 4px, transparent 8px);
  transition: width .5s ease;
}
.progress-fill.green  { background: var(--green); background-image: repeating-linear-gradient(45deg,rgba(0,0,0,.15) 0,rgba(0,0,0,.15) 4px,transparent 4px,transparent 8px); }
.progress-fill.orange { background: var(--orange); background-image: repeating-linear-gradient(45deg,rgba(0,0,0,.15) 0,rgba(0,0,0,.15) 4px,transparent 4px,transparent 8px); }

/* ═══ TABS ═══ */
.tabs {
  display: flex; gap: 0;
  margin: 0 -16px;
  border-bottom: 2px solid var(--border);
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0; padding: 14px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1px;
  color: var(--text2);
  border: none; background: none; cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px; white-space: nowrap;
  transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: #FFD60A;
  border-bottom-color: #FFD60A;
}

/* ═══ PHOTO GRID ═══ */
.photo-day { margin-bottom: 24px; }
.photo-day-header {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 800; color: var(--text2);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 10px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.photo-thumb {
  aspect-ratio: 1;
  border-radius: 0;
  overflow: hidden;
  background: var(--bg3);
  cursor: pointer;
  position: relative;
  border: 1px solid var(--border);
  transition: border-color .15s;
}
.photo-thumb:hover { border-color: #FFD60A; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.85));
  padding: 6px 6px 4px; font-size: 9px; color: white;
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  letter-spacing: .5px;
}

/* ═══ CAMERA ═══ */
.camera-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: #000; color: white;
  border-bottom: 2px solid #FFD60A;
}
.cam-back { background: none; border: none; color: white; font-size: 22px; cursor: pointer; padding: 4px; }
.cam-title {
  font-size: 14px; font-weight: 900;
  text-transform: uppercase; letter-spacing: 1px; color: white;
}
.camera-area {
  background: #000; flex: 1; position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 250px; max-height: 50vh; overflow: hidden;
}
#camVideo { width: 100%; height: 100%; object-fit: cover; }
.cam-overlay { position: absolute; inset: 0; pointer-events: none; }
.cam-gps-tag {
  position: absolute; top: 12px; left: 12px;
  background: rgba(0,0,0,.78); color: #FFD60A;
  border: 1px solid #FFD60A;
  border-radius: 0; padding: 6px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  backdrop-filter: blur(8px);
  display: inline-flex; align-items: center; gap: 6px;
  max-width: calc(100% - 24px);
}
.cam-gps-tag span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.camera-controls {
  background: var(--bg2);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  border-top: 2px solid var(--border);
}
.cam-field { margin-bottom: 12px; }
.cam-field label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text2); margin-bottom: 6px;
}
.cam-input {
  width: 100%; background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 0; padding: 11px 14px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  color: var(--text); outline: none;
}
.cam-input:focus { border-color: #FFD60A; }
.surface-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  padding: 7px 14px; border-radius: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  border: 1.5px solid var(--border);
  background: var(--bg3); color: var(--text2);
  cursor: pointer; transition: all .12s;
}
.pill:hover { border-color: #FFD60A; color: var(--text); }
.pill.active {
  background: #FFD60A; color: #0A0A0A;
  border-color: #FFD60A; font-weight: 800;
}
.cam-actions { display: flex; align-items: center; justify-content: space-around; padding-top: 8px; }
.cam-shoot {
  width: 72px; height: 72px; border-radius: 0;
  background: #FFD60A;
  border: 4px solid #0A0A0A;
  outline: 2px solid #FFD60A;
  color: #0A0A0A;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 0 rgba(255,214,10,.3);
  transition: all .12s;
}
.cam-shoot svg { color: #0A0A0A; }
.cam-shoot:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(255,214,10,.3);
}
.cam-import, .cam-flip {
  width: 56px; height: 56px; border-radius: 0;
  background: var(--bg3);
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  cursor: pointer; transition: all .12s;
}
.cam-import svg, .cam-flip svg { display: block; }
.cam-import:hover, .cam-flip:hover { border-color: #FFD60A; color: #FFD60A; }
.cam-import:active, .cam-flip:active { transform: scale(.94); }
.cam-actions { gap: 24px; padding: 14px 0 4px; }

/* ═══ AI SCREEN ═══ */
.ai-screen-body { display: flex; flex-direction: column; padding: 0; }
.ai-messages {
  flex: 1; overflow-y: auto;
  padding: 16px 16px 8px;
  display: flex; flex-direction: column; gap: 12px;
  min-height: 200px;
}
.ai-msg { max-width: 85%; display: flex; flex-direction: column; gap: 4px; }
.ai-msg.user { align-self: flex-end; align-items: flex-end; }
.ai-msg.bot  { align-self: flex-start; align-items: flex-start; }
.ai-bubble {
  padding: 12px 14px; border-radius: 0;
  font-size: 13px; line-height: 1.5; font-weight: 500;
  font-family: 'Inter', sans-serif;
  border: 1.5px solid;
}
.ai-msg.user .ai-bubble { background: #FFD60A; color: #0A0A0A; border-color: #FFD60A; }
.ai-msg.bot  .ai-bubble { background: var(--bg2); color: var(--text); border-color: var(--border); }
.ai-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; color: var(--text3); font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
}
.ai-quick-prompts {
  padding: 0 16px 8px;
  display: flex; gap: 8px; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.ai-quick-prompts::-webkit-scrollbar { display: none; }
.ai-prompt-chip {
  flex-shrink: 0;
  padding: 8px 14px; border-radius: 0;
  background: var(--bg3); color: #FFD60A;
  border: 1.5px solid #FFD60A;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  cursor: pointer; white-space: nowrap;
  transition: all .12s;
}
.ai-prompt-chip:active {
  background: #FFD60A; color: #0A0A0A;
}
.ai-input-bar {
  display: flex; gap: 8px;
  padding: 12px 16px calc(96px + env(safe-area-inset-bottom));
  background: var(--bg2); border-top: 2px solid var(--border);
}
.ai-input {
  flex: 1; background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 0; padding: 12px 14px;
  font-family: 'Inter', sans-serif; font-size: 14px;
  color: var(--text); outline: none;
}
.ai-input:focus { border-color: #FFD60A; }
.ai-send {
  width: 48px; height: 48px; border-radius: 0;
  background: #FFD60A; border: none; color: #0A0A0A;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 0 rgba(255,214,10,.3);
  transition: all .12s;
}
.ai-send:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(255,214,10,.3); }
.ai-key-warning {
  margin: 16px; padding: 14px 16px;
  background: var(--bg3); border: 2px solid #FFD60A;
  border-radius: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: #FFD60A;
  font-weight: 700; text-align: center;
  text-transform: uppercase; letter-spacing: 1px;
}

/* ═══ PROFILE ═══ */
.profile-header {
  background: var(--bg);
  padding: 28px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  border: none; border-bottom: 2px solid #FFD60A;
  border-radius: 0;
  margin: -16px -16px 18px;
  position: relative;
}
.profile-header::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: repeating-linear-gradient(90deg,
    #FFD60A 0, #FFD60A 16px, #0A0A0A 16px, #0A0A0A 24px);
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 0;
  background: #FFD60A; border: 3px solid #0A0A0A;
  outline: 2px solid #FFD60A;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 28px; font-weight: 900; color: #0A0A0A;
}
.profile-name {
  font-size: 20px; font-weight: 900;
  color: white; text-transform: uppercase; letter-spacing: -.5px;
}
.profile-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: #FFD60A; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1.5px;
}

/* ═══ MODAL ═══ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.85);
  z-index: 500; display: none;
  align-items: flex-end; justify-content: center;
  backdrop-filter: blur(8px);
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg2);
  border-radius: 0;
  border-top: 3px solid #FFD60A;
  width: 100%; max-width: 430px; max-height: 92vh;
  padding: 16px 20px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
  animation: slideUp .28s cubic-bezier(.4,0,.2,1);
  position: relative;
}
.modal-box::before, .modal-box::after {
  content: ''; position: absolute; top: -3px; width: 16px; height: 16px;
  border: 3px solid #FFD60A; border-bottom: none;
}
.modal-box::before { left: 0; border-right: none; }
.modal-box::after  { right: 0; border-left: none; }

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.modal-handle {
  width: 40px; height: 3px; border-radius: 0;
  background: var(--text3); margin: 0 auto 16px; display: block;
}
.modal-title {
  font-size: 16px; font-weight: 900; margin-bottom: 18px;
  text-transform: uppercase; letter-spacing: -.3px;
  display: flex; align-items: center; gap: 10px;
}

/* ═══ TOAST ═══ */
.toast-container {
  position: fixed;
  bottom: calc(96px + env(safe-area-inset-bottom) + 12px);
  left: 50%; transform: translateX(-50%);
  z-index: 999;
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: 100%; max-width: 380px; padding: 0 16px;
}
.toast {
  background: var(--bg2);
  border: 2px solid var(--border);
  color: white;
  padding: 12px 18px; border-radius: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  box-shadow: 0 8px 24px rgba(0,0,0,.6);
  animation: toastIn .25s cubic-bezier(.4,0,.2,1);
  display: flex; align-items: center; gap: 8px;
  max-width: 100%;
}
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error   { border-color: var(--red); color: var(--red); }
.toast.warning { border-color: #FFD60A; color: #FFD60A; }
.toast.info    { border-color: #FFD60A; color: #FFD60A; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══ INSTALL BANNER ═══ */
.install-banner {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  background: #FFD60A; color: #0A0A0A;
  padding: 12px 16px; z-index: 900;
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 800; gap: 12px;
  text-transform: uppercase; letter-spacing: .5px;
  border-bottom: 2px solid #0A0A0A;
}
.install-yes {
  background: #0A0A0A; color: #FFD60A;
  border: none; border-radius: 0;
  padding: 8px 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 800; font-size: 11px;
  text-transform: uppercase; letter-spacing: 1px;
  cursor: pointer; flex-shrink: 0;
}
.install-no { background: none; border: none; color: rgba(0,0,0,.6); font-size: 18px; cursor: pointer; padding: 4px; }

/* ═══ ISSUE / PROBLÈMES ═══ */
.issue-item {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 14px;
  margin-bottom: 10px;
  position: relative;
  transition: border-color .15s;
}
.issue-item:hover { border-color: var(--border2); }
.issue-title {
  font-size: 14px; font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -.2px;
}
.issue-desc {
  font-size: 12px; color: var(--text2);
  line-height: 1.5;
}
.issue-meta {
  display: flex; gap: 6px;
  align-items: center; margin-top: 10px;
  flex-wrap: wrap;
}

/* ═══ ADMIN ═══ */
.admin-tabs {
  display: flex; overflow-x: auto; gap: 0;
  border-bottom: 2px solid var(--border);
  margin: 0 -16px; padding: 0 16px;
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.user-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.user-row:hover { background: var(--bg3); }
.user-row:last-child { border: none; }
.user-avatar {
  width: 42px; height: 42px; border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 900;
  color: #0A0A0A; flex-shrink: 0;
  border: 2px solid var(--border2);
}
.user-info { flex: 1; }
.user-name { font-size: 14px; font-weight: 800; letter-spacing: -.2px; }
.user-role {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--text2);
  font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-top: 1px;
}
.user-stats {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--text3); margin-top: 1px;
}

/* ═══ EMPTY STATE ═══ */
.empty {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 56px 24px; text-align: center; gap: 12px;
}
.empty-icon { font-size: 48px; opacity: .5; }
.empty-title {
  font-size: 16px; font-weight: 900;
  text-transform: uppercase; letter-spacing: -.2px;
}
.empty-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text2);
  line-height: 1.6; text-transform: uppercase; letter-spacing: 1px;
  max-width: 280px;
}

/* ═══ SEARCH BAR ═══ */
.search-bar {
  background: var(--bg2);
  padding: 10px 16px;
  border-bottom: 2px solid var(--border);
  position: sticky; top: 57px; z-index: 50;
}
.search-input {
  width: 100%;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 0;
  padding: 11px 16px 11px 40px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: var(--text); outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23FFD60A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center;
}
.search-input:focus { border-color: #FFD60A; }

/* ═══ PHOTO LIGHTBOX ═══ */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.97);
  z-index: 800; display: none;
  flex-direction: column; align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox-img {
  width: 100%; max-height: 78vh;
  object-fit: contain; border-radius: 0;
  display: block;
  border: 2px solid #FFD60A;
}
.lightbox-close {
  position: absolute; top: 16px; right: 16px;
  background: #FFD60A; border: none; color: #0A0A0A;
  width: 44px; height: 44px; border-radius: 0;
  font-size: 20px; font-weight: 900;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-info {
  color: rgba(255,255,255,.85);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; text-align: center; padding: 14px 24px;
  letter-spacing: .5px;
}

/* ═══ SETTINGS ═══ */
.settings-section { margin-bottom: 22px; }
.settings-section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: var(--text2); margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.settings-section-title::before {
  content: ''; width: 3px; height: 12px; background: #FFD60A;
}
.settings-row {
  background: var(--bg2);
  border-radius: 0;
  overflow: hidden;
  border: 1px solid var(--border);
}
.settings-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s;
}
.settings-item:hover { background: var(--bg3); }
.settings-item:last-child { border-bottom: none; }
.settings-icon { font-size: 22px; width: 32px; text-align: center; }
.settings-label { flex: 1; }
.settings-name { font-size: 14px; font-weight: 700; letter-spacing: -.2px; }
.settings-desc {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text2); margin-top: 1px;
}
.settings-arrow { color: #FFD60A; font-size: 18px; font-weight: 900; }

/* ═══ MISC ═══ */
.divider { height: 1px; background: var(--border); margin: 14px 0; }
.text-center { text-align: center; }
.text-muted { color: var(--text2); }
.fw-800 { font-weight: 800; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(0,0,0,.3); border-top-color: #0A0A0A;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-btn { pointer-events: none; opacity: .6; }

/* ═══ CHANTIER DETAIL HEADER ═══ */
.chantier-hero {
  background: var(--bg);
  padding: 22px 18px 22px;
  margin: -16px -16px 18px;
  border-bottom: 2px solid #FFD60A;
  border-radius: 0;
  position: relative;
}
.chantier-hero::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: repeating-linear-gradient(90deg,
    #FFD60A 0, #FFD60A 16px, #0A0A0A 16px, #0A0A0A 24px);
}
.chantier-hero-name {
  font-size: 22px; font-weight: 900; color: white;
  margin-bottom: 4px; letter-spacing: -.5px;
  text-transform: uppercase;
}
.chantier-hero-client {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; color: var(--text2); font-weight: 600;
}
.chantier-hero-address {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text3); margin-top: 4px;
}
.chantier-hero-badges {
  display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap;
}
.chantier-hero-progress { margin-top: 16px; }
.chantier-hero-pct {
  font-family: 'Inter', sans-serif;
  font-size: 32px; font-weight: 900; color: #FFD60A;
  line-height: 1; letter-spacing: -1px;
}
.chantier-hero-pct-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--text2);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 1.5px;
}
.progress-bar-white {
  height: 8px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 0; overflow: hidden;
}
.progress-fill-white {
  height: 100%; border-radius: 0;
  background: #FFD60A;
  background-image: repeating-linear-gradient(45deg,
    rgba(0,0,0,.2) 0, rgba(0,0,0,.2) 4px,
    transparent 4px, transparent 8px);
}

/* ═══ SÉCURITÉ ═══ */
.security-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,214,10,.1);
  border: 1px solid rgba(255,214,10,.4);
  border-radius: 0; padding: 4px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  color: #FFD60A;
  letter-spacing: 1.5px; text-transform: uppercase;
  margin-top: 14px;
}
.pwd-strength-wrap { margin-top: 6px; }
.pwd-strength-bar {
  height: 4px; border-radius: 0; background: var(--border);
  overflow: hidden; margin-bottom: 4px;
}
.pwd-strength-fill { height: 100%; border-radius: 0; transition: all .3s; }
.pwd-strength-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
}
.lockout-warning {
  background: var(--red-l);
  border: 2px solid var(--red);
  border-radius: 0; padding: 12px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700; color: var(--red);
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
  text-transform: uppercase; letter-spacing: .5px;
}
.session-indicator {
  position: fixed; top: 8px; right: 8px; z-index: 999;
  background: var(--bg2);
  border: 1px solid #FFD60A;
  color: #FFD60A;
  border-radius: 0; padding: 4px 10px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  display: none;
}

/* ═══ DRIVE STATUS ═══ */
.drive-status {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  border: 1.5px solid var(--border); background: var(--bg3);
  color: var(--text);
}
.drive-dot {
  width: 8px; height: 8px; border-radius: 0;
  background: var(--text3); flex-shrink: 0;
}
.drive-dot.synced  { background: var(--green); box-shadow: 0 0 0 2px rgba(74,222,128,.2); }
.drive-dot.syncing { background: #FFD60A; animation: pulse .8s ease-in-out infinite alternate; }
.drive-dot.error   { background: var(--red); }
.firebase-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 0;
  background: var(--text3); margin-right: 6px; vertical-align: middle;
}
.firebase-dot.connected { background: var(--green); box-shadow: 0 0 0 2px rgba(74,222,128,.2); }
.firebase-dot.error     { background: var(--red); }
.firebase-dot.pending   { background: #FFD60A; animation: pulse .8s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .5; } to { opacity: 1; } }

/* ═══ ADDRESS AUTOCOMPLETE (BAN) ═══ */
.addr-suggestion {
  background: var(--bg2) !important;
  color: var(--text) !important;
  border-bottom-color: var(--border) !important;
}
.addr-suggestion:hover { background: var(--bg3) !important; color: #FFD60A !important; }

/* ═══ MOBILE OPTIMIZATIONS — fluidité tactile ═══ */
@media (hover: none) and (pointer: coarse) {
  /* Tap targets minimums sur mobile : 44x44 px */
  .nav-item { min-height: 64px; }
  button, .btn, .pill, .login-link, .tab { min-height: 40px; }
  /* Désactive hover sur tactile (sinon ça reste collé après tap) */
  .chantier-card:hover, .stat-card-link:hover, .photo-thumb:hover { background: inherit; border-color: var(--border); }
}

/* ═══ ACCESSIBILITÉ ═══ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; transition-duration: .01s !important; }
}

/* Focus visible pour accessibilité clavier */
*:focus-visible {
  outline: 2px solid #FFD60A;
  outline-offset: 2px;
}
button:focus-visible { outline-offset: 0; }

/* Scrollbars stylées */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: #FFD60A; }
