/* breeder_pro_2026/assets/css/theme.css */

:root {
    /* --- BRANDING FARBEN (#BD8A67) --- */
    --brand-primary: #BD8A67;
    --brand-primary-dark: #A67C52;
    --brand-primary-rgb: 189, 138, 103;
    --brand-secondary: #fdf8f3;     /* Hell-Beige */
    --brand-accent: #EAD7BB;
    --brand-bg-light: #F8F9FA;
    --brand-ink: #111827;          /* Überschriften / Icons */

    --radius-xl: 24px;
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.05);

    /* Bootstrap Primary → Brand-Braun (kein Standard-Blau) */
    --bs-primary: #BD8A67;
    --bs-primary-rgb: 189, 138, 103;
    --bs-primary-text-emphasis: #5d4037;
    --bs-primary-bg-subtle: #f7efe8;
    --bs-primary-border-subtle: #e2c4ad;
    --bs-link-color: #8a6348;
    --bs-link-hover-color: #6d4c38;
    --bs-focus-ring-color: rgba(189, 138, 103, 0.35);
}

/* --- GLOBALE BASIS-STYLES --- */
body {
    background-color: var(--brand-bg-light);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    margin: 0;
}

/* ============================================================
   EINHEITLICHE BRAND-FARBEN (Blau → Braun)
   ============================================================ */
.text-primary { color: var(--brand-primary) !important; }
.bg-primary { background-color: var(--brand-primary) !important; }
.border-primary { border-color: var(--brand-primary) !important; }
.bg-primary-subtle { background-color: var(--bs-primary-bg-subtle) !important; }
.text-bg-primary { background-color: var(--brand-primary) !important; color: #fff !important; }

.btn-primary {
    --bs-btn-bg: var(--brand-primary);
    --bs-btn-border-color: var(--brand-primary);
    --bs-btn-hover-bg: var(--brand-primary-dark);
    --bs-btn-hover-border-color: var(--brand-primary-dark);
    --bs-btn-active-bg: var(--brand-primary-dark);
    --bs-btn-active-border-color: var(--brand-primary-dark);
    --bs-btn-disabled-bg: var(--brand-primary);
    --bs-btn-disabled-border-color: var(--brand-primary);
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #fff !important;
}
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active {
    background-color: var(--brand-primary-dark) !important;
    border-color: var(--brand-primary-dark) !important;
    color: #fff !important;
}

.btn-outline-primary {
    --bs-btn-color: var(--brand-primary);
    --bs-btn-border-color: var(--brand-primary);
    --bs-btn-hover-bg: var(--brand-primary);
    --bs-btn-hover-border-color: var(--brand-primary);
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--brand-primary);
    --bs-btn-active-border-color: var(--brand-primary);
    color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}
.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active,
.btn-outline-primary.active {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    color: #fff !important;
}

.form-check-input:checked {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}
.form-check-input:focus {
    border-color: var(--brand-accent) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--brand-primary-rgb), 0.25) !important;
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--brand-primary) !important;
}

.bg-soft-primary { background-color: rgba(var(--brand-primary-rgb), 0.12) !important; }
.bg-soft-info {
    background-color: rgba(var(--brand-primary-rgb), 0.12) !important;
    color: var(--brand-primary-dark) !important;
}

/* Page-Header: einheitliche Größe, Überschrift + Icon schwarz */
:root {
    --page-title-size: 1.5rem; /* fest, nicht h3/h4-abhängig */
    --page-title-weight: 700;
}

body.app-logged-in .container-fluid > .mb-4 > h1,
body.app-logged-in .container-fluid > .mb-4 > h2,
body.app-logged-in .container-fluid > .d-flex > h1,
body.app-logged-in .container-fluid > .d-flex > div > h1,
body.app-logged-in .container-fluid > .d-flex.justify-content-between > div > h1,
body.app-logged-in .container-fluid > .d-flex.justify-content-between > h1,
body.app-logged-in .container > .d-flex > div > h1,
body.app-logged-in .page-header h1,
body.app-logged-in .page-header .page-title,
body.app-logged-in h1.h3,
body.app-logged-in h1.h4,
body.app-logged-in h2.h3,
body.app-logged-in .container-fluid h1.h3,
body.app-logged-in .container-fluid h1.h4,
body.app-logged-in .page-title-main {
    font-size: var(--page-title-size) !important;
    font-weight: var(--page-title-weight) !important;
    line-height: 1.3 !important;
    color: var(--brand-ink) !important;
    letter-spacing: normal;
}

