:root {
    --drk-red: #e30613;
    --drk-red-dark: #b8000d;
    --text-dark: #1f2933;
    --text-muted: #6b7280;
    --bg-soft: #f4f5f7;
    --card-bg: rgba(255, 255, 255, 0.94);
    --page-bg: #eef1f5;
    --surface-bg: #ffffff;
    --surface-bg-soft: #f9fafb;
    --surface-bg-translucent: rgba(255, 255, 255, 0.94);
    --text-main: #1f2933;
    --border-soft: #e5e7eb;
    --card-shadow: 0 14px 36px rgba(15, 23, 42, 0.10);
    --sidebar-bg: #ffffff;
    --header-bg: var(--drk-red);
    --hero-overlay: linear-gradient(90deg, rgba(255,255,255,0.96) 0%, rgba(255,255,255,0.86) 46%, rgba(255,255,255,0.54) 100%);
    --chip-bg: rgba(227, 6, 19, 0.08);
    --chip-text: var(--drk-red-dark);
    --danger-accent: var(--drk-red-dark);
    --success-accent: #15803d;
    --input-bg: #ffffff;
    --table-head-bg: #f9fafb;
    --branding-background-image: url("../images/background.jpeg");
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
    --radius-lg: 26px;
    --radius-md: 18px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--text-main);
    background: var(--page-bg);
}

.login-page {
    min-height: 100vh;
    background:
        linear-gradient(120deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.28)),
        var(--branding-background-image) center center / cover no-repeat;
}

.login-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.login-card {
    width: min(430px, 100%);
    padding: 30px;
    border-radius: var(--radius-lg);
    background: rgba(18, 24, 33, 0.78);
    box-shadow: var(--shadow);
    color: #ffffff;
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.setup-card {
    width: min(680px, 100%);
}

.brand-area {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.brand-logo {
    max-width: 215px;
    width: 100%;
    height: auto;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 18px;
    padding: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.app-product-logo {
    display: block;
    object-fit: contain;
}

.org-identity,
.auth-organization {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.82rem;
    font-weight: 800;
}

.org-identity {
    font-size: clamp(1.28rem, 2vw, 1.72rem);
    line-height: 1.08;
}

.org-identity img,
.auth-organization img {
    width: 84px;
    height: 84px;
    object-fit: contain;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    padding: 8px;
}

.header-org-logo {
    width: 84px;
    height: 84px;
    max-width: 22vw;
    object-fit: contain;
}

.org-identity span {
    display: grid;
    gap: 2px;
}

.org-identity strong {
    display: block;
    color: #ffffff;
    font-size: 0.78em;
    font-weight: 900;
}

.auth-organization img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    padding: 4px;
}

.auth-organization {
    width: min(430px, 100%);
    justify-content: center;
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(18, 24, 33, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
    text-align: center;
}

.topbar-brand {
    min-width: 0;
}

.topbar-user-area {
    display: grid;
    justify-items: end;
    gap: 10px;
    flex: 0 0 auto;
}

.maintenance-organization {
    width: min(560px, 100%);
}

.maintenance-brand-area {
    margin-bottom: 18px;
}

.login-heading h1 {
    margin: 0 0 8px;
    font-size: clamp(1.7rem, 4vw, 2.2rem);
    line-height: 1.1;
}

.login-heading p {
    margin: 0 0 26px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.45;
}

.login-heading-compact {
    margin-bottom: 26px;
}

.auth-password-heading h1 {
    font-size: clamp(1.45rem, 3vw, 1.85rem);
}

.auth-password-heading p {
    font-size: 0.95rem;
    font-weight: 500;
}

.login-form {
    display: grid;
    gap: 12px;
}

.login-form label {
    font-size: 0.9rem;
    font-weight: 700;
}

.login-form input,
.login-form select {
    width: 100%;
    padding: 14px 15px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.93);
    color: var(--text-dark);
    font-size: 1rem;
}

.login-form input:focus,
.login-form select:focus {
    outline: 3px solid rgba(227, 6, 19, 0.35);
    border-color: var(--drk-red);
}

.login-form button {
    margin-top: 8px;
    padding: 15px 18px;
    border: 0;
    border-radius: 14px;
    background: var(--drk-red);
    color: #ffffff;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.login-form button:hover {
    background: var(--drk-red-dark);
    transform: translateY(-1px);
}

.login-note {
    margin: 18px 0 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.76);
    text-align: center;
}

.auth-flash-list {
    margin-bottom: 16px;
}

.setup-hint-box,
.setup-later-box {
    display: grid;
    gap: 6px;
    margin: 0 0 18px;
    padding: 14px 15px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.4;
}

.setup-hint-box strong,
.setup-later-box strong {
    color: #ffffff;
}

.setup-form {
    gap: 16px;
}

.setup-form fieldset {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
}

.setup-form legend {
    padding: 0 8px;
    color: #ffffff;
    font-weight: 900;
}

.setup-form-row {
    display: grid;
    grid-template-columns: minmax(110px, 0.6fr) minmax(0, 1.4fr);
    gap: 12px;
}

.setup-form-row label {
    display: grid;
    gap: 8px;
}

.setup-field-hint {
    margin: -4px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.86rem;
    line-height: 1.4;
}

.setup-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.setup-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.setup-optional-section {
    background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 620px) {
    .setup-form-row {
        grid-template-columns: 1fr;
    }
}

.app-page {
    min-height: 100vh;
    background: var(--page-bg);
}

.app-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 285px 1fr;
}

.sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-soft);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-shadow: 10px 0 35px rgba(15, 23, 42, 0.04);
}

.sidebar-logo {
    width: 100%;
    min-height: 118px;
    padding: 16px;
    border-radius: 20px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), var(--surface-bg-translucent));
    border: 1px solid var(--border-soft);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sidebar-logo img {
    display: block;
    width: min(100%, 230px);
    max-width: 100%;
    max-height: 104px;
    height: auto;
    object-fit: contain;
}

.sidebar-product-logo {
    aspect-ratio: auto;
}

.nav-title {
    margin: 0 0 10px;
    padding: 0 10px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.module-nav {
    display: grid;
    gap: 8px;
}

.nav-item {
    display: block;
    padding: 13px 14px;
    border-radius: 14px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    border: 1px solid transparent;
}

.nav-item:hover,
.nav-item.active {
    background: var(--chip-bg);
    color: var(--chip-text);
    border-color: rgba(227, 6, 19, 0.18);
}

.dashboard {
    padding: 28px;
    overflow-x: hidden;
}

.topbar {
    min-height: 76px;
    padding: 16px 22px;
    border-radius: 24px;
    background: var(--header-bg);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    box-shadow: var(--card-shadow);
}

.eyebrow {
    display: block;
    margin-bottom: 4px;
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.86;
}

.topbar h1 {
    margin: 0;
    font-size: clamp(1.35rem, 3vw, 2rem);
}

.logout-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 800;
    white-space: nowrap;
}

.hero-panel {
    margin-top: 22px;
    min-height: 220px;
    border-radius: var(--radius-lg);
    background:
        var(--hero-overlay),
        var(--branding-background-image) center center / cover no-repeat;
    box-shadow: var(--card-shadow);
    display: flex;
    align-items: center;
    padding: 34px;
    overflow: hidden;
}

.hero-content {
    max-width: 650px;
}

.hero-content h2 {
    margin: 0 0 12px;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.hero-content h2::after {
    content: "";
    display: block;
    width: 84px;
    height: 5px;
    margin-top: 14px;
    border-radius: 999px;
    background: var(--drk-red);
}

.hero-content p {
    margin: 20px 0 0;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.module-section {
    margin-top: 28px;
}

.module-section h2,
.info-box h2 {
    margin: 0 0 16px;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.module-card {
    min-height: 135px;
    padding: 20px;
    border-radius: var(--radius-md);
    background: var(--surface-bg-translucent);
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-soft);
    border-bottom: 6px solid var(--border-soft);
}

.module-card h3 {
    margin: 0 0 16px;
    font-size: 1.05rem;
    line-height: 1.35;
}

.module-card p {
    margin: 0;
    font-weight: 800;
}

.status-ready {
    border-bottom-color: #16a34a;
}

.status-ready p {
    color: #15803d;
}

.status-progress {
    border-bottom-color: #f59e0b;
}

.status-progress p {
    color: #b45309;
}

.overview-module-section .module-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.overview-module-section .module-card {
    min-height: 190px;
    padding: 24px;
    border: 1px solid var(--border-soft);
    border-bottom: 4px solid rgba(22, 163, 74, 0.45);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.overview-module-section .module-card h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.08rem;
    font-weight: 900;
    line-height: 1.28;
}

.overview-module-card .module-settings-kicker {
    margin: 0 0 -6px;
    color: var(--drk-red-dark) !important;
    font-size: 0.75rem;
    font-weight: 900;
    line-height: normal;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.overview-module-section .module-card p:not(.module-settings-kicker),
.overview-module-section .status-ready p:not(.module-settings-kicker) {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.55;
}

.overview-module-section .module-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 4px;
}

.overview-module-section .status-badge {
    font-size: 0.74rem;
    font-weight: 800;
    padding: 6px 9px;
}

.status-unavailable {
    border-bottom-color: #9ca3af;
}

.status-unavailable p {
    color: #6b7280;
}

.info-box {
    margin-top: 28px;
    padding: 22px 26px;
    max-width: 100%;
    overflow-wrap: anywhere;
    border-radius: var(--radius-md);
    background: var(--surface-bg);
    border-left: 7px solid var(--drk-red);
    box-shadow: var(--card-shadow);
}

.info-box p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

.overview-hero-panel,
.overview-section,
.overview-empty-note {
    border: 1px solid var(--border-soft);
    box-shadow: var(--card-shadow);
}

.overview-hero-panel {
    margin-top: 32px;
    min-height: 190px;
    border-radius: var(--radius-lg);
    padding: 30px 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: rgba(255, 255, 255, 0.76);
    overflow: hidden;
    backdrop-filter: blur(16px) saturate(126%);
    -webkit-backdrop-filter: blur(16px) saturate(126%);
}

.overview-hero-copy {
    max-width: 680px;
}

.overview-hero-copy h2 {
    margin: 6px 0 10px;
    color: var(--text-main);
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1.05;
}

.brand-wordmark-inline {
    display: inline-flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    font: inherit;
    font-weight: inherit;
    letter-spacing: 0;
    vertical-align: baseline;
}

.brand-wordmark-red {
    color: var(--drk-red);
}

.brand-wordmark-dark {
    color: var(--text-main);
}

.overview-hero-copy p:not(.module-settings-kicker) {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.55;
    max-width: 620px;
}

.overview-version-link,
.overview-quick-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    background: var(--surface-bg-translucent);
    color: var(--text-main);
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.overview-section,
.overview-empty-note {
    margin-top: 30px;
    padding: 22px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(14px) saturate(118%);
    -webkit-backdrop-filter: blur(14px) saturate(118%);
}

.overview-section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    margin-bottom: 14px;
}

.overview-section-head h2,
.overview-empty-note h2 {
    margin: 0;
    color: var(--text-main);
    font-size: 1.15rem;
}

.overview-task-list {
    display: grid;
    gap: 10px;
}

.overview-task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.90);
    color: var(--text-main);
    text-decoration: none;
}

.overview-task-item span {
    font-weight: 800;
}

.overview-task-item strong {
    color: var(--drk-red-dark);
}

.overview-readiness-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.overview-readiness-card {
    display: grid;
    gap: 6px;
    padding: 18px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.90);
}

.overview-readiness-card span,
.overview-readiness-card small {
    color: var(--text-muted);
    font-weight: 800;
}

.overview-readiness-card strong {
    color: var(--text-main);
    font-size: 1.7rem;
    line-height: 1;
}

.overview-readiness-warning {
    border-bottom: 4px solid #f59e0b;
}

.overview-readiness-ok {
    border-bottom: 4px solid #16a34a;
}

.overview-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.overview-empty-note p {
    margin: 8px 0 0;
    color: var(--text-muted);
}

.theme-liquid-glass .overview-hero-panel {
    background: rgba(255, 255, 255, 0.66);
    border-color: rgba(255, 255, 255, 0.58);
}

.theme-liquid-glass .overview-section,
.theme-liquid-glass .overview-empty-note,
.theme-liquid-glass .overview-task-item,
.theme-liquid-glass .overview-readiness-card,
.theme-liquid-glass .overview-version-link,
.theme-liquid-glass .overview-quick-link,
.theme-liquid-glass .module-toggle-group {
    background: rgba(255, 255, 255, 0.68);
    border-color: rgba(255, 255, 255, 0.54);
}

.theme-dark-command .overview-hero-panel {
    background: rgba(13, 18, 32, 0.92);
    border-color: var(--border-soft);
}

.theme-dark-command .overview-section,
.theme-dark-command .overview-empty-note,
.theme-dark-command .overview-task-item,
.theme-dark-command .overview-readiness-card,
.theme-dark-command .overview-version-link,
.theme-dark-command .overview-quick-link,
.theme-dark-command .module-toggle-group {
    background: var(--surface-bg);
    color: var(--text-main);
}

.theme-dark-command .brand-wordmark-dark {
    color: var(--text-main);
}

.overview-page .app-footer {
    margin-top: 44px;
}

@media (max-width: 1050px) {
    .module-toggle-grid,
    .overview-readiness-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .overview-hero-panel {
        display: grid;
        align-items: center;
        min-height: 0;
        margin-top: 24px;
        padding: 24px;
    }

    .overview-version-link,
    .overview-quick-link,
    .overview-task-item {
        width: 100%;
    }

    .overview-task-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .overview-readiness-grid,
    .module-toggle-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1050px) {
    .app-layout {
        grid-template-columns: 230px 1fr;
    }

    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .app-layout {
        display: block;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .sidebar-logo img {
        width: min(100%, 300px);
        max-height: 112px;
        margin: 0 auto;
    }

    .dashboard {
        padding: 18px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-panel {
        padding: 24px;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .login-shell {
        padding: 18px;
    }

    .login-card {
        padding: 24px;
    }
}

.error-box {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(227, 6, 19, 0.16);
    border: 1px solid rgba(227, 6, 19, 0.45);
    color: #ffffff;
    font-weight: 700;
    line-height: 1.4;
}

.user-box {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: flex-end;
    text-align: right;
}

.user-box span {
    display: block;
    font-weight: 900;
}

.user-box small {
    display: block;
    opacity: 0.82;
    font-weight: 700;
}

.success-box {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(22, 163, 74, 0.18);
    border: 1px solid rgba(22, 163, 74, 0.48);
    color: #ffffff;
    font-weight: 700;
    line-height: 1.4;
}

.inline-link {
    color: #ffffff;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.inline-link:hover {
    color: #ffd6d9;
}

.admin-panel {
    margin-top: 28px;
    padding: 0;
}

.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    background: var(--surface-bg);
    box-shadow: var(--card-shadow);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.admin-table th,
.admin-table td {
    padding: 15px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}

.admin-table th {
    background: var(--table-head-bg);
    color: var(--text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.admin-table td {
    color: var(--text-main);
    font-size: 0.94rem;
}

.user-admin-form {
    display: contents;
}

.admin-table select {
    width: 100%;
    min-width: 190px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: var(--input-bg);
    color: var(--text-main);
    font-weight: 700;
}

.small-button {
    padding: 10px 14px;
    border: 0;
    border-radius: 12px;
    background: var(--drk-red);
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
}

.small-button:hover {
    background: var(--drk-red-dark);
}

.settings-form {
    display: grid;
    gap: 18px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
    width: 100%;
    max-width: 100%;
}

.settings-card {
    min-width: 0;
    max-width: 100%;
    padding: 20px;
    border-radius: 8px;
    background: var(--surface-bg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--card-shadow);
    display: grid;
    gap: 14px;
    box-sizing: border-box;
    overflow: hidden;
}

.settings-card-wide {
    grid-column: 1 / -1;
}

.settings-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 12px;
}

.settings-card h2 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--text-main);
}

.settings-kicker {
    color: var(--drk-red-dark);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.settings-card label {
    min-width: 0;
    max-width: 100%;
    display: grid;
    gap: 7px;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 900;
}

.settings-card input[type="text"],
.settings-card input[type="email"],
.settings-card input[type="number"],
.settings-card input[type="password"],
.settings-card input[type="url"],
.settings-card input[type="file"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 11px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    background: var(--input-bg);
    color: var(--text-main);
    font: inherit;
    font-weight: 700;
}

.settings-card input:focus {
    outline: 2px solid rgba(227, 6, 19, 0.18);
    border-color: var(--drk-red);
}

.settings-two-col,
.settings-color-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.settings-checkbox {
    display: flex !important;
    grid-template-columns: none !important;
    flex-direction: row;
    align-items: center;
    gap: 10px !important;
    line-height: 1.3;
}

.settings-checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--drk-red);
}

.settings-danger-check {
    color: #991b1b !important;
}

.settings-help-text {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.module-toggle-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.module-toggle-group {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--surface-bg-soft);
}

.module-toggle-group h3 {
    margin: 0 0 12px;
    color: var(--text-main);
    font-size: 0.95rem;
}

.module-toggle-list {
    display: grid;
    gap: 10px;
}

.module-toggle-row {
    color: var(--text-main) !important;
    font-weight: 800 !important;
}

.settings-logo-row {
    display: grid;
    grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
    gap: 22px;
    align-items: center;
    min-width: 0;
    max-width: 100%;
}

.settings-background-row,
.settings-background-upload {
    display: grid;
    gap: 16px;
    padding-top: 18px;
    border-top: 1px solid var(--border-soft);
}

.settings-background-copy {
    display: grid;
    gap: 6px;
}

.settings-background-copy h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 0.98rem;
}

.settings-background-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    min-width: 0;
    max-width: 100%;
}

.settings-background-controls {
    display: grid;
    gap: 12px;
    align-content: start;
    min-width: 0;
    max-width: 100%;
}

.settings-upload-hint {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.settings-logo-preview-box {
    width: 100%;
    max-width: 260px;
    min-height: 170px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    background: var(--surface-bg-soft);
    padding: 14px;
}

.settings-logo-preview {
    display: block;
    max-width: 100%;
    max-height: 160px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.settings-background-preview-box {
    width: 100%;
    max-width: 460px;
    aspect-ratio: 16 / 9;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    background: var(--surface-bg-soft);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.settings-background-preview {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.theme-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    min-width: 0;
    max-width: 100%;
}

.theme-card {
    position: relative;
    display: block !important;
    min-width: 0;
    max-width: 100%;
    min-height: 102px;
    cursor: pointer;
    box-sizing: border-box;
}

.theme-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0.001;
    pointer-events: none;
}

.theme-card-content {
    min-width: 0;
    max-width: 100%;
    display: grid;
    gap: 8px;
    min-height: 102px;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 8px;
    background: var(--surface-bg);
    color: var(--text-muted);
    font-size: 0.86rem;
    line-height: 1.35;
    transition: border-color 160ms ease, box-shadow 160ms ease;
    box-sizing: border-box;
    overflow: hidden;
}

.theme-card:hover .theme-card-content,
.theme-card input:focus-visible + .theme-card-content,
.theme-card input:checked + .theme-card-content,
.theme-card-active .theme-card-content {
    border-color: var(--drk-red);
    box-shadow: var(--card-shadow);
}

.theme-card input:checked + .theme-card-content,
.theme-card-active .theme-card-content {
    outline: 3px solid rgba(227, 6, 19, 0.14);
}

.theme-card-headline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--text-main);
}

.theme-preview {
    display: grid;
    gap: 0;
    min-height: 70px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    background: var(--surface-bg-soft);
}

.theme-preview-header {
    height: 20px;
}

.theme-preview-panel {
    display: flex;
    align-items: end;
    gap: 7px;
    padding: 10px;
}

.theme-preview-panel span {
    display: block;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.08);
}

.theme-preview-panel span:nth-child(1) {
    width: 36px;
    height: 12px;
}

.theme-preview-panel span:nth-child(2) {
    width: 26px;
    height: 26px;
}

.theme-preview-panel span:nth-child(3) {
    flex: 1;
    min-width: 34px;
    height: 18px;
    border-radius: 7px;
}

.theme-card-headline strong {
    font-size: 0.96rem;
}

.theme-swatches {
    display: inline-flex;
    gap: 5px;
    flex: 0 0 auto;
}

.theme-swatches span {
    display: block;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid #ffffff;
    box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.12);
}

.custom-theme-fields {
    padding: 14px;
    border-radius: 8px;
    background: var(--surface-bg-soft);
    border: 1px dashed var(--border-soft);
}

.custom-theme-fields h3 {
    margin: 0 0 12px;
    color: var(--text-main);
    font-size: 0.98rem;
}

.color-input-row {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.color-input-row input[type="color"] {
    width: 54px;
    height: 44px;
    padding: 2px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #ffffff;
}

.color-input-row input[disabled] {
    color: #6b7280;
    background: #f9fafb;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    padding-bottom: 24px;
}

.admin-settings-page .floating-top-button {
    display: none;
}

.app-page.theme-liquid-glass .sidebar,
.app-page.theme-liquid-glass .topbar,
.app-page.theme-liquid-glass .info-box,
.app-page.theme-liquid-glass .module-card,
.app-page.theme-liquid-glass .settings-card,
.app-page.theme-liquid-glass .admin-table-wrap,
.app-page.theme-liquid-glass .user-card,
.app-page.theme-liquid-glass .vehicle-card,
.app-page.theme-liquid-glass .filter-collapse-panel {
    background: var(--surface-bg-translucent);
    border-color: var(--border-soft);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .theme-liquid-glass .sidebar,
    .theme-liquid-glass .topbar,
    .theme-liquid-glass .hero-panel,
    .theme-liquid-glass .info-box,
    .theme-liquid-glass .module-card,
    .theme-liquid-glass .settings-card,
    .theme-liquid-glass .admin-table-wrap,
    .theme-liquid-glass .theme-card-content,
    .theme-liquid-glass .login-card,
    .theme-liquid-glass .auth-organization {
        backdrop-filter: blur(14px) saturate(130%);
        -webkit-backdrop-filter: blur(14px) saturate(130%);
    }
}

.theme-dark-command {
    --text-dark: var(--text-main);
    --bg-soft: var(--page-bg);
    --card-bg: var(--surface-bg);
}

.theme-dark-command .sidebar,
.theme-dark-command .info-box,
.theme-dark-command .module-card,
.theme-dark-command .settings-card,
.theme-dark-command .admin-table-wrap,
.theme-dark-command .user-card,
.theme-dark-command .vehicle-card,
.theme-dark-command .filter-collapse-panel,
.theme-dark-command .audit-entry,
.theme-dark-command .loadout-check-card,
.theme-dark-command .loadout-unit-card {
    background: var(--surface-bg);
    border-color: var(--border-soft);
    color: var(--text-main);
}

.theme-dark-command .hero-content h2,
.theme-dark-command .hero-content p,
.theme-dark-command .module-card h3,
.theme-dark-command .module-card p,
.theme-dark-command .info-box h2,
.theme-dark-command .info-box p,
.theme-dark-command .settings-card h2,
.theme-dark-command .settings-card label,
.theme-dark-command .theme-card-headline,
.theme-dark-command .user-card h3,
.theme-dark-command .user-card-meta strong,
.theme-dark-command .audit-entry h3 {
    color: var(--text-main);
}

.theme-dark-command .module-card p,
.theme-dark-command .info-box p,
.theme-dark-command .settings-help-text,
.theme-dark-command .user-card-meta span,
.theme-dark-command .audit-meta,
.theme-dark-command .nav-title {
    color: var(--text-muted);
}

.theme-dark-command input,
.theme-dark-command select,
.theme-dark-command textarea,
.theme-dark-command .settings-card input[type="text"],
.theme-dark-command .settings-card input[type="email"],
.theme-dark-command .settings-card input[type="number"],
.theme-dark-command .settings-card input[type="password"],
.theme-dark-command .settings-card input[type="url"],
.theme-dark-command .filter-bar input,
.theme-dark-command .filter-bar select,
.theme-dark-command .mpg-form input,
.theme-dark-command .mpg-form select,
.theme-dark-command .mpg-form textarea,
.theme-dark-command .vehicle-card-form input,
.theme-dark-command .vehicle-card-form select,
.theme-dark-command .vehicle-card-form textarea {
    background: var(--input-bg);
    color: var(--text-main);
    border-color: var(--border-soft);
}

.theme-dark-command input::placeholder,
.theme-dark-command textarea::placeholder {
    color: #94a3b8;
}

.theme-dark-command .admin-table th {
    background: var(--table-head-bg);
    color: var(--text-muted);
}

.theme-dark-command .admin-table td {
    color: var(--text-main);
    border-bottom-color: var(--border-soft);
}

.theme-dark-command .app-footer {
    background: var(--surface-bg);
    border-color: var(--border-soft);
    color: var(--text-muted);
}

.theme-tactical-blue .topbar,
.theme-rescue-green .topbar,
.theme-warm-operations .topbar {
    box-shadow: var(--card-shadow);
}

.theme-tactical-blue .status-badge-ok,
.theme-rescue-green .status-badge-ok,
.theme-warm-operations .status-badge-ok {
    background: var(--chip-bg);
    color: var(--chip-text);
}

.login-page.theme-liquid-glass {
    background:
        linear-gradient(135deg, rgba(239, 246, 255, 0.92), rgba(255, 241, 242, 0.84)),
        var(--branding-background-image) center center / cover no-repeat;
}

.login-page.theme-dark-command {
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(17, 24, 39, 0.86)),
        var(--branding-background-image) center center / cover no-repeat;
}

.login-page.theme-tactical-blue {
    background:
        linear-gradient(135deg, rgba(30, 58, 138, 0.88), rgba(15, 23, 42, 0.62)),
        var(--branding-background-image) center center / cover no-repeat;
}

.login-page.theme-rescue-green {
    background:
        linear-gradient(135deg, rgba(4, 120, 87, 0.86), rgba(15, 23, 42, 0.54)),
        var(--branding-background-image) center center / cover no-repeat;
}

.login-page.theme-warm-operations {
    background:
        linear-gradient(135deg, rgba(194, 65, 12, 0.82), rgba(120, 53, 15, 0.52)),
        var(--branding-background-image) center center / cover no-repeat;
}

@media (max-width: 1180px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .settings-grid,
    .settings-two-col,
    .settings-color-grid,
    .theme-card-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .settings-logo-row,
    .settings-background-row,
    .settings-background-layout {
        grid-template-columns: 1fr;
    }

    .settings-logo-preview-box {
        max-width: 240px;
        min-height: 150px;
    }

    .settings-logo-preview {
        max-height: 140px;
    }

    .settings-background-preview-box {
        max-width: 100%;
    }
}


.app-footer {
    margin-top: 34px;
    padding: 18px 22px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(209, 213, 219, 0.9);
    color: #6b7280;
    font-size: 0.84rem;
    font-weight: 700;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    justify-content: center;
    text-align: center;
}

.footer-text-line {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 18px;
}

.footer-version-line {
    display: flex;
    justify-content: center;
    width: 100%;
}

.login-footer {
    width: min(430px, 100%);
    margin-top: 18px;
    padding: 13px 18px;
    border-radius: 18px;
    color: rgba(255, 255, 255, 0.76);
    background: rgba(18, 24, 33, 0.42);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    justify-content: center;
    text-align: center;
}

@media (max-width: 760px) {
    .app-footer,
    .login-footer {
        flex-direction: column;
        gap: 5px;
    }
}

.mpg-form {
    margin-top: 18px;
    display: grid;
    gap: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.mpg-form label {
    display: grid;
    gap: 7px;
    color: #374151;
    font-size: 0.88rem;
    font-weight: 800;
}

.mpg-form input,
.mpg-form select,
.mpg-form textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #d1d5db;
    border-radius: 13px;
    background: #ffffff;
    color: #1f2933;
    font: inherit;
    font-weight: 600;
}

.mpg-form input:focus,
.mpg-form select:focus,
.mpg-form textarea:focus {
    outline: 3px solid rgba(227, 6, 19, 0.18);
    border-color: var(--drk-red);
}

