:root {
    --bg: #0b1220;
    --bg-soft: #111a2b;
    --panel: rgba(15, 23, 42, 0.82);
    --panel-strong: #0f172a;
    --line: rgba(148, 163, 184, 0.16);
    --line-strong: rgba(148, 163, 184, 0.24);
    --text: #e5edf8;
    --muted: #9aa9c0;
    --accent: #3b82f6;
    --accent-strong: #2563eb;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 18px 40px rgba(2, 8, 23, 0.35);
    --radius: 18px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: Inter, Arial, Helvetica, sans-serif;
    line-height: 1.5;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.16), transparent 28%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.1), transparent 24%),
        linear-gradient(180deg, #09111d 0%, #0b1220 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 16%);
}

a {
    color: #93c5fd;
    text-decoration: none;
}

a:hover {
    color: #bfdbfe;
}

img {
    max-width: 100%;
    display: block;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.container.narrow {
    width: min(760px, calc(100% - 32px));
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    backdrop-filter: blur(18px);
    background: rgba(9, 17, 29, 0.88);
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    box-shadow: 0 10px 30px rgba(2, 8, 23, 0.22);
}

.header-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 22px;
    min-height: 78px;
    padding: 12px 20px;
}

.header-full {
    width: 100%;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: var(--shadow);
    flex: 0 0 auto;
    overflow: hidden;
}

.logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.title {
    font-size: 1rem;
    font-weight: 800;
    color: #f8fbff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subtitle {
    color: var(--muted);
    font-size: 0.84rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
}

.nav a {
    color: #d5e2f5;
    padding: 9px 12px;
    border-radius: 999px;
    transition: 0.2s ease;
    border: 1px solid transparent;
    white-space: nowrap;
    flex: 0 1 auto;
    font-size: 0.95rem;
}

.nav a:hover,
.nav a.active {
    text-decoration: none;
    background: rgba(59, 130, 246, 0.14);
    border-color: rgba(96, 165, 250, 0.2);
    color: #ffffff;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 0 0 auto;
}

.user-chip {
    display: flex;
    flex-direction: column;
    padding: 8px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.user-chip-label,
.muted,
label,
small,
th {
    color: var(--muted);
}

.user-chip strong {
    font-size: 0.95rem;
}

main.container,
main.container.narrow {
    padding: 32px 0 56px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 380px);
    gap: 24px;
    margin-bottom: 24px;
}

.hero-copy,
.hero-meta,
.card,
table,
.login-box {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-copy {
    padding: 32px;
}

.hero-copy h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 10px;
}

.hero-copy p {
    max-width: 64ch;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.22);
    color: #bfdbfe;
    font-size: 0.86rem;
    font-weight: 700;
}

.hero-meta,
.inset-card {
    padding: 24px;
}

.mini-stat + .mini-stat {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.mini-stat span,
.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 6px;
}

.mini-stat strong,
.stat-card strong {
    font-size: 1.4rem;
}

.grid {
    display: grid;
    gap: 20px;
    margin-bottom: 24px;
}

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

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

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

.card {
    padding: 24px;
}

.section-head,
.profile-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

h1, h2, h3 {
    color: #f8fbff;
    line-height: 1.15;
    margin-bottom: 10px;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }

p {
    color: #d7e1f0;
    margin-bottom: 12px;
}

.list-item {
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.list-item:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.list-item strong {
    display: block;
    margin-bottom: 8px;
    font-size: 1rem;
}

.panel-link {
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.panel-link:hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.25);
    background: rgba(17, 26, 43, 0.96);
    text-decoration: none;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

th, td {
    padding: 14px 16px;
    text-align: left;
}

th {
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(255,255,255,0.04);
}

td {
    color: #e8eff9;
    border-top: 1px solid var(--line);
}

tr:hover td {
    background: rgba(59, 130, 246, 0.05);
}

form {
    width: 100%;
}

label {
    display: block;
    margin: 0 0 8px;
    font-size: 0.95rem;
}

input,
textarea,
select {
    width: 100%;
    padding: 13px 14px;
    margin-bottom: 16px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(7, 13, 23, 0.9);
    color: var(--text);
    outline: none;
    transition: 0.2s ease;
}

input:focus,
textarea:focus,
select:focus {
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

input[type="color"] {
    min-height: 52px;
    padding: 6px;
}

button,
.btn,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(96, 165, 250, 0.24);
    background: linear-gradient(180deg, var(--accent), var(--accent-strong));
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

button:hover,
.btn:hover,
.button-link:hover {
    text-decoration: none;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
    filter: brightness(1.03);
}

.button-link.small {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 0.9rem;
}

.text-link {
    font-weight: 700;
}

.logout {
    white-space: nowrap;
}

.alert,
.login-error,
.error,
.success {
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid transparent;
    margin-bottom: 18px;
}

.alert.success,
.success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.28);
    color: #d1fae5;
}

.alert.danger,
.error,
.login-error {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.28);
    color: #fecaca;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.12);
    color: #e6eef9;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.badge.success { background: rgba(34, 197, 94, 0.14); color: #dcfce7; }
.badge.warning { background: rgba(245, 158, 11, 0.16); color: #fef3c7; }
.badge.danger { background: rgba(239, 68, 68, 0.16); color: #fee2e2; }

.preview-stack {
    display: grid;
    gap: 18px;
}

.preview-card h3 {
    margin-bottom: 14px;
}

.preview-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--line);
}

.preview-header img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 14px;
    padding: 6px;
    background: rgba(255,255,255,0.06);
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-box {
    width: min(100%, 460px);
    padding: 34px;
}