body.app-logged-in .page-header h1 .bi,
body.app-logged-in .page-header .page-title .bi,
body.app-logged-in h1.h3 .bi,
body.app-logged-in h1.h4 .bi,
body.app-logged-in h2.h3 .bi,
body.app-logged-in .container-fluid h1 .bi,
body.app-logged-in .container-fluid h2 .bi,
body.app-logged-in .container-fluid > .mb-4 > h1 .bi,
body.app-logged-in .container-fluid > .d-flex h1 .bi {
    font-size: 1em !important;
    color: var(--brand-ink) !important;
    vertical-align: -0.05em;
}

/* FullCalendar: kein Bootstrap-Blau */
.fc .fc-button-primary,
.fc .fc-button {
    background-color: #3f3f46 !important;
    border-color: #3f3f46 !important;
    color: #fff !important;
}
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active,
.fc .fc-button-active {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}
.fc .fc-button-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--brand-primary-rgb), 0.35) !important;
}
.fc-event,
.fc .fc-daygrid-event {
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
}

/* ============================================================
   EINHEITLICHE FILTER- & CHIP-NAVIGATION (global)
   ============================================================ */
.app-toolbar,
.tierdaten-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.app-search,
.tierdaten-search {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    max-width: 420px;
    padding: 0.65rem 1rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #e8edf3;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
}

.app-search i,
.tierdaten-search i {
    font-size: 0.95rem;
    opacity: 0.65;
}

.app-filters,
.tierdaten-filters,
.nav-pills-custom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem;
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04);
    white-space: normal;
    overflow: visible;
}

.filter-chip-divider {
    width: 1px;
    height: 1.35rem;
    background: #e2e8f0;
    margin: 0 0.15rem;
    flex-shrink: 0;
}

.filter-chip,
.nav-link-chip,
.nav-pills-custom > .nav-link,
.nav-pills-custom .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid transparent;
    color: #475569 !important;
    text-decoration: none !important;
    font-size: 0.8rem;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.filter-chip-muted {
    color: #64748b !important;
    background: #fff;
    border-color: #eef2f7;
}

.filter-chip:hover:not(.active),
.nav-link-chip:hover:not(.active),
.nav-pills-custom .nav-link:hover:not(.active) {
    background: #f1f5f9;
    color: #0f172a !important;
}

.filter-chip.active,
.nav-link-chip.active,
.nav-pills-custom > .nav-link.active,
.nav-pills-custom .nav-link.active {
    background: var(--brand-primary) !important;
    color: #fff !important;
    border-color: var(--brand-primary) !important;
    box-shadow: 0 4px 12px rgba(190, 138, 98, 0.28);
}

.filter-chip-count,
.nav-pills-custom .nav-link .badge,
.nav-link-chip .badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    background: rgba(15, 23, 42, 0.08);
    color: inherit;
    border: none;
}

.filter-chip-count.is-active,
.filter-chip.active .filter-chip-count,
.nav-link-chip.active .badge,
.nav-pills-custom .nav-link.active .badge {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
}

@media (max-width: 575.98px) {
    .app-search,
    .tierdaten-search {
        max-width: none;
    }
    .filter-chip-divider {
        display: none;
    }
}

/* ============================================================
   ÖFFENTLICHER HEADER (LOGOUT-ANSICHT)
   ============================================================ */
