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

/* =====================================================
   INSUREAPP – GRUNDDESIGN
   Einheitliches Designsystem für alle Frontend-Seiten
   ===================================================== */


/* =====================================================
   1. Design Tokens
   ===================================================== */
  :root {
    /* Brand / Primärfarben */
    --primary: #243D63;
    --primary-soft: #e7edf7;
    --accent: #1FC5A8;
    --accent-soft: #d5f5ee;

    --bs-primary: var(--primary);
    --bs-primary-rgb: 36, 61, 99;

    /* Statusfarben */
    --success: #16a34a;
    --warning: #f59e0b;
    --danger:  #dc2626;

    /* Neutrale & Textfarben */
    --text-main: var(--color-text-main);
    --text-muted: var(--color-text-muted);
    --text-light: var(--color-surface);
    --text-dark: var(--text-main);

    /* Hintergründe */
    --background: var(--color-bg-app);
  --surface: var(--color-surface);
  --surface-alt: var(--color-surface-alt);

  /* Komponenten */
  --corner-radius: var(--radius-lg);
  --corner-radius-pill: var(--radius-pill);
  --soft-shadow: var(--elevation-2);
  --brand-logo-src: "/static/assets/img/LogoInsureApp.png";

    /* Layout */
    --header-h: 72px;
    --header-pad: 16px;
    --footer-h: 56px;
    --agent-sidebar-width: 260px;
    --agent-sidebar-collapsed-width: 84px;
    --content-max-width: 1440px;

    /* Typografie */
    --font-heading: "Exo 2", "Montserrat", system-ui, -apple-system, sans-serif;
    --font-body: "Inter", "Montserrat", system-ui, -apple-system, sans-serif;

    --font-page-title: var(--font-size-8);
    --font-section-title: var(--font-size-6);
    --font-ui-heading: var(--font-size-5);
    --font-standard: var(--font-size-3);
    --font-form: var(--font-size-2);
    --font-meta: var(--font-size-1);

    /* Bootstrap Radius Tokens */
    --bs-border-radius: var(--corner-radius);
    --bs-border-radius-sm: var(--corner-radius);
    --bs-border-radius-lg: var(--corner-radius);
    --bs-border-radius-xl: var(--corner-radius);
    --bs-border-radius-xxl: var(--corner-radius);
    --bs-border-radius-pill: var(--corner-radius-pill);

    /* Buttons */
    --bs-btn-border-radius: var(--corner-radius);
    --bs-btn-border-radius-sm: var(--corner-radius);
    --bs-btn-border-radius-lg: var(--corner-radius);
  }

  /* =====================================================
     2. Allgemeines Seitenlayout
     ===================================================== */
body {
  font-family: var(--font-body);
  background-color: var(--background);
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-size: var(--font-standard);
  line-height: 1.5;
}

p,
li,
a,
button,
input,
textarea,
select,
label {
  font-family: inherit;
  font-size: inherit;
}

h1,
h2,
h3,
h4,
h5 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

h1 {
  font-size: var(--font-page-title);
}

h2,
h3 {
  font-size: var(--font-section-title);
}

h4 {
  font-size: var(--font-ui-heading);
}

h5 {
  font-size: var(--font-standard);
}

.app-main-shell {
  max-width: var(--content-max-width);
}

.agent-content > .app-section {
  margin-bottom: var(--space-3);
}

.agent-content > .app-section:last-child {
  margin-bottom: 0;
}

.page-header-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--elevation-3);
  background: var(--color-surface);
}

.page-header-card h1 {
  letter-spacing: var(--letter-spacing-tight);
}

.app-surface-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--elevation-2);
}

.page-header,
.agent-hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.page-header > h1,
.agent-hero h1 {
  margin: 0;
  font-size: var(--font-page-title);
  line-height: var(--line-height-tight);
}

.page-subtitle,
.agent-hero p {
  font-size: var(--font-form);
  color: var(--text-muted);
  margin: 0;
}

.app-section h2 {
  font-size: var(--font-size-6);
  line-height: var(--line-height-tight);
}

.app-section .text-muted {
  color: var(--color-text-muted) !important;
}

.btn,
.policy-tab,
.hero-stat-link,
.sidebar-link,
.policy-details-link,
.note-trigger,
.link-button {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:focus-visible,
.policy-tab:focus-visible,
.hero-stat-link:focus-visible,
.sidebar-link:focus-visible,
.policy-details-link:focus-visible,
.note-trigger:focus-visible,
.link-button:focus-visible {
  outline: none;
  box-shadow: var(--elevation-1);
}

.link-button,
.policy-details-link,
.note-trigger {
  font-size: var(--font-size-2);
  font-weight: 600;
}

small,
.chip-label,
.meta-text,
.badge,
.text-muted.small,
.small {
  font-size: var(--font-meta);
}

.table thead th,
.form-label,
.input-group-text,
.ui-heading {
  font-family: var(--font-heading);
  font-size: var(--font-ui-heading);
  font-weight: 600;
}

.form-check-input {
  accent-color: var(--primary);
}

.table tbody td,
.form-control,
.form-select,
.input-group-text,
.customers-search input {
  font-size: var(--font-form);
}

.agent-kpi-card h2,
.hero-stat .stat-value,
.status-dot + div h2,
.hero-badge,
.agent-appointment-card .fw-bold,
.agent-document-card h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--font-section-title);
}

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--background);
}

.auth-wrapper {
  width: 100%;
  max-width: 420px;
  padding: 2rem;
}

.auth-card {
  background: var(--color-surface);
  border-radius: var(--corner-radius);
  padding: 2.5rem 2rem;
  box-shadow: var(--elevation-4);
  border: 2px solid rgba(148, 163, 184, 0.2);
  position: relative;
}

.auth-badge {
  width: 72px;
  height: 72px;
  border-radius: var(--corner-radius);
  background: var(--color-surface-alt);
  border: 2px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: var(--font-size-8);
  margin: 0 auto 1.5rem;
}

.auth-panel {
  display: none;
}

.auth-panel.active {
  display: block;
}

.auth-form .form-control {
  border-radius: var(--corner-radius-pill);
  padding: 0.9rem 1.1rem;
  border: 2px solid rgba(148, 163, 184, 0.3);
}

.auth-form .form-control:focus {
  border-color: rgba(31, 59, 143, 0.6);
  box-shadow: var(--elevation-1);
}

.auth-form .btn.btn-primary {
  background-color: var(--product-primary-default);
  border-color: var(--product-primary-default);
  color: var(--color-text-inverse);
}

.auth-form .btn.btn-primary:hover,
.auth-form .btn.btn-primary:focus,
.auth-form .btn.btn-primary:active {
  background-color: #1d3252;
  border-color: #1d3252;
  color: var(--color-text-inverse);
}

.btn.btn-primary:disabled,
.btn.btn-primary.disabled {
  background-color: var(--color-gray-300);
  border-color: var(--color-gray-300);
  color: var(--color-gray-700);
  opacity: 1;
}

