/* Eigenes Layout und Design. Die Vendor-Dateien (MDB5, Font Awesome, Roboto) bleiben unverändert;
   Anpassungen erfolgen ausschließlich hier (CLAUDE.md, UI-Framework). */

:root {
    /* Kopf 14 px höher als die Fußleiste (Vorgabe Nutzer 16.11.2026: 10–15 px), beide schwarz */
    --aqc-navbar-height: 54px;
    --aqc-footer-height: 40px;
    --aqc-bar-bg: #000;
    --aqc-page-padding: 1rem;

    /* Primärfarbe Aquacert (Q-52) über die MDB-Variablen */
    --mdb-primary: #003DFD;
    --mdb-primary-rgb: 0, 61, 253;
}

html {
    font-family: 'Roboto', sans-serif;
}

body {
    padding-top: var(--aqc-navbar-height);
    min-height: 100vh;
}

/* ---------- Hauptnavigation: Icon über Text, aktiver Bereich hervorgehoben */
/* Feste Höhe: Aktionsleiste und Kopfzeile docken darunter an, deshalb darf die Navbar nicht von ihrem Inhalt abhängen */
#main-navbar {
    height: var(--aqc-navbar-height);
    padding-top: 0;
    padding-bottom: 0;
    background-color: var(--aqc-bar-bg);
    box-shadow: none;
}

/* Desktop: Symbole und Texte der Navigation und das Benutzermenü weiß auf Schwarz.
   Nur ab lg – darunter liegen die Einträge als Kacheln im weißen Aufklappmenü und bleiben dunkel (Regeln im Media-Block unten). */
@media (min-width: 992px) {
    #main-navbar .aqc-nav-link {
        color: #fff;
    }

    #main-navbar .aqc-nav-link:hover,
    #main-navbar .aqc-nav-link:focus-visible {
        background-color: rgba(255, 255, 255, 0.12);
        color: #fff;
    }

    #main-navbar .aqc-nav-link.active {
        background-color: rgba(255, 255, 255, 0.2);
        color: #fff;
    }
}

#main-navbar .aqc-user-toggle,
#main-navbar .aqc-user-toggle:hover,
#main-navbar .aqc-user-toggle:focus {
    color: #fff !important;
}

#main-navbar .navbar-toggler {
    color: #fff;
}

/* Symbol über Text muss in 54 px passen: Symbol groß, Text klein, wenig Innenabstand.
   !important: das Symbol trägt die Bootstrap-Klassen fs-5/mb-1, die selbst mit !important gesetzt sind (core/shell.js) */
#main-navbar .aqc-nav-link .fa-solid {
    font-size: 1.35rem !important;
    margin-bottom: 0.1rem !important;
}

#main-navbar .aqc-nav-link .small {
    font-size: 0.6875rem;
}

/* Logo mit weißem Trennstrich rechts: Abstand Logo–Strich wie Logo–linker Rand (Innenabstand von container-fluid), danach gleicher Abstand zur Navigation */
#main-navbar .navbar-brand {
    --aqc-brand-gap: calc(var(--mdb-gutter-x, 1.5rem) * 0.5);
    padding: 0 var(--aqc-brand-gap) 0 0;
    margin-right: var(--aqc-brand-gap);
    border-right: 1px solid #fff;
}

/* MDB gibt Bildern in .navbar-brand 4 px Abstand rechts – der Abstand zum Strich kommt allein aus dem Innenabstand oben */
#main-navbar .navbar-brand .aqc-navbar-logo {
    margin-right: 0;
}

/* Aufgeklapptes Hamburger-Menü (unter lg): Die Navbar hat eine feste Höhe, das Menü ragt darüber hinaus und lag deshalb ohne Hintergrund
   über dem Inhalt. Es liegt jetzt als deckende Fläche direkt unter der Navbar, Einträge als Kacheln, bei wenig Höhe scrollbar. */
