/* ============================================
   CARTES BIENS — RentaLab (Premium)
   Dépendances : variables dans /style.css
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700&family=DM+Sans:wght@400;500;600&display=swap');

.biens-main {
  margin-top: 60px;
  min-height: calc(100vh - 60px);
  padding-bottom: 64px;
  background: #ffffff;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.biens-main h1,
.biens-main h2,
.biens-detail-title {
  font-family: 'Syne', sans-serif;
}

.biens-main * {
  box-sizing: border-box;
}

.biens-main [hidden] {
  display: none !important;
}

/* ── Toolbar hero ── */
.biens-hero-toolbar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 48px 22px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.biens-hero-text {
  flex: 1;
  min-width: 240px;
}

.biens-hero-text h1 {
  font-size: 40px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--color-text);
}

.biens-hero-sub {
  font-size: 18px;
  color: var(--color-text-light);
  margin: 0;
  line-height: 1.5;
}

/* ── Boutons ── */
.biens-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: #2563eb;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
}

.biens-btn-primary:hover {
  background: #1d4ed8;
}

.biens-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.biens-btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #2563eb;
  background: #fff;
  border: 1px solid rgba(37, 99, 235, 0.45);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
}

.biens-btn-outline:hover {
  background: rgba(37, 99, 235, 0.06);
  border-color: #2563eb;
}

.biens-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: #dc2626;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
}

.biens-btn-danger:hover {
  background: #b91c1c;
}

.biens-btn-ghost {
  background: transparent;
  border: none;
  color: var(--color-text-light);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 8px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
}

.biens-btn-ghost:hover {
  color: #2563eb;
}

.biens-btn-icon-circle {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
}

.biens-btn-icon-circle:hover {
  border-color: #2563eb;
  color: #2563eb;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.biens-detail-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ── Grille cartes ── */
.biens-section-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 22px 48px;
}

.biens-save-toast {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 3000;
  font-size: 14px;
  font-weight: 600;
  color: #166534;
  background: #dcfce7;
  border-radius: 10px;
  padding: 12px 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.biens-save-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.biens-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

@media (max-width: 1024px) {
  .biens-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .biens-grid {
    grid-template-columns: 1fr;
  }

  .biens-hero-text h1 {
    font-size: 30px;
  }

  .biens-hero-toolbar {
    padding-top: 36px;
  }
}

/* ── Carte bien ── */
.biens-card {
  background: var(--color-bg);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.07);
  cursor: pointer;
  transition: var(--transition, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
  border: 1px solid transparent;
}

.biens-card:hover {
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

.biens-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--color-bg-light, #f5f5f7);
  overflow: hidden;
}

.biens-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.biens-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 42px;
  background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 100%);
}

/* Badges DPE (couleurs officielles) */
.biens-badge-dpe {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Syne', sans-serif;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.biens-badge-dpe--a {
  background: #319834;
  color: #fff;
}
.biens-badge-dpe--b {
  background: #33cc33;
  color: #fff;
}
.biens-badge-dpe--c {
  background: #cbec00;
  color: #111827;
}
.biens-badge-dpe--d {
  background: #fbec00;
  color: #111827;
}
.biens-badge-dpe--e {
  background: #fbad00;
  color: #fff;
}
.biens-badge-dpe--f {
  background: #f9640d;
  color: #fff;
}
.biens-badge-dpe--g {
  background: #f90d0d;
  color: #fff;
}
.biens-badge-dpe--nc {
  background: rgba(255, 255, 255, 0.95);
  color: #4b5563;
  border: 1px solid var(--color-border);
}

/* Badges statut */
.biens-badge-statut {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
}

.biens-badge-statut--a_appeler {
  background: #eff6ff;
  color: #2563eb;
}
.biens-badge-statut--a_visiter {
  background: #fef9c3;
  color: #854d0e;
}
.biens-badge-statut--offre_en_cours {
  background: #dcfce7;
  color: #166534;
}
.biens-badge-statut--abandonne {
  background: #f3f4f6;
  color: #6b7280;
}

