/**
 * @desc Pütz Aktuell - Projektweites Theme
 * 
 * @version 1.44
 * @author Jörg Oberleuck
 * @date 21.08.2026
 * @copyright 2022 - 2026 Jörg Oberleuck
 * 
 * Design-Spezifikationen:
 * - Grauer Hintergrund wie in Cards (mit Rahmen)
 * - Alle Buttons, Card-Header und Menü-Hintergründe: #0044AA
 */

/* ========================================
   GRUNDLEGENDE BODY/LAYOUT STYLES
   ======================================== */

html {
    overflow-y: scroll !important; /* Scrollbalken-Platz immer reservieren auf HTML-Ebene */
    -ms-overflow-style: none;  /* IE/Edge - Scrollbar ausblenden */
    scrollbar-width: none;  /* Firefox - Scrollbar ausblenden */
}

/* Webkit (Chrome, Safari, Edge) - Scrollbar ausblenden */
html::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

body {
    background-color: #f8f9fa !important; /* Grauer Hintergrund wie Bootstrap Cards */
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden !important; /* Kein horizontaler Scrollbalken */
}

/* Platz für fixed Footer */
main {
    padding-bottom: 60px !important;
}

/* Container mit Card-ähnlichem Styling */
.main-content {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin: 1rem;
    padding: 1rem;
}

/* ========================================
   PRIMÄRFARBE #0044AA DEFINITIONEN
   ======================================== */

/* Alle primären Buttons */
.btn-primary,
.btn-primary:active,
.btn-primary.active {
    background: linear-gradient(135deg, #0044aa 0%, #0055cc 100%) !important;
    border: none !important;
    color: #ffffff !important;
    transition: all 0.3s ease;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, #003388 0%, #0044aa 100%) !important;
    border: none !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 68, 170, 0.3);
}

/* Outline Buttons */
.btn-outline-primary {
    color: #0044aa !important;
    border-color: #0044aa !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-outline-primary:active {
    background-color: #0044aa !important;
    border-color: #0044aa !important;
    color: #ffffff !important;
}

/* ========================================
   NAVBAR/MENU STYLES
   ======================================== */

/* Hauptnavigation */
.navbar.bg-primary,
.bg-primary {
    background: linear-gradient(135deg, #0044aa 0%, #0055cc 100%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Navbar Brand und Links */
.navbar-brand,
.navbar-nav .nav-link {
    color: #ffffff !important;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus {
    color: #e6f3ff !important;
}

/* Dropdown Menu Items */
.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
    background-color: #f8f9fa;
    color: #0044aa;
}

/* Navbar Toggler */
.navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.25);
}

/* ========================================
   CARD COMPONENTS
   ======================================== */

/* Card Header */
.card-header {
    background-color: #0044aa !important;
    color: #ffffff !important;
    border-bottom: 1px solid #003388;
}

.card-header h1,
.card-header h2, 
.card-header h3,
.card-header h4,
.card-header h5,
.card-header h6 {
    color: #ffffff !important;
    margin-bottom: 0;
}

/* Cards mit Rahmen und abgerundeten Ecken */
.card {
    border: 1px solid #dee2e6 !important;
    border-radius: 0.5rem !important;
    border-bottom-left-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
    background-color: #ffffff;
    margin-bottom: 5px !important;
    overflow: hidden !important;
}

/* Card Body */
.card-body {
    background-color: #ffffff;
    padding: 1.25rem;
}

/* Card Body mit voller Höhe für Haupt-Content-Cards */
.card > .card-body {
    min-height: calc(100vh - 180px);
    padding-bottom: 0 !important;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */

/* Submit/Primary Buttons in Forms */
input[type="submit"].btn-primary,
button[type="submit"].btn-primary,
.btn[name="save"],
.btn[name="login"] {
    background: linear-gradient(135deg, #0044aa 0%, #0055cc 100%) !important;
    border: none !important;
    color: #ffffff !important;
    transition: all 0.3s ease;
}

input[type="submit"].btn-primary:hover,
button[type="submit"].btn-primary:hover,
.btn[name="save"]:hover,
.btn[name="login"]:hover {
    background: linear-gradient(135deg, #003388 0%, #0044aa 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 68, 170, 0.3);
}

/* Input Focus States */
.form-control:focus,
.form-select:focus {
    border-color: #0044aa !important;
    box-shadow: none !important;
    outline: 0 !important;
}

/* Input Groups */
.input-group-text {
    background-color: #ffffff !important;
    border-color: #0044aa !important;
    color: #0044aa !important;
    height: auto !important;
    padding: 0.375rem 0.75rem !important;
    display: flex !important;
    align-items: center !important;
    font-weight: 600 !important;
}

/* Spezielle Behandlung für Icon-Gruppen (Login etc.) */
.input-group-text.icon-group {
    background-color: #0044aa !important;
    color: #ffffff !important;
}

/* Input Group Zusammenhang - keine doppelten Rahmen */
.input-group > .form-control:not(:first-child),
.input-group > .form-floating:not(:first-child) > .form-control {
    border-left: 0 !important;
    border-color: #0044aa !important;
}

.input-group > .input-group-text:not(:last-child) {
    border-right: 0 !important;
}

/* Formular-Felder mit Beschreibungen - blaue Rahmen */
.md-form .form-control {
    border-color: #0044aa !important;
    border-width: 2px !important;
}

.md-form .form-control:focus {
    border-color: #0044aa !important;
    box-shadow: none !important;
    outline: 0 !important;
}

/* Floating Labels in Input Groups */
.input-group .form-floating {
    flex: 1 1 auto !important;
}

.input-group .form-floating .form-control {
    border-radius: 0 0.375rem 0.375rem 0 !important;
    height: calc(3.5rem + 2px) !important;
}

.input-group .input-group-text {
    border-radius: 0.375rem 0 0 0.375rem !important;
    height: calc(3.5rem + 2px) !important;
}

/* ========================================
   BREADCRUMB STYLES
   ======================================== */

.breadcrumb {
    background-color: transparent !important;
    padding: 0.5rem 0 !important;
    margin-bottom: 0 !important;
    border-radius: 0 !important;
    font-size: 0.9rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #0044aa !important;
}

.breadcrumb-item a {
    color: #0044aa !important;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #003388 !important;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #6c757d !important;
}

.breadcrumb-nav {
    margin-top: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    position: relative !important;
    z-index: 90 !important;
    background-color: rgba(248, 249, 250, 0.95) !important;
    backdrop-filter: blur(5px) !important;
}

:root {
    --header-navbar-hoehe: 56px;
    --header-unterzeile-hoehe: 26px;
    --footer-hoehe: 48px;
    --karten-kopf-hoehe: 36px;
    --abstand-header-inhalt: 20px;
    --abstand-card-footer: 20px;
    --objektliste-karte-abzug: calc(165px + var(--abstand-card-footer));
    /* page=1022: Register_Fertige_Seiten.txt */
    --dokumente-karte-abzug: calc(115px + var(--abstand-card-footer));
    /* page=11000: Register_Fertige_Seiten.txt */
    --rechnungsvorpruefung-karte-abzug: 150px;
    /* Nur Bereich oberhalb der Spalten-Zeile (Card-Header sind in der Zeilenhoehe enthalten) */
    --objektdetails-kopf-karte-hoehe: 95px;
    --objektdetails-spalten-abzug: calc(
        var(--header-navbar-hoehe) +
        var(--header-unterzeile-hoehe) +
        var(--abstand-header-inhalt) +
        var(--objektdetails-kopf-karte-hoehe) +
        var(--abstand-header-inhalt)
    );
}

.header-breadcrumb-bar {
    position: fixed;
    top: var(--header-navbar-hoehe);
    left: 0;
    right: 0;
    z-index: 1020;
    height: var(--header-unterzeile-hoehe);
    min-height: var(--header-unterzeile-hoehe);
    max-height: var(--header-unterzeile-hoehe);
    padding: 0 20px;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    pointer-events: none;
    box-sizing: border-box;
}

.header-breadcrumb-bar.header-zweite-zeile {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center !important;
    justify-content: space-between;
    gap: 0.5rem !important;
    line-height: 1 !important;
}

.header-breadcrumb-bar > * {
    pointer-events: auto;
}

.header-breadcrumb-inhalt {
    display: flex;
    align-items: center;
    align-self: center;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    line-height: 1 !important;
}

header {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Navbar & Benutzermenü über Breadcrumb-Zeile */
header .navbar-haupt {
    z-index: 1030 !important;
    margin-bottom: 0 !important;
}

header .navbar-haupt .navbar-collapse {
    overflow: visible !important;
}

header .navbar-benutzer-dropdown .dropdown-menu {
    z-index: 1055 !important;
}

/* Seitenabstand links/rechts (Navbar, Breadcrumb, Inhalt) */
body:not(.login-seite) .navbar.fixed-top {
    padding-left: 20px !important;
    padding-right: 20px !important;
}

.breadcrumb-nav-header {
    display: flex;
    align-items: center;
    height: 100%;
    margin: 0;
    padding: 0;
}

.header-breadcrumb-bar .breadcrumb,
.breadcrumb-nav-header .breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.8rem;
    line-height: 1 !important;
}

.breadcrumb-nav-header .breadcrumb-item {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    line-height: 1 !important;
}

.breadcrumb-nav-header .breadcrumb-item a {
    line-height: 1 !important;
    padding: 0;
}

.breadcrumb-nav-header .breadcrumb-item + .breadcrumb-item {
    padding-left: 0;
}

.breadcrumb-nav-header .breadcrumb-item + .breadcrumb-item::before {
    float: none;
    display: inline-flex;
    align-items: center;
    align-self: center;
    margin: 0 0.35rem;
    padding: 0;
    line-height: 1 !important;
}

.header-dashboard-titel {
    color: #0044aa;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1 !important;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.header-dashboard-titel .fa-tachometer-alt {
    font-size: 0.8rem;
    margin-right: 0.4rem !important;
    line-height: 1;
}

.header-uhr {
    display: flex;
    align-items: center;
    align-self: center;
    height: 100%;
    margin: 0;
    padding: 0;
    font-size: 0.8rem;
    line-height: 1 !important;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Hilfe-Button in der Header-Unterzeile (siehe class_hilfe.php) */
.header-hilfe-uhr-bereich {
    height: 100%;
    flex-shrink: 0;
}

.header-hilfe-button {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0;
    border: none;
    background: none;
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
}

.header-hilfe-button:hover,
.header-hilfe-button:focus {
    color: #0d6efd;
}

.hilfe-modal-screenshot {
    border: 1px solid #dee2e6;
    border-radius: 4px;
}

.hilfe-modal-schritte li {
    margin-bottom: 0.4rem;
}

/* Body Anpassung für fixed navbar + Unterzeile (Breadcrumb/Uhr) + 20px Abstand zum Inhalt */
body:not(.login-seite) {
    padding-top: calc(
        var(--header-navbar-hoehe) +
        var(--header-unterzeile-hoehe) +
        var(--abstand-header-inhalt)
    ) !important;
}

/* Lade-Overlay deaktiviert – verursachte grauen Vollbild-Schleier */
.page-loading-overlay {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Hängende Bootstrap-Backdrops ohne offenes Modal */
body:not(.modal-open) .modal-backdrop {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ========================================
   FOOTER STYLES
   ======================================== */

.page-footer {
    background: linear-gradient(135deg, #0044aa 0%, #0055cc 100%) !important;
    color: white !important;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-copyright {
    color: white !important;
    background: linear-gradient(135deg, #0044aa 0%, #0055cc 100%) !important;
    padding: 1rem 0 !important;
}

.footer-copyright a {
    color: white !important;
    text-decoration: none !important;
}

.footer-copyright a:hover {
    color: #cccccc !important;
    text-decoration: underline !important;
}

/* ========================================
   MODAL STYLES
   ======================================== */

.modal-modern {
    border: none !important;
    border-radius: 0.75rem !important;
    overflow: hidden !important;
    box-shadow: 0 10px 40px rgba(0, 68, 170, 0.3) !important;
}

/* Sicherstellen dass Modal-Header sichtbar ist */
.modal-modern .modal-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.modal-modern .modal-title {
    margin: 0 !important;
    line-height: 1.5 !important;
}

/* UNIVERSELLE MODERNE MODAL-REGELN - HÖCHSTE PRIORITÄT */
.modal-modern .modal-header-modern,
.modal-modern .modal-header,
div[class*="modal"] .modal-header-modern {
    background: linear-gradient(135deg, #0044aa 0%, #0055cc 100%) !important;
    color: white !important;
    border: none !important;
    padding: 0.5rem 1rem !important;
    height: auto !important;
    min-height: 40px !important;
    line-height: 1.0 !important;
    border-radius: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    position: relative !important;
}

.modal-modern .modal-header-modern .modal-title,
.modal-modern .modal-header .modal-title,
.modal-modern .modal-header-modern h5,
.modal-modern .modal-header h5 {
    font-weight: 400 !important;
    font-size: 1.0rem !important;
    color: white !important;
    margin-bottom: 0 !important;
    margin: 0 !important;
    line-height: 1.0 !important;
}

/* Kleine abgerundete Ecke oben links im Modal-Header */
.modal-modern .modal-header-modern::before,
.modal-modern .modal-header::before {
    content: '';
    position: absolute;
    top: 1px;
    left: 1px;
    width: 8px;
    height: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 7px 0 0 0;
    pointer-events: none;
    z-index: 1;
}

.modal-modern .modal-header-modern .btn-close,
.modal-modern .modal-header .btn-close {
    filter: brightness(0) invert(1) !important;
    opacity: 0.8 !important;
    background-size: 0.6em !important;
    width: 0.8em !important;
    height: 0.8em !important;
    padding: 0 !important;
    background-color: transparent !important;
    font-size: 1rem !important;
}

.modal-modern .modal-header-modern .btn-close:hover,
.modal-modern .modal-header .btn-close:hover {
    opacity: 1 !important;
    transform: scale(1.1);
}

.btn-close-white {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.btn-close-white:hover {
    opacity: 1;
}

/* modal-edit: vertikal und horizontal zentriert */
#modal-edit.modal {
    align-items: center !important;
}

#modal-edit .modal-dialog {
    margin-left: auto !important;
    margin-right: auto !important;
}

#modal-edit.modal.fade .modal-dialog {
    transform: translate(0, -1rem);
}

#modal-edit.modal.show .modal-dialog {
    transform: none;
}

/* Spezifische Modal-Regeln für modal-edit - Maximale Priorität */
#modal-edit .modal-header,
#modal-edit .modal-header.modal-header-modern,
.modal#modal-edit .modal-header {
    background: linear-gradient(135deg, #0044aa 0%, #0055cc 100%) !important;
    color: white !important;
    border: none !important;
    border-bottom: none !important;
    padding: 1.25rem 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 60px !important;
    position: relative !important;
    z-index: 1060 !important;
    border-radius: 0.375rem 0.375rem 0 0 !important;
}

#modal-edit .modal-title,
#modal-edit h5.modal-title,
.modal#modal-edit .modal-title {
    color: white !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    margin: 0 !important;
    flex: 1 !important;
    line-height: 1.5 !important;
}

#modal-edit .btn-close,
#modal-edit button.btn-close,
.modal#modal-edit .btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='m.235 1.818 4.597 4.597 4.597-4.597 1.183 1.183-4.597 4.597 4.597 4.597-1.183 1.183-4.597-4.597-4.597 4.597-1.183-1.183 4.597-4.597-4.597-4.597z'/%3e%3c/svg%3e") center/1em auto no-repeat !important;
    border: 0 !important;
    border-radius: 0.375rem !important;
    opacity: 0.8 !important;
    width: 1.5em !important;
    height: 1.5em !important;
    padding: 0.375em !important;
    position: relative !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    display: block !important;
    margin-left: auto !important;
}

#modal-edit .btn-close:hover {
    opacity: 1 !important;
    background-color: rgba(255,255,255,0.1) !important;
}

/* EXTREME CSS-REGELN - HÖCHSTE PRIORITÄT */
div#modal-edit .modal-dialog .modal-content .modal-header,
.modal.fade#modal-edit .modal-dialog .modal-content .modal-header,
.modal#modal-edit .modal-dialog .modal-content .modal-header.modal-header-modern {
    background: linear-gradient(135deg, #0044aa 0%, #0055cc 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-bottom: none !important;
    padding: 1.25rem 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 60px !important;
    position: relative !important;
    border-radius: 0.375rem 0.375rem 0 0 !important;
}

div#modal-edit .modal-dialog .modal-content .modal-header .modal-title,
.modal.fade#modal-edit .modal-dialog .modal-content .modal-header h5,
.modal#modal-edit .modal-dialog .modal-content .modal-header h5.modal-title {
    color: #ffffff !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    margin: 0 !important;
    flex: 1 !important;
    line-height: 1.5 !important;
}

div#modal-edit .modal-dialog .modal-content .modal-header .btn-close,
.modal.fade#modal-edit .modal-dialog .modal-content .modal-header button.btn-close,
.modal#modal-edit .modal-dialog .modal-content .modal-header .btn-close.btn-close-white {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='m.235 1.818 4.597 4.597 4.597-4.597 1.183 1.183-4.597 4.597 4.597 4.597-1.183 1.183-4.597-4.597-4.597 4.597-1.183-1.183 4.597-4.597-4.597-4.597z'/%3e%3c/svg%3e") center/1em auto no-repeat !important;
    border: 0 !important;
    border-radius: 0.375rem !important;
    opacity: 0.8 !important;
    width: 1.5em !important;
    height: 1.5em !important;
    padding: 0.375em !important;
    position: relative !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    display: block !important;
    margin-left: auto !important;
    filter: none !important;
}

/* CARD Z-INDEX ENTFERNT - KORREKTE DOM-STRUKTUR */

/* ABSOLUTES CSS-MODAL - HÖCHSTE PRIORITÄT */
#css-modal {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0,0,0,0.9) !important;
    z-index: 99999999 !important;
}

#css-modal:target {
    display: block !important;
}