.link-button {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  padding: 0;
  cursor: pointer;
}

.password-visibility {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--color-gray-400);
}

  /* =====================================================
     4. Header & Navbar Layout
     ===================================================== */
  .app-top-nav {
    height: var(--header-h);
    padding: 0 1.5rem;
    background: var(--primary);
    color: var(--text-light);
    border: none;
    box-shadow: var(--elevation-3);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    overflow: visible;
  }
  
  .app-top-nav .container-fluid {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    overflow: visible;
  }
  
  .app-brand img {
    height: 52px;
    width: auto;
  }
  
  .app-brand {
    text-decoration: none;
  }
  
  .brand-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--font-ui-heading);
  }

  .app-brand:focus,
  .app-brand:hover {
    text-decoration: none;
  }
  
  .brand-title {
    color: var(--text-light);
  }
  
  .icon-button {
    width: 44px;
    height: 44px;
    border-radius: var(--corner-radius);
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    overflow: visible;
  }

  .icon-button[data-sidebar-open] .menu-icon--close {
    display: none;
  }

  body.sidebar-open .icon-button[data-sidebar-open] .menu-icon--open {
    display: none;
  }

  body.sidebar-open .icon-button[data-sidebar-open] .menu-icon--close {
    display: inline-block;
  }
  
  .icon-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
  }

  .notification-panel {
    position: absolute;
    right: 0;
    top: calc(var(--header-h));
    width: 280px;
    background: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--corner-radius);
    padding: 0.75rem;
    z-index: 20;
    color: var(--text-dark);
  }

  .notification-panel-header {
    border-bottom: 1px solid var(--color-border-subtle);
    padding-bottom: 0.35rem;
    margin-bottom: 0.5rem;
  }

  .notification-panel li + li {
    border-top: 1px solid #f1f3f9;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
  }

  .profile-trigger {
    border-color: rgba(255, 255, 255, 0.35);
  }
  
  .chip-label {
    font-size: var(--font-size-1);
    letter-spacing: 0.08rem;
    color: rgba(255, 255, 255, 0.7);
  }

  @media (max-width: 768px) {
    .app-top-nav {
      height: 70px;
      padding: 0 1rem;
    }
  
    .app-top-nav .container-fluid {
      gap: 0.5rem;
    }
  
    .app-brand img {
      height: 42px;
    }
  
    .app-brand .brand-copy {
      display: none;
    }
  
    .top-nav-actions {
      gap: 0.5rem;
    }
  
    .icon-button {
      width: 40px;
      height: 40px;
    }
  
    /* Entfernt wegen keine Verwendnung gefunden: .profile-chip */
  }
  
  /* =====================================================
     5. Hauptbereich (Main)
     ===================================================== */
  main {
    min-height: calc(100vh - var(--header-h) - var(--footer-h));
    padding-top: var(--header-h);
    padding-bottom: var(--footer-h);
    box-sizing: border-box;
    overflow-y: auto;
  }

  main > section {
    margin-bottom: clamp(2rem, 4vw, 3.5rem);
  }

  main > section:last-of-type {
    margin-bottom: 0;
  }

  /* Agentur-Sidebar Layout */
  .agent-shell {
    display: flex;
    width: 100%;
    min-height: calc(100vh - var(--header-h));
  }

  .agent-shell .agent-content {
    width: 100%;
    transition: margin-left 0.25s ease;
    padding-top: calc(var(--header-h) + var(--space-2));
    padding-bottom: var(--space-5);
    max-width: var(--content-max-width);
    margin-inline: auto;
  }

  .agent-content.container.py-5.mt-5.mb-5 {
    padding-top: calc(var(--header-h) + var(--space-2)) !important;
    padding-bottom: var(--space-5) !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  .agent-content > section,
  .agent-content > form,
  .agent-content > .row {
    margin-bottom: var(--space-3);
  }

  .agent-content > :last-child {
    margin-bottom: 0;
  }

  .agent-sidebar-container {
    width: 0;
  }

  .agent-sidebar {
    position: fixed;
    top: var(--header-h);
    left: 0;
    height: calc(100vh - var(--header-h));
    width: var(--agent-sidebar-width);
    background: var(--color-surface);
    border-right: 1px solid var(--color-border-subtle);
    box-shadow: var(--elevation-1);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 1030;
    transition: width 0.25s ease, transform 0.25s ease;
  }

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

  .sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--corner-radius);
    color: var(--color-gray-600);
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--font-size-3);
    position: relative;
  }

  .sidebar-button {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
  }

  .sidebar-link span {
    transition: opacity 0.2s ease;
    font-family: inherit;
  }

.sidebar-link i {
  font-size: var(--font-size-4);
  color: var(--color-gray-500);
  position: relative;
  display: inline-block;
  }

.chat-badge-dot {
  position: absolute;
  display: none;
}

body.sidebar-collapsed .sidebar-link {
  overflow: visible;
}

.sidebar-link.chat-unread::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  border-radius: 3px;
  background: var(--primary);
  z-index: 3;
}

  .sidebar-link-meta {
    margin-top: auto;
  }

  .sidebar-link-group {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

.sidebar-link.active,
.sidebar-link:hover {
  background: rgba(var(--bs-primary-rgb), 0.06);
  color: var(--primary);
}

.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 50%;
  width: 2px;
  height: 18px;
  transform: translateY(-50%);
  background: var(--primary);
  border-radius: var(--radius-pill);
  opacity: 0.8;
}

.sidebar-link.active i,
.sidebar-link:hover i {
  color: var(--primary);
}

.global-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  width: 46px;
  height: 42px;
  border-radius: var(--corner-radius);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.55rem;
  transition: width 0.25s ease, background-color 0.2s ease, border-color 0.2s ease;
  overflow: hidden;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.global-search-wrapper.active {
  width: 320px;
  background: var(--color-surface);
  border-color: transparent;
}

.global-search-icon {
  color: var(--color-surface);
  font-size: var(--font-size-4);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
}

.global-search-wrapper.active .global-search-icon {
  color: var(--primary);
}

.global-search-input {
  width: 0;
  opacity: 0;
  pointer-events: none;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--font-size-3);
  transition: width 0.2s ease, opacity 0.2s ease;
  color: var(--color-gray-900);
}

.global-search-wrapper.active .global-search-input {
  width: 100%;
  opacity: 1;
  pointer-events: auto;
  background: transparent;
}

.global-search-input:focus {
  outline: none;
}

.global-search-input::placeholder {
  color: var(--color-gray-400);
}

.global-search-results {
  position: fixed;
  top: calc(var(--header-h) + 4px);
  right: 1.5rem;
  left: auto;
  min-width: 320px;
  width: min(520px, calc(100vw - 2rem));
  background: var(--color-surface);
  border-radius: var(--corner-radius);
  box-shadow: var(--elevation-3);
  z-index: 5000;
  border: 1px solid rgba(148, 163, 184, 0.25);
  overflow: hidden;
  backdrop-filter: blur(4px);
  pointer-events: auto;
  display: none;
  opacity: 0;
  visibility: hidden;
  color: var(--color-gray-900);
}