.notes-field {
    width: 100%;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.status-einsatzbereit {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.status-eingeschränkt {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
}

.status-prüfung_fällig {
    background: rgba(245, 158, 11, 0.18);
    color: #92400e;
}

.status-defekt {
    background: rgba(227, 6, 19, 0.13);
    color: var(--drk-red-dark);
}

@media (max-width: 1180px) {
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.due-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.due-ok {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.due-soon {
    background: rgba(245, 158, 11, 0.16);
    color: #92400e;
}

.due-overdue {
    background: rgba(227, 6, 19, 0.14);
    color: var(--drk-red-dark);
}

.due-none,
.due-unknown {
    background: rgba(107, 114, 128, 0.14);
    color: #4b5563;
}

.mpg-device-table input,
.mpg-device-table select {
    width: 100%;
    min-width: 150px;
    padding: 9px 10px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #1f2933;
    font-weight: 700;
}

.mpg-device-table input:focus,
.mpg-device-table select:focus {
    outline: 3px solid rgba(227, 6, 19, 0.16);
    border-color: var(--drk-red);
}

.device-row-form {
    display: contents;
}

.device-actions {
    display: grid;
    gap: 8px;
    min-width: 130px;
}

.danger-button {
    padding: 10px 14px;
    border: 0;
    border-radius: 12px;
    background: #6b7280;
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
}

.danger-button:hover {
    background: var(--drk-red-dark);
}

.mpg-device-table .due-pill {
    margin-top: 7px;
}

.mpg-device-table {
    table-layout: fixed;
    min-width: 100%;
}

.mpg-device-table th:nth-child(1),
.mpg-device-table td:nth-child(1) {
    width: 17%;
}

.mpg-device-table th:nth-child(2),
.mpg-device-table td:nth-child(2) {
    width: 12%;
}

.mpg-device-table th:nth-child(3),
.mpg-device-table td:nth-child(3) {
    width: 18%;
}

.mpg-device-table th:nth-child(4),
.mpg-device-table td:nth-child(4) {
    width: 13%;
}

.mpg-device-table th:nth-child(5),
.mpg-device-table td:nth-child(5) {
    width: 16%;
}

.mpg-device-table th:nth-child(6),
.mpg-device-table td:nth-child(6) {
    width: 14%;
}

.mpg-device-table th:nth-child(7),
.mpg-device-table td:nth-child(7) {
    width: 10%;
}

.mpg-device-table input,
.mpg-device-table select {
    min-width: 0;
    font-size: 0.86rem;
}

.mpg-device-table td {
    overflow: visible;
}

.admin-table-wrap {
    overflow-x: auto;
}

.mpg-device-table.admin-table {
    width: 100%;
    min-width: 0 !important;
}

.mpg-device-table th,
.mpg-device-table td {
    padding: 12px 10px;
}

.mpg-device-table input,
.mpg-device-table select {
    padding: 8px 9px;
    font-size: 0.82rem;
}

.mpg-device-table th:nth-child(1),
.mpg-device-table td:nth-child(1) {
    width: 16%;
}

.mpg-device-table th:nth-child(2),
.mpg-device-table td:nth-child(2) {
    width: 10%;
}

.mpg-device-table th:nth-child(3),
.mpg-device-table td:nth-child(3) {
    width: 18%;
}

.mpg-device-table th:nth-child(4),
.mpg-device-table td:nth-child(4) {
    width: 12%;
}

.mpg-device-table th:nth-child(5),
.mpg-device-table td:nth-child(5) {
    width: 16%;
}

.mpg-device-table th:nth-child(6),
.mpg-device-table td:nth-child(6) {
    width: 15%;
}

.mpg-device-table th:nth-child(7),
.mpg-device-table td:nth-child(7) {
    width: 13%;
}

.device-actions {
    min-width: 0;
}

.device-actions .small-button,
.device-actions .danger-button {
    width: 100%;
    padding: 9px 10px;
    font-size: 0.78rem;
}

.admin-table-wrap {
    overflow-x: visible;
}

.mpg-stats-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.mpg-stat-card {
    padding: 20px;
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    border-left: 7px solid #9ca3af;
}

.mpg-stat-card span {
    display: block;
    color: #6b7280;
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.mpg-stat-card strong {
    display: block;
    margin-top: 10px;
    color: #1f2933;
    font-size: 2.2rem;
    line-height: 1;
}

a.mpg-stat-card.clickable-stat-card {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

a.mpg-stat-card.clickable-stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

a.mpg-stat-card.clickable-stat-card:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.45);
    outline-offset: 3px;
}

.status-ready-card {
    border-left-color: #16a34a;
}

.status-soon-card {
    border-left-color: #f59e0b;
}

.status-critical-card {
    border-left-color: var(--drk-red);
}

@media (max-width: 1050px) {
    .mpg-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .mpg-stats-grid {
        grid-template-columns: 1fr;
    }
}

.section-title-row {
    margin-bottom: 14px;
}

.section-title-row h2 {
    margin: 0;
}

.filter-bar {
    margin-bottom: 18px;
    padding: 18px;
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    display: grid;
    grid-template-columns: 2fr 1fr auto auto;
    gap: 14px;
    align-items: end;
}

.filter-bar label {
    display: grid;
    gap: 7px;
    color: #374151;
    font-size: 0.88rem;
    font-weight: 800;
}

.filter-bar input,
.filter-bar select {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid #d1d5db;
    border-radius: 13px;
    background: #ffffff;
    color: #1f2933;
    font: inherit;
    font-weight: 700;
}

.filter-bar input:focus,
.filter-bar select:focus {
    outline: 3px solid rgba(227, 6, 19, 0.16);
    border-color: var(--drk-red);
}

.reset-button {
    padding: 10px 14px;
    border-radius: 12px;
    background: #6b7280;
    color: #ffffff;
    text-decoration: none;
    font-weight: 800;
    text-align: center;
}

.reset-button:hover {
    background: #4b5563;
}

@media (max-width: 900px) {
    .filter-bar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 620px) {
    .filter-bar {
        grid-template-columns: 1fr;
    }
}

.due-pill-stacked {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    line-height: 1.15;
    white-space: normal;
    min-width: 0;
}

.due-pill-stacked strong {
    font-size: 0.76rem;
    line-height: 1.1;
}

.due-pill-stacked small {
    font-size: 0.72rem;
    font-weight: 800;
    opacity: 0.9;
}

.detail-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.detail-item {
    padding: 16px;
    border-radius: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.detail-item span {
    display: block;
    margin-bottom: 8px;
    color: #6b7280;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.detail-item strong {
    display: block;
    color: #1f2933;
    font-size: 1rem;
    line-height: 1.35;
}

.detail-notes {
    white-space: pre-wrap;
}

.detail-link {
    display: inline-flex;
    margin-bottom: 7px;
    color: var(--drk-red-dark);
    font-size: 0.78rem;
    font-weight: 900;
    text-decoration: none;
}

.detail-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 1050px) {
    .detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

.history-form {
    margin-top: 18px;
    display: grid;
    gap: 18px;
}

.history-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.history-list {
    display: grid;
    gap: 14px;
}

.history-entry {
    padding: 16px;
    border-radius: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.history-entry div {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 16px;
    margin-bottom: 8px;
}

.history-entry strong {
    color: #1f2933;
    font-size: 1rem;
}

.history-entry span {
    color: #6b7280;
    font-size: 0.82rem;
    font-weight: 800;
}

.history-entry p {
    margin: 0;
    color: #374151;
    line-height: 1.55;
    white-space: pre-wrap;
}

@media (max-width: 760px) {
    .history-form-grid {
        grid-template-columns: 1fr;
    }
}

.mpg-device-table tbody tr {
    border-bottom: 1px solid #e5e7eb;
}

.mpg-device-table tbody tr:last-child {
    border-bottom: 0;
}

.mpg-device-table td {
    border-bottom: 0 !important;
    vertical-align: middle;
}

.mpg-device-table .device-actions {
    border-left: 1px solid #eef0f3;
    background: #ffffff;
    align-content: center;
}

.mpg-device-table .device-actions form {
    margin: 0;
}

.mpg-device-table .device-actions::before {
    content: "";
    display: none;
}

.mpg-device-table .due-pill {
    max-width: 100%;
}

.history-form .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.history-form label {
    display: grid;
    gap: 8px;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 800;
}

.history-form select,
.history-form input,
.history-form textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #d1d5db;
    border-radius: 13px;
    background: #ffffff;
    color: #1f2933;
    font: inherit;
    font-weight: 700;
}

.history-form textarea {
    min-height: 110px;
    resize: vertical;
}

.history-form select:focus,
.history-form input:focus,
.history-form textarea:focus {
    outline: 3px solid rgba(227, 6, 19, 0.16);
    border-color: var(--drk-red);
}

.history-form .notes-field {
    display: grid;
    width: 100%;
}

.history-form .small-button {
    width: 100%;
}

@media (max-width: 760px) {
    .history-form .form-grid {
        grid-template-columns: 1fr;
    }
}

.history-entry {
    border-left: 7px solid #9ca3af;
}

.history-pruefung {
    border-left-color: #16a34a;
}

.history-defekt {
    border-left-color: var(--drk-red);
}

.history-wartung {
    border-left-color: #64748b;
}

.history-statusaenderung {
    border-left-color: #f59e0b;
}

.history-notiz {
    border-left-color: #9ca3af;
}

.filter-bar {
    grid-template-columns: 2fr 1fr 1fr auto auto;
}

@media (max-width: 1050px) {
    .filter-bar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 620px) {
    .filter-bar {
        grid-template-columns: 1fr;
    }
}

.section-title-row-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.export-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--drk-red);
    color: #ffffff;
    text-decoration: none;
    font-weight: 900;
    white-space: nowrap;
}

.export-button:hover {
    background: var(--drk-red-dark);
}

@media (max-width: 620px) {
    .section-title-row-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .export-button {
        width: 100%;
    }
}

.export-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.secondary-export {
    background: #6b7280;
}

.secondary-export:hover {
    background: #4b5563;
}

.module-back-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.module-back-button {
    gap: 8px;
    margin-bottom: 0;
    text-decoration: none;
}

@media (max-width: 620px) {
    .export-actions {
        width: 100%;
        flex-direction: column;
    }

    .export-actions .export-button {
        width: 100%;
    }

    .module-back-row,
    .module-back-button {
        width: 100%;
    }
}


.product-name {
    margin-bottom: 10px;
    color: var(--drk-red);
    font-size: 0.92rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.app-name {
    display: block;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.92rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* San|Pad Branding bewusst nicht komplett in Versalien */
.app-name,
.product-name {
    text-transform: none !important;
    letter-spacing: 0.04em;
}

.eyebrow {
    text-transform: none !important;
    letter-spacing: 0.03em;
}

/* Mobile Optimierung für San|Pad */
@media (max-width: 760px) {
    body {
        overflow-x: hidden;
    }

    .app-layout {
        display: block;
        min-height: 100vh;
    }

    .sidebar {
        padding: 18px;
        gap: 18px;
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .sidebar-logo {
        max-width: 280px;
        margin: 0 auto;
    }

    .module-nav {
        gap: 10px;
    }

    .nav-item {
        padding: 14px 16px;
        font-size: 1rem;
    }

    .dashboard {
        padding: 16px;
    }

    .topbar {
        min-height: auto;
        padding: 20px;
        border-radius: 24px;
        display: grid;
        gap: 16px;
    }

    .topbar h1 {
        font-size: 1.9rem;
        line-height: 1.12;
    }

    .app-name {
        font-size: 0.95rem;
    }

    .eyebrow {
        font-size: 0.85rem;
        line-height: 1.35;
    }

    .user-box {
        justify-content: flex-start;
        text-align: left;
        align-items: flex-start;
        gap: 8px 14px;
    }

    .logout-link {
        display: inline-flex;
        margin-top: 6px;
        padding: 9px 12px;
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.16);
    }

    .hero-panel {
        min-height: 210px;
        padding: 24px;
        border-radius: 24px;
        background:
            linear-gradient(90deg, rgba(255,255,255,0.96) 0%, rgba(255,255,255,0.88) 100%),
            var(--branding-background-image) center center / cover no-repeat;
    }

    .hero-content h2 {
        font-size: 2rem;
        line-height: 1.12;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .module-grid,
    .mpg-stats-grid,
    .form-grid,
    .detail-grid,
    .history-form .form-grid {
        grid-template-columns: 1fr !important;
    }

    .info-box {
        padding: 22px;
        border-radius: 22px;
    }

    .filter-bar {
        grid-template-columns: 1fr !important;
    }

    .filter-bar .small-button,
    .filter-bar .reset-button {
        width: 100%;
    }

    .admin-table-wrap {
        overflow-x: visible;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
    }

    .admin-table,
    .admin-table thead,
    .admin-table tbody,
    .admin-table th,
    .admin-table td,
    .admin-table tr {
        display: block;
        width: 100%;
        min-width: 0 !important;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table tr {
        margin-bottom: 18px;
        padding: 18px;
        border-radius: 22px;
        background: #ffffff;
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
        border: 1px solid #e5e7eb;
    }

    .admin-table td {
        padding: 10px 0;
        border-bottom: 1px solid #eef0f3 !important;
    }

    .admin-table td:last-child {
        border-bottom: 0 !important;
    }

    .admin-table td::before {
        display: block;
        margin-bottom: 6px;
        color: #6b7280;
        font-size: 0.76rem;
        font-weight: 900;
        text-transform: uppercase;
        letter-spacing: 0.06em;
    }

    .admin-table td:nth-child(1)::before { content: "Name"; }
    .admin-table td:nth-child(2)::before { content: "Benutzername / Inventar"; }
    .admin-table td:nth-child(3)::before { content: "Rolle / Hersteller"; }
    .admin-table td:nth-child(4)::before { content: "Status / Standort"; }
    .admin-table td:nth-child(5)::before { content: "Erstellt / Status"; }
    .admin-table td:nth-child(6)::before { content: "Aktion / Prüffrist"; }
    .admin-table td:nth-child(7)::before { content: "Aktion"; }

    .admin-table select,
    .admin-table input,
    .mpg-device-table input,
    .mpg-device-table select {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        font-size: 1rem;
        padding: 12px 13px;
    }

    .device-row-form {
        display: contents;
    }

    .device-actions {
        border-left: 0 !important;
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .device-actions .small-button,
    .device-actions .danger-button,
    .small-button,
    .danger-button {
        width: 100%;
        padding: 13px 14px;
        font-size: 0.95rem;
    }

    .due-pill,
    .status-pill {
        width: fit-content;
        max-width: 100%;
    }

    .app-footer,
    .login-footer {
        margin-top: 24px;
        padding: 18px;
        flex-direction: column;
        gap: 6px;
        font-size: 0.88rem;
    }
}

/* Mobile-Fix: MPG-Gerätetabelle als echte Karten */
@media (max-width: 760px) {
    .mpg-device-table,
    .mpg-device-table tbody,
    .mpg-device-table tr,
    .mpg-device-table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: auto !important;
    }

    .mpg-device-table thead {
        display: none !important;
    }

    .mpg-device-table tr {
        padding: 20px !important;
        margin-bottom: 20px !important;
        border-radius: 24px !important;
        background: #ffffff !important;
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10) !important;
        border: 1px solid #e5e7eb !important;
    }

    .mpg-device-table td {
        padding: 12px 0 !important;
        border-bottom: 1px solid #eef0f3 !important;
    }

    .mpg-device-table td:last-child {
        border-bottom: 0 !important;
    }

    .mpg-device-table td::before {
        display: block !important;
        margin-bottom: 8px !important;
        color: #6b7280 !important;
        font-size: 0.78rem !important;
        font-weight: 900 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.06em !important;
    }

    .mpg-device-table td:nth-child(1)::before { content: "Name"; }
    .mpg-device-table td:nth-child(2)::before { content: "Inventarnummer"; }
    .mpg-device-table td:nth-child(3)::before { content: "Hersteller / Modell"; }
    .mpg-device-table td:nth-child(4)::before { content: "Standort"; }
    .mpg-device-table td:nth-child(5)::before { content: "Status"; }
    .mpg-device-table td:nth-child(6)::before { content: "Prüffrist"; }
    .mpg-device-table td:nth-child(7)::before { content: "Aktion"; }

    .mpg-device-table input,
    .mpg-device-table select {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: auto !important;
        padding: 13px 14px !important;
        border-radius: 14px !important;
        font-size: 1rem !important;
        line-height: 1.3 !important;
    }

    .mpg-device-table .detail-link {
        display: inline-flex !important;
        margin-bottom: 10px !important;
        font-size: 0.9rem !important;
    }

    .mpg-device-table .due-pill {
        margin-top: 10px !important;
        width: fit-content !important;
        max-width: 100% !important;
    }

    .mpg-device-table .device-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        width: 100% !important;
        background: transparent !important;
    }

    .mpg-device-table .device-actions form {
        width: 100% !important;
    }

    .mpg-device-table .device-actions button {
        width: 100% !important;
    }
}

/* Mobile-Reihenfolge: Kopfzeile vor Navigation */
@media (max-width: 760px) {
    .app-layout {
        display: flex !important;
        flex-direction: column !important;
    }

    .dashboard {
        display: contents !important;
    }

    .topbar {
        order: 1;
        margin: 16px 16px 18px;
    }

    .sidebar {
        order: 2;
    }

    .hero-panel,
    .module-section,
    .info-box,
    .admin-panel,
    .mpg-stats-grid,
    .app-footer {
        order: 3;
        margin-left: 16px;
        margin-right: 16px;
    }

    .hero-panel {
        margin-top: 18px;
    }

    .app-footer {
        order: 99;
        margin-bottom: 24px;
    }
}

.user-actions {
    display: grid;
    gap: 8px;
    min-width: 130px;
}

.user-actions form {
    margin: 0;
}

.user-actions .small-button,
.user-actions .danger-button {
    width: 100%;
}


.version-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(227, 6, 19, 0.10);
    color: var(--drk-red-dark);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.03em;
}

.profile-form {
    margin-top: 20px;
    display: grid;
    gap: 18px;
}

.profile-form-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-form label {
    display: grid;
    gap: 8px;
    color: #374151;
    font-size: 0.9rem;
    font-weight: 800;
}

.profile-form input {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #d1d5db;
    border-radius: 13px;
    background: #ffffff;
    color: #1f2933;
    font: inherit;
    font-weight: 700;
}

.profile-form input:focus {
    outline: 3px solid rgba(227, 6, 19, 0.16);
    border-color: var(--drk-red);
}

.profile-message {
    margin-top: 18px;
    padding: 12px 14px;
    border-radius: 14px;
    font-weight: 800;
    line-height: 1.4;
}

.profile-success {
    background: rgba(22, 163, 74, 0.12);
    border: 1px solid rgba(22, 163, 74, 0.38);
    color: #15803d;
}

.profile-error {
    background: rgba(227, 6, 19, 0.10);
    border: 1px solid rgba(227, 6, 19, 0.38);
    color: var(--drk-red-dark);
}

@media (max-width: 1050px) {
    .profile-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .profile-form-grid {
        grid-template-columns: 1fr;
    }
}


/* Benutzerverwaltung: sauberes Desktop-Layout mit E-Mail-Spalte */
.user-table {
    width: 100%;
    table-layout: fixed;
    min-width: 0;
}

.user-table th,
.user-table td {
    padding: 14px 12px;
}

.user-table th:nth-child(1),
.user-table td:nth-child(1) {
    width: 12%;
}

.user-table th:nth-child(2),
.user-table td:nth-child(2) {
    width: 13%;
}

.user-table th:nth-child(3),
.user-table td:nth-child(3) {
    width: 16%;
    overflow-wrap: anywhere;
}

.user-table th:nth-child(4),
.user-table td:nth-child(4) {
    width: 20%;
}

.user-table th:nth-child(5),
.user-table td:nth-child(5) {
    width: 15%;
}

.user-table th:nth-child(6),
.user-table td:nth-child(6) {
    width: 13%;
}

.user-table th:nth-child(7),
.user-table td:nth-child(7) {
    width: 11%;
}

.user-table select {
    min-width: 0;
    width: 100%;
    font-size: 0.86rem;
}

.user-table .user-actions {
    min-width: 0;
}

.user-table .user-actions .small-button,
.user-table .user-actions .danger-button {
    width: 100%;
    padding: 10px 8px;
    font-size: 0.82rem;
}

@media (max-width: 760px) {
    .user-table {
        table-layout: auto;
    }
}

/* Mobile-Fix: Benutzerverwaltung als saubere Nutzerkarten */
@media (max-width: 760px) {
    .user-table,
    .user-table tbody,
    .user-table tr,
    .user-table td {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        table-layout: auto !important;
    }

    .user-table thead {
        display: none !important;
    }

    .user-table tr {
        padding: 20px !important;
        margin-bottom: 20px !important;
        border-radius: 24px !important;
        background: #ffffff !important;
        box-shadow: 0 12px 30px rgba(15, 23, 42, 0.10) !important;
        border: 1px solid #e5e7eb !important;
    }

    .user-table td {
        padding: 12px 0 !important;
        border-bottom: 1px solid #eef0f3 !important;
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }

    .user-table td:last-child {
        border-bottom: 0 !important;
    }

    .user-table td::before {
        display: block !important;
        margin-bottom: 8px !important;
        color: #6b7280 !important;
        font-size: 0.78rem !important;
        font-weight: 900 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.06em !important;
        line-height: 1.2 !important;
    }

    .user-table td:nth-child(1)::before { content: "Name" !important; }
    .user-table td:nth-child(2)::before { content: "Benutzername" !important; }
    .user-table td:nth-child(3)::before { content: "E-Mail" !important; }
    .user-table td:nth-child(4)::before { content: "Rolle" !important; }
    .user-table td:nth-child(5)::before { content: "Status" !important; }
    .user-table td:nth-child(6)::before { content: "Erstellt" !important; }
    .user-table td:nth-child(7)::before { content: "Aktion" !important; }

    .user-table select,
    .user-table input {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        padding: 13px 14px !important;
        border-radius: 14px !important;
        font-size: 1rem !important;
        line-height: 1.3 !important;
    }

    .user-admin-form {
        display: contents !important;
    }

    .user-actions {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    .user-actions form {
        width: 100% !important;
        margin: 0 !important;
    }

    .user-actions button {
        width: 100% !important;
    }
}

/* Mobile-Fix: mehr Abstand zwischen Benutzer-Aktionsbuttons */
@media (max-width: 760px) {
    .user-table .user-actions {
        gap: 14px !important;
        padding-top: 4px !important;
    }

    .user-table .user-actions .small-button,
    .user-table .user-actions .danger-button {
        margin: 0 !important;
        border-radius: 16px !important;
        min-height: 52px !important;
    }

    .user-table .user-actions .danger-button {
        margin-top: 2px !important;
    }
}

/* Feinschliff: San|Pad Branding und mobile Prüffrist-Felder */
.topbar .app-name {
    color: #ffffff;
    width: fit-content;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.22);
    font-weight: 950;
}

.login-heading .product-name {
    color: var(--drk-red);
}

@media (max-width: 760px) {
    .topbar-user-area {
        justify-items: start;
        width: 100%;
    }

    .org-identity {
        align-items: flex-start;
        font-size: clamp(1.08rem, 7vw, 1.38rem);
    }

    .org-identity img {
        width: 64px;
        height: 64px;
    }

    .topbar .app-name {
        color: var(--drk-red);
        background: #ffffff;
        border: 1px solid rgba(255, 255, 255, 0.85);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    }

    .mpg-device-table td:nth-child(6) input[type="date"] {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        display: block !important;
        box-sizing: border-box !important;
        text-align: left !important;
    }

    .mpg-device-table td:nth-child(6) {
        overflow: hidden !important;
    }

    .mpg-device-table td:nth-child(6) .due-pill {
        margin-top: 12px !important;
        display: inline-flex !important;
    }
}

/* iPhone-Fix: Datumsfeld im MPG-Mobile-Cardlayout sauber darstellen */
@media (max-width: 760px) {
    .mpg-device-table td:nth-child(6) {
        display: block !important;
        width: 100% !important;
        overflow: visible !important;
    }

    .mpg-device-table td:nth-child(6) input[type="date"] {
        -webkit-appearance: none !important;
        appearance: none !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 58px !important;
        padding: 13px 14px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        border: 1px solid #d1d5db !important;
        border-radius: 14px !important;
        background: #ffffff !important;
        color: #1f2933 !important;
        font-size: 1rem !important;
        font-weight: 800 !important;
        line-height: 1.3 !important;
        text-align: left !important;
    }

    .mpg-device-table td:nth-child(6) input[type="date"]::-webkit-date-and-time-value {
        text-align: left !important;
        width: 100% !important;
        display: block !important;
    }

    .mpg-device-table td:nth-child(6) input[type="date"]::-webkit-calendar-picker-indicator {
        margin-left: auto !important;
    }

    .mpg-device-table td:nth-child(6) .due-pill {
        margin-top: 12px !important;
        width: auto !important;
        max-width: 100% !important;
    }
}

/* iPhone-Fix: Datumsfeld im MPG-Mobile-Cardlayout sauber darstellen */
@media (max-width: 760px) {
    .mpg-device-table td:nth-child(6) {
        display: block !important;
        width: 100% !important;
        overflow: visible !important;
    }

    .mpg-device-table td:nth-child(6) input[type="date"] {
        -webkit-appearance: none !important;
        appearance: none !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 58px !important;
        padding: 13px 14px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        border: 1px solid #d1d5db !important;
        border-radius: 14px !important;
        background: #ffffff !important;
        color: #1f2933 !important;
        font-size: 1rem !important;
        font-weight: 800 !important;
        line-height: 1.3 !important;
        text-align: left !important;
    }

    .mpg-device-table td:nth-child(6) input[type="date"]::-webkit-date-and-time-value {
        text-align: left !important;
        width: 100% !important;
        display: block !important;
    }

    .mpg-device-table td:nth-child(6) input[type="date"]::-webkit-calendar-picker-indicator {
        margin-left: auto !important;
    }

    .mpg-device-table td:nth-child(6) .due-pill {
        margin-top: 12px !important;
        width: auto !important;
        max-width: 100% !important;
    }
}

/* Mobile-Fix: MPG-Anlegeformular Prüffrist + Notizen sauber einpassen */
@media (max-width: 760px) {
    .mpg-form input[type="date"],
    .mpg-form textarea {
        -webkit-appearance: none !important;
        appearance: none !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        border: 1px solid #d1d5db !important;
        border-radius: 14px !important;
        background: #ffffff !important;
        color: #1f2933 !important;
        font-size: 1rem !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
    }

    .mpg-form input[type="date"] {
        height: 58px !important;
        padding: 13px 14px !important;
        text-align: left !important;
    }

    .mpg-form input[type="date"]::-webkit-date-and-time-value {
        text-align: left !important;
        width: 100% !important;
        display: block !important;
    }

    .mpg-form input[type="date"]::-webkit-calendar-picker-indicator {
        margin-left: auto !important;
    }

    .mpg-form textarea {
        min-height: 118px !important;
        padding: 14px !important;
        resize: vertical !important;
    }

    .mpg-form .notes-field {
        width: 100% !important;
        max-width: 100% !important;
        display: grid !important;
    }
}


.checkbox-field {
    align-content: end;
}

.checkbox-row {
    min-height: 46px;
    padding: 11px 13px;
    border: 1px solid #d1d5db;
    border-radius: 13px;
    background: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #1f2933;
    font-weight: 800;
}

.checkbox-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--drk-red);
}

.battery-button {
    padding: 10px 14px;
    border: 0;
    border-radius: 12px;
    background: #f59e0b;
    color: #ffffff;
    font-weight: 800;
    cursor: pointer;
}

.battery-button:hover {
    background: #b45309;
}

.device-actions .battery-button {
    width: 100%;
}

@media (max-width: 760px) {
    .checkbox-row {
        min-height: 58px;
        border-radius: 14px;
    }

    .battery-button {
        width: 100%;
        min-height: 52px;
        border-radius: 16px;
        font-size: 0.95rem;
    }
}


.changelog-box h2 {
    margin-bottom: 20px;
}

.changelog-list {
    display: grid;
    gap: 14px;
}

.changelog-list article {
    padding: 16px 18px;
    border-radius: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-left: 5px solid var(--drk-red);
}

.changelog-list strong {
    display: block;
    margin-bottom: 6px;
    color: #1f2933;
    font-size: 1rem;
}

.changelog-list p {
    margin: 0;
    color: #4b5563;
    line-height: 1.55;
}

@media (max-width: 760px) {
    .changelog-list article {
        padding: 15px;
    }
}

.hp-field {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.battery-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 900;
    white-space: normal;
    line-height: 1.2;
}

.battery-none {
    background: rgba(107, 114, 128, 0.14);
    color: #4b5563;
}

.battery-active,
.battery-ok {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.battery-soon {
    background: rgba(245, 158, 11, 0.16);
    color: #92400e;
}

.battery-overdue {
    background: rgba(227, 6, 19, 0.14);
    color: var(--drk-red-dark);
}

.battery-unknown {
    background: rgba(107, 114, 128, 0.14);
    color: #4b5563;
}

@media (max-width: 760px) {
    .battery-pill {
        width: fit-content;
        max-width: 100%;
        margin-top: 10px;
        border-radius: 14px;
        font-size: 0.82rem;
    }
}

/* Ruhigere Statusanzeige für Prüffrist und Akku */
.mpg-status-stack {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}

.mpg-status-line {
    padding: 9px 11px;
    border-radius: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    display: grid;
    gap: 2px;
    line-height: 1.2;
}

.mpg-status-line span {
    color: #6b7280;
    font-size: 0.68rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.mpg-status-line strong {
    color: #1f2933;
    font-size: 0.82rem;
    font-weight: 900;
}

.mpg-status-line small {
    color: #4b5563;
    font-size: 0.76rem;
    font-weight: 800;
}

.mpg-status-line.due-ok,
.mpg-status-line.battery-ok,
.mpg-status-line.battery-active {
    background: rgba(22, 163, 74, 0.08);
    border-color: rgba(22, 163, 74, 0.22);
}

.mpg-status-line.due-ok strong,
.mpg-status-line.battery-ok strong,
.mpg-status-line.battery-active strong {
    color: #15803d;
}

.mpg-status-line.due-soon,
.mpg-status-line.battery-soon {
    background: rgba(245, 158, 11, 0.10);
    border-color: rgba(245, 158, 11, 0.26);
}

.mpg-status-line.due-soon strong,
.mpg-status-line.battery-soon strong {
    color: #92400e;
}

.mpg-status-line.due-overdue,
.mpg-status-line.battery-overdue {
    background: rgba(227, 6, 19, 0.10);
    border-color: rgba(227, 6, 19, 0.26);
}

.mpg-status-line.due-overdue strong,
.mpg-status-line.battery-overdue strong {
    color: var(--drk-red-dark);
}

@media (max-width: 760px) {
    .mpg-status-stack {
        margin-top: 12px;
    }

    .mpg-status-line {
        padding: 12px 14px;
        border-radius: 16px;
    }

    .mpg-status-line strong {
        font-size: 0.95rem;
    }

    .mpg-status-line small {
        font-size: 0.85rem;
    }
}


.telegram-link-box {
    margin-top: 22px;
    padding: 20px;
    border-radius: 18px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-left: 6px solid var(--drk-red);
}

.telegram-link-box h3 {
    margin: 0 0 10px;
    color: #1f2933;
}

.telegram-link-box p {
    margin: 0 0 14px;
    color: #4b5563;
    line-height: 1.55;
}

.telegram-link-box code {
    display: block;
    margin: 14px 0;
    padding: 14px 16px;
    border-radius: 14px;
    background: #111827;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.telegram-hint {
    font-size: 0.92rem;
}


.telegram-steps {
    margin: 12px 0 14px 20px;
    color: #374151;
    line-height: 1.55;
    font-weight: 700;
}

.telegram-steps li {
    margin-bottom: 6px;
}

.telegram-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 6px 0 16px;
    padding: 12px 16px;
    border-radius: 14px;
    background: var(--drk-red);
    color: #ffffff;
    text-decoration: none;
    font-weight: 900;
}

.telegram-button:hover {
    background: var(--drk-red-dark);
}

@media (max-width: 760px) {
    .telegram-button {
        width: 100%;
    }
}

.maintenance-page {
    min-height: 100vh;
    background:
        linear-gradient(120deg, rgba(0, 0, 0, 0.76), rgba(0, 0, 0, 0.34)),
        url("../images/background.jpeg") center center / cover no-repeat;
}

.maintenance-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.maintenance-card {
    width: min(560px, 100%);
    padding: 38px;
    border-radius: 28px;
    background: rgba(18, 24, 33, 0.82);
    box-shadow: 0 22px 55px rgba(0, 0, 0, 0.28);
    color: #ffffff;
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    text-align: center;
}

.maintenance-icon {
    width: 74px;
    height: 74px;
    margin: 0 auto 18px;
    border-radius: 24px;
    background: rgba(227, 6, 19, 0.18);
    border: 1px solid rgba(227, 6, 19, 0.42);
    display: grid;
    place-items: center;
    font-size: 2.3rem;
}

.maintenance-card .product-name {
    margin-bottom: 12px;
}

.maintenance-card h1 {
    margin: 0 0 14px;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.05;
}

.maintenance-card p {
    margin: 0 auto;
    max-width: 470px;
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.6;
}

.maintenance-note {
    margin-top: 18px !important;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    font-size: 0.92rem;
}

@media (max-width: 760px) {
    .maintenance-shell {
        padding: 20px;
    }

    .maintenance-card {
        padding: 28px 22px;
    }
}


.maintenance-admin-box {
    border-left-color: #f59e0b;
}

.maintenance-toggle-form {
    margin-top: 18px;
}

.maintenance-state {
    margin-top: 14px !important;
    color: #4b5563;
}

.maintenance-state strong {
    color: var(--drk-red-dark);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
    white-space: nowrap;
}

.status-badge-ok {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.status-badge-muted {
    background: rgba(107, 114, 128, 0.14);
    color: #4b5563;
}

.user-filter-bar {
    margin-bottom: 18px;
}

@media (max-width: 760px) {
    .user-filter-bar {
        grid-template-columns: 1fr !important;
    }

    .status-badge {
        border-radius: 14px;
        font-size: 0.86rem;
    }

    .user-table td:nth-child(7)::before { content: "Telegram" !important; }
    .user-table td:nth-child(8)::before { content: "Aktion" !important; }
}

/* Benutzerverwaltung Desktop-Fix nach zusätzlicher Telegram-Spalte */
.user-table.admin-table {
    min-width: 1180px;
    table-layout: fixed;
}

.user-table th:nth-child(1),
.user-table td:nth-child(1) {
    width: 11%;
}

.user-table th:nth-child(2),
.user-table td:nth-child(2) {
    width: 11%;
}

.user-table th:nth-child(3),
.user-table td:nth-child(3) {
    width: 16%;
    overflow-wrap: anywhere;
}

.user-table th:nth-child(4),
.user-table td:nth-child(4) {
    width: 18%;
}

.user-table th:nth-child(5),
.user-table td:nth-child(5) {
    width: 13%;
}

.user-table th:nth-child(6),
.user-table td:nth-child(6) {
    width: 12%;
}

.user-table th:nth-child(7),
.user-table td:nth-child(7) {
    width: 10%;
}

.user-table th:nth-child(8),
.user-table td:nth-child(8) {
    width: 9%;
}

.user-table .user-actions {
    min-width: 110px;
}

.user-table .user-actions .small-button,
.user-table .user-actions .danger-button {
    width: 100%;
    padding: 10px 8px;
    font-size: 0.82rem;
}

.admin-panel .admin-table-wrap {
    overflow-x: auto;
}

@media (max-width: 760px) {
    .user-table.admin-table {
        min-width: 0;
    }
}

/* Benutzerverwaltung: Desktop sauber in sichtbaren Bereich einpassen */
@media (min-width: 761px) {
    .user-table.admin-table {
        width: 100% !important;
        min-width: 0 !important;
        table-layout: fixed !important;
    }

    .user-table th,
    .user-table td {
        padding: 12px 10px !important;
        font-size: 0.88rem !important;
    }

    .user-table th:nth-child(1),
    .user-table td:nth-child(1) {
        width: 10% !important;
    }

    .user-table th:nth-child(2),
    .user-table td:nth-child(2) {
        width: 10% !important;
    }

    .user-table th:nth-child(3),
    .user-table td:nth-child(3) {
        width: 15% !important;
        overflow-wrap: anywhere !important;
    }

    .user-table th:nth-child(4),
    .user-table td:nth-child(4) {
        width: 18% !important;
    }

    .user-table th:nth-child(5),
    .user-table td:nth-child(5) {
        width: 13% !important;
    }

    .user-table th:nth-child(6),
    .user-table td:nth-child(6) {
        width: 12% !important;
    }

    .user-table th:nth-child(7),
    .user-table td:nth-child(7) {
        width: 11% !important;
    }

    .user-table th:nth-child(8),
    .user-table td:nth-child(8) {
        width: 11% !important;
    }

    .user-table select {
        width: 100% !important;
        min-width: 0 !important;
        padding: 9px 10px !important;
        font-size: 0.82rem !important;
    }

    .user-table .status-badge {
        font-size: 0.72rem !important;
        padding: 6px 8px !important;
        white-space: nowrap !important;
    }

    .user-table .user-actions {
        min-width: 0 !important;
        gap: 7px !important;
    }

    .user-table .user-actions .small-button,
    .user-table .user-actions .danger-button {
        width: 100% !important;
        padding: 9px 6px !important;
        font-size: 0.76rem !important;
    }

    .admin-panel .admin-table-wrap {
        overflow-x: visible !important;
    }
}

/* Feinschliff Benutzerverwaltung: Tabellenkopf sauber umbrechen */
@media (min-width: 761px) {
    .user-table th {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        line-height: 1.15 !important;
        font-size: 0.78rem !important;
    }

    .user-table th:nth-child(2),
    .user-table td:nth-child(2) {
        width: 12% !important;
    }

    .user-table th:nth-child(3),
    .user-table td:nth-child(3) {
        width: 14% !important;
    }

    .user-table th:nth-child(8),
    .user-table td:nth-child(8) {
        width: 10% !important;
    }
}


/* Benutzerverwaltung als Karten statt gequetschter Tabelle */
.user-card-list {
    display: grid;
    gap: 18px;
}

.user-card {
    padding: 22px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eef0f3;
}

.user-card-kicker {
    display: block;
    margin-bottom: 5px;
    color: #6b7280;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.user-card h3 {
    margin: 0;
    color: #1f2933;
    font-size: 1.25rem;
    line-height: 1.2;
}

.user-card-header p {
    margin: 6px 0 0;
    color: #4b5563;
    font-weight: 800;
}

.user-card-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.status-badge-warning {
    background: rgba(245, 158, 11, 0.16);
    color: #92400e;
}

.user-card-meta {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1.2fr;
    gap: 14px;
}

.user-card-meta div {
    padding: 14px;
    border-radius: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.user-card-meta span,
.user-card-form label {
    display: block;
    margin-bottom: 7px;
    color: #6b7280;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.user-card-meta strong {
    display: block;
    color: #1f2933;
    font-size: 0.96rem;
    overflow-wrap: anywhere;
}

.user-card-form {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 14px;
    align-items: end;
}

.user-card-form select,
.user-card-form input[type="text"] {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #d1d5db;
    border-radius: 13px;
    background: #ffffff;
    color: #1f2933;
    font: inherit;
    font-weight: 800;
}

.small-muted {
    margin: 12px 0 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    overflow-wrap: anywhere;
}

.user-card-delete {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.user-card-delete .danger-button {
    min-width: 180px;
}

@media (max-width: 1050px) {
    .user-card-meta {
        grid-template-columns: 1fr;
    }

    .user-card-form {
        grid-template-columns: 1fr;
    }

    .user-card-delete {
        display: block;
    }

    .user-card-delete .danger-button {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .user-card {
        padding: 20px;
        border-radius: 24px;
    }

    .user-card-header {
        display: grid;
    }

    .user-card-badges {
        justify-content: flex-start;
    }
}

/* MPG-Geräteübersicht als Kartenlayout */
.device-card-list {
    display: grid;
    gap: 18px;
}

.device-card {
    padding: 22px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.device-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eef0f3;
}

.device-card-kicker {
    display: block;
    margin-bottom: 5px;
    color: #6b7280;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.device-card h3 {
    margin: 0;
    color: #1f2933;
    font-size: 1.25rem;
    line-height: 1.2;
}

.device-card-header p {
    margin: 6px 0 0;
    color: #4b5563;
    font-weight: 800;
}

.detail-button {
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(227, 6, 19, 0.08);
    color: var(--drk-red-dark);
    border: 1px solid rgba(227, 6, 19, 0.18);
    text-decoration: none;
    white-space: nowrap;
}

.device-card-form {
    margin-top: 18px;
    display: grid;
    gap: 16px;
}

.device-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.device-card-grid label {
    display: grid;
    gap: 7px;
    color: #6b7280;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.device-card-grid input,
.device-card-grid select {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #d1d5db;
    border-radius: 13px;
    background: #ffffff;
    color: #1f2933;
    font: inherit;
    font-weight: 800;
    text-transform: none;
    letter-spacing: normal;
}

.device-card-grid input:focus,
.device-card-grid select:focus {
    outline: 3px solid rgba(227, 6, 19, 0.16);
    border-color: var(--drk-red);
}

.device-status-area {
    margin-top: 2px;
}

.device-status-area .mpg-status-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.device-card-actions {
    display: flex;
    justify-content: flex-end;
}

.device-card-actions .small-button {
    min-width: 220px;
}

.device-secondary-actions {
    margin-top: 14px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.device-secondary-actions form {
    margin: 0;
}

.device-secondary-actions .battery-button,
.device-secondary-actions .danger-button {
    min-width: 150px;
}

@media (max-width: 1180px) {
    .device-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .device-card {
        padding: 20px;
        border-radius: 24px;
    }

    .device-card-header {
        display: grid;
    }

    .device-card-actions-top {
        width: 100%;
    }

    .detail-button {
        width: 100%;
        justify-content: center;
    }

    .device-card-grid,
    .device-status-area .mpg-status-stack {
        grid-template-columns: 1fr;
    }

    .device-card-actions,
    .device-secondary-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .device-card-actions .small-button,
    .device-secondary-actions .battery-button,
    .device-secondary-actions .danger-button {
        width: 100%;
        min-width: 0;
    }
}

/* iPhone-Fix: Prüffrist-Datumsfeld im neuen MPG-Kartenlayout */
@media (max-width: 760px) {
    .device-card-grid input[type="date"] {
        -webkit-appearance: none !important;
        appearance: none !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 58px !important;
        padding: 13px 14px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
        border: 1px solid #d1d5db !important;
        border-radius: 14px !important;
        background: #ffffff !important;
        color: #1f2933 !important;
        font-size: 1rem !important;
        font-weight: 800 !important;
        line-height: 1.3 !important;
        text-align: left !important;
    }

    .device-card-grid input[type="date"]::-webkit-date-and-time-value {
        text-align: left !important;
        width: 100% !important;
        display: block !important;
    }

    .device-card-grid input[type="date"]::-webkit-calendar-picker-indicator {
        margin-left: auto !important;
    }
}

/* MPG-Filterleiste mit Kategorie und Standort */
@media (min-width: 1051px) {
    .filter-bar {
        grid-template-columns: 1.6fr 1fr 1fr 1fr 1fr auto auto;
    }
}

@media (max-width: 1050px) {
    .filter-bar {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 620px) {
    .filter-bar {
        grid-template-columns: 1fr;
    }
}


.detail-dashboard {
    display: grid;
    gap: 22px;
}

.detail-group-card {
    padding: 24px;
    border-radius: var(--radius-md);
    background: #ffffff;
    border-left: 7px solid var(--drk-red);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

.detail-group-card h2 {
    margin: 0 0 18px;
    color: #1f2933;
}

.detail-group-card .detail-grid {
    margin-top: 0;
}

@media (max-width: 760px) {
    .detail-dashboard {
        margin-left: 16px;
        margin-right: 16px;
    }

    .detail-group-card {
        padding: 22px;
        border-radius: 22px;
    }
}


.changelog-highlight {
    margin: 0 0 18px;
    padding: 16px 18px;
    border-radius: 18px;
    background: rgba(227, 6, 19, 0.08);
    border: 1px solid rgba(227, 6, 19, 0.18);
    border-left: 6px solid var(--drk-red);
}

.changelog-highlight span {
    display: block;
    margin-bottom: 6px;
    color: var(--drk-red-dark);
    font-size: 0.78rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.changelog-highlight strong {
    display: block;
    color: #1f2933;
    font-size: 1.05rem;
    line-height: 1.35;
}

.changelog-list article.changelog-today {
    background: #fff7f7;
    border-left-color: var(--drk-red);
}


.maintenance-toggle-form {
    display: grid;
    gap: 14px;
}

.maintenance-toggle-form label {
    display: grid;
    gap: 7px;
    color: #374151;
    font-size: 0.88rem;
    font-weight: 800;
}

.maintenance-toggle-form textarea,
.maintenance-toggle-form input[type="text"] {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #d1d5db;
    border-radius: 13px;
    background: #ffffff;
    color: #1f2933;
    font: inherit;
    font-weight: 700;
}

.maintenance-toggle-form textarea:focus,
.maintenance-toggle-form input[type="text"]:focus {
    outline: 3px solid rgba(227, 6, 19, 0.16);
    border-color: var(--drk-red);
}

.personnel-link-form {
    width: 100%;
    max-width: 100%;
    padding: 18px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
    box-sizing: border-box;
}

.personnel-link-form label {
    min-width: 0;
}

.personnel-link-form select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 12px 13px;
    border: 1px solid #d1d5db;
    border-radius: 13px;
    background: #ffffff;
    color: #1f2933;
    font: inherit;
    font-weight: 700;
    box-sizing: border-box;
}

.personnel-link-form select:focus {
    outline: 3px solid rgba(227, 6, 19, 0.16);
    border-color: var(--drk-red);
}

.personnel-link-form .small-button {
    width: fit-content;
    max-width: 100%;
    white-space: normal;
}

@media (max-width: 760px) {
    .personnel-link-form {
        padding: 16px;
        overflow: hidden;
    }

    .personnel-link-form .small-button {
        width: 100%;
    }
}

.audit-list {
    display: grid;
    gap: 14px;
}

.audit-entry {
    padding: 18px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-left: 6px solid var(--drk-red);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
}

.audit-entry-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef0f3;
}

.audit-action {
    display: inline-flex;
    margin-bottom: 7px;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(227, 6, 19, 0.10);
    color: var(--drk-red-dark);
    font-size: 0.76rem;
    font-weight: 900;
}

.audit-entry h3 {
    margin: 0;
    color: #1f2933;
    font-size: 1rem;
    line-height: 1.4;
}

.audit-date {
    color: #6b7280;
    font-size: 0.82rem;
    font-weight: 800;
    white-space: nowrap;
}

.audit-meta {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: #4b5563;
    font-size: 0.88rem;
}

.audit-meta strong {
    color: #1f2933;
}

@media (max-width: 760px) {
    .audit-entry-head {
        display: grid;
    }

    .audit-date {
        white-space: normal;
    }

    .audit-meta {
        display: grid;
        gap: 8px;
    }
}


.vehicle-card-list {
    display: grid;
    gap: 18px;
}

.loadout-hierarchy {
    display: grid;
    gap: 18px;
}

.loadout-vehicle-section {
    overflow: hidden;
}

.loadout-tree,
.loadout-tree ul {
    display: grid;
    gap: 10px;
    margin: 16px 0 0;
    padding-left: 0;
    list-style: none;
}

.loadout-tree ul {
    margin-top: 10px;
    padding-left: 22px;
    border-left: 2px solid #e5e7eb;
}

.loadout-tree-card,
.loadout-material-card {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    border-radius: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.loadout-tree-card a,
.loadout-material-card a,
.loadout-child-card a {
    color: #1d4ed8;
    font-weight: 900;
    text-decoration: none;
}

.loadout-tree-card a:hover,
.loadout-material-card a:hover,
.loadout-child-card a:hover {
    text-decoration: underline;
}

.loadout-tree-card p,
.loadout-material-card p {
    margin: 5px 0 0;
    color: #4b5563;
    font-weight: 750;
    line-height: 1.45;
}

.loadout-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
    color: #64748b;
    font-weight: 850;
}

.loadout-breadcrumb a {
    color: #1d4ed8;
    text-decoration: none;
}

.loadout-detail-summary {
    margin-top: 0;
}

.loadout-material-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.loadout-warning-stats {
    margin-top: 18px;
}

.loadout-warning-container {
    position: relative;
    margin-top: 28px;
    padding: 22px 26px;
    border-left: 7px solid var(--drk-red);
    border-radius: var(--radius-md);
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.07);
    overflow: hidden;
}

.loadout-warning-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.loadout-warning-header h2 {
    margin: 0 0 6px;
    color: #111827;
}

.loadout-warning-header .detail-notes {
    margin: 0;
    color: #6b7280;
    font-weight: 700;
    line-height: 1.45;
}

.loadout-warning-actions {
    justify-content: flex-end;
    flex-shrink: 0;
}

.loadout-warning-container .loadout-warning-compact {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
}

.loadout-warning-container .loadout-warning-summary-row {
    gap: 10px;
}

.loadout-warning-container .status-badge {
    font-weight: 800;
}

.loadout-status-strip {
    display: grid;
    grid-template-columns: repeat(9, minmax(92px, 1fr));
    gap: 8px;
}

.loadout-status-strip .mpg-stat-card {
    min-height: 0;
    padding: 10px 12px;
    border-radius: 10px;
    border-left-width: 4px;
    box-shadow: none;
}

.loadout-status-strip a.mpg-stat-card {
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.loadout-status-strip a.mpg-stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.loadout-status-strip a.mpg-stat-card:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.45);
    outline-offset: 3px;
}

.loadout-status-strip .mpg-stat-card > span {
    font-size: 0.68rem;
    line-height: 1.15;
    letter-spacing: 0.03em;
}

.loadout-status-strip .mpg-stat-card > strong {
    margin-top: 5px;
    font-size: 1.35rem;
}

@media (max-width: 1180px) {
    .loadout-status-strip {
        grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    }
}

@media (max-width: 420px) {
    .loadout-status-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .loadout-status-strip .mpg-stat-card {
        padding: 9px 10px;
    }

    .loadout-status-strip .mpg-stat-card > span {
        font-size: 0.64rem;
    }

    .loadout-status-strip .mpg-stat-card > strong {
        font-size: 1.18rem;
    }
}

.loadout-warning-list {
    margin-top: 14px;
}

.loadout-warning-compact {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.loadout-warning-summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.loadout-warning-detail-body {
    margin-top: 14px;
}

.loadout-active-warning-filter {
    margin-top: 8px !important;
}

.loadout-active-warning-filter a {
    color: var(--drk-red);
    font-weight: 800;
    text-decoration: none;
}

.loadout-active-warning-filter a:hover,
.loadout-active-warning-filter a:focus-visible {
    text-decoration: underline;
}

@media (max-width: 720px) {
    .loadout-warning-container {
        padding: 20px;
    }

    .loadout-warning-header {
        display: grid;
        gap: 14px;
    }

    .loadout-warning-actions {
        width: 100%;
        justify-content: stretch;
    }

    .loadout-warning-actions .export-button,
    .loadout-warning-actions .small-button {
        width: 100%;
    }
}

.loadout-filter-panel {
    margin-top: 18px;
}

.loadout-filter-grid {
    align-items: end;
}

.loadout-filter-result {
    margin-top: 12px;
}

.loadout-order-container {
    margin-top: 28px;
}

.loadout-order-container .loadout-warning-header {
    align-items: flex-start;
}

.loadout-order-heading {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 760px;
}

.loadout-order-description {
    display: block;
    max-width: 720px;
    white-space: normal;
}

.loadout-order-container .loadout-warning-compact {
    justify-content: flex-start;
}

.loadout-order-detail-body {
    margin-top: 18px;
}

.loadout-order-table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
}

.loadout-order-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 860px;
}

.loadout-order-table th,
.loadout-order-table td {
    padding: 12px 14px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.loadout-order-table th {
    background: #f9fafb;
    color: #374151;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.loadout-order-table td {
    color: #1f2937;
    font-weight: 700;
}

.loadout-order-table small {
    color: #6b7280;
    font-weight: 700;
}

.loadout-order-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 850;
    white-space: nowrap;
}

.loadout-order-check input {
    width: 18px;
    height: 18px;
    accent-color: var(--drk-red);
}

.loadout-order-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.loadout-order-empty {
    margin-top: 18px;
    padding: 18px 20px;
    border: 1px dashed #d1d5db;
    border-radius: 14px;
    background: #f9fafb;
    color: #4b5563;
    font-weight: 750;
}

@media (max-width: 720px) {
    .loadout-order-container .loadout-warning-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .loadout-order-heading,
    .loadout-order-description {
        max-width: 100%;
    }

    .loadout-order-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .loadout-order-actions .small-button,
    .loadout-order-actions .export-button {
        width: 100%;
        text-align: center;
    }
}

.loadout-section-badges {
    align-items: center;
}

.loadout-section-toggle {
    margin-left: 4px;
}

.loadout-section-body {
    margin-top: 14px;
}

.loadout-tree-card-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.loadout-warning-card h3 {
    margin: 0;
    color: #1f2933;
    font-size: 1.05rem;
}

.loadout-warning-card a {
    color: #1d4ed8;
    font-weight: 900;
    text-decoration: none;
}

.loadout-warning-card a:hover {
    text-decoration: underline;
}

.loadout-detail-warning-box {
    border-left: 5px solid var(--drk-red);
}

.loadout-detail-warning-box .section-title-row {
    margin-bottom: 12px;
}

.loadout-detail-warning-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.loadout-detail-warning-note {
    margin: 12px 0 0;
    color: #4b5563;
    font-weight: 850;
    line-height: 1.45;
}

.loadout-check-list {
    margin-top: 22px;
}

.loadout-check-start-button {
    margin-top: 2px;
}

.loadout-shortage-note {
    color: var(--drk-red-dark) !important;
    font-weight: 900 !important;
}

.loadout-group-grid {
    margin-top: 18px;
}

.loadout-check-input-grid {
    min-width: min(420px, 100%);
}

.loadout-history-preview-title {
    margin-top: 22px;
}

.loadout-history-card {
    display: grid;
    gap: 14px;
}

.loadout-history-link {
    justify-self: flex-start;
    text-decoration: none;
}

.loadout-item-edit-card {
    box-shadow: none;
}

.loadout-material-card h3 {
    margin: 0;
    color: #1f2933;
    font-size: 1.05rem;
    line-height: 1.25;
}

.loadout-material-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    min-width: 140px;
}

.flash-message {
    margin: 0;
    font-weight: 850;
    line-height: 1.5;
}

.flash-message-error {
    color: #b91c1c;
}

.flash-message-success {
    color: #166534;
}

.vehicle-card {
    padding: 22px;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.vehicle-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid #eef0f3;
}

.vehicle-card-kicker {
    display: block;
    margin-bottom: 5px;
    color: #6b7280;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.vehicle-card h3 {
    margin: 0;
    color: #1f2933;
    font-size: 1.35rem;
    line-height: 1.2;
}

.vehicle-card-header p {
    margin: 6px 0 0;
    color: #4b5563;
    font-weight: 800;
}

.vehicle-card-meta {
    margin-top: 18px;
}

.vehicle-driver-placeholder {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    background: #f9fafb;
    border: 1px dashed #cbd5e1;
}

.vehicle-driver-placeholder h4 {
    margin: 0 0 8px;
    color: #1f2933;
}

.vehicle-driver-placeholder p {
    margin: 0;
    color: #4b5563;
    line-height: 1.55;
}

@media (max-width: 760px) {
    .loadout-tree ul {
        padding-left: 14px;
    }

    .loadout-tree-card,
    .loadout-material-card {
        display: grid;
    }

    .loadout-warning-compact,
    .loadout-section-badges {
        display: grid;
        width: 100%;
    }

    .loadout-wide-toggle,
    .loadout-section-toggle {
        width: 100%;
        margin-left: 0;
    }

    .loadout-tree-card-actions {
        justify-content: flex-start;
    }

    .loadout-material-badges {
        display: grid;
        justify-content: flex-start;
        min-width: 0;
        width: 100%;
    }

    .loadout-detail-warning-badges {
        display: grid;
        grid-template-columns: 1fr;
    }

    .loadout-material-badges .small-button {
        width: 100%;
    }

    .loadout-history-link {
        width: 100%;
        justify-self: stretch;
    }

    .vehicle-card {
        padding: 20px;
        border-radius: 24px;
    }

    .vehicle-card-header {
        display: grid;
    }
}


.vehicle-card-form {
    margin-top: 18px;
    display: grid;
    gap: 16px;
}

.vehicle-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.vehicle-card-grid label,
.vehicle-notes-field {
    display: grid;
    gap: 7px;
    color: #6b7280;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.vehicle-card-grid input,
.vehicle-card-grid select,
.vehicle-notes-field textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #d1d5db;
    border-radius: 13px;
    background: #ffffff;
    color: #1f2933;
    font: inherit;
    font-weight: 800;
    text-transform: none;
    letter-spacing: normal;
}

.vehicle-notes-field textarea {
    min-height: 96px;
    resize: vertical;
}

.vehicle-card-grid input:focus,
.vehicle-card-grid select:focus,
.vehicle-notes-field textarea:focus {
    outline: 3px solid rgba(227, 6, 19, 0.16);
    border-color: var(--drk-red);
}

@media (max-width: 1180px) {
    .vehicle-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .vehicle-card-grid {
        grid-template-columns: 1fr;
    }

    .vehicle-card-grid input[type="date"],
    .vehicle-card-grid input[type="month"] {
        -webkit-appearance: none;
        appearance: none;
        min-height: 58px;
    }
}


.vehicle-mileage-summary {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.vehicle-mileage-summary div {
    padding: 14px;
    border-radius: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.vehicle-mileage-summary span {
    display: block;
    margin-bottom: 7px;
    color: #6b7280;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.vehicle-mileage-summary strong {
    display: block;
    color: #1f2933;
    font-size: 1.05rem;
}

@media (max-width: 760px) {
    .vehicle-mileage-summary {
        grid-template-columns: 1fr;
    }
}


.fleet-stats-grid-six {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.fleet-stat-neutral {
    border-left-color: #94a3b8;
}

.fleet-stat-workshop {
    border-left-color: #f97316;
}

.fleet-stats-grid .mpg-stat-card {
    min-width: 0;
    overflow: hidden;
}

.fleet-stats-grid .mpg-stat-card > span {
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
}

@media (max-width: 1300px) {
    .fleet-stats-grid-six {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .fleet-stats-grid-six {
        grid-template-columns: 1fr;
    }
}


.personnel-card-form {
    margin-top: 18px;
    display: grid;
    gap: 16px;
}

.status-badge-danger {
    background: rgba(227, 6, 19, 0.14);
    color: var(--drk-red-dark);
}

@media (max-width: 760px) {
    .personnel-card-form .vehicle-card-grid {
        grid-template-columns: 1fr;
    }
}


.personnel-card-form {
    margin-top: 18px;
    display: grid;
    gap: 18px;
}

.personnel-section {
    padding: 18px;
    border-radius: 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.personnel-section h4 {
    margin: 0 0 14px;
    color: #1f2933;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.checkbox-grid .checkbox-row {
    min-height: 44px;
    margin: 0;
}

.inline-info-box {
    margin: 0 0 14px;
    padding: 14px 16px;
    border-radius: 16px;
    box-shadow: none;
}

.inline-info-box p {
    margin: 6px 0 0;
}

.status-badge-danger {
    background: rgba(227, 6, 19, 0.14);
    color: var(--drk-red-dark);
}

@media (max-width: 1050px) {
    .checkbox-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .personnel-section {
        padding: 16px;
    }
}


.user-card-quick-actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}

.user-card-quick-actions .detail-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 760px) {
    .user-card-quick-actions .detail-button {
        width: 100%;
    }
}


.mpg-instruction-form {
    margin-top: 18px;
    display: grid;
    gap: 18px;
}

.instruction-personnel-section {
    margin-top: 0;
}

.instruction-personnel-grid .checkbox-row {
    align-items: flex-start;
}

.instruction-personnel-grid small {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.3;
}

@media (max-width: 760px) {
    .mpg-instruction-form .history-form-grid {
        grid-template-columns: 1fr;
    }
}


/* Detailseiten: mehr Luft zwischen Topbar und erster Karte */
.dashboard > .detail-dashboard:first-of-type,
.dashboard > .info-box:first-of-type {
    margin-top: 22px;
}

.mpg-instruction-form select {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #d1d5db;
    border-radius: 13px;
    background: #ffffff;
    color: #1f2933;
    font: inherit;
    font-weight: 800;
}


.certificate-list-title {
    margin: 22px 0 12px;
    color: #1f2933;
}

.inline-signature-note {
    align-self: end;
    min-height: 58px;
}


.personal-filter-panel {
    margin-bottom: 18px;
}

.personal-filter-bar {
    grid-template-columns: 1.6fr 1fr 1fr 1fr auto auto;
}

.personal-filter-bar input[type="text"] {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #d1d5db;
    border-radius: 13px;
    background: #ffffff;
    color: #1f2933;
    font: inherit;
    font-weight: 800;
}

.personal-filter-bar input[type="text"]:focus {
    outline: 3px solid rgba(227, 6, 19, 0.16);
    border-color: var(--drk-red);
}

@media (max-width: 1200px) {
    .personal-filter-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .personal-filter-bar {
        grid-template-columns: 1fr;
    }

    .personal-filter-panel {
        padding: 18px;
    }

    .personal-filter-panel .personal-filter-toggle {
        width: 100% !important;
        min-height: 42px !important;
        margin: 0 !important;
        padding: 10px 14px !important;
        border-radius: 12px !important;
        background: var(--drk-red) !important;
        border: 0 !important;
        color: #ffffff !important;
        box-shadow: none !important;
    }

    .personal-filter-panel.filter-open .personal-filter-toggle {
        margin-bottom: 14px !important;
    }
}


.certificate-mini-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.certificate-mini-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.certificate-mini-item strong {
    display: block;
    color: #1f2933;
}

.certificate-mini-item span {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 0.82rem;
    font-weight: 700;
}

@media (max-width: 760px) {
    .certificate-mini-item {
        display: grid;
    }

    .certificate-mini-item .detail-button {
        width: 100%;
    }
}


.instruction-overview-section {
    display: grid;
    gap: 18px;
}

.instruction-overview-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 16px;
}

.instruction-overview-card,
.certificate-document-section {
    padding: 18px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-left: 6px solid var(--drk-red);
}

.instruction-card-head,
.certificate-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.instruction-card-head span,
.certificate-section-head span {
    display: block;
    margin-bottom: 5px;
    color: #6b7280;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.instruction-card-head strong,
.certificate-section-head h5 {
    display: block;
    margin: 0;
    color: #1f2933;
    font-size: 1.05rem;
    font-weight: 950;
}

.instruction-fact-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.instruction-fact-grid div {
    padding: 12px;
    border-radius: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.instruction-fact-grid span {
    display: block;
    margin-bottom: 5px;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.instruction-fact-grid strong {
    display: block;
    color: #1f2933;
    font-size: 0.92rem;
    overflow-wrap: anywhere;
}

.instruction-fact-wide {
    grid-column: 1 / -1;
}

.instruction-last-note,
.instruction-empty {
    margin: 14px 0 0;
    color: #4b5563;
    line-height: 1.55;
}

.certificate-document-list {
    margin-top: 10px;
}

.certificate-document-item small {
    display: block;
    margin-top: 5px;
    color: #6b7280;
    font-size: 0.78rem;
    line-height: 1.35;
}

.vehicle-certificate-placeholder {
    border-left-color: #94a3b8;
}

@media (max-width: 1050px) {
    .instruction-overview-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .instruction-fact-grid {
        grid-template-columns: 1fr;
    }

    .instruction-overview-card,
    .certificate-document-section {
        padding: 16px;
    }
}


.permission-notice {
    border-left-color: #64748b;
    background: #f8fafc;
}

.permission-notice h2 {
    color: #1f2933;
}


.driver-license-check-card {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 18px;
    background: var(--surface-bg-soft);
    border: 1px solid var(--border-soft);
    border-left: 6px solid #f59e0b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.driver-license-check-card span {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.driver-license-check-card strong {
    display: block;
    color: var(--text-main);
    font-size: 1rem;
}

.driver-license-check-card small {
    display: block;
    margin-top: 5px;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.35;
}

.driver-license-check-card form {
    margin: 0;
    flex-shrink: 0;
}

.driver-license-self-service-card {
    display: grid;
    align-items: flex-start;
    gap: 18px;
}

.driver-license-status-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
}

.driver-license-status-copy {
    min-width: 0;
}

.driver-license-status-action {
    flex: 0 0 auto;
    display: grid;
    justify-items: end;
    gap: 8px;
}

.driver-license-live-toggle {
    min-height: 40px;
}

.driver-license-live-check-body {
    width: 100%;
}

.driver-license-pending-note {
    max-width: 260px;
    text-align: right;
}

.driver-license-pending-body {
    margin-top: -4px;
}

.driver-license-upload-form {
    display: grid;
    gap: 10px;
    width: 100%;
}

.driver-license-upload-form label {
    display: grid;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-muted);
}

.driver-license-upload-form input[type="file"] {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    background: var(--input-bg);
    color: var(--text-main);
}

.driver-license-camera-intro,
.driver-license-file-fallback {
    display: grid;
    gap: 10px;
}

.driver-license-camera-intro p,
.driver-license-file-fallback summary {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.4;
}

.driver-license-file-fallback {
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--surface-bg);
}

.driver-license-file-fallback summary {
    cursor: pointer;
    color: var(--text-main);
}

.driver-license-camera-panel {
    display: grid;
    gap: 12px;
}

.driver-license-camera-button {
    min-height: 44px;
    min-width: 44px;
    width: fit-content;
    max-width: 100%;
    padding: 11px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 900;
    line-height: 1.15;
    text-decoration: none;
    cursor: pointer;
    color: var(--text-main);
    background: var(--surface-bg);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.10);
}

.driver-license-camera-button-primary {
    border-color: var(--danger-accent);
    background: var(--danger-accent);
    color: #ffffff;
}

.driver-license-camera-button-secondary {
    border-color: var(--border-soft);
    background: var(--surface-bg);
    color: var(--text-main);
}

.driver-license-camera-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.driver-license-camera-stage {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background: #111827;
    aspect-ratio: 4 / 3;
}

.driver-license-camera-stage video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.driver-license-camera-capture-row {
    display: flex;
    justify-content: stretch;
    margin-top: -2px;
}

.driver-license-camera-capture-button {
    width: 100%;
    min-height: 48px;
}

.driver-license-camera-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 0 38%, rgba(0, 0, 0, 0.50) 39% 100%);
}

.driver-license-card-mask {
    width: min(86%, 520px);
    aspect-ratio: 85.6 / 54;
    border: 3px solid rgba(255, 255, 255, 0.92);
    border-radius: 18px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.36), 0 0 24px rgba(255, 255, 255, 0.30);
    display: grid;
    place-items: end center;
    padding: 14px;
}

.driver-license-card-mask span {
    display: inline-flex;
    margin: 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.72);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: none;
}

.driver-license-camera-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.driver-license-camera-preview-grid figure {
    margin: 0;
    display: grid;
    gap: 6px;
}

.driver-license-camera-preview-grid figcaption {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 900;
}

.driver-license-camera-preview-grid img {
    width: 100%;
    aspect-ratio: 85.6 / 54;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
}

.driver-license-camera-actions {
    justify-content: start;
    flex-wrap: wrap;
    gap: 10px;
}

.driver-license-review-entry {
    margin-top: 18px;
}

.driver-license-review-list {
    display: grid;
    gap: 12px;
}

.driver-license-review-item {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background: var(--surface-bg-soft);
}

.driver-license-review-item h3,
.driver-license-review-item p {
    margin: 0;
}

.driver-license-review-item small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
}

.driver-license-request-card {
    align-items: center;
}

.driver-license-review-actions {
    align-items: center;
    flex: 0 0 auto;
    gap: 10px;
}

.driver-license-review-button {
    min-height: 44px;
    min-width: 0;
    width: auto;
    flex: 0 0 auto;
    align-self: center;
    padding: 10px 16px;
    line-height: 1.1;
}

.driver-license-detail-layout {
    display: grid;
    gap: 20px;
}

.driver-license-image-grid,
.driver-license-warning-grid,
.driver-license-metadata-grid,
.driver-license-ocr-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.driver-license-image-grid figure {
    margin: 0;
    display: grid;
    gap: 8px;
}

.driver-license-image-grid figcaption {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-muted);
}

.driver-license-image-grid img {
    width: 100%;
    max-height: 520px;
    object-fit: contain;
    border-radius: 14px;
    border: 1px solid var(--border-soft);
    background: var(--surface-bg-soft);
}

.driver-license-metadata-grid article {
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--surface-bg-soft);
}