#css-modal * {
    z-index: 99999999 !important;
}

#css-modal > div {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: white !important;
    border-radius: 8px !important;
    width: 600px !important;
    max-width: 90vw !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5) !important;
    z-index: 99999999 !important;
}

/* DIREKTE REGELN FÜR DAS AREAS-MODAL */
#modal-areas-edit .modal-header {
    background: linear-gradient(135deg, #0044aa 0%, #0055cc 100%) !important;
    color: white !important;
    border: none !important;
    padding: 1.25rem 1.5rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 60px !important;
}

#modal-areas-edit .modal-title {
    color: white !important;
    margin: 0 !important;
    font-weight: 600 !important;
}

#modal-areas-edit .btn-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%3e%3cpath d='m.235 1.818 4.597 4.597 4.597-4.597 1.183 1.183-4.597 4.597 4.597 4.597-1.183 1.183-4.597-4.597-4.597 4.597-1.183-1.183 4.597-4.597-4.597-4.597z'/%3e%3c/svg%3e") center/1em auto no-repeat !important;
    width: 1.5em !important;
    height: 1.5em !important;
    opacity: 0.8 !important;
    border: 0 !important;
}

/* UNIVERSELLE MODAL-BODY REGELN */
.modal-modern .modal-body-modern,
.modal-modern .modal-body {
    padding: 1rem 1.5rem !important;
    background-color: #ffffff !important;
}

/* MODAL-FOOTER REGELN */
.modal-modern .modal-footer-modern,
.modal-modern .modal-footer,
.modal-dialog .modal-content .modal-footer {
    background-color: #ffffff !important;
    border-top: 1px solid #dee2e6 !important;
    padding: 0.75rem 1.5rem !important;
    gap: 0.5rem !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
}

/* Speziell für Button-Reihenfolge: Beide Buttons links nebeneinander */
.modal-modern .modal-footer-modern button:first-child,
.modal-modern .modal-footer button:first-child {
    order: 1 !important;
}

.modal-modern .modal-footer-modern button:last-child,
.modal-modern .modal-footer button:last-child {
    order: 2 !important;
}

/* BUTTONS IM FOOTER: Abbrechen links, Speichern rechts - GLEICHE GRÖSSE */
.modal-modern .modal-footer button {
    font-size: 0.875rem !important;
    padding: 0.5rem 1rem !important;
    border-radius: 0.375rem !important;
    font-weight: 400 !important;
    min-height: 38px !important;
    line-height: 1.5 !important;
}

.modal-modern .modal-footer button.btn-secondary,
.modal-modern .modal-footer .btn-modal-cancel {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
}

.modal-modern .modal-footer button.btn-secondary:hover,
.modal-modern .modal-footer .btn-modal-cancel:hover {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
}

