/* ==========================================================================
   MROJEK.COM - IMMOVAULT UNIFIED DESIGN SYSTEM
   Fonts: Outfit (Headings & Body), JetBrains Mono (Numbers, Finance & Code)
   Aesthetic: Dark Obsidian Pine (#0c110e) + Luxury Ambient Glow + Radiant Gold
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

:root {
  /* Brand Master Alignment from mrojek.com */
  --bg-main: #0c110e;              /* Deep Obsidian Pine Canvas */
  --bg-sidebar: #0f1612;           /* Deep Sidebar Surface */
  --bg-card: rgba(30, 38, 32, 0.85); /* Exact mrojek.com card surface */
  --bg-card-hover: rgba(38, 50, 41, 0.95);
  --bg-input: #141c17;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(225, 182, 102, 0.22); /* Exact mrojek.com gold border */
  --border-gold: #e1b666;
  
  --gold-primary: #e1b666;         /* Signature Warm Gold */
  --gold-glow: #f5af4e;            /* Bright Amber Gold */
  --gold-bright: #fbbf24;
  --accent-glow: rgba(225, 182, 102, 0.35);

  --emerald-accent: #10b981;
  --emerald-light: rgba(16, 185, 129, 0.15);
  --emerald-border: rgba(16, 185, 129, 0.35);

  --red-alert: #ef4444;
  --red-light: rgba(239, 68, 68, 0.15);
  --red-border: rgba(239, 68, 68, 0.35);

  --amber-warn: #f59e0b;
  --amber-light: rgba(245, 158, 11, 0.15);
  --amber-border: rgba(245, 158, 11, 0.35);

  /* Typography & High-Contrast Readability (WCAG 2.2 AA >= 4.5:1) */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --text-main: #ffffff;
  --text-secondary: #cbd5e1;       /* Crisp Slate 300 (12.3:1 contrast against #0c110e) */
  --text-muted: #94a3b8;           /* Slate 400 (7.4:1 contrast against #0c110e) */
  --text-dim: #94a3b8;             /* Elevated to Slate 400 for strict WCAG 2.2 AA compliance */
  --text-gold: #f5af4e;

  /* Shapes & Elevations from mrojek.com */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --sidebar-width: 260px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 16px 36px -10px rgba(0, 0, 0, 0.65);
  --shadow-card-hover: 0 20px 40px -12px rgba(225, 182, 102, 0.28);

  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
}


/* Layout */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar Navigation */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  padding: 1.25rem 0.75rem;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.brand-text h1,
.brand-text .brand-title {
  display: block;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.nav-link.active {
  background: rgba(225, 182, 102, 0.12);
  color: var(--gold-primary);
  border: 1px solid rgba(225, 182, 102, 0.25);
}

.nav-link svg {
  flex-shrink: 0;
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.privacy-tag {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--emerald-accent);
  padding: 0.4rem 0.6rem;
  background: rgba(16, 185, 129, 0.08);
  border-radius: var(--radius-sm);
  font-weight: 600;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  color: var(--text-muted);
}

.lang-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 700;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}

.lang-btn.active {
  color: var(--gold-primary);
  background: rgba(225, 182, 102, 0.15);
}

/* Main Content Area */
.app-main {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 2.25rem 2.5rem;
  max-width: 1300px;
}