.public-header {
    background-color: var(--brand-primary) !important; 
    padding: 8px 0 !important; /* Noch flacher für Mobile */
    border-bottom: 2px solid var(--brand-primary-dark) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.public-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Weißes Logo auf braunem Grund */
.public-header img {
    max-height: 32px !important; /* Minimal kleiner für mehr Platz */
    width: auto;
    filter: brightness(0) invert(1) !important;
}

/* Buttons im öffentlichen Header (Mobile-Optimiert & Schmaler) */
.public-header .auth-buttons .btn {
    padding: 0.35rem 0.65rem !important; /* Schmaleres Padding für weniger Breite */
    font-size: 0.75rem !important;       /* Kleinere Schrift für Mobile */
    border-radius: 50px !important;
    font-weight: 700 !important;
    white-space: nowrap;                 /* Verhindert Textumbruch */
}

.public-header .btn-outline-primary {
    border: 1px solid rgba(255,255,255,0.7) !important;
    color: #fff !important;
}

.public-header .btn-primary {
    background-color: #fff !important;
    color: var(--brand-primary) !important;
    border: none !important;
}

/* ============================================================
   MOBILE TOPBAR (EINGELOGGT)
   ============================================================ */
.topbar {
    background-color: var(--brand-primary) !important; 
    color: #ffffff !important;
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 15px;
    border-bottom: none !important;
}

.topbar .fw-bold { color: #ffffff !important; font-size: 1rem; }
.topbar img { height: 32px !important; filter: brightness(0) invert(1) !important; }

/* ============================================================
   SIDEBAR (MAXIMAL KOMPAKT)
   ============================================================ */
.sidebar {
    background-color: var(--brand-primary) !important;
    color: #fff !important;
    z-index: 1055 !important;
}

.sidebar-brand-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo-img {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    filter: brightness(0) invert(1) !important;
}

.sidebar-brand-title {
    font-size: 0.95rem;
    line-height: 1.1;
}

.sidebar-brand-subtitle {
    font-size: 0.72rem;
    line-height: 1.1;
}

.sidebar-close-btn {
    background: rgba(255,255,255,0.12) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    color: #fff !important;
    border-radius: 10px;
    padding: 0.35rem 0.55rem;
    line-height: 1;
}

.sidebar-search {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 12px;
    padding: 0.25rem 0.35rem;
}
.sidebar-search .form-control::placeholder { color: rgba(255,255,255,0.65); }
.sidebar-search .form-control:focus { box-shadow: none; }

.sidebar .nav-link {
    color: rgba(255,255,255,0.85) !important;
    padding: 0.50rem 0.65rem !important;
    font-size: 0.90rem;
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 0.15rem;
}

.sidebar .nav-link.active, .sidebar .active-nav {
    background: rgba(255,255,255,0.15) !important;
    font-weight: 600;
}

/* Nur Menübereich scrollt, Header/Userbox bleiben stehen */
.sidebar-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}
.sidebar-nav::-webkit-scrollbar { width: 10px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.22); border-radius: 999px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }

/* Neue Gruppen (collapsible) */
.sidebar-group { margin-top: 0.5rem; }
.sidebar-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    background: transparent;
    border: 0;
    color: rgba(255,255,255,0.70);
    font-size: 0.70rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.35rem 0.35rem;
    border-radius: 10px;
}
.sidebar-group-toggle:hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.95);
}
.sidebar-group-chevron { transition: transform 0.2s ease; }
.sidebar-group.is-collapsed .sidebar-group-chevron { transform: rotate(-90deg); }

.sidebar-group-items {
    margin: 0.15rem 0 0.35rem 0;
    padding-left: 0;
}
.sidebar-group.is-collapsed .sidebar-group-items { display: none; }

.sidebar-item-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255,255,255,0.10);
    margin-right: 0.55rem;
    flex-shrink: 0;
}
.sidebar-item-icon i { font-size: 1.05rem; line-height: 1; }
.sidebar-item-lock { opacity: 0.7; margin-left: 0.4rem; }
.sidebar .nav-link.is-locked { opacity: 0.85; }

