/* =========================================
   ROOT VARS
========================================= */
:root {
    --primary: #2c5364;
    --secondary: #203a43;
    --dark: #0f2027;

    --bg: #f4f6f9;
    --white: #ffffff;

    --text: #111827;
    --muted: #6b7280;

    --success: #0b3568;
    --danger: #ef4444;
    --warning: #f59e0b;
}

/* =========================================
   RESET
========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

/* =========================================
   BODY / BACKGROUND
========================================= */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    line-height: 1.5;

    /* Standard Hintergrund */
    background:
        linear-gradient(rgba(255,255,255,0.55), rgba(255,255,255,0.55)),
        url("/static/assets/hintergrund/back-bg.jpg")
        center center / cover no-repeat fixed;
}

/* CRM / Dashboard Background (Login Style) */
.crm-bg {
    background: url("/static/images/makler_hintergrund.png") no-repeat center center fixed;
    background-size: cover;
}

/* =========================================
   NAVBAR
========================================= */
.navbar-custom {
    background: linear-gradient(90deg, var(--dark), var(--secondary), var(--primary));
    padding: 14px 24px;
}

.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
    letter-spacing: 0.4px;
}

.nav-link {
    color: var(--white) !important;
    margin-left: 16px;
    position: relative;
    transition: 0.2s ease;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0%;
    height: 2px;
    background: var(--white);
    transition: 0.3s;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* =========================================
   LAYOUT
========================================= */
.container {
    max-width: 1200px;
}

.crm-container {
    padding: 30px;
}

/* =========================================
   HEADER
========================================= */
.crm-header {
    margin-bottom: 25px;
}

.crm-header h2 {
    font-weight: 600;
}

/* =========================================
   GLASS CARDS (GLOBAL STYLE)
========================================= */
.glass {
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

/* bestehende Komponenten */
.card-box {
    composes: glass;
    padding: 28px;
    margin-top: 25px;
}

.dashboard-hero {
    margin-top: 30px;
    padding: 30px;
    border-radius: 20px;
    background: rgba(255,255,255,0.55);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.dashboard-card {
    padding: 25px;
    border-radius: 18px;
    background: rgba(255,255,255,0.45);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.dashboard-card.full-width {
    grid-column: 1 / -1;
}

/* =========================================
   CRM TOOLBAR (NEU)
========================================= */
.crm-toolbar {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    align-items: center;
    flex-wrap: wrap;
}

.crm-search {
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(6px);
    width: 300px;
}

/* Filter Buttons */
.crm-filter button {
    padding: 8px 14px;
    border-radius: 10px;
    border: none;
    background: rgba(255,255,255,0.6);
    cursor: pointer;
}

.crm-filter .active {
    background: var(--success);
    color: white;
}

/* =========================================
   BUTTONS
========================================= */
.btn-primary {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 30px;
    text-decoration: none;
    background: rgba(34,197,94,0.2);
    color: #166534;
    font-weight: 500;
    border: none;
}

.btn-primary:hover {
    background: rgba(34,197,94,0.3);
}

.btn-small {
    background: #1976d2;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
}

/* =========================================
   TABLE (CRM STYLE)
========================================= */
.crm-table {
    margin-top: 20px;
    border-radius: 16px;
    overflow: hidden;
}

.crm-table table {
    width: 100%;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(10px);
}

.crm-table th {
    background: rgba(0,0,0,0.05);
    padding: 12px;
    text-align: left;
}

.crm-table td {
    padding: 14px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* =========================================
   BADGES / STATUS
========================================= */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.badge.firma {
    background: #d1fae5;
    color: #065f46;
}

.badge.privat {
    background: #dbeafe;
    color: #1e3a8a;
}

.status {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.status.ok {
    background: #c8e6c9;
}

.status.warn {
    background: #fde68a;
}

.status.danger {
    background: #fecaca;
}

/* =========================================
   AMPEL
========================================= */
.ampel {
    display: flex;
    gap: 6px;
    background: #111827;
    padding: 6px 10px;
    border-radius: 20px;
    width: fit-content;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0.3;
}

.dot.red { background: #ef4444; }
.dot.yellow { background: #f59e0b; }
.dot.green { background: #22c55e; }

.dot.active {
    opacity: 1;
    box-shadow: 0 0 6px currentColor;
}

/* =========================================
   STATUS COLORS
========================================= */
.status.aktiv {
    background: #c8e6c9;
}

.status.offen {
    background: #fde68a;
}

.status.kritisch {
    background: #fecaca;
}

/* =========================================
   BIG NUMBER
========================================= */
.big-number {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* =========================================
   MOBILE
========================================= */
@media (max-width: 768px) {

    .navbar-nav {
        text-align: center;
    }

    .nav-link {
        margin: 10px 0;
    }

    .crm-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .crm-search {
        width: 100%;
    }

    .dashboard-card,
    .dashboard-hero {
        padding: 20px;
    }

    .big-number {
        font-size: 28px;
    }
}

/* IMMFIMA App-Navigation */
.app-navbar { min-height:84px; padding:0; border-bottom:1px solid #dbe4ef; background:#fff; box-shadow:0 4px 16px rgba(11,53,104,.045); }
.app-navbar-inner { min-height:84px; }
.app-brand { display:flex; align-items:center; gap:12px; color:#102039; text-decoration:none; }
.app-brand:hover { color:#102039; }
.app-brand img { width:52px; height:52px; border-radius:12px; object-fit:cover; box-shadow:0 4px 12px rgba(11,53,104,.18); }
.app-brand>span { display:flex; flex-direction:column; line-height:1.05; }
.app-brand strong { color:#102039; font-size:1.1rem; letter-spacing:.08em; }
.app-brand small { margin-top:5px; color:#5e6a79; font-size:.68rem; }
.app-navbar .nav-link { margin:0 5px; padding:10px 12px!important; border-radius:7px; color:#102039!important; font-size:.82rem; font-weight:650; }
.app-navbar .nav-link::after { display:none; }
.app-navbar .nav-link:hover { background:#f1f6fb; }
.app-navbar .nav-link.active { color:#0b3568!important; background:#eaf2fa; }
.app-user-name { color:#102039; font-size:.79rem; font-weight:650; white-space:nowrap; }
.app-user-name span { color:#cc9416; font-size:.55rem; }
.app-logout { padding:8px 13px; border:1px solid #0b3568; border-radius:7px; color:#0b3568; font-size:.75rem; font-weight:700; text-decoration:none; }
.app-logout:hover { color:#fff; background:#0b3568; }
.app-content { max-width:1240px; }
.app-flashes .alert { border-radius:9px; font-size:.85rem; }
.app-flashes .alert-success {
  color:#0b3568;
  border-color:#b9d0e7;
  background:#eaf2fa;
}
.app-flashes .alert-success .btn-close {
  filter:invert(18%) sepia(34%) saturate(1831%) hue-rotate(177deg) brightness(88%) contrast(96%);
}

/* Einheitliche IMMFIMA-Farbwelt: bisher grüne Bedienelemente werden blau */
.btn-primary,
.btn-success,
.btn-green,
.login-btn,
.crm-filter .active {
  color:#fff!important;
  border-color:#0b3568!important;
  background:#0b3568!important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus,
.btn-green:hover,
.btn-green:focus,
.login-btn:hover,
.login-btn:focus,
.crm-filter .active:hover {
  color:#fff!important;
  border-color:#08294f!important;
  background:#08294f!important;
}
.badge.firma,
.status.ok,
.status.aktiv {
  color:#0b3568!important;
  background:#eaf2fa!important;
}
@media(max-width:991px) {
  .app-navbar{padding:10px 0}
  .app-navbar .navbar-collapse{padding:16px 0 6px}
  .app-user{margin-top:12px;padding-top:12px;border-top:1px solid #e5ebf2}
}
