:root {
    --header-height: 68px;
    --sidebar-width: 268px;
    --sidebar-collapsed-width: 76px;
    --bg-app: #eaf1f8;
    --bg-shell-top: #f7fbff;
    --bg-shell-bottom: #edf4fb;
    --header-start: #0f6adf;
    --header-end: #0a56ba;
    --text-main: #243243;
    --text-muted: #5f7288;
    --text-on-dark: #f5f9ff;
    --border-soft: rgba(15, 23, 42, 0.08);
    --shadow-soft: 0 12px 28px rgba(15, 23, 42, 0.14);
    --shadow-elevated: 0 20px 48px rgba(15, 23, 42, 0.20);
    --radius-sm: 10px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --accent-blue: #1677ff;
    --accent-blue-hover: #0f62d6;
    --accent-cyan: #73d2ff;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #ef4444;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-main);
    background: var(--bg-app);
    overflow-y: auto;
}

body {
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    color: inherit;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

    h1:focus {
        outline: none;
    }

a, .btn-link {
    color: var(--accent-blue);
}

    a:hover, .btn-link:hover {
        color: var(--accent-blue-hover);
    }

.btn-primary {
    color: #fff;
    background: linear-gradient(180deg, #2187ff, #1068d8);
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(22, 119, 255, 0.22);
}

    .btn-primary:hover {
        background: linear-gradient(180deg, #1d7aeb, #0f62d6);
        border-color: transparent;
    }

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.1rem rgba(255,255,255,0.85), 0 0 0 0.25rem rgba(22,119,255,0.28);
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid var(--danger);
}

.validation-message {
    color: var(--danger);
}

.page {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: var(--bg-app);
}

/* ===============================
   HEADER
================================= */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 10px 18px;
    box-sizing: border-box;
    background: linear-gradient(90deg, var(--header-start), var(--header-end));
    color: var(--text-on-dark);
    border-bottom: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 10px 24px rgba(10, 24, 48, 0.18);
}
.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-right {
    justify-content: flex-end;
}

.header-user-muted {
    color: rgba(255,255,255,0.75);
    font-weight: 600;
}

.header-logo {
    height: 46px;
    width: auto;
    display: block;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

.dev-banner {
    flex: 1;
    text-align: center;
    line-height: 1.05;
    min-width: 0;
}

.dev-banner-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #e8ff73;
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.dev-banner-subtitle {
    margin-top: 2px;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(232,255,115,0.88);
}

.header-user {
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.98rem;
    color: rgba(255,255,255,0.92);
}

/* ===============================
   MAIN AREA
================================= */

.main-area {
    position: absolute;
    top: var(--header-height);
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    transition: left 0.28s ease;
    background: radial-gradient(circle at top left, rgba(115,210,255,0.12), transparent 30%), linear-gradient(180deg, var(--bg-shell-top), var(--bg-shell-bottom));
}

    .main-area.expanded {
        left: var(--sidebar-collapsed-width) !important;
    }

.content {
    min-height: 100%;
    box-sizing: border-box;
    padding: 24px;
    color: var(--text-main);
}

/* ===============================
   COMMON UTILITIES
================================= */

.muted {
    color: var(--text-muted);
    opacity: 1;
}

.highlight {
    animation: pulse 1.2s ease-in-out infinite;
}

.turnstile-widget {
    min-height: 0;
    margin: 0;
}

.turnstile-config-warning {
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
    font-weight: 600;
    margin: 1rem 0;
    padding: 0.75rem 0.85rem;
}

@keyframes pulse {
    0%, 100% {
        background-color: rgba(255,165,0,.10);
    }

    50% {
        background-color: rgba(255,165,0,.18);
    }
}

.bg-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

/* ===============================
   DROPDOWN
================================= */

.dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.custom-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 1000;
    min-width: 200px;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    background: rgba(255,255,255,0.96);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(12px);
}

    .custom-dropdown li {
        padding: 0;
    }

        .custom-dropdown li:hover {
            background-color: rgba(22,119,255,0.06);
        }

    .custom-dropdown a {
        display: block;
        padding: 10px 14px;
        text-decoration: none;
        color: var(--text-main);
    }

/* ===============================
   FOOTER
================================= */

.footer-note {
    margin-top: auto;
    padding: 0.9rem 1.25rem;
    background: rgba(255,255,255,0.78);
    border-top: 1px solid var(--border-soft);
    backdrop-filter: blur(12px);
    display: flex; /* Aktiviert Flexbox */
    flex-direction: row; /* Standard: Elemente in einer Reihe */
    justify-content: space-between; /* Abstand zwischen den Elementen */
    gap: 10px; /* Abstand zwischen den Elementen (optional) */
}

.footer-links {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    flex-direction: row;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
    white-space: nowrap;
}

    .footer-link:hover {
        color: var(--text-main);
        text-decoration: underline;
    }

    .footer-link.active {
        color: var(--text-main);
        font-weight: 700;
    }

.footer-note-version {
    margin-top: 0.85rem;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.58);
    text-align: right;
    color: var(--text-main);
}