.global-search-results.hidden {
  display: none;
}

.global-search-results .global-search-loading,
.global-search-results .global-search-empty {
  padding: 0.65rem 0.9rem;
  font-size: var(--font-size-2);
  color: var(--color-gray-600);
}

.global-search-section {
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  background: var(--color-surface);
  color: var(--color-gray-900);
}

.global-search-section:last-child {
  border-bottom: none;
}

.global-search-section-label {
  font-size: var(--font-size-1);
  text-transform: uppercase;
  letter-spacing: 0.1rem;
  color: var(--color-gray-400);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.35rem;
}

.global-search-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.global-search-list li a {
  display: block;
  padding: 0.35rem 0.5rem;
  color: var(--color-gray-900);
  font-weight: 600;
  border-radius: 8px;
  background: var(--color-surface-alt);
  transition: background-color 0.15s ease, color 0.15s ease;
  box-shadow: none;
}

.global-search-list li a:hover {
  background: rgba(var(--bs-primary-rgb), 0.08);
  color: var(--primary);
}

.global-search-list li span {
  display: block;
  font-size: var(--font-size-2);
  color: var(--color-gray-600);
}

.global-search-actions {
  padding: 0.5rem 0.9rem 0.8rem;
  background: var(--color-surface);
}

.global-search-actions a {
  display: block;
  color: var(--primary);
  font-size: var(--font-size-2);
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  background: var(--color-surface-alt);
  margin-bottom: 0.25rem;
  transition: background-color 0.15s ease, color 0.15s ease;
  box-shadow: none;
}

.global-search-actions a:last-child {
  margin-bottom: 0;
}

.global-search-actions a:hover {
  background: rgba(var(--bs-primary-rgb), 0.08);
  color: var(--primary);
}
  .sidebar-toggle {
    align-self: flex-end;
    width: 48px;
    height: 48px;
    border-radius: var(--corner-radius);
    border: 1px solid rgba(31, 59, 143, 0.15);
    background: var(--color-surface-alt);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-5);
    transition: background-color 0.2s ease, border-color 0.2s ease;
  }

  .sidebar-toggle:hover {
    background: rgba(31, 59, 143, 0.15);
    border-color: rgba(31, 59, 143, 0.3);
  }

  .agent-sidebar-backdrop {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-h));
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1020;
  }

  body.sidebar-open .agent-sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  body.sidebar-open {
    overflow: hidden;
  }

  @media (min-width: 992px) {
    .agent-shell .agent-content {
      margin-left: var(--agent-sidebar-width);
    }

    body.sidebar-collapsed .agent-shell .agent-content {
      margin-left: var(--agent-sidebar-collapsed-width);
    }

    body.sidebar-collapsed .agent-sidebar {
      width: var(--agent-sidebar-collapsed-width);
      padding-inline: 0.5rem;
    }

    body.sidebar-collapsed .sidebar-link {
      justify-content: center;
      padding: 0.65rem 0.35rem;
      gap: 0;
    }

    body.sidebar-collapsed .sidebar-link span {
      opacity: 0;
      width: 0;
      overflow: hidden;
    }

    body.sidebar-collapsed .sidebar-toggle {
      align-self: center;
    }

    .agent-sidebar-backdrop {
      display: none;
    }
  }

  @media (max-width: 991px) {
    .agent-shell .agent-content {
      margin-left: 0;
    }

    .agent-sidebar {
      transform: translateX(-100%);
      width: min(var(--agent-sidebar-width), 80vw);
      box-shadow: var(--elevation-3);
    }

    body.sidebar-open .agent-sidebar {
      transform: translateX(0);
    }

    .sidebar-toggle {
      display: none;
    }
  }

  /* =====================================================
     Branding Einstellungen
     ===================================================== */
.branding-card {
  border: 1px solid rgba(31, 59, 143, 0.08);
  border-radius: 14px;
  padding: 1.75rem;
  background: var(--color-surface);
  box-shadow: var(--elevation-2);
}

