/*
 * Copyright © 2026 MMC Network / Onkel_Robby
 * Dieses Projekt ist urheberrechtlich geschützt und gemäß der Datei LICENSE lizenziert.
 */

:root {
    color-scheme: dark;
    --bg: #07111f;
    --surface: #0d1a2b;
    --surface-2: #122238;
    --surface-3: #172a43;
    --border: rgba(148, 163, 184, .18);
    --text: #e8eef7;
    --muted: #94a3b8;
    --primary: #38bdf8;
    --primary-strong: #0284c7;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #fb7185;
    --shadow: 0 20px 55px rgba(0, 0, 0, .28);
    --radius: 16px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 90% 0%, rgba(14, 165, 233, .12), transparent 35%), var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }
code { border: 1px solid var(--border); border-radius: 6px; background: rgba(2, 132, 199, .08); padding: .12rem .4rem; color: #bae6fd; }
.app-shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; display: flex; width: 270px; flex-direction: column; border-right: 1px solid var(--border); background: rgba(7, 17, 31, .96); backdrop-filter: blur(20px); }
.brand, .auth-brand { display: flex; align-items: center; gap: 12px; }
.brand { min-height: 86px; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.brand-mark { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 12px; background: linear-gradient(135deg, var(--primary), #6366f1); color: #03111d; font-weight: 900; letter-spacing: -.04em; box-shadow: 0 8px 25px rgba(56, 189, 248, .22); }
.brand strong, .auth-brand strong { display: block; font-size: .98rem; }
.brand small, .auth-brand small { display: block; margin-top: 2px; color: var(--muted); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-nav { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 22px 16px; }
.sidebar-nav a { border: 1px solid transparent; border-radius: 10px; padding: 11px 14px; color: #b8c5d8; font-size: .92rem; font-weight: 650; transition: .16s ease; }
.sidebar-nav a:hover { border-color: var(--border); background: rgba(255, 255, 255, .035); color: white; }
.sidebar-nav a.active { border-color: rgba(56, 189, 248, .26); background: rgba(56, 189, 248, .11); color: #e0f2fe; }
.nav-section { margin: 18px 14px 4px; color: #5f718a; font-size: .67rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.sidebar-user { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin: 16px; border: 1px solid var(--border); border-radius: 13px; background: rgba(255, 255, 255, .025); padding: 11px; }
.avatar { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; background: rgba(56, 189, 248, .15); color: #7dd3fc; font-weight: 800; }
.sidebar-user strong { display: block; overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { display: block; overflow: hidden; margin-top: 2px; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.icon-button, .menu-button { border: 0; background: transparent; color: var(--muted); }
.icon-button { font-size: 1.35rem; }
.app-content { grid-column: 2; min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; min-height: 86px; align-items: center; gap: 16px; border-bottom: 1px solid var(--border); background: rgba(7, 17, 31, .83); padding: 14px clamp(20px, 4vw, 50px); backdrop-filter: blur(18px); }
.topbar h1 { margin: 2px 0 0; font-size: clamp(1rem, 2vw, 1.28rem); }
.eyebrow { color: var(--primary); font-size: .68rem; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.role-badge { margin-left: auto; border: 1px solid var(--border); border-radius: 999px; background: rgba(255, 255, 255, .03); padding: 7px 11px; color: #cbd5e1; font-size: .72rem; font-weight: 700; }
.menu-button { display: none; font-size: 1.3rem; }
.main-content { width: min(1500px, 100%); margin: 0 auto; padding: 34px clamp(20px, 4vw, 50px) 60px; }
.footer { padding: 20px 50px 28px; color: #64748b; font-size: .75rem; text-align: center; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.page-heading h2 { margin: 5px 0 5px; font-size: clamp(1.55rem, 3vw, 2.15rem); letter-spacing: -.035em; }
.page-heading p, .panel-header p { margin: 0; color: var(--muted); font-size: .88rem; }
.panel { margin-bottom: 22px; overflow: visible; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(180deg, rgba(18, 34, 56, .8), rgba(13, 26, 43, .88)); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--border); padding: 20px 22px; }
.panel-header h3 { margin: 0 0 5px; font-size: 1rem; }
.form-panel { padding: 24px; }
.compact-panel { align-self: start; padding-bottom: 22px; }
.compact-panel .stack-form { padding: 0 22px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { position: relative; overflow: hidden; min-height: 145px; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(145deg, rgba(18, 34, 56, .95), rgba(10, 24, 41, .92)); padding: 20px; box-shadow: var(--shadow); }
.stat-card::after { position: absolute; right: -30px; bottom: -55px; width: 125px; height: 125px; border-radius: 50%; background: rgba(56, 189, 248, .07); content: ""; }
.stat-card span, .stat-card small { display: block; color: var(--muted); font-size: .75rem; }
.stat-card strong { display: block; margin: 15px 0 8px; font-size: 2rem; letter-spacing: -.05em; }
.alert, .callout { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 12px; padding: 13px 16px; font-size: .84rem; }
.alert-success { border-color: rgba(52, 211, 153, .28); background: rgba(52, 211, 153, .08); color: #a7f3d0; }
.alert-error { border-color: rgba(251, 113, 133, .3); background: rgba(251, 113, 133, .08); color: #fecdd3; }
.callout { background: rgba(56, 189, 248, .06); color: #dbeafe; }
.callout-warning { border-color: rgba(251, 191, 36, .28); background: rgba(251, 191, 36, .07); }
.callout span { color: var(--muted); }
.callout a { margin-left: auto; color: var(--primary); font-weight: 750; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--border); padding: 14px 17px; text-align: left; vertical-align: middle; }
th { color: #7f90a9; font-size: .66rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
td { color: #d9e2ef; font-size: .82rem; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .018); }
.table-subline, .error-detail { display: block; max-width: 320px; overflow: hidden; margin-top: 4px; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.error-detail { color: #fda4af; }
.actions-column { width: 1%; white-space: nowrap; }
.table-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.table-actions form { margin: 0; }
.truncate-cell { max-width: 270px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-state { padding: 34px; color: var(--muted); text-align: center; }
.muted { color: var(--muted); }
.status { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; padding: 4px 8px; font-size: .68rem; font-weight: 800; white-space: nowrap; }
.status-success { border-color: rgba(52, 211, 153, .25); background: rgba(52, 211, 153, .09); color: #6ee7b7; }
.status-error { border-color: rgba(251, 113, 133, .27); background: rgba(251, 113, 133, .08); color: #fda4af; }
.status-warning { border-color: rgba(251, 191, 36, .25); background: rgba(251, 191, 36, .08); color: #fde68a; }
.status-muted { color: var(--muted); }
.button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-3); padding: 8px 13px; color: #e2e8f0; font-size: .78rem; font-weight: 760; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); border-color: rgba(148, 163, 184, .38); }
.button-primary { border-color: transparent; background: linear-gradient(135deg, var(--primary), var(--primary-strong)); color: #03111d; }
.button-danger { border-color: rgba(251, 113, 133, .25); background: rgba(251, 113, 133, .08); color: #fda4af; }
.button-ghost { background: transparent; }
.button-small { min-height: 31px; padding: 5px 9px; font-size: .68rem; }
.button-wide { width: 100%; }
.text-link { color: var(--primary); font-size: .78rem; font-weight: 750; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-grid-inline { grid-template-columns: 1.2fr 1.2fr .7fr auto; align-items: end; }
.form-grid-small { gap: 12px; }
.form-span { grid-column: 1 / -1; }
.stack-form { display: grid; gap: 16px; }
.two-column-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 7px; color: #cbd5e1; font-size: .76rem; font-weight: 720; }
label small { color: var(--muted); font-size: .68rem; font-weight: 500; }
input, select { width: 100%; min-height: 43px; border: 1px solid var(--border); border-radius: 9px; outline: none; background: rgba(4, 13, 25, .65); padding: 9px 11px; color: var(--text); transition: border-color .15s ease, box-shadow .15s ease; }
input:focus, select:focus { border-color: rgba(56, 189, 248, .65); box-shadow: 0 0 0 3px rgba(56, 189, 248, .1); }
input[readonly], select:disabled { color: #8291a7; cursor: not-allowed; }
.input-action, .inline-form { display: flex; align-items: center; gap: 8px; }
.input-action input, .inline-form input { flex: 1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--border); padding-top: 20px; }
.align-end { align-self: end; }
.split-layout { display: grid; grid-template-columns: minmax(270px, .7fr) minmax(0, 1.7fr); gap: 22px; }
.user-list { display: grid; }
.user-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 13px; border-bottom: 1px solid var(--border); padding: 16px 20px; }
.user-item:last-child { border-bottom: 0; }
.user-summary strong, .user-summary span, .user-summary small { display: block; }
.user-summary span { margin-top: 2px; color: #b4c0d2; font-size: .78rem; }
.user-summary small { margin-top: 3px; color: var(--muted); font-size: .68rem; }
.row-details { position: relative; }
.row-details summary { list-style: none; }
.row-details summary::-webkit-details-marker { display: none; }
.details-card { position: absolute; top: 42px; right: 0; z-index: 15; display: grid; width: min(520px, 85vw); gap: 14px; border: 1px solid var(--border); border-radius: 13px; background: #0b1829; padding: 18px; box-shadow: var(--shadow); }
.guest-shell { display: grid; place-items: center; padding: 28px; }
.guest-main { width: min(540px, 100%); }
.auth-card { border: 1px solid var(--border); border-radius: 22px; background: linear-gradient(160deg, rgba(18, 34, 56, .96), rgba(8, 20, 35, .96)); padding: clamp(26px, 6vw, 45px); box-shadow: 0 30px 80px rgba(0, 0, 0, .38); }
.auth-card-wide { width: min(720px, calc(100vw - 40px)); margin-left: 50%; transform: translateX(-50%); }
.auth-copy { margin: 32px 0 26px; }
.auth-copy h1 { margin: 6px 0 8px; font-size: 2rem; letter-spacing: -.045em; }
.auth-copy p, .auth-note { color: var(--muted); line-height: 1.55; }
.auth-note { margin: 20px 0 0; font-size: .7rem; text-align: center; }
.guest-alert { width: 100%; }
.sidebar-backdrop { display: none; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 100; border: 1px solid rgba(56, 189, 248, .3); border-radius: 10px; background: #0d2036; padding: 12px 16px; color: #bae6fd; box-shadow: var(--shadow); font-size: .78rem; }
@media (max-width: 1100px) {
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .split-layout { grid-template-columns: 1fr; }
    .form-grid-inline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .app-shell { display: block; }
    .app-content { margin-left: 0; }
    .sidebar { transform: translateX(-102%); transition: transform .2s ease; }
    body.menu-open .sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .55); }
    body.menu-open .sidebar-backdrop { display: block; }
    .menu-button { display: block; }
    .topbar { padding-inline: 18px; }
    .main-content { padding-inline: 16px; }
    .page-heading { align-items: flex-start; flex-direction: column; }
    .form-grid, .two-column-form, .form-grid-inline { grid-template-columns: 1fr; }
    .form-span { grid-column: auto; }
    .table-actions { align-items: stretch; flex-direction: column; }
    .table-actions .button { width: 100%; }
    .user-item { grid-template-columns: auto minmax(0, 1fr) auto; }
    .user-item > .status { display: none; }
}
@media (max-width: 520px) {
    .stat-grid { grid-template-columns: 1fr; }
    .role-badge { display: none; }
    .auth-card { padding: 24px 20px; }
    .inline-form { align-items: stretch; flex-direction: column; }
    .callout { align-items: flex-start; flex-direction: column; }
    .callout a { margin-left: 0; }
}