/* ===============================
   MODALS / PROFILE / MISC
================================= */

.modal {
    top: var(--header-height);
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    overflow-x: hidden;
}

.profile-box {
    margin-bottom: 20px;
    text-align: center;
}

.profile-image {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: var(--shadow-soft);
    border: 3px solid rgba(255,255,255,0.9);
}

.table-profile-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.audit-pre {
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .9rem;
    background: rgba(0,0,0,.03);
    border: 1px solid rgba(0,0,0,.08);
    border-radius: .75rem;
    padding: .85rem;
    min-height: 120px;
}

.settings-grid {
    display: grid;
    gap: 16px;
}

.settings-actions {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 0;
    background: linear-gradient(180deg, rgba(237,244,251,0), var(--bg-shell-bottom) 32%);
}

.settings-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    margin: 0;
    padding-top: 30px;
    padding-left: 1.5rem;
}

.settings-cleanup-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.settings-cleanup-card {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.58);
}

.settings-cleanup-card h6 {
    margin-bottom: 10px;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
}

.settings-cleanup-fields {
    display: grid;
    grid-template-columns: minmax(74px, 0.8fr) repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
}

.settings-cleanup-fields .settings-field {
    min-width: 0;
}

.settings-cleanup-fields .form-label {
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.settings-cleanup-fields .form-control {
    min-width: 0;
}

.settings-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    margin: 0;
    color: var(--text-main);
    font-weight: 700;
}

.settings-switch .form-check-input {
    flex: 0 0 auto;
    margin: 0;
}

@media (max-width: 700px) {
    .settings-cleanup-fields {
        grid-template-columns: 1fr;
    }
}

.settings-table-title {
    margin-top: 18px;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--text-main);
}

/* ===============================
   BLAZOR SYSTEM UI
================================= */

#blazor-error-ui {
    color-scheme: light only;
    background: #fff6cc;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.7rem 1.25rem 0.8rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url('/images/warning.svg') no-repeat 1rem center, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    background-size: 26px;
}

    .blazor-error-boundary::after {
        content: "An error has occurred.";
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

code {
    color: #c02d76;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ===============================
   MOBILE
================================= */

@media (max-width: 900px) {

    .header {
        height: var(--header-height);
        padding: 0 0.9rem;
        gap: 10px;
    }

    .header-left {
        gap: 8px;
    }

    .header-right {
        min-width: 0;
    }
    .header-logo {
        height: 40px;
    }

    .dev-banner-title {
        font-size: 0.82rem;
    }

    .dev-banner-subtitle {
        font-size: 0.74rem;
    }

    .header-user {
        font-size: 0.88rem;
    }

    .page {
        height: 100vh;
        overflow: hidden;
    }

    .main-area {
        left: 0 !important;
        top: var(--header-height) !important;
        right: 0 !important;
        bottom: 0 !important;
    }

    .content {
        padding: 14px;
    }

    .footer-note {
        flex-direction: column;
    }

    .footer-links {
        justify-content: center;
        flex-direction: column;
    }
}
