/*
 * BauRapport UI
 * Layouts: Leitstand · Horizont · Fokus
 * Farbwelten: Klarwerk · Baustellen-Puls · Nachtschicht
 */

:root,
html[data-theme="klarwerk"] {
    color-scheme: light;
    --br-bg: #f3f7f8;
    --br-bg-accent: #eaf3f5;
    --br-surface: #ffffff;
    --br-surface-2: #f7fafb;
    --br-surface-hover: #edf7f8;
    --br-text: #17272e;
    --br-heading: #102832;
    --br-muted: #657780;
    --br-border: #d9e5e8;
    --br-border-strong: #c4d6da;
    --br-primary: #008b9c;
    --br-primary-rgb: 0, 139, 156;
    --br-primary-hover: #007586;
    --br-primary-soft: #e2f5f7;
    --br-sidebar: #ffffff;
    --br-sidebar-text: #50636b;
    --br-sidebar-active: #007f91;
    --br-sidebar-border: #dce7e9;
    --br-topbar: rgba(255, 255, 255, 0.94);
    --br-success: #4c942d;
    --br-success-soft: #edf7e8;
    --br-warning: #c27a12;
    --br-warning-soft: #fff3df;
    --br-danger: #c94b49;
    --br-danger-soft: #fff0ef;
    --br-info: #287cc0;
    --br-info-soft: #eaf4fd;
    --br-shadow: 0 12px 34px rgba(17, 53, 64, 0.08);
    --br-shadow-hover: 0 20px 48px rgba(17, 53, 64, 0.14);
    --br-radius: 18px;
    --br-radius-sm: 11px;
    --br-grid-opacity: 0.025;
}

html[data-theme="baustellen-puls"] {
    color-scheme: light;
    --br-bg: #f6f8f2;
    --br-bg-accent: #eff6ed;
    --br-surface: #ffffff;
    --br-surface-2: #fafcf7;
    --br-surface-hover: #f2f8ed;
    --br-text: #18272d;
    --br-heading: #102930;
    --br-muted: #65757b;
    --br-border: #dde7df;
    --br-border-strong: #c9d8cd;
    --br-primary: #008e9e;
    --br-primary-rgb: 0, 142, 158;
    --br-primary-hover: #007585;
    --br-primary-soft: #e2f7f8;
    --br-sidebar: #0b333a;
    --br-sidebar-text: #c9e2e5;
    --br-sidebar-active: #ffffff;
    --br-sidebar-border: #174750;
    --br-topbar: rgba(255, 255, 255, 0.95);
    --br-success: #5a9f27;
    --br-success-soft: #edf8e3;
    --br-warning: #f07b18;
    --br-warning-soft: #fff0df;
    --br-danger: #d54b48;
    --br-danger-soft: #ffeceb;
    --br-info: #2475d3;
    --br-info-soft: #e9f2ff;
    --br-shadow: 0 13px 32px rgba(28, 62, 48, 0.1);
    --br-shadow-hover: 0 22px 52px rgba(28, 62, 48, 0.17);
    --br-radius: 20px;
    --br-radius-sm: 12px;
    --br-grid-opacity: 0.045;
}

html[data-theme="nachtschicht"] {
    color-scheme: dark;
    --br-bg: #07171d;
    --br-bg-accent: #0a2027;
    --br-surface: #10272e;
    --br-surface-2: #132d35;
    --br-surface-hover: #183740;
    --br-text: #e7f1f3;
    --br-heading: #f6fbfc;
    --br-muted: #94aab1;
    --br-border: #27464e;
    --br-border-strong: #365a63;
    --br-primary: #28c6ca;
    --br-primary-rgb: 40, 198, 202;
    --br-primary-hover: #4ad7d9;
    --br-primary-soft: #123b41;
    --br-sidebar: #06141a;
    --br-sidebar-text: #aec6cc;
    --br-sidebar-active: #46d2d4;
    --br-sidebar-border: #18343c;
    --br-topbar: rgba(7, 20, 26, 0.96);
    --br-success: #88ce55;
    --br-success-soft: #203c29;
    --br-warning: #f2b844;
    --br-warning-soft: #3b321d;
    --br-danger: #ff7770;
    --br-danger-soft: #422728;
    --br-info: #71aaf0;
    --br-info-soft: #203650;
    --br-shadow: 0 16px 38px rgba(0, 0, 0, 0.27);
    --br-shadow-hover: 0 24px 58px rgba(0, 0, 0, 0.38);
    --br-radius: 18px;
    --br-radius-sm: 11px;
    --br-grid-opacity: 0.06;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--br-bg);
}