/* ── Statut picker (vue fiche : badge cliquable + dropdown) ── */
.biens-statut-picker {
  position: relative;
  display: inline-block;
}

.biens-statut-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  line-height: 1.2;
  border-radius: 20px;
  border: 2px solid transparent;
  background: transparent;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    filter 0.15s ease,
    box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.biens-statut-btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.97);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.biens-statut-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.biens-statut-arrow {
  display: inline-block;
  font-size: 12px;
  line-height: 1;
  transition: transform 0.18s ease;
}

.biens-statut-picker.is-open .biens-statut-arrow {
  transform: rotate(180deg);
}

.biens-statut-btn--a_appeler {
  background: #eff6ff;
  color: #2563eb;
  border-color: #93c5fd;
}
.biens-statut-btn--a_visiter {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde047;
}
.biens-statut-btn--offre_en_cours {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}
.biens-statut-btn--abandonne {
  background: #f3f4f6;
  color: #6b7280;
  border-color: #d1d5db;
}

.biens-statut-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 180px;
  z-index: 100;
}

.biens-statut-dropdown[hidden] {
  display: none !important;
}

.biens-statut-dropdown li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--color-text);
  border-radius: 6px;
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    color 0.12s ease;
}

.biens-statut-dropdown li:hover {
  background: #f3f4f6;
}

.biens-statut-dropdown li.is-current {
  font-weight: 600;
  color: #2563eb;
}

.biens-statut-dropdown li.is-current::after {
  content: '✓';
  font-weight: 700;
  margin-left: 8px;
}

@media (max-width: 480px) {
  .biens-statut-dropdown {
    min-width: 200px;
  }
}

.biens-card-body {
  padding: 16px 18px 18px;
}

.biens-card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 6px;
  line-height: 1.35;
}

.biens-card-addr {
  font-size: 14px;
  color: var(--color-text-light);
  margin: 0 0 10px;
  line-height: 1.45;
}

.biens-card-meta {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  margin: 0 0 14px;
}

.biens-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.biens-link-fiche {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  margin-left: auto;
  transition: var(--transition, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
}

.biens-card:hover .biens-link-fiche {
  gap: 8px;
}

/* TRI 10 ans sur la carte (vue liste) */
.biens-carte-tri {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  margin-bottom: 2px;
}

.biens-carte-tri-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9ca3af;
}

.biens-carte-tri-value {
  font-size: 16px;
  font-weight: 700;
  font-family: 'Syne', sans-serif;
  line-height: 1;
}

.biens-carte-tri-value--pos {
  color: #166534;
}
.biens-carte-tri-value--neg {
  color: #991b1b;
}
.biens-carte-tri-value--neutral {
  color: var(--color-text);
}

/* ── État vide ── */
.biens-empty {
  grid-column: 1 / -1;
  background: var(--color-bg-light);
  border: 2px dashed var(--color-border);
  border-radius: 16px;
  padding: 56px 32px;
  text-align: center;
}

.biens-empty-icon {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 16px;
}

.biens-empty h2 {
  font-family: 'Syne', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 10px;
}

.biens-empty p {
  font-size: 15px;
  color: var(--color-text-light);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.55;
}

/* ── Vue fiche ── */
.biens-detail-shell {
  max-width: 900px;
  margin: 0 auto;
  padding: 88px 22px 48px;
}

.biens-detail-top {
  margin-bottom: 20px;
}

.biens-detail-hero-photo {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
  background: var(--color-bg-light);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.biens-detail-hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.biens-detail-header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.biens-detail-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.biens-detail-addr {
  font-size: 16px;
  color: var(--color-text-light);
  margin: 0 0 16px;
}

.biens-detail-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 20px;
  font-size: 15px;
  color: #374151;
}

.biens-detail-kpis strong {
  font-weight: 600;
}

.biens-detail-sim-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 15px;
  color: #2563eb;
  text-decoration: none;
}

.biens-detail-sim-link:hover {
  text-decoration: underline;
}