@media (max-width: 991.98px) {
    #main-navbar .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        max-height: calc(100vh - var(--aqc-navbar-height));
        overflow-y: auto;
        padding: 0.75rem var(--aqc-page-padding) 1rem;
        background-color: #fff;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 0.75rem 1.5rem rgba(16, 32, 80, 0.18);
    }

    #main-menu-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
        gap: 0.5rem;
    }

    #main-menu-list .aqc-nav-link {
        padding: 0.6rem 0.25rem;
        background-color: #f4f6fb;
        color: var(--aqc-text, #212529);
    }

    #main-menu-list .aqc-nav-link.active {
        background-color: rgba(var(--mdb-primary-rgb, 0, 61, 253), 0.12);
    }

    /* Im aufgeklappten Menü klappt das Benutzermenü nach unten im Fluss auf; Popper würde es wegen der begrenzten Höhe
       nach oben über die Kacheln drehen (Inline-Styles von Popper, daher !important) */
    .aqc-user-menu {
        width: 100%;
    }

    .aqc-user-menu .dropdown-menu {
        position: static !important;
        transform: none !important;
        margin-top: 0.25rem;
        box-shadow: none;
        border: 1px solid rgba(0, 0, 0, 0.08);
    }

    #navbar-end {
        flex-wrap: wrap;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid rgba(0, 0, 0, 0.08);
    }
}

/* ---------- Benutzermenü der Navbar: Avatar mit Initialen und Name, klappt Aktualisieren/Passwort/Abmelden aus */
.aqc-user-toggle {
    font-weight: 500;
    text-transform: none;
    box-shadow: none;
}

.aqc-user-toggle:hover,
.aqc-user-toggle:focus {
    background-color: rgba(var(--mdb-primary-rgb), 0.08);
}

.aqc-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    border-radius: 50%;
    background-color: var(--mdb-primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.aqc-user-name {
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aqc-user-menu .dropdown-header {
    font-size: 0.8rem;
}

/* Versionszeile am Ende des Benutzermenüs – klein und zurückhaltend, nicht anklickbar */
.aqc-user-menu .aqc-user-version {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
}

.aqc-user-menu .aqc-user-version[data-environment="dev"] {
    color: #8a6d00;
}

.aqc-user-menu .aqc-user-version[data-environment="sbox"] {
    color: #a3175f;
}

/* Versionsnummer links vom Benutzermenü, führt zur Seite „Versionen“ (Changelog). Zurückhaltend wie eine Fußnote, aber klickbar.
   Ab lg weiß auf der schwarzen Leiste, darunter dunkel im weißen Aufklappmenü (wie die Navigationseinträge). */
.aqc-navbar-version {
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-family: var(--aq-font-mono);
    font-size: 0.8rem;
    white-space: nowrap;
    text-decoration: none;
    color: #6c757d;
}

/* Versionsnummern überall in Monospace (Navbar, Seite „Versionen“) */
.aqc-version-number {
    font-family: var(--aq-font-mono);
}

.aqc-navbar-version:hover,
.aqc-navbar-version:focus-visible {
    background-color: rgba(var(--mdb-primary-rgb), 0.08);
    color: var(--mdb-primary);
}

@media (min-width: 992px) {
    #main-navbar .aqc-navbar-version {
        color: rgba(255, 255, 255, 0.7);
    }

    #main-navbar .aqc-navbar-version:hover,
    #main-navbar .aqc-navbar-version:focus-visible {
        background-color: rgba(255, 255, 255, 0.12);
        color: #fff;
    }
}

.aqc-nav-link {
    min-width: 5rem;
    padding: 0.25rem 0.75rem;
    line-height: 1.2;
    border-radius: 0.375rem;
}

.aqc-nav-link.active {
    background-color: rgba(var(--mdb-primary-rgb, 0, 61, 253), 0.12);
    color: var(--mdb-primary, #003DFD);
    font-weight: 500;
}

/* ---------- Fußleiste (fest unten, 40 px, schwarz): Aktionen links, Metadaten rechts */
.aqc-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--aqc-footer-height);
    padding: 0 var(--aqc-page-padding);
    display: flex;
    align-items: center;
    gap: 1rem;
    background-color: var(--aqc-bar-bg);
    color: #fff;
    z-index: 1000;
}

.aqc-footer-actions {
    flex: 1 1 auto;
    margin-left: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    overflow-x: auto;
}