.modal-modern .modal-footer button.btn-primary,
.modal-modern .modal-footer .btn-modal-save,
.modal-modern .modal-footer button[type="submit"]:not([value="0"]) {
    background: linear-gradient(135deg, #0044aa 0%, #0055cc 100%) !important;
    border: none !important;
    color: white !important;
}

.modal-modern .modal-footer button.btn-primary:hover,
.modal-modern .modal-footer .btn-modal-save:hover,
.modal-modern .modal-footer button[type="submit"]:not([value="0"]):hover {
    background: linear-gradient(135deg, #003388 0%, #0044aa 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 68, 170, 0.3) !important;
}

/* ========================================
   MODAL BUTTONS STYLING
   ======================================== */

/* UNIVERSELLE BUTTON-CONTAINER IM MODAL-BODY ALS FLEXBOX */
.modal-modern .modal-body-modern .mb-3:last-of-type,
.modal-modern .modal-body .mb-3:last-of-type,
.modal-modern .modal-body-modern > div:last-child:has(button),
.modal-modern .modal-body > div:last-child:has(button) {
    display: flex !important;
    justify-content: flex-start !important;
    gap: 0.5rem !important;
    margin-top: 1rem !important;
}

/* ABBRECHEN-BUTTON (mit data-bs-dismiss oder value="0") GRAU UND LINKS */
.modal-modern button[data-bs-dismiss="modal"],
.modal-modern button[value="0"],
.modal-modern .btn[value="0"] {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: white !important;
    font-weight: 400 !important;
    order: 2 !important; /* Erscheint links */
}

.modal-modern button[data-bs-dismiss="modal"]:hover,
.modal-modern button[value="0"]:hover,
.modal-modern .btn[value="0"]:hover {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
}

/* SPEICHERN-BUTTON (submit mit value > 0) BLAU UND RECHTS */
.modal-modern button[type="submit"]:not([value="0"]),
.modal-modern button[value="1"],
.modal-modern button[value="2"],
.modal-modern button[value="3"],
.modal-modern .btn[value="1"],
.modal-modern .btn[value="2"],
.modal-modern .btn[value="3"] {
    background: linear-gradient(135deg, #0044aa 0%, #0055cc 100%) !important;
    border: none !important;
    color: white !important;
    font-weight: 400 !important;
    order: 1 !important; /* Erscheint rechts vom Abbrechen-Button */
}

.modal-modern button[type="submit"]:not([value="0"]):hover,
.modal-modern button[value="1"]:hover,
.modal-modern button[value="2"]:hover,
.modal-modern button[value="3"]:hover {
    background: linear-gradient(135deg, #003388 0%, #0044aa 100%) !important;
}

/* ALLE MODAL-BUTTONS: EINHEITLICHE GRÖSSE UND PADDING */
.modal-modern button.btn,
.modal-modern .btn {
    font-weight: 400 !important;
    padding: 0.375rem 1rem !important;
}

/* ========================================
   MODAL FORM FIELDS STYLING (wie details.php)
   ======================================== */

/* FORM CONTROLS IN MODALS - WIE IN DETAILS.PHP */
/* Input-Felder in Modals MIT form-floating-modern haben vorrang */
.modal-modern .form-floating-modern .form-control,
.modal-modern .form-floating-modern .form-select {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    font-weight: 400 !important;
    font-size: 1rem !important;
    padding: 0.75rem !important;
}

.modal-modern .form-floating-modern .form-control:focus,
.modal-modern .form-floating-modern .form-select:focus {
    background-color: #ffffff !important;
    border-color: #0044aa !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 68, 170, 0.25) !important;
}

/* Alte Input-Felder OHNE form-floating-modern (für Kompatibilität) */
.modal-modern .form-control:not(.form-floating-modern .form-control),
.modal-modern .form-select:not(.form-floating-modern .form-select),
.modal-modern .input-group-text {
    background-color: #f8f9fa !important;
    border: 1px solid #ced4da !important;
    font-weight: 400 !important;
}

.modal-modern .form-control:not(.form-floating-modern .form-control):focus,
.modal-modern .form-select:not(.form-floating-modern .form-select):focus {
    background-color: #f8f9fa !important;
    border-color: #0044aa !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 68, 170, 0.25) !important;
}

/* INPUT-GROUP SPACING */
.modal-modern .md-form.input-group,
.modal-modern .form-floating-modern {
    margin-bottom: 1rem !important;
}

.btn-modal-save {
    background: linear-gradient(135deg, #0044aa 0%, #0055cc 100%);
    border: none;
    color: white;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.btn-modal-save:hover {
    background: linear-gradient(135deg, #003388 0%, #0044aa 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 68, 170, 0.3);
}

.btn-modal-cancel {
    background-color: #6c757d;
    border: none;
    color: white;
    font-weight: 500;
    padding: 0.5rem 1.5rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.btn-modal-cancel:hover {
    background-color: #5a6268;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Modal Backdrop */
.modal-backdrop {
    background-color: rgba(0, 68, 170, 0.1);
}

/* Modal Animation */
.modal.fade .modal-dialog {
    transition: transform 0.4s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: none;
}

/* Modal Input Fields - Weißes Design wie in Cards */
.modal-body-modern .form-control {
    background-color: #ffffff !important;
    border: 1px solid #ced4da !important;
    color: #495057 !important;
    font-weight: 400;  /* Normal statt fett */
}

.modal-body-modern .form-control:focus {
    background-color: #ffffff !important;
    border-color: #0044aa !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 68, 170, 0.25) !important;
    color: #495057 !important;
}

.modal-body-modern .form-select {
    background-color: #ffffff !important;
    border: 1px solid #ced4da !important;
    color: #495057 !important;
    font-weight: 400;  /* Normal statt fett */
}

.modal-body-modern .form-select:focus {
    background-color: #ffffff !important;
    border-color: #0044aa !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 68, 170, 0.25) !important;
    color: #495057 !important;
}

/* Modal Floating Labels angepasst - IMMER SICHTBAR! */
.modal-body-modern .form-floating-modern label {
    /* IMMER oben anzeigen - auch bei leeren Feldern! */
    top: 0 !important;
    left: 0.75rem !important;
    transform: translateY(-50%) !important;
    color: #6c757d !important;
    background-color: #ffffff !important;
    font-weight: 400 !important;
    background-color: #ffffff !important;
    padding: 0 0.15rem !important;
    font-size: 0.65rem !important;
    z-index: 5 !important;
    max-height: 12px !important;
    height: 12px !important;
    line-height: 1 !important;
}

.modal-body-modern .form-floating-modern .form-control:focus ~ label,
.modal-body-modern .form-floating-modern .form-control:not(:placeholder-shown) ~ label,
.modal-body-modern .form-floating-modern .form-select:focus ~ label {
    /* Bleibt oben bei Focus und gefüllten Feldern */
    top: 0 !important;
    left: 0.75rem !important;
    transform: translateY(-50%) !important;
    color: #6c757d !important;
    background-color: #ffffff !important;
    padding: 0 0.15rem !important;
    font-size: 0.65rem !important;
    font-weight: 400 !important;
    max-height: 12px !important;
    height: 12px !important;
    line-height: 1 !important;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 1rem 0.5rem;
    }
    
    .modal-header-modern,
    .modal-body-modern,
    .modal-footer-modern {
        padding: 1rem;
    }
}

/* ========================================
   DROPDOWN MENU STYLES - ALLE DROPDOWNS
   ======================================== */

/* Alle Dropdown-Menüs bekommen das gleiche Design (außer in Card-Headers) */
.dropdown-menu:not(.submenu .dropdown-menu):not(.card-header .dropdown-menu),
.dropdown-menu-end:not(.submenu .dropdown-menu):not(.card-header .dropdown-menu-end) {
    background: linear-gradient(135deg, #0044aa 0%, #0055cc 100%) !important;
    border: none !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 5px 15px rgba(0, 68, 170, 0.3) !important;
    padding: 0.5rem 0 !important;
}

/* Card-Header Dropdown-Menüs - weißer Hintergrund */
.card-header .dropdown-menu,
.card-header .dropdown-menu-end {
    background: white !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 0.5rem !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15) !important;
}

/* Alle Dropdown-Items weiße Schrift (außer im Submenu und Card-Header) */
.dropdown-item:not(.submenu .dropdown-item):not(.card-header .dropdown-item),
.dropdown-item-text:not(.submenu .dropdown-item-text):not(.card-header .dropdown-item-text) {
    color: rgba(255, 255, 255, 0.9) !important;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s ease !important;
    border: none !important;
}

/* Card-Header Dropdown-Items - dunkle Schrift */
.card-header .dropdown-item {
    color: #212529 !important;
    padding: 0.5rem 1rem !important;
}

.card-header .dropdown-item:hover,
.card-header .dropdown-item:focus {
    background-color: #f8f9fa !important;
    color: #0044aa !important;
}

.dropdown-item:not(.submenu .dropdown-item):not(.card-header .dropdown-item):hover,
.dropdown-item:not(.submenu .dropdown-item):not(.card-header .dropdown-item):focus,
.dropdown-item:not(.submenu .dropdown-item):not(.card-header .dropdown-item):active {
    background: rgba(255, 255, 255, 0.1) !important;
    color: white !important;
    text-decoration: none !important;
}

/* Dropdown-Trennlinien */
.dropdown-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
    margin: 0.5rem 0 !important;
    opacity: 1 !important;
}

/* Dropdown-Trennlinien in Card-Header - dunkle Farbe für Sichtbarkeit */
.card-header .dropdown-menu .dropdown-divider {
    border-top: 1px solid #dee2e6 !important;
    margin: 0.5rem 0 !important;
}

/* Dropdown-Header (für User-Dropdown) */
.dropdown-header {
    color: white !important;
    font-weight: 600 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 0.75rem 1rem 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

/* Logout-Button speziell */
.dropdown-item.text-danger {
    color: #ff6b6b !important;
}

.dropdown-item.text-danger:hover {
    background: rgba(255, 107, 107, 0.1) !important;
    color: #ff5252 !important;
}

/* Icons in allen Dropdowns (außer Submenu und Card-Header) */
.dropdown-menu:not(.submenu .dropdown-menu):not(.card-header .dropdown-menu) .dropdown-item i,
.dropdown-menu-end:not(.submenu .dropdown-menu):not(.card-header .dropdown-menu-end) .dropdown-item i {
    color: rgba(255, 255, 255, 0.7) !important;
    margin-right: 0.5rem !important;
}

/* Entferne Bootstrap Standard-Styles (außer Submenu und Card-Header) */
.dropdown-menu:not(.submenu .dropdown-menu):not(.card-header .dropdown-menu) {
    --bs-dropdown-bg: transparent !important;
    --bs-dropdown-border-color: transparent !important;
    --bs-dropdown-color: white !important;
}

/* ========================================
   TABLE STYLES
   ======================================== */

/* Table Headers */
.table thead th {
    background-color: #0044aa !important;
    color: #ffffff !important;
    border-color: #003388 !important;
}

/* Table Striped */
.table-striped > tbody > tr:nth-of-type(odd) > td {
    background-color: #f8f9fa;
}

/* Table Hover */
.table-hover tbody tr:hover {
    background-color: #e6f3ff;
}

/* ========================================
   PAGINATION
   ======================================== */

.page-link {
    color: #0044aa !important;
}

.page-link:hover,
.page-link:focus {
    color: #003388 !important;
    background-color: #e6f3ff !important;
    border-color: #0044aa !important;
}

.page-item.active .page-link {
    background-color: #0044aa !important;
    border-color: #0044aa !important;
    color: #ffffff !important;
}

/* ========================================
   BADGES UND LABELS
   ======================================== */

.badge.bg-primary {
    background-color: #0044aa !important;
}

.text-primary {
    color: #0044aa !important;
}

/* ========================================
   MODALS
   ======================================== */

.modal-header {
    background-color: #0044aa !important;
    color: #ffffff !important;
    border-bottom: 1px solid #003388;
}

.modal-header h1,
.modal-header h2,
.modal-header h3,
.modal-header h4,
.modal-header h5,
.modal-header h6 {
    color: #ffffff !important;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1); /* Weißes X für Close Button */
}

/* ========================================
   ALERTS
   ======================================== */

.alert-primary {
    background-color: #e6f3ff !important;
    border-color: #0044aa !important;
    color: #003388 !important;
}

/* ========================================
   CUSTOM UTILITY CLASSES
   ======================================== */

/* Pütz Primary Background */
.bg-puetz-primary {
    background-color: #0044aa !important;
    color: #ffffff !important;
}

/* Pütz Primary Text */
.text-puetz-primary {
    color: #0044aa !important;
}

/* Pütz Primary Border */
.border-puetz-primary {
    border-color: #0044aa !important;
}

/* Content Area mit Card-Styling */
.content-area {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

/* ========================================
   RESPONSIVE ANPASSUNGEN
   ======================================== */

@media (max-width: 768px) {
    .main-content,
    .content-area {
        margin: 0.5rem;
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .navbar-brand img {
        width: 35px !important;
        height: 35px !important;
    }
}

@media (max-width: 576px) {
    .main-content,
    .content-area {
        margin: 0.25rem;
        padding: 0.75rem;
    }
    
    .card-header {
        padding: 0.75rem 1rem;
    }
}

/* ========================================
   ACCESSIBILITY VERBESSERUNGEN
   ======================================== */

/* Focus Indicators nur für Buttons - nicht für Form Controls */
.btn:focus {
    outline: 0 !important;
    box-shadow: 0 0 0 0.25rem rgba(0, 68, 170, 0.25) !important;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   MODERNE FLOATING LABELS SYSTEM
   ======================================== */

/* Moderne Floating Labels - richtig gemacht */
.form-floating-modern {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-floating-modern .form-control {
    height: 42px;
    padding: 0.9rem 0.75rem 0.3rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.25;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.form-floating-modern .form-control:focus {
    border-color: #0044aa;
    box-shadow: 0 0 0 0.2rem rgba(0, 68, 170, 0.15);
    outline: 0;
}

.form-floating-modern .form-control::placeholder {
    color: transparent;
}

.form-floating-modern label {
    position: absolute;
    top: 0;
    left: 0.75rem;
    transform: translateY(-50%);
    z-index: 2;
    pointer-events: none;
    transition: all 0.2s ease;
    color: #6c757d;
    font-size: 0.75rem;
    font-weight: 400;
    background-color: #ffffff;
    padding: 0 0.25rem;
    white-space: nowrap;
}

.form-floating-modern .form-control:focus ~ label,
.form-floating-modern .form-control:not(:placeholder-shown) ~ label {
    top: 0;
    left: 0.75rem;
    transform: translateY(-50%);
    color: #0044aa;
    font-weight: 400;
    font-size: 0.75rem;
    background-color: #ffffff;
    padding: 0 0.25rem;
}

/* MODAL SPEZIFISCHE FLOATING LABELS */
.modal-modern .form-floating-modern {
    position: relative;
    margin-bottom: 1rem;
}

.modal-modern .form-floating-modern .form-control {
    height: 42px;
    padding: 0.9rem 0.75rem 0.3rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.25;
    background-color: #ffffff !important;
    transition: all 0.3s ease;
}

.modal-modern .form-floating-modern .form-select {
    height: 42px;
    padding: 0.4rem 2.25rem 0.45rem 0.75rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.25;
    background-color: #ffffff !important;
    transition: all 0.3s ease;
}

.modal-modern .form-floating-modern .form-control:focus,
.modal-modern .form-floating-modern .form-select:focus {
    border-color: #0044aa;
    box-shadow: 0 0 0 0.2rem rgba(0, 68, 170, 0.15);
    outline: 0;
    background-color: #ffffff !important;
}

.modal-modern .form-floating-modern label {
    position: absolute;
    top: 0 !important;
    left: 0.75rem !important;
    transform: translateY(-50%) !important;
    z-index: 2;
    background-color: #ffffff !important;
    pointer-events: none;
    transition: all 0.2s ease;
    color: #6c757d !important;
    font-size: 0.65rem !important;
    font-weight: 400 !important;
    background-color: #ffffff !important;
    padding: 0 0.15rem !important;
    white-space: nowrap;
    max-height: 12px !important;
    line-height: 1 !important;
    height: 12px !important;
}

.modal-modern .form-floating-modern .form-control:focus ~ label,
.modal-modern .form-floating-modern .form-select:focus ~ label {
    color: #0044aa !important;
}

/* ALTE MD-FORM INPUT-GROUP IN MODALS UMWANDELN ZU FLOATING LABELS */
.modal-modern .md-form.input-group {
    position: relative;
    margin-bottom: 1rem;
    display: block;
}

.modal-modern .md-form.input-group .col {
    position: absolute;
    top: 0;
    left: 0.75rem;
    transform: translateY(-50%);
    z-index: 2;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    display: inline-block !important;
    max-width: fit-content !important;
    line-height: 1 !important;
}

.modal-modern .md-form.input-group .input-group-text {
    background-color: #ffffff !important;
    border: none !important;
    padding: 0 0.25rem !important;
    font-size: 0.75rem !important;
    color: #6c757d !important;
    font-weight: 400 !important;
    pointer-events: none;
    margin: 0 !important;
}

.modal-modern .md-form.input-group .form-control,
.modal-modern .md-form.input-group .form-select {
    height: 42px;
    padding: 0.9rem 0.75rem 0.3rem;
    border: 2px solid #dee2e6 !important;
    border-radius: 8px !important;
    font-size: 1rem;
    line-height: 1.25;
    background-color: #ffffff !important;
    transition: all 0.3s ease;
    width: 100% !important;
}

.modal-modern .md-form.input-group .form-control:focus,
.modal-modern .md-form.input-group .form-select:focus {
    border-color: #0044aa !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 68, 170, 0.15) !important;
    outline: 0;
}

.modal-modern .md-form.input-group .form-control:focus ~ .col .input-group-text,
.modal-modern .md-form.input-group .form-select:focus ~ .col .input-group-text {
    color: #0044aa !important;
}

/* SUBMIT-BUTTONS WERDEN DURCH ALLGEMEINE FOOTER-BUTTON-REGELN OBEN GESTYLT */

/* Read-only Variante */
.form-floating-modern .form-control.readonly {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #495057;
}

/* Spezifische Anpassungen für Object Details/New Pages */
.card-body .form-floating-modern { 
    margin-bottom: 0.85rem !important; 
}

/* Labels in card-body IMMER oben anzeigen - auch bei leeren Feldern (für new.php) */
.card-body .form-floating-modern label {
    top: 0 !important;
    left: 0.75rem !important;
    transform: translateY(-50%) !important;
    color: #6c757d !important;
    font-weight: 400 !important;
    font-size: 0.75rem !important;
    background-color: #ffffff !important;
    padding: 0 0.25rem !important;
}

#modal-edit .modal-body-modern {
    background-color: #ffffff !important;
}

#modal-edit .form-control,
#modal-edit .form-select {
    background-color: #f8f9fa !important;
    font-weight: 400 !important;
}

#modal-edit .form-control:focus,
#modal-edit .form-select:focus {
    background-color: #f8f9fa !important;
}

#modal-edit .modal-title,
#modal-edit .modal-title * {
    font-weight: 400 !important;
}

#modal-edit .form-floating-modern.with-icon label {
    background-color: #ffffff !important;
}

#modal-edit .form-floating-modern label {
    background-color: #ffffff !important;
}

.form-floating-modern .form-control.readonly ~ label {
    /* Bei readonly Feldern IMMER Label oben anzeigen - auch bei leeren Feldern! */
    top: 0 !important;
    left: 0.75rem !important;
    transform: translateY(-50%) !important;
    color: #6c757d !important;
    font-weight: 400 !important;
    font-size: 0.75rem !important;
    background-color: #ffffff !important;
    padding: 0 0.25rem !important;
}

/* Select-Felder */
.form-floating-modern .form-select {
    height: 42px;
    padding: 0.55rem 2.25rem 0.45rem 0.75rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.25;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.form-floating-modern .form-select:focus {
    border-color: #0044aa;
    box-shadow: 0 0 0 0.2rem rgba(0, 68, 170, 0.15);
    outline: 0;
}

.form-floating-modern .form-select ~ label {
    /* Select-Labels IMMER oben auf dem Rahmen, über dem Select */
    position: absolute !important;
    top: 0 !important;
    left: 0.75rem !important;
    transform: translateY(-50%) !important;
    z-index: 5 !important;
    color: #6c757d;
    font-weight: 400;
    font-size: 0.75rem;
    background-color: #ffffff;
    padding: 0 0.25rem;
    pointer-events: none;
}

.form-floating-modern .form-select:focus ~ label {
    color: #0044aa;
}

/* Textarea-Felder (z. B. "Mail-Text" bei Zurückweisung, "Kommentare" bei
   Bemerkung/Log auf page=11000, showTextareaModern()) - eigene Regel noetig,
   da ".form-control" sonst die fixe Input-Hoehe von 42px/32px erben wuerde.
   Element-Selektor "textarea.form-control" hat hoehere Spezifitaet als die
   Klassen-Selektoren ".form-floating-modern .form-control" bzw.
   ".compare-field-modern .form-floating-modern .form-control" und gewinnt
   daher unabhaengig von der Reihenfolge im Stylesheet. */
.form-floating-modern textarea.form-control {
    height: auto;
    padding: 1.35rem 0.75rem 0.5rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.3;
    resize: vertical;
}

.form-floating-modern textarea.form-control:focus {
    border-color: #0044aa;
    box-shadow: 0 0 0 0.2rem rgba(0, 68, 170, 0.15);
    outline: 0;
}

/* MODAL SELECT-FELDER SPEZIFISCH (alle Bearbeiten-Modals) */
.modal-modern .form-floating-modern .form-select,
[id^="modal-edit"] .form-floating-modern .form-select {
    height: 42px;
    margin-top: 0 !important;
    padding: 0.35rem 2.25rem 0.45rem 0.75rem !important;
    background-color: #ffffff !important;
}

.modal-modern .form-floating-modern .form-select ~ label {
    top: 0 !important;
    left: 0.75rem !important;
    transform: translateY(-50%) !important;
    font-size: 0.65rem !important;
    background-color: #ffffff !important;
    padding: 0 0.15rem !important;
    max-height: 12px !important;
    height: 12px !important;
    line-height: 1 !important;
}

/* Hover-Effekte */
.form-floating-modern:hover .form-control:not(:focus) {
    border-color: #3366cc;
}

.form-floating-modern:hover .form-select:not(:focus) {
    border-color: #3366cc;
}

/* Icon-Support */
.form-floating-modern.with-icon {
    position: relative;
}

.form-floating-modern.with-icon.icon-building::after {
    content: '🏢';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
    z-index: 3;
    opacity: 0.6;
}

.form-floating-modern.with-icon.icon-location::after {
    content: '📍';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
    z-index: 3;
    opacity: 0.6;
}

.form-floating-modern.with-icon.icon-bank::after {
    content: '💳';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    pointer-events: none;
    z-index: 3;
    opacity: 0.6;
}

/* ========================================
   MODERNE CARD COMPONENTS
   ======================================== */

.card-modern {
    border: 1px solid #0044aa;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 68, 170, 0.1);
    margin-top: 0.5rem;
    margin-bottom: 1.5rem;
}

/* Objektliste: Karte bis zum Footer verlängern */
.card-objektliste .card-body {
    min-height: calc(100vh - var(--objektliste-karte-abzug)) !important;
    padding-bottom: 0 !important;
}

/* Objektdetails: Spalten-Zeile fuellt Resthoehe bis 20px vor Footer */
.seite-objektdetails .objektdetails-spalten-row {
    min-height: calc(
        100vh -
        var(--objektdetails-spalten-abzug) -
        var(--footer-hoehe) -
        var(--abstand-card-footer) +
        20px
    ) !important;
    align-items: stretch !important;
    margin-bottom: var(--abstand-card-footer) !important;
}

.seite-objektdetails .objektdetails-spalten-row > [class*='col-'] {
    display: flex !important;
}

.seite-objektdetails .card-objektdetails-spalte {
    flex: 1 1 auto !important;
    width: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    margin-bottom: 0 !important;
}

.seite-objektdetails .card-objektdetails-spalte .card-body--adresse {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding-top: 0.75rem !important;
    padding-bottom: 5px !important;
    overflow: hidden !important;
}

.seite-objektdetails .card-objektdetails-spalte .card-body--adresse > .row:first-of-type {
    margin-top: 0.75rem;
}

.seite-objektdetails .card-objektdetails-spalte .card-body--karte {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
}

.seite-objektdetails .card-objektdetails-spalte .card-body--karte-inner {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    border-radius: 0 0 0.5rem 0.5rem;
    overflow: hidden;
}

.seite-objektdetails .card-objektdetails-spalte .card-body--karte-inner embed {
    display: block;
    width: 100%;
    height: 100%;
}

/* Objektdetails: Abstand Ende Kopf-Card bis Anfang Card-Header (Adresse/Karte) */
.seite-objektdetails .objektdetails-kopf-card {
    margin-bottom: var(--abstand-header-inhalt) !important;
}

/* Gleiche Höhe für nebeneinander stehende Cards */
.row .card-modern.h-100 {
    display: flex;
    flex-direction: column;
}

.row .card-modern.h-100 .card-body {
    flex: 1;
}

.card-header-modern {
    background: linear-gradient(135deg, #0044aa 0%, #0055cc 100%);
    color: white;
    border-radius: 0.5rem 0.5rem 0 0;
    border: none;
}

/* ========================================
   MODERNE BUTTONS
   ======================================== */

.btn-copy {
    background-color: #0044aa;
    border-color: #0044aa;
    color: white;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background-color: #003388;
    border-color: #003388;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 68, 170, 0.3);
    color: white;
}

/* ========================================
   BESITZGESELLSCHAFT EINGABEFORMAT  
   ======================================== */

/* Besitzgesellschaft nutzt jetzt automatisch form-floating-modern Format durch 
   Anpassung der selectOwner() Methode in class_select.php - keine CSS-Anpassungen nötig */

/* ========================================
   LINKS OHNE UNTERSTRICH
   ======================================== */

/* Alle Links haben standardmäßig keine Unterstreichung */
a {
    text-decoration: none !important;
}

/* Unterstreichung nur bei Hover */
a:hover {
    text-decoration: underline !important;
}

/* Spezielle Link-Klassen ohne Unterstreichung auch bei Hover */
a.no-underline,
a.nav-link,
a.navbar-brand,
a.dropdown-item,
a.btn,
a.card-link {
    text-decoration: none !important;
}

a.no-underline:hover,
a.nav-link:hover,
a.navbar-brand:hover,
a.dropdown-item:hover,
a.btn:hover,
a.card-link:hover {
    text-decoration: none !important;
}

/* Breadcrumb Links - Ausnahme für bessere Navigation */
.breadcrumb-item a:hover {
    text-decoration: underline !important;
}

/* Page 10000: Keine Unterstreichung auch bei Hover, dunkelblau */
/* ABER: Nicht im Navbar/Hauptmenü und nicht in Card-Headern! */
body:has([href*="page=10000"]) main a:not(.btn):not(.navbar-brand):not(.nav-link):not(.dropdown-item),
body:has([href*="page=10000"]) main a:not(.btn):not(.navbar-brand):not(.nav-link):not(.dropdown-item):hover {
    text-decoration: none !important;
    color: #0044aa !important;
}

/* Card-Header Links bleiben weiß */
.card-header a {
    color: white !important;
}

.card-header a:hover {
    color: white !important;
}

/* ========================================
   TABELLE IN SCHÖN
   ======================================== */

/* Moderne Tabellen-Styles */
.table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-radius: 0.5rem !important;
    overflow: hidden !important;
    box-shadow: 0 4px 15px rgba(0, 68, 170, 0.1) !important;
    background-color: #ffffff !important;
}

/* Tabellen-Header - Kompakt wie in list.php */
.table thead th {
    background: linear-gradient(135deg, #0044aa 0%, #0055cc 100%) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 4px 8px !important;
    height: 28px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-size: 0.875rem !important;
    line-height: 1.0 !important;
    vertical-align: middle !important;
    position: relative !important;
}

.table thead th:first-child {
    border-top-left-radius: 0.5rem !important;
}

.table thead th:last-child {
    border-top-right-radius: 0.5rem !important;
}

/* Tabellen-Body - Kompakte Zeilen wie in list.php */
.table tbody td {
    padding: 4px 8px !important;
    border: none !important;
    border-bottom: 1px solid #e9ecef !important;
    vertical-align: middle !important;
    line-height: 1.2 !important;
    transition: all 0.3s ease !important;
}

/* Zeilen-Striping deaktiviert - wird per PHP inline-styles gehandhabt */
.table-striped > tbody > tr > td {
    background-color: inherit !important;
}

/* Custom Zeilen-Klassen */
.bg-light-blue {
    background-color: rgba(0, 68, 170, 0.03) !important;
}

.bg-white {
    background-color: #ffffff !important;
}

/* Überschreibe alle anderen Background-Colors */
.table tbody tr.bg-white td,
.table tbody tr.bg-light-blue td {
    background-color: inherit !important;
}

/* Hover-Effekt */
.table-hover tbody tr:hover td {
    background-color: rgba(0, 68, 170, 0.08) !important;
    transform: scale(1.01) !important;
    box-shadow: 0 2px 8px rgba(0, 68, 170, 0.15) !important;
}

/* Bordered Tables */
.table-bordered {
    border: 2px solid #0044aa !important;
    border-radius: 0.5rem !important;
}

.table-bordered th,
.table-bordered td {
    border-left: 1px solid rgba(0, 68, 170, 0.2) !important;
    border-right: 1px solid rgba(0, 68, 170, 0.2) !important;
}

/* Responsive Table Container */
.table-responsive {
    border-radius: 0.5rem !important;
    box-shadow: 0 4px 15px rgba(0, 68, 170, 0.1) !important;
}

/* Small Tables */
.table-sm th,
.table-sm td {
    padding: 0 !important;
}

/* Dark Table Variante */
.table-dark {
    background-color: #2c3e50 !important;
    color: #ffffff !important;
}

.table-dark thead th {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%) !important;
    color: #ffffff !important;
}

.table-dark tbody tr:hover td {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Tabelle mit Icons in Zellen */
.table td .btn {
    margin: 0 0.125rem !important;
    padding: 0.25rem 0.5rem !important;
    font-size: 0.875rem !important;
}

.table td .btn i {
    font-size: 0.875rem !important;
}

/* Icons in Tabellen dunkelblau */
.table td i,
.table td .fa,
.table td .fas,
.table td .far,
.table td .fab {
    color: #0044aa !important;
}

/* Icons in Links auch dunkelblau */
.table td a i,
.table td a .fa,
.table td a .fas,
.table td a .far,
.table td a .fab {
    color: #0044aa !important;
}

/* Hover-Effekt für Icons */
.table td a:hover i,
.table td a:hover .fa,
.table td a:hover .fas,
.table td a:hover .far,
.table td a:hover .fab {
    color: #003388 !important;
}

/* Status-Badges in Tabellen (kompakt wie Lieferantenliste) */
.table .badge {
    font-size: 0.7rem !important;
    padding: 1px 4px !important;
    border-radius: 0.25rem !important;
    line-height: 1.2 !important;
    font-weight: 500 !important;
}

/* ========================================
   MIETER-ACCORDION WEISSEN STREIFEN ENTFERNEN
   ======================================== */

/* Entferne weißen Streifen bei geschlossenen Mieter-Accordions */
.accordian-body.collapse:not(.show) {
    display: none !important;
}

/* Geschlossene Accordions mit hide-Klasse */
.accordian-body.collapse.hide {
    display: none !important;
}

/* ========================================
   RESPONSIVE FLOATING LABELS
   ======================================== */

@media (max-width: 768px) {
    .form-floating-modern {
        margin-bottom: 1rem;
    }
    
    .form-floating-modern .form-control,
    .form-floating-modern .form-select {
        height: 40px;
        padding: 0.8rem 0.75rem 0.2rem;
        font-size: 0.95rem;
    }
    
    .form-floating-modern .form-select {
        padding: 0.5rem 2rem 0.3rem 0.75rem;
    }
    
    .form-floating-modern label {
        font-size: 0.95rem;
    }
    
    .form-floating-modern .form-control:focus ~ label,
    .form-floating-modern .form-control:not(:placeholder-shown) ~ label,
    .form-floating-modern .form-select:focus ~ label,
    .form-floating-modern .form-select:not([value=""]) ~ label {
        font-size: 0.7rem;
    }
    
    .form-floating-modern.with-icon.icon-building::after,
    .form-floating-modern.with-icon.icon-location::after,
    .form-floating-modern.with-icon.icon-bank::after {
        font-size: 16px;
        right: 10px;
    }
}

@media (max-width: 576px) {
    .form-floating-modern .form-control,
    .form-floating-modern .form-select {
        height: 38px;
        padding: 0.45rem 0.75rem 0.3rem;
        font-size: 0.9rem;
    }
    
    .card-modern {
        border-radius: 0.25rem;
        margin: 0.5rem;
    }
    
    .card-header-modern {
        border-radius: 0.25rem 0.25rem 0 0;
        padding: 1rem;
    }
}

/* ========================================
   DASHBOARD QUICK STATS CARDS
   ======================================== */

/* Basis für alle Quick Stats Cards */
.card.border-start {
    border-left-width: 5px !important;
}

/* Spezifische Farben für Dashboard Stats */
.dashboard-stat-termine {
    border-left-color: #17a2b8 !important;
}

.dashboard-stat-einladungen {
    border-left-color: #ffc107 !important;
}

.dashboard-stat-objekte {
    border-left-color: #007bff !important;
}

.dashboard-stat-mieter {
    border-left-color: #28a745 !important;
}

/* ========================================
   DASHBOARD KACHEL KATEGORIEN
   ======================================== */

/* Basis: Icon + Rahmen aus --dashboard-kachel-farbe (pro Kachel gesetzt) */
.dashboard-tile.dashboard-tile-compact {
    border: 2px solid var(--dashboard-kachel-farbe, #0044aa) !important;
    border-left-width: 5px !important;
    margin-top: 0.25rem !important;
    margin-bottom: 0.5rem !important;
}

.dashboard-tile .dashboard-icon,
.dashboard-tile .dashboard-icon i {
    color: var(--dashboard-kachel-farbe, #0044aa) !important;
}

/* Fallback-Klassen (falls keine Inline-Farbe gesetzt ist) */
.dashboard-category-administration {
    --dashboard-kachel-farbe: #dc3545;
}
.dashboard-category-objekte {
    --dashboard-kachel-farbe: #007bff;
}
.dashboard-category-mieter {
    --dashboard-kachel-farbe: #28a745;
}
.dashboard-category-finanzen {
    --dashboard-kachel-farbe: #ffc107;
}
.dashboard-category-dokumente {
    --dashboard-kachel-farbe: #fd7e14;
}
.dashboard-category-termine {
    --dashboard-kachel-farbe: #17a2b8;
}
.dashboard-category-berichte {
    --dashboard-kachel-farbe: #fd7e14;
}
.dashboard-category-tickets {
    --dashboard-kachel-farbe: #dc3545;
}
.dashboard-category-personal {
    --dashboard-kachel-farbe: #6f42c1;
}
.dashboard-category-sonstige,
.dashboard-category-sonstiges {
    --dashboard-kachel-farbe: #6c757d;
}

/* ========================================
   DASHBOARD TILE ANIMATIONS & EFFECTS
   ======================================== */

/* Dashboard-spezifische Styles */
.dashboard-tile {
    transition: all 0.3s ease;
    cursor: pointer;
}

/* Status-Cards - kompakt, Text oben */
.dashboard-stat-compact {
    max-height: 58px;
}
.dashboard-stat-compact .card-body {
    padding: 0.25rem 0.4rem !important;
}
.dashboard-stat-compact .fs-6 {
    font-size: 0.95rem !important;
}

/* Menu-Kacheln - reduzierte Höhe */
.dashboard-tile-compact {
    max-height: 88px;
    min-height: 72px;
}
.dashboard-tile-compact .card-body {
    padding: 0.35rem 0.45rem !important;
}
.dashboard-tile-compact .dashboard-icon i {
    font-size: 1.15rem !important;
}
.dashboard-tile-compact .card-title {
    font-size: 0.78rem !important;
    line-height: 1.15;
}
.dashboard-tile-desc {
    font-size: 0.68rem !important;
    line-height: 1.1;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dashboard-tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 68, 170, 0.2) !important;
}

.dashboard-tile.disabled-tile {
    opacity: 0.5;
    cursor: not-allowed;
}

.dashboard-tile.disabled-tile:hover {
    transform: none;
    box-shadow: none !important;
}

.dashboard-icon {
    transition: transform 0.3s ease;
}

.dashboard-tile:hover .dashboard-icon {
    transform: scale(1.1);
}

/* Responsive Anpassungen für Dashboard */
@media (max-width: 768px) {
    .dashboard-tile {
        margin-bottom: 1rem;
    }
    
    .dashboard-icon i {
        font-size: 2rem !important;
    }
}

/* ========================================
   TAB-CARDS (Dokumente)
   ======================================== */

/* Tab-Pane: Abgerundete Ecken unten und oben rechts */
.tab-pane {
    border-bottom-left-radius: 0.5rem !important;
    border-bottom-right-radius: 0.5rem !important;
    border-top-right-radius: 0.5rem !important;
    margin-top: 0px !important;
    padding: 20px !important;
    padding-bottom: 5px !important;
    min-height: calc(100vh - 250px) !important;
    overflow: visible !important;
}

/* Jahres-Button Container */
.tab-pane .d-flex.gap-2 {
    padding-top: 5px !important;
    margin-left: 10px !important;
    margin-right: 10px !important;
}

/* Alle Inhalte in Tab-Panes: Links/Rechts 10px */
.tab-pane > * {
    margin-left: 10px !important;
    margin-right: 10px !important;
}

/* Tabelle in Tab-Panes: Schmaler, kein Schatten */
.tab-pane .table {
    margin-left: 10px !important;
    margin-right: 10px !important;
    margin-bottom: 5px !important;
    box-shadow: none !important;
}

/* Kein Schatten bei Tabellen-Container */
.tab-pane .table-responsive {
    box-shadow: none !important;
    overflow: visible !important;
}

/* Filter, Suche, Ergebnisse in Tab-Panes */
.tab-pane .form-control,
.tab-pane .form-select,
.tab-pane .text-muted,
.tab-pane .alert {
    margin-left: 10px !important;
    margin-right: 10px !important;
}

/* Paginierung in Tab-Panes */
.tab-pane .pagination,
.tab-pane nav[aria-label] {
    margin-bottom: 5px !important;
}

/* Kein Hover-Schatten in Tab-Panes */
.tab-pane .table-hover tbody tr:hover td {
    box-shadow: none !important;
    transform: none !important;
}

/* Dokumente (page=1022): Card-Hoehe ueber --dokumente-karte-abzug (nach globalen .tab-pane-Regeln) */
.card-dokumente.card-objektliste {
    height: calc(100vh - var(--dokumente-karte-abzug)) !important;
    max-height: calc(100vh - var(--dokumente-karte-abzug)) !important;
    overflow: hidden !important;
}

.card-dokumente.card-objektliste .card-body {
    min-height: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
}

.card-dokumente .tab-content {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.card-dokumente .tab-pane {
    min-height: 0 !important;
    height: auto !important;
    padding: 10px !important;
    padding-bottom: 5px !important;
    overflow: hidden !important;
}

.card-dokumente .tab-pane .d-flex.gap-2 {
    padding-top: 0 !important;
}

/* Kopfzeile: Jahres-Buttons + obere Paginierung (vom Tabellen-margin nicht mitziehen lassen) */
.card-dokumente .dokumente-liste-kopf {
    flex-shrink: 0;
    position: relative;
    z-index: 5;
    background-color: #fff;
    margin-bottom: 0 !important;
}

.card-dokumente .dokumente-liste-kopf .d-flex.justify-content-end.mb-0 {
    margin-top: -35px !important;
    margin-bottom: 0 !important;
}

/* Tabelle tiefer; obere Paginierung unveraendert */
.card-dokumente .tab-pane .table-responsive {
    margin-top: 0 !important;
}

/* Untere Paginierung nach oben */
.card-dokumente .tab-pane .d-flex.justify-content-center.mt-1 {
    margin-top: -20px !important;
}

/*
 * ## WARUM: Auf dem Handy ist die Viewport-Hoehe kleiner als die Tabellen+Tabs.
 * Feste Card-Hoehe + overflow:hidden schneidet den Inhalt ab und blockiert
 * den Seiten-Scroll (Debug 20.08.2026: Desktop passte noch, Mobile nicht).
 * Mobile inkl. iPad Air (bis 1199.98px): Card waechst mit, Seite scrollt normal.
 * Desktop ab 1200px unveraendert.
 * Horizontal: .tab-pane .table-responsive hat overflow:visible – deshalb
 * hier overflow-x:auto, damit breite Tabellen nach rechts wischbar bleiben.
 */
@media (max-width: 1199.98px) {
    .card-dokumente.card-objektliste {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .card-dokumente.card-objektliste .card-body {
        overflow: visible !important;
        flex: none !important;
        min-height: 0 !important;
    }

    .card-dokumente .tab-content {
        overflow: visible !important;
        flex: none !important;
        min-height: 0 !important;
    }

    .card-dokumente .tab-pane {
        overflow: visible !important;
    }

    .card-dokumente .tab-pane .table-responsive {
        overflow-x: auto !important;
        overflow-y: visible !important;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        touch-action: pan-x pan-y;
    }
}

/* ========================================
   TICKET DETAILS PAGE (page=10005)
   ======================================== */

/* Bilder in E-Mail-Signaturen begrenzen */
.card-body .card-text img {
    max-width: 200px !important;
    height: auto !important;
}

/* Card mit Messages nur so lang wie nötig - überschreibt globale min-height */
/* Gilt für ALLE Cards auf der Ticket-Details-Seite (erkennbar an .ticket Element) */
body:has(.ticket) .card > .card-body {
    min-height: auto !important;
    padding: 0.5rem !important;
}

/* Inhalts-Cards ohne Viewport-Mindesthöhe (z. B. Notizen unter Detail-Layouts) */
.card.card-inhalt-auto > .card-body {
    min-height: 0 !important;
    padding: 0.75rem 1rem !important;
}

/* ========================================
   Vertragsformular Edit/New – Zweispaltig
   ======================================== */
.vertrag-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
    align-items: start;
}
.vertrag-edit-voll {
    grid-column: 1 / -1;
}
.vertrag-edit-notizen {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 15% minmax(0, 1fr);
    column-gap: 1rem;
    align-items: start;
}
.vertrag-edit-grid .form-floating-modern label {
    position: absolute !important;
    top: 0 !important;
    left: 0.75rem !important;
    transform: translateY(-50%) !important;
    z-index: 5 !important;
    pointer-events: none !important;
    background-color: #ffffff !important;
}
.vertrag-edit-grid .form-floating-modern .form-select,
.vertrag-edit-grid .form-floating-modern .form-control {
    position: relative !important;
    z-index: 1 !important;
}
#gegenstand-display-table td.text-center {
    white-space: nowrap;
}

/* ========================================
   Mietvertrags-Modals (Custom, ohne .modal-modern)
   Header / Body / Footer brauchen eigene Abstände
   ======================================== */
#newRenterModal,
#viewRenterModal,
#duplicateRenterModal,
#amendmentNewRenterModal {
    overflow: hidden;
    max-height: 90vh;
}

#newRenterModal .modal-header,
#viewRenterModal .modal-header,
#duplicateRenterModal .modal-header,
#amendmentNewRenterModal .modal-header {
    padding: 0.75rem 1.5rem !important;
    margin: 0 !important;
}

#newRenterModal .modal-body,
#viewRenterModal .modal-body,
#duplicateRenterModal .modal-body,
#amendmentNewRenterModal .modal-body {
    padding: 1.25rem 1.5rem !important;
    margin: 0 !important;
    overflow-y: auto;
    max-height: calc(90vh - 8rem);
}

#newRenterModal .modal-footer,
#viewRenterModal .modal-footer,
#duplicateRenterModal .modal-footer,
#amendmentNewRenterModal .modal-footer {
    padding: 0.75rem 1.5rem !important;
    margin: 0 !important;
    gap: 0.5rem;
    border-top: 1px solid #dee2e6;
}

#newRenterModal .modal-body .row,
#viewRenterModal .modal-body .row,
#amendmentNewRenterModal .modal-body .row {
    --bs-gutter-x: 1.5rem;
    margin-left: calc(var(--bs-gutter-x) * -0.5);
    margin-right: calc(var(--bs-gutter-x) * -0.5);
}

#newRenterModal .modal-body .row > [class*="col-"],
#viewRenterModal .modal-body .row > [class*="col-"],
#amendmentNewRenterModal .modal-body .row > [class*="col-"] {
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    padding-right: calc(var(--bs-gutter-x) * 0.5);
}

#newRenterModal .modal-body h6,
#viewRenterModal .modal-body h6,
#amendmentNewRenterModal .modal-body h6 {
    margin-top: 0.25rem !important;
    margin-bottom: 1rem !important;
    padding-bottom: 0.35rem !important;
}

#newRenterModal .form-floating-modern,
#viewRenterModal .form-floating-modern,
#amendmentNewRenterModal .form-floating-modern {
    margin-bottom: 1rem !important;
}

#newGegenstandModal > div,
#amendmentNewGegenstandModal > div {
    padding: 1.25rem 1.5rem !important;
}

/* Gegenstandsliste (Vertrag + Nachtrag + Mietanpassung): Aktions-Buttons – weiß, blaue Schrift, kein Rahmen */
#gegenstand-display-table .btn-gegenstand-aktion,
#gegenstand-display-table .btn-gegenstand-aktion:disabled,
#amendment_gegenstand_display_table .btn-gegenstand-aktion,
#amendment_gegenstand_display_table .btn-gegenstand-aktion:disabled,
#rent_adj_gegenstand-display-table .btn-gegenstand-aktion,
#rent_adj_gegenstand-display-table .btn-gegenstand-aktion:disabled {
    background-color: #ffffff !important;
    color: #0044aa !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0.1rem 0.35rem !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
}
#gegenstand-display-table .btn-gegenstand-aktion:hover:not(:disabled),
#gegenstand-display-table .btn-gegenstand-aktion:focus:not(:disabled),
#gegenstand-display-table .btn-gegenstand-aktion:active:not(:disabled),
#amendment_gegenstand_display_table .btn-gegenstand-aktion:hover:not(:disabled),
#amendment_gegenstand_display_table .btn-gegenstand-aktion:focus:not(:disabled),
#amendment_gegenstand_display_table .btn-gegenstand-aktion:active:not(:disabled),
#rent_adj_gegenstand-display-table .btn-gegenstand-aktion:hover:not(:disabled),
#rent_adj_gegenstand-display-table .btn-gegenstand-aktion:focus:not(:disabled),
#rent_adj_gegenstand-display-table .btn-gegenstand-aktion:active:not(:disabled) {
    background-color: #eef3fb !important;
    color: #003388 !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}