/* Position relative badges en fiche (non absolus) */
.biens-badge-dpe--inline {
  position: static;
  box-shadow: none;
  height: auto;
  min-height: 32px;
}

/* ── Onglets ── */
.biens-tabs-strip {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.biens-tab-btn {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  color: var(--color-text-light);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  margin-bottom: -1px;
  transition:
    color 0.22s ease,
    border-color 0.22s ease,
    background 0.22s ease;
}

.biens-tab-btn:hover {
  color: var(--color-text);
  background: rgba(37, 99, 235, 0.04);
}

.biens-tab-btn.is-active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.biens-tab-panels {
  position: relative;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 14px 14px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  min-height: 280px;
}

.biens-tab-panel {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    visibility 0.28s;
  position: absolute;
  inset: 24px;
  overflow-y: auto;
  overflow-x: hidden;
}

.biens-tab-panel.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  position: relative;
  inset: auto;
}

/* Notes */
.biens-notes-textarea {
  width: 100%;
  min-height: 220px;
  padding: 16px;
  font-size: 15px;
  font-family: inherit;
  line-height: 1.55;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  resize: vertical;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.biens-notes-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.biens-muted-hint {
  font-size: 13px;
  color: var(--color-text-light);
  margin: 12px 0 0;
}

/* Questions / checklist */
.biens-q-category {
  font-family: 'Syne', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 24px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border);
}

.biens-q-category:first-child {
  margin-top: 0;
}

.biens-q-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.biens-q-item {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-bg-light, #fafafa);
  transition: var(--transition, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
}

.biens-q-item.biens-q-item--checked {
  opacity: 0.68;
  background: #f9fafb;
}

.biens-q-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.biens-q-row input[type='checkbox'] {
  margin-top: 4px;
  width: 18px;
  height: 18px;
  accent-color: #2563eb;
  cursor: pointer;
  flex-shrink: 0;
}

.biens-q-label {
  font-size: 15px;
  line-height: 1.45;
  color: var(--color-text);
  cursor: pointer;
  flex: 1;
}

.biens-note-toggle {
  display: inline-block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.biens-note-toggle:hover {
  text-decoration: underline;
}

.biens-q-note-field {
  margin-top: 10px;
}

.biens-q-note-field input[type='text'] {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  font-family: inherit;
}

.biens-q-note-field input:focus {
  outline: none;
  border-color: #2563eb;
}

/* ── Questions Q/A (réponses libres) ── */
.biens-q-list--qa {
  gap: 16px;
}

.biens-q-item--qa {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--color-bg);
  border-color: var(--color-border);
}

.biens-q-item--qa .biens-q-label {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--color-text);
  cursor: default;
}

