:root {
  --bg: #f3f5fb;
  --card: #ffffff;
  --ink: #18213a;
  --muted: #6b7689;
  --line: #e7eaf3;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --green: #059669;
  --green-bg: #d1fae5;
  --amber: #d97706;
  --amber-bg: #fef3c7;
  --red: #e11d48;
  --red-bg: #ffe4e6;
  --shadow: 0 1px 3px rgba(16,24,40,.08), 0 1px 2px rgba(16,24,40,.06);
  /* Identité « startup » : dégradé de marque + halos colorés réutilisés partout. */
  --brand-grad: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
  --brand-grad-soft: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
  --accent: #8b5cf6;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-lift: 0 12px 30px -8px rgba(79,70,229,.35);
  --shadow-card: 0 1px 2px rgba(16,24,40,.05), 0 10px 24px -16px rgba(24,33,58,.30);
}

:root[data-theme="dark"] {
  --bg: #0b1020;
  --card: #151c2e;
  --ink: #e6eaf2;
  --muted: #93a0b5;
  --line: #283248;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --green: #34d399; --green-bg: #0c3a2c;
  --amber: #fbbf24; --amber-bg: #3a2e0c;
  --red: #fb7185; --red-bg: #3a1420;
  --shadow: 0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
  --brand-grad-soft: linear-gradient(135deg, #1b2440 0%, #241a3d 100%);
  --shadow-lift: 0 14px 34px -10px rgba(0,0,0,.6);
  --shadow-card: 0 1px 2px rgba(0,0,0,.4), 0 12px 28px -18px rgba(0,0,0,.7);
}
:root[data-theme="dark"] .google-btn,
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] .btn { background: #1f2a3d; color: var(--ink); }
:root[data-theme="dark"] .btn.primary { background: var(--brand-grad); }
:root[data-theme="dark"] th { background: #141b28; }
:root[data-theme="dark"] tbody tr:hover { background: #1d2738; }
:root[data-theme="dark"] #modal-form textarea { background: #1f2a3d; color: var(--ink); }
:root[data-theme="dark"] .toast { background: var(--brand-grad); color: #fff; }

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(900px 420px at 110% -8%, rgba(139,92,246,.14), transparent 60%),
    radial-gradient(800px 400px at -10% 0%, rgba(59,130,246,.12), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  padding: 0 24px; height: 64px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
}
/* ---------- Menu utilisateur ---------- */
.user-menu { display: flex; align-items: center; gap: 10px; }
.user-menu img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.user-menu .uname { font-weight: 600; font-size: 13px; }
.user-menu .uname small { display: block; color: var(--muted); font-weight: 500; }

/* ---------- Page de connexion ---------- */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: 0 24px 60px -16px rgba(79,70,229,.35); padding: 44px 36px 38px; width: 100%;
  max-width: 390px; text-align: center; margin: 20px;
  animation: stat-in .4s ease both;
}
.login-card::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 5px; background: var(--brand-grad);
}
.login-logo { font-size: 46px; }
.login-card h1 {
  font-size: 24px; margin: 10px 0 6px; font-weight: 800; letter-spacing: -.5px;
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-sub { color: var(--muted); margin: 0 0 24px; }
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 16px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer;
}
.google-btn:hover { background: var(--bg); box-shadow: var(--shadow); }
.login-note { margin-top: 20px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.login-note a { color: var(--primary); font-weight: 600; }
.login-form { display: grid; gap: 14px; text-align: left; }
.login-form .field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.login-form input { width: 100%; }
.btn.block { width: 100%; justify-content: center; }
.login-sep { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 18px 0; font-size: 13px; }
.login-sep::before, .login-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-foot { margin-top: 18px; font-size: 13px; }
.login-foot a { color: var(--primary); font-weight: 600; text-decoration: none; }
.login-ok { background: var(--green-bg); color: var(--green); padding: 12px 14px; border-radius: 9px; font-weight: 600; margin-bottom: 16px; }

/* ---------- Entités ---------- */
.entities-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 700px) { .entities-grid { grid-template-columns: 1fr; } }
.entity-col { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; box-shadow: var(--shadow); }
.entity-col h3 { margin: 0 0 14px; font-size: 16px; }
.entity-add { display: flex; gap: 8px; margin-bottom: 14px; }
.entity-add input { flex: 1; }
.entity-list { list-style: none; margin: 0; padding: 0; }
.entity-list li { display: flex; align-items: center; justify-content: space-between; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.entity-list li:last-child { border-bottom: none; }
.entity-list .ecount { color: var(--muted); font-size: 12px; margin-left: 8px; }

/* ---------- Paramètres compte ---------- */
.modal.modal-lg { max-width: 560px; }
.modal.modal-xl { max-width: 820px; }

/* Administration des comptes & Paramètres du compte : pleine largeur, sans scroll horizontal. */
#admin-overlay .modal.modal-lg { max-width: min(1100px, 96vw); width: 96vw; }
#settings-overlay .modal.modal-lg { max-width: min(900px, 94vw); width: 94vw; }
#admin-overlay .mini-table, #settings-overlay .mini-table { width: 100%; table-layout: auto; }

/* ---------- Indicateurs de politique de mot de passe ---------- */
.pw-policy { list-style: none; margin: 8px 0 0; padding: 0; font-size: 12.5px; }
.pw-policy li { padding: 2px 0; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.pw-policy li::before { content: "○"; color: var(--muted); font-weight: 700; }
.pw-policy li.ok { color: var(--green); }
.pw-policy li.ok::before { content: "✓"; color: var(--green); }
.switch-row { display: flex; align-items: center; justify-content: space-between; }
.switch { position: relative; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.settings-body { padding: 20px 22px; display: grid; gap: 22px; overflow-y: auto; overflow-x: hidden; flex: 1 1 auto; min-height: 0; min-width: 0; }
.settings-body > * { min-width: 0; }
.settings-section { border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.settings-section h4 { margin: 0 0 12px; font-size: 14px; }
.settings-section .field { margin-bottom: 10px; }
.settings-section .field label { font-size: 12.5px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 4px; }
.settings-section input { width: 100%; }
.pk-list { list-style: none; margin: 10px 0 0; padding: 0; }
.pk-list li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.qr-box { text-align: center; }
.qr-box img.qr-img {
  width: 240px; height: 240px; background: #fff; border-radius: 8px; padding: 8px;
  image-rendering: pixelated; image-rendering: crisp-edges; /* pixels nets, pas de flou */
}
.qr-secret { font-family: ui-monospace, Menlo, monospace; background: var(--bg); padding: 6px 10px; border-radius: 6px; display: inline-block; max-width: 100%; word-break: break-all; font-size: 12px; }
.badge.on { background: var(--green-bg); color: var(--green); }
.badge.off { background: var(--line); color: var(--muted); }

.brand { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.brand span {
  letter-spacing: -.6px;
  background: var(--brand-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-logo { width: 32px; height: 32px; display: block; flex-shrink: 0; filter: drop-shadow(0 4px 8px rgba(99,102,241,.35)); }
.login-logo-img { width: 72px; height: 72px; display: inline-block; filter: drop-shadow(0 8px 18px rgba(99,102,241,.4)); }

/* ---------- Sélecteur de solution (logo dropdown) ---------- */
.brand-switch { position: relative; }
.brand {
  border: none; background: transparent; cursor: pointer; padding: 4px 8px 4px 4px;
  border-radius: 12px; transition: background .15s ease; font: inherit;
}
.brand:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.brand-caret { color: var(--muted); font-size: 12px; margin-left: 2px; }
.solution-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 40;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 20px 50px -12px rgba(24,33,58,.4); padding: 6px; min-width: 250px;
  animation: pop .14s ease;
}
.solution-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: 10px; border: none; background: transparent;
  cursor: pointer; color: var(--ink); font: inherit;
}
.solution-item:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.solution-item img { width: 30px; height: 30px; flex-shrink: 0; }
.solution-item .si-name { font-weight: 700; }
.solution-item .si-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.solution-item.current { background: var(--brand-grad-soft); }
.solution-item:disabled { opacity: .5; cursor: not-allowed; }
.solution-item .si-lock { margin-left: auto; font-size: 13px; }

/* ---------- Onglets désactivés (solutions vides) ---------- */
.tabs.disabled { opacity: .45; pointer-events: none; }

/* ---------- Hero "bientôt disponible" ---------- */
.empty-hero {
  text-align: center; padding: 70px 24px; display: grid; gap: 14px; justify-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.empty-hero img { width: 88px; height: 88px; filter: drop-shadow(0 10px 22px rgba(99,102,241,.4)); }
.empty-hero h2 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.6px; }
.empty-hero p { margin: 0; color: var(--muted); max-width: 420px; }

/* ---------- Indicateurs cliquables ---------- */
.stat.clickable { cursor: pointer; }
.stat.clickable:active { transform: translateY(-1px) scale(.99); }

/* ---------- Cases solutions (table admin) ---------- */
.sol-checks { display: flex; gap: 9px; flex-wrap: wrap; }
.chk.sm { font-size: 12px; gap: 5px; }
.mini-table td select { padding: 5px 8px; border-radius: 8px; }
.tabs { display: flex; gap: 4px; }
.tab {
  border: none; background: transparent; padding: 9px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: transform .12s ease, background .15s ease, color .15s ease, box-shadow .15s ease;
}
.tab:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--ink); transform: translateY(-1px); }
.tab.active { background: var(--brand-grad); color: #fff; box-shadow: var(--shadow-lift); }
.tab.active:hover { color: #fff; }
.tab-badge {
  display: inline-block; min-width: 18px; padding: 1px 6px; margin-left: 4px;
  background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700;
}
.tab.active .tab-badge { background: #fff; color: var(--primary); }

/* ---------- Sous-onglets (Véhicules) ---------- */
.subtabs {
  display: flex; gap: 2px; padding: 12px 24px 0; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); background: var(--bg);
}
.subtab {
  border: none; background: transparent; padding: 9px 16px; border-radius: 8px 8px 0 0;
  font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subtab:hover { color: var(--ink); }
.subtab.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--card); }

/* ---------- Calques de la carte ---------- */
.map-layers { list-style: none; margin: 0 0 16px; padding: 0; }
.map-layers li { display: flex; align-items: center; gap: 8px; padding: 6px 2px; font-size: 13px; border-bottom: 1px solid var(--line); }
.map-layers li:last-child { border-bottom: none; }
.map-layers label { display: flex; align-items: center; gap: 8px; cursor: pointer; flex: 1; }
.map-layers input { width: auto; }
.map-layers .cnt { color: var(--muted); font-size: 12px; margin-left: auto; }
.map-dot { width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(0,0,0,.15); }

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px; padding: 20px 24px 4px;
}
.stat {
  position: relative; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-card);
  display: flex; align-items: center; gap: 14px;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  animation: stat-in .35s ease both;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--brand-grad); opacity: .9; }
.stat .stat-ico {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 12px;
  display: grid; place-items: center; font-size: 21px;
  background: var(--brand-grad-soft); box-shadow: inset 0 0 0 1px var(--line);
}
.stat .stat-main { min-width: 0; }
.stat .label { color: var(--muted); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.stat .value { font-size: 30px; font-weight: 800; margin-top: 2px; letter-spacing: -.5px; line-height: 1.05; }
.stat.green .value { color: var(--green); } .stat.green::before { background: linear-gradient(180deg, #34d399, #059669); }
.stat.amber .value { color: var(--amber); } .stat.amber::before { background: linear-gradient(180deg, #fbbf24, #d97706); }
.stat.red .value { color: var(--red); } .stat.red::before { background: linear-gradient(180deg, #fb7185, #e11d48); }
.stat.blue .value { color: var(--primary); }
@keyframes stat-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Main / toolbar ---------- */
main { padding: 16px 24px 48px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar h2 { margin: 0; font-size: 18px; }
.toolbar input[type="search"] { flex: 1; min-width: 220px; }

input, select {
  font: inherit; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-sm); background: var(--card); color: var(--ink); outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }

.btn {
  font: inherit; font-weight: 600; padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease, filter .15s ease;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 9%, var(--card)); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--brand-grad); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -6px rgba(79,70,229,.6); }
.btn.primary:hover { filter: brightness(1.06); box-shadow: var(--shadow-lift); }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 35%, var(--line)); background: var(--card); }
.btn.danger:hover { background: var(--red-bg); }
.btn.sm { padding: 5px 11px; font-size: 13px; }

/* ---------- Table ---------- */
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); padding: 13px 16px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 5%, var(--card));
}
td { padding: 12px 16px; border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
td.plate { font-weight: 700; font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); padding: 40px; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .2px; box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 22%, transparent); }
.badge.en_service { background: var(--green-bg); color: var(--green); }
.badge.maintenance { background: var(--amber-bg); color: var(--amber); }
.badge.hors_service { background: var(--red-bg); color: var(--red); }
.badge.expiree { background: var(--red-bg); color: var(--red); }
.badge.bientot { background: var(--amber-bg); color: var(--amber); }
.muted { color: var(--muted); }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.pagination button { min-width: 36px; }
.pagination .info { color: var(--muted); margin: 0 10px; }

/* ---------- Modale ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(16,24,40,.45);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal {
  background: var(--card); border-radius: 20px; width: 100%; max-width: 480px;
  box-shadow: 0 30px 70px -12px rgba(24,33,58,.45); animation: pop .16s cubic-bezier(.2,.9,.3,1.3);
  max-height: 92vh; display: flex; flex-direction: column; overflow: hidden;
}
@keyframes pop { from { transform: scale(.94) translateY(8px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); background: var(--brand-grad-soft); }
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.modal-close { border: none; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
#modal-form { padding: 20px 22px; display: grid; gap: 14px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-head, .modal-foot { flex-shrink: 0; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; border-bottom: 1px solid var(--line); }
.kv span { color: var(--muted); }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
.det-h { margin: 18px 0 8px; font-size: 14px; display: flex; align-items: center; gap: 10px; }
#modal-form textarea { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; resize: vertical; width: 100%; }
#modal-form textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); outline: none; }
.field-group { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px 4px; display: grid; gap: 10px; }
.field-group legend { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; padding: 0 6px; }
.chk { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.chk input { width: auto; }
input[type="file"] { font: inherit; }
.field { display: grid; gap: 5px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field .row { display: flex; gap: 10px; }
.field .row > * { flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--line); }
.modal-error { margin: 0 22px; padding: 10px 14px; background: var(--red-bg); color: var(--red); border-radius: 9px; font-weight: 600; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--brand-grad); color: #fff; padding: 13px 24px; border-radius: 999px;
  box-shadow: var(--shadow-lift); z-index: 60; font-weight: 700;
  animation: toast-in .25s cubic-bezier(.2,.9,.3,1.4);
}
.toast.err { background: linear-gradient(135deg, #fb7185, #e11d48); }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 16px) scale(.96); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* ---------- Historique entretien dans la modale ---------- */
.maint-history { max-height: 200px; overflow-y: auto; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th { padding: 6px 8px; font-size: 11px; }
.mini-table td { padding: 6px 8px; }
.sep { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* ---------- Bannière d'intégration ---------- */
.banner { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; font-weight: 600; }
.banner.ok { background: var(--green-bg); color: var(--green); border-color: var(--green); }
.banner.hidden { display: none; }

/* ---------- Carte (Map / OpenStreetMap) ---------- */
.map-layout { display: grid; grid-template-columns: 1fr 300px; gap: 16px; }
@media (max-width: 800px) { .map-layout { grid-template-columns: 1fr; } }
#map { height: 560px; border-radius: 12px; border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 1; }
.map-side { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); max-height: 560px; overflow-y: auto; }
.map-side h3 { margin: 0 0 10px; font-size: 15px; }
.leaflet-popup-content { font-size: 13px; }

/* ---------- Responsive des pop-ups ---------- */
.field .row { flex-wrap: wrap; }
.field .row > * { min-width: 130px; }
@media (max-width: 560px) {
  .modal { max-width: 100%; max-height: 96vh; margin: 0; border-radius: 12px; }
  .modal-overlay { padding: 8px; }
  .field .row { flex-direction: column; gap: 14px; }
  .details-grid { grid-template-columns: 1fr; }
  #modal-form, .settings-body { padding: 16px; }
  .toolbar { gap: 8px; }
}

.hidden { display: none !important; }