/* Desktop: kompakter + bessere Lesbarkeit */
@media (min-width: 992px) {
    .sidebar .sidebar-nav {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        padding-top: 0.6rem !important;
        padding-bottom: 0.6rem !important;
    }

    .sidebar .nav-link {
        padding: 0.48rem 0.60rem !important;
        font-size: 0.88rem;
        color: rgba(255,255,255,0.92) !important;
        margin-bottom: 0;
    }

    .sidebar .nav-link:hover {
        background: rgba(255,255,255,0.14) !important;
        color: #fff !important;
    }

    .sidebar .nav-link.active,
    .sidebar .active-nav {
        background: rgba(255,255,255,0.22) !important;
        box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
        color: #fff !important;
    }
}

/* ============================================================
   USERBOX UNTEN – nahtlos, ohne abgehackten Block
   ============================================================ */
.sidebar-userbox {
    flex-shrink: 0;
    position: relative;
    z-index: 5;
    padding: 0.85rem 0.85rem 1rem;
    background: transparent;
    border-top: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.sidebar-userbox::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -18px;
    height: 18px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.12));
}

.sidebar-user-main {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.65rem;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--brand-primary, #BE8A62);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.sidebar-user-text {
    min-width: 0;
    flex: 1;
}

.sidebar-user-name {
    font-size: 0.88rem;
    font-weight: 650;
    color: #fff;
    line-height: 1.2;
}

.sidebar-user-plan {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.15rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.72) !important;
    letter-spacing: 0.02em;
}

.sidebar-user-plan:hover {
    color: #fff !important;
}

.sidebar-user-plan i {
    font-size: 0.7rem;
    opacity: 0.9;
}

.sidebar-user-links {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding-top: 0.15rem;
}

.sidebar-user-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.28rem 0.45rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.82) !important;
    text-decoration: none !important;
    transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-user-link i {
    font-size: 0.85rem;
    line-height: 1;
}

.sidebar-user-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff !important;
}

.sidebar-user-logout:hover {
    background: rgba(220, 53, 69, 0.22);
}

.sidebar-user-sep {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

/* ============================================================
   RESPONSIVE & ALLGEMEIN
   ============================================================ */
@media (max-width: 991.98px) {
    .sidebar { 
        width: 85%;
        max-width: 290px;
    }
}

@media (max-width: 767.98px) {
    .sidebar {
        width: 100% !important;
        max-width: 100% !important;
    }
}

.card, .breeder-card {
    border: none !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--shadow-soft) !important;
    background: #fff;
}

.btn-breeder {
    background-color: var(--brand-primary) !important;
    color: #fff !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
}


/* ============================================================
   SIDEPANEL & OVERLAY (NOTIZEN & DETAILS)
   ============================================================ */

/* Der dunkle Hintergrund-Schleier */
.sidepanel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1060;
    display: none; /* Standardmäßig aus */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidepanel-overlay.show {
    display: block;
    opacity: 1;
}

/* Das eigentliche Panel - Mobile First Ergänzung */
.sidepanel {
    position: fixed;
    top: 0;
    right: -100%; /* Startet komplett außerhalb (Mobile First) */
    width: 100%;  /* Volle Breite auf Mobile */
    height: 100%;
    background: #fff;
    z-index: 1070;
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column; /* Ermöglicht Sticky Header/Footer */
}

/* Wenn das Panel aktiv ist */
.sidepanel.show {
    right: 0;
}

/* Desktop-Anpassung: breiteres Bearbeiten-Panel (Mobil bleibt 100%) */
@media (min-width: 768px) {
    .sidepanel {
        width: min(640px, 92vw);
        right: calc(-1 * min(640px, 92vw));
    }
}
@media (min-width: 1200px) {
    .sidepanel {
        width: 720px;
        right: -720px;
    }
}

/* NEU: Flex-Struktur für das Formular im Sidepanel */
#noteForm {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
    overflow: hidden;
}

/* Scrollbarer Bereich im Panel */
.sidepanel-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    -webkit-overflow-scrolling: touch; /* Flüssiges Scrollen auf iOS */
}