#gegenstand-display-table .gegenstand-aktionen,
#amendment_gegenstand_display_table .gegenstand-aktionen,
#rent_adj_gegenstand-display-table .gegenstand-aktionen {
    display: inline-flex;
    gap: 0.25rem;
    justify-content: center;
    align-items: center;
}
#gegenstand-display-table td.text-center,
#amendment_gegenstand_display_table td.text-center,
#rent_adj_gegenstand-display-table td.text-center {
    white-space: nowrap;
}

/* Mietanpassung: Tabelle „Mieten anpassen“ – hell/bedienbar (überschreibt globales Blau + table-sm padding:0) */
.rent-adj-miet-wrap {
    box-shadow: none !important;
    border-radius: 0.375rem !important;
}
#rent_adj_mietanpassung_tabelle.table-bordered {
    border: 1px solid #dee2e6 !important;
    border-radius: 0.375rem !important;
}
#rent_adj_mietanpassung_tabelle.table-bordered th,
#rent_adj_mietanpassung_tabelle.table-bordered td {
    border-color: #e9ecef !important;
}
#rent_adj_mietanpassung_tabelle thead th {
    background: #f8f9fa !important;
    color: #212529 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    height: auto !important;
    padding: 0.5rem 0.6rem !important;
    border-bottom: 1px solid #dee2e6 !important;
    border-radius: 0 !important;
}
#rent_adj_mietanpassung_tabelle.table-sm th,
#rent_adj_mietanpassung_tabelle.table-sm td {
    padding: 0.25rem 0.4rem !important;
    vertical-align: middle !important;
}
#rent_adj_mietanpassung_tabelle tbody tr:hover td {
    transform: none !important;
    box-shadow: none !important;
    background-color: #f8fafc !important;
}
#rent_adj_mietanpassung_tabelle tfoot th {
    background: #f1f3f5 !important;
    color: #212529 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-size: 0.8125rem !important;
    height: auto !important;
    padding: 0.35rem 0.4rem !important;
    border-radius: 0 !important;
}
/* WARUM: Globales .input-group .input-group-text { height: 3.5rem } macht Tabellen-Inputs riesig */
#rent_adj_mietanpassung_tabelle .rent-adj-col-eingabe,
#rent_adj_mietanpassung_tabelle .rent-adj-zelle-eingabe {
    width: 8.25rem;
    max-width: 8.25rem;
    white-space: nowrap;
}
#rent_adj_mietanpassung_tabelle .rent-adj-zelle-eingabe {
    text-align: right !important;
}
#rent_adj_mietanpassung_tabelle .rent-adj-input-group {
    display: inline-flex !important;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 8.25rem;
    margin-left: auto;
    vertical-align: middle;
}
#rent_adj_mietanpassung_tabelle .rent-adj-input-group .form-control,
#rent_adj_mietanpassung_tabelle .rent-adj-input-group .form-control-sm {
    border-color: #ced4da !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0.15rem 0.35rem !important;
    font-size: 0.8125rem !important;
    line-height: 1.2 !important;
    min-width: 0 !important;
}
#rent_adj_mietanpassung_tabelle .rent-adj-input-group .input-group-text {
    background-color: #f8f9fa !important;
    border-color: #ced4da !important;
    color: #6c757d !important;
    font-weight: 400 !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0.15rem 0.35rem !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
}