.branding-tile {
  border: 1px solid rgba(17, 24, 39, 0.06);
  border-radius: 14px;
  background: linear-gradient(135deg, #f7f8fb 0%, #f9fbff 100%);
  padding: 18px;
}

.branding-logo-box {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: var(--color-surface);
  display: grid;
  place-items: center;
  padding: 1rem;
  box-shadow: var(--elevation-2);
}

.branding-logo-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.brand-color-swatch {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  background: linear-gradient(145deg, var(--swatch, #1f3b8f) 0%, color-mix(in srgb, var(--swatch, #1f3b8f) 85%, var(--color-surface) 15%));
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.18s ease, border-color 0.18s ease, filter 0.18s ease;
  box-shadow: var(--elevation-2);
  position: relative;
  display: grid;
  place-items: center;
}

.brand-color-swatch:hover {
  transform: translateY(-1px);
  box-shadow: var(--elevation-3);
  border-color: rgba(17, 24, 39, 0.14);
  filter: saturate(1.05);
}

.brand-color-swatch.active {
  border-color: rgba(var(--bs-primary-rgb), 0.6);
  box-shadow: var(--elevation-3);
  outline: 3px solid rgba(var(--bs-primary-rgb), 0.16);
  outline-offset: 4px;
  transform: translateY(0);
}

.brand-color-swatch.active::after {
  content: "✓";
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: rgba(17, 24, 39, 0.8);
  color: var(--color-surface);
  font-size: var(--font-size-1);
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: var(--elevation-1);
}

.brand-color-item {
  display: grid;
  grid-template-rows: auto auto;
  justify-items: center;
  gap: 6px;
  min-width: 88px;
  text-align: center;
}

.brand-color-item small {
  font-size: var(--font-size-1);
  color: var(--color-text-muted);
  line-height: 1.3;
  margin-top: 4px;
}

.brand-color-item--custom .brand-color-swatch {
  border-style: dashed;
  border-color: rgba(17, 24, 39, 0.18);
}

.brand-color-icon {
  color: rgba(255, 255, 255, 0.92);
  font-size: var(--font-size-5);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

#branding-colors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 16px;
  align-items: center;
  justify-items: center;
}

  /* =====================================================
     Schaden melden Modal
     ===================================================== */
  .damage-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
  }

  .damage-overlay.is-open {
    pointer-events: auto;
    opacity: 1;
  }

  .damage-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
  }

  .damage-modal {
    position: relative;
    z-index: 1;
    width: min(860px, 95vw);
    background: var(--color-surface);
    border-radius: var(--corner-radius);
    box-shadow: var(--elevation-4);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .damage-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }

  .damage-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-radius: var(--corner-radius);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.12);
    background: rgba(var(--bs-primary-rgb), 0.05);
    color: var(--color-gray-600);
    font-weight: 600;
  }

  .damage-step .dot {
    width: 28px;
    height: 28px;
    border-radius: var(--corner-radius-pill);
    display: grid;
    place-items: center;
    border: 2px solid rgba(var(--bs-primary-rgb), 0.4);
    color: var(--primary);
    font-weight: 700;
  }

  .damage-step.active {
    border-color: var(--primary);
    background: rgba(var(--bs-primary-rgb), 0.12);
    color: var(--primary);
  }

  .damage-step.active .dot {
    background: var(--primary);
    color: var(--color-surface);
    border-color: var(--primary);
  }

  .damage-actions {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .damage-actions .btn {
    min-width: 140px;
  }

  .damage-error {
    color: var(--color-danger);
    font-size: var(--font-meta);
    margin-top: 0.25rem;
  }

  @media (max-width: 576px) {
    .damage-modal {
      padding: 1rem;
    }

    .damage-actions {
      flex-direction: column;
      align-items: stretch;
    }

    .damage-steps {
      grid-template-columns: repeat(3, 1fr);
      gap: 0.5rem;
    }

    .damage-step {
      justify-content: center;
      padding: 0.5rem;
    }

    .damage-step span:not(.dot) {
      display: none;
    }
  }

  /* =====================================================
     Chat
     ===================================================== */
  .chat-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 16px;
  }

  .chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 420px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
  }

  .chat-bubble {
    max-width: 75%;
    padding: 0.9rem 1rem;
    border-radius: var(--corner-radius);
    box-shadow: var(--elevation-2);
    border: 1px solid rgba(var(--bs-primary-rgb), 0.12);
    background: var(--color-surface);
  }

  .chat-bubble.from-agent {
    align-self: flex-start;
    background: rgba(var(--bs-primary-rgb), 0.06);
  }

  .chat-bubble.from-client {
    align-self: flex-end;
    background: var(--color-surface);
  }

  .chat-meta {
    font-size: var(--font-meta);
    color: var(--color-gray-500);
    margin-bottom: 0.35rem;
  }

  .chat-input .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
  }

  .chat-empty {
    color: var(--color-gray-400);
    font-style: italic;
  }

  /* =====================================================
     Termine – Kalender & Slots
     ===================================================== */
  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.6rem;
  }

  .calendar-day {
    border: 1px solid rgba(var(--bs-primary-rgb), 0.12);
    background: var(--color-surface);
    border-radius: var(--corner-radius);
    padding: 0.75rem;
    text-align: left;
    cursor: pointer;
    transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  }

  .calendar-day:hover {
    box-shadow: var(--elevation-2);
    transform: translateY(-2px);
  }

  .calendar-day .weekday {
    display: block;
    font-size: var(--font-meta);
    color: var(--color-gray-500);
  }

  .calendar-day strong {
    display: block;
    font-size: var(--font-ui-heading);
    color: var(--text-dark);
  }

  .calendar-day.selected {
    border-color: var(--primary);
    box-shadow: var(--elevation-2);
    background: rgba(var(--bs-primary-rgb), 0.08);
  }

  .slot-btn.selected {
    background: var(--primary) !important;
    color: var(--color-surface) !important;
    border-color: var(--primary) !important;
  }

  /* =====================================================
     6. Footer / Bottom Navigation
     ===================================================== */
  
  /* Fußleiste */
  nav.navbar.fixed-bottom {
    height: var(--footer-h);
    padding-block: calc(var(--footer-h) * 0.10);
  }
  
  /* Inhalte der Fußleiste (zentriert & verteilt) */
  nav.navbar.fixed-bottom .container-fluid {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-around;
  }

  .app-bottom-nav {
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(31, 59, 143, 0.08);
    box-shadow: var(--elevation-2);
    backdrop-filter: blur(6px);
  }
  
  .app-bottom-nav .container-fluid {
    gap: 0.25rem;
  }
  
  .bottom-nav-link {
    flex: 1;
    text-align: center;
    color: var(--color-gray-400);
    text-decoration: none;
    font-size: var(--font-ui-heading);
    font-weight: 600;
    font-family: var(--font-heading);
    padding: 0.4rem 0.1rem;
    border-radius: var(--corner-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    transition: color 0.2s ease, background-color 0.2s ease;
  }
  
  .bottom-nav-link i {
    font-size: var(--font-size-5);
  }
  
  .bottom-nav-link.active,
  .bottom-nav-link:hover {
    color: var(--primary);
    background-color: rgba(var(--bs-primary-rgb), 0.08);
  }

  @media (max-width: 576px) {
    .app-bottom-nav .container-fluid {
      gap: 0;
    }

    .bottom-nav-link {
      font-size: var(--font-size-1);
      padding: 0.3rem 0.05rem;
      gap: 0.1rem;
    }

    .bottom-nav-link i {
      font-size: var(--font-size-4);
    }
  }

  /* =====================================================
     7. Startseite – Karten & Tiles
     ===================================================== */
/* Entfernt wegen keine Verwendnung gefunden: .session-card, .session-icon, .session-logout-btn */

.profile-card img {
  width: 120px;
  height: 120px;
  object-fit: cover;
}
  
  /* Entfernt wegen keine Verwendnung gefunden: .insurance-tile, .insurance-icon */
  
  .next-appointment {
    border: 2px solid var(--color-gray-300);
    background-color: var(--color-surface);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    height: 100%;
  }

  /* Entfernt wegen keine Verwendnung gefunden: .insurance-carousel, .insurance-track, .insurance-details */

  .advisor-photo {
    object-fit: cover;
    object-position: center 10%;
  }

  .appointment-card {
    border-radius: var(--corner-radius);
    box-shadow: var(--elevation-2);
  }

  .appointment-overview-card {
    border: 1px solid var(--color-border-subtle);
    background: var(--color-surface);
    border-radius: var(--corner-radius);
  }

  .appointment-history-card {
    border-radius: var(--corner-radius);
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border-subtle);
    opacity: 0.9;
  }

  .appointment-staff-card {
    border-radius: var(--corner-radius);
    border: 1px solid var(--color-border-subtle);
    background: var(--color-surface);
  }

  .appointment-detail-card {
    border-radius: var(--corner-radius);
    border: 1px solid var(--color-border-subtle);
    background: var(--color-surface);
  }

  .appointment-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--corner-radius-pill);
    background: rgba(31, 59, 143, 0.08);
    color: var(--primary);
    font-size: var(--font-size-1);
    font-weight: 600;
    letter-spacing: 0.04rem;
    text-transform: uppercase;
  }

  .appointment-pill-outline {
    background: transparent;
    border: 1px solid rgba(31, 59, 143, 0.2);
  }

  .appointment-pill-muted {
    background: rgba(148, 163, 184, 0.18);
    color: var(--color-text-muted);
  }

  .appointment-header {
    border-bottom: 1px solid var(--color-border-subtle);
    padding-bottom: 0.75rem;
  }

  .appointment-topic {
    font-size: var(--font-size-2);
    letter-spacing: 0.05rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--primary);
  }

  .appointment-body {
    color: var(--color-gray-600);
  }

  .appointment-body p {
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: var(--font-size-3);
  }

  .appointment-body i {
    color: var(--primary);
  }

  .appointment-footer {
    border-top: 1px solid var(--color-border-subtle);
    padding-top: 0.75rem;
  }

  .appointment-avatar {
    width: 52px;
    height: 52px;
  }

  .appointment-logo-fallback {
    width: 52px;
    height: 52px;
    border-radius: var(--corner-radius-pill);
    background: rgba(31, 59, 143, 0.08);
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.04rem;
  }

  /* Entfernt wegen keine Verwendnung gefunden: .agency-logo-fallback */

  .appointment-link {
    font-size: var(--font-size-2);
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
  }

  .appointment-link i {
    font-size: var(--font-size-3);
  }

  .appointment-link:hover {
    text-decoration: underline;
  }

  .hero-badges {
    gap: 0.75rem;
  }

  .hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    border-radius: var(--corner-radius-pill);
    border: 1px solid rgba(31, 59, 143, 0.15);
    background: rgba(31, 59, 143, 0.07);
    color: var(--primary);
    font-weight: 600;
    font-size: var(--font-size-2);
  }

  /* Entfernt wegen keine Verwendnung gefunden: .hero-avatar */

  .hero-badge {
    background-color: rgba(31, 59, 143, 0.08);
    border: 1px solid rgba(31, 59, 143, 0.12);
    color: var(--primary);
    letter-spacing: 0.12rem;
    font-size: var(--font-size-1);
  }

  .hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    align-items: stretch;
  }

  .hero-stat-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    align-self: stretch;
    text-decoration: none;
    color: inherit;
  }

  .hero-stat {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--corner-radius);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1;
  }

  /* Erzwinge gleiche Höhe innerhalb der Hero-Kachel */
  .hero-card .hero-stats > * {
    height: 100%;
  }

  .hero-card .hero-stats .hero-stat-link {
    height: 100%;
  }

  .hero-card .hero-stats .hero-stat {
    height: 100%;
  }

  .hero-stat-link:hover .hero-stat {
    border-color: rgba(31, 59, 143, 0.35);
    box-shadow: var(--elevation-2);
  }

  .hero-stat .stat-label {
    text-transform: uppercase;
    font-size: var(--font-size-1);
    letter-spacing: 0.08rem;
    margin-bottom: 0.25rem;
    color: var(--color-gray-500);
  }

  .hero-stat .stat-value {
    font-size: var(--font-size-6);
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--primary);
  }

  .latest-doc-title {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* Entfernt wegen keine Verwendnung gefunden: .stat-value-link */

  /* Entfernt wegen keine Verwendnung gefunden: .tasks-card .task-item, .task-icon, .task-category, .task-status */

  .insurance-card {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--corner-radius);
    padding: 1.5rem;
    background: var(--color-surface);
    box-shadow: var(--elevation-2);
  }

  .insurance-card-horizontal {
    width: 320px;
  }

  .insurance-card-header .insurer-name {
    font-size: var(--font-size-2);
    text-transform: uppercase;
    letter-spacing: 0.08rem;
    color: var(--color-gray-500);
  }

  .insurance-title {
    color: var(--primary);
  }

  .insurance-badge {
    font-size: var(--font-size-1);
    font-weight: 600;
    padding: 0.25rem 0.8rem;
    border-radius: var(--corner-radius-pill);
  }

  .insurance-badge.active {
    background: rgba(21, 128, 61, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(21, 128, 61, 0.2);
  }

  .insurance-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
  }

  .insurance-card-meta li {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.35rem 0;
    font-size: var(--font-size-3);
  }

  .insurance-card-meta li span {
    color: var(--color-text-muted);
  }

  .insurance-card-footer {
    border-top: 1px solid var(--color-border-subtle);
    padding-top: 0.75rem;
  }

  .policy-section {
    width: 100%;
  }

  .policy-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
  }

  @media (min-width: 768px) {
    .policy-grid {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  @media (min-width: 1200px) {
    .policy-grid {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  .policy-preview-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--corner-radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    height: 100%;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
  }

  .policy-preview-card:hover {
    border-color: rgba(31, 59, 143, 0.35);
    box-shadow: var(--elevation-2);
  }

  .policy-preview-body {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .policy-badge {
    width: 38px;
    height: 38px;
    border-radius: var(--corner-radius);
    background: rgba(31, 59, 143, 0.08);
    color: var(--primary);
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-2);
    letter-spacing: 0.04rem;
  }

  .policy-insurer {
    text-transform: uppercase;
    font-size: var(--font-size-1);
    letter-spacing: 0.08rem;
    color: var(--color-gray-500);
    margin: 0;
  }

  .policy-title {
    font-size: var(--font-size-4);
    font-weight: 600;
    color: var(--color-text-main);
  }

  .policy-status-pill {
    font-size: var(--font-size-1);
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: var(--corner-radius-pill);
    background: rgba(18, 183, 106, 0.12);
    color: var(--color-success);
    text-transform: uppercase;
    letter-spacing: 0.04rem;
  }

  .policy-status-pill.is-inactive {
    background: rgba(208, 213, 221, 0.5);
    color: var(--color-gray-500);
  }

  .policy-contract-value {
    font-weight: 600;
    max-width: 150px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .policy-copy-btn {
    color: var(--color-gray-400);
  }

  .policy-copy-btn:hover {
    color: var(--primary);
  }

  .policy-premium-value {
    font-size: var(--font-size-4);
    font-weight: 700;
    color: var(--color-text-main);
  }

  .policy-details-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    padding: 0;
  }

  .policy-details-link:hover {
    text-decoration: underline;
  }

  .policy-empty-card {
    border: 1px dashed var(--color-gray-300);
    background: var(--color-surface-alt);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .policy-empty-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--corner-radius);
    background: rgba(31, 59, 143, 0.08);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-6);
  }

  .policy-preview-card-skeleton {
    position: relative;
    overflow: hidden;
    background: var(--color-gray-100);
    border-color: var(--color-gray-200);
  }

  .policy-preview-card-skeleton .skeleton-line {
    height: 10px;
    border-radius: var(--corner-radius-pill);
    background: linear-gradient(90deg, rgba(234, 236, 240, 0.6), rgba(208, 213, 221, 0.8), rgba(234, 236, 240, 0.6));
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease infinite;
  }

  .policy-preview-card-skeleton .skeleton-line + .skeleton-line {
    margin-top: 0.75rem;
  }

  @keyframes skeleton-shimmer {
    0% {
      background-position: 200% 0;
    }
    100% {
      background-position: -200% 0;
    }
  }

  .document-card ul {
    margin: 0;
    padding: 0;
  }
  
  .document-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border-subtle);
  }
  
  .document-entry:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  
  .document-entry:first-child {
    padding-top: 0;
  }
  
  .document-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--corner-radius);
    border: 2px solid var(--color-gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-5);
    color: var(--primary);
  }
  
  .document-meta {
    white-space: nowrap;
    font-size: var(--font-size-3);
  }

  .category-section .btn-outline-primary {
    border-color: rgba(31, 59, 143, 0.3);
    color: var(--primary);
    font-weight: 600;
  }

  .category-section .btn-outline-primary:hover {
    background-color: rgba(31, 59, 143, 0.08);
    border-color: rgba(31, 59, 143, 0.45);
  }

