/****************************************************
 * ymoo · Immo-Dashboard – style.css (Apple / iOS Look)
 ****************************************************/

/* =========================
   RESET & BASIS
========================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #0f172a;
  background:
    radial-gradient(circle at 0% 0%, #e0f2fe 0, transparent 40%),
    radial-gradient(circle at 100% 0%, #e9d5ff 0, transparent 45%),
    radial-gradient(circle at 0% 100%, #dcfce7 0, transparent 40%),
    linear-gradient(135deg, #f9fafb, #e5e7eb);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Grundfarben / Tokens */

:root {
  --ymoo-primary: #4f46e5;
  --ymoo-primary-soft: #eef2ff;
  --ymoo-primary-soft2: #e0e7ff;
  --ymoo-accent: #22c55e;
  --ymoo-danger: #ef4444;
  --ymoo-border-soft: rgba(148, 163, 184, 0.45);
  --ymoo-card-bg: rgba(255, 255, 255, 0.82);
  --ymoo-card-blur: 14px;

  --btn-blue: #dbeafe;
  --btn-blue-text: #1e3a8a;
  --btn-green: #bbf7d0;
  --btn-green-text: #14532d;
  --btn-grey: #e5e7eb;
  --btn-grey-text: #111827;
  --btn-red: #fecaca;
  --btn-red-text: #7f1d1d;
  --btn-purple: #ddd6fe;
  --btn-purple-text: #4c1d95;
}

/* =========================
   PAGE LAYOUT
========================= */

.page {
  max-width: 1280px;
  margin: 24px auto 32px;
  padding: 16px;
}

/* =========================
   HEADER
========================= */

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 22px;
  background: var(--ymoo-card-bg);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.16),
    0 0 0 1px rgba(148, 163, 184, 0.15);
  backdrop-filter: blur(var(--ymoo-card-blur));
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-image {
  height: 40px;
  width: auto;
  border-radius: 12px;
}

.page-header-text h1 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-header-text p {
  margin: 0;
  color: #6b7280;
  font-size: 13px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-circle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0, #e0f2fe, #4f46e5);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 10px 25px rgba(79, 70, 229, 0.45),
    0 0 0 1px rgba(129, 140, 248, 0.4);
}

/* =========================
   TABS (Top-Navigation)
========================= */

.tabs {
  display: flex;
  gap: 8px;
  margin: 18px 0;
  flex-wrap: wrap;
}

.tab-button {
  border: none;
  outline: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 13px;
  color: #4b5563;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.35);
  cursor: pointer;
  transition: all 0.18s ease;
  backdrop-filter: blur(8px);
}

.tab-button .tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tab-button:hover {
  background: #eef2ff;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(148, 163, 184, 0.35);
}

.tab-button.active {
  background: linear-gradient(135deg, #4f46e5, #818cf8);
  color: #ffffff;
  border-color: transparent;
  box-shadow:
    0 10px 24px rgba(79, 70, 229, 0.45),
    0 0 0 1px rgba(191, 219, 254, 0.4);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* Icons in Tabs */
.tab-button svg path,
.tab-button svg circle {
  transition: stroke 0.18s ease;
}

.tab-button.active svg path,
.tab-button.active svg circle {
  stroke: #ffffff !important;
}

/* =========================
   CARDS & GRID
========================= */

.card {
  background: var(--ymoo-card-bg);
  border-radius: 20px;
  padding: 16px 18px;
  margin-bottom: 16px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow:
    0 18px 45px rgba(15, 23, 42, 0.16),
    0 0 0 1px rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(var(--ymoo-card-blur));
}

.card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 600;
}

.card-header-row,
.tab-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.card-wide {
  grid-column: span 2;
}

.card-ampel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.triple-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 1024px) {
  .triple-grid {
    grid-template-columns: 1fr;
  }

  .card-wide {
    grid-column: auto;
  }
}

/* =========================
   TEXTUTILS
========================= */

.muted {
  color: #6b7280;
  font-size: 13px;
}

.small {
  font-size: 12px;
}

/* =========================
   KPI-KACHELN (Dashboard oben)
========================= */