.login-logo {
    width: 92px;
    height: 92px;
    margin: 0 auto 18px;
    object-fit: contain;
}

.login-preview {
    min-height: 220px;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.24), rgba(15, 23, 42, 0.95));
    background-size: cover;
    background-position: center;
    border: 1px solid var(--line);
}

.login-preview-overlay {
    display: flex;
    flex-direction: column;
    justify-content: end;
    gap: 6px;
    min-height: 220px;
    padding: 22px;
    background: linear-gradient(180deg, rgba(3, 7, 18, 0.12), rgba(3, 7, 18, 0.76));
}

hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 20px 0;
}

.compact p:last-child,
.card p:last-child,
.list-item p:last-child {
    margin-bottom: 0;
}

@media (max-width: 1080px) {
    .section-head,
    .profile-top,
    .hero {
        grid-template-columns: 1fr;
    }

    .header-inner {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 12px 16px;
    }

    .header-actions {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: space-between;
        padding-top: 4px;
    }

    .nav {
        justify-content: flex-end;
        flex-wrap: wrap;
        overflow: visible;
    }

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

@media (max-width: 760px) {
    .container {
        width: min(100% - 20px, 1180px);
    }

    .hero,
    .two-col,
    .three-col,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .card,
    .hero-copy,
    .hero-meta,
    .login-box {
        padding: 20px;
    }

    .header-inner {
        grid-template-columns: 1fr;
    }

    .brand,
    .nav,
    .header-actions {
        width: 100%;
    }

    .brand {
        justify-content: flex-start;
    }

    .brand-text {
        max-width: calc(100vw - 120px);
    }

    .nav {
        justify-content: flex-start;
    }

    .nav a {
        padding: 8px 11px;
        font-size: 0.92rem;
    }

    .header-actions {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .user-chip {
        flex: 1 1 auto;
        min-width: 0;
    }
}

.page-intro {
    margin-bottom: 24px;
    padding: 28px 30px;
}

.dashboard-extras {
    margin-bottom: 24px;
}

.monitor-grid,
.quick-links,
.org-card-grid {
    display: grid;
    gap: 14px;
}

.monitor-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-top: 18px;
}

.monitor-item,
.quick-link,
.org-card {
    padding: 16px 18px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--line);
}

.monitor-item span,
.quick-link span,
.org-card span,
.org-card small {
    display: block;
}

.monitor-item strong,
.quick-link strong,
.org-card strong {
    margin-top: 4px;
}

.quick-link {
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.quick-link:hover {
    text-decoration: none;
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.28);
    background: rgba(59, 130, 246, 0.08);
}

.org-section {
    margin-bottom: 24px;
}

.org-root {
    position: relative;
    padding: 28px;
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.12), rgba(15, 23, 42, 0.72));
    border: 1px solid rgba(96, 165, 250, 0.16);
    box-shadow: var(--shadow);
}

.org-root h2 {
    margin-bottom: 18px;
}

.org-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.org-group {
    padding: 22px;
}

.org-card-grid-root {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.org-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.org-card {
    min-height: 112px;
}

.org-card.compact {
    min-height: 98px;
}

body[data-screen="mobilgerat"] .hero,
body[data-screen="tablet-kleines-display"] .hero {
    grid-template-columns: 1fr;
}

@media (max-width: 1100px) {
    .header-inner {
        grid-template-columns: minmax(0, 1fr);
        justify-items: stretch;
        padding: 12px 16px 14px;
    }

    .brand,
    .nav,
    .header-actions {
        justify-content: center;
        justify-self: center;
    }

    .header-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 700px) {
    .nav {
        flex-wrap: wrap;
    }

    .nav a {
        text-align: center;
        flex: 1 1 calc(50% - 6px);
    }

    .brand {
        justify-content: center;
    }

    .brand-text {
        align-items: center;
        text-align: center;
    }

    .monitor-grid,
    .org-grid,
    .org-card-grid,
    .org-card-grid-root {
        grid-template-columns: 1fr;
    }
}



.organigram-layout {
    width: min(1720px, calc(100% - 20px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.organigram-layout-image {
    width: min(1750px, calc(100% - 12px));
}

.org-image-stage {
    padding: 8px 0 18px;
}

.org-image-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    margin: 0 auto 12px;
    width: min(1660px, 100%);
}

.org-image-head h1 {
    font-size: clamp(1.7rem, 2.4vw, 2.4rem);
    line-height: 1.1;
}

.org-image-head p {
    color: var(--muted);
}

.org-image-figure {
    margin: 0;
    width: 100%;
}

.org-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 28px;
    box-shadow: 0 18px 42px rgba(2, 8, 23, 0.3);
}

@media (max-width: 1300px) {
    .organigram-layout,
    .organigram-layout-image {
        width: min(100%, calc(100% - 12px));
    }

    .org-image-head {
        width: 100%;
        padding: 0 6px;
    }
}

@media (max-width: 900px) {
    .org-image-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .org-image {
        border-radius: 18px;
    }
}
@media (max-width: 1300px) {
    .organigram-layout {
        width: min(100%, calc(100% - 18px));
    }

    .org-board {
        padding: 28px 24px 40px;
        overflow-x: auto;
    }

    .org-board-wrap {
        overflow-x: auto;
    }

    .org-board {
        min-width: 1180px;
    }
}

@media (max-width: 900px) {
    .org-badge {
        width: 84px;
        height: 84px;
    }
}


.inline-form {
    display: inline-block;
    margin-left: 0.5rem;
}

.profile-top-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}