.driver-license-metadata-grid h3,
.driver-license-warning-grid h3 {
    margin: 0 0 10px;
}

.driver-license-metadata-grid dl {
    margin: 0;
    display: grid;
    gap: 8px;
}

.driver-license-metadata-grid dl div {
    display: grid;
    grid-template-columns: minmax(110px, 0.4fr) minmax(0, 1fr);
    gap: 10px;
}

.driver-license-metadata-grid dt {
    color: var(--text-muted);
    font-weight: 800;
}

.driver-license-metadata-grid dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.driver-license-ocr-raw {
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    padding: 14px;
    background: var(--surface-bg-soft);
}

.driver-license-ocr-raw summary {
    cursor: pointer;
    font-weight: 900;
}

.driver-license-ocr-columns pre {
    min-height: 160px;
    max-height: 360px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    padding: 12px;
    border-radius: 12px;
    background: var(--input-bg);
    border: 1px solid var(--border-soft);
    color: var(--text-main);
}

.driver-license-review-form {
    display: grid;
    gap: 16px;
}

.danger-button {
    background: var(--danger-accent);
}

@media (max-width: 760px) {
    .driver-license-check-card {
        display: grid;
    }

    .driver-license-check-card .small-button {
        width: 100%;
    }

    .driver-license-review-item,
    .driver-license-self-service-card {
        display: grid;
    }

    .driver-license-status-row,
    .driver-license-status-action {
        display: grid;
        justify-items: stretch;
    }

    .driver-license-pending-note {
        max-width: none;
        text-align: left;
    }

    .driver-license-review-actions {
        justify-content: stretch;
    }

    .driver-license-review-button {
        width: 100%;
    }

    .driver-license-image-grid,
    .driver-license-warning-grid,
    .driver-license-metadata-grid,
    .driver-license-ocr-columns,
    .driver-license-camera-preview-grid {
        grid-template-columns: 1fr;
    }

    .driver-license-metadata-grid dl div {
        grid-template-columns: 1fr;
    }

    .driver-license-camera-button,
    .driver-license-camera-actions {
        width: 100%;
    }

    .driver-license-camera-capture-row {
        margin-top: 0;
    }

    .driver-license-camera-capture-button {
        min-height: 52px;
    }
}


.sync-output-box {
    padding: 16px;
    border-radius: 16px;
    background: #111827;
    color: #ffffff;
    overflow-x: auto;
    white-space: pre-wrap;
    font-size: 0.9rem;
    line-height: 1.5;
}

.sync-error-box {
    background: #7f1d1d;
}


.maintenance-collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.maintenance-collapsible-header h2 {
    margin-bottom: 6px;
}

.maintenance-status-line {
    margin: 0;
    color: #4b5563;
    font-weight: 800;
}

.status-text-active {
    color: var(--drk-red-dark);
}

.status-text-inactive {
    color: #15803d;
}

.maintenance-toggle-button {
    white-space: nowrap;
}

.maintenance-collapsible-body {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
}

@media (max-width: 760px) {
    .maintenance-collapsible-header {
        display: grid;
    }

    .maintenance-toggle-button {
        width: 100%;
    }
}


.floating-top-button {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 999;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 94px;
    padding: 12px 16px;
    border-radius: 999px;
    background: var(--drk-red);
    color: #ffffff;
    font-weight: 950;
    text-decoration: none;
    box-shadow: 0 14px 34px rgba(227, 6, 19, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.floating-top-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(227, 6, 19, 0.34);
}

.linked-personnel-focus {
    border-left-color: #0f766e;
}

@media (max-width: 760px) {
    .floating-top-button {
        right: 14px;
        bottom: 16px;
        min-width: 86px;
        padding: 11px 14px;
        font-size: 0.9rem;
    }
}


/* Mobile Layout-Fix: verhindert, dass Topbar/Kopfzeile zwischen Detailkarten rutscht */
@media (max-width: 760px) {
    .app-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }

    .sidebar {
        order: 1 !important;
        width: 100% !important;
        position: static !important;
    }

    .dashboard {
        order: 2 !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .dashboard > .topbar {
        order: -100 !important;
        position: relative !important;
        top: auto !important;
        margin-bottom: 20px !important;
    }

    .dashboard > .detail-dashboard,
    .dashboard > .info-box,
    .dashboard > .admin-panel,
    .dashboard > .module-section,
    .dashboard > .app-footer {
        order: 0 !important;
    }

    .dashboard > .detail-dashboard:first-of-type,
    .dashboard > .info-box:first-of-type {
        margin-top: 0 !important;
    }
}

/* FINALER MOBILE ORDER RESET:
   Keine künstliche Umsortierung mehr. Reihenfolge folgt dem Template:
   Sidebar/Menu -> Topbar -> Inhalte -> Footer */
@media (max-width: 760px) {
    .app-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
    }

    .sidebar {
        order: 0 !important;
        position: static !important;
        width: 100% !important;
    }

    .dashboard {
        order: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }

    .dashboard > .topbar,
    .dashboard > .hero-panel,
    .dashboard > .maintenance-admin-box,
    .dashboard > .module-section,
    .dashboard > .changelog-box,
    .dashboard > .detail-dashboard,
    .dashboard > .info-box,
    .dashboard > .admin-panel,
    .dashboard > .app-footer {
        order: 0 !important;
    }

    .dashboard > .topbar {
        margin-top: 0 !important;
        margin-bottom: 20px !important;
        position: relative !important;
        top: auto !important;
    }

    .dashboard > .app-footer {
        margin-top: 28px !important;
    }
}



.mobile-nav-toggle {
    display: none;
}

@media (max-width: 760px) {
    .mobile-nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin: 18px 0 8px;
        padding: 15px 18px;
        border: 1px solid rgba(227, 6, 19, 0.28);
        border-radius: 18px;
        background: rgba(227, 6, 19, 0.08);
        color: var(--drk-red-dark);
        font: inherit;
        font-weight: 950;
        cursor: pointer;
    }

    .sidebar .module-nav {
        display: none;
    }

    .sidebar.mobile-nav-open .module-nav {
        display: grid;
    }

    .sidebar.mobile-nav-open {
        padding-bottom: 22px;
    }
}


.grouped-module-nav {
    display: grid;
    gap: 22px;
}

.nav-group {
    display: grid;
    gap: 8px;
}

.nav-group + .nav-group {
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
}

.nav-group-admin {
    border-top-color: rgba(227, 6, 19, 0.18);
}

.nav-group-personal {
    border-top-color: #e5e7eb;
}

.grouped-module-nav .nav-title {
    margin: 0 0 6px;
    color: #6b7280;
    font-size: 0.76rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.09em;
}

.grouped-module-nav .nav-item {
    position: relative;
}

.grouped-module-nav .nav-item.active {
    border-color: rgba(227, 6, 19, 0.28);
    background: rgba(227, 6, 19, 0.08);
    color: var(--drk-red-dark);
}

.grouped-module-nav .nav-item.active::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 50%;
    width: 4px;
    height: 24px;
    border-radius: 999px;
    background: var(--drk-red);
    transform: translateY(-50%);
}

.grouped-module-nav .nav-item.active {
    padding-left: 22px;
}

@media (max-width: 760px) {
    .grouped-module-nav {
        gap: 18px;
    }

    .nav-group + .nav-group {
        padding-top: 16px;
    }

    .grouped-module-nav .nav-item {
        min-height: 54px;
        display: flex;
        align-items: center;
    }
}

/* Statistik-Karten: Zahlen auf gleicher Höhe ausrichten */
.mpg-stat-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.mpg-stat-card > span {
    min-height: 2.55em;
    display: flex;
    align-items: flex-start;
    line-height: 1.18;
}

.mpg-stat-card > strong {
    margin-top: 8px;
    line-height: 1;
}

/* Personal-Stats etwas kompakter, aber weiterhin sauber ausgerichtet */
.personal-filter-panel + .mpg-stats-grid .mpg-stat-card > span,
.fleet-stats-grid .mpg-stat-card > span {
    min-height: 2.55em;
}

@media (max-width: 760px) {
    .mpg-stat-card > span {
        min-height: auto;
    }
}


/* FINAL MOBILE DASHBOARD ORDER PATCH:
   Statistik-/Statusübersichten dürfen mobil nicht unter den Footer rutschen.
   Footer immer ganz ans Ende. */
@media (max-width: 760px) {
    .dashboard {
        display: flex !important;
        flex-direction: column !important;
    }

    .dashboard > * {
        order: 0 !important;
    }

    .dashboard > .topbar {
        order: 0 !important;
    }

    .dashboard > .hero-panel,
    .dashboard > .personal-filter-panel,
    .dashboard > .filter-bar,
    .dashboard > .mpg-stats-grid,
    .dashboard > .fleet-stats-grid,
    .dashboard > .module-section,
    .dashboard > .admin-panel,
    .dashboard > .info-box,
    .dashboard > .detail-dashboard,
    .dashboard > .changelog-box {
        order: 0 !important;
    }

    .dashboard > .app-footer {
        order: 9999 !important;
        margin-top: 28px !important;
    }
}



.collapsible-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.collapsible-section-header h2 {
    margin-bottom: 6px;
}

.collapsible-section-header p {
    margin: 0;
    color: #6b7280;
    font-weight: 700;
    line-height: 1.45;
}

.collapsible-toggle-button {
    white-space: nowrap;
}

.collapsible-section-body {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
}

@media (max-width: 760px) {
    .collapsible-section-header {
        display: grid;
    }

    .collapsible-toggle-button {
        width: 100%;
    }
}