.biens-q-textarea {
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  resize: vertical;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.biens-q-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.biens-q-textarea::placeholder {
  color: #9ca3af;
}

/* ── Checklist visite (3 états) ── */
.biens-cl-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.biens-cl-item {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.biens-cl-text {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--color-text);
}

.biens-cl-states {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.biens-cl-state-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 36px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  color: #4b5563;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.biens-cl-state-btn:hover {
  background: #f9fafb;
}

.biens-cl-state-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.biens-cl-state-btn--bon.is-active {
  background: #dcfce7;
  color: #166534;
  border-color: #86efac;
}

.biens-cl-state-btn--correct.is-active {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}

.biens-cl-state-btn--surveiller.is-active {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde047;
}

.biens-cl-state-btn--probleme.is-active {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

.biens-cl-state-btn--non_pertinent.is-active {
  background: #f3f4f6;
  color: #6b7280;
  border-color: #d1d5db;
}

.biens-cl-item--etat-bon {
  border-color: #bbf7d0;
}

.biens-cl-item--etat-correct {
  border-color: #bfdbfe;
}

.biens-cl-item--etat-surveiller {
  border-color: #fef08a;
}

.biens-cl-item--etat-probleme {
  border-color: #fecaca;
}

.biens-cl-item--etat-non_pertinent {
  border-color: #e5e7eb;
}

/* ── Checklist visite : items à options custom ── */
.biens-cl-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.biens-cl-option-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 14px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background-color 0.18s ease,
    color 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.biens-cl-option-btn:hover {
  background: #e5e7eb;
}

.biens-cl-option-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.biens-cl-option-btn.is-active {
  background: #eff6ff;
  color: #2563eb;
  border-color: #93c5fd;
}

.biens-cl-comment-toggle {
  align-self: flex-start;
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.biens-cl-comment-toggle:hover {
  text-decoration: underline;
}

.biens-cl-comment-wrap {
  margin-top: -2px;
}

.biens-cl-textarea {
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  resize: vertical;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.biens-cl-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.biens-cl-textarea::placeholder {
  color: #9ca3af;
}

@media (max-width: 480px) {
  .biens-cl-state-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    padding: 8px 10px;
    font-size: 13px;
  }
  .biens-cl-options {
    flex-wrap: wrap;
  }
  .biens-cl-option-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    padding: 6px 10px;
    font-size: 13px;
  }
}

/* ── Onglet « Ma simulation » ── */
.biens-sim-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 36px 24px;
  text-align: center;
  background: var(--color-bg-light, #fafafa);
  border: 1px dashed var(--color-border);
  border-radius: 12px;
}

.biens-sim-empty-text {
  margin: 0;
  font-size: 15px;
  color: var(--color-text-light);
}

.biens-sim-empty-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  transition: color 0.18s ease;
}

.biens-sim-empty-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.biens-sim-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.biens-sim-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.biens-sim-head-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.biens-sim-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.biens-sim-badge--lmnp {
  background: #eff6ff;
  color: #2563eb;
}

.biens-sim-badge--nue {
  background: #dcfce7;
  color: #166534;
}

.biens-sim-badge--rp {
  background: #f5f3ff;
  color: #6d28d9;
}

.biens-sim-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
  word-break: break-word;
}

.biens-sim-open {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.biens-sim-open:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.biens-sim-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.biens-sim-kpi {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.biens-sim-kpi-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-light);
}

.biens-sim-kpi-value {
  font-size: 24px;
  font-weight: 700;
  font-family: 'Syne', sans-serif;
  color: var(--color-text);
  line-height: 1.15;
  word-break: break-word;
}

.biens-sim-kpi-value--pos {
  color: #166534;
}

.biens-sim-kpi-value--neg {
  color: #991b1b;
}

.biens-sim-kpi-value--neutral {
  color: var(--color-text);
}

.biens-sim-note {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-light);
  line-height: 1.45;
}

@media (max-width: 480px) {
  .biens-sim-kpis {
    grid-template-columns: 1fr;
  }
  .biens-sim-kpi-value {
    font-size: 20px;
  }
}

/* ── Photos visite ── */
.biens-photos-actions {
  margin-bottom: 18px;
}

.biens-photo-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.biens-photos-warning {
  font-size: 13px;
  color: #b45309;
  margin: 10px 0 0;
}

.biens-grid-photos {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 640px) {
  .biens-grid-photos {
    grid-template-columns: repeat(2, 1fr);
  }
}

.biens-photo-tile {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-bg-light);
}

.biens-photo-thumb-wrap {
  position: relative;
  aspect-ratio: 1;
  cursor: zoom-in;
  overflow: hidden;
}

.biens-photo-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.biens-photo-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.biens-photo-remove:hover {
  background: #dc2626;
}

.biens-photo-legend-editor {
  padding: 8px 10px;
  font-size: 13px;
}

.biens-photo-legend-editor input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
}

.biens-photo-legend-editor input:focus {
  outline: none;
}

.biens-photo-legend-placeholder {
  color: var(--color-text-light);
}

/* Lightbox */
.biens-lightbox {
  position: fixed;
  inset: 0;
  z-index: 3500;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}

.biens-lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.biens-lightbox-inner {
  max-width: min(920px, 100%);
  max-height: 92vh;
  position: relative;
}

.biens-lightbox-inner img {
  max-width: 100%;
  max-height: 78vh;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.biens-lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 4px;
}