.kpi-main {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.kpi-tile {
  background: rgba(248, 250, 252, 0.88);
  border-radius: 16px;
  padding: 10px 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 8px 20px rgba(148, 163, 184, 0.28);
}

.kpi-tile-label {
  font-size: 12px;
  color: #6b7280;
}

.kpi-tile-value {
  font-size: 18px;
  font-weight: 600;
  margin: 4px 0;
}

.kpi-tile-sub {
  font-size: 11px;
  color: #9ca3af;
}

/* Filter in KPI-Karte */

.kpi-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.kpi-filter-label {
  font-size: 12px;
  color: #6b7280;
}

/* =========================
   FORMULARE / OBJEKTDATEN
========================= */

.obj-form-large {
  display: block;
}

.obj-form-large-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
}

@media (max-width: 960px) {
  .obj-form-large-grid {
    grid-template-columns: 1fr;
  }
}

.obj-form-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.block-card-big {
  padding: 12px 12px 14px;
  border-radius: 16px;
  background: rgba(249, 250, 251, 0.95);
  border: 1px solid rgba(229, 231, 235, 0.9);
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.35);
}

.block-card-big h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.block-card-big h4 {
  margin: 6px 0 4px;
  font-size: 13px;
}

.block-card-big label {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  color: #374151;
  margin-top: 6px;
  gap: 3px;
}

.block-separator {
  border: none;
  border-top: 1px dashed #e5e7eb;
  margin: 10px 0;
}

/* Inputs */

input[type="text"],
input[type="number"],
input[type="password"],
select,
textarea {
  font-family: inherit;
  font-size: 13px;
  padding: 7px 8px;
  border-radius: 12px;
  border: 1px solid rgba(209, 213, 219, 0.9);
  outline: none;
  background-color: rgba(255, 255, 255, 0.96);
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease, transform 0.1s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  border-color: #6366f1;
  box-shadow:
    0 0 0 1px rgba(99, 102, 241, 0.4),
    0 10px 24px rgba(129, 140, 248, 0.28);
  background-color: #ffffff;
  transform: translateY(-0.5px);
}

input::placeholder,
textarea::placeholder {
  color: #cbd5e1;
  opacity: 1;
}

.select-small {
  padding: 5px 8px;
  font-size: 12px;
}

/* generische Form-Helfer */

.form-row {
  display: flex;
  gap: 8px;
}

.form-row > * {
  flex: 1;
}

.input-with-unit {
  display: flex;
  align-items: stretch;
}

.input-with-unit input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-with-unit .unit {
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 0 12px 12px 0;
  border: 1px solid rgba(209, 213, 219, 0.9);
  border-left: none;
  background: #f3f4f6;
  font-size: 12px;
  color: #6b7280;
}

.form-actions-left {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

/* =========================
   BUTTONS – iOS / Pastell
========================= */

button {
  font-family: inherit;
}

.btn,
.btn-primary,
.btn-secondary,
.btn-outline,
.btn-ghost,
.btn-danger,
.btn-small {
  border-radius: 999px;
  border: none;
  font-size: 13px;
  padding: 7px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}

/* Primär – sanftes Blau (iOS-Style) */
.btn-primary {
  background: var(--btn-blue);
  color: var(--btn-blue-text);
  border: 1px solid #93c5fd;
  box-shadow:
    0 6px 14px rgba(59, 130, 246, 0.32),
    0 0 0 1px rgba(191, 219, 254, 0.6);
}

.btn-primary:hover {
  background: #93c5fd;
  transform: translateY(-1px);
}

/* Sekundär – hellgrau */
.btn-secondary,
a.btn-secondary {
  background: var(--btn-grey);
  color: var(--btn-grey-text);
  border: 1px solid #d1d5db;
}

.btn-secondary:hover,
a.btn-secondary:hover {
  background: #d4d4d8;
  transform: translateY(-1px);
}

/* Outline – leicht lila */
.btn-outline {
  background: #f5f3ff;
  color: var(--btn-purple-text);
  border: 1px solid #c4b5fd;
}

.btn-outline:hover {
  background: #e0e7ff;
  transform: translateY(-1px);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: #4b5563;
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: #f3f4f6;
  border-color: #e5e7eb;
  transform: translateY(-1px);
}

/* Danger */
.btn-danger {
  background: var(--btn-red);
  color: var(--btn-red-text);
  border: 1px solid #fecaca;
}

.btn-danger:hover {
  background: #fca5a5;
  transform: translateY(-1px);
}

/* Small */
.btn-small {
  padding: 5px 10px;
  font-size: 12px;
}

/* Icon-Button (z.B. Modal Close) */

.icon-button {
  border: none;
  background: transparent;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.18s ease;
}

.icon-button:hover {
  background: #e5e7eb;
  color: #111827;
  transform: translateY(-1px);
}

/* spezielle Buttons */

.btn-login-overlay {
  width: 100%;
  justify-content: center;
}

.btn-print-afa {
  margin-left: auto;
}

/* =========================
   MODALS (Ergebnis / Bearbeiten / Confirm / AfA / Immo-Score)
========================= */

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal:not(.hidden) {
  display: flex;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(10px);
}

.modal-dialog {
  position: relative;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 26px;
  padding: 24px 28px 20px;
  box-shadow:
    0 26px 70px rgba(15, 23, 42, 0.45),
    0 0 0 1px rgba(148, 163, 184, 0.28);
  max-width: 960px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
}

.modal-wide {
  width: 980px;
  max-width: 98vw;
}

.modal-xxl {
  max-width: 1200px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.modal-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: #f3f4f6;
  border-radius: 999px;
  border: none;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  font-size: 14px;
  transition: all 0.15s ease;
}

.modal-close:hover {
  background: #e5e7eb;
  color: #111827;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.modal-body {
  flex: 1;
  overflow: auto;
  padding-right: 4px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

/* Bearbeiten-Modal: scrollbarer Inhalt */

#edit-modal .modal-dialog {
  max-height: 90vh;
  overflow: hidden;
}

#edit-modal .edit-modal-scroll {
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 12px;
  padding-bottom: 24px;
  box-sizing: border-box;
}