/* Mobile Breiten-Fix: Karten dürfen nicht nach rechts aus dem Viewport laufen */
@media (max-width: 760px) {
    .dashboard,
    .dashboard > *,
    .admin-panel,
    .info-box,
    .user-card,
    .personnel-card,
    .device-card,
    .vehicle-card,
    .detail-group-card,
    .module-card,
    .mpg-stat-card {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .user-card-list,
    .personnel-card-list,
    .device-card-list,
    .vehicle-card-list {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .personnel-card,
    .user-card,
    .device-card,
    .vehicle-card {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Mobile Filter-/Exportbereiche einklappbar */
.filter-collapse-toggle {
    display: none;
}

@media (max-width: 760px) {
    .filter-collapse-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin: 0 0 14px;
        padding: 14px 18px;
        border-radius: 18px;
        border: 1px solid rgba(227, 6, 19, 0.28);
        background: rgba(227, 6, 19, 0.08);
        color: var(--drk-red-dark);
        font: inherit;
        font-weight: 950;
        cursor: pointer;
    }

    .filter-collapse-panel.filter-collapsed .filter-bar,
    .filter-collapse-panel.filter-collapsed .export-actions {
        display: none !important;
    }

    .filter-collapse-panel.filter-open .filter-bar {
        display: grid !important;
    }

    .filter-collapse-panel.filter-open .export-actions {
        display: flex !important;
    }

    .filter-collapse-panel .section-title-row-actions {
        display: grid;
        gap: 14px;
    }

    .filter-collapse-panel .export-actions {
        width: 100%;
    }

    .filter-collapse-panel .export-actions a {
        width: 100%;
        justify-content: center;
    }
}


/* FINAL Mobile Personal Card Width Fix:
   Personalakten dürfen mobil nicht rechts abgeschnitten werden. */
@media (max-width: 760px) {
    html,
    body {
        overflow-x: hidden !important;
    }

    .app-page {
        overflow-x: hidden !important;
    }

    .app-layout,
    .dashboard,
    .dashboard > section,
    .admin-panel,
    .user-card-list,
    .personnel-card-list {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        overflow-x: visible !important;
    }

    .dashboard {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .personnel-card-list,
    .user-card-list {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }

    .personnel-card,
    .user-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 18px !important;
        padding-right: 18px !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    .user-card-header,
    .user-card-meta,
    .driver-license-check-card,
    .personnel-section,
    .vehicle-card-grid,
    .checkbox-grid,
    .instruction-overview-grid,
    .certificate-document-section {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }

    .user-card-meta,
    .vehicle-card-grid,
    .checkbox-grid,
    .instruction-overview-grid {
        grid-template-columns: 1fr !important;
    }

    .user-card-header {
        display: grid !important;
        gap: 14px !important;
    }

    .user-card-badges {
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }

    .personnel-card textarea,
    .personnel-card input,
    .personnel-card select {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}


/* FINAL Mobile Centering Fix:
   Einheitliche linke/rechte Abstände auf Mobilgeräten.
   Verhindert Abschneiden UND optisches Verschieben nach rechts. */
@media (max-width: 760px) {
    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .app-page {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .app-layout {
        width: calc(100% - 28px) !important;
        max-width: calc(100% - 28px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
    }

    .sidebar,
    .dashboard {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
    }

    .dashboard > section,
    .dashboard > .topbar,
    .dashboard > .hero-panel,
    .dashboard > .info-box,
    .dashboard > .admin-panel,
    .dashboard > .module-section,
    .dashboard > .mpg-stats-grid,
    .dashboard > .fleet-stats-grid,
    .dashboard > .detail-dashboard,
    .dashboard > .app-footer {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }

    .mpg-stats-grid,
    .fleet-stats-grid,
    .module-grid,
    .user-card-list,
    .personnel-card-list,
    .device-card-list,
    .vehicle-card-list {
        width: 100% !important;
        max-width: 100% !important;
        grid-template-columns: 1fr !important;
        box-sizing: border-box !important;
    }

    .mpg-stat-card,
    .module-card,
    .user-card,
    .personnel-card,
    .device-card,
    .vehicle-card,
    .info-box,
    .admin-panel,
    .detail-group-card {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }
}


/* Mobile Navigation Button optisch kompakter */
@media (max-width: 760px) {
    .mobile-nav-toggle {
        width: auto !important;
        min-width: 230px !important;
        max-width: 280px !important;
        margin: 18px auto 8px !important;
        padding: 14px 22px !important;
        border-radius: 999px !important;
        box-shadow: 0 10px 24px rgba(227, 6, 19, 0.12);
    }
}


/* === KATSPAD MOBILE CONSOLIDATION FINAL START === */
/* Finaler mobiler Layout-Override:
   Ziel: stabile Reihenfolge, gleiche Seitenabstände, keine abgeschnittenen Karten,
   Footer immer unten, Navigation einklappbar, Filter einklappbar. */
@media (max-width: 760px) {
    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .app-page {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .app-layout {
        display: flex !important;
        flex-direction: column !important;
        width: calc(100% - 28px) !important;
        max-width: 620px !important;
        min-width: 0 !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        gap: 20px !important;
        box-sizing: border-box !important;
    }

    .sidebar {
        order: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        position: static !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        box-sizing: border-box !important;
    }

    .sidebar-logo {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 112px !important;
        padding: 14px !important;
        box-sizing: border-box !important;
    }

    .sidebar-logo img {
        width: min(100%, 300px) !important;
        max-width: 100% !important;
        max-height: 112px !important;
        height: auto !important;
    }

    .mobile-nav-toggle {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        min-width: 230px !important;
        max-width: 280px !important;
        margin: 18px auto 8px !important;
        padding: 14px 22px !important;
        border-radius: 999px !important;
        border: 1px solid rgba(227, 6, 19, 0.28) !important;
        background: rgba(227, 6, 19, 0.08) !important;
        color: var(--drk-red-dark) !important;
        font: inherit !important;
        font-weight: 950 !important;
        cursor: pointer !important;
        box-shadow: 0 10px 24px rgba(227, 6, 19, 0.12) !important;
    }

    .sidebar .module-nav {
        display: none !important;
    }

    .sidebar.mobile-nav-open .module-nav {
        display: grid !important;
    }

    .dashboard {
        order: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
        overflow-x: visible !important;
    }

    .dashboard > * {
        order: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
    }

    .dashboard > .topbar {
        order: 0 !important;
        position: relative !important;
        top: auto !important;
        margin-top: 0 !important;
        margin-bottom: 20px !important;
    }

    .dashboard > .app-footer {
        order: 9999 !important;
        margin-top: 28px !important;
    }

    .hero-panel,
    .info-box,
    .admin-panel,
    .module-section,
    .detail-dashboard,
    .changelog-box,
    .maintenance-admin-box,
    .mpg-stats-grid,
    .fleet-stats-grid,
    .module-grid,
    .user-card-list,
    .personnel-card-list,
    .device-card-list,
    .vehicle-card-list {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
        overflow-x: visible !important;
    }

    .mpg-stats-grid,
    .fleet-stats-grid,
    .module-grid,
    .user-card-list,
    .personnel-card-list,
    .device-card-list,
    .vehicle-card-list,
    .detail-dashboard,
    .user-card-meta,
    .vehicle-card-grid,
    .checkbox-grid,
    .instruction-overview-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }

    .mpg-stat-card,
    .module-card,
    .user-card,
    .personnel-card,
    .device-card,
    .vehicle-card,
    .detail-group-card,
    .instruction-overview-card,
    .certificate-document-section {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    .user-card,
    .personnel-card,
    .device-card,
    .vehicle-card {
        padding-left: 18px !important;
        padding-right: 18px !important;
    }

    .user-card-header {
        display: grid !important;
        gap: 14px !important;
    }

    .user-card-badges {
        justify-content: flex-start !important;
        flex-wrap: wrap !important;
    }

    .personnel-card textarea,
    .personnel-card input,
    .personnel-card select,
    .device-card textarea,
    .device-card input,
    .device-card select,
    .vehicle-card textarea,
    .vehicle-card input,
    .vehicle-card select {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .filter-collapse-toggle {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        margin: 0 0 14px !important;
        padding: 14px 18px !important;
        border-radius: 18px !important;
        border: 1px solid rgba(227, 6, 19, 0.28) !important;
        background: rgba(227, 6, 19, 0.08) !important;
        color: var(--drk-red-dark) !important;
        font: inherit !important;
        font-weight: 950 !important;
        cursor: pointer !important;
    }

    .filter-collapse-panel.filter-collapsed .filter-bar,
    .filter-collapse-panel.filter-collapsed .export-actions {
        display: none !important;
    }

    .filter-collapse-panel.filter-open .filter-bar {
        display: grid !important;
    }

    .filter-collapse-panel.filter-open .export-actions {
        display: flex !important;
    }

    .filter-collapse-panel .section-title-row-actions {
        display: grid !important;
        gap: 14px !important;
    }

    .filter-collapse-panel .export-actions {
        width: 100% !important;
        max-width: 100% !important;
        flex-direction: column !important;
    }

    .filter-collapse-panel .export-actions a {
        width: 100% !important;
        justify-content: center !important;
    }

    .mpg-stat-card {
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
    }

    .mpg-stat-card > span {
        min-height: auto !important;
        display: block !important;
        line-height: 1.18 !important;
    }

    .mpg-stat-card > strong {
        margin-top: 10px !important;
        line-height: 1 !important;
    }

    .floating-top-button {
        right: 14px !important;
        bottom: 16px !important;
        min-width: 86px !important;
        padding: 11px 14px !important;
        font-size: 0.9rem !important;
    }
}
/* === KATSPAD MOBILE CONSOLIDATION FINAL END === */


/* Passwort-vergessen / Passwort-zurücksetzen: Logo kompakt halten */
.login-card .login-logo {
    width: 100% !important;
    max-width: 260px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.login-card .login-logo img {
    width: 100% !important;
    max-width: 260px !important;
    height: auto !important;
    display: block !important;
    object-fit: contain !important;
    border-radius: 18px !important;
}

@media (max-width: 760px) {
    .login-card .login-logo {
        max-width: 220px !important;
    }

    .login-card .login-logo img {
        max-width: 220px !important;
    }
}



/* FINAL Readmode Notice Styling */
.permission-notice {
    border-left-color: #64748b !important;
    background: #f8fafc !important;
}

.permission-notice h2 {
    color: #1f2933 !important;
}

.permission-notice p {
    color: #4b5563 !important;
    font-weight: 700;
    line-height: 1.55;
}


/* Fuhrpark UI Sichtbar Fix */
.vehicle-add-box select[multiple],
.vehicle-card select[multiple] {
    min-height: 132px;
}

.collapsible-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
}

.collapsible-section-header h2 {
    margin-bottom: 6px;
}

.collapsible-section-header p {
    margin: 0;
    color: #6b7280;
    font-weight: 700;
    line-height: 1.45;
}

.collapsible-toggle-button {
    white-space: nowrap;
}

.collapsible-section-body {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
}

@media (max-width: 760px) {
    .collapsible-section-header {
        display: grid;
    }

    .collapsible-toggle-button {
        width: 100%;
    }
}

/* Fuhrpark: Abstand zwischen Speichern-/Archivieren-Aktionen */
.vehicle-card form + form {
    margin-top: 14px;
}

.vehicle-card .device-card-actions + .device-card-actions {
    margin-top: 14px;
}

.vehicle-card .device-card-actions {
    gap: 12px;
}

.vehicle-card .small-button,
.vehicle-card .danger-button {
    margin-top: 0;
}

@media (max-width: 760px) {
    .vehicle-card form + form {
        margin-top: 16px;
    }

    .vehicle-card .device-card-actions {
        display: grid;
        gap: 14px;
    }

    .vehicle-card .small-button,
    .vehicle-card .danger-button {
        width: 100%;
    }
}



/* Fuhrpark Search Filter Styling */
@media (max-width: 760px) {
    .admin-panel .filter-bar {
        grid-template-columns: 1fr !important;
    }
}


/* Fuhrpark Manual Filter Collapse */
.filter-collapse-manual {
    margin: 16px 0 22px;
}

.manual-filter-toggle {
    width: 100%;
}

#fuhrpark-filter-panel {
    margin-top: 14px;
}

@media (min-width: 761px) {
    .manual-filter-toggle {
        max-width: 360px;
    }
}


/* Fuhrpark Unified Tools Collapse */
.fuhrpark-tools-collapse {
    margin: 16px 0 22px;
}

.fuhrpark-tools-collapse .manual-filter-toggle {
    width: 100%;
}

.fuhrpark-export-actions {
    margin-bottom: 16px;
}

#fuhrpark-tools-panel .filter-bar {
    margin-top: 0;
}

@media (min-width: 761px) {
    .fuhrpark-tools-collapse .manual-filter-toggle {
        max-width: 360px;
    }

    .fuhrpark-export-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }
}

@media (max-width: 760px) {
    .fuhrpark-export-actions {
        display: grid !important;
        gap: 12px !important;
    }

    .fuhrpark-export-actions .export-button {
        width: 100% !important;
        justify-content: center !important;
    }
}


.vehicle-device-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.vehicle-device-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.vehicle-device-item strong {
    display: block;
    color: #1f2933;
}

.vehicle-device-item span {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 0.84rem;
    font-weight: 700;
}

@media (max-width: 760px) {
    .vehicle-device-item {
        display: grid;
    }

    .vehicle-device-item .detail-button {
        width: 100%;
    }
}


/* Detail Collapsible Cards */
.detail-collapsible-card {
    padding-top: 0 !important;
}

.detail-collapsible-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-top: 20px;
}

.detail-collapsible-header h2 {
    margin: 0 !important;
}

.detail-collapse-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 112px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(227, 6, 19, 0.28);
    background: rgba(227, 6, 19, 0.08);
    color: var(--drk-red-dark);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 950;
    cursor: pointer;
}

.detail-collapse-button:hover {
    background: rgba(227, 6, 19, 0.13);
}

.detail-collapsible-body {
    margin-top: 18px;
}

.detail-collapsible-body[hidden] {
    display: none !important;
}

@media (max-width: 760px) {
    .detail-collapsible-header {
        display: grid;
        gap: 12px;
    }

    .detail-collapse-button {
        width: 100%;
    }
}

/* Einheitliche Detail-Einklappbuttons */
.detail-collapsible-header {
    align-items: center !important;
}

.detail-collapse-button {
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
    height: 44px !important;
    padding: 0 18px !important;
    border-radius: 999px !important;
    text-align: center !important;
}

@media (max-width: 760px) {
    .detail-collapsible-header {
        display: grid !important;
        gap: 14px !important;
    }

    .detail-collapse-button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        height: 48px !important;
        justify-self: stretch !important;
    }
}



/* FINAL Detail Button Uniform Force */
.detail-collapsible-card,
.detail-collapsible-header,
.detail-collapsible-body {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.detail-collapsible-header {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    align-items: stretch !important;
}

.detail-collapse-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 48px !important;
    padding: 0 18px !important;
    margin: 0 !important;
    border-radius: 999px !important;
    box-sizing: border-box !important;
    text-align: center !important;
}


/* Fuhrpark Driver Eligibility Styling */
.vehicle-requirement-box {
    padding: 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-left: 6px solid var(--drk-red);
    margin-bottom: 18px;
}

.vehicle-requirement-box span {
    display: block;
    margin-bottom: 6px;
    color: #6b7280;
    font-size: 0.76rem;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

.vehicle-requirement-box strong {
    display: block;
    color: #1f2933;
    font-size: 1.05rem;
}

.driver-eligibility-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.driver-eligibility-card {
    padding: 18px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.driver-eligibility-card h3 {
    margin: 0 0 14px;
    color: #1f2933;
}

.driver-eligibility-warning {
    border-left: 6px solid #f59e0b;
}

.compact-person-list {
    display: grid;
    gap: 10px;
}

.compact-person-row {
    padding: 12px;
    border-radius: 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.compact-person-row strong {
    display: block;
    color: #1f2933;
}

.compact-person-row span {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 0.84rem;
    font-weight: 700;
}

@media (max-width: 760px) {
    .driver-eligibility-grid {
        grid-template-columns: 1fr !important;
    }
}


/* Vehicle Instruction Foundation Styling */
.vehicle-instruction-placeholder {
    padding: 16px;
    border-radius: 18px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-left: 6px solid #64748b;
}


/* Vehicle Instruction UI Styling */
.vehicle-instruction-form {
    margin-top: 18px;
    display: grid;
    gap: 18px;
}

.vehicle-instruction-box .instruction-personnel-grid small {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.3;
}

@media (max-width: 760px) {
    .vehicle-instruction-form .history-form-grid {
        grid-template-columns: 1fr !important;
    }
}


/* Vehicle Instruction Status Small Text */
.vehicle-requirement-box small {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1.35;
}


/* Vehicle Instruction Clean Layout */
.vehicle-instruction-subsection {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
}

.vehicle-instruction-subsection:first-of-type {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.vehicle-instruction-subsection h3 {
    margin: 0 0 14px;
    color: #1f2933;
    font-weight: 950;
}


/* FINAL Detail Collapse Button Cleanup */
.detail-collapsible-header {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    align-items: start !important;
}

.detail-collapse-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 280px !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 48px !important;
    padding: 0 18px !important;
    margin: 0 !important;
    border-radius: 999px !important;
    box-sizing: border-box !important;
    text-align: center !important;
    justify-self: start !important;
}

@media (max-width: 760px) {
    .detail-collapse-button {
        width: 280px !important;
        max-width: 100% !important;
        justify-self: start !important;
    }
}


/* Fuhrpark Unified Desktop Mobile Tools */
.fuhrpark-tools-collapse {
    margin: 16px 0 22px;
}

.fuhrpark-tools-collapse .manual-filter-toggle {
    width: 100%;
}

.fuhrpark-export-actions {
    margin-bottom: 16px;
}

#fuhrpark-tools-panel .filter-bar {
    margin-top: 0;
}

@media (min-width: 761px) {
    .fuhrpark-tools-collapse .manual-filter-toggle {
        max-width: 360px;
    }

    .fuhrpark-export-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
    }
}

@media (max-width: 760px) {
    .fuhrpark-export-actions {
        display: grid !important;
        gap: 12px !important;
    }

    .fuhrpark-export-actions .export-button {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* FUHRPARK DESKTOP TOOLS BUTTON FIX */
.fuhrpark-tools-collapse .filter-collapse-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 260px !important;
    max-width: 360px !important;
    margin: 0 0 16px !important;
    padding: 14px 22px !important;
    border-radius: 18px !important;
    border: 1px solid rgba(227, 6, 19, 0.28) !important;
    background: rgba(227, 6, 19, 0.08) !important;
    color: var(--drk-red-dark) !important;
    font: inherit !important;
    font-weight: 950 !important;
    cursor: pointer !important;
}

@media (max-width: 760px) {
    .fuhrpark-tools-collapse .filter-collapse-toggle {
        width: 100% !important;
        max-width: 100% !important;
    }
}



/* FUHRPARK_MATCH_MPG_DESKTOP_LAYOUT */
@media (min-width: 761px) {
    .section-title-row-actions .export-actions {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 12px;
    }

    .admin-panel > .filter-bar {
        margin-top: 18px;
    }
}

@media (max-width: 760px) {
    .section-title-row-actions .export-actions {
        display: grid !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .section-title-row-actions .export-actions .export-button {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* FUHRPARK MOBILE TOOLS: Desktop wie MPG, Mobile einklappbar */
.fuhrpark-mobile-tools-toggle {
    display: none;
}

@media (max-width: 760px) {
    .fuhrpark-mobile-tools-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin: 14px 0 16px;
        padding: 14px 18px;
        border-radius: 18px;
        border: 1px solid rgba(227, 6, 19, 0.28);
        background: rgba(227, 6, 19, 0.08);
        color: var(--drk-red-dark);
        font: inherit;
        font-weight: 950;
        cursor: pointer;
    }

    .fuhrpark-overview-panel.fuhrpark-tools-collapsed .section-title-row-actions .export-actions,
    .fuhrpark-overview-panel.fuhrpark-tools-collapsed .fuhrpark-filter-panel {
        display: none !important;
    }

    .fuhrpark-overview-panel.fuhrpark-tools-open .section-title-row-actions .export-actions {
        display: grid !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .fuhrpark-overview-panel.fuhrpark-tools-open .fuhrpark-filter-panel {
        display: grid !important;
    }
}

/* PERSONAL: kompakte Darstellung für Einweisungen & Bescheinigungen */
.personnel-card .instruction-overview-grid {
    gap: 14px !important;
}

.personnel-card .instruction-overview-card {
    padding: 14px 16px !important;
}

.personnel-card .instruction-card-head {
    margin-bottom: 10px !important;
}

.personnel-card .instruction-card-grid {
    gap: 10px !important;
}

.personnel-card .instruction-last-note,
.personnel-card .instruction-empty {
    margin-top: 8px !important;
    font-size: 0.86rem !important;
    line-height: 1.38 !important;
}

.personnel-card .certificate-document-section {
    margin-top: 18px !important;
    padding: 14px 16px !important;
}

.personnel-card .certificate-section-head {
    margin-bottom: 10px !important;
}

.personnel-card .certificate-section-head h5 {
    margin: 0 !important;
}

.personnel-card .certificate-document-list {
    display: grid !important;
    gap: 10px !important;
    max-height: 260px !important;
    overflow-y: auto !important;
    padding-right: 4px !important;
}

.personnel-card .certificate-document-item {
    padding: 12px 14px !important;
    border-radius: 14px !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 12px !important;
    align-items: center !important;
}

.personnel-card .certificate-document-item strong {
    font-size: 0.92rem !important;
    line-height: 1.25 !important;
}

.personnel-card .certificate-document-item span,
.personnel-card .certificate-document-item small {
    font-size: 0.78rem !important;
    line-height: 1.28 !important;
}

.personnel-card .certificate-document-item .detail-button {
    white-space: nowrap !important;
}

.personnel-card .certificate-file-status {
    justify-self: end !important;
    max-width: 180px !important;
    white-space: normal !important;
    text-align: center !important;
}

@media (max-width: 760px) {
    .personnel-card .certificate-document-list {
        max-height: 320px !important;
    }

    .personnel-card .certificate-document-item {
        grid-template-columns: 1fr !important;
    }

    .personnel-card .certificate-document-item .detail-button {
        width: 100% !important;
        justify-content: center !important;
    }

    .personnel-card .certificate-file-status {
        justify-self: stretch !important;
        max-width: none !important;
    }
}



/* PERSONAL_CARD_COLLAPSE_FINAL */
.personal-card-collapse-ready .user-card-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 16px !important;
    align-items: start !important;
}

.personal-card-toggle-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 170px !important;
    height: 44px !important;
    padding: 0 18px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(227, 6, 19, 0.28) !important;
    background: rgba(227, 6, 19, 0.08) !important;
    color: var(--drk-red-dark) !important;
    font: inherit !important;
    font-weight: 950 !important;
    cursor: pointer !important;
}

.personal-card-collapsible-body {
    margin-top: 18px !important;
}

.personal-card-collapsible-body[hidden] {
    display: none !important;
}

.personal-card-collapsed {
    padding-bottom: 22px !important;
}

@media (max-width: 760px) {
    .personal-card-collapse-ready .user-card-header {
        grid-template-columns: 1fr !important;
    }

    .personal-card-toggle-button {
        width: 100% !important;
        min-width: 0 !important;
    }
}


/* OVERVIEW_CARD_COLLAPSE_FINAL */
.overview-card-collapse-ready .vehicle-card-header,
.overview-card-collapse-ready .device-card-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 16px !important;
    align-items: start !important;
}

.overview-card-toggle-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 170px !important;
    height: 44px !important;
    padding: 0 18px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(227, 6, 19, 0.28) !important;
    background: rgba(227, 6, 19, 0.08) !important;
    color: var(--drk-red-dark) !important;
    font: inherit !important;
    font-weight: 950 !important;
    cursor: pointer !important;
}

.overview-card-collapsible-body {
    margin-top: 18px !important;
}

.overview-card-collapsible-body[hidden] {
    display: none !important;
}

.overview-card-collapsed {
    padding-bottom: 22px !important;
}

@media (max-width: 760px) {
    .overview-card-collapse-ready .vehicle-card-header,
    .overview-card-collapse-ready .device-card-header {
        grid-template-columns: 1fr !important;
    }

    .overview-card-toggle-button {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* DETAIL HISTORY / CERTIFICATE COMPACT LISTS
   Für MPG-Detail und Fuhrpark-Detail:
   Einweisungen, Teilnehmer und PDF-Bescheinigungen kompakt und scrollbar anzeigen. */
.detail-collapsible-body .history-list {
    display: grid !important;
    gap: 10px !important;
    max-height: 360px !important;
    overflow-y: auto !important;
    padding-right: 6px !important;
}

.detail-collapsible-body .history-entry {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 14px !important;
    min-height: 0 !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
}

.detail-collapsible-body .history-entry > div {
    min-width: 0 !important;
}

.detail-collapsible-body .history-entry strong {
    font-size: 0.92rem !important;
    line-height: 1.25 !important;
}

.detail-collapsible-body .history-entry span,
.detail-collapsible-body .history-entry p {
    font-size: 0.82rem !important;
    line-height: 1.32 !important;
}

.detail-collapsible-body .history-entry p {
    margin: 6px 0 0 !important;
}

.detail-collapsible-body .history-entry .detail-button {
    white-space: nowrap !important;
    justify-self: end !important;
}

@media (max-width: 760px) {
    .detail-collapsible-body .history-list {
        max-height: 420px !important;
    }

    .detail-collapsible-body .history-entry {
        grid-template-columns: 1fr !important;
    }

    .detail-collapsible-body .history-entry .detail-button {
        width: 100% !important;
        justify-content: center !important;
        justify-self: stretch !important;
    }
}


/* REPAIR: Detail-History-Listen kompakt, aber ohne Grid-Zerstörung */
.detail-collapsible-body .history-list {
    display: grid !important;
    gap: 10px !important;
    max-height: 340px !important;
    overflow-y: auto !important;
    padding-right: 6px !important;
}

.detail-collapsible-body .history-entry {
    display: block !important;
    min-height: 0 !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
}

.detail-collapsible-body .history-entry > div {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 14px !important;
    min-width: 0 !important;
}

.detail-collapsible-body .history-entry strong {
    display: block !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    font-size: 0.95rem !important;
    line-height: 1.25 !important;
}

.detail-collapsible-body .history-entry span {
    display: block !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    font-size: 0.82rem !important;
    line-height: 1.3 !important;
    color: #6b7280 !important;
    font-weight: 800 !important;
}

.detail-collapsible-body .history-entry p {
    margin: 8px 0 0 !important;
    font-size: 0.86rem !important;
    line-height: 1.35 !important;
}

/* PDF-/Bescheinigungslisten deutlich kompakter */
.detail-collapsible-body .history-entry .detail-button {
    display: inline-flex !important;
    width: auto !important;
    min-width: 150px !important;
    height: 38px !important;
    padding: 0 14px !important;
    justify-content: center !important;
    align-items: center !important;
    white-space: nowrap !important;
}

/* Wenn ein History-Eintrag nur PDF-Link enthält: keine riesige freie Fläche */
.detail-collapsible-body .history-entry:has(.detail-button) {
    min-height: 0 !important;
}

@media (max-width: 760px) {
    .detail-collapsible-body .history-list {
        max-height: 420px !important;
    }

    .detail-collapsible-body .history-entry > div {
        display: grid !important;
        gap: 8px !important;
    }

    .detail-collapsible-body .history-entry .detail-button {
        width: 100% !important;
    }
}


/* FINAL: Detailseiten PDF-/Bescheinigungszeilen kompakt darstellen */
.detail-collapsible-body .history-list .history-entry:has(.detail-button) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 14px !important;
    min-height: unset !important;
    height: auto !important;
    padding: 12px 14px !important;
}

.detail-collapsible-body .history-list .history-entry:has(.detail-button) > div {
    display: grid !important;
    gap: 4px !important;
    min-width: 0 !important;
}

.detail-collapsible-body .history-list .history-entry:has(.detail-button) > p {
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
}

.detail-collapsible-body .history-list .history-entry:has(.detail-button) .detail-button {
    margin: 0 !important;
    width: auto !important;
    min-width: 170px !important;
    height: 38px !important;
    padding: 0 14px !important;
}

.detail-collapsible-body .history-list .history-entry:has(.detail-button) strong {
    margin: 0 !important;
    line-height: 1.2 !important;
}

.detail-collapsible-body .history-list .history-entry:has(.detail-button) span {
    margin: 0 !important;
    line-height: 1.25 !important;
}

@media (max-width: 760px) {
    .detail-collapsible-body .history-list .history-entry:has(.detail-button) {
        grid-template-columns: 1fr !important;
    }

    .detail-collapsible-body .history-list .history-entry:has(.detail-button) > p {
        justify-content: stretch !important;
    }

    .detail-collapsible-body .history-list .history-entry:has(.detail-button) .detail-button {
        width: 100% !important;
    }
}



/* DETAIL_HISTORY_LIMIT_FINAL */
.history-entry-extra[hidden] {
    display: none !important;
}

.history-list-toggle-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    min-width: 180px;
    height: 42px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(227, 6, 19, 0.28);
    background: rgba(227, 6, 19, 0.08);
    color: var(--drk-red-dark);
    font: inherit;
    font-weight: 950;
    cursor: pointer;
}

.history-list-toggle-button:hover {
    background: rgba(227, 6, 19, 0.13);
}

@media (max-width: 760px) {
    .history-list-toggle-button {
        width: 100%;
    }
}


/* OVERVIEW_CARD_COLLAPSE_CLEAN */
.overview-card-collapse-ready .vehicle-card-header,
.overview-card-collapse-ready .device-card-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 16px !important;
    align-items: start !important;
}

.overview-card-toggle-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 170px !important;
    height: 44px !important;
    padding: 0 18px !important;
    border-radius: 999px !important;
    border: 1px solid rgba(227, 6, 19, 0.28) !important;
    background: rgba(227, 6, 19, 0.08) !important;
    color: var(--drk-red-dark) !important;
    font: inherit !important;
    font-weight: 950 !important;
    cursor: pointer !important;
}

.overview-card-collapsible-body {
    margin-top: 18px !important;
}

.overview-card-collapsible-body[hidden] {
    display: none !important;
}

.overview-card-collapsed {
    padding-bottom: 22px !important;
}

@media (max-width: 760px) {
    .overview-card-collapse-ready .vehicle-card-header,
    .overview-card-collapse-ready .device-card-header {
        grid-template-columns: 1fr !important;
    }

    .overview-card-toggle-button {
        width: 100% !important;
        min-width: 0 !important;
    }
}


/* UNIFIED_CARD_TOGGLE_LABELS_AND_DETAIL_VISIBILITY */
.overview-card-toggle-button {
    background: rgba(15, 23, 42, 0.06) !important;
    border-color: rgba(15, 23, 42, 0.18) !important;
    color: #1f2937 !important;
}

.overview-card-toggle-button:hover {
    background: rgba(15, 23, 42, 0.10) !important;
}

.overview-card-collapsed .vehicle-card-header .fleet-detail-button,
.overview-card-collapsed .device-card-header .device-card-actions-top {
    display: none !important;
}

.overview-card-open .vehicle-card-header .fleet-detail-button,
.overview-card-open .device-card-header .device-card-actions-top {
    display: flex !important;
}

/* FUHRPARK: Detailbutton optisch an MPG-Detailbutton angleichen */
.vehicle-card-header .fleet-detail-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: fit-content !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    padding: 10px 16px !important;
    border-radius: 999px !important;
    font-weight: 900 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
}

@media (max-width: 760px) {
    .overview-card-open .vehicle-card-header .fleet-detail-button {
        width: 100% !important;
        justify-content: center !important;
    }
}


/* FUHRPARK: Status direkt neben Fahrzeugname/Kennzeichen */
.vehicle-title-status-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.vehicle-title-status-row h3 {
    margin: 0 !important;
}

.vehicle-status-inline {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

@media (max-width: 760px) {
    .vehicle-title-status-row {
        display: grid;
        gap: 8px;
    }

    .vehicle-status-inline {
        justify-content: flex-start !important;
    }
}


/* FINAL: Aufklappen/Einklappen in MPG/Fuhrpark wie Detailbutton positionieren */
.overview-card-collapse-ready .vehicle-card-header,
.overview-card-collapse-ready .device-card-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    gap: 12px !important;
    align-items: start !important;
}

.overview-card-toggle-button {
    width: auto !important;
    min-width: 150px !important;
    max-width: 190px !important;
    height: 40px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    justify-self: end !important;
    align-self: start !important;
    font-size: 0.9rem !important;
    white-space: nowrap !important;
}

.overview-card-open .vehicle-card-header .device-card-actions-top,
.overview-card-open .device-card-header .device-card-actions-top {
    justify-self: end !important;
    align-self: start !important;
}

.overview-card-open .vehicle-card-header .fleet-detail-button,
.overview-card-open .device-card-header .detail-button {
    height: 40px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
}

/* Im eingeklappten Zustand gibt es nur den Aufklappen-Button rechts */
.overview-card-collapsed .vehicle-card-header,
.overview-card-collapsed .device-card-header {
    grid-template-columns: minmax(0, 1fr) auto !important;
}

/* Mobil bleiben die Buttons untereinander und voll breit */
@media (max-width: 760px) {
    .overview-card-collapse-ready .vehicle-card-header,
    .overview-card-collapse-ready .device-card-header,
    .overview-card-collapsed .vehicle-card-header,
    .overview-card-collapsed .device-card-header {
        grid-template-columns: 1fr !important;
    }

    .overview-card-toggle-button,
    .overview-card-open .vehicle-card-header .fleet-detail-button,
    .overview-card-open .device-card-header .detail-button {
        width: 100% !important;
        max-width: 100% !important;
        justify-self: stretch !important;
    }
}


/* FINAL: MPG/Fuhrpark Kartenaktionen rechts sauber stapeln */
.overview-card-collapse-ready .vehicle-card-header,
.overview-card-collapse-ready .device-card-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 14px !important;
    align-items: start !important;
}

.overview-card-open .vehicle-card-header .device-card-actions-top,
.overview-card-open .device-card-header .device-card-actions-top {
    grid-column: 2 !important;
    grid-row: 1 !important;
    justify-self: end !important;
    align-self: start !important;
    display: flex !important;
}

.overview-card-toggle-button {
    grid-column: 2 !important;
    grid-row: 2 !important;
    justify-self: end !important;
    align-self: start !important;
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
    height: 40px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
}

.overview-card-open .vehicle-card-header .fleet-detail-button,
.overview-card-open .device-card-header .detail-button {
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
    height: 40px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    justify-content: center !important;
    white-space: nowrap !important;
}

/* Eingeklappt: nur Aufklappen rechts oben */
.overview-card-collapsed .vehicle-card-header,
.overview-card-collapsed .device-card-header {
    grid-template-columns: minmax(0, 1fr) auto !important;
}

.overview-card-collapsed .overview-card-toggle-button {
    grid-column: 2 !important;
    grid-row: 1 !important;
}

/* Mobil: Buttons untereinander vollbreit */
@media (max-width: 760px) {
    .overview-card-collapse-ready .vehicle-card-header,
    .overview-card-collapse-ready .device-card-header,
    .overview-card-collapsed .vehicle-card-header,
    .overview-card-collapsed .device-card-header {
        grid-template-columns: 1fr !important;
    }

    .overview-card-open .vehicle-card-header .device-card-actions-top,
    .overview-card-open .device-card-header .device-card-actions-top,
    .overview-card-toggle-button {
        grid-column: 1 !important;
        grid-row: auto !important;
        justify-self: stretch !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    .overview-card-open .vehicle-card-header .fleet-detail-button,
    .overview-card-open .device-card-header .detail-button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
}



/* FINAL_CARD_ACTION_GROUP: Details + Aufklappen als gemeinsame Aktionsgruppe */
.overview-card-collapse-ready .vehicle-card-header,
.overview-card-collapse-ready .device-card-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 16px !important;
    align-items: start !important;
}

.overview-card-collapse-ready .device-card-actions-top {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    justify-items: end !important;
    align-items: start !important;
    min-width: 180px !important;
}

.overview-card-toggle-button,
.overview-card-collapse-ready .device-card-actions-top .detail-button,
.overview-card-collapse-ready .device-card-actions-top .fleet-detail-button {
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
    height: 40px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    justify-content: center !important;
    align-items: center !important;
    white-space: nowrap !important;
}

.overview-card-toggle-button {
    display: inline-flex !important;
    background: rgba(15, 23, 42, 0.06) !important;
    border: 1px solid rgba(15, 23, 42, 0.18) !important;
    color: #1f2937 !important;
    font: inherit !important;
    font-weight: 950 !important;
    cursor: pointer !important;
}

.overview-card-collapsed .device-card-actions-top .detail-button,
.overview-card-collapsed .device-card-actions-top .fleet-detail-button {
    display: none !important;
}

.overview-card-open .device-card-actions-top .detail-button,
.overview-card-open .device-card-actions-top .fleet-detail-button {
    display: inline-flex !important;
}

@media (max-width: 760px) {
    .overview-card-collapse-ready .vehicle-card-header,
    .overview-card-collapse-ready .device-card-header {
        grid-template-columns: 1fr !important;
    }

    .overview-card-collapse-ready .device-card-actions-top {
        width: 100% !important;
        min-width: 0 !important;
        justify-items: stretch !important;
    }

    .overview-card-toggle-button,
    .overview-card-collapse-ready .device-card-actions-top .detail-button,
    .overview-card-collapse-ready .device-card-actions-top .fleet-detail-button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
}


/* FIX: Aufklappen-Button im eingeklappten Zustand sichtbar lassen */
.overview-card-collapse-ready .device-card-actions-top {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    justify-items: end !important;
    align-items: start !important;
    min-width: 180px !important;
}

/* Der Aktionsbereich bleibt sichtbar, nur der echte Detail-Link wird eingeklappt versteckt */
.overview-card-collapsed .device-card-actions-top {
    display: grid !important;
}

.overview-card-collapsed .device-card-actions-top .detail-link,
.overview-card-collapsed .device-card-actions-top .fleet-detail-button {
    display: none !important;
}

/* Der Aufklappen/Einklappen-Button bleibt immer sichtbar */
.overview-card-collapse-ready .overview-card-toggle-button {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
    height: 40px !important;
    align-items: center !important;
    justify-content: center !important;
}

@media (max-width: 760px) {
    .overview-card-collapse-ready .device-card-actions-top {
        width: 100% !important;
        min-width: 0 !important;
        justify-items: stretch !important;
    }

    .overview-card-collapse-ready .overview-card-toggle-button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
}


/* FINAL FIX: Aktionsbereich bleibt sichtbar, Aufklappen-Button verschwindet nicht */
.overview-card-collapse-ready .device-card-header .device-card-actions-top,
.overview-card-collapsed .device-card-header .device-card-actions-top,
.overview-card-open .device-card-header .device-card-actions-top,
.overview-card-collapse-ready .vehicle-card-header .device-card-actions-top,
.overview-card-collapsed .vehicle-card-header .device-card-actions-top,
.overview-card-open .vehicle-card-header .device-card-actions-top {
    display: grid !important;
    visibility: visible !important;
    opacity: 1 !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    justify-items: end !important;
    align-items: start !important;
    min-width: 180px !important;
}

/* Eingeklappt: nur Detail-Link ausblenden, NICHT den Aufklappen-Button */
.overview-card-collapsed .device-card-actions-top > a.detail-link,
.overview-card-collapsed .device-card-actions-top > a.fleet-detail-button {
    display: none !important;
}

/* Aufklappen/Einklappen bleibt immer sichtbar */
.overview-card-collapse-ready .device-card-actions-top > .overview-card-toggle-button,
.overview-card-collapsed .device-card-actions-top > .overview-card-toggle-button,
.overview-card-open .device-card-actions-top > .overview-card-toggle-button {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
    height: 40px !important;
    justify-content: center !important;
    align-items: center !important;
}

/* Aufgeklappt: Detail-Link wieder sichtbar */
.overview-card-open .device-card-actions-top > a.detail-link,
.overview-card-open .device-card-actions-top > a.fleet-detail-button {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
    height: 40px !important;
    justify-content: center !important;
    align-items: center !important;
}

@media (max-width: 760px) {
    .overview-card-collapse-ready .device-card-header .device-card-actions-top,
    .overview-card-collapsed .device-card-header .device-card-actions-top,
    .overview-card-open .device-card-header .device-card-actions-top,
    .overview-card-collapse-ready .vehicle-card-header .device-card-actions-top,
    .overview-card-collapsed .vehicle-card-header .device-card-actions-top,
    .overview-card-open .vehicle-card-header .device-card-actions-top {
        width: 100% !important;
        min-width: 0 !important;
        justify-items: stretch !important;
    }

    .overview-card-collapse-ready .device-card-actions-top > .overview-card-toggle-button,
    .overview-card-collapsed .device-card-actions-top > .overview-card-toggle-button,
    .overview-card-open .device-card-actions-top > .overview-card-toggle-button,
    .overview-card-open .device-card-actions-top > a.detail-link,
    .overview-card-open .device-card-actions-top > a.fleet-detail-button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
}


/* FINAL: Detailbutton links im Kartenkopf, Aufklappen/Einklappen rechts */
.overview-inline-detail-action {
    margin-top: 10px !important;
    width: fit-content !important;
    min-width: 150px !important;
    max-width: 220px !important;
    height: 38px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    justify-content: center !important;
    align-items: center !important;
    white-space: nowrap !important;
}

.overview-card-collapsed .overview-inline-detail-action {
    display: none !important;
}

.overview-card-open .overview-inline-detail-action {
    display: inline-flex !important;
}

.overview-card-collapse-ready .device-card-actions-top {
    display: grid !important;
    justify-items: end !important;
    align-items: start !important;
    min-width: 180px !important;
}

.overview-card-collapse-ready .device-card-actions-top .overview-card-toggle-button {
    width: 180px !important;
    min-width: 180px !important;
    max-width: 180px !important;
}

@media (max-width: 760px) {
    .overview-inline-detail-action {
        width: 100% !important;
        max-width: 100% !important;
    }

    .overview-card-collapse-ready .device-card-actions-top {
        width: 100% !important;
        min-width: 0 !important;
        justify-items: stretch !important;
    }

    .overview-card-collapse-ready .device-card-actions-top .overview-card-toggle-button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }
}



/* PERSONAL_RECORD_OPEN_BUTTON */
.personal-record-open-button {
    white-space: nowrap !important;
}

@media (max-width: 760px) {
    .personal-record-open-button {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* PERSONAL: Übersicht kompakt ohne extra Ausklappbutton */
.personal-compact-hidden-body[hidden] {
    display: none !important;
}

.personal-overview-compact {
    padding-bottom: 22px !important;
}

.personal-detail-open .personal-compact-hidden-body {
    display: block !important;
}



/* DRIVER_LICENSE_REFERENCE_GRID */
.driver-license-reference-grid {
    margin-top: 18px;
}


/* FINAL: Detailseiten-Klappbuttons einheitlich */
.detail-collapsible-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 16px !important;
    align-items: center !important;
}

.detail-collapsible-header .detail-collapse-button,
.section-title-row .detail-collapse-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
    height: 42px !important;
    padding: 0 16px !important;
    border-radius: 999px !important;
    justify-self: end !important;
    white-space: nowrap !important;
    font-weight: 950 !important;
}

.section-title-row.section-title-row-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto auto !important;
    gap: 14px !important;
    align-items: center !important;
}

.section-title-row.section-title-row-actions .export-actions {
    justify-self: end !important;
}

.section-title-row.section-title-row-actions .detail-collapse-button {
    justify-self: end !important;
}

@media (max-width: 760px) {
    .detail-collapsible-header,
    .section-title-row.section-title-row-actions {
        grid-template-columns: 1fr !important;
    }

    .detail-collapsible-header .detail-collapse-button,
    .section-title-row .detail-collapse-button {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        justify-self: stretch !important;
    }

    .section-title-row.section-title-row-actions .export-actions {
        justify-self: stretch !important;
        width: 100% !important;
    }
}