/* View Header */
.view-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.view-header h2 {
  font-size: 1.85rem;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.sub-text {
  font-size: 0.92rem;
  color: var(--text-muted);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  background: linear-gradient(180deg, #e1b666 0%, #cf9e48 100%);
  color: #0b0f0d;
  font-weight: 700;
  font-size: 0.88rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(225, 182, 102, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: linear-gradient(180deg, #f5af4e 0%, #e1b666 100%);
  box-shadow: 0 6px 20px rgba(225, 182, 102, 0.4);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  background: rgba(225, 182, 102, 0.12);
  color: var(--gold-primary);
  border: 1px solid rgba(225, 182, 102, 0.3);
  font-weight: 700;
  font-size: 0.88rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(225, 182, 102, 0.2);
  border-color: var(--gold-primary);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none;
}

.btn-sm.gold {
  background: rgba(225, 182, 102, 0.15);
  color: var(--gold-primary);
  border-color: rgba(225, 182, 102, 0.35);
}
.btn-sm.gold:hover { background: rgba(225, 182, 102, 0.25); }

.btn-sm.green {
  background: rgba(16, 185, 129, 0.15);
  color: var(--emerald-accent);
  border-color: rgba(16, 185, 129, 0.35);
}
.btn-sm.green:hover { background: rgba(16, 185, 129, 0.25); }

.btn-sm.danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red-alert);
  border-color: rgba(239, 68, 68, 0.35);
}
.btn-sm.danger:hover { background: rgba(239, 68, 68, 0.25); }

.btn-sm.outline {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border-subtle);
}
.btn-sm.outline:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

.btn-danger-outline {
  background: transparent;
  color: var(--red-alert);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger-outline:hover { background: rgba(239, 68, 68, 0.15); }

/* KPI Cards */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-2px);
}