body.app-body {
    min-height: 100vh;
    margin: 0;
    color: var(--br-text);
    background:
        linear-gradient(
            rgba(var(--br-primary-rgb), var(--br-grid-opacity)) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(var(--br-primary-rgb), var(--br-grid-opacity)) 1px,
            transparent 1px
        ),
        radial-gradient(
            circle at 94% 2%,
            rgba(var(--br-primary-rgb), 0.09),
            transparent 34rem
        ),
        var(--br-bg);
    background-size: 42px 42px, 42px 42px, auto, auto;
    font-family:
        Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body,
.form-control,
.form-select,
.btn {
    font-size: 0.95rem;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
    color: var(--br-heading);
    letter-spacing: -0.025em;
}

a {
    color: var(--br-primary);
}

a:hover {
    color: var(--br-primary-hover);
}

.text-muted {
    color: var(--br-muted) !important;
}

.app-shell {
    min-height: 100vh;
}

.app-sidebar {
    position: fixed;
    z-index: 1040;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: 270px;
    overflow: hidden;
    flex-direction: column;
    color: var(--br-sidebar-text);
    background: var(--br-sidebar);
    border-right: 1px solid var(--br-sidebar-border);
    transition: width 180ms ease;
}

.sidebar-brand {
    display: flex;
    min-height: 96px;
    padding: 1rem 1.4rem;
    flex-direction: column;
    justify-content: center;
    color: var(--br-sidebar-text);
    border-bottom: 1px solid var(--br-sidebar-border);
    overflow: hidden;
    text-decoration: none;
}

.sidebar-brand:hover {
    color: var(--br-sidebar-active);
}

.sidebar-logo {
    width: 115px;
    height: 54px;
    object-fit: contain;
    object-position: left center;
    transform: scale(1.7);
    transform-origin: left center;
}

.sidebar-product {
    margin-top: 0.1rem;
    color: var(--br-primary);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.sidebar-navigation {
    position: relative;
    z-index: 2;
    padding: 1.2rem 0.9rem;
    overflow-y: auto;
}

.nav-section-label {
    display: block;
    padding: 0 0.8rem 0.65rem;
    color: var(--br-muted);
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.app-nav-list {
    display: flex;
    padding: 0;
    margin: 0;
    flex-direction: column;
    gap: 0.3rem;
    list-style: none;
}

.app-nav-list > li {
    position: relative;
}

.app-nav-link {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 48px;
    padding: 0.7rem 0.8rem;
    gap: 0.8rem;
    align-items: center;
    color: var(--br-sidebar-text);
    background: transparent;
    border: 0;
    border-radius: 11px;
    outline: 0;
    text-align: left;
    text-decoration: none;
    transition:
        color 140ms ease,
        background-color 140ms ease,
        transform 140ms ease;
}

.app-nav-link:hover,
.app-nav-link:focus,
.app-nav-link.active {
    color: var(--br-sidebar-active);
    background: rgba(var(--br-primary-rgb), 0.13);
}

.app-nav-link.active {
    font-weight: 800;
}

.app-nav-link.active::after {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: -0.9rem;
    width: 4px;
    content: "";
    background: var(--br-primary);
    border-radius: 0 999px 999px 0;
}

.nav-icon {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.nav-label {
    overflow: hidden;
    flex: 1;
    font-size: 0.88rem;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-nav-link.dropdown-toggle::after {
    margin-left: auto;
}

.app-nav-link.nav-create {
    color: var(--br-success);
}

.nav-admin-item {
    padding-top: 0.7rem;
    margin-top: 0.55rem;
    border-top: 1px solid var(--br-sidebar-border);
}

.sidebar-art {
    position: absolute;
    right: -35px;
    bottom: 62px;
    left: 20px;
    z-index: 0;
    color: var(--br-primary);
    opacity: 0.14;
    pointer-events: none;
}

.sidebar-art img {
    display: block;
    width: 100%;
}

.sidebar-footer {
    position: relative;
    z-index: 2;
    display: flex;
    min-height: 58px;
    padding: 0.9rem 1.4rem;
    margin-top: auto;
    gap: 0.6rem;
    align-items: center;
    color: var(--br-muted);
    background: var(--br-sidebar);
    border-top: 1px solid var(--br-sidebar-border);
}

.sidebar-status-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    background: var(--br-success);
    border-radius: 50%;
    box-shadow: 0 0 0 4px var(--br-success-soft);
}

.app-stage {
    min-width: 0;
    min-height: 100vh;
    margin-left: 270px;
    transition: margin-left 180ms ease;
}

.app-topbar {
    position: sticky;
    z-index: 1030;
    top: 0;
    display: flex;
    min-height: 76px;
    padding: 0.75rem clamp(1rem, 2.3vw, 2rem);
    gap: 1.1rem;
    align-items: center;
    color: var(--br-text);
    background: var(--br-topbar);
    border-bottom: 1px solid var(--br-border);
    box-shadow: 0 5px 25px rgba(13, 43, 52, 0.06);
    backdrop-filter: blur(18px);
}

.topbar-leading {
    display: flex;
    min-width: 0;
    gap: 0.85rem;
    align-items: center;
}

.topbar-brand {
    display: none;
    width: 145px;
    height: 50px;
    overflow: hidden;
    color: inherit;
}

.topbar-brand img {
    width: 98px;
    height: 47px;
    object-fit: contain;
    object-position: left center;
    transform: scale(1.65);
    transform-origin: left center;
}

.topbar-context {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.topbar-context-label {
    color: var(--br-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.topbar-context strong {
    color: var(--br-heading);
    font-size: 0.93rem;
}

.topbar-navigation {
    display: none;
    min-width: 0;
    flex: 1;
}

.topbar-tools {
    display: flex;
    margin-left: auto;
    gap: 0.6rem;
    align-items: center;
}

.topbar-tool {
    display: grid;
    width: 40px;
    height: 40px;
    color: var(--br-muted);
    background: var(--br-surface-2);
    border: 1px solid var(--br-border);
    border-radius: 12px;
    place-items: center;
}

.topbar-tool:hover {
    color: var(--br-primary);
    background: var(--br-primary-soft);
    border-color: rgba(var(--br-primary-rgb), 0.35);
}

.theme-orbit {
    position: relative;
    display: block;
    width: 17px;
    height: 17px;
    background: conic-gradient(
        var(--br-primary) 0 33%,
        var(--br-warning) 33% 66%,
        var(--br-info) 66%
    );
    border-radius: 50%;
}

.theme-orbit::after {
    position: absolute;
    inset: 4px;
    content: "";
    background: var(--br-surface-2);
    border-radius: 50%;
}

.mobile-menu-button {
    display: none;
    width: 42px;
    height: 42px;
    padding: 9px;
    background: var(--br-surface-2);
    border: 1px solid var(--br-border);
    border-radius: 11px;
}

.mobile-menu-button span {
    display: block;
    width: 100%;
    height: 2px;
    margin: 4px 0;
    background: var(--br-text);
    border-radius: 999px;
}

.app-user-button {
    display: flex;
    min-width: 165px;
    padding: 0.34rem 0.5rem;
    gap: 0.62rem;
    align-items: center;
    color: var(--br-text);
    border: 1px solid transparent;
    border-radius: 12px;
    text-align: left;
}

.app-user-button:hover,
.app-user-button:focus,
.app-user-button.show {
    color: var(--br-heading);
    background: var(--br-primary-soft);
    border-color: rgba(var(--br-primary-rgb), 0.25);
}

.app-user-avatar {
    display: grid;
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    color: #fff;
    background: var(--br-primary);
    border-radius: 50%;
    place-items: center;
    font-weight: 900;
}

.app-user-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    line-height: 1.12;
}

.app-user-name {
    max-width: 120px;
    overflow: hidden;
    font-size: 0.81rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-user-theme {
    margin-top: 0.2rem;
    color: var(--br-muted);
    font-size: 0.68rem;
}

.app-user-dropdown {
    min-width: 240px;
}

.app-mobile-navigation {
    display: none;
}

.app-main {
    width: 100%;
    max-width: 1560px;
    min-height: calc(100vh - 76px);
    padding: clamp(1.15rem, 2.4vw, 2.3rem);
    margin: 0 auto;
}

.app-messages {
    margin-bottom: 1.2rem;
}

/* Horizont: Navigation im Kopf */
html[data-layout="horizont"] .app-sidebar {
    display: none;
}

html[data-layout="horizont"] .app-stage {
    margin-left: 0;
}

html[data-layout="horizont"] .topbar-brand {
    display: block;
}

html[data-layout="horizont"] .topbar-context {
    display: none;
}

html[data-layout="horizont"] .topbar-navigation {
    display: block;
}

html[data-layout="horizont"] .topbar-navigation .nav-section-label {
    display: none;
}

html[data-layout="horizont"] .topbar-navigation .app-nav-list {
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

html[data-layout="horizont"] .topbar-navigation .app-nav-link {
    min-height: 44px;
    padding: 0.6rem 0.66rem;
    gap: 0.45rem;
    color: var(--br-muted);
    white-space: nowrap;
}

html[data-layout="horizont"] .topbar-navigation .app-nav-link:hover,
html[data-layout="horizont"] .topbar-navigation .app-nav-link.active {
    color: var(--br-primary);
}

html[data-layout="horizont"] .topbar-navigation .app-nav-link.active::after {
    top: auto;
    right: 0.65rem;
    bottom: -0.78rem;
    left: 0.65rem;
    width: auto;
    height: 3px;
    border-radius: 999px 999px 0 0;
}

html[data-layout="horizont"] .topbar-navigation .nav-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
}

html[data-layout="horizont"] .topbar-navigation .nav-label {
    flex: initial;
    font-size: 0.78rem;
}

html[data-layout="horizont"] .topbar-navigation .nav-admin-item {
    padding-top: 0;
    margin-top: 0;
    border-top: 0;
}

/* Fokus: kompakte Icon-Werkzeugleiste */
html[data-layout="fokus"] .app-sidebar {
    width: 92px;
    overflow: visible;
}

html[data-layout="fokus"] .app-stage {
    margin-left: 92px;
}

html[data-layout="fokus"] .sidebar-brand {
    height: 76px;
    min-height: 76px;
    padding: 0.75rem;
    align-items: center;
    justify-content: center;
    border-bottom-color: var(--br-border);
}

html[data-layout="fokus"] .sidebar-logo {
    width: 46px;
    height: 46px;
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
    transform: scale(1.7);
    transform-origin: center;
}

html[data-layout="fokus"] .sidebar-product,
html[data-layout="fokus"] .nav-section-label,
html[data-layout="fokus"] .app-sidebar .nav-label,
html[data-layout="fokus"] .app-sidebar .dropdown-toggle::after {
    display: none;
}

html[data-layout="fokus"] .sidebar-navigation {
    padding: 1rem 0.75rem;
    overflow: visible;
}

html[data-layout="fokus"] .app-sidebar .app-nav-link {
    justify-content: center;
    min-height: 54px;
    padding: 0.8rem;
}

html[data-layout="fokus"] .app-sidebar .nav-icon {
    width: 23px;
    height: 23px;
    flex-basis: 23px;
}

html[data-layout="fokus"] .app-sidebar .app-nav-link:hover::before,
html[data-layout="fokus"] .app-sidebar .app-nav-link:focus-visible::before {
    position: absolute;
    z-index: 1055;
    top: 50%;
    left: calc(100% + 0.55rem);
    padding: 0.45rem 0.65rem;
    content: attr(data-nav-label);
    color: var(--br-text);
    background: var(--br-surface);
    border: 1px solid var(--br-border);
    border-radius: 8px;
    box-shadow: var(--br-shadow);
    font-size: 0.76rem;
    font-weight: 700;
    pointer-events: none;
    transform: translateY(-50%);
    white-space: nowrap;
}

html[data-layout="fokus"] .app-sidebar .dropdown-menu {
    left: 65px !important;
}

html[data-layout="fokus"] .app-sidebar .app-nav-link.active::after {
    left: -0.75rem;
}

html[data-layout="fokus"] .sidebar-art {
    right: -20px;
    bottom: 75px;
    left: 4px;
    opacity: 0.1;
}

html[data-layout="fokus"] .sidebar-footer {
    justify-content: center;
    padding-inline: 0;
}

/* Bootstrap- und Inhaltskomponenten */
.dropdown-menu {
    padding: 0.55rem;
    color: var(--br-text);
    background: var(--br-surface);
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius-sm);
    box-shadow: var(--br-shadow-hover);
}

.dropdown-item {
    padding: 0.58rem 0.7rem;
    color: var(--br-text);
    border-radius: 8px;
}

.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item.active {
    color: var(--br-heading);
    background: var(--br-primary-soft);
}

.dropdown-divider {
    border-color: var(--br-border);
}

.dropdown-header {
    color: var(--br-muted);
}

.card {
    color: var(--br-text);
    background: var(--br-surface);
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius);
    box-shadow: var(--br-shadow) !important;
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease;
}

a:hover > .card,
.card-hover:hover {
    border-color: rgba(var(--br-primary-rgb), 0.42);
    box-shadow: var(--br-shadow-hover) !important;
    transform: translateY(-2px);
}

.card-header,
.card-footer {
    color: var(--br-text);
    background: var(--br-surface-2);
    border-color: var(--br-border);
}

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--br-text);
    --bs-table-border-color: var(--br-border);
    --bs-table-hover-bg: var(--br-surface-hover);
    --bs-table-hover-color: var(--br-text);
    margin-bottom: 0;
    color: var(--br-text);
}

.table thead th {
    padding-block: 0.82rem;
    color: var(--br-muted);
    background: var(--br-surface-2);
    border-bottom-width: 1px;
    font-size: 0.73rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.table tbody td {
    padding-block: 0.9rem;
}

.form-control,
.form-select,
.form-check-input,
.input-group-text {
    color: var(--br-text);
    background-color: var(--br-surface);
    border-color: var(--br-border-strong);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    color: var(--br-text);
    background-color: var(--br-surface);
    border-color: var(--br-primary);
    box-shadow: 0 0 0 0.22rem rgba(var(--br-primary-rgb), 0.15);
}

.form-control::placeholder {
    color: var(--br-muted);
    opacity: 0.75;
}

.form-label {
    color: var(--br-heading);
    font-weight: 750;
}

.btn {
    border-radius: 10px;
    font-weight: 750;
}

.btn-primary {
    --bs-btn-bg: var(--br-primary);
    --bs-btn-border-color: var(--br-primary);
    --bs-btn-hover-bg: var(--br-primary-hover);
    --bs-btn-hover-border-color: var(--br-primary-hover);
    --bs-btn-active-bg: var(--br-primary-hover);
    --bs-btn-active-border-color: var(--br-primary-hover);
}

.btn-outline-primary {
    --bs-btn-color: var(--br-primary);
    --bs-btn-border-color: rgba(var(--br-primary-rgb), 0.58);
    --bs-btn-hover-bg: var(--br-primary);
    --bs-btn-hover-border-color: var(--br-primary);
}

.badge {
    padding: 0.45em 0.72em;
    border-radius: 999px;
    font-weight: 750;
}

.bg-primary,
.badge.bg-primary {
    background-color: var(--br-info) !important;
}

.bg-success,
.badge.bg-success {
    background-color: var(--br-success) !important;
}

.bg-warning,
.badge.bg-warning {
    background-color: var(--br-warning) !important;
}

.alert {
    color: var(--br-text);
    background: var(--br-surface);
    border-color: var(--br-border);
    border-radius: var(--br-radius-sm);
    box-shadow: var(--br-shadow);
}

.alert-success {
    background: var(--br-success-soft);
    border-color: var(--br-success);
}

.alert-warning {
    background: var(--br-warning-soft);
    border-color: var(--br-warning);
}

.alert-danger {
    background: var(--br-danger-soft);
    border-color: var(--br-danger);
}

.alert-info {
    background: var(--br-info-soft);
    border-color: var(--br-info);
}

.pagination {
    --bs-pagination-bg: var(--br-surface);
    --bs-pagination-color: var(--br-primary);
    --bs-pagination-border-color: var(--br-border);
    --bs-pagination-hover-bg: var(--br-primary-soft);
    --bs-pagination-hover-color: var(--br-primary-hover);
    --bs-pagination-focus-bg: var(--br-primary-soft);
    --bs-pagination-active-bg: var(--br-primary);
    --bs-pagination-active-border-color: var(--br-primary);
    --bs-pagination-disabled-bg: var(--br-surface-2);
    --bs-pagination-disabled-border-color: var(--br-border);
}

.modal-content {
    color: var(--br-text);
    background: var(--br-surface);
    border-color: var(--br-border);
    border-radius: var(--br-radius);
}

.modal-header,
.modal-footer {
    border-color: var(--br-border);
}

html[data-theme="nachtschicht"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(180%);
}

/* Dashboard */
.dashboard-hero {
    position: relative;
    display: flex;
    min-height: 155px;
    padding: clamp(1.4rem, 2.4vw, 2.2rem);
    margin-bottom: 1.5rem;
    overflow: hidden;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
    background:
        linear-gradient(
            118deg,
            rgba(var(--br-primary-rgb), 0.13),
            transparent 62%
        ),
        var(--br-surface);
    border: 1px solid var(--br-border);
    border-radius: calc(var(--br-radius) + 4px);
    box-shadow: var(--br-shadow);
}

.dashboard-hero > * {
    position: relative;
    z-index: 2;
}

.dashboard-hero::after {
    position: absolute;
    top: -68px;
    right: 1.4rem;
    width: 330px;
    height: 220px;
    content: "";
    color: var(--br-primary);
    background:
        url("../bilder/bagger-lineart.svg")
        right center / contain no-repeat;
    opacity: 0.11;
    pointer-events: none;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 0.45rem;
    color: var(--br-primary);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.dashboard-actions {
    display: flex;
    max-width: 470px;
    gap: 0.65rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.br-stat-card {
    position: relative;
    overflow: hidden;
}

.br-stat-card::after {
    position: absolute;
    top: -48px;
    right: -45px;
    width: 135px;
    height: 135px;
    content: "";
    background: rgba(var(--br-primary-rgb), 0.075);
    border-radius: 50%;
}

.br-card-content {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.br-icon {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    color: var(--br-primary);
    background: var(--br-primary-soft);
    border: 1px solid rgba(var(--br-primary-rgb), 0.22);
    border-radius: 14px;
    place-items: center;
    font-size: 1.2rem;
    font-weight: 900;
}

.br-icon.warning {
    color: var(--br-warning);
    background: var(--br-warning-soft);
}

.br-icon.success {
    color: var(--br-success);
    background: var(--br-success-soft);
}

.br-icon.info {
    color: var(--br-info);
    background: var(--br-info-soft);
}

.br-stat-label {
    color: var(--br-muted);
    font-size: 0.82rem;
    font-weight: 750;
}

.br-stat-value {
    margin-top: 0.12rem;
    color: var(--br-heading);
    font-size: clamp(1.75rem, 3vw, 2.4rem);
    font-weight: 900;
    line-height: 1;
}

.br-stat-note {
    margin-top: 0.4rem;
    color: var(--br-muted);
    font-size: 0.75rem;
}

.section-title {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.section-title h2,
.section-title h3 {
    margin: 0;
}

html[data-theme="baustellen-puls"] .br-stat-card {
    border-top: 3px solid rgba(var(--br-primary-rgb), 0.72);
}

html[data-theme="baustellen-puls"] .br-stat-card:nth-child(3n + 1) {
    border-top-color: var(--br-warning);
}

html[data-theme="baustellen-puls"] .br-stat-card:nth-child(3n + 2) {
    border-top-color: var(--br-success);
}

/* Designauswahl */
.settings-hero {
    display: flex;
    padding: clamp(1.4rem, 3vw, 2.5rem);
    gap: 2rem;
    align-items: center;
    justify-content: space-between;
    background:
        linear-gradient(
            125deg,
            rgba(var(--br-primary-rgb), 0.14),
            transparent 60%
        ),
        var(--br-surface);
    border: 1px solid var(--br-border);
    border-radius: calc(var(--br-radius) + 5px);
    box-shadow: var(--br-shadow);
}

.settings-combination {
    display: flex;
    min-width: 120px;
    flex-direction: column;
    color: var(--br-primary);
    text-align: center;
}

.settings-combination span {
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1;
}

.settings-combination small {
    margin-top: 0.35rem;
    color: var(--br-muted);
    font-weight: 700;
}

.settings-section-heading {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.settings-step {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    color: #fff;
    background: var(--br-primary);
    border-radius: 13px;
    place-items: center;
    font-weight: 900;
}

.theme-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-option {
    position: relative;
    display: flex;
    overflow: hidden;
    flex-direction: column;
    cursor: pointer;
    background: var(--br-surface);
    border: 2px solid var(--br-border);
    border-radius: calc(var(--br-radius) + 2px);
    box-shadow: var(--br-shadow);
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.theme-option:hover {
    border-color: rgba(var(--br-primary-rgb), 0.58);
    box-shadow: var(--br-shadow-hover);
    transform: translateY(-3px);
}

.theme-radio:focus-visible + .theme-option {
    outline: 3px solid rgba(var(--br-primary-rgb), 0.3);
    outline-offset: 3px;
}

.theme-radio:checked + .theme-option {
    border-color: var(--br-primary);
    box-shadow:
        0 0 0 4px rgba(var(--br-primary-rgb), 0.12),
        var(--br-shadow-hover);
}

.theme-check {
    position: absolute;
    z-index: 3;
    top: 0.75rem;
    right: 0.75rem;
    display: grid;
    width: 30px;
    height: 30px;
    color: transparent;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 50%;
    place-items: center;
    font-weight: 900;
}

.theme-radio:checked + .theme-option .theme-check {
    color: #fff;
    background: var(--br-primary);
    border-color: var(--br-primary);
}

.layout-preview {
    display: flex;
    height: 205px;
    padding: 13px;
    overflow: hidden;
    background: #eef3f4;
    border-bottom: 1px solid var(--br-border);
}

.layout-sidebar {
    display: flex;
    width: 27%;
    padding: 22px 8px;
    flex-direction: column;
    gap: 8px;
    background: #0d353c;
    border-radius: 9px 0 0 9px;
}

.layout-sidebar i {
    width: 76%;
    height: 7px;
    background: #5a777c;
    border-radius: 999px;
}

.layout-sidebar i:first-child {
    background: #25bdc2;
}

.layout-sidebar b {
    width: 80%;
    height: 48px;
    margin-top: auto;
    background:
        url("../bilder/bagger-lineart.svg")
        center / contain no-repeat;
    opacity: 0.45;
}

.layout-workspace {
    display: flex;
    width: 73%;
    padding: 13px;
    flex-direction: column;
    background: #f7f9fa;
    border-radius: 0 9px 9px 0;
}

.layout-topbar {
    width: 45%;
    height: 9px;
    margin-bottom: 18px;
    background: #668087;
    border-radius: 999px;
}

.layout-cards {
    display: flex;
    gap: 7px;
}

.layout-cards i {
    width: 33.333%;
    height: 47px;
    background: #fff;
    border: 1px solid #d6e0e3;
    border-top: 4px solid #1397a4;
    border-radius: 7px;
}

.layout-cards i:nth-child(2) {
    border-top-color: #69a83a;
}

.layout-cards i:nth-child(3) {
    border-top-color: #ef8622;
}

.layout-table {
    height: 63px;
    margin-top: 9px;
    background:
        repeating-linear-gradient(
            #fff 0 13px,
            #e9eef0 13px 14px
        );
    border: 1px solid #d6e0e3;
    border-radius: 7px;
}

.preview-horizont {
    padding: 13px;
    flex-direction: column;
}

.layout-horizontal-top {
    display: flex;
    height: 28px;
    padding: 7px 12px;
    gap: 11px;
    align-items: center;
    background: #fff;
    border: 1px solid #d6e0e3;
    border-radius: 9px 9px 0 0;
}

.layout-horizontal-top i {
    width: 12%;
    height: 5px;
    background: #6e8388;
    border-radius: 999px;
}

.layout-horizontal-top i:first-child {
    width: 18%;
    background: #1596a3;
}

.layout-horizontal-body {
    display: flex;
    min-height: 145px;
}

.layout-mini-rail {
    width: 16%;
    background:
        linear-gradient(#e5ecee 11px, transparent 11px)
        50% 23px / 55% 22px repeat-y,
        #f8fafb;
    border: 1px solid #d6e0e3;
    border-top: 0;
    border-radius: 0 0 0 9px;
}

.preview-horizont .layout-workspace {
    width: 84%;
    border-radius: 0 0 9px 0;
}

.layout-icon-rail {
    display: flex;
    width: 18%;
    padding: 20px 9px;
    flex-direction: column;
    gap: 11px;
    align-items: center;
    background: #0a2229;
    border-radius: 9px 0 0 9px;
}

.layout-icon-rail i {
    width: 22px;
    height: 22px;
    background: #28464e;
    border-radius: 7px;
}

.layout-icon-rail i:first-child {
    background: #20bec4;
}

.preview-fokus .layout-workspace {
    width: 82%;
}

.theme-option-copy {
    display: flex;
    padding: 1.2rem;
    flex: 1;
    flex-direction: column;
}

.theme-option-title {
    color: var(--br-heading);
    font-size: 1.25rem;
    font-weight: 900;
}

.theme-option-tag {
    margin-top: 0.25rem;
    color: var(--br-primary);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.035em;
    text-transform: uppercase;
}

.theme-option-description {
    margin-top: 0.8rem;
    color: var(--br-muted);
    font-size: 0.88rem;
    line-height: 1.55;
}

.color-option {
    min-height: 240px;
}

.color-swatch {
    display: grid;
    height: 88px;
    padding: 1rem 4rem 1rem 1rem;
    gap: 7px;
    grid-template-columns: repeat(4, 1fr);
}

.color-swatch i {
    border: 1px solid rgba(0, 0, 0, 0.09);
    border-radius: 10px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.swatch-klarwerk {
    background: #f2f6f7;
}

.swatch-klarwerk i:nth-child(1) { background: #ffffff; }
.swatch-klarwerk i:nth-child(2) { background: #008b9c; }
.swatch-klarwerk i:nth-child(3) { background: #d9e5e8; }
.swatch-klarwerk i:nth-child(4) { background: #17272e; }

.swatch-puls {
    background: #f5f7f1;
}

.swatch-puls i:nth-child(1) { background: #008e9e; }
.swatch-puls i:nth-child(2) { background: #f07b18; }
.swatch-puls i:nth-child(3) { background: #5a9f27; }
.swatch-puls i:nth-child(4) { background: #2475d3; }

.swatch-nachtschicht {
    background: #07171d;
}

.swatch-nachtschicht i:nth-child(1) { background: #10272e; }
.swatch-nachtschicht i:nth-child(2) { background: #28c6ca; }
.swatch-nachtschicht i:nth-child(3) { background: #f2b844; }
.swatch-nachtschicht i:nth-child(4) { background: #e7f1f3; }

.theme-picker-actions {
    position: sticky;
    z-index: 20;
    bottom: 1rem;
    display: flex;
    padding: 1rem 1.25rem;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
    background: var(--br-topbar);
    border: 1px solid var(--br-border);
    border-radius: var(--br-radius);
    box-shadow: var(--br-shadow-hover);
    backdrop-filter: blur(18px);
}

/* Login */
.login-card {
    position: relative;
    width: 100%;
    max-width: 920px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(6, 72, 91, 0.14);
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(3, 41, 52, 0.16);
}

.login-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 5px;
    content: "";
    background:
        linear-gradient(
            90deg,
            var(--br-primary),
            #62ad3c 55%,
            #ef8a24
        );
}

.login-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
    min-height: 520px;
}

.login-brand-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 3rem;
    text-align: center;
    background:
        radial-gradient(
            circle at 20% 10%,
            rgba(0, 145, 166, 0.1),
            transparent 44%
        ),
        #ffffff;
    border-right: 1px solid rgba(6, 72, 91, 0.1);
}

.login-logo {
    width: min(100%, 390px);
    height: auto;
    object-fit: contain;
}

.login-brand-panel p {
    margin: 0;
    color: #62737a;
    font-size: 0.94rem;
    letter-spacing: 0.02em;
}

.login-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3.5rem;
}

.login-heading {
    margin-bottom: 2rem;
}

.login-product-name {
    display: inline-block;
    margin-bottom: 0.75rem;
    color: #00768a;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.login-heading h1 {
    margin: 0;
    color: #092f3e;
    font-size: clamp(1.85rem, 3vw, 2.35rem);
    font-weight: 750;
    line-height: 1.12;
}

.login-heading p {
    margin: 1rem 0 0;
    color: #6a7a80;
}

.login-card .form-control {
    min-height: 50px;
    color: #163b48;
    background: #ffffff;
    border-color: rgba(6, 72, 91, 0.2);
}

.login-card .form-control::placeholder {
    color: #829197;
}

.login-card .btn-primary {
    min-height: 50px;
    font-weight: 700;
}

@media (max-width: 767.98px) {
    .login-card {
        max-width: 470px;
        border-radius: 20px;
    }

    .login-layout {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .login-brand-panel {
        gap: 0.8rem;
        padding: 2.25rem 1.75rem 1.75rem;
        border-right: 0;
        border-bottom: 1px solid rgba(6, 72, 91, 0.1);
    }

    .login-logo {
        width: min(100%, 290px);
    }

    .login-brand-panel p {
        font-size: 0.82rem;
    }

    .login-form-panel {
        padding: 2rem 1.5rem 2.25rem;
    }

    .login-heading {
        margin-bottom: 1.5rem;
        text-align: center;
    }

    .login-heading h1 {
        font-size: 1.75rem;
    }
}

@media (max-width: 1450px) {
    html[data-layout="horizont"] .topbar-navigation .nav-icon {
        display: none;
    }

    html[data-layout="horizont"] .topbar-navigation .app-nav-link {
        padding-inline: 0.48rem;
    }

    html[data-layout="horizont"] .app-user-copy {
        display: none;
    }

    html[data-layout="horizont"] .app-user-button {
        min-width: auto;
    }
}

@media (max-width: 1199.98px) {
    .app-sidebar {
        display: none !important;
    }

    .app-stage,
    html[data-layout="fokus"] .app-stage {
        margin-left: 0;
    }

    .app-topbar {
        min-height: 72px;
        padding: 0.65rem 1rem;
    }

    .mobile-menu-button,
    .topbar-brand {
        display: block !important;
    }

    .topbar-brand {
        width: 125px;
    }

    .topbar-brand img {
        width: 112px;
        height: 44px;
    }

    .topbar-context,
    .topbar-navigation {
        display: none !important;
    }

    .app-mobile-navigation {
        position: sticky;
        z-index: 1025;
        top: 72px;
        max-height: calc(100vh - 72px);
        padding: 0.85rem;
        overflow-y: auto;
        color: var(--br-text);
        background: var(--br-surface);
        border-bottom: 1px solid var(--br-border);
        box-shadow: var(--br-shadow);
    }

    .app-mobile-navigation.show,
    .app-mobile-navigation.collapsing {
        display: block;
    }

    .app-mobile-navigation .nav-section-label {
        padding-top: 0.35rem;
    }

    .app-mobile-navigation .app-nav-link {
        color: var(--br-text);
    }

    .app-mobile-navigation .app-nav-link:hover,
    .app-mobile-navigation .app-nav-link.active {
        color: var(--br-primary);
    }

    .app-mobile-navigation .app-nav-link.active::after {
        left: -0.85rem;
    }

    .dashboard-hero::after {
        right: -5rem;
    }
}

@media (max-width: 767.98px) {
    .topbar-tool,
    .app-user-copy {
        display: none;
    }

    .app-user-button {
        min-width: auto;
    }

    .app-main {
        padding: 1rem;
    }

    .dashboard-hero,
    .settings-hero,
    .theme-picker-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-hero {
        padding: 1.25rem;
    }

    .dashboard-hero::after {
        right: -7rem;
        opacity: 0.06;
    }

    .dashboard-actions {
        justify-content: flex-start;
    }

    .dashboard-actions .btn {
        flex: 1 1 auto;
    }

    .settings-combination {
        min-width: auto;
        align-items: baseline;
        flex-direction: row;
        gap: 0.6rem;
        text-align: left;
    }

    .layout-preview {
        height: 180px;
    }

    .theme-picker-actions {
        bottom: 0.5rem;
    }

    .theme-picker-actions .btn {
        width: 100%;
    }
}

@media (max-width: 430px) {
    .topbar-brand {
        width: 105px;
    }

    .topbar-brand img {
        width: 98px;
    }

    .app-topbar {
        gap: 0.55rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