/* Archiv-/Alle-öffnen-Aktion innerhalb aufgeklappter Detailkacheln */
.archive-inline-action {
    margin: 0 0 14px !important;
    display: flex !important;
    justify-content: flex-end !important;
}

@media (max-width: 760px) {
    .archive-inline-action {
        justify-content: stretch !important;
    }

    .archive-inline-action .export-button {
        width: 100% !important;
        justify-content: center !important;
    }
}


/* FINAL: Detailkacheln mit Archivlink sauber wie alle anderen ausrichten */
.detail-collapsible-card > .section-title-row.section-title-row-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 16px !important;
    align-items: center !important;
}

.detail-collapsible-card > .section-title-row.section-title-row-actions h2 {
    margin: 0 !important;
}

.detail-collapsible-card > .section-title-row.section-title-row-actions .detail-collapse-button {
    grid-column: 2 !important;
    justify-self: end !important;
    align-self: center !important;
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
    height: 42px !important;
    margin: 0 !important;
}

/* Archivaktion gehört in den aufgeklappten Inhaltsbereich, nicht rechts unter den Toggle */
.archive-inline-action {
    margin: 4px 0 16px !important;
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
}

.archive-inline-action .export-button,
.archive-inline-action .secondary-export {
    width: auto !important;
    min-width: 220px !important;
    max-width: fit-content !important;
    height: 42px !important;
    padding: 0 18px !important;
    border-radius: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
}

/* Normale Detail-Kopfzeilen weiterhin exakt gleich */
.detail-collapsible-header {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 16px !important;
    align-items: center !important;
}

.detail-collapsible-header .detail-collapse-button {
    justify-self: end !important;
    align-self: center !important;
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
    height: 42px !important;
    margin: 0 !important;
}

@media (max-width: 760px) {
    .detail-collapsible-card > .section-title-row.section-title-row-actions,
    .detail-collapsible-header {
        grid-template-columns: 1fr !important;
    }

    .detail-collapsible-card > .section-title-row.section-title-row-actions .detail-collapse-button,
    .detail-collapsible-header .detail-collapse-button,
    .archive-inline-action .export-button,
    .archive-inline-action .secondary-export {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        justify-self: stretch !important;
    }

    .archive-inline-action {
        justify-content: stretch !important;
    }
}


/* FINAL: Detailseiten-Klappbuttons exakt gleiche Position in jeder Kachel */
.detail-collapsible-card {
    position: relative !important;
}

.detail-collapsible-card > .detail-collapsible-header,
.detail-collapsible-card > .section-title-row.section-title-row-actions {
    display: block !important;
    position: relative !important;
    min-height: 46px !important;
    padding-right: 260px !important;
}

.detail-collapsible-card > .detail-collapsible-header h2,
.detail-collapsible-card > .section-title-row.section-title-row-actions h2 {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
}

.detail-collapsible-card > .detail-collapsible-header .detail-collapse-button,
.detail-collapsible-card > .section-title-row.section-title-row-actions .detail-collapse-button {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 0 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
}

/* Archiv-/Alle-öffnen-Aktion bleibt im aufgeklappten Inhalt */
.archive-inline-action {
    margin: 14px 0 16px !important;
    display: flex !important;
    justify-content: flex-start !important;
}

/* Mobil: wieder normal untereinander */
@media (max-width: 760px) {
    .detail-collapsible-card > .detail-collapsible-header,
    .detail-collapsible-card > .section-title-row.section-title-row-actions {
        padding-right: 0 !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .detail-collapsible-card > .detail-collapsible-header .detail-collapse-button,
    .detail-collapsible-card > .section-title-row.section-title-row-actions .detail-collapse-button {
        position: static !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        justify-self: stretch !important;
    }

    .archive-inline-action {
        justify-content: stretch !important;
    }

    .archive-inline-action .export-button {
        width: 100% !important;
        justify-content: center !important;
    }
}


/* REPAIR: Detailseiten-Klappbuttons ohne absolute Positionierung */
.detail-collapsible-card {
    position: static !important;
}

.detail-collapsible-card > .detail-collapsible-header,
.detail-collapsible-card > .section-title-row.section-title-row-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 16px !important;
    align-items: center !important;
    min-height: 0 !important;
    padding-right: 0 !important;
    position: static !important;
}

.detail-collapsible-card > .detail-collapsible-header h2,
.detail-collapsible-card > .section-title-row.section-title-row-actions h2 {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
}

.detail-collapsible-card > .detail-collapsible-header .detail-collapse-button,
.detail-collapsible-card > .section-title-row.section-title-row-actions .detail-collapse-button {
    position: static !important;
    grid-column: 2 !important;
    justify-self: end !important;
    align-self: center !important;
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 0 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 999px !important;
    white-space: nowrap !important;
}

.archive-inline-action {
    margin: 14px 0 16px !important;
    display: flex !important;
    justify-content: flex-start !important;
}

@media (max-width: 760px) {
    .detail-collapsible-card > .detail-collapsible-header,
    .detail-collapsible-card > .section-title-row.section-title-row-actions {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .detail-collapsible-card > .detail-collapsible-header .detail-collapse-button,
    .detail-collapsible-card > .section-title-row.section-title-row-actions .detail-collapse-button {
        grid-column: 1 !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        justify-self: stretch !important;
    }

    .archive-inline-action {
        justify-content: stretch !important;
    }

    .archive-inline-action .export-button {
        width: 100% !important;
        justify-content: center !important;
    }
}


/* REPAIR: Kacheln mit section-title-row exakt wie normale Detail-Kacheln ausrichten */
.vehicle-instruction-history-box > .section-title-row.section-title-row-actions,
.mpg-instruction-history-box > .section-title-row.section-title-row-actions,
.detail-collapsible-card > .section-title-row.section-title-row-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 220px !important;
    gap: 16px !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
}

.vehicle-instruction-history-box > .section-title-row.section-title-row-actions h2,
.mpg-instruction-history-box > .section-title-row.section-title-row-actions h2,
.detail-collapsible-card > .section-title-row.section-title-row-actions h2 {
    grid-column: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
}

.vehicle-instruction-history-box > .section-title-row.section-title-row-actions .detail-collapse-button,
.mpg-instruction-history-box > .section-title-row.section-title-row-actions .detail-collapse-button,
.detail-collapsible-card > .section-title-row.section-title-row-actions .detail-collapse-button {
    grid-column: 2 !important;
    justify-self: end !important;
    align-self: center !important;
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
    height: 42px !important;
    margin: 0 !important;
    padding: 0 16px !important;
    position: static !important;
}

@media (max-width: 760px) {
    .vehicle-instruction-history-box > .section-title-row.section-title-row-actions,
    .mpg-instruction-history-box > .section-title-row.section-title-row-actions,
    .detail-collapsible-card > .section-title-row.section-title-row-actions {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .vehicle-instruction-history-box > .section-title-row.section-title-row-actions .detail-collapse-button,
    .mpg-instruction-history-box > .section-title-row.section-title-row-actions .detail-collapse-button,
    .detail-collapsible-card > .section-title-row.section-title-row-actions .detail-collapse-button {
        grid-column: 1 !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        justify-self: stretch !important;
    }
}



/* Personal long certificate label fix */
.personal-card h2,
.personal-card h3,
.personnel-card h2,
.personnel-card h3,
.certificate-list-title,
.history-entry strong,
.vehicle-instruction-box h2,
.vehicle-instruction-history-box h2,
.vehicle-instruction-create-box h2 {
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
}

@media (max-width: 760px) {
    .certificate-list-title,
    .history-entry strong {
        line-height: 1.18;
    }
}


/* Theme system: final surface and contrast layer */
.app-page.theme-sanpad-drk,
.app-page.theme-sanpad-asb,
.app-page.theme-sanpad-mhd,
.app-page.theme-sanpad-juh,
.app-page.theme-sanpad-neutral,
.app-page.theme-drk-red,
.app-page.theme-liquid-glass,
.app-page.theme-dark-command,
.app-page.theme-tactical-blue,
.app-page.theme-rescue-green,
.app-page.theme-warm-operations,
.app-page.theme-custom {
    color: var(--text-main);
    background: var(--page-bg);
}

.theme-sanpad-drk .dashboard,
.theme-sanpad-asb .dashboard,
.theme-sanpad-mhd .dashboard,
.theme-sanpad-juh .dashboard,
.theme-sanpad-neutral .dashboard,
.theme-drk-red .dashboard,
.theme-liquid-glass .dashboard,
.theme-dark-command .dashboard,
.theme-tactical-blue .dashboard,
.theme-rescue-green .dashboard,
.theme-warm-operations .dashboard,
.theme-custom .dashboard {
    color: var(--text-main);
}

.theme-sanpad-drk .sidebar,
.theme-sanpad-asb .sidebar,
.theme-sanpad-mhd .sidebar,
.theme-sanpad-juh .sidebar,
.theme-sanpad-neutral .sidebar,
.theme-drk-red .sidebar,
.theme-liquid-glass .sidebar,
.theme-dark-command .sidebar,
.theme-tactical-blue .sidebar,
.theme-rescue-green .sidebar,
.theme-warm-operations .sidebar,
.theme-custom .sidebar,
.theme-drk-red .info-box,
.theme-liquid-glass .info-box,
.theme-dark-command .info-box,
.theme-tactical-blue .info-box,
.theme-rescue-green .info-box,
.theme-warm-operations .info-box,
.theme-custom .info-box,
.theme-drk-red .module-card,
.theme-liquid-glass .module-card,
.theme-dark-command .module-card,
.theme-tactical-blue .module-card,
.theme-rescue-green .module-card,
.theme-warm-operations .module-card,
.theme-custom .module-card,
.theme-drk-red .settings-card,
.theme-liquid-glass .settings-card,
.theme-dark-command .settings-card,
.theme-tactical-blue .settings-card,
.theme-rescue-green .settings-card,
.theme-warm-operations .settings-card,
.theme-custom .settings-card,
.theme-drk-red .admin-table-wrap,
.theme-liquid-glass .admin-table-wrap,
.theme-dark-command .admin-table-wrap,
.theme-tactical-blue .admin-table-wrap,
.theme-rescue-green .admin-table-wrap,
.theme-warm-operations .admin-table-wrap,
.theme-custom .admin-table-wrap,
.theme-drk-red .user-card,
.theme-liquid-glass .user-card,
.theme-dark-command .user-card,
.theme-tactical-blue .user-card,
.theme-rescue-green .user-card,
.theme-warm-operations .user-card,
.theme-custom .user-card,
.theme-drk-red .vehicle-card,
.theme-liquid-glass .vehicle-card,
.theme-dark-command .vehicle-card,
.theme-tactical-blue .vehicle-card,
.theme-rescue-green .vehicle-card,
.theme-warm-operations .vehicle-card,
.theme-custom .vehicle-card,
.theme-drk-red .detail-collapsible-card,
.theme-liquid-glass .detail-collapsible-card,
.theme-dark-command .detail-collapsible-card,
.theme-tactical-blue .detail-collapsible-card,
.theme-rescue-green .detail-collapsible-card,
.theme-warm-operations .detail-collapsible-card,
.theme-custom .detail-collapsible-card,
.theme-drk-red .personal-card,
.theme-liquid-glass .personal-card,
.theme-dark-command .personal-card,
.theme-tactical-blue .personal-card,
.theme-rescue-green .personal-card,
.theme-warm-operations .personal-card,
.theme-custom .personal-card,
.theme-drk-red .personnel-card,
.theme-liquid-glass .personnel-card,
.theme-dark-command .personnel-card,
.theme-tactical-blue .personnel-card,
.theme-rescue-green .personnel-card,
.theme-warm-operations .personnel-card,
.theme-custom .personnel-card,
.theme-drk-red .audit-entry,
.theme-liquid-glass .audit-entry,
.theme-dark-command .audit-entry,
.theme-tactical-blue .audit-entry,
.theme-rescue-green .audit-entry,
.theme-warm-operations .audit-entry,
.theme-custom .audit-entry {
    background: var(--surface-bg) !important;
    border-color: var(--border-soft) !important;
    box-shadow: var(--card-shadow);
    color: var(--text-main);
}

.theme-sanpad-drk .info-box,
.theme-sanpad-asb .info-box,
.theme-sanpad-mhd .info-box,
.theme-sanpad-juh .info-box,
.theme-sanpad-neutral .info-box,
.theme-sanpad-drk .module-card,
.theme-sanpad-asb .module-card,
.theme-sanpad-mhd .module-card,
.theme-sanpad-juh .module-card,
.theme-sanpad-neutral .module-card,
.theme-sanpad-drk .settings-card,
.theme-sanpad-asb .settings-card,
.theme-sanpad-mhd .settings-card,
.theme-sanpad-juh .settings-card,
.theme-sanpad-neutral .settings-card,
.theme-sanpad-drk .admin-table-wrap,
.theme-sanpad-asb .admin-table-wrap,
.theme-sanpad-mhd .admin-table-wrap,
.theme-sanpad-juh .admin-table-wrap,
.theme-sanpad-neutral .admin-table-wrap,
.theme-sanpad-drk .user-card,
.theme-sanpad-asb .user-card,
.theme-sanpad-mhd .user-card,
.theme-sanpad-juh .user-card,
.theme-sanpad-neutral .user-card,
.theme-sanpad-drk .vehicle-card,
.theme-sanpad-asb .vehicle-card,
.theme-sanpad-mhd .vehicle-card,
.theme-sanpad-juh .vehicle-card,
.theme-sanpad-neutral .vehicle-card,
.theme-sanpad-drk .detail-collapsible-card,
.theme-sanpad-asb .detail-collapsible-card,
.theme-sanpad-mhd .detail-collapsible-card,
.theme-sanpad-juh .detail-collapsible-card,
.theme-sanpad-neutral .detail-collapsible-card,
.theme-sanpad-drk .personal-card,
.theme-sanpad-asb .personal-card,
.theme-sanpad-mhd .personal-card,
.theme-sanpad-juh .personal-card,
.theme-sanpad-neutral .personal-card,
.theme-sanpad-drk .personnel-card,
.theme-sanpad-asb .personnel-card,
.theme-sanpad-mhd .personnel-card,
.theme-sanpad-juh .personnel-card,
.theme-sanpad-neutral .personnel-card,
.theme-sanpad-drk .audit-entry,
.theme-sanpad-asb .audit-entry,
.theme-sanpad-mhd .audit-entry,
.theme-sanpad-juh .audit-entry,
.theme-sanpad-neutral .audit-entry {
    background: var(--surface-bg) !important;
    border-color: var(--border-soft) !important;
    box-shadow: var(--card-shadow);
    color: var(--text-main);
}

.theme-sanpad-neutral .sidebar,
.theme-sanpad-neutral .info-box,
.theme-sanpad-neutral .module-card,
.theme-sanpad-neutral .settings-card,
.theme-sanpad-neutral .admin-table-wrap,
.theme-sanpad-neutral .user-card,
.theme-sanpad-neutral .vehicle-card,
.theme-sanpad-neutral .detail-collapsible-card,
.theme-sanpad-neutral .personal-card,
.theme-sanpad-neutral .personnel-card,
.theme-sanpad-neutral .audit-entry,
.theme-liquid-glass .sidebar,
.theme-liquid-glass .info-box,
.theme-liquid-glass .module-card,
.theme-liquid-glass .settings-card,
.theme-liquid-glass .admin-table-wrap,
.theme-liquid-glass .user-card,
.theme-liquid-glass .vehicle-card,
.theme-liquid-glass .detail-collapsible-card,
.theme-liquid-glass .personal-card,
.theme-liquid-glass .personnel-card,
.theme-liquid-glass .audit-entry {
    background: var(--surface-bg-translucent) !important;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .theme-sanpad-neutral .sidebar,
    .theme-sanpad-neutral .topbar,
    .theme-sanpad-neutral .info-box,
    .theme-sanpad-neutral .module-card,
    .theme-sanpad-neutral .settings-card,
    .theme-sanpad-neutral .admin-table-wrap,
    .theme-sanpad-neutral .theme-card-content,
    .theme-sanpad-neutral .login-card,
    .theme-sanpad-neutral .auth-organization,
    .theme-liquid-glass .sidebar,
    .theme-liquid-glass .topbar,
    .theme-liquid-glass .info-box,
    .theme-liquid-glass .module-card,
    .theme-liquid-glass .settings-card,
    .theme-liquid-glass .admin-table-wrap,
    .theme-liquid-glass .theme-card-content,
    .theme-liquid-glass .login-card,
    .theme-liquid-glass .auth-organization {
        backdrop-filter: blur(14px) saturate(130%);
        -webkit-backdrop-filter: blur(14px) saturate(130%);
    }
}

.theme-sanpad-drk h1,
.theme-sanpad-asb h1,
.theme-sanpad-mhd h1,
.theme-sanpad-juh h1,
.theme-sanpad-neutral h1,
.theme-drk-red h1,
.theme-liquid-glass h1,
.theme-dark-command h1,
.theme-tactical-blue h1,
.theme-rescue-green h1,
.theme-warm-operations h1,
.theme-custom h1,
.theme-sanpad-drk h2,
.theme-sanpad-asb h2,
.theme-sanpad-mhd h2,
.theme-sanpad-juh h2,
.theme-sanpad-neutral h2,
.theme-drk-red h2,
.theme-liquid-glass h2,
.theme-dark-command h2,
.theme-tactical-blue h2,
.theme-rescue-green h2,
.theme-warm-operations h2,
.theme-custom h2,
.theme-sanpad-drk h3,
.theme-sanpad-asb h3,
.theme-sanpad-mhd h3,
.theme-sanpad-juh h3,
.theme-sanpad-neutral h3,
.theme-drk-red h3,
.theme-liquid-glass h3,
.theme-dark-command h3,
.theme-tactical-blue h3,
.theme-rescue-green h3,
.theme-warm-operations h3,
.theme-custom h3,
.theme-sanpad-drk .user-card-meta strong,
.theme-sanpad-asb .user-card-meta strong,
.theme-sanpad-mhd .user-card-meta strong,
.theme-sanpad-juh .user-card-meta strong,
.theme-sanpad-neutral .user-card-meta strong,
.theme-drk-red .user-card-meta strong,
.theme-liquid-glass .user-card-meta strong,
.theme-dark-command .user-card-meta strong,
.theme-tactical-blue .user-card-meta strong,
.theme-rescue-green .user-card-meta strong,
.theme-warm-operations .user-card-meta strong,
.theme-custom .user-card-meta strong,
.theme-drk-red .theme-card-headline,
.theme-liquid-glass .theme-card-headline,
.theme-dark-command .theme-card-headline,
.theme-tactical-blue .theme-card-headline,
.theme-rescue-green .theme-card-headline,
.theme-warm-operations .theme-card-headline,
.theme-custom .theme-card-headline {
    color: var(--text-main);
}

.theme-drk-red p,
.theme-liquid-glass p,
.theme-dark-command p,
.theme-tactical-blue p,
.theme-rescue-green p,
.theme-warm-operations p,
.theme-custom p,
.theme-drk-red .settings-help-text,
.theme-liquid-glass .settings-help-text,
.theme-dark-command .settings-help-text,
.theme-tactical-blue .settings-help-text,
.theme-rescue-green .settings-help-text,
.theme-warm-operations .settings-help-text,
.theme-custom .settings-help-text,
.theme-drk-red .audit-meta,
.theme-liquid-glass .audit-meta,
.theme-dark-command .audit-meta,
.theme-tactical-blue .audit-meta,
.theme-rescue-green .audit-meta,
.theme-warm-operations .audit-meta,
.theme-custom .audit-meta {
    color: var(--text-muted);
}

.theme-drk-red input,
.theme-liquid-glass input,
.theme-dark-command input,
.theme-tactical-blue input,
.theme-rescue-green input,
.theme-warm-operations input,
.theme-custom input,
.theme-drk-red select,
.theme-liquid-glass select,
.theme-dark-command select,
.theme-tactical-blue select,
.theme-rescue-green select,
.theme-warm-operations select,
.theme-custom select,
.theme-drk-red textarea,
.theme-liquid-glass textarea,
.theme-dark-command textarea,
.theme-tactical-blue textarea,
.theme-rescue-green textarea,
.theme-warm-operations textarea,
.theme-custom textarea {
    background: var(--input-bg) !important;
    border-color: var(--border-soft) !important;
    color: var(--text-main) !important;
}

.theme-drk-red .admin-table th,
.theme-liquid-glass .admin-table th,
.theme-dark-command .admin-table th,
.theme-tactical-blue .admin-table th,
.theme-rescue-green .admin-table th,
.theme-warm-operations .admin-table th,
.theme-custom .admin-table th {
    background: var(--table-head-bg) !important;
    color: var(--text-muted) !important;
}

.theme-drk-red .admin-table td,
.theme-liquid-glass .admin-table td,
.theme-dark-command .admin-table td,
.theme-tactical-blue .admin-table td,
.theme-rescue-green .admin-table td,
.theme-warm-operations .admin-table td,
.theme-custom .admin-table td {
    color: var(--text-main) !important;
    border-bottom-color: var(--border-soft) !important;
}

.theme-drk-red .status-badge-ok,
.theme-liquid-glass .status-badge-ok,
.theme-dark-command .status-badge-ok,
.theme-tactical-blue .status-badge-ok,
.theme-rescue-green .status-badge-ok,
.theme-warm-operations .status-badge-ok,
.theme-custom .status-badge-ok,
.theme-drk-red .nav-item:hover,
.theme-liquid-glass .nav-item:hover,
.theme-dark-command .nav-item:hover,
.theme-tactical-blue .nav-item:hover,
.theme-rescue-green .nav-item:hover,
.theme-warm-operations .nav-item:hover,
.theme-custom .nav-item:hover,
.theme-drk-red .nav-item.active,
.theme-liquid-glass .nav-item.active,
.theme-dark-command .nav-item.active,
.theme-tactical-blue .nav-item.active,
.theme-rescue-green .nav-item.active,
.theme-warm-operations .nav-item.active,
.theme-custom .nav-item.active {
    background: var(--chip-bg) !important;
    color: var(--chip-text) !important;
}

/* Targeted visual fixes for the richer themes. Keep these late so they win over
   older component rules without changing the default DRK Classic look. */
.app-page.theme-liquid-glass {
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 20% 12%, rgba(227, 6, 19, 0.16), transparent 28%),
        radial-gradient(circle at 85% 20%, rgba(37, 99, 235, 0.14), transparent 32%),
        radial-gradient(circle at 48% 92%, rgba(14, 165, 233, 0.12), transparent 34%),
        linear-gradient(135deg, #edf4ff 0%, #f8fbff 45%, #eef2f7 100%);
}

.app-page.theme-liquid-glass::before {
    content: "";
    position: fixed;
    inset: -18px;
    z-index: 0;
    pointer-events: none;
    background: var(--branding-background-image) center center / cover no-repeat;
    opacity: 0.22;
    filter: blur(2px) saturate(115%);
    transform: scale(1.02);
}

.app-page.theme-liquid-glass .app-layout {
    position: relative;
    z-index: 1;
}

.theme-liquid-glass .topbar {
    background: linear-gradient(120deg, rgba(227, 6, 19, 0.98) 0%, rgba(205, 0, 15, 0.96) 48%, rgba(116, 18, 36, 0.96) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow:
        0 18px 42px rgba(227, 6, 19, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.theme-liquid-glass .topbar h1,
.theme-liquid-glass .topbar .eyebrow,
.theme-liquid-glass .topbar .org-identity strong,
.theme-liquid-glass .topbar .logout-link,
.theme-liquid-glass .topbar .user-chip,
.theme-liquid-glass .topbar .app-name {
    color: #ffffff !important;
    text-shadow: 0 1px 1px rgba(84, 0, 8, 0.16);
}

.theme-liquid-glass .topbar .app-name {
    background: rgba(120, 18, 36, 0.76) !important;
    border: 1px solid rgba(255, 255, 255, 0.38) !important;
    box-shadow: 0 8px 20px rgba(84, 0, 8, 0.18);
    color: #ffffff !important;
    text-shadow: none !important;
}

@media (max-width: 760px) {
    .theme-liquid-glass .topbar .app-name {
        background: rgba(120, 18, 36, 0.78) !important;
        border-color: rgba(255, 255, 255, 0.42) !important;
        color: #ffffff !important;
        box-shadow: 0 8px 20px rgba(84, 0, 8, 0.20);
        text-shadow: none !important;
    }
}

.theme-liquid-glass .sidebar,
.theme-liquid-glass .info-box,
.theme-liquid-glass .module-card,
.theme-liquid-glass .settings-card,
.theme-liquid-glass .content-card,
.theme-liquid-glass .admin-table-wrap,
.theme-liquid-glass .user-card,
.theme-liquid-glass .vehicle-card,
.theme-liquid-glass .detail-card,
.theme-liquid-glass .detail-collapsible-card,
.theme-liquid-glass .personal-card,
.theme-liquid-glass .personnel-card,
.theme-liquid-glass .audit-entry,
.theme-liquid-glass .filter-collapse-panel,
.theme-liquid-glass .loadout-warning-container,
.theme-liquid-glass .loadout-check-card,
.theme-liquid-glass .loadout-unit-card,
.theme-liquid-glass .inline-info-box,
.theme-liquid-glass .login-card,
.theme-liquid-glass .auth-organization,
.theme-liquid-glass .theme-card-content {
    background: rgba(255, 255, 255, 0.54) !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    background-clip: padding-box;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
    color: #172033;
}

.theme-liquid-glass .sidebar,
.theme-liquid-glass .settings-card,
.theme-liquid-glass .admin-table-wrap,
.theme-liquid-glass .login-card,
.theme-liquid-glass .auth-organization {
    background: rgba(255, 255, 255, 0.66) !important;
}

.theme-liquid-glass .sidebar {
    background: rgba(255, 255, 255, 0.58) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.45) !important;
    box-shadow: 18px 0 45px rgba(15, 23, 42, 0.08);
}

.theme-liquid-glass .sidebar-logo {
    background: rgba(255, 255, 255, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.58);
}

.theme-liquid-glass .nav-title,
.theme-liquid-glass .nav-item {
    color: #253044;
}

.theme-liquid-glass .nav-item:hover,
.theme-liquid-glass .nav-item.active {
    background: rgba(227, 6, 19, 0.13) !important;
    color: #a9000d !important;
}

.theme-liquid-glass .hero-panel {
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.70) 0%, rgba(255, 255, 255, 0.48) 54%, rgba(255, 255, 255, 0.28) 100%),
        var(--branding-background-image) center center / cover no-repeat !important;
    border: 1px solid rgba(255, 255, 255, 0.56);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.13);
}

.theme-liquid-glass .admin-table th,
.theme-liquid-glass .table thead th {
    background: rgba(255, 255, 255, 0.84) !important;
    color: #536174 !important;
}

.theme-liquid-glass .admin-table td,
.theme-liquid-glass .table td {
    background: rgba(255, 255, 255, 0.42);
    color: #172033 !important;
}

.theme-liquid-glass .loadout-order-table-wrap,
.theme-liquid-glass .loadout-order-table th,
.theme-liquid-glass .loadout-order-table td,
.theme-liquid-glass .loadout-order-empty {
    background: rgba(255, 255, 255, 0.58) !important;
    border-color: rgba(255, 255, 255, 0.52) !important;
    color: #172033 !important;
}

.theme-liquid-glass input,
.theme-liquid-glass select,
.theme-liquid-glass textarea,
.theme-liquid-glass .settings-card input[type="text"],
.theme-liquid-glass .settings-card input[type="email"],
.theme-liquid-glass .settings-card input[type="number"],
.theme-liquid-glass .settings-card input[type="password"],
.theme-liquid-glass .settings-card input[type="url"],
.theme-liquid-glass .filter-bar input,
.theme-liquid-glass .filter-bar select,
.theme-liquid-glass .mpg-form input,
.theme-liquid-glass .mpg-form select,
.theme-liquid-glass .mpg-form textarea,
.theme-liquid-glass .vehicle-card-form input,
.theme-liquid-glass .vehicle-card-form select,
.theme-liquid-glass .vehicle-card-form textarea {
    background: rgba(255, 255, 255, 0.72) !important;
    border-color: rgba(100, 116, 139, 0.22) !important;
    color: #172033 !important;
}

.theme-liquid-glass input::placeholder,
.theme-liquid-glass textarea::placeholder {
    color: #64748b;
}

.theme-liquid-glass input:focus,
.theme-liquid-glass select:focus,
.theme-liquid-glass textarea:focus {
    border-color: #e30613 !important;
    box-shadow: 0 0 0 3px rgba(227, 6, 19, 0.13);
    outline: none;
}

.theme-liquid-glass .theme-card input:checked + .theme-card-content {
    background: rgba(255, 255, 255, 0.82) !important;
    border-color: rgba(227, 6, 19, 0.58) !important;
    box-shadow:
        0 0 0 3px rgba(227, 6, 19, 0.12),
        0 18px 45px rgba(15, 23, 42, 0.12);
}

.theme-card input[value="liquid_glass"] + .theme-card-content .theme-preview {
    background:
        radial-gradient(circle at 16% 12%, rgba(227, 6, 19, 0.24), transparent 34%),
        radial-gradient(circle at 88% 24%, rgba(37, 99, 235, 0.22), transparent 34%),
        linear-gradient(135deg, #dceafe 0%, #f8fbff 52%, #e2e8f0 100%) !important;
}

.theme-card input[value="liquid_glass"] + .theme-card-content .theme-preview-header {
    background: linear-gradient(135deg, rgba(227, 6, 19, 0.96), rgba(184, 0, 13, 0.92)) !important;
}

.theme-card input[value="liquid_glass"] + .theme-card-content .theme-preview-panel {
    background: transparent !important;
}

.theme-card input[value="liquid_glass"] + .theme-card-content .theme-preview-panel span {
    background: rgba(255, 255, 255, 0.48) !important;
    border: 1px solid rgba(255, 255, 255, 0.72);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.55),
        0 8px 18px rgba(15, 23, 42, 0.12);
}

.theme-card input[value="liquid_glass"] + .theme-card-content .theme-preview-panel span:nth-child(2) {
    background: rgba(227, 6, 19, 0.88) !important;
}

.theme-card input[value="dark_command"] + .theme-card-content .theme-preview {
    background: #0f172a !important;
}

.theme-card input[value="dark_command"] + .theme-card-content .theme-preview-panel {
    background: #111827 !important;
}

.theme-card input[value="dark_command"] + .theme-card-content .theme-preview-panel span:nth-child(1) {
    background: rgba(255, 255, 255, 0.92) !important;
    border-radius: 7px;
}

.theme-card input[value="dark_command"] + .theme-card-content .theme-preview-panel span:nth-child(2) {
    background: #ef4444 !important;
}

.theme-card input[value="dark_command"] + .theme-card-content .theme-preview-panel span:nth-child(3) {
    background: #273449 !important;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .theme-liquid-glass .sidebar,
    .theme-liquid-glass .topbar,
    .theme-liquid-glass .info-box,
    .theme-liquid-glass .module-card,
    .theme-liquid-glass .settings-card,
    .theme-liquid-glass .content-card,
    .theme-liquid-glass .admin-table-wrap,
    .theme-liquid-glass .user-card,
    .theme-liquid-glass .vehicle-card,
    .theme-liquid-glass .detail-card,
    .theme-liquid-glass .detail-collapsible-card,
    .theme-liquid-glass .personal-card,
    .theme-liquid-glass .personnel-card,
    .theme-liquid-glass .audit-entry,
    .theme-liquid-glass .filter-collapse-panel,
    .theme-liquid-glass .loadout-warning-container,
    .theme-liquid-glass .loadout-check-card,
    .theme-liquid-glass .loadout-unit-card,
    .theme-liquid-glass .inline-info-box,
    .theme-liquid-glass .login-card,
    .theme-liquid-glass .auth-organization,
    .theme-liquid-glass .theme-card-content {
        backdrop-filter: blur(18px) saturate(145%);
        -webkit-backdrop-filter: blur(18px) saturate(145%);
    }

    .theme-liquid-glass .sidebar {
        backdrop-filter: blur(20px) saturate(150%);
        -webkit-backdrop-filter: blur(20px) saturate(150%);
    }
}

.login-page.theme-liquid-glass {
    background:
        radial-gradient(circle at 15% 10%, rgba(227, 6, 19, 0.14), transparent 30%),
        radial-gradient(circle at 85% 20%, rgba(37, 99, 235, 0.14), transparent 30%),
        linear-gradient(135deg, rgba(238, 244, 255, 0.78), rgba(248, 251, 255, 0.66)),
        var(--branding-background-image) center center / cover no-repeat;
}

.theme-dark-command .sidebar-logo {
    background: rgba(255, 255, 255, 0.94) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    border-radius: 20px;
    padding: 12px;
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.22);
}

.theme-dark-command .sidebar-logo img {
    object-fit: contain;
}

/* Final placement and Liquid Glass polish overrides */
.floating-top-button {
    position: fixed !important;
    right: 28px !important;
    bottom: 28px !important;
    left: auto !important;
    top: auto !important;
    transform: none;
    z-index: 80;
    min-width: 96px;
    min-height: 44px;
    width: auto;
    height: auto;
    white-space: nowrap;
    line-height: 1;
}

.floating-top-button:hover {
    transform: translateY(-1px);
}

.app-page.theme-liquid-glass .floating-top-button {
    position: fixed !important;
    right: 28px !important;
    bottom: 28px !important;
    left: auto !important;
    top: auto !important;
    transform: none;
    background: linear-gradient(120deg, rgba(227, 6, 19, 0.96), rgba(116, 18, 36, 0.96));
    box-shadow: 0 16px 34px rgba(116, 18, 36, 0.22);
}

.app-page.theme-liquid-glass::before {
    inset: 0;
    z-index: 0;
    opacity: 0.26;
    filter: blur(1px) saturate(115%);
    transform: none;
    background: var(--branding-background-image) center center / cover no-repeat;
}

.app-page.theme-liquid-glass::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 20% 12%, rgba(227, 6, 19, 0.18), transparent 30%),
        radial-gradient(circle at 86% 18%, rgba(37, 99, 235, 0.16), transparent 34%),
        linear-gradient(135deg, rgba(237, 244, 255, 0.58) 0%, rgba(248, 251, 255, 0.48) 46%, rgba(238, 242, 247, 0.62) 100%);
}

.app-page.theme-liquid-glass .app-layout {
    position: relative;
    z-index: 2;
}

.theme-liquid-glass .sidebar {
    background: rgba(255, 255, 255, 0.34) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.42) !important;
    box-shadow: 18px 0 48px rgba(15, 23, 42, 0.10);
}

.theme-liquid-glass .info-box,
.theme-liquid-glass .module-card,
.theme-liquid-glass .user-card,
.theme-liquid-glass .vehicle-card,
.theme-liquid-glass .detail-card,
.theme-liquid-glass .detail-collapsible-card,
.theme-liquid-glass .personal-card,
.theme-liquid-glass .personnel-card,
.theme-liquid-glass .audit-entry,
.theme-liquid-glass .filter-collapse-panel,
.theme-liquid-glass .loadout-warning-container,
.theme-liquid-glass .loadout-check-card,
.theme-liquid-glass .loadout-unit-card,
.theme-liquid-glass .inline-info-box,
.theme-liquid-glass .theme-card-content {
    background: rgba(255, 255, 255, 0.50) !important;
}

.theme-liquid-glass .settings-card,
.theme-liquid-glass .admin-table-wrap,
.theme-liquid-glass .login-card,
.theme-liquid-glass .auth-organization {
    background: rgba(255, 255, 255, 0.64) !important;
}

.theme-liquid-glass .mpg-overview-panel,
.theme-liquid-glass .fuhrpark-overview-panel {
    padding: 20px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.50) !important;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

.theme-liquid-glass .mpg-overview-panel .section-title-row,
.theme-liquid-glass .fuhrpark-overview-panel .section-title-row {
    margin-bottom: 16px;
}

.theme-liquid-glass .mpg-filter-panel,
.theme-liquid-glass .fuhrpark-filter-panel,
.theme-liquid-glass .personal-filter-panel {
    background: rgba(255, 255, 255, 0.50) !important;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
    overflow: hidden;
}

.theme-liquid-glass .mpg-filter-panel input,
.theme-liquid-glass .mpg-filter-panel select,
.theme-liquid-glass .fuhrpark-filter-panel input,
.theme-liquid-glass .fuhrpark-filter-panel select,
.theme-liquid-glass .personal-filter-panel input,
.theme-liquid-glass .personal-filter-panel select {
    background: rgba(255, 255, 255, 0.78) !important;
    border-color: rgba(100, 116, 139, 0.24) !important;
    color: #172033 !important;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.theme-liquid-glass .personal-filter-bar {
    margin-bottom: 0;
    padding: 22px;
    width: 100%;
    min-width: 0;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0;
    box-shadow: none !important;
    box-sizing: border-box;
}

.theme-liquid-glass .personal-filter-bar label {
    min-width: 0;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .theme-liquid-glass .mpg-overview-panel,
    .theme-liquid-glass .fuhrpark-overview-panel,
    .theme-liquid-glass .mpg-filter-panel,
    .theme-liquid-glass .fuhrpark-filter-panel,
    .theme-liquid-glass .personal-filter-panel {
        backdrop-filter: blur(18px) saturate(145%);
        -webkit-backdrop-filter: blur(18px) saturate(145%);
    }
}

.theme-liquid-glass .topbar {
    background: linear-gradient(120deg, rgba(227, 6, 19, 0.98) 0%, rgba(205, 0, 15, 0.96) 48%, rgba(116, 18, 36, 0.96) 100%) !important;
    box-shadow:
        0 18px 42px rgba(227, 6, 19, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.theme-liquid-glass .sidebar-logo {
    width: 100%;
    max-width: 249px;
    min-height: 68px;
    max-height: 86px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.74) !important;
    border: 1px solid rgba(255, 255, 255, 0.65) !important;
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.10);
}