/* NK-Anpassung: Kategorientabelle – analog Mietanpassung */
.utility-adj-miet-wrap {
    box-shadow: none !important;
    border-radius: 0.375rem !important;
}
#utility_adj_kategorien_tabelle.table-bordered {
    border: 1px solid #dee2e6 !important;
    border-radius: 0.375rem !important;
}
#utility_adj_kategorien_tabelle.table-bordered th,
#utility_adj_kategorien_tabelle.table-bordered td {
    border-color: #e9ecef !important;
}
#utility_adj_kategorien_tabelle thead th {
    background: #f8f9fa !important;
    color: #212529 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-size: 0.8125rem !important;
    font-weight: 600 !important;
    height: auto !important;
    padding: 0.5rem 0.6rem !important;
    border-bottom: 1px solid #dee2e6 !important;
    border-radius: 0 !important;
}
#utility_adj_kategorien_tabelle.table-sm th,
#utility_adj_kategorien_tabelle.table-sm td {
    padding: 0.25rem 0.4rem !important;
    vertical-align: middle !important;
}
#utility_adj_kategorien_tabelle tbody tr:hover td {
    transform: none !important;
    box-shadow: none !important;
    background-color: #f8fafc !important;
}
#utility_adj_kategorien_tabelle tfoot th {
    background: #f1f3f5 !important;
    color: #212529 !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    font-size: 0.8125rem !important;
    height: auto !important;
    padding: 0.35rem 0.4rem !important;
    border-radius: 0 !important;
}
/* WARUM: Kompakte Tabellen-Inputs – globales form-control wäre zu hoch */
#utility_adj_kategorien_tabelle .form-control,
#utility_adj_kategorien_tabelle .form-control-sm,
#utility_adj_kategorien_tabelle .form-select,
#utility_adj_kategorien_tabelle select.form-control-sm {
    border-color: #ced4da !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0.15rem 0.35rem !important;
    font-size: 0.8125rem !important;
    line-height: 1.2 !important;
}
#utility_adj_kategorien_tabelle .text-end .form-control,
#utility_adj_kategorien_tabelle .text-end .form-control-sm,
#utility_adj_kategorien_tabelle td.text-end {
    text-align: right !important;
}
#utility_adj_kategorien_tabelle .utility-adj-input-group {
    display: inline-flex !important;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 8.25rem;
    margin-left: auto;
    vertical-align: middle;
}
#utility_adj_kategorien_tabelle .utility-adj-input-group .form-control,
#utility_adj_kategorien_tabelle .utility-adj-input-group .form-control-sm {
    border-color: #ced4da !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0.15rem 0.35rem !important;
    font-size: 0.8125rem !important;
    line-height: 1.2 !important;
    min-width: 0 !important;
}
#utility_adj_kategorien_tabelle .utility-adj-input-group .input-group-text {
    background-color: #f8f9fa !important;
    border-color: #ced4da !important;
    color: #6c757d !important;
    font-weight: 400 !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0.15rem 0.35rem !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
}
/* WARUM: Globales .input-group .input-group-text { height: 3.5rem } – Neue Betriebskosten kompakt */
.utility-adj-input-group {
    flex-wrap: nowrap;
}
.utility-adj-input-group .form-control,
.utility-adj-input-group .form-control-sm {
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0.15rem 0.35rem !important;
    font-size: 0.8125rem !important;
    line-height: 1.2 !important;
}
.utility-adj-input-group .input-group-text {
    background-color: #f8f9fa !important;
    border-color: #ced4da !important;
    color: #6c757d !important;
    font-weight: 400 !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    padding: 0.15rem 0.35rem !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
}