#edit-modal .modal-actions {
  position: static;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Confirm-Dialog */

.modal-dialog.modal-confirm {
  max-width: 420px;
  width: 100%;
  padding: 24px 24px 20px;
}

#confirm-modal .confirm-content p {
  margin: 0 0 16px;
  font-size: 14px;
  color: #111827;
}

#confirm-modal .modal-actions {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Save-Dialog im Result-Modal */

.save-dialog {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.save-dialog.hidden {
  display: none;
}

.save-dialog-box {
  background: #ffffff;
  border-radius: 18px;
  padding: 18px 22px;
  max-width: 320px;
  text-align: center;
  box-shadow:
    0 18px 50px rgba(15, 23, 42, 0.45),
    0 0 0 1px rgba(148, 163, 184, 0.3);
}

.save-dialog-box h3 {
  margin: 0 0 6px;
}

/* =========================
   AUSWERTUNG & AMPEL (Result-Popup)
========================= */

.ampel-summary {
  margin-top: 6px;
}

.ampel-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f3f4ff;
  color: #1e3a8a;
  font-size: 12px;
}

.ampel-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  background: #fbbf24;
}

/* Farben für Score-Ampel */

.ampel-green {
  background: #22c55e;
}

.ampel-red {
  background: #ef4444;
}

.ampel-orange {
  background: #facc15;
}

.result-summary,
.longterm-summary {
  margin-top: 8px;
  font-size: 13px;
}

.summary-line {
  margin-bottom: 4px;
}

/* Summary-Grid */