.theme-liquid-glass .sidebar-logo img,
.theme-liquid-glass .sidebar-logo .app-product-logo {
    width: auto;
    max-width: 220px;
    max-height: 58px;
    height: auto;
    object-fit: contain;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .theme-liquid-glass .sidebar {
        backdrop-filter: blur(24px) saturate(160%);
        -webkit-backdrop-filter: blur(24px) saturate(160%);
    }

    .theme-liquid-glass .sidebar-logo {
        backdrop-filter: blur(18px) saturate(145%);
        -webkit-backdrop-filter: blur(18px) saturate(145%);
    }
}

@media (max-width: 760px) {
    .floating-top-button,
    .app-page.theme-liquid-glass .floating-top-button {
        right: 18px !important;
        bottom: 18px !important;
        min-width: 86px;
        min-height: 42px;
    }
}

/* Admin settings layout guard: keep form grids in normal flow in every theme. */
.admin-settings-page .settings-form,
.admin-settings-page .settings-grid,
.admin-settings-page .settings-card,
.admin-settings-page .settings-card > *,
.admin-settings-page .theme-card-grid,
.admin-settings-page .theme-card,
.admin-settings-page .theme-card-content,
.admin-settings-page .settings-logo-row,
.admin-settings-page .settings-background-upload,
.admin-settings-page .settings-background-layout,
.admin-settings-page .settings-background-controls {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.admin-settings-page .settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    align-items: start;
    overflow: visible;
}

.admin-settings-page .settings-card {
    position: relative;
    transform: none;
    z-index: auto;
    overflow: hidden;
}

.admin-settings-page .settings-background-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.admin-settings-page .settings-background-preview-box,
.admin-settings-page .settings-logo-preview-box {
    max-width: 100%;
}

.admin-settings-page .settings-card input,
.admin-settings-page .settings-card select,
.admin-settings-page .settings-card textarea {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.admin-settings-page .theme-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.admin-settings-page .theme-card-content {
    overflow: hidden;
}

.admin-settings-page.theme-liquid-glass .settings-card,
.admin-settings-page.theme-liquid-glass .theme-card-content {
    background: rgba(255, 255, 255, 0.70) !important;
}

@media (max-width: 1180px) {
    .admin-settings-page .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .admin-settings-page .theme-card-grid,
    .admin-settings-page .settings-logo-row,
    .admin-settings-page .settings-background-layout {
        grid-template-columns: 1fr;
    }
}

/* User profile theme picker. */
.profile-theme-panel .theme-preference-form {
    margin-top: 18px;
}

.user-theme-card-grid {
    margin-bottom: 18px;
}

@media (min-width: 1180px) {
    .user-theme-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Liquid Glass: hero cards use the global page background, not their own image. */
.theme-liquid-glass .hero-panel {
    background: rgba(255, 255, 255, 0.52) !important;
    background-image: none !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12) !important;
    color: #172033;
}

.theme-liquid-glass .hero-panel::before,
.theme-liquid-glass .hero-panel::after {
    content: none !important;
    display: none !important;
    background: none !important;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .theme-liquid-glass .hero-panel {
        backdrop-filter: blur(18px) saturate(145%);
        -webkit-backdrop-filter: blur(18px) saturate(145%);
    }
}

/* Dark Command contrast guard: keep all central panels dark and readable. */
.theme-dark-command {
    background: #0f172a !important;
    color: #f8fafc;
}

.theme-dark-command .topbar {
    background: linear-gradient(120deg, #991b1b 0%, #7f1d1d 46%, #111827 100%) !important;
    border-color: rgba(248, 250, 252, 0.16) !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
    color: #ffffff;
}

.theme-dark-command .topbar *,
.theme-dark-command .logout-link {
    color: #ffffff;
}

.theme-dark-command .hero-panel,
.theme-dark-command .info-box,
.theme-dark-command .module-card,
.theme-dark-command .settings-card,
.theme-dark-command .admin-panel,
.theme-dark-command .admin-table-wrap,
.theme-dark-command .user-card,
.theme-dark-command .vehicle-card,
.theme-dark-command .detail-card,
.theme-dark-command .detail-collapsible-card,
.theme-dark-command .personal-card,
.theme-dark-command .personnel-card,
.theme-dark-command .audit-entry,
.theme-dark-command .filter-collapse-panel,
.theme-dark-command .filter-bar,
.theme-dark-command .mpg-overview-panel,
.theme-dark-command .fuhrpark-overview-panel,
.theme-dark-command .mpg-filter-panel,
.theme-dark-command .fuhrpark-filter-panel,
.theme-dark-command .loadout-warning-container,
.theme-dark-command .loadout-warning-panel,
.theme-dark-command .loadout-check-card,
.theme-dark-command .loadout-unit-card,
.theme-dark-command .inline-info-box,
.theme-dark-command .telegram-link-box,
.theme-dark-command .login-card,
.theme-dark-command .auth-organization,
.theme-dark-command .changelog-highlight,
.theme-dark-command .changelog-list article,
.theme-dark-command .theme-card-content {
    background: rgba(30, 41, 59, 0.94) !important;
    border-color: rgba(148, 163, 184, 0.24) !important;
    color: #f8fafc !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

.theme-dark-command .loadout-order-table-wrap,
.theme-dark-command .loadout-order-table th,
.theme-dark-command .loadout-order-table td,
.theme-dark-command .loadout-order-empty {
    background: rgba(15, 23, 42, 0.82) !important;
    border-color: rgba(148, 163, 184, 0.24) !important;
    color: #f8fafc !important;
}

.theme-dark-command .loadout-order-table small {
    color: #cbd5e1 !important;
}

.theme-dark-command h1,
.theme-dark-command h2,
.theme-dark-command h3,
.theme-dark-command h4,
.theme-dark-command .hero-content h2,
.theme-dark-command .module-card h3,
.theme-dark-command .info-box h2,
.theme-dark-command .settings-card h2,
.theme-dark-command .theme-card-headline,
.theme-dark-command .theme-card-headline strong,
.theme-dark-command .changelog-list strong,
.theme-dark-command .changelog-highlight strong,
.theme-dark-command label,
.theme-dark-command th {
    color: #ffffff !important;
}

.theme-dark-command p,
.theme-dark-command li,
.theme-dark-command td,
.theme-dark-command .hero-content p,
.theme-dark-command .module-card p,
.theme-dark-command .info-box p,
.theme-dark-command .settings-help-text,
.theme-dark-command .settings-upload-hint,
.theme-dark-command .changelog-list p,
.theme-dark-command .telegram-hint,
.theme-dark-command .user-card-meta span,
.theme-dark-command .audit-meta,
.theme-dark-command .nav-title,
.theme-dark-command .form-hint,
.theme-dark-command small {
    color: #cbd5e1 !important;
}

.theme-dark-command input,
.theme-dark-command select,
.theme-dark-command textarea,
.theme-dark-command .settings-card input,
.theme-dark-command .settings-card select,
.theme-dark-command .settings-card textarea,
.theme-dark-command .filter-bar input,
.theme-dark-command .filter-bar select,
.theme-dark-command .mpg-filter-panel input,
.theme-dark-command .mpg-filter-panel select,
.theme-dark-command .fuhrpark-filter-panel input,
.theme-dark-command .fuhrpark-filter-panel select,
.theme-dark-command .profile-form input {
    background: rgba(15, 23, 42, 0.92) !important;
    border-color: rgba(148, 163, 184, 0.38) !important;
    color: #f8fafc !important;
}

.theme-dark-command input::placeholder,
.theme-dark-command textarea::placeholder {
    color: #94a3b8 !important;
}

.theme-dark-command .admin-table th {
    background: #111827 !important;
    color: #ffffff !important;
}

.theme-dark-command .admin-table td {
    background: rgba(15, 23, 42, 0.78) !important;
    color: #e5e7eb !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
}

.theme-dark-command .status-badge,
.theme-dark-command .status-chip,
.theme-dark-command .module-badge,
.theme-dark-command .count-badge,
.theme-dark-command .hero-meta-pill {
    background: rgba(239, 68, 68, 0.18) !important;
    border-color: rgba(248, 113, 113, 0.38) !important;
    color: #fecaca !important;
}

.theme-dark-command .small-button,
.theme-dark-command button[type="submit"],
.theme-dark-command .telegram-button {
    color: #ffffff !important;
}

.theme-dark-command .secondary-button,
.theme-dark-command .reset-button,
.theme-dark-command .small-button.secondary {
    background: rgba(15, 23, 42, 0.92) !important;
    border-color: rgba(148, 163, 184, 0.34) !important;
    color: #f8fafc !important;
}

.theme-dark-command .app-footer {
    background: rgba(15, 23, 42, 0.94) !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
    color: #cbd5e1 !important;
}

.theme-dark-command .app-footer *,
.theme-dark-command .version-badge {
    color: #e5e7eb !important;
}

/* PSA module */
.psa-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: stretch;
}

.psa-form-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.psa-mini-form,
.psa-order-form {
    display: grid;
    gap: 16px;
    min-width: 0;
    margin-top: 0;
}

.psa-form-card {
    padding: 18px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--surface-bg-soft);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.psa-mini-form h3 {
    margin: 0;
    color: var(--text-main);
    font-size: 1rem;
}

.psa-mini-form label,
.psa-order-form label {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: #374151;
    font-size: 0.86rem;
    font-weight: 800;
}

.psa-form-help,
.psa-panel-header p {
    margin: 4px 0 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.45;
}

.psa-mini-form input,
.psa-mini-form select,
.psa-mini-form textarea,
.psa-order-form input,
.psa-order-form select,
.psa-filter-panel input,
.psa-filter-panel select,
.psa-personnel-form input,
.psa-personnel-form select {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 12px 13px;
    border: 1px solid #d1d5db;
    border-radius: 13px;
    background: #ffffff;
    color: #1f2933;
    font: inherit;
    font-weight: 700;
}

.psa-mini-form input:focus,
.psa-mini-form select:focus,
.psa-mini-form textarea:focus,
.psa-order-form input:focus,
.psa-order-form select:focus,
.psa-filter-panel input:focus,
.psa-filter-panel select:focus {
    outline: 3px solid rgba(227, 6, 19, 0.18);
    border-color: var(--drk-red);
}

.psa-overview-panel,
.psa-actions-panel {
    margin-top: 20px;
    padding: 22px;
    border-radius: var(--radius-lg);
    box-sizing: border-box;
    max-width: 100%;
}

.psa-overview-panel {
    overflow: hidden;
}

.psa-panel-header {
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.psa-panel-header h2 {
    margin: 0;
}

.psa-panel-header .export-actions {
    flex-shrink: 0;
}

.psa-panel-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.psa-collapsible-visible[hidden] {
    display: none;
}

.psa-card-list {
    margin-top: 16px;
}

.psa-order-row,
.psa-personnel-form {
    display: grid;
    grid-template-columns: minmax(220px, 1.6fr) minmax(120px, 0.75fr) minmax(110px, 0.65fr) minmax(180px, 1fr);
    gap: 14px;
    align-items: end;
    min-width: 0;
}

.psa-order-row {
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--surface-bg-soft);
}

.psa-order-list {
    display: grid;
    gap: 12px;
}

.psa-form-grid-compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.psa-personnel-form {
    grid-template-columns: 1.8fr 1.5fr 0.8fr 0.7fr 1fr 1.2fr auto;
    margin-top: 12px;
    max-width: 100%;
    box-sizing: border-box;
}

.psa-personnel-form > * {
    min-width: 0;
}

.psa-personnel-section {
    margin-top: 18px;
}

.psa-personnel-list {
    display: grid;
    gap: 8px;
}

.psa-personnel-item {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    background: var(--surface-bg-soft);
}

.psa-filter-panel {
    margin: 0 0 18px;
    max-width: 100%;
    box-sizing: border-box;
}

.psa-stock-card,
.psa-assignment-card {
    max-width: 100%;
    box-sizing: border-box;
}

.theme-liquid-glass .psa-actions-panel,
.theme-liquid-glass .psa-overview-panel,
.theme-liquid-glass .psa-filter-panel,
.theme-liquid-glass .psa-form-card,
.theme-liquid-glass .psa-order-row {
    background: rgba(255, 255, 255, 0.50) !important;
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

.theme-liquid-glass .psa-form-card,
.theme-liquid-glass .psa-order-row {
    background: rgba(255, 255, 255, 0.56) !important;
}

.theme-liquid-glass .psa-filter-panel {
    border-radius: var(--radius-md);
}

.theme-liquid-glass .psa-personnel-item {
    background: rgba(255, 255, 255, 0.44) !important;
    border-color: rgba(255, 255, 255, 0.55);
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .theme-liquid-glass .psa-actions-panel,
    .theme-liquid-glass .psa-overview-panel,
    .theme-liquid-glass .psa-filter-panel,
    .theme-liquid-glass .psa-form-card,
    .theme-liquid-glass .psa-order-row,
    .theme-liquid-glass .psa-personnel-item {
        backdrop-filter: blur(18px) saturate(145%);
        -webkit-backdrop-filter: blur(18px) saturate(145%);
    }
}

.theme-dark-command .psa-actions-panel,
.theme-dark-command .psa-overview-panel,
.theme-dark-command .psa-form-card,
.theme-dark-command .psa-order-row,
.theme-dark-command .psa-personnel-item {
    background: rgba(30, 41, 59, 0.94) !important;
    border-color: rgba(148, 163, 184, 0.24) !important;
    color: #f8fafc !important;
}

.theme-dark-command .psa-form-card h3,
.theme-dark-command .psa-form-card label,
.theme-dark-command .psa-order-form label,
.theme-dark-command .psa-panel-header h2 {
    color: #f8fafc !important;
}

.theme-dark-command .psa-form-help,
.theme-dark-command .psa-panel-header p {
    color: #cbd5e1 !important;
}

@media (max-width: 1180px) {
    .psa-form-grid,
    .psa-form-grid-two,
    .psa-order-row,
    .psa-personnel-form {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    .psa-form-grid,
    .psa-form-grid-two,
    .psa-order-row,
    .psa-personnel-form {
        grid-template-columns: 1fr;
    }

    .psa-personnel-section,
    .psa-personnel-form {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    .psa-personnel-form input,
    .psa-personnel-form select,
    .psa-personnel-form button {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
}

/* PAL Einsatzmodul */
.pal-panel,
.pal-section-panel,
.pal-safety-note {
    border-radius: var(--radius-lg);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.pal-section-panel {
    padding: 28px;
}

.pal-safety-note {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    line-height: 1.55;
}

.pal-form-grid,
.pal-patient-form .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.pal-action-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.pal-action-buttons {
    margin: 0;
}

.pal-action-bar form {
    margin: 0;
}

.pal-actions-panel .collapsible-section-header {
    align-items: center;
}

.pal-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
    min-width: 0;
}

.pal-section-header > div {
    min-width: 0;
}

.pal-section-header h2 {
    margin: 0 0 6px;
}

.pal-section-header p {
    margin: 0;
}

.pal-flash-panel {
    padding: 18px 24px;
}

.pal-flash-panel .flash-message {
    margin: 0;
}

.pal-triage-stats {
    align-items: stretch;
}

.pal-triage-stats .mpg-stat-card {
    min-height: 118px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

.pal-triage-stats .mpg-stat-card > span {
    min-height: 2.4em;
    line-height: 1.2;
    overflow: visible;
}

.pal-triage-stats .mpg-stat-card > strong {
    margin-top: 0;
}

.pal-stat-card.pal-sk1 {
    border-left-color: #dc2626;
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.10), #ffffff 58%);
}

.pal-stat-card.pal-sk2 {
    border-left-color: #facc15;
    background: linear-gradient(180deg, rgba(250, 204, 21, 0.16), #ffffff 58%);
}

.pal-stat-card.pal-sk3 {
    border-left-color: #16a34a;
    background: linear-gradient(180deg, rgba(22, 163, 74, 0.11), #ffffff 58%);
}

.pal-stat-card.pal-sk4 {
    border-left-color: #2563eb;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.11), #ffffff 58%);
}

.pal-stat-card.pal-x {
    border-left-color: #111827;
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.12), #ffffff 58%);
}

.pal-stat-card.pal-transported {
    border-left-color: #64748b;
    background: linear-gradient(180deg, rgba(100, 116, 139, 0.10), #ffffff 58%);
}

.pal-inline-category {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pal-form-section {
    padding: 18px 0;
    border-bottom: 1px solid var(--border-soft);
}

.pal-form-section:first-child {
    padding-top: 0;
}

.pal-form-section:last-of-type {
    border-bottom: 0;
}

.pal-prior-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.pal-question-card,
.pal-case-card,
.pal-patient-card,
.pal-share-row {
    background: var(--surface-bg-soft);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    box-sizing: border-box;
}

.pal-question-card {
    display: grid;
    gap: 8px;
    padding: 14px;
}

.pal-case-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.pal-case-card {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.pal-case-meta,
.pal-patient-main,
.pal-card-actions,
.pal-case-actions,
.pal-share-row,
.pal-column-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pal-case-meta {
    flex-wrap: wrap;
}

.pal-case-actions {
    flex-wrap: wrap;
    margin-top: 2px;
}

.pal-case-actions .small-button {
    text-align: center;
    text-decoration: none;
}

.pal-archive-action-cell {
    text-align: right;
    white-space: nowrap;
}

.pal-archive-button {
    position: static;
}

.pal-case-meta span {
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--chip-text);
    font-size: 0.84rem;
    font-weight: 700;
}

.pal-board,
.pal-triage-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    align-items: stretch;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.pal-column,
.pal-triage-group {
    background: var(--surface-bg);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    padding: 20px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    height: 100%;
    min-height: 240px;
    display: flex;
    flex-direction: column;
}

.pal-column-header {
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
    min-width: 0;
    gap: 14px;
    flex: 0 0 auto;
}

.pal-column-header > div {
    min-width: 0;
    display: grid;
    gap: 6px;
}

.pal-column-header h2 {
    font-size: 1rem;
    margin: 0;
    line-height: 1.25;
    overflow-wrap: normal;
    word-break: normal;
}

.pal-group-title-row {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.pal-group-count {
    flex: 0 0 auto;
    min-width: 42px;
    min-height: 42px;
    padding: 7px 10px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    line-height: 1;
}

.pal-column-header p,
.pal-section-panel p,
.pal-panel p,
.pal-safety-note,
.pal-patient-card p {
    color: var(--text-muted);
}

.pal-color-dot {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    border-radius: 999px;
}

.pal-dot-sk1 { background: #dc2626; }
.pal-dot-sk2 { background: #facc15; }
.pal-dot-sk3 { background: #16a34a; }
.pal-dot-sk4 { background: #2563eb; }
.pal-dot-x { background: #111827; }

.pal-patient-list {
    display: grid;
    gap: 14px;
    margin-top: 14px;
    flex: 1 1 auto;
    align-content: start;
}

.pal-patient-card {
    padding: 14px;
    display: grid;
    gap: 12px;
    min-width: 0;
    align-self: stretch;
}

.pal-patient-main {
    justify-content: space-between;
    align-items: center;
    min-width: 0;
    gap: 12px;
}

.pal-patient-main strong,
.pal-patient-status {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: normal;
}

.pal-patient-main strong {
    font-size: 1rem;
}

.pal-patient-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    max-width: max-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--chip-text);
    font-weight: 700;
    text-align: left;
    font-size: 0.76rem;
    line-height: 1;
    white-space: nowrap;
    text-transform: none;
}

.pal-patient-status i {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #16a34a;
    flex: 0 0 auto;
}

.pal-patient-meta {
    display: grid;
    gap: 4px;
}

.pal-patient-meta p,
.pal-patient-note,
.pal-patient-card small {
    margin: 0;
}

.pal-patient-actions,
.pal-card-actions {
    flex-wrap: wrap;
    margin-top: 2px;
    align-items: stretch;
    gap: 10px;
}

.pal-patient-actions form,
.pal-card-actions form {
    margin: 0;
}

.pal-patient-actions .small-button,
.pal-card-actions .small-button {
    text-decoration: none;
    width: 100%;
}

.pal-group-empty {
    min-height: 96px;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 14px;
    border-radius: var(--radius-md);
    background: rgba(148, 163, 184, 0.10);
    border: 1px dashed rgba(148, 163, 184, 0.30);
}

.pal-page a.small-button,
.pal-page a.export-button {
    text-decoration: none;
}

.pal-share-list {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.pal-share-row {
    justify-content: space-between;
    padding: 18px;
    align-items: flex-start;
    min-width: 0;
}

.pal-share-content {
    display: grid;
    gap: 10px;
    min-width: 0;
    flex: 1 1 420px;
}

.pal-share-url {
    display: block;
    max-width: 100%;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--text-main);
    font: 700 0.88rem/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    word-break: break-all;
}

.pal-live-form {
    grid-template-columns: minmax(180px, 280px) auto;
    justify-content: start;
    margin: 0 0 18px;
}

.pal-live-form label {
    min-width: 0;
}

.pal-live-form select {
    min-height: 42px;
}

.pal-share-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.pal-prior-flow {
    max-width: 840px;
    margin-inline: auto;
}

.pal-flow-progress {
    display: grid;
    gap: 10px;
    margin-bottom: 24px;
    color: var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pal-flow-bar {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.22);
    overflow: hidden;
}

.pal-flow-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--drk-red);
}

.pal-flow-question {
    text-align: center;
    margin: 18px auto 28px;
}

.pal-flow-question h2 {
    font-size: clamp(1.8rem, 4vw, 3.2rem);
    line-height: 1.05;
    margin-bottom: 12px;
}

.pal-flow-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.pal-flow-actions form {
    margin: 0;
}

.pal-answer-button {
    width: 100%;
    min-height: 112px;
    border: 0;
    border-radius: var(--radius-lg);
    color: #ffffff;
    font-size: 2rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: var(--card-shadow);
}

.pal-answer-yes {
    background: #dc2626;
}

.pal-answer-no {
    background: #1f2937;
}

.pal-flow-reset {
    margin-top: 20px;
    text-align: center;
}

.pal-flow-result {
    text-align: center;
    border-radius: var(--radius-lg);
    padding: 34px;
    border: 1px solid var(--border-soft);
    margin-bottom: 22px;
}

.pal-flow-result h2 {
    font-size: clamp(2rem, 4vw, 3.6rem);
    margin: 0 0 10px;
}

.pal-result-sk1 { background: rgba(220, 38, 38, 0.14); }
.pal-result-sk2 { background: rgba(250, 204, 21, 0.20); }
.pal-result-sk3 { background: rgba(22, 163, 74, 0.14); }

.pal-flow-actions-final {
    max-width: 560px;
    margin-inline: auto;
}

.pal-patient-form-actions {
    align-items: center;
}

.pal-public-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px;
}

.pal-public-page {
    background: var(--page-bg);
    color: var(--text-main);
}

.pal-public-page .floating-top-button {
    display: none !important;
}

.pal-public-hero {
    min-height: 180px;
}

.pal-public-stats-grid {
    margin-top: 16px;
}

.pal-public-board {
    margin-top: 16px;
}

.pal-public-footer {
    margin: 24px 0 0;
    color: var(--text-muted);
    font-weight: 800;
    text-align: center;
}

.pal-public-expired {
    max-width: 760px;
    margin: 64px auto;
}

.theme-liquid-glass .pal-panel,
.theme-liquid-glass .pal-section-panel,
.theme-liquid-glass .pal-safety-note,
.theme-liquid-glass .pal-column,
.theme-liquid-glass .pal-case-card,
.theme-liquid-glass .pal-patient-card,
.theme-liquid-glass .pal-question-card,
.theme-liquid-glass .pal-share-row {
    background: rgba(255, 255, 255, 0.54) !important;
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
    border-color: rgba(255, 255, 255, 0.55) !important;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12) !important;
}

.theme-liquid-glass .pal-stat-card.pal-sk1 { background: linear-gradient(180deg, rgba(220, 38, 38, 0.18), rgba(255, 255, 255, 0.58) 62%) !important; }
.theme-liquid-glass .pal-stat-card.pal-sk2 { background: linear-gradient(180deg, rgba(250, 204, 21, 0.24), rgba(255, 255, 255, 0.58) 62%) !important; }
.theme-liquid-glass .pal-stat-card.pal-sk3 { background: linear-gradient(180deg, rgba(22, 163, 74, 0.18), rgba(255, 255, 255, 0.58) 62%) !important; }
.theme-liquid-glass .pal-stat-card.pal-sk4 { background: linear-gradient(180deg, rgba(37, 99, 235, 0.18), rgba(255, 255, 255, 0.58) 62%) !important; }
.theme-liquid-glass .pal-stat-card.pal-x { background: linear-gradient(180deg, rgba(17, 24, 39, 0.18), rgba(255, 255, 255, 0.58) 62%) !important; }
.theme-liquid-glass .pal-stat-card.pal-transported { background: linear-gradient(180deg, rgba(100, 116, 139, 0.16), rgba(255, 255, 255, 0.58) 62%) !important; }

.theme-dark-command .pal-panel,
.theme-dark-command .pal-section-panel,
.theme-dark-command .pal-safety-note,
.theme-dark-command .pal-column,
.theme-dark-command .pal-case-card,
.theme-dark-command .pal-patient-card,
.theme-dark-command .pal-question-card,
.theme-dark-command .pal-share-row {
    background: rgba(30, 41, 59, 0.94) !important;
    border-color: rgba(148, 163, 184, 0.24) !important;
    color: #f8fafc !important;
}

.theme-dark-command .pal-stat-card.pal-sk1,
.theme-dark-command .pal-stat-card.pal-sk2,
.theme-dark-command .pal-stat-card.pal-sk3,
.theme-dark-command .pal-stat-card.pal-sk4,
.theme-dark-command .pal-stat-card.pal-x,
.theme-dark-command .pal-stat-card.pal-transported {
    background: rgba(30, 41, 59, 0.94) !important;
}

.theme-dark-command .pal-stat-card > span {
    color: #cbd5e1 !important;
}

.theme-dark-command .pal-stat-card > strong {
    color: #ffffff !important;
}

.theme-dark-command .pal-group-count {
    background: rgba(15, 23, 42, 0.62);
    color: #ffffff;
}

.theme-dark-command .pal-group-empty {
    background: rgba(15, 23, 42, 0.45);
    border-color: rgba(148, 163, 184, 0.26);
}

.theme-dark-command .pal-column-header p,
.theme-dark-command .pal-section-panel p,
.theme-dark-command .pal-panel p,
.theme-dark-command .pal-safety-note,
.theme-dark-command .pal-patient-card p {
    color: #cbd5e1 !important;
}

@media (max-width: 1280px) {
    .pal-board,
    .pal-triage-board,
    .pal-public-board {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pal-case-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .pal-board,
    .pal-triage-board,
    .pal-public-board {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .pal-section-panel {
        padding: 18px;
    }

    .pal-form-grid,
    .pal-patient-form .form-grid,
    .pal-prior-grid,
    .pal-board,
    .pal-triage-board,
    .pal-public-board,
    .pal-case-grid {
        grid-template-columns: 1fr;
    }

    .pal-share-row,
    .pal-column-header,
    .pal-section-header,
    .pal-live-form {
        align-items: flex-start;
        flex-direction: column;
    }

    .pal-action-bar,
    .pal-flow-actions,
    .pal-flow-actions-final {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .pal-action-bar {
        justify-content: stretch;
        display: grid;
    }

    .pal-patient-form-actions {
        display: grid;
        gap: 12px;
        width: 100%;
    }

    .pal-patient-form-actions button,
    .pal-patient-form-actions a {
        width: 100%;
        justify-content: center;
        text-align: center;
        box-sizing: border-box;
    }

    .pal-action-bar a,
    .pal-action-bar button,
    .pal-action-bar form,
    .pal-case-actions,
    .pal-case-actions .small-button,
    .pal-archive-action-cell .small-button,
    .pal-patient-actions a,
    .pal-patient-actions button,
    .pal-patient-actions form,
    .pal-live-form,
    .pal-live-form label,
    .pal-live-form button {
        width: 100%;
    }

    .pal-case-actions {
        align-items: stretch;
        flex-direction: column;
        margin-top: 16px;
    }

    .pal-archive-action-cell {
        display: block;
        width: 100%;
        padding-top: 12px;
        text-align: left;
        white-space: normal;
    }

    .pal-answer-button {
        min-height: 96px;
    }
}

/* Mobile brand and header contrast guard.
   Keep this at the end so older mobile/theme overrides cannot create
   oversized logo cards or white-on-white header badges. */
.topbar .app-name {
    background: rgba(120, 18, 36, 0.34) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.34) !important;
    text-shadow: none !important;
}

.theme-liquid-glass .topbar .app-name,
.theme-dark-command .topbar .app-name,
.theme-tactical-blue .topbar .app-name,
.theme-rescue-green .topbar .app-name,
.theme-warm-operations .topbar .app-name,
.theme-custom .topbar .app-name {
    background: rgba(120, 18, 36, 0.76) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.38) !important;
    box-shadow: 0 8px 20px rgba(84, 0, 8, 0.18);
    text-shadow: none !important;
}

.theme-dark-command .topbar .app-name {
    background: rgba(15, 23, 42, 0.64) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.34) !important;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

@media (max-width: 760px) {
    .sidebar {
        display: grid !important;
        justify-items: center !important;
        gap: 12px !important;
        padding: 12px 0 14px !important;
    }

    .sidebar-logo {
        width: min(100%, 320px) !important;
        max-width: 320px !important;
        min-height: 0 !important;
        max-height: 120px !important;
        margin: 0 auto !important;
        padding: 10px 14px !important;
        border-radius: 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        background: rgba(255, 255, 255, 0.86) !important;
        border: 1px solid rgba(229, 231, 235, 0.86) !important;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10) !important;
    }

    .sidebar-logo img,
    .sidebar-logo .app-product-logo {
        width: auto !important;
        max-width: 285px !important;
        max-height: 64px !important;
        height: auto !important;
        object-fit: contain !important;
    }

    .mobile-nav-toggle {
        min-width: 0 !important;
        width: min(100%, 320px) !important;
        max-width: 320px !important;
        margin: 0 auto !important;
        padding: 12px 18px !important;
        border-radius: 999px !important;
        background: rgba(227, 6, 19, 0.10) !important;
        color: var(--drk-red-dark) !important;
        border: 1px solid rgba(227, 6, 19, 0.30) !important;
        box-shadow: 0 10px 22px rgba(227, 6, 19, 0.10) !important;
    }

    .theme-liquid-glass .sidebar-logo {
        background: rgba(255, 255, 255, 0.66) !important;
        border-color: rgba(255, 255, 255, 0.58) !important;
        box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12) !important;
        backdrop-filter: blur(18px) saturate(145%);
        -webkit-backdrop-filter: blur(18px) saturate(145%);
    }

    .theme-dark-command .sidebar-logo {
        background: rgba(255, 255, 255, 0.88) !important;
        border-color: rgba(255, 255, 255, 0.34) !important;
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.28) !important;
    }

    .theme-tactical-blue .sidebar-logo {
        background: rgba(255, 255, 255, 0.82) !important;
        border-color: rgba(37, 99, 235, 0.22) !important;
    }

    .theme-rescue-green .sidebar-logo {
        background: rgba(255, 255, 255, 0.82) !important;
        border-color: rgba(5, 150, 105, 0.22) !important;
    }

    .theme-warm-operations .sidebar-logo {
        background: rgba(255, 255, 255, 0.82) !important;
        border-color: rgba(249, 115, 22, 0.24) !important;
    }

    .theme-custom .sidebar-logo {
        background: rgba(255, 255, 255, 0.84) !important;
        border-color: rgba(148, 163, 184, 0.28) !important;
    }

    .theme-liquid-glass .mobile-nav-toggle,
    .theme-tactical-blue .mobile-nav-toggle,
    .theme-rescue-green .mobile-nav-toggle,
    .theme-warm-operations .mobile-nav-toggle,
    .theme-custom .mobile-nav-toggle {
        background: rgba(120, 18, 36, 0.72) !important;
        color: #ffffff !important;
        border-color: rgba(255, 255, 255, 0.34) !important;
        box-shadow: 0 10px 24px rgba(84, 0, 8, 0.18) !important;
    }

    .theme-dark-command .mobile-nav-toggle {
        background: rgba(15, 23, 42, 0.78) !important;
        color: #ffffff !important;
        border-color: rgba(255, 255, 255, 0.24) !important;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28) !important;
    }

    .theme-liquid-glass .topbar .app-name,
    .theme-dark-command .topbar .app-name,
    .theme-tactical-blue .topbar .app-name,
    .theme-rescue-green .topbar .app-name,
    .theme-warm-operations .topbar .app-name,
    .theme-custom .topbar .app-name {
        color: #ffffff !important;
        text-shadow: none !important;
    }
}


/* ETB module */
.etb-page .etb-panel {
    display: grid;
    gap: 18px;
}

.etb-page .etb-form-grid label,
.etb-page .etb-cancel-form label {
    display: grid;
    gap: 7px;
    color: var(--text-main);
    font-size: 0.88rem;
    font-weight: 800;
}

.etb-page .etb-form-grid input:not([type="checkbox"]),
.etb-page .etb-form-grid select,
.etb-page .etb-form-grid textarea,
.etb-page .etb-cancel-form textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid var(--border-soft);
    border-radius: 13px;
    background: var(--input-bg);
    color: var(--text-main);
    font: inherit;
    font-weight: 600;
    box-sizing: border-box;
}

.etb-page .full-span {
    grid-column: 1 / -1;
}

.etb-action-bar,
.etb-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.etb-meta-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.etb-meta-grid div,
.etb-signature-box {
    display: grid;
    gap: 5px;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--surface-bg-soft);
}

.etb-meta-grid span,
.etb-entry-meta {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.etb-text-block {
    margin: 0;
}

.etb-link-details {
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--surface-bg-soft);
}

.etb-divera-summary {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--surface-bg-soft);
}

.etb-divera-summary h3 {
    margin: 0;
}

.etb-divera-count-grid,
.etb-divera-response-list {
    display: grid;
    gap: 12px;
}

.etb-divera-count-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.etb-divera-response-row {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(140px, 0.8fr) auto;
    gap: 12px;
    align-items: end;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--surface-bg);
}

.etb-divera-response-row > * {
    min-width: 0;
}

.etb-divera-strength-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.etb-divera-strength-grid article {
    display: grid;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: var(--surface-bg-soft);
}

.etb-divera-strength-grid h3,
.etb-divera-strength-grid p {
    margin: 0;
}

.etb-link-details summary,
.etb-cancel-details summary {
    cursor: pointer;
    font-weight: 900;
}

.etb-entry-list {
    display: grid;
    gap: 14px;
}

.etb-entry-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--surface-bg-soft);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.etb-entry-card.is-canceled {
    opacity: 0.78;
}

.etb-entry-card.is-canceled .etb-entry-text {
    text-decoration: line-through;
}

.etb-entry-head,
.etb-entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.etb-entry-head > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.etb-entry-text,
.etb-cancel-note {
    margin: 0;
}

.etb-cancel-form {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.etb-signature-box code {
    display: block;
    white-space: normal;
    overflow-wrap: anywhere;
}

.etb-archive-card-grid {
    display: none;
}

.etb-archive-table-wrap {
    margin-top: 0;
}

.etb-archive-table .small-button {
    text-decoration: none;
}

.etb-archive-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    background: var(--surface-bg-soft);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    box-sizing: border-box;
}

.etb-archive-card-head,
.etb-archive-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
}

.etb-archive-card h3 {
    margin: 0;
}

.etb-archive-meta {
    display: grid;
    gap: 10px;
}

.etb-archive-meta span {
    display: grid;
    gap: 3px;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.35;
}