/* Nachträge-Tabelle (Vertragsansicht): kompakte Spalten, Icon-Links, scrollbare Beschreibung */
.nachtrag-col-gueltig-ab,
.nachtrag-col-aktionen {
    width: 1%;
    white-space: nowrap;
    vertical-align: middle;
}
.nachtrag-aktion-link {
    display: inline-block;
    margin-right: 0.4rem;
    text-decoration: none;
    border: none;
    background: none;
    padding: 0;
    line-height: 1;
}
.nachtrag-aktion-link:last-child {
    margin-right: 0;
}
.nachtrag-aktion-link:hover {
    opacity: 0.75;
}
.nachtrag-beschreibung-scroll {
    max-height: 12rem;
    overflow-y: auto;
}

@media (max-width: 767.98px) {
    .vertrag-edit-grid {
        grid-template-columns: 1fr;
    }
    .vertrag-edit-notizen {
        grid-template-columns: 1fr;
    }
}

/* Abstand Card->Table oben kleiner */
.card-body .table-responsive {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* Ticket-Titelleiste */
.ticket {
    background-color: #0044aa !important;
    border-color: #003388 !important;
    color: #ffffff !important;
    padding: 3px 10px !important;
    border-radius: 5px !important;
}

/* Submenu-Bereich */
.submenu {
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 5px !important;
    padding: 8px 10px !important;
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
}

.submenu ul {
    display: flex !important;
    align-items: center !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.submenu ul li {
    margin: 0 !important;
    padding: 0 8px !important;
    border-right: 1px solid #ccc !important;
    list-style: none !important;
}

.submenu ul li:last-child {
    border-right: none !important;
}

.submenu ul li:first-child {
    padding-left: 0 !important;
}

.submenu form {
    display: inline-block !important;
    margin: 0 !important;
    vertical-align: middle !important;
    padding: 0 8px !important;
    border-left: 1px solid #ccc !important;
}

.submenu form:first-of-type {
    border-left: 1px solid #ccc !important;
}

.submenu .dropdown {
    display: inline-block !important;
    margin: 0 !important;
    position: relative !important;
}

.submenu ul li a {
    color: #333 !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    display: inline-block !important;
}

.submenu ul li a:hover {
    color: #000 !important;
    text-decoration: none !important;
}

.submenu .dropdown-toggle {
    color: #333 !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    text-decoration: none !important;
    font-size: 14px !important;
}

.submenu .dropdown-toggle:hover {
    color: #000 !important;
    text-decoration: none !important;
}

.submenu .dropdown-toggle::after {
    margin-left: 6px !important;
}

/* Dropdown-Menü im Submenu - überschreibt globale Dropdown-Styles */
.submenu .dropdown-menu,
.submenu .dropdown .dropdown-menu,
#communicationDropdown + .dropdown-menu {
    --bs-dropdown-bg: #ffffff !important;
    --bs-dropdown-border-color: #dee2e6 !important;
    --bs-dropdown-color: #333 !important;
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
    padding: 0.5rem 0 !important;
}

.submenu .dropdown-menu .dropdown-item,
#communicationDropdown + .dropdown-menu .dropdown-item {
    color: #333 !important;
    background-color: transparent !important;
    padding: 0.5rem 1rem !important;
}