.kpi-card.gold-border { border-color: rgba(225, 182, 102, 0.35); }
.kpi-card.green-border { border-color: rgba(16, 185, 129, 0.35); }
.kpi-card.emerald-border { border-color: rgba(5, 150, 105, 0.35); }
.kpi-card.red-border { border-color: rgba(239, 68, 68, 0.4); }

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.kpi-lbl {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.kpi-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kpi-icon.gold { background: rgba(225, 182, 102, 0.12); color: var(--gold-primary); }
.kpi-icon.green { background: rgba(16, 185, 129, 0.12); color: var(--emerald-accent); }
.kpi-icon.emerald { background: rgba(5, 150, 105, 0.12); color: #34d399; }
.kpi-icon.red { background: rgba(239, 68, 68, 0.12); color: var(--red-alert); }

.kpi-val {
  font-size: 1.85rem;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.kpi-sub {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.text-gold { color: var(--gold-primary) !important; }
.text-green { color: var(--emerald-accent) !important; }
.text-red { color: var(--red-alert) !important; }
.text-white { color: #ffffff !important; }

/* Alert Box */
.alert-box {
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-top: 1.5rem;
}

.alert-box.red {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.alert-box.green {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

.alert-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.arrears-list {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.arrear-item {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* Action Portals */
.action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.action-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

.action-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--gold-primary);
  transform: translateY(-2px);
}

.action-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.action-icon.gold { background: rgba(225, 182, 102, 0.12); color: var(--gold-primary); }
.action-icon.green { background: rgba(16, 185, 129, 0.12); color: var(--emerald-accent); }
.action-icon.emerald { background: rgba(5, 150, 105, 0.12); color: #34d399; }
.action-icon.blue { background: rgba(59, 130, 246, 0.12); color: #60a5fa; }

.action-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.2rem;
}

.action-content p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.action-arrow {
  color: var(--text-dim);
  font-size: 1.2rem;
  margin-left: auto;
  transition: transform 0.2s;
}

.action-card:hover .action-arrow {
  color: var(--gold-primary);
  transform: translateX(3px);
}

/* Tables */
.table-responsive-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.data-table th {
  background: rgba(0, 0, 0, 0.35);
  padding: 0.85rem 1rem;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold-primary);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.sub-cell-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Badges & Chips */
.status-badge-chip {
  display: inline-flex;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-badge-chip.green { background: rgba(16, 185, 129, 0.15); color: var(--emerald-accent); border: 1px solid rgba(16, 185, 129, 0.3); }
.status-badge-chip.amber { background: rgba(245, 158, 11, 0.15); color: var(--amber-warn); border: 1px solid rgba(245, 158, 11, 0.3); }
.status-badge-chip.red { background: rgba(239, 68, 68, 0.15); color: var(--red-alert); border: 1px solid rgba(239, 68, 68, 0.3); }
.status-badge-chip.gray { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); border: 1px solid var(--border-subtle); }

.cat-pill {
  font-size: 0.75rem;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.key-pill {
  font-size: 0.72rem;
  color: var(--gold-primary);
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.form-input, .form-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus {
  border-color: var(--gold-primary);
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

.form-help {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
  display: block;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: #111814;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 650px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Printable Document Sheets (Nebenkosten & Mahnung) */
.printable-document-sheet {
  background: #ffffff;
  color: #1a202c;
  padding: 3rem 3.5rem;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  max-width: 900px;
  margin: 0 auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
}

.doc-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  font-size: 0.88rem;
  color: #4a5568;
}

.doc-recipient {
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.sender-mini-line {
  font-size: 0.68rem;
  color: #718096;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.35rem;
  margin-bottom: 0.75rem;
  text-decoration: underline;
}

.doc-subject h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #1a202c;
  margin-bottom: 0.4rem;
}

.doc-meta-bar {
  font-size: 0.82rem;
  color: #4a5568;
  padding: 0.5rem 0.75rem;
  background: #edf2f7;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.85rem;
}

.doc-table th {
  background: #2d3748;
  color: #ffffff;
  padding: 0.65rem 0.75rem;
  font-weight: 700;
  text-align: left;
}

.doc-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.doc-table-total td {
  background: #edf2f7;
  border-top: 2px solid #cbd5e0;
  font-size: 0.95rem;
}

.doc-balance-card {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.doc-balance-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

.doc-balance-row.total {
  font-size: 1.15rem;
  font-weight: 800;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  border-top: 2px solid #cbd5e0;
}

.doc-balance-row.total.arrears { color: #c53030; }
.doc-balance-row.total.credit { color: #276749; }

.doc-bank-box {
  background: #ebf8ff;
  border: 1px solid #bee3f8;
  border-radius: 6px;
  padding: 0.85rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.85rem;
  color: #2c5282;
}

.doc-adjustment-box {
  background: #fffff0;
  border: 1px solid #fefcbf;
  border-radius: 6px;
  padding: 0.85rem 1.25rem;
  margin: 1.25rem 0;
  font-size: 0.82rem;
  color: #744210;
}

.doc-signature-block {
  margin-top: 3rem;
  font-size: 0.92rem;
}

.signature-line {
  margin-top: 2.5rem;
  border-top: 1px solid #a0aec0;
  width: 250px;
  padding-top: 0.35rem;
}

/* Tool Tabs */
.tool-tabs-bar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.tool-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tool-tab-btn.active {
  background: rgba(225, 182, 102, 0.15);
  color: var(--gold-primary);
  border-color: var(--gold-primary);
}

.calc-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

.calc-results-panel {
  background: #080d0a;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
}

.calc-results-panel h4 {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.res-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  font-size: 0.88rem;
}

.res-lbl { color: var(--text-muted); }
.res-val { color: #ffffff; font-weight: 800; }

.res-item.highlight {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.res-item.highlight.gold { background: rgba(225, 182, 102, 0.12); border: 1px solid rgba(225, 182, 102, 0.25); }
.res-item.highlight.green { background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.25); }

/* Print Media Query */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    display: block !important;
  }
  .app-sidebar, .no-print, .header-controls, .kpi-grid, .view-header {
    display: none !important;
  }
  .app-main {
    margin-left: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
  .printable-document-sheet {
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 100% !important;
  }
}

/* ==========================================================================
   ADSENSE & PRIVACY COOKIE SETTINGS CONTROLS
   - Floating cookie widget hidden, placed below footer
   - No ad links, ad intents or auto-placed overlays
   ========================================================================== */
.google-revocation-link-placeholder,
div.google-revocation-link-placeholder,
[class*="googlefc-revocation-button"],
.google-auto-placed,
ins.adsbygoogle[data-ad-format="autorelaxed"],
.ad-intent-link,
a[data-google-ad-intent],
a[data-ad-intent],
a[href*="googleadservices"],
.ads-wrap {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}

.adsense-revocation-wrap {
    margin-top: 1.5rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.adsense-revocation-wrap a {
    color: var(--text-muted);
    text-decoration: underline;
    transition: color 0.2s ease;
    cursor: pointer;
}

.adsense-revocation-wrap a:hover {
    color: var(--gold-primary, #e1b666);
}

/* Dashboard Hero & Badges */
.dash-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.dash-hero-title h2 {
  font-size: 1.65rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.dash-hero-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.badge-pill.green {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-pill.gold {
  background: rgba(225, 182, 102, 0.12);
  color: var(--gold-primary);
  border: 1px solid rgba(225, 182, 102, 0.3);
}

.badge-pill .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Mobile App Bar */
.mobile-app-bar,
.mobile-app-header {
  display: none;
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVENESS (<= 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  body {
    display: block !important;
  }

  .app-container {
    flex-direction: column !important;
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .mobile-app-bar,
  .mobile-app-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 0.85rem 1.25rem !important;
    background: rgba(18, 24, 20, 0.98) !important;
    backdrop-filter: blur(15px) !important;
    -webkit-backdrop-filter: blur(15px) !important;
    border-bottom: 1px solid var(--border-subtle) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }


  .mobile-app-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
    font-family: var(--font-heading);
    letter-spacing: 0.04em;
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.85rem;
    background: rgba(225, 182, 102, 0.12);
    border: 1px solid rgba(225, 182, 102, 0.3);
    border-radius: var(--radius-sm);
    color: var(--gold-primary);
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-heading);
    cursor: pointer;
  }

  .app-sidebar {
    display: none !important;
    position: fixed !important;
    top: 58px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: calc(100vh - 58px) !important;
    z-index: 999 !important;
    background: rgba(14, 18, 15, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    overflow-y: auto !important;
    padding: 1.25rem 1.25rem 3rem !important;
    box-sizing: border-box !important;
    border-right: none !important;
  }

  .app-sidebar.mobile-open {
    display: flex !important;
    flex-direction: column !important;
  }

  .app-main {
    margin-left: 0 !important;
    padding: 1.5rem 1.25rem !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .calc-layout {
    grid-template-columns: 1fr !important;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  .action-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }
}

/* Phones & Small Screens (<= 640px) */
@media (max-width: 640px) {
  .app-main {
    padding: 1.25rem 0.85rem !important;
  }

  .kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .action-grid {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
  }

  .dash-hero {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  .dash-hero-title h2 {
    font-size: 1.4rem !important;
  }

  .view-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }

  .view-header .header-controls {
    width: 100% !important;
    flex-wrap: wrap !important;
  }

  .view-header button,
  .view-header select {
    width: 100% !important;
  }

  .table-responsive-card {
    border-radius: var(--radius-sm) !important;
    margin: 0 -0.5rem !important;
    width: calc(100% + 1rem) !important;
  }
}

/* ==========================================================================
   PROPERTIES & UNITS STYLING (Kapitalanlage & Eigennutzung)
   ========================================================================== */
.properties-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.property-block {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

.property-block-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.prop-info-main {
  flex: 1;
  min-width: 280px;
}

.prop-badge-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.prop-usage-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prop-usage-pill.gold {
  background: rgba(225, 182, 102, 0.18);
  color: var(--gold-primary);
  border: 1px solid rgba(225, 182, 102, 0.4);
}

.prop-usage-pill.emerald {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.prop-type-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.prop-area-pill, .prop-year-pill, .prop-country-pill {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.3);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.prop-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.35rem;
}

.prop-address-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.prop-meta-highlights {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0.45rem 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.prop-meta-highlights strong {
  color: #ffffff;
}

.prop-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Owner Occupied Box */
.owner-occupied-card {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-top: 1.25rem;
}

.owner-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.owner-top h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.2rem;
}

.owner-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 1rem;
  border-radius: var(--radius-sm);
}

.owner-detail-item .lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
}

.owner-detail-item .val {
  font-size: 1rem;
  font-weight: 800;
  color: #ffffff;
}

/* Units Container */
.units-container {
  margin-top: 1.25rem;
}

.units-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.units-header-bar h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.empty-units-note {
  padding: 1.25rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  border: 1px dashed var(--border-subtle);
}

.units-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.unit-card {
  background: rgba(10, 15, 12, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.unit-card:hover {
  border-color: var(--border-card);
  background: rgba(14, 20, 16, 0.9);
}

.unit-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.unit-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.unit-status-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.unit-status-badge.green {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.unit-status-badge.amber {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.unit-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.unit-tenant-box {
  background: rgba(0, 0, 0, 0.25);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.tenant-active-info .tenant-lbl {
  font-size: 0.72rem;
  color: var(--text-dim);
  display: block;
}

.tenant-active-info .tenant-name {
  font-size: 0.88rem;
  color: #ffffff;
  display: block;
  margin-bottom: 0.25rem;
}

.tenant-rent-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.tenant-rent-row strong {
  color: var(--gold-primary);
}

.tenant-vacant-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vacant-text {
  font-size: 0.8rem;
  color: #f59e0b;
}

.unit-meters-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.meter-chip {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: var(--text-muted);
}

.meter-tag {
  color: var(--gold-primary);
  font-weight: 700;
  margin-right: 0.2rem;
}

.unit-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
}

.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
}

.link-btn:hover {
  color: #ffffff;
}

.link-btn.text-red:hover {
  color: var(--red-alert);
}

/* ==========================================================================
   WCAG 2.2 AA ACCESSIBILITY & ERGONOMICS (44x44px Touch Targets)
   ========================================================================== */
.mobile-menu-btn,
.nav-link,
.btn-primary,
.btn-outline,
.btn-sm,
.modal-close-btn,
.lang-btn,
.form-input,
.form-select {
  min-height: 44px;
}

.mobile-menu-btn,
.modal-close-btn {
  min-width: 44px;
}

.nav-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.nav-link:hover,
.nav-link:focus-visible {
  background: rgba(225, 182, 102, 0.12);
  color: var(--gold-primary);
}

/* Clear Focus Rings for Keyboard Navigation */
:focus-visible {
  outline: 2px solid var(--gold-primary) !important;
  outline-offset: 2px !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold-primary) !important;
  outline-offset: 2px !important;
}

/* Numbers & Financial Metrics: Tabular Monospace Alignment */
.kpi-val,
.metric-value,
.money-display,
.table-number {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   STATIC SEO SKELETON & NO-SCRIPT CRAWLER PRERENDER
   ========================================================================== */
.static-seo-skeleton {
  padding: 2.5rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.seo-hero-header {
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 2rem;
}

.seo-badge-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.seo-main-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.seo-hero-lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 900px;
}

.seo-feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.seo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  box-shadow: var(--shadow-card);
}

.seo-card-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.seo-card-badge.emerald {
  background: var(--emerald-light);
  color: var(--emerald-accent);
  border: 1px solid var(--emerald-border);
}

.seo-card-badge.gold {
  background: rgba(225, 182, 102, 0.15);
  color: var(--gold-primary);
  border: 1px solid rgba(225, 182, 102, 0.35);
}

.seo-card h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.seo-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.seo-check-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.seo-check-list li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  position: relative;
  padding-left: 1.5rem;
}

.seo-check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35rem;
  width: 5px;
  height: 9px;
  border: solid var(--gold-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.seo-section {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
}

.seo-section h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--gold-primary);
  margin-bottom: 1.5rem;
}

.seo-card-table {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.seo-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

@media (max-width: 768px) {
  .seo-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

.seo-cell-head {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.95rem;
}

.seo-cell-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.seo-faq-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.seo-faq-item {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.25rem;
}

.seo-faq-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.seo-faq-item h3 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.seo-faq-item p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