.etb-archive-meta strong {
    color: var(--text-main);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.theme-liquid-glass .etb-archive-card {
    background: rgba(255, 255, 255, 0.44) !important;
    border-color: rgba(255, 255, 255, 0.55);
}

.theme-dark-command .etb-archive-card {
    background: rgba(30, 41, 59, 0.94) !important;
    border-color: rgba(148, 163, 184, 0.24) !important;
    color: #f8fafc !important;
}

@media (max-width: 900px) {
    .etb-meta-grid,
    .etb-divera-count-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .etb-divera-response-row,
    .etb-divera-strength-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 760px) {
    .etb-page .etb-hero {
        display: grid;
        grid-template-columns: 1fr;
        gap: 18px;
        align-items: start;
    }

    .etb-page .etb-hero > *,
    .etb-page .etb-action-bar {
        min-width: 0;
        max-width: 100%;
    }

    .etb-page .etb-action-bar {
        display: grid;
        width: 100%;
        justify-content: stretch;
    }

    .etb-page .etb-archive-table-wrap {
        display: none;
    }

    .etb-page .etb-archive-card-grid {
        display: grid;
        gap: 14px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .etb-page .etb-archive-actions {
        display: grid;
        width: 100%;
        justify-content: stretch;
    }

    .etb-meta-grid,
    .etb-divera-count-grid,
    .etb-divera-response-row,
    .etb-divera-strength-grid {
        grid-template-columns: 1fr;
    }

    .etb-page .etb-action-bar .export-button,
    .etb-page .etb-action-bar .small-button,
    .etb-page .module-back-button,
    .etb-page .etb-archive-actions .export-button,
    .etb-action-bar .export-button,
    .etb-form-actions .small-button,
    .etb-form-actions .danger-button,
    .etb-page .pal-case-actions .small-button {
        width: 100%;
        max-width: 100%;
        justify-content: center;
        text-align: center;
        box-sizing: border-box;
        white-space: normal;
    }

    .etb-entry-head,
    .etb-entry-meta {
        align-items: flex-start;
        justify-content: flex-start;
    }
}


/* PAL archive mobile card layout fix */
@media (max-width: 760px) {
    .pal-page .pal-panel .admin-table-wrap {
        overflow-x: visible;
    }

    .pal-page .pal-panel .admin-table {
        display: block;
        width: 100%;
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0;
    }

    .pal-page .pal-panel .admin-table thead {
        display: none;
    }

    .pal-page .pal-panel .admin-table tbody {
        display: grid;
        gap: 14px;
        width: 100%;
    }

    .pal-page .pal-panel .admin-table tr {
        display: grid;
        gap: 8px;
        width: 100%;
        padding: 16px;
        border: 1px solid var(--border-soft);
        border-radius: var(--radius-md);
        background: var(--surface-bg-soft);
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
        box-sizing: border-box;
    }

    .pal-page .pal-panel .admin-table td {
        display: block;
        width: 100%;
        padding: 0;
        border: 0;
        box-sizing: border-box;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .pal-page .pal-archive-action-cell {
        display: block;
        width: 100%;
        padding-top: 12px;
        text-align: left;
        white-space: normal;
    }

    .pal-page .pal-archive-action-cell .small-button,
    .pal-page .pal-archive-button {
        display: inline-flex;
        width: 100%;
        justify-content: center;
        align-items: center;
        text-align: center;
        position: static;
        inset: auto;
        margin-top: 4px;
        box-sizing: border-box;
    }
}

/* App-wide button consolidation: keep existing San|Pad colors, align sizing. */
.small-button,
.export-button,
.reset-button,
.danger-button,
.module-action-button {
    min-height: 44px;
    padding: 11px 18px;
    border-radius: 14px;
    font: inherit;
    font-weight: 800;
    line-height: 1.1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-sizing: border-box;
    border: 0;
    cursor: pointer;
}

.small-button,
.export-button,
.module-action-button:not(.secondary-export) {
    background: var(--drk-red);
    color: #ffffff;
}

.small-button:hover,
.small-button:focus-visible,
.export-button:hover,
.export-button:focus-visible,
.module-action-button:not(.secondary-export):hover,
.module-action-button:not(.secondary-export):focus-visible {
    background: var(--drk-red-dark);
    color: #ffffff;
}

.secondary-export,
.reset-button,
.small-button.secondary {
    background: #6b7280;
    color: #ffffff;
}

.secondary-export:hover,
.secondary-export:focus-visible,
.reset-button:hover,
.reset-button:focus-visible,
.small-button.secondary:hover,
.small-button.secondary:focus-visible {
    background: #4b5563;
    color: #ffffff;
}

.danger-button:hover,
.danger-button:focus-visible {
    background: var(--drk-red-dark);
    color: #ffffff;
}

.small-button:focus-visible,
.export-button:focus-visible,
.reset-button:focus-visible,
.danger-button:focus-visible,
.module-action-button:focus-visible,
.fuhrpark-mobile-tools-toggle:focus-visible {
    outline: 3px solid rgba(227, 6, 19, 0.22);
    outline-offset: 2px;
}

.fuhrpark-mobile-tools-toggle {
    min-height: 44px;
    border-radius: 14px;
    font-weight: 800;
    box-sizing: border-box;
}

.grouped-module-nav .nav-overview-item {
    margin-bottom: 2px;
}

.personnel-card-actions {
    display: flex;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.personnel-card-tags {
    margin-top: 14px;
    justify-content: flex-start;
}

.personnel-card .module-action-button {
    min-width: 180px;
    margin-bottom: 0;
    white-space: nowrap;
}

.status-badge,
.status-chip,
.module-badge,
.count-badge {
    cursor: default;
}

@media (max-width: 760px) {
    .export-actions,
    .loadout-warning-actions,
    .loadout-order-actions,
    .psa-panel-actions,
    .pal-case-actions,
    .etb-action-bar,
    .etb-archive-actions,
    .personnel-card-actions {
        display: grid;
        width: 100%;
        justify-content: stretch;
    }

    .export-actions .export-button,
    .loadout-warning-actions .export-button,
    .loadout-warning-actions .small-button,
    .loadout-order-actions .export-button,
    .loadout-order-actions .small-button,
    .psa-panel-actions .export-button,
    .psa-panel-actions .small-button,
    .pal-case-actions .small-button,
    .etb-action-bar .small-button,
    .etb-action-bar .export-button,
    .etb-archive-actions .export-button,
    .personnel-card .module-action-button,
    .filter-bar .small-button,
    .filter-bar .reset-button {
        width: 100%;
        max-width: 100%;
        white-space: normal;
    }
}

/* Button polish and fixed Personal filter collapse structure. */
.personal-filter-panel {
    padding: 24px;
    overflow: hidden;
}

.personal-filter-panel .collapsible-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin: 0;
}

.personal-filter-panel .collapsible-section-header h2 {
    margin: 0 0 6px;
}

.personal-filter-panel .collapsible-section-header p {
    margin: 0;
}

.personal-filter-body[hidden] {
    display: none !important;
}

.personal-filter-panel .collapsible-section-body {
    margin-top: 20px;
    padding-top: 18px;
}

.personal-filter-panel .personal-filter-body {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.personal-filter-panel .personal-filter-bar {
    width: 100%;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
}

.personal-filter-panel .personal-filter-toggle {
    flex: 0 0 auto;
    margin: 0;
}

.small-button,
.export-button,
.module-action-button:not(.secondary-export),
.filter-collapse-toggle,
.mobile-nav-toggle {
    border: 1px solid rgba(255, 255, 255, 0.20);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 42%),
        linear-gradient(135deg, rgba(227, 6, 19, 0.98) 0%, rgba(205, 0, 15, 0.96) 48%, rgba(116, 18, 36, 0.96) 100%);
    color: #ffffff;
    box-shadow:
        0 10px 24px rgba(227, 6, 19, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease, background 0.16s ease;
}

.small-button:hover,
.small-button:focus-visible,
.export-button:hover,
.export-button:focus-visible,
.module-action-button:not(.secondary-export):hover,
.module-action-button:not(.secondary-export):focus-visible,
.filter-collapse-toggle:hover,
.filter-collapse-toggle:focus-visible,
.mobile-nav-toggle:hover,
.mobile-nav-toggle:focus-visible {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 38%),
        linear-gradient(135deg, rgba(238, 24, 36, 0.98) 0%, rgba(192, 0, 16, 0.98) 48%, rgba(92, 15, 32, 0.98) 100%);
    color: #ffffff;
    box-shadow:
        0 14px 30px rgba(227, 6, 19, 0.26),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
    transform: translateY(-1px);
    text-decoration: none;
}

.small-button:active,
.export-button:active,
.module-action-button:not(.secondary-export):active,
.filter-collapse-toggle:active,
.mobile-nav-toggle:active {
    transform: translateY(0);
    box-shadow:
        0 7px 16px rgba(116, 18, 36, 0.24),
        inset 0 1px 2px rgba(84, 0, 8, 0.18);
}

.secondary-export,
.reset-button,
.small-button.secondary {
    border: 1px solid rgba(148, 163, 184, 0.34);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 42%),
        linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: #ffffff;
    box-shadow:
        0 9px 20px rgba(15, 23, 42, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.secondary-export:hover,
.secondary-export:focus-visible,
.reset-button:hover,
.reset-button:focus-visible,
.small-button.secondary:hover,
.small-button.secondary:focus-visible {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 40%),
        linear-gradient(135deg, #5b6470 0%, #374151 100%);
    color: #ffffff;
    box-shadow:
        0 12px 24px rgba(15, 23, 42, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
    text-decoration: none;
}

.danger-button {
    border: 1px solid rgba(148, 163, 184, 0.34);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 42%),
        linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: #ffffff;
    box-shadow: 0 9px 20px rgba(15, 23, 42, 0.14);
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.danger-button:hover,
.danger-button:focus-visible {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0) 42%),
        linear-gradient(135deg, rgba(185, 28, 28, 0.98), rgba(127, 29, 29, 0.98));
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(185, 28, 28, 0.22);
    transform: translateY(-1px);
}

.theme-liquid-glass .small-button:not(.secondary),
.theme-liquid-glass .export-button:not(.secondary-export),
.theme-liquid-glass .module-action-button:not(.secondary-export),
.theme-liquid-glass .filter-collapse-toggle,
.theme-liquid-glass .mobile-nav-toggle {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 42%),
        linear-gradient(135deg, rgba(227, 6, 19, 0.98) 0%, rgba(205, 0, 15, 0.96) 48%, rgba(116, 18, 36, 0.96) 100%) !important;
    border-color: rgba(255, 255, 255, 0.26) !important;
    color: #ffffff !important;
    box-shadow:
        0 12px 28px rgba(227, 6, 19, 0.24),
        inset 0 1px 0 rgba(255, 255, 255, 0.24) !important;
}

.theme-liquid-glass .secondary-export,
.theme-liquid-glass .reset-button,
.theme-liquid-glass .small-button.secondary {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.70), rgba(226, 232, 240, 0.56)),
        rgba(255, 255, 255, 0.56) !important;
    border-color: rgba(255, 255, 255, 0.62) !important;
    color: #172033 !important;
    box-shadow:
        0 10px 24px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.55) !important;
}

.theme-liquid-glass .secondary-export:hover,
.theme-liquid-glass .secondary-export:focus-visible,
.theme-liquid-glass .reset-button:hover,
.theme-liquid-glass .reset-button:focus-visible,
.theme-liquid-glass .small-button.secondary:hover,
.theme-liquid-glass .small-button.secondary:focus-visible {
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(226, 232, 240, 0.64)),
        rgba(255, 255, 255, 0.66) !important;
    color: #111827 !important;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .theme-liquid-glass .secondary-export,
    .theme-liquid-glass .reset-button,
    .theme-liquid-glass .small-button.secondary {
        backdrop-filter: blur(14px) saturate(140%);
        -webkit-backdrop-filter: blur(14px) saturate(140%);
    }
}

.theme-dark-command .small-button,
.theme-dark-command .export-button,
.theme-dark-command .module-action-button:not(.secondary-export),
.theme-dark-command .filter-collapse-toggle,
.theme-dark-command .mobile-nav-toggle {
    background:
        linear-gradient(135deg, rgba(248, 113, 113, 0.98), rgba(185, 28, 28, 0.98) 50%, rgba(127, 29, 29, 0.98)) !important;
    border-color: rgba(248, 113, 113, 0.38) !important;
    color: #ffffff !important;
    box-shadow:
        0 12px 28px rgba(127, 29, 29, 0.30),
        inset 0 1px 0 rgba(255, 255, 255, 0.16) !important;
}

.theme-dark-command .secondary-export,
.theme-dark-command .reset-button,
.theme-dark-command .small-button.secondary,
.theme-dark-command .danger-button {
    background:
        linear-gradient(135deg, rgba(51, 65, 85, 0.98), rgba(15, 23, 42, 0.96)) !important;
    border-color: rgba(148, 163, 184, 0.38) !important;
    color: #f8fafc !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28) !important;
}

@media (max-width: 760px) {
    .personal-filter-panel {
        padding: 20px;
    }

    .personal-filter-panel .collapsible-section-header {
        display: grid;
        gap: 14px;
    }

    .personal-filter-panel .personal-filter-toggle {
        width: 100% !important;
        min-height: 44px !important;
        border-radius: 14px !important;
    }

    .personal-filter-panel .collapsible-section-body {
        margin-top: 16px;
        padding-top: 16px;
    }
}

/* Settings-inspired module, form and field harmonization. */
.admin-panel,
.info-box,
.detail-card,
.detail-collapsible-card,
.module-card,
.vehicle-card,
.user-card,
.device-card,
.personnel-card,
.personal-card,
.loadout-warning-container,
.loadout-check-card,
.loadout-unit-card,
.psa-form-card,
.etb-archive-card,
.pal-case-card,
.pal-triage-group,
.inline-info-box {
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    background: var(--surface-bg);
    box-shadow: var(--card-shadow);
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

.admin-panel,
.info-box,
.detail-card,
.detail-collapsible-card,
.module-card {
    padding: 22px;
}

.collapsible-section-header,
.section-title-row,
.psa-panel-header,
.loadout-warning-header {
    gap: 16px;
    min-width: 0;
}

.collapsible-section-header > div,
.section-title-row > div,
.psa-panel-header > div,
.loadout-warning-header > div {
    min-width: 0;
}

.collapsible-section-header h2,
.section-title-row h2,
.info-box h2,
.admin-panel h2,
.detail-card h2,
.detail-collapsible-card h2 {
    color: var(--text-main);
    line-height: 1.2;
}

.settings-kicker,
.user-card-kicker,
.device-card-kicker,
.vehicle-card-kicker,
.section-eyebrow,
.card-kicker {
    color: var(--drk-red-dark);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.filter-bar,
.personal-filter-panel .personal-filter-bar,
.mpg-filter-panel,
.fuhrpark-filter-panel,
.psa-filter-panel {
    border: 1px solid var(--border-soft);
    border-radius: 16px;
    background: var(--surface-bg-soft);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    box-sizing: border-box;
    max-width: 100%;
}

.personal-filter-panel .personal-filter-bar {
    padding: 18px;
}

.collapsible-section-body {
    border-top-color: var(--border-soft);
}

.filter-bar label,
.form-grid label,
.device-card-grid label,
.vehicle-card-grid label,
.user-card-form label,
.psa-mini-form label,
.psa-order-form label,
.pal-form-grid label,
.etb-form-grid label {
    min-width: 0;
    max-width: 100%;
    display: grid;
    gap: 7px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.055em;
    line-height: 1.25;
    text-transform: uppercase;
}

.filter-bar input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.filter-bar select,
.filter-bar textarea,
.form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.form-grid select,
.form-grid textarea,
.device-card-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.device-card-grid select,
.device-card-grid textarea,
.vehicle-card-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.vehicle-card-grid select,
.vehicle-card-grid textarea,
.user-card-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.user-card-form select,
.user-card-form textarea,
.psa-mini-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.psa-mini-form select,
.psa-mini-form textarea,
.psa-order-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.psa-order-form select,
.psa-order-form textarea,
.pal-form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.pal-form-grid select,
.pal-form-grid textarea,
.etb-form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.etb-form-grid select,
.etb-form-grid textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text-main);
    font: inherit;
    font-weight: 800;
    box-sizing: border-box;
}

.settings-checkbox,
.theme-card,
.theme-card-content {
    text-transform: none;
    letter-spacing: normal;
}

.filter-bar textarea,
.form-grid textarea,
.device-card-grid textarea,
.vehicle-card-grid textarea,
.psa-mini-form textarea,
.psa-order-form textarea,
.pal-form-grid textarea,
.etb-form-grid textarea {
    min-height: 96px;
    resize: vertical;
}

.filter-bar input[type="file"],
.form-grid input[type="file"],
.psa-mini-form input[type="file"],
.psa-order-form input[type="file"] {
    padding: 10px 12px;
    cursor: pointer;
}

.filter-bar input:focus,
.filter-bar select:focus,
.filter-bar textarea:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.device-card-grid input:focus,
.device-card-grid select:focus,
.device-card-grid textarea:focus,
.vehicle-card-grid input:focus,
.vehicle-card-grid select:focus,
.vehicle-card-grid textarea:focus,
.user-card-form input:focus,
.user-card-form select:focus,
.user-card-form textarea:focus,
.psa-mini-form input:focus,
.psa-mini-form select:focus,
.psa-mini-form textarea:focus,
.psa-order-form input:focus,
.psa-order-form select:focus,
.psa-order-form textarea:focus,
.pal-form-grid input:focus,
.pal-form-grid select:focus,
.pal-form-grid textarea:focus,
.etb-form-grid input:focus,
.etb-form-grid select:focus,
.etb-form-grid textarea:focus {
    outline: 3px solid rgba(227, 6, 19, 0.18);
    outline-offset: 1px;
    border-color: var(--drk-red);
}

.form-hint,
.detail-notes,
.small-muted,
.inline-empty-note,
.loadout-filter-result {
    color: var(--text-muted);
    line-height: 1.45;
}

.theme-liquid-glass .admin-panel,
.theme-liquid-glass .info-box,
.theme-liquid-glass .detail-card,
.theme-liquid-glass .detail-collapsible-card,
.theme-liquid-glass .module-card,
.theme-liquid-glass .vehicle-card,
.theme-liquid-glass .user-card,
.theme-liquid-glass .device-card,
.theme-liquid-glass .personnel-card,
.theme-liquid-glass .personal-card,
.theme-liquid-glass .loadout-warning-container,
.theme-liquid-glass .loadout-check-card,
.theme-liquid-glass .loadout-unit-card,
.theme-liquid-glass .psa-form-card,
.theme-liquid-glass .etb-archive-card,
.theme-liquid-glass .pal-case-card,
.theme-liquid-glass .pal-triage-group,
.theme-liquid-glass .inline-info-box,
.theme-liquid-glass .filter-bar,
.theme-liquid-glass .personal-filter-panel .personal-filter-bar {
    background: rgba(255, 255, 255, 0.56) !important;
    border-color: rgba(255, 255, 255, 0.58) !important;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.12);
}

.theme-liquid-glass .filter-bar input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.theme-liquid-glass .filter-bar select,
.theme-liquid-glass .filter-bar textarea,
.theme-liquid-glass .form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.theme-liquid-glass .form-grid select,
.theme-liquid-glass .form-grid textarea,
.theme-liquid-glass .device-card-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.theme-liquid-glass .device-card-grid select,
.theme-liquid-glass .device-card-grid textarea,
.theme-liquid-glass .vehicle-card-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.theme-liquid-glass .vehicle-card-grid select,
.theme-liquid-glass .vehicle-card-grid textarea {
    background: rgba(255, 255, 255, 0.78) !important;
    border-color: rgba(100, 116, 139, 0.24) !important;
    color: #172033 !important;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .theme-liquid-glass .admin-panel,
    .theme-liquid-glass .info-box,
    .theme-liquid-glass .detail-card,
    .theme-liquid-glass .detail-collapsible-card,
    .theme-liquid-glass .module-card,
    .theme-liquid-glass .vehicle-card,
    .theme-liquid-glass .user-card,
    .theme-liquid-glass .device-card,
    .theme-liquid-glass .personnel-card,
    .theme-liquid-glass .personal-card,
    .theme-liquid-glass .filter-bar,
    .theme-liquid-glass .personal-filter-panel .personal-filter-bar {
        backdrop-filter: blur(18px) saturate(145%);
        -webkit-backdrop-filter: blur(18px) saturate(145%);
    }
}

.theme-dark-command .admin-panel,
.theme-dark-command .info-box,
.theme-dark-command .detail-card,
.theme-dark-command .detail-collapsible-card,
.theme-dark-command .module-card,
.theme-dark-command .vehicle-card,
.theme-dark-command .user-card,
.theme-dark-command .device-card,
.theme-dark-command .personnel-card,
.theme-dark-command .personal-card,
.theme-dark-command .loadout-warning-container,
.theme-dark-command .loadout-check-card,
.theme-dark-command .loadout-unit-card,
.theme-dark-command .psa-form-card,
.theme-dark-command .etb-archive-card,
.theme-dark-command .pal-case-card,
.theme-dark-command .pal-triage-group,
.theme-dark-command .inline-info-box,
.theme-dark-command .filter-bar,
.theme-dark-command .personal-filter-panel .personal-filter-bar {
    background: rgba(30, 41, 59, 0.94) !important;
    border-color: rgba(148, 163, 184, 0.24) !important;
    color: #f8fafc !important;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
}

.theme-dark-command .filter-bar label,
.theme-dark-command .form-grid label,
.theme-dark-command .device-card-grid label,
.theme-dark-command .vehicle-card-grid label,
.theme-dark-command .user-card-form label,
.theme-dark-command .psa-mini-form label,
.theme-dark-command .psa-order-form label,
.theme-dark-command .pal-form-grid label,
.theme-dark-command .etb-form-grid label {
    color: #cbd5e1 !important;
}

.theme-dark-command .filter-bar input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.theme-dark-command .filter-bar select,
.theme-dark-command .filter-bar textarea,
.theme-dark-command .form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.theme-dark-command .form-grid select,
.theme-dark-command .form-grid textarea,
.theme-dark-command .device-card-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.theme-dark-command .device-card-grid select,
.theme-dark-command .device-card-grid textarea,
.theme-dark-command .vehicle-card-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.theme-dark-command .vehicle-card-grid select,
.theme-dark-command .vehicle-card-grid textarea {
    background: rgba(15, 23, 42, 0.92) !important;
    border-color: rgba(148, 163, 184, 0.38) !important;
    color: #f8fafc !important;
}

.theme-dark-command .settings-kicker,
.theme-dark-command .user-card-kicker,
.theme-dark-command .device-card-kicker,
.theme-dark-command .vehicle-card-kicker,
.theme-dark-command .section-eyebrow,
.theme-dark-command .card-kicker {
    color: #fca5a5 !important;
}

@media (max-width: 760px) {
    .admin-panel,
    .info-box,
    .detail-card,
    .detail-collapsible-card,
    .module-card {
        padding: 18px;
        border-radius: 18px;
    }

    .filter-bar,
    .personal-filter-panel .personal-filter-bar {
        width: 100%;
        grid-template-columns: 1fr !important;
        padding: 16px;
        overflow: hidden;
    }

    .collapsible-section-header,
    .section-title-row,
    .psa-panel-header,
    .loadout-warning-header {
        display: grid;
        align-items: start;
    }

    .filter-bar input,
    .filter-bar select,
    .filter-bar textarea,
    .form-grid input,
    .form-grid select,
    .form-grid textarea,
    .device-card-grid input,
    .device-card-grid select,
    .device-card-grid textarea,
    .vehicle-card-grid input,
    .vehicle-card-grid select,
    .vehicle-card-grid textarea {
        max-width: 100%;
    }
}

/* Keep Admin Settings as the visual reference, not a target for module-card harmonization. */
.admin-settings-page .admin-panel {
    margin-top: 28px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible;
}

.admin-settings-page .info-box {
    margin-top: 28px;
    padding: 22px 26px;
    border: 0;
    border-left: 7px solid var(--drk-red);
    border-radius: var(--radius-md);
    background: var(--surface-bg);
    box-shadow: var(--card-shadow);
}

.admin-settings-page .settings-card {
    padding: 20px;
    border-radius: 8px;
    background: var(--surface-bg);
    border: 1px solid var(--border-soft);
    box-shadow: var(--card-shadow);
    gap: 14px;
}

.admin-settings-page .settings-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 12px;
}

.admin-settings-page .settings-card label {
    gap: 7px;
    color: var(--text-muted);
    font-size: 0.84rem;
    font-weight: 900;
    letter-spacing: normal;
    line-height: normal;
    text-transform: none;
}

.admin-settings-page .settings-card input[type="text"],
.admin-settings-page .settings-card input[type="email"],
.admin-settings-page .settings-card input[type="number"],
.admin-settings-page .settings-card input[type="password"],
.admin-settings-page .settings-card input[type="url"],
.admin-settings-page .settings-card input[type="file"] {
    min-height: 0;
    padding: 11px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-soft);
    background: var(--input-bg);
    color: var(--text-main);
    font-weight: 700;
}

.admin-settings-page .settings-help-text,
.admin-settings-page .settings-upload-hint {
    color: var(--text-muted);
}

.theme-liquid-glass.admin-settings-page .admin-panel,
.theme-dark-command.admin-settings-page .admin-panel {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Global module card harmonization based on settings design. */
body:not(.admin-settings-page) .admin-panel,
body:not(.admin-settings-page) .info-box,
body:not(.admin-settings-page) .detail-card,
body:not(.admin-settings-page) .detail-collapsible-card,
body:not(.admin-settings-page) .module-card,
body:not(.admin-settings-page) .mpg-overview-panel,
body:not(.admin-settings-page) .fuhrpark-overview-panel,
body:not(.admin-settings-page) .mpg-add-device-box,
body:not(.admin-settings-page) .vehicle-add-box,
body:not(.admin-settings-page) .psa-actions-panel,
body:not(.admin-settings-page) .vehicle-card,
body:not(.admin-settings-page) .device-card,
body:not(.admin-settings-page) .personnel-card,
body:not(.admin-settings-page) .personal-card,
body:not(.admin-settings-page) .personal-filter-panel,
body:not(.admin-settings-page) .psa-form-card,
body:not(.admin-settings-page) .pal-case-card,
body:not(.admin-settings-page) .pal-triage-group,
body:not(.admin-settings-page) .loadout-warning-panel,
body:not(.admin-settings-page) .loadout-warning-container,
body:not(.admin-settings-page) .loadout-order-container,
body:not(.admin-settings-page) .loadout-filter-panel,
body:not(.admin-settings-page) .loadout-vehicle-section,
body:not(.admin-settings-page) .loadout-unit-card,
body:not(.admin-settings-page) .loadout-check-card,
body:not(.admin-settings-page) .loadout-tree-card,
body:not(.admin-settings-page) .etb-archive-card {
    border: 1px solid var(--border-soft) !important;
    border-radius: 12px !important;
    background: var(--surface-bg) !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08) !important;
    box-sizing: border-box;
}

body:not(.admin-settings-page) .admin-panel,
body:not(.admin-settings-page) .info-box,
body:not(.admin-settings-page) .detail-card,
body:not(.admin-settings-page) .detail-collapsible-card,
body:not(.admin-settings-page) .mpg-overview-panel,
body:not(.admin-settings-page) .fuhrpark-overview-panel,
body:not(.admin-settings-page) .mpg-add-device-box,
body:not(.admin-settings-page) .vehicle-add-box,
body:not(.admin-settings-page) .psa-actions-panel,
body:not(.admin-settings-page) .personal-filter-panel,
body:not(.admin-settings-page) .loadout-warning-panel,
body:not(.admin-settings-page) .loadout-warning-container,
body:not(.admin-settings-page) .loadout-order-container,
body:not(.admin-settings-page) .loadout-filter-panel {
    padding: 20px !important;
}

body:not(.admin-settings-page) .filter-bar,
body:not(.admin-settings-page) .mpg-filter-panel,
body:not(.admin-settings-page) .fuhrpark-filter-panel,
body:not(.admin-settings-page) .psa-filter-panel,
body:not(.admin-settings-page) .personal-filter-bar,
body:not(.admin-settings-page) .loadout-filter-grid,
body:not(.admin-settings-page) .form-grid,
body:not(.admin-settings-page) .vehicle-card-grid,
body:not(.admin-settings-page) .device-card-grid,
body:not(.admin-settings-page) .psa-form-grid,
body:not(.admin-settings-page) .psa-form-grid-compact,
body:not(.admin-settings-page) .pal-form-grid,
body:not(.admin-settings-page) .etb-form-grid {
    gap: 14px !important;
    box-sizing: border-box;
}

body:not(.admin-settings-page) .filter-bar,
body:not(.admin-settings-page) .mpg-filter-panel,
body:not(.admin-settings-page) .fuhrpark-filter-panel,
body:not(.admin-settings-page) .psa-filter-panel,
body:not(.admin-settings-page) .personal-filter-bar {
    padding: 16px !important;
    border: 1px solid var(--border-soft) !important;
    border-radius: 10px !important;
    background: var(--surface-bg-soft) !important;
    box-shadow: none !important;
}

body:not(.admin-settings-page) .collapsible-section-header,
body:not(.admin-settings-page) .section-title-row,
body:not(.admin-settings-page) .loadout-warning-header,
body:not(.admin-settings-page) .vehicle-card-header,
body:not(.admin-settings-page) .device-card-header,
body:not(.admin-settings-page) .personnel-card-header,
body:not(.admin-settings-page) .pal-case-card-head,
body:not(.admin-settings-page) .etb-archive-card-head {
    border-bottom-color: var(--border-soft) !important;
    gap: 14px !important;
}

body:not(.admin-settings-page) .collapsible-section-header h2,
body:not(.admin-settings-page) .section-title-row h2,
body:not(.admin-settings-page) .loadout-warning-header h2,
body:not(.admin-settings-page) .vehicle-card h3,
body:not(.admin-settings-page) .device-card h3,
body:not(.admin-settings-page) .personnel-card h3,
body:not(.admin-settings-page) .psa-form-card h3,
body:not(.admin-settings-page) .pal-case-card h3,
body:not(.admin-settings-page) .etb-archive-card h3 {
    margin-top: 0;
    color: var(--text-main) !important;
    font-size: 1.02rem;
    line-height: 1.22;
}

body:not(.admin-settings-page) .collapsible-section-header p,
body:not(.admin-settings-page) .info-box p,
body:not(.admin-settings-page) .detail-notes,
body:not(.admin-settings-page) .small-muted,
body:not(.admin-settings-page) .loadout-order-description,
body:not(.admin-settings-page) .loadout-filter-result,
body:not(.admin-settings-page) .pal-muted,
body:not(.admin-settings-page) .etb-muted {
    color: var(--text-muted) !important;
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.48;
}

body:not(.admin-settings-page) .filter-bar label,
body:not(.admin-settings-page) .mpg-form label:not(.checkbox-field),
body:not(.admin-settings-page) .vehicle-card-form label:not(.checkbox-field),
body:not(.admin-settings-page) .device-card-grid label,
body:not(.admin-settings-page) .vehicle-card-grid label,
body:not(.admin-settings-page) .psa-mini-form label,
body:not(.admin-settings-page) .psa-order-form label,
body:not(.admin-settings-page) .pal-form-grid label,
body:not(.admin-settings-page) .etb-form-grid label,
body:not(.admin-settings-page) .loadout-filter-grid label,
body:not(.admin-settings-page) .user-card-form label {
    display: grid;
    gap: 7px;
    color: var(--text-muted) !important;
    font-size: 0.78rem !important;
    font-weight: 900 !important;
    letter-spacing: 0.055em;
    line-height: 1.25;
    text-transform: uppercase;
}

body:not(.admin-settings-page) .checkbox-field,
body:not(.admin-settings-page) .checkbox-row,
body:not(.admin-settings-page) .loadout-order-check {
    text-transform: none !important;
    letter-spacing: normal !important;
}

body:not(.admin-settings-page) .filter-bar input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
body:not(.admin-settings-page) .filter-bar select,
body:not(.admin-settings-page) .filter-bar textarea,
body:not(.admin-settings-page) .mpg-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
body:not(.admin-settings-page) .mpg-form select,
body:not(.admin-settings-page) .mpg-form textarea,
body:not(.admin-settings-page) .vehicle-card-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
body:not(.admin-settings-page) .vehicle-card-form select,
body:not(.admin-settings-page) .vehicle-card-form textarea,
body:not(.admin-settings-page) .device-card-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
body:not(.admin-settings-page) .device-card-grid select,
body:not(.admin-settings-page) .device-card-grid textarea,
body:not(.admin-settings-page) .vehicle-card-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
body:not(.admin-settings-page) .vehicle-card-grid select,
body:not(.admin-settings-page) .vehicle-card-grid textarea,
body:not(.admin-settings-page) .psa-mini-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
body:not(.admin-settings-page) .psa-mini-form select,
body:not(.admin-settings-page) .psa-mini-form textarea,
body:not(.admin-settings-page) .pal-form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
body:not(.admin-settings-page) .pal-form-grid select,
body:not(.admin-settings-page) .pal-form-grid textarea,
body:not(.admin-settings-page) .etb-form-grid input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
body:not(.admin-settings-page) .etb-form-grid select,
body:not(.admin-settings-page) .etb-form-grid textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 11px 12px !important;
    border: 1px solid var(--border-soft) !important;
    border-radius: 8px !important;
    background: var(--input-bg) !important;
    color: var(--text-main) !important;
    font: inherit;
    font-weight: 750;
    box-sizing: border-box;
}

body:not(.admin-settings-page) .filter-bar input:focus,
body:not(.admin-settings-page) .filter-bar select:focus,
body:not(.admin-settings-page) .filter-bar textarea:focus,
body:not(.admin-settings-page) .mpg-form input:focus,
body:not(.admin-settings-page) .mpg-form select:focus,
body:not(.admin-settings-page) .mpg-form textarea:focus,
body:not(.admin-settings-page) .vehicle-card-form input:focus,
body:not(.admin-settings-page) .vehicle-card-form select:focus,
body:not(.admin-settings-page) .vehicle-card-form textarea:focus,
body:not(.admin-settings-page) .pal-form-grid input:focus,
body:not(.admin-settings-page) .pal-form-grid select:focus,
body:not(.admin-settings-page) .pal-form-grid textarea:focus,
body:not(.admin-settings-page) .etb-form-grid input:focus,
body:not(.admin-settings-page) .etb-form-grid select:focus,
body:not(.admin-settings-page) .etb-form-grid textarea:focus {
    outline: 2px solid rgba(227, 6, 19, 0.18) !important;
    outline-offset: 1px;
    border-color: var(--drk-red) !important;
}

body.theme-liquid-glass:not(.admin-settings-page) .admin-panel,
body.theme-liquid-glass:not(.admin-settings-page) .info-box,
body.theme-liquid-glass:not(.admin-settings-page) .detail-card,
body.theme-liquid-glass:not(.admin-settings-page) .detail-collapsible-card,
body.theme-liquid-glass:not(.admin-settings-page) .module-card,
body.theme-liquid-glass:not(.admin-settings-page) .mpg-overview-panel,
body.theme-liquid-glass:not(.admin-settings-page) .fuhrpark-overview-panel,
body.theme-liquid-glass:not(.admin-settings-page) .mpg-add-device-box,
body.theme-liquid-glass:not(.admin-settings-page) .vehicle-add-box,
body.theme-liquid-glass:not(.admin-settings-page) .psa-actions-panel,
body.theme-liquid-glass:not(.admin-settings-page) .vehicle-card,
body.theme-liquid-glass:not(.admin-settings-page) .device-card,
body.theme-liquid-glass:not(.admin-settings-page) .personnel-card,
body.theme-liquid-glass:not(.admin-settings-page) .personal-card,
body.theme-liquid-glass:not(.admin-settings-page) .personal-filter-panel,
body.theme-liquid-glass:not(.admin-settings-page) .psa-form-card,
body.theme-liquid-glass:not(.admin-settings-page) .pal-case-card,
body.theme-liquid-glass:not(.admin-settings-page) .pal-triage-group,
body.theme-liquid-glass:not(.admin-settings-page) .loadout-warning-panel,
body.theme-liquid-glass:not(.admin-settings-page) .loadout-warning-container,
body.theme-liquid-glass:not(.admin-settings-page) .loadout-order-container,
body.theme-liquid-glass:not(.admin-settings-page) .loadout-filter-panel,
body.theme-liquid-glass:not(.admin-settings-page) .loadout-vehicle-section,
body.theme-liquid-glass:not(.admin-settings-page) .loadout-unit-card,
body.theme-liquid-glass:not(.admin-settings-page) .loadout-check-card,
body.theme-liquid-glass:not(.admin-settings-page) .loadout-tree-card,
body.theme-liquid-glass:not(.admin-settings-page) .etb-archive-card {
    background: rgba(255, 255, 255, 0.70) !important;
    border-color: rgba(255, 255, 255, 0.68) !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14) !important;
}

body.theme-liquid-glass:not(.admin-settings-page) .filter-bar,
body.theme-liquid-glass:not(.admin-settings-page) .mpg-filter-panel,
body.theme-liquid-glass:not(.admin-settings-page) .fuhrpark-filter-panel,
body.theme-liquid-glass:not(.admin-settings-page) .psa-filter-panel,
body.theme-liquid-glass:not(.admin-settings-page) .personal-filter-bar {
    background: rgba(255, 255, 255, 0.60) !important;
    border-color: rgba(255, 255, 255, 0.62) !important;
}

body.theme-liquid-glass:not(.admin-settings-page) input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
body.theme-liquid-glass:not(.admin-settings-page) select,
body.theme-liquid-glass:not(.admin-settings-page) textarea {
    background: rgba(255, 255, 255, 0.86) !important;
    border-color: rgba(100, 116, 139, 0.26) !important;
    color: #172033 !important;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body.theme-liquid-glass:not(.admin-settings-page) .admin-panel,
    body.theme-liquid-glass:not(.admin-settings-page) .info-box,
    body.theme-liquid-glass:not(.admin-settings-page) .detail-card,
    body.theme-liquid-glass:not(.admin-settings-page) .detail-collapsible-card,
    body.theme-liquid-glass:not(.admin-settings-page) .module-card,
    body.theme-liquid-glass:not(.admin-settings-page) .vehicle-card,
    body.theme-liquid-glass:not(.admin-settings-page) .device-card,
    body.theme-liquid-glass:not(.admin-settings-page) .personnel-card,
    body.theme-liquid-glass:not(.admin-settings-page) .personal-filter-panel,
    body.theme-liquid-glass:not(.admin-settings-page) .psa-form-card,
    body.theme-liquid-glass:not(.admin-settings-page) .pal-case-card,
    body.theme-liquid-glass:not(.admin-settings-page) .pal-triage-group,
    body.theme-liquid-glass:not(.admin-settings-page) .loadout-warning-container,
    body.theme-liquid-glass:not(.admin-settings-page) .etb-archive-card {
        backdrop-filter: blur(18px) saturate(145%);
        -webkit-backdrop-filter: blur(18px) saturate(145%);
    }
}