.submenu .dropdown-menu .dropdown-item:hover,
#communicationDropdown + .dropdown-menu .dropdown-item:hover {
    background-color: #f8f9fa !important;
    color: #000 !important;
}

.submenu button[type='submit'] {
    background-color: #0044aa !important;
    color: #ffffff !important;
    border: 1px solid #0044aa !important;
    padding: 4px 12px !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    text-transform: none !important;
}

.submenu button[type='submit']:hover {
    background-color: #003388 !important;
    border-color: #003388 !important;
}

.submenu select {
    padding: 4px 12px !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    background-color: #ffffff !important;
    min-height: 32px !important;
}

/* Ticket: Verschieben / Übernehmen deutlich kennzeichnen */
.submenu .ticket-aktion-gruppe {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-left: 0.5rem !important;
    padding-left: 0.5rem !important;
    border-left: 1px solid #ccc !important;
}

.submenu .ticket-aktion-form {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    border-left: none !important;
    padding: 0 !important;
}

.submenu .ticket-aktion-label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.3rem !important;
    margin: 0 !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    color: #0044aa !important;
    white-space: nowrap !important;
}

.submenu .ticket-aktion-btn-uebernehmen {
    background-color: #198754 !important;
    border-color: #198754 !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

.submenu .ticket-aktion-btn-uebernehmen:hover {
    background-color: #157347 !important;
    border-color: #157347 !important;
}

/* Objektauswahl-Rahmen */
.row.py-0.px-1.my-1.mx-0.border.rounded {
    padding: 15px 15px 8px 15px !important;
    margin: 10px 0 !important;
    background-color: #f8f9fa !important;
    border-radius: 5px !important;
}

.row.py-0.px-1.my-1.mx-0.border.rounded select {
    background-color: #ffffff !important;
    color: #333 !important;
    border: 1px solid #ced4da !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
}

.row.py-0.px-1.my-1.mx-0.border.rounded label {
    color: #333 !important;
    font-weight: 500 !important;
}

/* Modal #closedirectModal - Spezifische Anpassungen */
#closedirectModal .modal-footer {
    justify-content: flex-start !important;
    padding: 1rem 1rem 1rem 0 !important;
    margin-left: 1rem !important;
}

#closedirectModal .btn-close {
    display: none !important;
}

#closedirectModal .btn-close-no {
    background: #6c757d !important;
    border: 1px solid #6c757d !important;
    color: #ffffff !important;
}

#closedirectModal .btn-close-no:hover {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
}

#closedirectModal .btn-close-yes {
    background-color: #0044aa !important;
    border: 1px solid #0044aa !important;
    color: #ffffff !important;
}

#closedirectModal .btn-close-yes:hover {
    background-color: #003388 !important;
    border-color: #003388 !important;
}

#closedirectModal button::before,
#closedirectModal button::after,
#closedirectModal button i {
    display: none !important;
}

/* Card-Header Buttons mit weißem Rand */
.card-header .btn {
    border: 1px solid white !important;
}

/* Card-Header Links weiß */
.card-header .btn-link.btn-menu,
.card-header a.btn-link.btn-menu {
    color: #ffffff !important;
    text-decoration: none !important;
}

.card-header .btn-link.btn-menu:hover,
.card-header a.btn-link.btn-menu:hover {
    color: #e0e0e0 !important;
}

.card-header span {
    color: #ffffff !important;
}

/* Modal Labels - kompakte Darstellung */
.modal-modern .form-floating label,
.modal-body-modern .form-floating label,
.modal-modern .form-floating > label,
.modal-body-modern .form-floating > label {
    font-size: 11px !important;
    padding: 0 4px !important;
    line-height: 1 !important;
    background-color: #ffffff !important;
    display: inline-block !important;
    height: auto !important;
    max-height: 13px !important;
    top: 2px !important;
    left: 8px !important;
}

/* Modal Input/Select/Textarea - kompakter */
.modal-modern .form-floating > .form-control,
.modal-body-modern .form-floating > .form-control,
.modal-modern .form-floating > .form-select,
.modal-body-modern .form-floating > .form-select {
    height: calc(2rem + 2px) !important;
    min-height: calc(2rem + 2px) !important;
    padding: 0.375rem 0.75rem !important;
    font-size: 14px !important;
}

.modal-modern .form-floating > textarea.form-control,
.modal-body-modern .form-floating > textarea.form-control {
    height: auto !important;
    min-height: auto !important;
}