/* Sticky Header & Footer Fixierung */
.sidepanel-header, 
.sidepanel-footer {
    flex-shrink: 0; /* Verhindert das Stauchen bei wenig Platz */
}

/* Fallback für panelContent (falls ohne Formular genutzt) */
#panelContent {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* Drei-Punkte-Menü in Kartenzeilen */
.crm-card .d-flex > .dropdown,
.anfrage-card .action-group .dropdown {
    align-self: center;
    height: auto;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.crm-card:has(.dropdown.show),
.anfrage-card:has(.dropdown.show) {
    z-index: 1050;
    position: relative;
}

.crm-card .dropdown-menu,
.anfrage-card .dropdown-menu {
    z-index: 1060;
    height: auto !important;
    min-height: 0 !important;
}

.crm-card.menu-open,
.anfrage-card.menu-open {
    z-index: 1050;
    position: relative;
}

.tab-content,
.tab-pane,
#anfragenContainer {
    overflow: visible;
}

.crm-card .dropdown-menu.show,
.anfrage-card .dropdown-menu.show {
    z-index: 1060;
}

/* ============================================================
   MOBILE LAYOUT 2026 – GLOBAL (< 768px)
   ============================================================ */

/* Strict horizontal overflow lock */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

/* --- Bottom Navigation --- */
.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    display: none;
    height: 72px;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid #e9ecef;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    align-items: stretch;
    justify-content: space-around;
    gap: 2px;
}

.mobile-bottom-nav .mbn-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    padding: 4px 2px;
    border: 0;
    background: transparent;
    color: #6c757d;
    text-decoration: none;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.1;
    border-radius: 10px;
    transition: color 0.15s ease, background 0.15s ease;
}

.mobile-bottom-nav .mbn-item i {
    font-size: 1.25rem;
    line-height: 1;
}

.mobile-bottom-nav .mbn-item span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-bottom-nav .mbn-item.active,
.mobile-bottom-nav .mbn-item:active {
    color: var(--brand-primary);
    background: rgba(189, 138, 103, 0.1);
}

/* --- Floating Action Button (global = Zyklus & Läufigkeit) --- */
.fab-button,
.fab,
a.fab-button,
button.fab-button {
    position: fixed !important;
    bottom: 85px !important;
    right: 20px !important;
    width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important;
    background: #BE8A62 !important;
    color: #fff !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 28px !important;
    line-height: 1 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    z-index: 1030 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    padding: 0 !important;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
}

.fab-button:hover,
.fab:hover,
a.fab-button:hover,
button.fab-button:hover {
    transform: scale(1.1);
    color: #fff !important;
    background: #a67652 !important;
}

.fab-button i,
.fab i {
    font-size: inherit;
    line-height: 1;
    color: inherit;
}

.fab-menu {
    position: fixed;
    right: 20px;
    bottom: 160px;
    z-index: 1030;
}

/* --- Modals: z-index above brown top header --- */
.modal-backdrop {
    z-index: 1060 !important;
}

.modal {
    z-index: 1070 !important;
}

.sidepanel-overlay {
    z-index: 1060;
}

.sidepanel {
    z-index: 1070;
}

.modal .modal-header {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
    padding: 15px;
    border-bottom: 1px solid #dee2e6;
}

.sidepanel-header {
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
    border-bottom: 1px solid #dee2e6;
}