body.theme-dark-command:not(.admin-settings-page) .admin-panel,
body.theme-dark-command:not(.admin-settings-page) .info-box,
body.theme-dark-command:not(.admin-settings-page) .detail-card,
body.theme-dark-command:not(.admin-settings-page) .detail-collapsible-card,
body.theme-dark-command:not(.admin-settings-page) .module-card,
body.theme-dark-command:not(.admin-settings-page) .vehicle-card,
body.theme-dark-command:not(.admin-settings-page) .device-card,
body.theme-dark-command:not(.admin-settings-page) .personnel-card,
body.theme-dark-command:not(.admin-settings-page) .personal-card,
body.theme-dark-command:not(.admin-settings-page) .personal-filter-panel,
body.theme-dark-command:not(.admin-settings-page) .psa-actions-panel,
body.theme-dark-command:not(.admin-settings-page) .psa-form-card,
body.theme-dark-command:not(.admin-settings-page) .pal-case-card,
body.theme-dark-command:not(.admin-settings-page) .pal-triage-group,
body.theme-dark-command:not(.admin-settings-page) .loadout-warning-container,
body.theme-dark-command:not(.admin-settings-page) .loadout-order-container,
body.theme-dark-command:not(.admin-settings-page) .loadout-filter-panel,
body.theme-dark-command:not(.admin-settings-page) .loadout-vehicle-section,
body.theme-dark-command:not(.admin-settings-page) .loadout-tree-card,
body.theme-dark-command:not(.admin-settings-page) .etb-archive-card {
    background: rgba(30, 41, 59, 0.96) !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
    color: #f8fafc !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34) !important;
}

body.theme-dark-command:not(.admin-settings-page) .filter-bar,
body.theme-dark-command:not(.admin-settings-page) .mpg-filter-panel,
body.theme-dark-command:not(.admin-settings-page) .fuhrpark-filter-panel,
body.theme-dark-command:not(.admin-settings-page) .psa-filter-panel,
body.theme-dark-command:not(.admin-settings-page) .personal-filter-bar {
    background: rgba(15, 23, 42, 0.70) !important;
    border-color: rgba(148, 163, 184, 0.26) !important;
}

body.theme-dark-command:not(.admin-settings-page) input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
body.theme-dark-command:not(.admin-settings-page) select,
body.theme-dark-command:not(.admin-settings-page) textarea {
    background: rgba(15, 23, 42, 0.92) !important;
    border-color: rgba(148, 163, 184, 0.40) !important;
    color: #f8fafc !important;
}

body.theme-dark-command:not(.admin-settings-page) .filter-bar label,
body.theme-dark-command:not(.admin-settings-page) .mpg-form label:not(.checkbox-field),
body.theme-dark-command:not(.admin-settings-page) .vehicle-card-form label:not(.checkbox-field),
body.theme-dark-command:not(.admin-settings-page) .device-card-grid label,
body.theme-dark-command:not(.admin-settings-page) .vehicle-card-grid label,
body.theme-dark-command:not(.admin-settings-page) .psa-mini-form label,
body.theme-dark-command:not(.admin-settings-page) .pal-form-grid label,
body.theme-dark-command:not(.admin-settings-page) .etb-form-grid label {
    color: #cbd5e1 !important;
}

@media (max-width: 760px) {
    body:not(.admin-settings-page) .admin-panel,
    body:not(.admin-settings-page) .info-box,
    body:not(.admin-settings-page) .detail-card,
    body:not(.admin-settings-page) .detail-collapsible-card,
    body:not(.admin-settings-page) .mpg-overview-panel,
    body:not(.admin-settings-page) .fuhrpark-overview-panel,
    body:not(.admin-settings-page) .mpg-add-device-box,
    body:not(.admin-settings-page) .vehicle-add-box,
    body:not(.admin-settings-page) .psa-actions-panel,
    body:not(.admin-settings-page) .personal-filter-panel,
    body:not(.admin-settings-page) .loadout-warning-panel,
    body:not(.admin-settings-page) .loadout-warning-container,
    body:not(.admin-settings-page) .loadout-order-container,
    body:not(.admin-settings-page) .loadout-filter-panel {
        padding: 16px !important;
    }

    body:not(.admin-settings-page) .filter-bar,
    body:not(.admin-settings-page) .personal-filter-bar,
    body:not(.admin-settings-page) .vehicle-card-grid,
    body:not(.admin-settings-page) .device-card-grid,
    body:not(.admin-settings-page) .form-grid,
    body:not(.admin-settings-page) .pal-form-grid,
    body:not(.admin-settings-page) .etb-form-grid {
        grid-template-columns: 1fr !important;
        width: 100%;
    }
}

/* Settings-like module card structure for operational modules. */
.module-settings-card {
    min-width: 0;
    max-width: 100%;
    display: grid;
    gap: 14px;
    margin-top: 28px;
    padding: 20px !important;
    border: 1px solid var(--border-soft) !important;
    border-radius: 8px !important;
    background: var(--surface-bg) !important;
    box-shadow: var(--card-shadow) !important;
    box-sizing: border-box;
    overflow: hidden;
}

.module-settings-card-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);
}

.module-settings-card-head > div {
    min-width: 0;
}

.module-settings-kicker {
    margin: 0;
    color: var(--drk-red-dark) !important;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.module-settings-card .module-settings-kicker,
.psa-page .module-settings-card .module-settings-kicker {
    margin: 0;
    color: var(--drk-red-dark) !important;
    font-size: 0.75rem;
    font-weight: 900;
    line-height: normal;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.module-settings-card-head h2 {
    margin: 4px 0 0;
    color: var(--text-main);
    font-size: 1.05rem;
    line-height: 1.2;
}

.module-settings-description {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.45;
}

.module-settings-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.module-settings-body {
    min-width: 0;
    display: grid;
    gap: 16px;
}

.module-settings-body[hidden],
.module-settings-card .collapsible-section-body[hidden] {
    display: none !important;
}

.module-settings-body .filter-bar {
    margin: 0;
}

.module-settings-card label:not(.checkbox-field):not(.checkbox-label):not(.loadout-order-check),
.module-settings-card .filter-bar label {
    min-width: 0;
    max-width: 100%;
    display: grid;
    gap: 7px;
    color: var(--text-muted) !important;
    font-size: 0.84rem !important;
    font-weight: 900 !important;
    letter-spacing: normal;
    line-height: 1.25;
    text-transform: none;
}

.module-settings-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.module-settings-card select,
.module-settings-card textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    min-height: 44px;
    padding: 11px 12px !important;
    border-radius: 8px !important;
    border: 1px solid var(--border-soft) !important;
    background: var(--input-bg) !important;
    color: var(--text-main) !important;
    font: inherit;
    font-weight: 700;
}

.module-settings-card input:focus,
.module-settings-card select:focus,
.module-settings-card textarea:focus {
    outline: 2px solid rgba(227, 6, 19, 0.18) !important;
    outline-offset: 1px;
    border-color: var(--drk-red) !important;
}

.theme-liquid-glass .module-settings-card {
    background: rgba(255, 255, 255, 0.70) !important;
    border-color: rgba(255, 255, 255, 0.68) !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14) !important;
}

.theme-liquid-glass .module-settings-kicker {
    color: var(--drk-red-dark) !important;
}

.theme-liquid-glass .module-settings-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.theme-liquid-glass .module-settings-card select,
.theme-liquid-glass .module-settings-card textarea {
    background: rgba(255, 255, 255, 0.86) !important;
    border-color: rgba(100, 116, 139, 0.26) !important;
    color: #172033 !important;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .theme-liquid-glass .module-settings-card {
        backdrop-filter: blur(18px) saturate(145%);
        -webkit-backdrop-filter: blur(18px) saturate(145%);
    }
}

.theme-dark-command .module-settings-card {
    background: rgba(30, 41, 59, 0.96) !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
    color: #f8fafc !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34) !important;
}

.theme-dark-command .module-settings-card-head {
    border-bottom-color: rgba(148, 163, 184, 0.24);
}

.theme-dark-command .module-settings-card-head h2 {
    color: #ffffff !important;
}

.theme-dark-command .module-settings-kicker {
    color: #fca5a5 !important;
}

.theme-dark-command .module-settings-description,
.theme-dark-command .module-settings-card label:not(.checkbox-field):not(.checkbox-label):not(.loadout-order-check) {
    color: #cbd5e1 !important;
}

.theme-dark-command .module-settings-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
.theme-dark-command .module-settings-card select,
.theme-dark-command .module-settings-card textarea {
    background: rgba(15, 23, 42, 0.92) !important;
    border-color: rgba(148, 163, 184, 0.40) !important;
    color: #f8fafc !important;
}

/* Global theme QA hardening for admin/profile/help surfaces and dark status cards. */
body.theme-liquid-glass:not(.admin-settings-page) .telegram-link-box,
body.theme-liquid-glass:not(.admin-settings-page) .sync-output-box,
body.theme-liquid-glass:not(.admin-settings-page) .audit-entry,
body.theme-liquid-glass:not(.admin-settings-page) .theme-card-content,
body.theme-liquid-glass:not(.admin-settings-page) .profile-theme-panel,
body.theme-liquid-glass:not(.admin-settings-page) .user-card-form,
body.theme-liquid-glass:not(.admin-settings-page) .user-card-delete,
body.theme-liquid-glass:not(.admin-settings-page) .maintenance-toggle-form {
    background: rgba(255, 255, 255, 0.64) !important;
    border-color: rgba(255, 255, 255, 0.64) !important;
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.12) !important;
}

body.theme-liquid-glass:not(.admin-settings-page) .telegram-link-box h3,
body.theme-liquid-glass:not(.admin-settings-page) .telegram-link-box p,
body.theme-liquid-glass:not(.admin-settings-page) .profile-form label,
body.theme-liquid-glass:not(.admin-settings-page) .audit-entry h3,
body.theme-liquid-glass:not(.admin-settings-page) .audit-meta strong,
body.theme-liquid-glass:not(.admin-settings-page) .user-card-form label,
body.theme-liquid-glass:not(.admin-settings-page) .user-card-delete label {
    color: var(--text-main) !important;
}

body.theme-liquid-glass:not(.admin-settings-page) .sync-output-box {
    color: #172033 !important;
    background: rgba(255, 255, 255, 0.76) !important;
    border: 1px solid rgba(100, 116, 139, 0.22) !important;
}

body.theme-liquid-glass:not(.admin-settings-page) .sync-error-box {
    color: #7f1d1d !important;
    background: rgba(254, 226, 226, 0.82) !important;
    border-color: rgba(248, 113, 113, 0.32) !important;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    body.theme-liquid-glass:not(.admin-settings-page) .telegram-link-box,
    body.theme-liquid-glass:not(.admin-settings-page) .sync-output-box,
    body.theme-liquid-glass:not(.admin-settings-page) .audit-entry,
    body.theme-liquid-glass:not(.admin-settings-page) .theme-card-content,
    body.theme-liquid-glass:not(.admin-settings-page) .profile-theme-panel,
    body.theme-liquid-glass:not(.admin-settings-page) .user-card-form,
    body.theme-liquid-glass:not(.admin-settings-page) .user-card-delete,
    body.theme-liquid-glass:not(.admin-settings-page) .maintenance-toggle-form {
        backdrop-filter: blur(18px) saturate(145%);
        -webkit-backdrop-filter: blur(18px) saturate(145%);
    }
}

body.theme-dark-command:not(.admin-settings-page) {
    background: #0f172a !important;
    color: #f8fafc !important;
}

body.theme-dark-command:not(.admin-settings-page) .module-settings-card,
body.theme-dark-command:not(.admin-settings-page) .admin-panel,
body.theme-dark-command:not(.admin-settings-page) .info-box,
body.theme-dark-command:not(.admin-settings-page) .telegram-link-box,
body.theme-dark-command:not(.admin-settings-page) .audit-entry,
body.theme-dark-command:not(.admin-settings-page) .theme-card-content,
body.theme-dark-command:not(.admin-settings-page) .profile-theme-panel,
body.theme-dark-command:not(.admin-settings-page) .user-card-form,
body.theme-dark-command:not(.admin-settings-page) .user-card-delete,
body.theme-dark-command:not(.admin-settings-page) .maintenance-toggle-form,
body.theme-dark-command:not(.admin-settings-page) .sync-output-box {
    background: rgba(30, 41, 59, 0.96) !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
    color: #f8fafc !important;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34) !important;
}

body.theme-dark-command:not(.admin-settings-page) .mpg-stat-card {
    background: rgba(30, 41, 59, 0.96) !important;
    border-top: 1px solid rgba(148, 163, 184, 0.22) !important;
    border-right: 1px solid rgba(148, 163, 184, 0.22) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22) !important;
    color: #f8fafc !important;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.30) !important;
}

body.theme-dark-command:not(.admin-settings-page) .mpg-stat-card > span,
body.theme-dark-command:not(.admin-settings-page) .fleet-stats-grid .mpg-stat-card > span,
body.theme-dark-command:not(.admin-settings-page) .pal-stat-card > span {
    color: #cbd5e1 !important;
}

body.theme-dark-command:not(.admin-settings-page) .mpg-stat-card > strong,
body.theme-dark-command:not(.admin-settings-page) .fleet-stats-grid .mpg-stat-card > strong,
body.theme-dark-command:not(.admin-settings-page) .pal-stat-card > strong {
    color: #ffffff !important;
}

body.theme-dark-command:not(.admin-settings-page) .module-settings-kicker,
body.theme-dark-command:not(.admin-settings-page) .settings-kicker,
body.theme-dark-command:not(.admin-settings-page) .user-card-kicker,
body.theme-dark-command:not(.admin-settings-page) .device-card-kicker,
body.theme-dark-command:not(.admin-settings-page) .vehicle-card-kicker,
body.theme-dark-command:not(.admin-settings-page) .section-eyebrow,
body.theme-dark-command:not(.admin-settings-page) .card-kicker,
body.theme-dark-command:not(.admin-settings-page) .audit-action,
body.theme-dark-command:not(.admin-settings-page) .eyebrow {
    color: #f87171 !important;
}

body.theme-dark-command:not(.admin-settings-page) .module-settings-description,
body.theme-dark-command:not(.admin-settings-page) .telegram-link-box p,
body.theme-dark-command:not(.admin-settings-page) .profile-form label,
body.theme-dark-command:not(.admin-settings-page) .audit-meta,
body.theme-dark-command:not(.admin-settings-page) .audit-date,
body.theme-dark-command:not(.admin-settings-page) .small-muted,
body.theme-dark-command:not(.admin-settings-page) .detail-notes {
    color: #cbd5e1 !important;
}

body.theme-dark-command:not(.admin-settings-page) .filter-bar,
body.theme-dark-command:not(.admin-settings-page) .mpg-filter-panel,
body.theme-dark-command:not(.admin-settings-page) .fuhrpark-filter-panel,
body.theme-dark-command:not(.admin-settings-page) .psa-filter-panel,
body.theme-dark-command:not(.admin-settings-page) .personal-filter-bar {
    background: rgba(15, 23, 42, 0.78) !important;
    border-color: rgba(148, 163, 184, 0.30) !important;
}

body.theme-dark-command:not(.admin-settings-page) input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
body.theme-dark-command:not(.admin-settings-page) select,
body.theme-dark-command:not(.admin-settings-page) textarea {
    background: rgba(15, 23, 42, 0.94) !important;
    border-color: rgba(148, 163, 184, 0.42) !important;
    color: #f8fafc !important;
}

body.theme-dark-command:not(.admin-settings-page) .status-badge-ok {
    background: rgba(34, 197, 94, 0.18) !important;
    color: #bbf7d0 !important;
    border: 1px solid rgba(74, 222, 128, 0.30) !important;
}

body.theme-dark-command:not(.admin-settings-page) .status-badge-warning {
    background: rgba(245, 158, 11, 0.18) !important;
    color: #fde68a !important;
    border: 1px solid rgba(251, 191, 36, 0.34) !important;
}

body.theme-dark-command:not(.admin-settings-page) .status-badge-danger {
    background: rgba(239, 68, 68, 0.20) !important;
    color: #fecaca !important;
    border: 1px solid rgba(248, 113, 113, 0.38) !important;
}

body.theme-dark-command:not(.admin-settings-page) .status-badge-muted {
    background: rgba(148, 163, 184, 0.16) !important;
    color: #e2e8f0 !important;
    border: 1px solid rgba(148, 163, 184, 0.28) !important;
}

/* Admin follow-up: keep nested user/admin action areas inside the card language. */
.admin-user-card {
    overflow: hidden;
}

.admin-user-action-form,
.admin-divera-sync-panel .maintenance-toggle-form,
.admin-personnel-links-panel .personnel-link-form {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    background: var(--surface-bg-soft);
    box-shadow: none;
    box-sizing: border-box;
}

.admin-user-compact-form {
    justify-content: flex-end;
}

.admin-user-delete-form {
    display: grid;
    gap: 12px;
    justify-content: stretch;
}

.admin-divera-sync-panel .maintenance-toggle-form,
.admin-personnel-links-panel .personnel-link-form {
    margin-top: 0;
}

.admin-personnel-links-panel .audit-list,
.admin-divera-sync-panel .audit-list {
    display: grid;
    gap: 14px;
}

.admin-personnel-links-panel .audit-entry,
.admin-divera-sync-panel .audit-entry {
    margin: 0;
}

body.theme-liquid-glass:not(.admin-settings-page) .admin-user-action-form,
body.theme-liquid-glass:not(.admin-settings-page) .admin-divera-sync-panel .maintenance-toggle-form,
body.theme-liquid-glass:not(.admin-settings-page) .admin-personnel-links-panel .personnel-link-form,
body.theme-liquid-glass:not(.admin-settings-page) .admin-personnel-links-panel .audit-entry,
body.theme-liquid-glass:not(.admin-settings-page) .admin-divera-sync-panel .audit-entry {
    background: rgba(255, 255, 255, 0.44) !important;
    border-color: rgba(255, 255, 255, 0.56) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), 0 10px 24px rgba(15, 23, 42, 0.08) !important;
}

body.theme-liquid-glass:not(.admin-settings-page) .admin-user-danger-form,
body.theme-liquid-glass:not(.admin-settings-page) .admin-user-delete-form {
    background: rgba(255, 255, 255, 0.38) !important;
    border-color: rgba(227, 6, 19, 0.18) !important;
}

body.theme-liquid-glass:not(.admin-settings-page) .admin-user-action-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
body.theme-liquid-glass:not(.admin-settings-page) .admin-user-action-form select,
body.theme-liquid-glass:not(.admin-settings-page) .admin-personnel-links-panel select {
    background: rgba(255, 255, 255, 0.86) !important;
    border-color: rgba(100, 116, 139, 0.26) !important;
    color: #172033 !important;
}

body.theme-dark-command:not(.admin-settings-page) .admin-user-action-form,
body.theme-dark-command:not(.admin-settings-page) .admin-divera-sync-panel .maintenance-toggle-form,
body.theme-dark-command:not(.admin-settings-page) .admin-personnel-links-panel .personnel-link-form,
body.theme-dark-command:not(.admin-settings-page) .admin-personnel-links-panel .audit-entry,
body.theme-dark-command:not(.admin-settings-page) .admin-divera-sync-panel .audit-entry {
    background: rgba(15, 23, 42, 0.68) !important;
    border-color: rgba(148, 163, 184, 0.28) !important;
    color: #f8fafc !important;
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.08), 0 12px 26px rgba(0, 0, 0, 0.24) !important;
}

body.theme-dark-command:not(.admin-settings-page) .admin-user-danger-form,
body.theme-dark-command:not(.admin-settings-page) .admin-user-delete-form {
    background: rgba(127, 29, 29, 0.18) !important;
    border-color: rgba(248, 113, 113, 0.24) !important;
}

body.theme-dark-command:not(.admin-settings-page) .admin-user-action-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
body.theme-dark-command:not(.admin-settings-page) .admin-user-action-form select,
body.theme-dark-command:not(.admin-settings-page) .admin-personnel-links-panel select {
    background: rgba(15, 23, 42, 0.94) !important;
    border-color: rgba(148, 163, 184, 0.42) !important;
    color: #f8fafc !important;
}

@media (max-width: 760px) {
    .admin-user-action-form {
        grid-template-columns: 1fr !important;
        align-items: stretch;
    }

    .admin-user-action-form .small-button,
    .admin-user-action-form .danger-button {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .module-settings-card {
        padding: 18px !important;
    }

    .module-settings-card-head {
        display: grid;
        align-items: start;
    }

    .module-settings-actions {
        display: grid;
        justify-content: stretch;
        width: 100%;
    }

    .module-settings-actions .small-button,
    .module-settings-actions .export-button,
    .module-settings-actions .reset-button,
    .module-settings-actions a {
        width: 100%;
    }
}

/* San|Pad edition quality layer: unified branding, surfaces and controls. */
:root {
    --edition-accent: #000000;
    --edition-soft: #fff1f2;
    --edition-sidebar-mark: var(--drk-red);
    --button-gradient: linear-gradient(135deg, var(--drk-red) 0%, var(--drk-red-dark) 100%);
    --button-hover-gradient: linear-gradient(135deg, var(--drk-red-dark) 0%, var(--drk-red) 100%);
    --focus-ring: rgba(227, 6, 19, 0.22);
    --nav-active-bg: var(--chip-bg);
    --nav-active-text: var(--chip-text);
    --topbar-badge-bg: rgba(255, 255, 255, 0.18);
}

.app-page.theme-sanpad-drk,
.app-page.theme-sanpad-asb,
.app-page.theme-sanpad-mhd,
.app-page.theme-sanpad-juh,
.app-page.theme-sanpad-neutral,
.login-page.theme-sanpad-drk,
.login-page.theme-sanpad-asb,
.login-page.theme-sanpad-mhd,
.login-page.theme-sanpad-juh,
.login-page.theme-sanpad-neutral {
    background: var(--page-bg) !important;
    color: var(--text-main);
}

.app-page.theme-sanpad-drk .sidebar,
.app-page.theme-sanpad-asb .sidebar,
.app-page.theme-sanpad-mhd .sidebar,
.app-page.theme-sanpad-juh .sidebar,
.app-page.theme-sanpad-neutral .sidebar {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.42)),
        var(--sidebar-bg) !important;
    border-right: 1px solid var(--border-soft) !important;
    box-shadow: 12px 0 34px rgba(15, 23, 42, 0.07);
}

.sidebar-brand {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 22px;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.88), rgba(255,255,255,0.58)),
        var(--surface-bg-translucent);
    border: 1px solid var(--border-soft);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.11);
    position: relative;
    overflow: hidden;
}

.sidebar-brand::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 5px;
    background: linear-gradient(180deg, var(--edition-sidebar-mark), var(--edition-accent));
}

.sidebar-logo-stage {
    min-height: 96px;
    padding: 8px 4px;
    border-radius: 16px;
    background:
        radial-gradient(circle at 18% 10%, color-mix(in srgb, var(--edition-sidebar-mark) 14%, transparent), transparent 42%),
        linear-gradient(145deg, rgba(255,255,255,0.34), rgba(255,255,255,0.08));
    border: 1px solid rgba(255, 255, 255, 0.24);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.sidebar-logo-stage-org {
    min-height: 112px;
    padding: 16px;
    background:
        radial-gradient(circle at 22% 12%, color-mix(in srgb, var(--edition-sidebar-mark) 12%, transparent), transparent 38%),
        linear-gradient(145deg, rgba(255,255,255,0.88), rgba(255,255,255,0.62));
    border-color: rgba(255, 255, 255, 0.66);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.68),
        0 10px 24px rgba(15, 23, 42, 0.08);
}

.sidebar-brand-logo {
    display: block;
    width: min(100%, 258px);
    max-width: 100%;
    max-height: 82px;
    height: auto;
    object-fit: contain;
}

.sidebar-logo-stage-org .sidebar-brand-logo {
    max-height: 92px;
}

.sidebar-brand-text {
    display: grid;
    gap: 4px;
    padding: 0 4px 2px;
    text-align: center;
}

.sidebar-brand-text strong {
    color: var(--text-main);
    font-size: 0.98rem;
    font-weight: 950;
    line-height: 1.18;
}

.sidebar-brand-text span {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.app-page.theme-sanpad-drk .topbar,
.app-page.theme-sanpad-asb .topbar,
.app-page.theme-sanpad-mhd .topbar,
.app-page.theme-sanpad-juh .topbar,
.app-page.theme-sanpad-neutral .topbar {
    background: var(--header-bg) !important;
    border: 1px solid rgba(255, 255, 255, 0.20);
    box-shadow:
        0 18px 42px color-mix(in srgb, var(--drk-red) 20%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.20);
}

.app-page.theme-sanpad-drk .app-name,
.app-page.theme-sanpad-asb .app-name,
.app-page.theme-sanpad-mhd .app-name,
.app-page.theme-sanpad-juh .app-name,
.app-page.theme-sanpad-neutral .app-name {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: min(360px, 100%);
    justify-self: end;
    padding: 7px 11px;
    border-radius: 999px;
    background: var(--topbar-badge-bg) !important;
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #ffffff !important;
    font-size: 0.78rem;
    font-weight: 950;
    line-height: 1.15;
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.app-page.theme-sanpad-drk .nav-item,
.app-page.theme-sanpad-asb .nav-item,
.app-page.theme-sanpad-mhd .nav-item,
.app-page.theme-sanpad-juh .nav-item,
.app-page.theme-sanpad-neutral .nav-item {
    color: var(--text-main);
    border-color: transparent;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.app-page.theme-sanpad-drk .nav-item:hover,
.app-page.theme-sanpad-asb .nav-item:hover,
.app-page.theme-sanpad-mhd .nav-item:hover,
.app-page.theme-sanpad-juh .nav-item:hover,
.app-page.theme-sanpad-neutral .nav-item:hover,
.app-page.theme-sanpad-drk .nav-item.active,
.app-page.theme-sanpad-asb .nav-item.active,
.app-page.theme-sanpad-mhd .nav-item.active,
.app-page.theme-sanpad-juh .nav-item.active,
.app-page.theme-sanpad-neutral .nav-item.active {
    background: var(--nav-active-bg) !important;
    color: var(--nav-active-text) !important;
    border-color: color-mix(in srgb, var(--drk-red) 28%, transparent) !important;
}

.app-page.theme-sanpad-drk .grouped-module-nav .nav-item.active::before,
.app-page.theme-sanpad-asb .grouped-module-nav .nav-item.active::before,
.app-page.theme-sanpad-mhd .grouped-module-nav .nav-item.active::before,
.app-page.theme-sanpad-juh .grouped-module-nav .nav-item.active::before,
.app-page.theme-sanpad-neutral .grouped-module-nav .nav-item.active::before {
    background: linear-gradient(180deg, var(--edition-sidebar-mark), var(--edition-accent));
}

.app-page.theme-sanpad-drk .info-box,
.app-page.theme-sanpad-asb .info-box,
.app-page.theme-sanpad-mhd .info-box,
.app-page.theme-sanpad-juh .info-box,
.app-page.theme-sanpad-neutral .info-box,
.app-page.theme-sanpad-drk .module-card,
.app-page.theme-sanpad-asb .module-card,
.app-page.theme-sanpad-mhd .module-card,
.app-page.theme-sanpad-juh .module-card,
.app-page.theme-sanpad-neutral .module-card,
.app-page.theme-sanpad-drk .settings-card,
.app-page.theme-sanpad-asb .settings-card,
.app-page.theme-sanpad-mhd .settings-card,
.app-page.theme-sanpad-juh .settings-card,
.app-page.theme-sanpad-neutral .settings-card,
.app-page.theme-sanpad-drk .admin-table-wrap,
.app-page.theme-sanpad-asb .admin-table-wrap,
.app-page.theme-sanpad-mhd .admin-table-wrap,
.app-page.theme-sanpad-juh .admin-table-wrap,
.app-page.theme-sanpad-neutral .admin-table-wrap,
.app-page.theme-sanpad-drk .theme-card-content,
.app-page.theme-sanpad-asb .theme-card-content,
.app-page.theme-sanpad-mhd .theme-card-content,
.app-page.theme-sanpad-juh .theme-card-content,
.app-page.theme-sanpad-neutral .theme-card-content,
.app-page.theme-sanpad-drk .telegram-link-box,
.app-page.theme-sanpad-asb .telegram-link-box,
.app-page.theme-sanpad-mhd .telegram-link-box,
.app-page.theme-sanpad-juh .telegram-link-box,
.app-page.theme-sanpad-neutral .telegram-link-box {
    background: var(--surface-bg-translucent) !important;
    border-color: var(--border-soft) !important;
    box-shadow: var(--card-shadow) !important;
    color: var(--text-main) !important;
}

.app-page.theme-sanpad-drk .info-box,
.app-page.theme-sanpad-asb .info-box,
.app-page.theme-sanpad-mhd .info-box,
.app-page.theme-sanpad-juh .info-box,
.app-page.theme-sanpad-neutral .info-box,
.app-page.theme-sanpad-drk .telegram-link-box,
.app-page.theme-sanpad-asb .telegram-link-box,
.app-page.theme-sanpad-mhd .telegram-link-box,
.app-page.theme-sanpad-juh .telegram-link-box,
.app-page.theme-sanpad-neutral .telegram-link-box {
    border-left-color: var(--edition-sidebar-mark) !important;
}

.app-page.theme-sanpad-drk .admin-table th,
.app-page.theme-sanpad-asb .admin-table th,
.app-page.theme-sanpad-mhd .admin-table th,
.app-page.theme-sanpad-juh .admin-table th,
.app-page.theme-sanpad-neutral .admin-table th {
    background: var(--table-head-bg) !important;
    color: var(--text-muted) !important;
}

.app-page.theme-sanpad-drk .small-button,
.app-page.theme-sanpad-asb .small-button,
.app-page.theme-sanpad-mhd .small-button,
.app-page.theme-sanpad-juh .small-button,
.app-page.theme-sanpad-neutral .small-button,
.app-page.theme-sanpad-drk .export-button,
.app-page.theme-sanpad-asb .export-button,
.app-page.theme-sanpad-mhd .export-button,
.app-page.theme-sanpad-juh .export-button,
.app-page.theme-sanpad-neutral .export-button,
.app-page.theme-sanpad-drk .module-action-button:not(.secondary-export),
.app-page.theme-sanpad-asb .module-action-button:not(.secondary-export),
.app-page.theme-sanpad-mhd .module-action-button:not(.secondary-export),
.app-page.theme-sanpad-juh .module-action-button:not(.secondary-export),
.app-page.theme-sanpad-neutral .module-action-button:not(.secondary-export),
.app-page.theme-sanpad-drk .telegram-button,
.app-page.theme-sanpad-asb .telegram-button,
.app-page.theme-sanpad-mhd .telegram-button,
.app-page.theme-sanpad-juh .telegram-button,
.app-page.theme-sanpad-neutral .telegram-button,
.app-page.theme-sanpad-drk .mobile-nav-toggle,
.app-page.theme-sanpad-asb .mobile-nav-toggle,
.app-page.theme-sanpad-mhd .mobile-nav-toggle,
.app-page.theme-sanpad-juh .mobile-nav-toggle,
.app-page.theme-sanpad-neutral .mobile-nav-toggle {
    background: var(--button-gradient) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
    box-shadow:
        0 12px 26px color-mix(in srgb, var(--drk-red) 23%, transparent),
        inset 0 1px 0 rgba(255, 255, 255, 0.20) !important;
}

.app-page.theme-sanpad-drk .small-button:hover,
.app-page.theme-sanpad-asb .small-button:hover,
.app-page.theme-sanpad-mhd .small-button:hover,
.app-page.theme-sanpad-juh .small-button:hover,
.app-page.theme-sanpad-neutral .small-button:hover,
.app-page.theme-sanpad-drk .telegram-button:hover,
.app-page.theme-sanpad-asb .telegram-button:hover,
.app-page.theme-sanpad-mhd .telegram-button:hover,
.app-page.theme-sanpad-juh .telegram-button:hover,
.app-page.theme-sanpad-neutral .telegram-button:hover {
    background: var(--button-hover-gradient) !important;
}

.app-page.theme-sanpad-drk input:focus,
.app-page.theme-sanpad-asb input:focus,
.app-page.theme-sanpad-mhd input:focus,
.app-page.theme-sanpad-juh input:focus,
.app-page.theme-sanpad-neutral input:focus,
.app-page.theme-sanpad-drk select:focus,
.app-page.theme-sanpad-asb select:focus,
.app-page.theme-sanpad-mhd select:focus,
.app-page.theme-sanpad-juh select:focus,
.app-page.theme-sanpad-neutral select:focus,
.app-page.theme-sanpad-drk textarea:focus,
.app-page.theme-sanpad-asb textarea:focus,
.app-page.theme-sanpad-mhd textarea:focus,
.app-page.theme-sanpad-juh textarea:focus,
.app-page.theme-sanpad-neutral textarea:focus {
    border-color: var(--edition-sidebar-mark) !important;
    box-shadow: 0 0 0 3px var(--focus-ring) !important;
    outline: none !important;
}

.app-page.theme-sanpad-drk .theme-card input:checked + .theme-card-content,
.app-page.theme-sanpad-asb .theme-card input:checked + .theme-card-content,
.app-page.theme-sanpad-mhd .theme-card input:checked + .theme-card-content,
.app-page.theme-sanpad-juh .theme-card input:checked + .theme-card-content,
.app-page.theme-sanpad-neutral .theme-card input:checked + .theme-card-content {
    border-color: var(--edition-sidebar-mark) !important;
    outline-color: var(--focus-ring) !important;
}

.app-page.theme-sanpad-drk .status-badge-ok,
.app-page.theme-sanpad-asb .status-badge-ok,
.app-page.theme-sanpad-mhd .status-badge-ok,
.app-page.theme-sanpad-juh .status-badge-ok,
.app-page.theme-sanpad-neutral .status-badge-ok,
.app-page.theme-sanpad-drk .flash-message-success,
.app-page.theme-sanpad-asb .flash-message-success,
.app-page.theme-sanpad-mhd .flash-message-success,
.app-page.theme-sanpad-juh .flash-message-success,
.app-page.theme-sanpad-neutral .flash-message-success {
    color: var(--success-accent) !important;
}

.app-page.theme-sanpad-drk .status-badge-warning,
.app-page.theme-sanpad-asb .status-badge-warning,
.app-page.theme-sanpad-mhd .status-badge-warning,
.app-page.theme-sanpad-juh .status-badge-warning,
.app-page.theme-sanpad-neutral .status-badge-warning {
    background: color-mix(in srgb, var(--edition-accent) 15%, white) !important;
    color: color-mix(in srgb, var(--edition-accent) 62%, #111827) !important;
}

.app-page.theme-sanpad-drk .error-box,
.app-page.theme-sanpad-asb .error-box,
.app-page.theme-sanpad-mhd .error-box,
.app-page.theme-sanpad-juh .error-box,
.app-page.theme-sanpad-neutral .error-box,
.app-page.theme-sanpad-drk .profile-error,
.app-page.theme-sanpad-asb .profile-error,
.app-page.theme-sanpad-mhd .profile-error,
.app-page.theme-sanpad-juh .profile-error,
.app-page.theme-sanpad-neutral .profile-error {
    background: color-mix(in srgb, var(--danger-accent) 12%, white) !important;
    border-color: color-mix(in srgb, var(--danger-accent) 34%, white) !important;
    color: var(--danger-accent) !important;
}

.app-page.theme-sanpad-drk .success-box,
.app-page.theme-sanpad-asb .success-box,
.app-page.theme-sanpad-mhd .success-box,
.app-page.theme-sanpad-juh .success-box,
.app-page.theme-sanpad-neutral .success-box,
.app-page.theme-sanpad-drk .profile-success,
.app-page.theme-sanpad-asb .profile-success,
.app-page.theme-sanpad-mhd .profile-success,
.app-page.theme-sanpad-juh .profile-success,
.app-page.theme-sanpad-neutral .profile-success {
    background: color-mix(in srgb, var(--success-accent) 12%, white) !important;
    border-color: color-mix(in srgb, var(--success-accent) 34%, white) !important;
    color: var(--success-accent) !important;
}

@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .sidebar-brand,
    .sidebar-logo-stage,
    .app-page.theme-sanpad-drk .topbar,
    .app-page.theme-sanpad-asb .topbar,
    .app-page.theme-sanpad-mhd .topbar,
    .app-page.theme-sanpad-juh .topbar,
    .app-page.theme-sanpad-neutral .topbar,
    .app-page.theme-sanpad-drk .info-box,
    .app-page.theme-sanpad-asb .info-box,
    .app-page.theme-sanpad-mhd .info-box,
    .app-page.theme-sanpad-juh .info-box,
    .app-page.theme-sanpad-neutral .info-box,
    .app-page.theme-sanpad-drk .module-card,
    .app-page.theme-sanpad-asb .module-card,
    .app-page.theme-sanpad-mhd .module-card,
    .app-page.theme-sanpad-juh .module-card,
    .app-page.theme-sanpad-neutral .module-card {
        backdrop-filter: blur(18px) saturate(145%);
        -webkit-backdrop-filter: blur(18px) saturate(145%);
    }
}

@media (max-width: 760px) {
    .sidebar-brand {
        margin: 0 16px;
        grid-template-columns: minmax(0, 1fr);
        align-items: center;
        justify-items: center;
    }

    .sidebar-logo-stage {
        width: min(100%, 270px);
        min-height: 78px;
        padding: 6px 4px;
    }

    .sidebar-logo-stage-org {
        width: min(100%, 220px);
        min-height: 86px;
        padding: 12px;
    }

    .sidebar-brand-logo,
    .sidebar-logo-stage-org .sidebar-brand-logo {
        max-height: 66px;
    }

    .sidebar-brand-text strong {
        font-size: 0.92rem;
    }

    .app-page.theme-sanpad-drk .app-name,
    .app-page.theme-sanpad-asb .app-name,
    .app-page.theme-sanpad-mhd .app-name,
    .app-page.theme-sanpad-juh .app-name,
    .app-page.theme-sanpad-neutral .app-name {
        justify-self: start;
        max-width: 100%;
    }
}