/* Modal Input-Group-Text (Labels bei showInput) */
.modal-modern .md-form.input-group .col .input-group-text.md-addon,
.modal-body-modern .md-form.input-group .col .input-group-text.md-addon,
.modal-modern .md-form .input-group-text,
.modal-body-modern .md-form .input-group-text,
.modal-modern .input-group .col span.input-group-text,
.modal-body-modern .input-group .col span.input-group-text {
    padding: 6px 8px !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Rich Text Editor Branding komplett ausblenden */
.tox-promotion,
.tox-statusbar__branding,
.tox .tox-statusbar a {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Datei-Upload wie auf page=1022 */
.modal-modern .custom-file,
.modal-body-modern .custom-file,
.custom-file {
    position: relative !important;
    display: inline-block !important;
    width: 100% !important;
    height: calc(1.5em + 0.75rem + 2px) !important;
    margin-bottom: 0 !important;
}

.modal-modern .custom-file-input,
.modal-body-modern .custom-file-input,
.custom-file-input {
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
    height: calc(1.5em + 0.75rem + 2px) !important;
    margin: 0 !important;
    opacity: 0 !important;
}

.modal-modern .custom-file-label,
.modal-body-modern .custom-file-label,
.custom-file-label {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    z-index: 1 !important;
    height: calc(1.5em + 0.75rem + 2px) !important;
    padding: 0.375rem 0.75rem !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    color: #495057 !important;
    background-color: #fff !important;
    border: 1px solid #ced4da !important;
    border-radius: 0.25rem !important;
}

/* Modal Abbrechen-Button (value=0) GRAU statt BLAU - überschreibt btn-primary */
.modal-modern .modal-footer button.btn-primary[value='0'],
.modal-modern .modal-footer button[type='submit'][value='0'],
.modal-modern .modal-footer button[type='button'][value='0'],
.modal-modern .modal-footer button[name='save'][value='0'],
.modal-modern button.btn[value='0'],
.modal-modern button[value='0'] {
    background: #6c757d !important;
    background-color: #6c757d !important;
    background-image: none !important;
    border: 1px solid #6c757d !important;
    color: #ffffff !important;
    transform: none !important;
    box-shadow: none !important;
}

.modal-modern .modal-footer button.btn-primary[value='0']:hover,
.modal-modern .modal-footer button[type='submit'][value='0']:hover,
.modal-modern .modal-footer button[type='button'][value='0']:hover,
.modal-modern .modal-footer button[name='save'][value='0']:hover,
.modal-modern button.btn[value='0']:hover,
.modal-modern button[value='0']:hover {
    background: #5a6268 !important;
    background-color: #5a6268 !important;
    background-image: none !important;
    border-color: #545b62 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* ========================================
   3-SPALTIGES LAYOUT (invoice_exam, invoiceLastcheck)
   ======================================== */

/* Container für 3-spaltige Layouts */
.container {
    display: block !important;
    white-space: nowrap;
    margin-right: 5px !important;
    width: 100%;
    max-width: 100%;
    padding: 0;
}

/* Bootstrap col-12 überschreiben wenn es 3-spaltige Areas enthält */
.container.col-12 {
    display: block !important;
    flex: none !important;
    max-width: 100% !important;
    width: 100% !important;
}

/* Bootstrap Container-Fluid: 20px Abstand zum Rand; Abstand unter Header via body padding-top */
main .container-fluid {
    padding-left: 20px !important;
    padding-right: 20px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
}

main .container-fluid > .row:first-child,
main .container-fluid > .card-modern:first-child {
    margin-top: 0;
}

/* Area Basis-Styles */
.area {
    display: inline-block !important;
    vertical-align: top;
    overflow-y: auto;
    overflow-x: hidden;
    margin-right: 0;
    box-sizing: border-box;
}

/* Linke Spalte */
.area_left {
    width: 23%;
    overflow-y: auto;
    overflow-x: hidden;
    margin-right: 5px;
}

/* Mittlere Spalte */
.area_center {
    width: 40%;
    overflow-y: auto;
    overflow-x: hidden;
    margin-right: 5px;
}

/* Rechte Spalte */
.area_right {
    width: 35.5%;
    overflow-y: auto;
    overflow-x: hidden;
}

/* ========================================
   VERGLEICHSFELDER MODERN (page=11000: Rechnungsvorprüfung)
   Zwei form-floating-modern-Boxen nebeneinander mit Kopier-Pfeil
   und farblicher Abweichungs-Kennzeichnung.
   ======================================== */
.compare-field-modern {
    margin-bottom: 0px;
}

.compare-field-modern .form-floating-modern {
    margin-bottom: 0;
}

/* Kompaktere Feldhöhe nur innerhalb der Vergleichsfelder (Allgemein/Rechnungsdaten
   auf page=11000) - die globale .form-floating-modern-Basisklasse (page=1000 etc.)
   bleibt bewusst unveraendert. */
.compare-field-modern .form-floating-modern .form-control {
    height: 32px;
    padding: 0.55rem 0.6rem 0.15rem;
    font-size: 0.875rem;
}

/* Textareas in compare-field-modern (Mail-Text, Kommentare) duerfen die
   kompakte 32px-Input-Hoehe NICHT erben - sonst ist nur die erste Zeile
   sichtbar. Spezifitaet muss ueber .compare-field-modern .form-control liegen. */
.compare-field-modern .form-floating-modern textarea.form-control {
    height: auto !important;
    min-height: 12.5rem;
    padding: 1.35rem 0.75rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.35;
    resize: vertical;
}

/* Mail-Text bei Zurueckweisung: genug Platz fuer die gesamte Vorlage */
#examAccordion #mail_text {
    min-height: 16rem !important;
}

/* Select-Felder (Objekt, Rg-Empfänger) bekamen bisher weiterhin die globale
   Höhe von 42px (.form-floating-modern .form-select), da obige Regel nur
   .form-control betrifft - hier dieselbe kompakte Höhe wie bei den
   Input-Feldern ergänzt. */
.compare-field-modern .form-floating-modern .form-select {
    height: 32px;
    padding: 0.3rem 2.25rem 0.15rem 0.6rem;
    font-size: 0.875rem;
}

.compare-field-modern .form-floating-modern label {
    font-size: 0.7rem;
}

.compare-field-copy-col {
    padding-left: 0;
    padding-right: 0;
}

.compare-field-copy {
    cursor: pointer;
    color: #0044aa;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.compare-field-copy:hover {
    color: #003380;
}

.compare-field-modern .form-floating-modern.compare-field-mismatch .form-control {
    border-color: #dc3545;
}

.compare-field-modern .form-floating-modern.compare-field-mismatch label {
    color: #dc3545;
}

.compare-field-modern .form-floating-modern.compare-field-auto .form-control {
    border-color: #fd7e14;
}

.compare-field-modern .form-floating-modern.compare-field-auto label {
    color: #fd7e14;
}

/* ========================================
   AKKORDEON-HEADER KOMPAKT (page=11000: Dokumentdaten-Karten
   Allgemein/Rechnungsdaten/Zahldaten/Zurückweisung/Bemerkung/Freigabe)
   Nur Beschriftung in Weiß, kein Link-Look (keine blaue Schrift/
   Unterstreichung), kein Rahmen, geringere Höhe als Standard-Card-Header.
   Wichtig: !important nötig, da die globale .card-Regel (Rahmen/Schatten)
   und Bootstrap-Utility-Klassen (py-1 etc. im Button-Markup) selbst
   !important verwenden.
   ======================================== */
#examAccordion .card {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin-bottom: 2px !important;
}

#examAccordion .card-header {
    border-bottom: none !important;
    padding: 0.05rem 0.75rem !important;
}

#examAccordion .card-header h2 {
    font-size: 1rem;
    line-height: 1.3;
}

#examAccordion .card-header .btn-link {
    display: block !important;
    width: 100% !important;
    text-align: left;
    color: #ffffff !important;
    text-decoration: none;
    padding: 0 !important;
    font-weight: 600;
    box-shadow: none !important;
    border: none !important;
}

#examAccordion .card-header .btn-link:hover,
#examAccordion .card-header .btn-link:focus {
    color: #ffffff !important;
    text-decoration: none;
    box-shadow: none !important;
}

/* Suchfeld im Eingangskorb (page=11000) schmaler statt volle Spaltenbreite */
.invoice-search-eingangskorb {
    max-width: 220px;
    margin-top: 5px;
}

/* Reiter "Allgemein" (erste Akkordeon-Karte): 776px - 30px = 746px.
   Kein eigener Scrollbalken mehr (overflow-y entfernt) - falls der Inhalt
   höher als 746px ist, läuft er sichtbar über die Karte hinaus, statt
   abgeschnitten/gescrollt zu werden. */
#collapseshowVendorData1 .card-body {
    max-height: 746px !important;
}

/* Y-Abstand zwischen Input-/Textarea-/Radiobutton-Feldern in den Akkordeon-
   Karten (page=11000, #examAccordion) auf 0px reduziert. Bewusst auf
   #examAccordion gescoped statt die Basis-Methoden showCheckbox2()/
   showRadioButton3()/showRadioButton4() in class_select.php zu ändern, da
   diese auch auf anderen Seiten mit normalem Abstand genutzt werden. */
#examAccordion .form-check {
    margin-bottom: 6px !important;
    margin-top: -14px !important;
}

/* Radiobuttons (form-check-inline) erhalten 4px Abstand nach unten -
   nach der generischen .form-check-Regel platziert, damit sie bei
   gleicher Spezifität die Checkbox-Regel (0px) überschreibt. */
#examAccordion .form-check-inline {
    margin-bottom: 4px !important;
}

#examAccordion .row.pt-2 {
    padding-top: 0 !important;
}

#examAccordion textarea.form-control {
    margin-bottom: -4px !important;
}

/* Reiter "Rechnungsdaten" (zweite Akkordeon-Karte, showVendorData2()):
   564px + 5px = 569px. Kein eigener Scrollbalken (wie bei "Allgemein") -
   Inhalt läuft bei Bedarf sichtbar über die Karte hinaus. */
#collapseshowVendorData2 .card-body {
    max-height: 569px !important;
}

/* Reiter "Zahldaten" (showBillData()): im Gegensatz zu "Allgemein"/
   "Rechnungsdaten" hier mit echtem Scrollbalken statt sichtbarem Überlauf,
   da der Inhalt deutlich länger ist. */
#collapseshowBillData .card-body {
    max-height: 569px !important;
    overflow-y: auto !important;
}

/* Kundennummer (Reiter "Zahldaten"): kleiner Abstand nach oben */
#collapseshowBillData .compare-field-modern:has(#customer_number),
#collapseshowBillData3 .compare-field-modern:has(#customer_number) {
    margin-top: 3px !important;
}

/* Zahldatum unter Section "Rechnungswert" / Skontodatum unter "Skonto":
   mehr Y-Abstand zur Section-Überschrift (11000/11001/11006) */
#collapseshowBillData .compare-field-modern:has(#payment_date),
#collapseshowBillData3 .compare-field-modern:has(#payment_date),
#collapseshowBillData .compare-field-modern:has(#discount_pay_date),
#collapseshowBillData3 .compare-field-modern:has(#discount_pay_date) {
    margin-top: 12px !important;
}

#collapseshowBillData #invoiceValue.section-open,
#collapseshowBillData3 #invoiceValue.section-open,
#collapseshowBillData #cashDiscount.section-open,
#collapseshowBillData3 #cashDiscount.section-open,
#collapseshowBillData #deduction.section-open,
#collapseshowBillData3 #deduction.section-open,
#collapseshowBillData #paymentMethod.section-open,
#collapseshowBillData3 #paymentMethod.section-open {
    padding-top: 4px;
}

/* Unterabschnitte in Zahldaten (Rechnungswert/Abzüge/Skonto/Zahlmethode)
   - siehe toggleSection() in preExamMisc.js.
   Standardmäßig eingeklappt. Gescoped auf showBillData (11000/11001) und
   showBillData3 (11006), damit closeAllSections()-Inline-Styles mit
   !important überschrieben werden können. */
#collapseshowBillData .section-header,
#collapseshowBillData3 .section-header {
    cursor: pointer;
    user-select: none;
}

#collapseshowBillData .section-header i.fa-arrow-down,
#collapseshowBillData3 .section-header i.fa-arrow-down {
    transition: transform 0.2s ease;
}

#collapseshowBillData .section-header.section-open i.fa-arrow-down,
#collapseshowBillData3 .section-header.section-open i.fa-arrow-down {
    transform: rotate(180deg);
}

#collapseshowBillData .section-content,
#collapseshowBillData3 .section-content {
    display: none;
}

/* !important notwendig: ein alter, funktionsloser Rest-Handler in
   preExamCalc.js (greift auf [data-section] - das sind die 6
   Akkordeon-Reiter-Buttons, NICHT diese Unterabschnitte) setzt bei jedem
   Klick auf einen Akkordeon-Reiter per Inline-Style
   "document.querySelectorAll('.section-content').forEach(s => s.style.display
   = 'none')" auf ALLEN .section-content-Elementen der Seite - Inline-Styles
   haben Vorrang vor Klassen-Selektoren, ohne !important würde die
   section-open-Klasse dadurch wirkungslos bleiben. */
#collapseshowBillData .section-content.section-open,
#collapseshowBillData3 .section-content.section-open {
    display: block !important;
}

/* .custom-hr (Trennlinien in class_turm.php/class_invoice_exam.php, u. a.
   showBillData()/showSection()) war urspruenglich in assets/css/style.css
   mit 1px Abstand definiert. Diese Datei wird aber in class_site.php seit
   jeher NICHT geladen (auskommentiert, "conflicts with Bootstrap 5") -
   dadurch griff bisher der viel groessere Browser-/Bootstrap-Standard-
   Abstand fuer <hr>. Hier mit demselben, urspruenglich vorgesehenen Wert
   nachgezogen, damit die Trennlinien wieder wie gestaltet aussehen. */
.custom-hr {
    margin-top: 1px;
    margin-bottom: 1px;
    border: 0;
    border-top: 1px solid #ccc;
}