.biens-lightbox-caption {
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
  margin-top: 14px;
  font-size: 14px;
}

/* ── Modale ── */
.biens-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2600;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.biens-modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.biens-modal {
  background: var(--color-bg);
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: min(92vh, 720px);
  overflow-y: auto;
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.2),
    0 12px 24px rgba(0, 0, 0, 0.08);
  transform: scale(0.96);
  transition: transform 0.25s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.biens-modal-overlay.is-open .biens-modal {
  transform: scale(1);
}

.biens-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--color-border);
}

.biens-modal-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.biens-modal-close {
  width: 38px;
  height: 38px;
  border: none;
  background: var(--color-bg-light);
  border-radius: 10px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text);
  transition: var(--transition, all 0.3s cubic-bezier(0.4, 0, 0.2, 1));
}

.biens-modal-close:hover {
  background: #e5e7eb;
}

.biens-modal-body {
  padding: 22px;
}

.biens-field {
  margin-bottom: 16px;
}

.biens-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}

.biens-field input[type='text'],
.biens-field input[type='number'],
.biens-field input[type='url'],
.biens-field select,
.biens-field textarea {
  width: 100%;
  padding: 11px 12px;
  font-size: 15px;
  font-family: inherit;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-bg);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.biens-field input:focus,
.biens-field select:focus,
.biens-field textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.biens-modal-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  padding: 18px 22px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-light, #fafafa);
  border-radius: 0 0 12px 12px;
}

.biens-field-error {
  font-size: 12px;
  color: #dc2626;
  margin-top: 4px;
}

/* === Modale : photo de couverture (URL ou upload) === */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.biens-field-legend {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.biens-photo-mode-tabs {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  background: #f3f4f6;
  border-radius: 999px;
  margin-bottom: 10px;
}

.biens-photo-mode-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: #4b5563;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.biens-photo-mode-btn:hover {
  color: #111827;
}

.biens-photo-mode-btn.is-active {
  background: #ffffff;
  color: #2563eb;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.biens-photo-mode-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.biens-photo-pane[hidden] {
  display: none !important;
}

.biens-photo-hint {
  margin: 6px 0 0 0;
  font-size: 12px;
  color: var(--color-text-light, #6b7280);
  line-height: 1.45;
}

.biens-photo-input-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  opacity: 0;
}

.biens-photo-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 110px;
  padding: 22px 18px;
  text-align: center;
  background: #f9fafb;
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  color: var(--color-text);
  font: inherit;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.biens-photo-dropzone:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.biens-photo-dropzone:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.biens-photo-dropzone.is-dragover {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1e3a8a;
}

.biens-photo-dropzone-text {
  font-size: 14px;
  font-weight: 600;
}

.biens-photo-dropzone-sub {
  font-size: 12px;
  color: var(--color-text-light, #6b7280);
  font-weight: 400;
}

.biens-photo-error {
  margin: 8px 0 0 0;
  font-size: 12px;
  color: #dc2626;
}

.biens-photo-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 10px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: 10px;
}

.biens-photo-preview-img {
  display: block;
  max-height: 120px;
  max-width: 160px;
  width: auto;
  height: auto;
  border-radius: 8px;
  object-fit: cover;
  background: #f3f4f6;
}

.biens-photo-preview-meta {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.biens-photo-preview-name {
  font-size: 13px;
  color: var(--color-text);
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
}

.biens-photo-preview-remove {
  appearance: none;
  border: 0;
  background: #f3f4f6;
  color: #4b5563;
  font: inherit;
  font-size: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.biens-photo-preview-remove:hover {
  background: #fee2e2;
  color: #991b1b;
}

.biens-photo-preview-remove:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .biens-photo-mode-tabs {
    display: flex;
    width: 100%;
  }
  .biens-photo-mode-btn {
    flex: 1;
    text-align: center;
  }
  .biens-photo-preview {
    flex-direction: column;
    align-items: stretch;
  }
  .biens-photo-preview-img {
    max-width: 100%;
    max-height: 160px;
  }
}