/* Entfernt wegen keine Verwendnung gefunden: .categories-grid, .category-card, .category-icon, .category-body, .category-meta, .category-count, .category-link */

  .upload-card {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--corner-radius);
    background: var(--color-surface);
    box-shadow: var(--elevation-4);
  }

  /* Entfernt wegen keine Verwendnung gefunden: .upload-option */

  .upload-form .form-label {
    font-weight: 600;
    color: var(--color-text-main);
  }

  .upload-form .form-control,
  .upload-form .form-select {
    border-radius: var(--corner-radius);
    border: 1px solid var(--color-border-subtle);
    padding: 0.85rem 1rem;
    box-shadow: none;
  }

  .upload-form .form-control:focus,
  .upload-form .form-select:focus {
    border-color: rgba(31, 59, 143, 0.6);
    box-shadow: var(--elevation-1);
  }

  .upload-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  @media (min-width: 768px) {
    .upload-actions {
      flex-direction: row;
      justify-content: flex-end;
      align-items: center;
    }
  }

  .policy-switcher {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
  }

  .policy-tabs {
    display: inline-flex;
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--corner-radius-pill);
    padding: 0.3rem;
    background: var(--color-surface-alt);
    gap: 0.4rem;
  }

  .policy-tab {
    border: none;
    border-radius: var(--corner-radius-pill);
    background: transparent;
    padding: 0.65rem 1.5rem;
    font-weight: 600;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  }

  .policy-tab.active {
    background: var(--color-surface);
    color: var(--primary);
    box-shadow: var(--elevation-2);
  }

  .policy-panel {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    padding: var(--space-4);
    box-shadow: var(--elevation-2);
    display: none;
    opacity: 0;
    transform: translateY(12px);
  }

  .policy-panel.active {
    display: block;
    animation: policyPanelIn 0.35s ease forwards;
  }

  @keyframes policyPanelIn {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .policy-panel-header {
    border-bottom: 1px solid var(--color-border-subtle);
    padding-bottom: var(--space-2);
    margin-bottom: var(--space-3);
  }

  .policy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
  }

  .policy-card {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--corner-radius);
    overflow: hidden;
    background: var(--color-surface);
    box-shadow: var(--elevation-2);
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  /* Entfernt wegen keine Verwendnung gefunden: .policy-card-link */

  /* Entfernt wegen keine Verwendnung gefunden: .profile-avatar-lg, .profile-settings-grid */

  .profile-settings-card {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--corner-radius);
    background: var(--color-surface);
    padding: 1.75rem;
    box-shadow: var(--elevation-2);
  }

  /* Entfernt wegen keine Verwendnung gefunden: .profile-avatar-xl, .profile-sections */

  .profile-settings-card .form-control {
    border-radius: var(--corner-radius);
    border: 1px solid var(--color-border-subtle);
  }

  .profile-meta {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .profile-meta dt {
    font-size: var(--font-size-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
  }

  .profile-meta dd {
    margin: 0;
    font-weight: 600;
  }

  .customer-profile-page .profile-hero-saas {
    border: 1px solid rgba(31, 59, 143, 0.1);
    background: var(--color-surface);
    box-shadow: var(--elevation-2);
  }

  .customer-profile-page {
    padding-top: var(--space-2);
  }

  .customer-profile-page .profile-settings-card {
    padding: var(--space-3);
    border-color: rgba(31, 59, 143, 0.1);
    box-shadow: var(--elevation-2);
  }

  .customer-profile-page .profile-meta {
    gap: var(--space-2);
  }

  .customer-profile-page .profile-meta dt {
    font-size: var(--font-size-1);
    letter-spacing: var(--letter-spacing-wide);
    margin-bottom: 0.25rem;
  }

  .customer-profile-page .profile-meta dd {
    font-size: var(--font-size-4);
    color: var(--color-gray-800);
  }

  .customer-profile-page .profile-actions-stack .profile-settings-card:last-child {
    margin-bottom: 0;
  }

  @media (max-width: 767px) {
    .customer-profile-page .profile-settings-card {
      padding: 1.1rem 1.05rem;
    }
  }

  /* Entfernt wegen keine Verwendnung gefunden: .agent-card-photo */

  .agent-hero {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    background: var(--color-surface);
    box-shadow: var(--elevation-3);
    margin-bottom: var(--space-3);
  }

  .agent-hero h1 {
    margin-bottom: var(--space-1);
  }

  .agent-hero p {
    margin-bottom: 0;
  }

  .agent-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
  }

  .agent-kpi-card {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--corner-radius);
    background: var(--color-surface);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    box-shadow: var(--elevation-2);
  }

  .agent-widget {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    background: var(--color-surface);
    box-shadow: var(--elevation-2);
  }

  .agent-widget .agent-widget,
  .agent-widget .profile-settings-card,
  .agent-widget .card {
    box-shadow: none;
    border-color: var(--color-gray-200);
  }

  .settings-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
  }

  .settings-tile {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--corner-radius);
    padding: 1.5rem;
    background: var(--color-surface);
    box-shadow: var(--elevation-2);
  }

  .settings-tile--link {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    position: relative;
  }

  .settings-tile--link:hover {
    border-color: rgba(31, 59, 143, 0.35);
    box-shadow: var(--elevation-3);
  }

  /* Entfernt wegen keine Verwendnung gefunden: .settings-tile--full */

  .settings-tile-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--corner-radius);
    background: rgba(31, 59, 143, 0.08);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-6);
  }

  .settings-tile-arrow {
    margin-left: auto;
    color: var(--color-text-muted);
    font-size: var(--font-size-5);
  }

  .settings-btn {
    border-radius: var(--corner-radius);
  }

  .employee-create-form .form-control,
  .employee-create-form .form-select,
  .employee-edit-form .form-control,
  .employee-edit-form .form-select {
    border-radius: var(--corner-radius);
    border: 1px solid var(--color-border-subtle);
  }

  /* Entfernt wegen keine Verwendnung gefunden: .employee-list, .employee-card, .employee-card-header, .employee-name, .employee-status, .employee-action-row */

  .employee-table th,
  .employee-table td {
    padding: 0.85rem 0.75rem;
  }

  .employee-edit-row td {
    background: var(--color-surface-alt);
    border-top: 0;
  }

  .employee-actions .btn {
    border-radius: var(--corner-radius-pill);
  }

  .employee-search-group .btn {
    border-radius: var(--corner-radius-pill);
  }

  .employee-search-group .form-control {
    border-radius: var(--corner-radius-pill);
  }

  .employee-create-form [data-create-employee-btn] {
    min-height: 2.75rem;
    font-weight: 600;
  }

  .info-icon {
    color: var(--color-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
  }

  .info-icon:hover {
    color: var(--primary);
  }

  .employee-edit-toggle i {
    margin-left: 0.35rem;
  }

  .sidebar-link-logout,
  .sidebar-link-logout i {
    color: var(--color-danger);
  }

  .sidebar-link-logout:hover,
  .sidebar-link-logout:focus {
    color: var(--color-danger);
  }

  .staff-nav .bottom-nav-link[data-logout-trigger],
  .staff-nav .bottom-nav-link[data-logout-trigger] i {
    color: var(--color-danger);
  }

  .status-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--corner-radius-pill);
    display: inline-block;
  }

  .agent-appointment-card {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--corner-radius);
    padding: 1rem 1.25rem;
    background: var(--color-surface-alt);
  }

  .agent-appointment-card.muted {
    background: var(--color-surface);
  }

  .agent-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--corner-radius-pill);
    object-fit: cover;
  }

  .agent-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: var(--corner-radius);
    background: rgba(31, 59, 143, 0.08);
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.04rem;
  }

  /* Entfernt wegen keine Verwendnung gefunden: .agent-documents-grid, .agent-document-card */

  .agent-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .agent-activity-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    border-bottom: 1px solid var(--color-border-subtle);
    padding-bottom: 0.75rem;
  }

  .agent-activity-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  /* Entfernt wegen keine Verwendnung gefunden: .agent-quick-actions .btn */

  .customers-search input {
    background: transparent;
    box-shadow: none;
  }

  .customer-table th {
    font-size: var(--font-size-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-gray-500);
  }

  .customer-avatar-lg {
    width: 140px;
    height: 140px;
    border-radius: var(--corner-radius-pill);
    object-fit: cover;
    border: 5px solid var(--color-surface);
    box-shadow: var(--elevation-2);
  }

  .customer-action-card {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--corner-radius);
    padding: 1.5rem;
    background: var(--color-surface);
    box-shadow: var(--elevation-2);
    text-align: center;
  }

  .customer-action-card i {
    font-size: var(--font-size-8);
    color: var(--primary);
    margin-bottom: 1rem;
  }

  .kpi-card {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--corner-radius);
    padding: 1.5rem;
    background: var(--color-surface);
    box-shadow: var(--elevation-2);
  }

  .kpi-title {
    margin-bottom: 0.5rem;
    color: var(--primary);
  }

  .kpi-description {
    color: var(--color-gray-500);
    margin-bottom: 0.75rem;
  }

  .kpi-value {
    font-size: var(--font-size-6);
    font-weight: 700;
    margin-bottom: 1rem;
  }

  .kpi-list {
    margin: 0 0 1rem 0;
    padding: 0;
    list-style: none;
    color: var(--color-gray-600);
  }

  .kpi-list li {
    margin-bottom: 0.2rem;
  }

  .kpi-bar {
    width: 100%;
    height: 16px;
    border-radius: var(--corner-radius-pill);
    background: var(--color-surface-alt);
  }

  .kpi-bar-fill {
    height: 100%;
    border-radius: var(--corner-radius-pill);
    background: var(--primary);
  }

  /* Entfernt wegen keine Verwendnung gefunden: .kpi-stack, .kpi-stack-segment, .kpi-legend, .legend-dot */

  .kpi-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    height: 150px;
    margin-top: 0.5rem;
  }

  .kpi-bar-column {
    flex: 1;
    background: rgba(37, 99, 235, 0.1);
    border-radius: var(--corner-radius);
    position: relative;
  }

  .kpi-bar-column::after {
    content: "";
    position: absolute;
    inset: auto 0 0 0;
    background: var(--primary);
    border-radius: inherit;
    height: 100%;
  }

  .kpi-bar-column span {
    position: absolute;
    bottom: -1.5rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--font-size-2);
    color: var(--color-gray-400);
  }

  .kpi-bar-column::before {
    content: attr(data-value);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translate(-50%, 0);
    background: rgba(15, 23, 42, 0.85);
    color: var(--color-surface);
    padding: 0.2rem 0.5rem;
    border-radius: var(--corner-radius-pill);
    font-size: var(--font-size-1);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .kpi-bar-column:hover::before {
    opacity: 1;
    transform: translate(-50%, -0.25rem);
  }

  /* Entfernt wegen keine Verwendnung gefunden: .staff-chip */

  /* Entfernt wegen keine Verwendnung gefunden: .policy-card-cover */

  .policy-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .policy-card-date {
    font-size: var(--font-size-2);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    margin-bottom: 0;
  }

  .policy-card h3 {
    margin-bottom: 0;
    color: var(--primary);
  }

  .policy-card p {
    margin-bottom: 0;
    color: var(--color-gray-600);
  }

  .policy-card-meta {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--color-border-subtle);
    margin-top: auto;
    padding-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
  }

  .policy-card-meta li {
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-3);
  }

  .policy-card-meta span {
    color: var(--color-text-muted);
  }

  .policy-card.inactive {
    border-style: dashed;
    opacity: 0.85;
  }

  .policy-detail-hero {
    position: relative;
    height: 320px;
    overflow: hidden;
  }

  .policy-detail-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.92);
  }

  .policy-detail-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.5rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.55));
    color: var(--color-surface);
  }

  .policy-detail-headline h1 {
    color: var(--color-surface);
    font-size: var(--font-size-8);
  }

  .policy-detail-headline p {
    color: rgba(255, 255, 255, 0.85);
  }

  .policy-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
  }

  .policy-info-card {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--corner-radius);
    background: var(--color-surface);
    padding: 1.75rem;
    box-shadow: var(--elevation-2);
  }

  .policy-info-card h2 {
    margin-bottom: 1.25rem;
    font-size: var(--font-size-5);
    color: var(--primary);
  }

  .policy-info-card dl {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
  }

  .policy-info-card dl div {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
  }

  .policy-info-card dt {
    font-size: var(--font-size-2);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
  }

  .policy-info-card dd {
    margin: 0;
    font-weight: 600;
    color: var(--color-text-main);
  }

  .policy-feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }

  .policy-feature-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-main);
  }

  .policy-detail-actions a {
    flex: 1;
    text-align: center;
  }

  .category-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
  }

  .category-back-link:hover {
    color: var(--color-text-main);
  }

  .document-gallery-card {
    border: 1px solid var(--color-border-subtle);
    border-radius: var(--corner-radius);
    background: var(--color-surface);
    box-shadow: var(--elevation-2);
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
  }

  .document-gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--elevation-3);
  }

  .document-preview {
    width: 100%;
    min-height: 220px;
    border-radius: var(--corner-radius);
    border: 1px solid var(--color-border-subtle);
    background: linear-gradient(180deg, var(--color-surface) 0%, #f5f7ff 100%);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: none;
  }

  .document-preview-header {
    height: 14px;
    border-radius: var(--corner-radius-pill);
    background: rgba(31, 59, 143, 0.15);
    margin-bottom: 0.75rem;
  }

  .document-preview-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
  }

  .document-preview-body span {
    display: block;
    height: 6px;
    border-radius: var(--corner-radius-pill);
    background: rgba(31, 59, 143, 0.12);
  }

  .document-preview-body span:nth-child(1) {
    width: 85%;
  }

  .document-preview-body span:nth-child(2) {
    width: 70%;
  }

  .document-preview-body span:nth-child(3) {
    width: 90%;
  }

  .document-preview-body span:nth-child(4) {
    width: 60%;
  }

  .document-preview-footer {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
  }

  .document-round-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--corner-radius-pill);
    border: 1px solid rgba(31, 59, 143, 0.2);
    background: var(--color-surface);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-4);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
  }

  .document-round-btn:hover {
    background: var(--primary);
    color: var(--color-surface);
  }

  .document-title {
    font-size: var(--font-size-4);
    font-weight: 600;
    color: var(--primary);
  }

  .document-viewer-hero {
    background: linear-gradient(135deg, #1f3b8f, #3f6ce1);
    border-radius: var(--corner-radius);
    padding: 2rem 2.5rem;
    color: var(--color-surface);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }

  .document-viewer-hero h1 {
    margin: 0;
    font-size: var(--font-size-8);
  }

  .document-viewer {
    border-radius: var(--corner-radius);
    background: var(--color-surface);
    box-shadow: var(--elevation-4);
    padding: 2rem;
  }

  /* Entfernt wegen keine Verwendnung gefunden: .document-page, .document-letter-header, .document-letter-logo, .document-letter-address, .document-letter-body */

  .pdf-viewer-wrapper {
    border-radius: var(--corner-radius);
    border: 1px solid var(--color-border-subtle);
    background: linear-gradient(135deg, var(--color-surface-alt), #f2f0ff);
    padding: 1rem;
  }

  .pdf-viewer {
    width: 100%;
    height: 80vh;
    border: none;
    border-radius: var(--corner-radius);
    background: var(--color-surface);
    box-shadow: none;
  }

  .document-actions {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
  }

/* =====================================================
   SYSTEM GUARD LAYER (global consistency across webapp)
   ===================================================== */

main.agent-content.container.py-5.mt-5.mb-5 {
  padding-top: calc(var(--header-h) + var(--space-2)) !important;
  padding-bottom: var(--space-5) !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.agent-content > section,
.agent-content > form,
.agent-content > .row,
.agent-content > .container,
.agent-content > .policy-section {
  margin-bottom: var(--space-3) !important;
}

.agent-content > :last-child {
  margin-bottom: 0 !important;
}

.agent-content h1,
.agent-content .h1 {
  font-size: var(--font-size-8);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
}

.agent-content h2,
.agent-content .h2 {
  font-size: var(--font-size-6);
  line-height: var(--line-height-tight);
}

.agent-content h3,
.agent-content .h3,
.agent-content h4,
.agent-content .h4 {
  font-size: var(--font-size-5);
  line-height: var(--line-height-normal);
}

.agent-content .small,
.agent-content small,
.agent-content .text-muted.small {
  font-size: var(--font-size-1);
}

.agent-widget,
.profile-card,
.hero-card,
.policy-panel,
.policy-card,
.policy-preview-card,
.profile-settings-card,
.insurance-card,
.document-card,
.document-gallery-card,
.upload-card,
.category-card,
.appointment-card,
.agent-appointment-card,
.agent-document-card,
.customer-action-card,
.kpi-card,
.policy-info-card,
.settings-tile,
.chat-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  box-shadow: var(--elevation-2);
}

.agent-widget,
.profile-settings-card,
.insurance-card,
.policy-panel,
.kpi-card,
.settings-tile,
.customer-action-card {
  padding: var(--space-3);
}

.agent-widget .card,
.profile-settings-card .card,
.policy-panel .card {
  box-shadow: none;
  border-color: var(--color-gray-200);
}

.table > :not(caption) > * > * {
  padding-block: 0.8rem;
  border-bottom-color: var(--color-border-subtle);
}

.table thead th {
  color: var(--color-gray-500);
  font-size: var(--font-size-1);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
}

.form-control,
.form-select {
  min-height: 2.75rem;
  border-color: var(--color-border-subtle);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
  box-shadow: var(--elevation-1) !important;
  border-color: rgba(var(--bs-primary-rgb), 0.45);
}

.btn,
.policy-tab,
.sidebar-link,
.hero-stat-link,
.policy-details-link,
.note-trigger,
.link-button,
.bottom-nav-link {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn:focus-visible,
.policy-tab:focus-visible,
.sidebar-link:focus-visible,
.hero-stat-link:focus-visible,
.policy-details-link:focus-visible,
.note-trigger:focus-visible,
.link-button:focus-visible,
.bottom-nav-link:focus-visible {
  outline: none;
  box-shadow: var(--elevation-1);
}

.agency-overview-card {
  background: linear-gradient(180deg, var(--color-surface) 0%, var(--color-surface-alt) 100%);
}

.agency-cta-group .btn {
  min-width: 190px;
}

.agency-contact-card,
.agency-map-card {
  border: 1px solid var(--color-border-subtle);
}

.agency-contact-meta li {
  padding-block: var(--space-1);
}

.agency-contact-meta a {
  color: var(--color-text-main);
  text-decoration: none;
}

.agency-contact-meta a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.agency-service-actions .btn {
  justify-content: center;
}

/* Agency-wide visual harmonization */
.agent-kpi-grid {
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.agent-kpi-card h2,
.agent-kpi-card h3 {
  font-size: var(--font-size-6);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-1);
}

.customer-table td,
.customer-table th {
  vertical-align: middle;
}

.settings-tile-grid {
  gap: var(--space-3);
}

.settings-tile {
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
}

.settings-tile-icon {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-subtle);
}

.agent-widget .form-label {
  font-size: var(--font-size-2);
  letter-spacing: var(--letter-spacing-wide);
  text-transform: uppercase;
  color: var(--color-gray-500);
}

.agent-widget .form-control,
.agent-widget .form-select {
  min-height: 2.7rem;
}

/* Claims: status controls */
.claim-status-block {
  min-width: 320px;
}

.claim-status-label {
  display: block;
  color: var(--color-gray-500);
}

.claim-status-form {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.claim-status-select-control {
  --claim-select-arrow-space: 1.2rem;
  flex: 0 1 auto;
  inline-size: 16ch;
  min-inline-size: 16ch;
  max-inline-size: 20ch;
  padding-inline: var(--space-2);
  padding-inline-end: calc(var(--space-3) + var(--claim-select-arrow-space));
  border-radius: var(--radius-md);
  background-position: right var(--space-2) center;
  background-size: 0.9rem 0.7rem;
}

.claim-status-submit {
  min-width: 132px;
}

@media (max-width: 767.98px) {
  .claim-status-block {
    width: 100%;
    min-width: 0;
    text-align: left !important;
  }

  .claim-status-form {
    justify-content: flex-start;
  }

  .claim-status-select-control {
    min-width: 0;
    width: 100%;
  }
}
