@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

:root {
  --primary: #1e3a8a;
  --primary-dark: #172e6b;
  --accent: #14b8a6;
  --accent-dark: #0d9488;
  --accent-muted: #0f766e;
  --bg: #fafafa;
  --card: #ffffff;
  --text: #18181b;
  --muted: #71717a;
  --brand: var(--primary);
  --brand-dark: var(--primary-dark);
  --brand-soft: #eff6ff;
  --accent-soft: #f0fdfa;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #b91c1c;
  --border: #e4e4e7;
  --radius-pill: 1.5rem;
  --shadow-brand: 0 10px 25px -5px rgba(30, 58, 138, 0.28);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-muted); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem; }
.container-wide { max-width: 1480px; }

.topbar-sticky {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.topbar {
  background: #fff;
  color: var(--text);
  padding: 0.65rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.topbar-main {
  border-bottom: 1px solid var(--border);
}
.topbar-operation {
  padding: 0.5rem 1.5rem;
  background: linear-gradient(90deg, var(--brand-soft) 0%, var(--accent-soft) 100%);
  border-bottom: 1px solid #bfdbfe;
}
.topbar-operation-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem 0;
  max-width: 100%;
}
.topbar-op-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(191, 219, 254, 0.9);
  font-size: 0.82rem;
  line-height: 1.3;
  color: #3f3f46;
  max-width: 100%;
}
.topbar-op-tag strong {
  color: var(--primary);
  font-weight: 700;
}
.topbar-op-tag--name {
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  border-color: #93c5fd;
  background: #fff;
}
.topbar-op-tag--name:hover {
  color: var(--accent-muted);
  text-decoration: none;
  border-color: var(--accent);
}
.topbar-op-tag--address {
  min-width: 0;
  white-space: normal;
  word-break: break-word;
}
.topbar-op-tag--parcel,
.topbar-op-tag--ref,
.topbar-op-tag--plu {
  color: var(--accent-muted);
  font-weight: 500;
  white-space: nowrap;
}
.topbar-op-tag--plu {
  border-color: #a7f3d0;
  background: rgba(255, 255, 255, 0.9);
}
.topbar-op-tag--plu strong {
  color: #047857;
}
.topbar-op-divider {
  width: 1px;
  height: 1.25rem;
  margin: 0 0.45rem;
  background: linear-gradient(180deg, transparent, #94a3b8 20%, #94a3b8 80%, transparent);
  flex-shrink: 0;
}
@media (max-width: 720px) {
  .topbar-op-divider { display: none; }
  .topbar-operation-group { gap: 0.35rem; }
}
.topbar-brand-text { min-width: 0; }

.study-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.study-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.topbar-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.topbar-back-btn,
.topbar-new-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.topbar-back-btn {
  background: var(--primary);
  color: #fff;
  border: 1px solid var(--primary);
  box-shadow: var(--shadow-brand);
}
.topbar-back-btn:hover {
  background: var(--primary-dark);
  color: #fff;
  border-color: var(--primary-dark);
  text-decoration: none;
}
.topbar-new-btn {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.topbar-new-btn:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
  text-decoration: none;
}
.topbar nav a.topbar-back-btn,
.topbar nav a.topbar-back-btn:hover {
  color: #fff;
}
.topbar nav a.topbar-new-btn,
.topbar nav a.topbar-new-btn:hover {
  color: #fff;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}
.topbar-logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  line-height: 0;
  text-decoration: none;
}
.topbar-logo:hover { text-decoration: none; }
.topbar-logo-img {
  display: block;
  height: 3rem;
  width: auto;
  max-width: min(18rem, 52vw);
  object-fit: contain;
}
@media (min-width: 768px) {
  .topbar-logo-img {
    height: 3.75rem;
    max-width: 24rem;
  }
}
@media (min-width: 1024px) {
  .topbar-logo-img {
    height: 4.25rem;
    max-width: 28rem;
  }
}
.topbar-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--primary) 0%, var(--accent-muted) 48%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.topbar .sub { color: var(--muted); font-size: 0.82rem; margin-top: 0.1rem; }
.topbar nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.15rem 1rem;
}
.topbar nav a {
  color: #3f3f46;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}
.topbar nav a:hover { color: var(--accent); text-decoration: none; }
.topbar-user {
  color: var(--muted);
  font-size: 0.85rem;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  cursor: pointer;
}
.users-table code {
  font-size: 0.88rem;
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.card h2 { margin: 0 0 0.75rem; font-size: 1.15rem; }
.muted { color: var(--muted); font-size: 0.9rem; }

.btn {
  display: inline-block;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.55rem 1.15rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-brand);
}
.btn-primary:hover {
  background: var(--primary-dark);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-accent {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 25px -5px rgba(20, 184, 166, 0.28);
}
.btn-accent:hover {
  background: var(--accent-dark);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-secondary { background: #f4f4f5; color: #3f3f46; border: 1px solid var(--border); }
.btn-secondary:hover { background: #e4e4e7; text-decoration: none; }
.btn-danger { background: #b91c1c; color: #fff; }
.btn-danger:hover { background: #991b1b; text-decoration: none; color: #fff; }
.btn-sm { padding: 0.35rem 0.65rem; font-size: 0.8rem; }
.delete-form { margin: 0; display: inline; }
.user-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.user-edit-row td { background: #f8fafc; padding: 1rem 0.5rem; }
.user-edit-form { max-width: 420px; }
.user-edit-form h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.user-edit-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.user-row-editing td { background: #f1f5f9; }
.success-banner {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.65rem 0.5rem; border-bottom: 1px solid var(--border); }
th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.sort-link {
  color: inherit;
  text-decoration: none;
}
.sort-link:hover { color: var(--brand); text-decoration: underline; }
.sort-link.sort-active { color: var(--text); font-weight: 700; }

.studies-card { overflow: visible; }
.studies-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.studies-table {
  width: 100%;
  min-width: 1280px;
  table-layout: auto;
}
.studies-table col.col-open { width: 5.5rem; }
.studies-table col.col-name { width: 20rem; }
.studies-table col.col-owner { width: 11rem; }
.studies-table col.col-address { width: auto; }
.studies-table col.col-collect { width: 7rem; }
.studies-table col.col-date { width: 9rem; }
.studies-table col.col-actions { width: 13rem; }

.studies-table .col-open { width: 5.5rem; white-space: nowrap; }
.studies-table .col-name { min-width: 20rem; }
.studies-table .col-owner { min-width: 11rem; }
.studies-table .col-address { min-width: 16rem; }
.studies-table .col-collect { min-width: 7rem; white-space: nowrap; }
.studies-table .col-date { min-width: 9rem; white-space: nowrap; }
.studies-table .col-actions { min-width: 13rem; white-space: nowrap; }

.studies-table th,
.studies-table td {
  padding: 0.8rem 0.75rem;
  vertical-align: middle;
}
.studies-table tbody tr:hover { background: #f8fafc; }

.study-open-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-width: 72px;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-muted) 100%);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow-brand);
}
.study-open-btn:hover {
  background: var(--primary-dark);
  color: #fff;
  text-decoration: none;
}
.study-open-icon {
  font-size: 1rem;
  line-height: 1;
}
.study-open-label { line-height: 1; }

.inline-input {
  width: 100%;
  min-width: 8rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  background: #fff;
  color: var(--text);
}
.studies-table .col-name .inline-input { min-width: 18rem; }
.studies-table .col-owner .inline-input { min-width: 9rem; }
.inline-input:hover { border-color: #cbd5e1; background: #f8fafc; }
.inline-input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
}
.study-address {
  display: block;
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}
.study-date {
  font-size: 0.82rem;
  white-space: nowrap;
}
.study-actions {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: flex-end;
  white-space: nowrap;
}
.studies-table td { vertical-align: middle; }
.studies-table .col-collect,
.studies-table .col-open,
.studies-table .col-date {
  text-align: center;
}
.studies-table .col-collect .badge { white-space: nowrap; }

.badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-auto { background: #dcfce7; color: var(--ok); }
.badge-semi { background: #fef3c7; color: var(--warn); }
.badge-manual { background: #f1f5f9; color: var(--muted); }
.badge-done { background: var(--accent-soft); color: var(--accent-muted); }
.badge-pending { background: #fee2e2; color: var(--danger); }

.alerts { display: grid; gap: 0.5rem; margin: 1rem 0; }
.alert {
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
}
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #e0f2fe; color: #075985; }

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.form-group input, .form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  gap: 0.75rem;
}
.form-row-city {
  grid-template-columns: 1fr 120px;
}
.form-row-names {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 700px) {
  .form-row, .form-row-city { grid-template-columns: 1fr; }
}

input[readonly] {
  background: #f8fafc;
  color: #475569;
}

.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  max-height: 280px;
  overflow-y: auto;
}
.autocomplete-list li {
  padding: 0.65rem 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}
.autocomplete-list li:last-child { border-bottom: none; }
.autocomplete-list li:hover,
.autocomplete-list li.active {
  background: var(--accent-soft);
}
.suggestion-label {
  display: block;
  font-weight: 600;
  color: var(--text);
}
.suggestion-meta {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.dossier-grid { display: grid; gap: 0.75rem; }
.sub-dossier-grid {
  display: grid;
  gap: 0.65rem;
  margin: 0.85rem 0 0.5rem;
  padding-left: 0.85rem;
  border-left: 3px solid var(--accent);
}
.dossier-sub {
  background: var(--accent-soft);
  border-color: #99f6e4;
}
.dossier-sub h4 {
  margin: 0;
  font-size: 0.95rem;
}
.dossier-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
  background: #fff;
}
.dossier-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.dossier-head h3 { margin: 0; font-size: 1rem; }
.file-list { margin: 0.75rem 0 0; padding-left: 1.1rem; color: var(--muted); font-size: 0.9rem; }
.upload-row { margin-top: 0.75rem; display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.upload-row input[type=file] { font-size: 0.85rem; }

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.meta-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}
.meta-box .label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; }
.meta-box .value { font-weight: 600; margin-top: 0.2rem; }

.plans-actions-inline {
  margin: 0.75rem 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.dossier-item--cadastre {
  padding: 0.85rem 1rem;
}
.dossier-item--cadastre .dossier-head {
  margin-bottom: 0.35rem;
}
.dossier-item--cadastre .dossier-head h3 {
  font-size: 0.95rem;
}

.cadastre-infos {
  margin-top: 0.35rem;
  padding: 0.75rem 0.9rem;
  background: linear-gradient(135deg, var(--brand-soft) 0%, var(--accent-soft) 100%);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
}
.cadastre-compact-facts {
  min-width: 0;
}
.cadastre-previews-gallery {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.65rem;
  margin-top: 0.75rem;
}
.cadastre-preview-card {
  margin: 0;
  flex: 0 0 auto;
  width: 11.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.cadastre-preview-caption {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--primary);
  text-align: center;
  line-height: 1.2;
}
.cadastre-compact-address {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.35;
}
.cadastre-fact-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-content: flex-start;
  gap: 0.3rem 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 36rem;
}
.cadastre-fact-list li {
  font-size: 0.8rem;
  color: #3f3f46;
  line-height: 1.3;
  padding: 0.18rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(191, 219, 254, 0.9);
}
.cadastre-fact-label {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-right: 0.2rem;
}
.cadastre-empty {
  margin: 0;
  font-size: 0.85rem;
}
@media (max-width: 520px) {
  .cadastre-previews-gallery {
    flex-wrap: wrap;
  }
}
@media (max-width: 640px) {
  .cadastre-fact-list {
    max-width: none;
  }
}

.cadastre-plan-thumb-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 360px;
  padding: 0.65rem;
  border: 1px solid #99f6e4;
  border-radius: 10px;
  background: #fff;
  cursor: zoom-in;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cadastre-plan-thumb-trigger:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 16px rgba(30, 58, 138, 0.12);
}
.cadastre-plan-thumb-frame {
  width: 100%;
  border-radius: 6px;
  background: #f8fafc;
  line-height: 0;
}
.cadastre-plan-thumb-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}
.cadastre-plan-thumb-hint {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

/* Vignettes cadastre : image seule, sans carré blanc */
.cadastre-previews-gallery .cadastre-plan-thumb-trigger {
  width: 11.5rem;
  max-width: 11.5rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  gap: 0;
  cursor: zoom-in;
}
.cadastre-previews-gallery .cadastre-plan-thumb-trigger:hover {
  border: none;
  box-shadow: none;
  opacity: 0.88;
}
.cadastre-previews-gallery .cadastre-plan-thumb-frame {
  width: 11.5rem;
  height: 7.5rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: transparent;
  line-height: 0;
}
.cadastre-previews-gallery .cadastre-plan-thumb-img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 11.5rem;
  max-height: 7.5rem;
  object-fit: contain;
  background: transparent;
}
.cadastre-previews-gallery .cadastre-plan-thumb-hint {
  display: none;
}

.vues-section-title {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.92rem;
  color: var(--primary);
}
.vues-section-title:first-of-type {
  margin-top: 0.25rem;
}
.aerial-gallery {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.65rem;
  margin: 0.35rem 0 0.75rem;
}
.aerial-preview-card {
  margin: 0;
  flex: 0 0 auto;
  width: 11.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.aerial-preview-caption {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--primary);
  text-align: center;
  line-height: 1.2;
}
.aerial-empty {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.85rem;
}
.aerial-gallery .aerial-preview-trigger {
  width: 11.5rem;
  max-width: 11.5rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  box-shadow: none;
  display: block;
  cursor: zoom-in;
  line-height: 0;
}
.aerial-gallery .aerial-preview-trigger:hover {
  opacity: 0.88;
}
.aerial-gallery .aerial-preview-img {
  display: block;
  width: 11.5rem;
  height: 7.5rem;
  max-width: 11.5rem;
  max-height: 7.5rem;
  object-fit: cover;
  object-position: center;
  border-radius: 4px;
  background: transparent;
}
.aerial-gallery--street .aerial-preview-card,
.aerial-gallery--street .aerial-preview-trigger,
.aerial-gallery--street .aerial-preview-img {
  width: 14rem;
  max-width: 14rem;
}
.aerial-gallery--street .aerial-preview-img {
  height: 7.5rem;
  max-height: 7.5rem;
}
.aerial-gallery .aerial-preview-hint {
  display: none;
}
.aerial-gallery--zonage {
  margin-top: 0.5rem;
}
.aerial-gallery--zonage .zonage-preview-card,
.aerial-gallery--zonage .zonage-preview-trigger,
.aerial-gallery--zonage .zonage-preview-img {
  width: 100%;
  max-width: 28rem;
}
.aerial-gallery--zonage .zonage-preview-img {
  height: auto;
  max-height: 16rem;
  object-fit: contain;
  border: 1px solid var(--border);
  background: #f1f5f9;
}
.zonage-zone-summary {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.88rem;
  line-height: 1.45;
}
.zonage-zone-type,
.zonage-zone-partition {
  font-weight: 500;
  color: var(--muted, #64748b);
}
.dossier-item--risques .risques-tables {
  display: grid;
  gap: 1rem;
  margin-top: 0.5rem;
}
.risques-table-title {
  margin: 0 0 0.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--accent-muted, #9a3412);
}
.risques-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.risques-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  line-height: 1.4;
}
.risques-table th,
.risques-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}
.risques-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.risques-table tbody tr:last-child td {
  border-bottom: none;
}
.risques-row--present {
  background: #fff7ed;
}
.risques-statut--present {
  font-weight: 600;
  color: #c2410c;
}

.plu-recap-zone-summary {
  margin: 0.35rem 0 0.65rem;
  font-size: 0.88rem;
  line-height: 1.45;
}
.plu-recap-destination {
  font-weight: 500;
}
.plu-recap-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  margin-top: 0.35rem;
}
.plu-recap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  line-height: 1.45;
}
.plu-recap-table th,
.plu-recap-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.65rem;
  text-align: left;
  vertical-align: top;
}
.plu-recap-table th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.plu-recap-table tbody tr:last-child td {
  border-bottom: none;
}
.plu-recap-theme {
  font-weight: 600;
  color: var(--text);
  min-width: 11rem;
}
.plu-recap-summary {
  font-weight: 600;
  color: #0f4c81;
  min-width: 10rem;
  max-width: 14rem;
}
.plu-recap-row--verified .plu-recap-summary {
  color: #9a3412;
}
.plu-recap-detail {
  color: var(--muted);
  font-size: 0.82rem;
}
.plu-recap-page {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.78rem;
}
.plu-recap-note,
.plu-recap-links {
  margin: 0.65rem 0 0;
  font-size: 0.84rem;
}
.plu-prescriptions-details {
  margin-top: 0.65rem;
  font-size: 0.84rem;
}
.plu-prescriptions-list {
  margin: 0.45rem 0 0;
  padding-left: 1.2rem;
}
.vues-app-links {
  margin: 0.5rem 0 0.85rem;
}
.vues-app-links-lead {
  margin: 0 0 0.4rem;
  font-size: 0.82rem;
}
.vues-app-address {
  font-weight: 600;
  color: var(--text);
}
.vues-app-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.vues-app-link {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  text-decoration: none;
  font-size: 0.8rem;
  max-width: 14rem;
}
.vues-app-link:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  text-decoration: none;
}
.vues-app-link-label {
  font-weight: 600;
  color: var(--primary);
}
.vues-app-link-hint {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.ign-temps-actions {
  margin-top: 0.65rem;
}
.ign-temps-gallery {
  margin-top: 0.65rem;
}
.ign-temps-open-btn {
  flex-shrink: 0;
}

.cadastre-plan-dialog {
  border: none;
  padding: 0;
  margin: auto;
  max-width: none;
  max-height: none;
  width: auto;
  background: transparent;
  overflow: visible;
}
.cadastre-plan-dialog::backdrop {
  background: rgba(15, 23, 42, 0.78);
}
.cadastre-plan-dialog-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.25);
}
.cadastre-plan-dialog-close:hover {
  background: var(--accent-soft);
}
.cadastre-plan-dialog-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  max-width: 95vw;
  max-height: 95vh;
  padding: 0.5rem;
}
.cadastre-plan-dialog-img {
  display: block;
  max-width: 95vw;
  max-height: calc(95vh - 3rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.35);
}
.cadastre-plan-dialog-pdf {
  font-size: 0.88rem;
  color: #fff;
  text-decoration: underline;
}
.cadastre-plan-dialog-pdf:hover {
  color: #99f6e4;
}
.cadastre-missing-official {
  margin: 0.85rem 0 0;
  padding: 0.65rem 0.85rem;
  background: var(--accent-soft);
  border: 1px dashed #99f6e4;
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--muted);
}
.cadastre-missing-official--inline {
  flex-shrink: 0;
  margin: 0;
  padding: 0.25rem 0.45rem;
  font-size: 0.72rem;
  border-radius: 6px;
}