@media (max-width: 767.98px) {
    /* Body / content clearance for bottom nav */
    body.app-logged-in {
        padding-bottom: 85px !important;
    }

    body.app-logged-in .content-scroll {
        padding-bottom: 100px !important;
    }

    /* Footer unter Bottom-Nav nicht nötig / stört */
    body.app-logged-in .app-content-footer {
        display: none !important;
    }

    .mobile-bottom-nav {
        display: flex !important;
    }

    /* Toast above bottom nav */
    .toast-container.position-fixed.bottom-0 {
        bottom: 85px !important;
    }

    /* Form action bars sit above bottom nav */
    .mobile-action-bar {
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 72px !important;
        z-index: 1025 !important;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    body.app-logged-in .container-fluid:has(+ .mobile-action-bar),
    body.app-logged-in .container-fluid:has(~ .mobile-action-bar) {
        padding-bottom: 160px !important;
    }

    /* Sidebar / hamburger menu: full viewport width */
    .sidebar {
        width: 100% !important;
        max-width: 100% !important;
        left: 0;
        top: 0 !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        z-index: 1055 !important;
    }

    .sidebar-overlay {
        inset: 0 !important;
        z-index: 1050 !important;
    }

    /* Lock background scroll while menu open */
    body.sidebar-open,
    body.sidebar-open .content-scroll {
        overflow: hidden !important;
    }

    /* Page headers: stack title + action buttons */
    .page-header,
    .page-toolbar,
    .content-scroll > .container-fluid > .d-flex.justify-content-between,
    .content-scroll > .container-fluid > .d-flex.align-items-center.justify-content-between,
    .content-scroll .mb-4.d-flex.justify-content-between,
    .content-scroll .mb-4.d-flex.align-items-center.justify-content-between,
    .content-scroll .d-flex.flex-wrap.justify-content-between.align-items-start {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .page-header .d-flex.gap-2,
    .page-toolbar .d-flex.gap-2,
    .content-scroll > .container-fluid > .d-flex.justify-content-between > .d-flex,
    .content-scroll > .container-fluid > .d-flex.align-items-center.justify-content-between > .d-flex {
        flex-wrap: wrap;
        width: 100%;
        gap: 8px;
    }

    .page-header .btn,
    .page-toolbar .btn {
        width: auto;
        max-width: 100%;
    }

    /* Filter / nav pills: wrap or scroll */
    .nav-pills,
    .nav-pills-custom,
    .nav-tabs-custom,
    .nav-tabs-crm,
    .nav-pills-zucht,
    .filter-pills,
    .bg-pill-container .nav {
        flex-wrap: wrap !important;
        row-gap: 8px;
        max-width: 100%;
    }

    .nav-scroll-x,
    .tabs-wrapper,
    .filter-scroll {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        max-width: 100%;
        scrollbar-width: thin;
    }

    .nav-scroll-x .nav-link,
    .filter-scroll .nav-link {
        flex-shrink: 0;
    }

    /* Modals & slide-overs: full width */
    .modal-dialog {
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        min-height: 100%;
    }

    .modal-dialog-centered {
        min-height: 100%;
        align-items: stretch !important;
    }

    .modal-content {
        width: 100%;
        min-height: 100dvh;
        border-radius: 0 !important;
        border: 0;
    }

    .modal-dialog-scrollable .modal-content {
        max-height: 100dvh;
    }

    .modal .modal-header {
        position: sticky;
        top: 0;
        background: #fff;
        z-index: 10;
        padding: 15px;
        border-bottom: 1px solid #dee2e6;
    }

    .sidepanel,
    .right-panel,
    #rightPanel {
        width: 100% !important;
        max-width: 100% !important;
        right: -100%;
    }

    .sidepanel.show,
    .sidepanel.open,
    .right-panel.show,
    #rightPanel.open,
    #rightPanel.show {
        right: 0 !important;
    }

    /* Forms: single column, full width inputs */
    .form-control,
    .form-select,
    .input-group,
    textarea.form-control {
        max-width: 100%;
    }

    .sidepanel .row > .col-6,
    .sidepanel .row > .col-4,
    .sidepanel .row > .col-3,
    .modal-body .row > .col-6,
    .modal-body .row > .col-4,
    .modal-body .row > .col-md-6,
    .modal-body .row > .col-md-4,
    .modal-body .row > .col-lg-6,
    .content-scroll form .row > .col-6,
    .content-scroll form .row > .col-md-6,
    .content-scroll form .row > .col-md-4,
    .content-scroll form .row > .col-lg-6,
    .content-scroll form .row > .col-lg-4 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    /* Tables never break layout */
    .table-responsive {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table.table {
        max-width: 100%;
    }
}

/* Desktop: keep bottom nav hidden even if markup present */
@media (min-width: 768px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}