.summary-header-line {
  font-weight: 400;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.summary-grid-horizontal {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-row {
  display: grid;
  grid-template-columns: 260px 140px minmax(0, 1fr);
  column-gap: 8px;
  align-items: baseline;
}

.summary-label strong {
  font-weight: 600;
}

.summary-label-note {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: #6b7280;
}

.summary-value strong {
  font-weight: 700;
}

.summary-explain {
  line-height: 1.3;
}

/* =========================
   JAHRES-TABELLE
========================= */

.table-wrapper {
  width: 100%;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

.yearly-table-wrapper {
  margin-top: 10px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
}

thead th {
  background: #f3f4f6;
  padding: 6px 8px;
  text-align: right;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

thead th:first-child {
  text-align: left;
}

tbody td {
  padding: 5px 8px;
  border-bottom: 1px solid #edf2f7;
  text-align: right;
  white-space: nowrap;
}

tbody td:first-child {
  text-align: left;
}

tbody tr:nth-child(even) {
  background: #f9fafb;
}

/* Kompakte Tabelle (AfA-Expert) */

.table-compact thead th,
.table-compact tbody td {
  padding: 4px 6px;
  font-size: 11px;
}

/* Detail-Chart */

#detailChart {
  margin-top: 4px;
}

/* =========================
   AMPEL-OVERVIEW (Dashboard rechts)
========================= */

.ampel-overview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.ampel-legend {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ampel-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.ampel-legend-item .ampel-dot {
  width: 10px;
  height: 10px;
}

.ampel-dot.green {
  background: #22c55e;
}

.ampel-dot.yellow {
  background: #facc15;
}

.ampel-dot.red {
  background: #ef4444;
}

.ampel-stack {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.ampel-circle {
  border-radius: 999px;
  opacity: 0.9;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
}

.ampel-circle.red {
  background: radial-gradient(circle at 30% 30%, #fecaca, #ef4444);
}

.ampel-circle.yellow {
  background: radial-gradient(circle at 30% 30%, #fef3c7, #f59e0b);
}

.ampel-circle.green {
  background: radial-gradient(circle at 30% 30%, #bbf7d0, #22c55e);
}

/* =========================
   DEINE OBJEKTE – Liste
========================= */

.dashboard-objects {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.dash-object-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: rgba(249, 250, 251, 0.98);
  cursor: pointer;
  transition: all 0.16s ease;
}

.dash-object-row:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.42);
}

.dash-object-name {
  font-size: 13px;
  font-weight: 500;
  color: #111827;
}

.dash-object-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dash-object-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #f3f4ff;
  color: #1e3a8a;
  font-size: 12px;
}

.dot-mini {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #facc15;
}

/* Pill-Farben (Ampel) */

.pill-gruen {
  background: #dcfce7;
  color: #166534;
}

.pill-gelb {
  background: #fef3c7;
  color: #92400e;
}

.pill-rot {
  background: #fee2e2;
  color: #991b1b;
}

/* =========================
   INFO-TAB (Förderung etc.)
========================= */

.info-header h2 {
  margin: 0 0 4px;
}

.info-header p {
  margin: 0 0 10px;
}

.info-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.info-chip {
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  color: #4b5563;
  transition: all 0.15s ease;
}

.info-chip:hover {
  background: #e5e7eb;
}

.info-chip-active {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.info-card {
  position: relative;
  border-radius: 16px;
  padding: 10px 10px 12px;
  border: 1px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}

.info-card h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.info-tagline {
  margin: 0 0 8px;
  font-size: 12px;
  color: #6b7280;
}

.info-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
}

/* Badge-Farben */

.badge-gold {
  background: #fef3c7;
  color: #92400e;
}

.badge-blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge-green {
  background: #dcfce7;
  color: #166534;
}

.badge-red {
  background: #fee2e2;
  color: #991b1b;
}

.badge-grey {
  background: #e5e7eb;
  color: #374151;
}

.badge-orange {
  background: #ffedd5;
  color: #9a3412;
}

.badge-purple {
  background: #ede9fe;
  color: #5b21b6;
}

.badge-soft {
  background: #e5e7eb;
  color: #4b5563;
}

/* Mehr-Button & Details im Info-Tab */

.info-more-btn {
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  color: #4b5563;
  transition: all 0.15s ease;
  margin-bottom: 4px;
}

.info-more-btn:hover {
  background: #e5e7eb;
}

.info-details {
  font-size: 12px;
  color: #374151;
  overflow: hidden;
  transition: max-height 0.2s ease;
}

.info-details ul {
  padding-left: 18px;
  margin: 6px 0;
}

.info-details li {
  margin-bottom: 2px;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 6px;
}

.info-table td {
  font-size: 12px;
  padding: 2px 4px;
}

/* =========================
   AFA-EXPERTENMODUS
========================= */

.afa-expert-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 82vh;
  overflow: hidden;
}

.expert-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.expert-header-main h3 {
  margin: 0 0 4px;
}

.expert-hint {
  margin: 0;
  font-size: 12px;
  color: #6b7280;
}

.expert-marketing-block {
  padding: 10px 12px;
  border-radius: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
}

.expert-label {
  font-size: 12px;
  color: #374151;
}

.marketing-text-output {
  margin-top: 8px;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #eef2ff;
  border: 1px dashed #c7d2fe;
}

.info-text {
  font-size: 12px;
  color: #6b7280;
  margin: 4px 0 0;
}

.expert-table-section h4,
.expert-chart-section h4 {
  margin: 0 0 4px;
  font-size: 14px;
}

.expert-table-section .table-wrapper {
  margin-top: 4px;
}

.chart-container {
  margin-top: 6px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 8px;
}

.expert-recommendation {
  margin-top: 6px;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #ecfdf5;
  border: 1px dashed #bbf7d0;
}

.expert-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

/* AfA-Modal Scroll */

#afa-modal .modal-dialog {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

#afa-modal .afa-expert-panel {
  overflow-y: auto;
  padding-bottom: 16px;
}

/* =========================
   IMMO-SCORE-MODAL
========================= */

.immo-score-objectname {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.immo-score-main {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

@media (max-width: 640px) {
  .immo-score-main {
    grid-template-columns: 1fr;
  }
}

.immo-score-total-box,
.immo-score-plus-box {
  border-radius: 16px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
}

.immo-score-total-box {
  background: radial-gradient(circle at top left, #e0f2fe, #ffffff);
}

.immo-score-plus-box {
  background: radial-gradient(circle at top left, #dcfce7, #ffffff);
}

.immo-score-total-box .label,
.immo-score-plus-box .label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.immo-score-total-value {
  font-size: 24px;
  font-weight: 700;
  color: #1d4ed8;
}

.immo-score-plus-value {
  font-size: 20px;
  font-weight: 600;
  color: #15803d;
}

.immo-score-breakdown {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  padding: 8px 10px;
  font-size: 13px;
}

.immo-score-breakdown-item {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.immo-score-breakdown-item:last-child {
  margin-bottom: 0;
}

/* Immo-Score Badge im Header */

.immo-score-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.immo-score-badge {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 999px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  box-sizing: border-box;
}

.immo-score-badge::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  border-width: 2px;
  border-style: solid;
  opacity: 0.4;
  box-sizing: border-box;
}

.immo-score-gruen {
  background: #dcfce7;
  color: #166534;
}

.immo-score-gruen::before {
  border-color: #4ade80;
}

.immo-score-gelb {
  background: #fef9c3;
  color: #854d0e;
}

.immo-score-gelb::before {
  border-color: #facc15;
}

.immo-score-rot {
  background: #fee2e2;
  color: #b91c1c;
}

.immo-score-rot::before {
  border-color: #f97373;
}

.immo-score-value {
  font-size: 22px;
  font-weight: 700;
}

.immo-score-label {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.85;
}

/* =========================
   LOGIN-OVERLAY
========================= */

body.has-login-overlay {
  overflow: hidden;
}

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(
      circle at top,
      rgba(129, 140, 248, 0.5),
      rgba(15, 23, 42, 0.9)
    );
  backdrop-filter: blur(12px);
}

.login-overlay-box {
  position: relative;
  z-index: 1;
  width: 360px;
  max-width: 90vw;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 24px;
  padding: 20px 22px 18px;
  box-shadow:
    0 30px 80px rgba(15, 23, 42, 0.8),
    0 0 0 1px rgba(148, 163, 184, 0.4);
}

.login-overlay-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
}

.login-overlay-box h1 {
  margin: 0 0 4px;
  font-size: 20px;
  text-align: center;
}

.login-overlay-box p {
  margin: 0 0 8px;
  text-align: center;
}

.login-overlay-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-password-input {
  width: 100%;
}

.login-overlay-footer {
  margin-top: 10px;
  font-size: 11px;
}

.error-msg {
  background: #fee2e2;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  color: #991b1b;
  text-align: center;
}

/* =========================
   RESPONSIVE / SONSTIGES
========================= */

main {
  margin-top: 4px;
}

@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-actions {
    align-self: stretch;
    justify-content: space-between;
  }

  .modal-dialog.modal-wide {
    width: 96vw;
    padding: 14px;
  }

  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-actions .btn,
  .modal-actions .btn-primary,
  .modal-actions .btn-secondary,
  .modal-actions .btn-outline,
  .modal-actions .btn-ghost {
    width: 100%;
    justify-content: center;
  }

  .form-actions-left {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions-left button {
    width: 100%;
    justify-content: center;
  }
}

@media (max-height: 700px) {
  #afa-modal .modal-dialog {
    max-height: 95vh;
  }
}