.cadastre-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.85rem;
}
.cadastre-layout-docs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 960px) {
  .cadastre-layout,
  .cadastre-layout-docs { grid-template-columns: 1fr; }
}
.cadastre-section {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  min-height: 100%;
}
.cadastre-section h4 {
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
  color: var(--primary);
}
.cadastre-section-desc {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  line-height: 1.35;
}
.cadastre-empty { margin: 0; font-size: 0.85rem; }

.cadastre-plan-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
@media (max-width: 520px) {
  .cadastre-plan-grid { grid-template-columns: 1fr; }
}
.cadastre-plan-thumb {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.75rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cadastre-plan-thumb:hover {
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(30, 58, 138, 0.1);
  text-decoration: none;
  color: var(--text);
}
.cadastre-plan-thumb img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
}
.cadastre-plan-thumb span {
  text-align: center;
  word-break: break-all;
}

.doc-chips {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.doc-chip {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.doc-chip:hover {
  border-color: var(--brand);
  background: var(--accent-soft);
  text-decoration: none;
}
.doc-chip-html::before {
  content: "HTML";
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
}
.doc-chip-pdf::before {
  content: "PDF";
  display: inline-block;
  margin-right: 0.4rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 0.7rem;
  font-weight: 700;
}
.doc-chip-official {
  margin-bottom: 0.65rem;
  border-color: #99f6e4;
  background: linear-gradient(135deg, var(--accent-soft) 0%, #fff 100%);
  font-weight: 600;
}
.doc-chip-official:hover {
  border-color: var(--brand);
  background: var(--accent-soft);
}

.login-page {
  background:
    linear-gradient(135deg, rgba(30, 58, 138, 0.06) 0%, rgba(20, 184, 166, 0.08) 100%),
    var(--bg);
}
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.login-card {
  width: 100%;
  max-width: 420px;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.login-brand {
  text-align: center;
  margin-bottom: 1.25rem;
}
.login-logo {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 4.5rem;
  object-fit: contain;
  margin: 0 auto 0.75rem;
  display: block;
}
.login-app-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  background: linear-gradient(120deg, var(--primary) 0%, var(--accent-muted) 48%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-hint { margin-top: 1rem; font-size: 0.85rem; }
.btn-block { display: block; width: 100%; text-align: center; }
.error { color: var(--danger); font-size: 0.9rem; margin-top: 0.5rem; }

.completion-card { margin-bottom: 1rem; }
.completion-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.completion-head h2 { margin: 0; }
.completion-score {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--brand-soft);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}
.completion-bar {
  height: 10px;
  background: #e4e4e7;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.85rem;
}
.completion-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transition: width 0.35s ease;
}
.completion-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.completion-chip {
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
}
.completion-chip--done {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
  font-weight: 600;
}

.upload-multi-card { margin-bottom: 1rem; }
.upload-dropzone {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
}
.upload-dropzone input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}
.upload-dropzone-label {
  display: grid;
  gap: 0.25rem;
  cursor: pointer;
  text-align: center;
  padding: 1rem;
}
.upload-dropzone-title {
  font-weight: 600;
  color: var(--primary);
}
.upload-dropzone-hint {
  font-size: 0.85rem;
  color: var(--muted);
}
.upload-dropzone.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}