.aqc-footer-primary {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.aqc-footer-button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.aqc-footer-meta {
    flex: 0 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.7rem;
    line-height: 1.2;
}

.aqc-footer-meta-line {
    white-space: nowrap;
}

/* ---------- Seite */
.aqc-page {
    /* unten Platz für die feste Fußleiste */
    min-height: calc(100vh - var(--aqc-navbar-height));
    padding-bottom: var(--aqc-footer-height);
}

.aqc-page-header {
    position: sticky;
    top: var(--aqc-navbar-height);
    z-index: 900;
    padding: 0.6rem var(--aqc-page-padding);
    background-color: var(--mdb-primary, #003DFD);
    color: #fff;
}

.aqc-page-header:empty,
.aqc-page-header #page-title:empty {
    min-height: 1.5rem;
}

.aqc-page-content {
    padding: var(--aqc-page-padding);
}

/* Datatable: Sortierpfeile ↑/↓ immer sichtbar, die aktuelle Richtung in Gelb (Warnfarbe der MDB-Palette); das Einzelsymbol der MDB wird ausgeblendet */
.aqc-datatable .datatable-sort-icon {
    display: none;
}

.aqc-datatable .aqc-sort {
    /* direkt hinter der Beschriftung (steht im DOM nach dem Text) */
    display: inline-flex;
    gap: 0.15rem;
    margin-left: 0.4rem;
    font-size: 0.7rem;
    vertical-align: middle;
}

.aqc-datatable .aqc-sort i {
    color: rgba(0, 0, 0, 0.25);
}

.aqc-datatable .aqc-sort i.active {
    color: var(--mdb-warning, #ffa900);
}

/* Datatable: kontrastreichere Schrift als das helle Grau der MDB-Vorgabe; Bootstrap setzt die Farbe je Zelle (table-color) und gestreifte Zeilen erben von der Zeile: deshalb Variablen und Zellen */
.aqc-datatable
{
    --mdb-datatable-color: #1f1f1f;
    --mdb-datatable-striped-color: #1f1f1f;
    --mdb-datatable-hover-color: #1f1f1f;
}

.aqc-datatable .datatable-body > tr > td
{
    color: #1f1f1f;
}

/* Datatable: kompakte Zeilen, Kopf bleibt beim Scrollen stehen (fixedHeader) und deckt die Zeilen ab */
.aqc-datatable .datatable-body td {
    padding-top: 0.2rem;
    padding-bottom: 0.2rem;
    vertical-align: middle;
}

.aqc-datatable .datatable-body td > * {
    vertical-align: middle;
}

.aqc-datatable .datatable-header th {
    background-color: var(--mdb-body-bg, #fff);
    vertical-align: middle;
    z-index: 5;
}

/* Liste lädt nach (Sortieren, Filtern, Blättern): die alte Tabelle bleibt sichtbar, nur abgeblendet */
.aqc-list-loading {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.15s;
}

.aqc-page-loading {
    padding: 2rem;
    text-align: center;
}

/* ---------- Schmale Bildschirme (iPad hochkant, Telefon): Aktionsleiste kompakter */
@media (max-width: 767.98px) {
    :root {
            --aqc-page-padding: 0.75rem;
    }
}

/* Beschriftung über dem Feld (ui-guidelines.md, Abschnitt 4) */
.aqc-field-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    color: var(--mdb-secondary-color, #6c757d);
}

/* Einstellungen: Schalter mit halber Breite (isHalfWidth) neben einem beschrifteten Feld – oben um die Beschriftung versetzt,
   damit er auf Höhe des Eingabefelds steht; einspaltig (unter md) steht er ohne Versatz darunter */
@media (min-width: 768px) {
    .aqc-settings-switch-half {
        padding-top: 1.25rem;
    }
}

/* Icon-Buttons (createButton mit iconOnly): nur Symbol, kein Hintergrund */
.aqc-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.35rem;
    border: 0;
    background: transparent;
    color: var(--mdb-body-color, #4f4f4f); /* wie die Überschrift einer Karte */
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
.aqc-icon-btn:hover:not(:disabled),
.aqc-icon-btn:focus-visible { color: #212529; }
.aqc-icon-btn-danger:hover:not(:disabled),
.aqc-icon-btn-danger:focus-visible,
.aqc-icon-btn-success:hover:not(:disabled),
.aqc-icon-btn-success:focus-visible { opacity: 0.65; }
.aqc-icon-btn:disabled { opacity: 0.3; cursor: default; }
/* mehrere Icon-Buttons nebeneinander: enger zusammen */
.aqc-icon-btn + .aqc-icon-btn { margin-left: -0.3rem; }
/* Gesperrter Icon-Button mit Hinweis steckt in einer Hülle (Tooltip trotz pointer-events: none); sie zählt beim Zusammenrücken wie ein Button */
.aqc-icon-btn-wrap + .aqc-icon-btn,
.aqc-icon-btn + .aqc-icon-btn-wrap,
.aqc-icon-btn-wrap + .aqc-icon-btn-wrap { margin-left: -0.3rem; }
.aqc-icon-btn-danger,
.aqc-icon-btn-danger:hover:not(:disabled),
.aqc-icon-btn-danger:focus-visible { color: #dc3545; }
.aqc-icon-btn-success,
.aqc-icon-btn-success:hover:not(:disabled),
.aqc-icon-btn-success:focus-visible { color: #198754; }

/* ---------- Login: ohne Menü und Aktionsleiste */
body.aqc-no-chrome .aqc-footer,
body.aqc-no-chrome #main-menu-list,
body.aqc-no-chrome #navbar-end,
body.aqc-no-chrome #navbar-toggler {
    display: none;
}

body.aqc-no-chrome .aqc-page-header {
    display: none !important;
}

/* Anmeldung: Karte mittig auf hellem Farbverlauf, System und Version darunter */
.aqc-login {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    /* volle Höhe unter der Navbar (4,5 rem); der negative Rand hebt den Innenabstand des Inhaltsbereichs auf */
    min-height: calc(100vh - 4.5rem);
    margin: -1rem;
    padding: 2rem 1rem;
    background:
        radial-gradient(60rem 30rem at 15% 0%, rgba(0, 61, 253, 0.10), transparent 60%),
        radial-gradient(50rem 30rem at 90% 100%, rgba(0, 170, 255, 0.12), transparent 60%),
        #f4f6fb;
}

/* Ohne Aktionsleiste kein Platz für sie reservieren (sonst weißer Streifen unter der Anmeldung) */
body.aqc-no-chrome .aqc-page {
    padding-bottom: 0;
}

body .card.aqc-login-card {
    width: 100%;
    max-width: 25rem;
    border: 0;
    border-radius: 1rem;
    box-shadow: 0 1rem 2.5rem rgba(16, 32, 80, 0.12), 0 0.125rem 0.5rem rgba(16, 32, 80, 0.06);
}

.aqc-login-card .card-body {
    padding: 2.25rem 2rem 2rem;
}

.aqc-login-brand {
    text-align: center;
    margin-bottom: 1.75rem;
}

.aqc-login-brand img {
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1.25rem rgba(0, 61, 253, 0.18);
}

.aqc-login-title {
    margin: 1rem 0 0.25rem;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.aqc-login-subtitle {
    margin: 0;
    color: #6c757d;
}

/* Symbol links im Eingabefeld */
.aqc-login-input {
    position: relative;
}

.aqc-login-input > i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa3b2;
    pointer-events: none;
}

body .aqc-login-input > .form-control {
    min-height: 2.75rem;
    padding-left: 2.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
}

body .aqc-login-input > .form-control:focus + i,
.aqc-login-input:focus-within > i {
    color: var(--mdb-primary, #003DFD);
}

body .btn.aqc-login-submit {
    min-height: 2.75rem;
    margin-top: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.95rem;
}

/* Zweiter Anmeldeschritt (Authenticator-App): core/ui/totp-step.js. Bei der Einrichtung ist die Karte breiter (QR-Code und Anleitung nebeneinander) */
body .card.aqc-login-card.aqc-login-card-wide {
    max-width: 36rem;
}

.aqc-login-totp-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
}

.aqc-login-totp-steps {
    flex: 1 1 auto;
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.875rem;
}

.aqc-login-totp-steps li + li {
    margin-top: 0.5rem;
}

.aqc-login-totp-qr {
    flex: 0 0 auto;
    width: 180px;
    height: 180px;
    /* Scanner brauchen einen hellen Rand, auch wenn die Karte dunkler dargestellt wird */
    padding: 0.5rem;
    background: var(--mdb-white, #fff);
    border: 1px solid rgba(16, 32, 80, 0.1);
    border-radius: 0.5rem;
}

/* Telefon: QR-Code über der Anleitung */
@media (max-width: 575.98px) {
    .aqc-login-totp-row {
        flex-direction: column;
        align-items: center;
    }
}

.aqc-login-totp-account {
    margin-bottom: 1rem;
    text-align: center;
}

/* Direkt unter dem Kopf (Code-Eingabe ohne Einrichtung): oben derselbe Abstand wie unten, der Kopf hat sonst 1,75 rem */
.aqc-login-brand + .aqc-login-totp-account {
    margin-top: -0.75rem;
}

body .badge.aqc-login-totp-pill {
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 400;
    white-space: normal;
}

.aqc-otp {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Felder teilen sich die Breite, höchstens 3 rem je Feld: Auf schmalen Telefonen passen so alle sechs in die Karte */
body .aqc-otp .aqc-otp-digit {
    flex: 1 1 0;
    min-width: 0;
    max-width: 3rem;
    height: 3.5rem;
    padding: 0;
    font-size: 1.75rem;
    font-weight: 500;
    text-align: center;
    border-radius: 0.5rem;
}

@media (max-width: 380px) {
    body .aqc-otp .aqc-otp-digit {
        height: 3rem;
        font-size: 1.5rem;
    }
}

.aqc-login-totp-secret {
    display: block;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.aqc-login-totp-link {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.aqc-login-system {
    font-size: 0.8rem;
    color: #6c757d;
    text-align: center;
}

.aqc-login-system[data-environment="dev"] {
    color: #8a6d00;
}

.aqc-login-system[data-environment="sbox"] {
    color: #a3175f;
}

/* Tabellen in Listen */
.aqc-table th {
    white-space: nowrap;
}

/* Pool: Spaltenbeschriftung unter jeder Gruppe – flach und kleiner als der übliche Tabellenkopf */
.aqc-table tr.aqc-pool-labels th {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    font-size: 0.75rem;
    line-height: 1.2;
    font-weight: 600;
}

.aqc-table .aqc-col-xs {
    width: 6rem;
    min-width: 5rem;
}

.aqc-table .aqc-row-actions {
    white-space: nowrap;
    text-align: right;
}

/* Spalte "für Sync vormerken" in der Aufgabenübersicht */
.aqc-table .aqc-sync-col {
    width: 2.5rem;
    text-align: center;
}

/* ---------- Gruppenzeile in Listen (z. B. Anfangsbuchstabe in der Kundenliste) */
.aqc-group-row > th {
    background-color: rgba(var(--mdb-primary-rgb, 0, 61, 253), 0.08);
    color: var(--mdb-primary, #003DFD);
    font-weight: 500;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

/* Speicherstatus im Seitenbanner: ungespeichert = gelbes Signal-Label, gespeichert = weiße Schrift */
#page-save-state { color: #fff; }
#page-save-state[data-state="dirty"]
{
    padding: 0.2rem 0.75rem;
    /* Negativer Rand hebt das senkrechte Padding auf: das Label darf den Banner nicht höher machen, sonst springt die Seite beim ersten Tastendruck */
    margin-block: -0.2rem;
    border-radius: 1rem;
    background: #ffc107;
    color: #212529;
    font-weight: 700;
}
#page-save-state[data-state="dirty"]::before
{
    content: "\f071";
    font-family: "Font Awesome 6 Pro", "Font Awesome 6 Free", sans-serif;
    font-weight: 900;
    margin-right: 0.4rem;
}

/* Objekt-Stammdaten: vier Spalten; Objekt und Kunde/Hausmeister/Zugang breit, Gesundheitsamt mittel, Kündigung schmal */
.aqc-master-grid
{
    display: grid;
    gap: 0 1rem;
    grid-template-columns: 1fr;
}
@media (min-width: 992px)  { .aqc-master-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1400px) { .aqc-master-grid { grid-template-columns: 1.3fr 1.5fr 1fr 0.75fr; } }

/* ---------- Startseite: Filterkarte und Tabellenkarte voneinander abgesetzt */
.aqc-start-filter {
    background-color: var(--aqc-surface-muted, #f5f6f8);
    border: 1px solid var(--aqc-border-subtle, #e0e3e8);
    box-shadow: none;
}

/* TEST: Tabelle ohne eigene Card (kein Rahmen, kein Innenabstand), direkt unter der Filter-Card. Zurück: Rahmen wieder setzen und .card-body-Padding entfernen */
.aqc-start-table.card {
    border: 0;
    box-shadow: none;
    background: transparent;
}

.aqc-start-table.card > .card-body {
    padding: 0;
}

/* Startseitentabelle hat viele Spalten: engere Zellen, damit Sync und Details ohne Querscrollen sichtbar bleiben */
.aqc-start-table .datatable-header th,
.aqc-start-table .datatable-body td {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
}

.aqc-start-table .aqc-sort {
    margin-left: 0.4rem;
}

/* Startseite: alle Filterfelder (MDB-Select, Datum) mit weißem Hintergrund auf der hellen Filterkarte; Datumsfelder schmal */
.aqc-start-filter .select-input,
.aqc-start-filter .form-control {
    background-color: #fff !important;
}

.aqc-start-filter .aqc-date-filter {
    width: 9.5rem;
}

.aqc-start-filter .aqc-filter-select {
    width: 11.5rem;
}

.aqc-start-filter .aqc-filter-search {
    width: 18rem;
}

/* Schmale Zahlenfelder im Filter (Ticketliste) */
.aqc-start-filter .aqc-filter-number {
    width: 6.5rem;
}

/* Ticketliste: schmaleres Suchfeld, damit die Buttons in derselben Zeile bleiben */
.aqc-tickets-filter .aqc-filter-search {
    width: 14rem;
}

/* ---------- Vollbild-Rahmen (PWA): keine Navbar, keine Aktionsleiste, keine Kopfzeile; die Maske bringt ihre eigene Leiste mit */
body.aqc-standalone {
    padding-top: 0;
}

body.aqc-standalone #main-navbar,
body.aqc-standalone .aqc-footer,
body.aqc-standalone .aqc-page-header {
    display: none !important;
}

body.aqc-standalone .aqc-page {
    padding-bottom: 0;
    min-height: 100vh;
}

body.aqc-standalone .aqc-page-content {
    padding: 0;
}

/* ---------- Einstellungen: Mail-Templates (Auswahlliste, Editor mit Reitern, einschiebbare Platzhalter-Liste) */
.aqc-template-list {
    max-height: calc(100vh - 15rem);
    overflow-y: auto;
}

.aqc-template-list .list-group-item {
    cursor: pointer;
    padding: 0.35rem 1rem;
}

/* Bezeichnung einzeilig abschneiden (Titel zeigt den vollen Text); min-width: 0 lässt den Textblock im Flex-Container schrumpfen */
.aqc-template-list .aqc-template-text {
    min-width: 0;
}

.aqc-template-list .aqc-template-name {
    font-size: 0.85rem;
    line-height: 1.3;
}

.aqc-template-list .aqc-template-code {
    font-size: 0.72rem;
    line-height: 1.2;
}

.aqc-template-list .list-group-item.aqc-template-active {
    background-color: #fff6cc;
}

.aqc-template-list .list-group-item:not(.aqc-template-active):hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.aqc-template-workspace {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.aqc-template-editor {
    flex: 1 1 auto;
    min-width: 0;
}

/* Zwei Klassen: aqc-ui.css (später geladen) setzt "body textarea.form-control { height: auto }" und gewinnt sonst bei gleicher Spezifität */
body textarea.form-control.aqc-template-body,
body .aqc-template-preview {
    display: block;
    width: 100%;
    height: var(--aqc-editor-height, 62vh);
    min-height: 22rem;
    font-family: var(--bs-font-monospace, monospace);
    font-size: 0.85rem;
    resize: none;
}

.aqc-template-preview {
    border: 1px solid var(--aqc-border-subtle, #e0e3e8);
    background: #fff;
}

/* Platzhalter-Liste: schiebt sich von rechts neben den Editor, scrollt in sich */
.aqc-template-side {
    flex: 0 0 auto;
    width: 0;
    overflow: hidden;
    transition: width 0.25s ease;
}

.aqc-template-workspace.is-side-open .aqc-template-side {
    width: 23rem;
    margin-left: 1rem;
}

.aqc-template-side-inner {
    width: 23rem;
    height: calc(var(--aqc-editor-height, 62vh) + 3rem);
    min-height: 25rem;
    overflow-y: auto;
    border: 1px solid var(--aqc-border-subtle, #e0e3e8);
    border-radius: 0.5rem;
    background: var(--aqc-surface-muted, #f5f6f8);
}

.aqc-template-side-group {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.4rem 0.75rem;
    font-weight: 600;
    font-size: 0.8rem;
    background: #e9ecf1;
}

.aqc-template-tag {
    font-family: var(--bs-font-monospace, monospace);
    font-size: 0.8rem;
    word-break: break-all;
}

/* Benutzerdetail: obere Kartenreihe Personal 40 % / Login 40 % (ab xl), Kalenderkarte so breit wie beide zusammen (80 %) */
@media (min-width: 1200px) {
    .aqc-col-40 { flex: 0 0 auto; width: 40%; }
    .aqc-col-20 { flex: 0 0 auto; width: 20%; }
    .aqc-col-80 { flex: 0 0 auto; width: 80%; }
    .aqc-col-70 { flex: 0 0 auto; width: 70%; }
    .aqc-col-375 { flex: 0 0 auto; width: 37.5%; }
    .aqc-col-25 { flex: 0 0 auto; width: 25%; }
}

/* Notizen: Datum und Uhrzeit nur so breit wie ihr Inhalt samt Picker-Symbol (ab md); den Rest der Zeile nimmt der Betreff */
@media (min-width: 768px) {
    .aqc-col-date { flex: 0 0 auto; width: 11rem; }
    .aqc-col-time { flex: 0 0 auto; width: 8rem; }
}

/* Warnhinweise beim Öffnen von Objekt/Kunde: aufklappbare Zeilen (Betreff links, Notizart rechts); der Pfeil dreht sich beim Öffnen */
.aqc-alert-list { border: 1px solid var(--mdb-border-color, #e0e0e0); border-radius: .375rem; overflow: hidden; }
.aqc-alert-entry + .aqc-alert-entry { border-top: 1px solid var(--mdb-border-color, #e0e0e0); }
.aqc-alert-entry > summary { display: flex; align-items: center; gap: .5rem; padding: .6rem .75rem; cursor: pointer; list-style: none; font-weight: 500; }
.aqc-alert-entry > summary::-webkit-details-marker { display: none; }
.aqc-alert-entry > summary:hover { background: var(--mdb-tertiary-bg, #f5f5f5); }
.aqc-alert-entry[open] > summary { background: var(--mdb-tertiary-bg, #f5f5f5); }
.aqc-alert-chevron { font-size: .75rem; transition: transform .15s ease; }
.aqc-alert-entry[open] .aqc-alert-chevron { transform: rotate(90deg); }
.aqc-alert-body { padding: .5rem .75rem .75rem 2rem; }
/* Notiztext als abgesetzte Fläche in Festbreitenschrift: hebt den eigentlichen Inhalt von Datum/Erstellt ab, Einrückungen und Listen aus dem Altsystem bleiben lesbar */
.aqc-alert-text { white-space: pre-wrap; font-family: var(--bs-font-monospace, SFMono-Regular, Menlo, Consolas, monospace); font-size: .875rem; color: var(--mdb-emphasis-color, #212529);
    background: var(--mdb-secondary-bg, #f8f9fa); border: 1px solid var(--mdb-border-color, #e0e0e0); border-left: 3px solid var(--mdb-warning, #e4a11b); border-radius: .25rem; padding: .5rem .75rem; }

/* Blinkendes Icon (Warnhinweise im Seitenkopf): MDB bringt fade/pulse/tada, aber kein Blinken mit; weich über die Deckkraft statt hartem An/Aus.
   Bei „Bewegung reduzieren“ im Betriebssystem bleibt das Icon ruhig */
@keyframes aqc-blink { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
.aqc-blink { animation: aqc-blink 1.2s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .aqc-blink { animation: none; } }

/* Klickbares Badge im Seitenkopf (Warnhinweise): sieht aus wie die übrigen Badges, zeigt aber Hand und Fokusrahmen */
.aqc-badge-button { border: 0; cursor: pointer; }
.aqc-badge-button:hover { filter: brightness(.95); }
.aqc-badge-button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Register als Pills über die volle Breite: Beschriftungen nicht umbrechen (bei wenig Platz rutschen ganze Pills in die nächste Zeile) */
.nav-pills.nav-justified .nav-link {
    white-space: nowrap;
}

/* Register in Kartenoptik (Ticket-Detail): wie Kartenüberschriften; das aktive Register ist hervorgehoben, die übrigen gedämpft */
.aqc-card-tab {
    background: none;
    border: 0;
    border-bottom: 3px solid transparent;
    padding: 0 0 0.25rem;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--aqc-text-muted, #8a919c);
    cursor: pointer;
    white-space: nowrap;
}

.aqc-card-tab:hover {
    color: var(--aqc-text, #1f1f1f);
    border-bottom-color: var(--aqc-border-subtle, #e0e3e8);
}

/* Aktiv in Primärfarbe wie die Segment-Leiste der übrigen Register (aqc-ui.css), damit beide Registerarten dieselbe Sprache sprechen */
.aqc-card-tab.is-active {
    color: var(--mdb-primary);
    border-bottom-color: var(--mdb-primary);
}

/* Ticket-Detail: Register-Karte füllt die Spalte, ohne deren Höhe zu bestimmen (gleich hoch wie die Nachbarkarten, unabhängig vom aktiven Register) */
@media (min-width: 1200px) {
    .aqc-tab-fill { position: relative; }
    .aqc-tab-fill > .card { position: absolute; top: 0; right: 0.75rem; bottom: 0; left: 0.75rem; height: auto; overflow: auto; }
}

/* Schreibgeschützte Felder (z. B. Kategorie/Identkey der Mail-Templates): graue Fläche, normaler Cursor, kein Fokusrahmen */
body .form-outline .form-control.aqc-readonly,
body .form-control.aqc-readonly {
    background-color: #f0f1f3;
    color: var(--mdb-secondary-color, #6c757d);
    cursor: default;
    box-shadow: none;
}

/* Filterleiste: Zurücksetzen (rotes Icon) und Suchen (grün, nur Icon) direkt hinter dem letzten Filter; Zurücksetzen fast quadratisch (36 × 32 px), Suchen etwa 1,5-mal so breit */
body .btn.aqc-filter-reset,
body .btn.aqc-filter-submit {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

body .btn.aqc-filter-reset {
    width: 2.25rem;
}

body .btn.aqc-filter-submit {
    width: 3.5rem;
}

body .btn.aqc-filter-reset > i.fa-solid {
    color: var(--mdb-danger, #dc4c64);
}

/* Optionen (Gruppieren, nur aktive) hinter den Buttons: gleiche Höhe wie die Felder, damit Checkbox und Text mittig auf deren Linie liegen; Abstand zum Suchen-Button */
.aqc-start-filter .aqc-filter-option {
    height: var(--aqc-control-height);
    margin-left: 1rem;
}

/* Icon-Buttons neben einem Eingabefeld: Box so hoch wie das Feld, damit die Buttons in Zeilen mit align-items-end
   mittig zum Feld stehen – unabhängig von der Button-Höhe (Felder in .form-outline haben keinen Abstand nach unten) */
.aqc-field-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    height: var(--aqc-control-height);
}

/* Buttons in Formularkarten (Vorgangsmaske): gleiche Höhe wie die Eingabefelder (--aqc-control-height), Schrift und Symbol unverändert */
body .btn.aqc-btn-field {
    min-height: var(--aqc-control-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Meldungen der Dialoge: Zeilenumbrüche aus dem Text übernehmen (z. B. Versandergebnis je Empfänger) */
.modal [data-dialog-message] { white-space: pre-line; }

/* Logo in der Desktop-Navigation: Querformat mit Schriftzug (logo-header.svg, 180 × 50); Höhe fest, Breite aus dem Seitenverhältnis */
.aqc-navbar-logo {
    display: block;
    height: 45px;
    width: auto;
}

/* Kopplungscode für ein neues Gerät der Feld-App (modules/core/devices.js): groß und gut abzulesen */
.aqc-pairing-code {
    font-family: var(--mdb-font-monospace, monospace);
    font-size: 2.25rem;
    font-weight: 600;
    letter-spacing: 0.15em;
}

/* Checkbox-List-Group (createCheckboxGroup mit listGroup): MDB setzt bei list-group-light viel Abstand oben/unten; die Erklärungstexte machen die Zeilen ohnehin hoch */
.aqc-check-list-group .list-group-item {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
}

.aqc-check-list-group .list-group-item .form-check-input {
    margin-top: 0.2rem;
}

/* Einstellungen → Firma: Karte „Logo“ neben „Kontakt“ (feste Breite ab md, darunter volle Breite); Vorschau begrenzt, Seitenverhältnis bleibt */
.aqc-settings-logo-column { flex: 0 0 16rem; }
.aqc-settings-logo-column > .aqc-settings-logo-card { flex: 1 1 auto; }
@media (max-width: 767.98px) { .aqc-settings-logo-column { flex: 1 1 auto; } }
.aqc-settings-logo-preview { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 6rem; }
.aqc-settings-logo-preview img { max-width: 100%; max-height: 7rem; object-fit: contain; }

/* Gruppenzeile der Kundenliste (Anfangsbuchstabe): der einzelne Buchstabe als kräftiges Kästchen in der Primärfarbe,
   damit er beim Durchblättern sofort ins Auge fällt – ein einzelnes Zeichen ginge in der hellblauen Zeile sonst unter */
.aqc-group-row.is-letter > th .aqc-group-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.4rem;
    border-radius: var(--aqc-radius, 4px);
    background-color: var(--mdb-primary, #003DFD);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}
