/* ==========================================================================
   Soko-Solutions – Design-System
   Glassmorphism · Dark/Light · Animationen
   ========================================================================== */

@font-face {
    font-family: "Inter";
    src: url("../fonts/inter-latin-wght.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* ---------- Design-Tokens ---------- */
:root,
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #07070f;
    --bg-2: #0d0c1d;
    --surface: rgba(255, 255, 255, 0.055);
    --surface-2: rgba(255, 255, 255, 0.085);
    --surface-3: rgba(255, 255, 255, 0.12);
    --surface-solid: #14132a;
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text: #f1f0ff;
    --text-2: #c9c8e6;
    --muted: #9391b5;
    --input-bg: rgba(0, 0, 0, 0.25);
    --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.7);
    --shadow-sm: 0 6px 20px -8px rgba(0, 0, 0, 0.6);
    --orb-1: #6d4cff;
    --orb-2: #2563eb;
    --orb-3: #c026d3;
    --orb-opacity: 0.55;
    --grid-line: rgba(255, 255, 255, 0.035);
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f4f4fb;
    --bg-2: #eceafa;
    --surface: rgba(255, 255, 255, 0.62);
    --surface-2: rgba(255, 255, 255, 0.8);
    --surface-3: rgba(255, 255, 255, 0.95);
    --surface-solid: #ffffff;
    --border: rgba(30, 27, 75, 0.09);
    --border-strong: rgba(30, 27, 75, 0.16);
    --text: #16142e;
    --text-2: #3a3860;
    --muted: #6b6990;
    --input-bg: rgba(255, 255, 255, 0.75);
    --shadow: 0 20px 45px -22px rgba(40, 30, 110, 0.28);
    --shadow-sm: 0 6px 18px -8px rgba(40, 30, 110, 0.22);
    --orb-1: #a78bfa;
    --orb-2: #60a5fa;
    --orb-3: #f0abfc;
    --orb-opacity: 0.5;
    --grid-line: rgba(30, 27, 75, 0.04);
}

:root {
    --accent: #7c5cff;
    --accent-2: #3b82f6;
    --gradient: linear-gradient(135deg, #7c5cff 0%, #5b6cff 50%, #3b82f6 100%);
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --radius: 18px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --blur: blur(18px) saturate(140%);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --topbar-h: 68px;
}

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-font-smoothing: antialiased;
    transition: background-color .4s var(--ease), color .4s var(--ease);
    overflow-x: hidden;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.6rem, 2.5vw, 2.1rem); font-weight: 750; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: color-mix(in srgb, var(--accent) 75%, var(--text)); }
code, .code-hint {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .86em;
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: .12em .45em;
    border-radius: 6px;
}
img { max-width: 100%; display: block; }
small, .small { font-size: .84rem; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.t-right { text-align: right; }
.text-warning { color: var(--warning); }
.danger-text { color: var(--danger) !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }

.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; vertical-align: -0.2em; }

/* ---------- Hintergrund-Orbs ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-orbs span {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: var(--orb-opacity);
    will-change: transform;
}
.bg-orbs span:nth-child(1) { width: 46vw; height: 46vw; left: -12vw; top: -14vw; background: var(--orb-1); animation: orb1 26s ease-in-out infinite alternate; }
.bg-orbs span:nth-child(2) { width: 40vw; height: 40vw; right: -12vw; top: 20vh; background: var(--orb-2); animation: orb2 30s ease-in-out infinite alternate; }
.bg-orbs span:nth-child(3) { width: 34vw; height: 34vw; left: 25vw; bottom: -20vw; background: var(--orb-3); opacity: calc(var(--orb-opacity) * .6); animation: orb3 34s ease-in-out infinite alternate; }
@keyframes orb1 { to { transform: translate(18vw, 14vh) scale(1.15); } }
@keyframes orb2 { to { transform: translate(-16vw, -10vh) scale(.9); } }
@keyframes orb3 { to { transform: translate(10vw, -18vh) scale(1.2); } }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 24px 48px; flex: 1; }
.container-mid { max-width: 980px; }
.container-narrow { max-width: 560px; }
.center-screen { display: flex; align-items: center; justify-content: center; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.grid-3-1 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.grid-2 > .card, .grid-3-1 > .card { margin-bottom: 0; }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    background: color-mix(in srgb, var(--bg) 55%, transparent);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--border);
    animation: slideDown .6s var(--ease) both;
}
@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } }

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-weight: 750; font-size: 1.08rem; letter-spacing: -0.02em; }
.brand:hover { color: var(--text); }
.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--gradient);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    box-shadow: 0 8px 24px -8px rgba(124, 92, 255, .8), inset 0 1px 0 rgba(255,255,255,.3);
    position: relative;
    overflow: hidden;
}
.brand-mark::after {
    content: "";
    position: absolute;
    inset: -50%;
    background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.45) 50%, transparent 60%);
    animation: shine 5s ease-in-out infinite;
}
@keyframes shine { 0%, 70% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }
.brand-mark .icon { width: 20px; height: 20px; }
.brand-mark-xl { width: 84px; height: 84px; border-radius: 26px; font-size: 2.4rem; }

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

.corner-controls { position: fixed; top: 18px; right: 18px; z-index: 40; display: flex; gap: 8px; align-items: center; }

/* ---------- Buttons ---------- */
.btn {
    --btn-bg: var(--surface-2);
    --btn-color: var(--text);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--btn-bg);
    color: var(--btn-color);
    font: inherit;
    font-weight: 600;
    font-size: .93rem;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    isolation: isolate;
    transition: transform .25s var(--spring), box-shadow .25s var(--ease), background .2s, border-color .2s, opacity .2s;
    -webkit-tap-highlight-color: transparent;
}
.btn:hover { transform: translateY(-2px); color: var(--btn-color); border-color: var(--border-strong); }
.btn:active { transform: translateY(0) scale(.97); }
.btn:disabled, .btn.is-loading { opacity: .65; pointer-events: none; }
.btn .icon { width: 17px; height: 17px; }
.btn:hover .icon:last-child:not(:first-child) { transform: translateX(3px); }
.btn .icon { transition: transform .25s var(--spring); }

.btn-primary { --btn-bg: var(--gradient); --btn-color: #fff; border-color: transparent; box-shadow: 0 10px 26px -12px rgba(110, 90, 255, .85), inset 0 1px 0 rgba(255,255,255,.22); }
.btn-primary::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(135deg, #8f74ff, #4f8bff);
    opacity: 0;
    transition: opacity .3s;
}
.btn-primary:hover { box-shadow: 0 16px 34px -12px rgba(110, 90, 255, .95), inset 0 1px 0 rgba(255,255,255,.25); border-color: transparent; }
.btn-primary:hover::before { opacity: 1; }
.btn-ghost { --btn-bg: var(--surface); }
.btn-ghost:hover { --btn-bg: var(--surface-3); }
.btn-success { --btn-bg: linear-gradient(135deg, #22c55e, #10b981); --btn-color: #fff; border-color: transparent; box-shadow: 0 10px 24px -12px rgba(34,197,94,.8); }
.btn-danger { --btn-bg: linear-gradient(135deg, #f43f5e, #ef4444); --btn-color: #fff; border-color: transparent; box-shadow: 0 10px 24px -12px rgba(239,68,68,.8); }
.btn-warning { --btn-bg: linear-gradient(135deg, #f59e0b, #f97316); --btn-color: #fff; border-color: transparent; box-shadow: 0 10px 24px -12px rgba(245,158,11,.8); }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn.is-danger { color: var(--danger); }
.btn.is-danger:hover { border-color: color-mix(in srgb, var(--danger) 50%, transparent); }

.btn .ripple {
    position: absolute;
    border-radius: 50%;
    transform: scale(0);
    background: rgba(255, 255, 255, .35);
    animation: ripple .6s ease-out forwards;
    pointer-events: none;
    z-index: 0;
}
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

.btn.is-loading::after {
    content: "";
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-2);
    cursor: pointer;
    transition: transform .25s var(--spring), background .2s, color .2s, border-color .2s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); transform: translateY(-2px); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(.92); }
.icon-btn .icon { width: 18px; height: 18px; }
.icon-btn.is-danger:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.icon-btn.is-success { color: var(--success); }
.icon-btn-accent { background: var(--gradient); color: #fff; border-color: transparent; }
.icon-btn-accent:hover { background: var(--gradient); color: #fff; }
.icon-btn-xs { width: 26px; height: 26px; border-radius: 8px; }
.icon-btn-xs .icon { width: 14px; height: 14px; }

.link-btn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.link-btn:hover { color: var(--text); }

.theme-toggle .icon { transition: transform .5s var(--spring), opacity .3s; }
.theme-toggle { position: relative; }
.theme-toggle .icon { position: absolute; }
[data-theme="dark"] .theme-icon-light, [data-theme="light"] .theme-icon-dark { transform: rotate(-90deg) scale(0); opacity: 0; }

.seg {
    display: inline-flex;
    padding: 3px;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 11px;
    flex-wrap: wrap;
}
.seg-item {
    padding: 6px 11px;
    border-radius: 8px;
    font-size: .82rem;
    font-weight: 650;
    color: var(--muted);
    transition: background .25s var(--ease), color .2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.seg-item:hover { color: var(--text); }
.seg-item.is-active { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }
.seg-count { font-size: .72rem; background: var(--accent); color: #fff; border-radius: 999px; padding: 0 7px; line-height: 1.6; }

/* ---------- Cards ---------- */
.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    box-shadow: var(--shadow);
}
.card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(160deg, rgba(255,255,255,.14), transparent 40%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}
.card-flush { padding: 0; overflow: hidden; }
.card-title { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; margin-bottom: 16px; flex-wrap: wrap; }
.card-title .icon { color: var(--accent); width: 20px; height: 20px; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-title-row .card-title { margin: 0; }
.card-danger { border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.card-danger .card-title .icon { color: var(--danger); }
.card-warning { border-color: color-mix(in srgb, var(--warning) 45%, transparent); }

/* ---------- Reveal-Animationen ---------- */
.reveal { animation: reveal .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + 60ms); }
.reveal:nth-child(2) { animation-delay: calc(var(--i, 0) * 70ms + 120ms); }
.reveal:nth-child(3) { animation-delay: calc(var(--i, 0) * 70ms + 180ms); }
.reveal:nth-child(4) { animation-delay: calc(var(--i, 0) * 70ms + 240ms); }
@keyframes reveal { from { opacity: 0; transform: translateY(18px); filter: blur(4px); } }
.row-reveal { animation: rowIn .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms + 150ms); }
@keyframes rowIn { from { opacity: 0; transform: translateX(-10px); } }

/* ---------- Badges, Pills, Chips ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 650;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    white-space: nowrap;
    vertical-align: middle;
}
.badge .icon { width: 13px; height: 13px; }
.badge-accent { background: color-mix(in srgb, var(--accent) 20%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); color: color-mix(in srgb, var(--accent) 60%, var(--text)); }
.badge-success { background: color-mix(in srgb, var(--success) 16%, transparent); border-color: color-mix(in srgb, var(--success) 35%, transparent); color: color-mix(in srgb, var(--success) 70%, var(--text)); }
.badge-warning { background: color-mix(in srgb, var(--warning) 16%, transparent); border-color: color-mix(in srgb, var(--warning) 35%, transparent); color: color-mix(in srgb, var(--warning) 70%, var(--text)); }
.badge-danger { background: color-mix(in srgb, var(--danger) 16%, transparent); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: color-mix(in srgb, var(--danger) 70%, var(--text)); }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 650; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); }
.pill .icon { width: 15px; height: 15px; }
.pill-warning { color: var(--warning); border-color: color-mix(in srgb, var(--warning) 45%, transparent); background: color-mix(in srgb, var(--warning) 12%, transparent); animation: glowPulse 2.4s ease-in-out infinite; }
.pill-success { color: var(--success); border-color: color-mix(in srgb, var(--success) 40%, transparent); background: color-mix(in srgb, var(--success) 10%, transparent); }
@keyframes glowPulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--warning) 12%, transparent); } }

.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: pulse 1.8s infinite; display: inline-block; }
@keyframes pulse { 70% { box-shadow: 0 0 0 9px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }

.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--surface-solid); vertical-align: middle; }
.status-dot.is-online { background: var(--success); animation: pulse 1.8s infinite; }
.status-dot.is-idle { background: var(--warning); }

/* ---------- Avatare ---------- */
.avatar {
    --hue: 260;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    border-radius: 50%;
    overflow: hidden;
    color: #fff;
    font-weight: 700;
    background: linear-gradient(135deg, hsl(var(--hue) 80% 62%), hsl(calc(var(--hue) + 45) 80% 52%));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-xs { width: 24px; height: 24px; font-size: .62rem; }
.avatar-sm { width: 34px; height: 34px; font-size: .78rem; }
.avatar-md { width: 44px; height: 44px; font-size: .95rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar-xl { width: 104px; height: 104px; font-size: 2.1rem; }
.avatar-wrap { position: relative; display: inline-flex; }
.avatar-wrap .status-dot { position: absolute; right: -2px; bottom: -2px; }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-weight: 600;
    font-size: .9rem;
    cursor: pointer;
    transition: background .2s, border-color .2s;
}
.user-chip:hover { background: var(--surface-3); border-color: var(--border-strong); }
.user-chip .icon { width: 15px; height: 15px; color: var(--muted); transition: transform .3s var(--ease); }
.dropdown.is-open .user-chip .icon { transform: rotate(180deg); }
.user-chip-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    min-width: 230px;
    padding: 6px;
    background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border-strong);
    border-radius: 14px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(.97);
    transform-origin: top right;
    transition: opacity .2s var(--ease), transform .25s var(--ease), visibility .2s;
    z-index: 60;
}
.dropdown.is-open .dropdown-menu { opacity: 1; visibility: visible; transform: none; }
.dropdown-lang { display: none; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px 6px 12px; color: var(--text-2); font-size: .92rem; }
.dropdown-lang > span { display: inline-flex; align-items: center; gap: 10px; }
.dropdown-lang .icon { width: 17px; height: 17px; }
.topbar-lang { display: contents; }
.dropdown-lang .seg { flex-wrap: nowrap; }
.dropdown-menu .dropdown-lang .seg-item { width: auto; padding: 6px 12px; }
.dropdown-menu a, .dropdown-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 11px;
    border-radius: 9px;
    border: 0;
    background: none;
    color: var(--text-2);
    font: inherit;
    font-size: .9rem;
    font-weight: 550;
    text-align: left;
    cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-3); color: var(--text); }
.dropdown-menu .icon { width: 17px; height: 17px; }
.dropdown-header { padding: 10px 11px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: flex; flex-direction: column; }
.dropdown-header .muted { font-size: .82rem; }

/* ---------- Formulare ---------- */
.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form-inline { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
.form-inline > input, .form-inline > select { flex: 1 1 160px; width: auto; }
.form-grid > .form-actions { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label, .field-label { font-size: .85rem; font-weight: 650; color: var(--text-2); }

input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
select,
textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
    font-size: .94rem;
    outline: none;
    transition: border-color .2s, box-shadow .25s var(--ease), background .2s;
}
textarea { resize: vertical; min-height: 80px; }
select {
    appearance: none;
    padding-right: 38px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239391b5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    cursor: pointer;
}
select option { background: var(--surface-solid); color: var(--text); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus {
    border-color: color-mix(in srgb, var(--accent) 70%, transparent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
input:disabled, input[readonly] { opacity: .6; cursor: not-allowed; }
.input-sm { padding: 7px 11px !important; font-size: .85rem !important; border-radius: 9px !important; }

.has-error input, .has-error textarea, .has-error select { border-color: color-mix(in srgb, var(--danger) 70%, transparent); }
.field-error { color: var(--danger); font-size: .82rem; font-weight: 550; animation: reveal .3s var(--ease); }

.input-icon { position: relative; display: flex; align-items: center; }
.input-icon > .icon { position: absolute; left: 14px; color: var(--muted); width: 18px; height: 18px; pointer-events: none; transition: color .2s; }
.input-icon > .icon ~ input { padding-left: 44px !important; }
.input-icon:focus-within > .icon { color: var(--accent); }
.input-icon input { padding-right: 46px !important; }
.input-action {
    position: absolute;
    right: 6px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--muted);
    cursor: pointer;
}
.input-action:hover { color: var(--text); background: var(--surface-2); }
.input-action .icon { width: 18px; height: 18px; }

.input-prefix { display: flex; align-items: stretch; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--input-bg); overflow: hidden; transition: border-color .2s, box-shadow .25s; }
.input-prefix:focus-within { border-color: color-mix(in srgb, var(--accent) 70%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.input-prefix span { display: flex; align-items: center; padding: 0 10px; color: var(--muted); font-family: ui-monospace, monospace; font-size: .86rem; background: var(--surface); }
.input-prefix input { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; background: transparent !important; font-family: ui-monospace, monospace; }

.otp-input {
    text-align: center;
    font-size: 1.9rem !important;
    font-weight: 700;
    letter-spacing: .45em;
    padding: 14px !important;
    font-variant-numeric: tabular-nums;
}
.otp-input-sm { font-size: 1.15rem !important; letter-spacing: .3em; padding: 9px 12px !important; max-width: 180px; flex: 0 0 180px !important; }

/* Checkbox */
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: .9rem; color: var(--text-2); user-select: none; }
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check-box {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 6px;
    border: 1.5px solid var(--border-strong);
    background: var(--input-bg);
    transition: all .2s var(--ease);
}
.check-box .icon { width: 13px; height: 13px; color: #fff; transform: scale(0); transition: transform .3s var(--spring); stroke-width: 3; }
.check input:checked + .check-box { background: var(--gradient); border-color: transparent; }
.check input:checked + .check-box .icon { transform: scale(1); }
.check input:focus-visible + .check-box { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }

/* Switch */
.switch {
    appearance: none;
    position: relative;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--surface-3);
    border: 1px solid var(--border-strong);
    cursor: pointer;
    transition: background .3s var(--ease);
    margin: 0;
}
.switch::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.3);
    transition: transform .35s var(--spring);
}
.switch:checked { background: var(--gradient); border-color: transparent; }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.switch-list { display: flex; flex-direction: column; gap: 4px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); cursor: pointer; }
.switch-row > span { display: flex; flex-direction: column; gap: 2px; }

/* Chip-Auswahl (Radio) */
.chip-select { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-option input { position: absolute; opacity: 0; pointer-events: none; }
.chip-option span {
    display: inline-block;
    padding: 7px 13px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: .85rem;
    font-weight: 600;
    color: var(--text-2);
    cursor: pointer;
    transition: all .2s var(--ease);
}
.chip-option span:hover { border-color: var(--border-strong); color: var(--text); }
.chip-option input:checked + span { background: var(--gradient); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -8px rgba(124,92,255,.9); }
.chip-option input:focus-visible + span { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.chip-success input:checked + span { background: var(--success); }
.chip-warning input:checked + span { background: var(--warning); }
.chip-danger input:checked + span { background: var(--danger); }
.chip-info input:checked + span { background: var(--info); }

/* Passwortstärke */
.strength { height: 4px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.strength span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .4s var(--ease), background .3s; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Alerts & Toasts ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-size: .9rem;
    margin-bottom: 16px;
}
.alert > .icon { margin-top: 2px; }
.alert > span { flex: 1 1 200px; min-width: 0; }
.alert > form { margin: 0; align-self: center; }
.alert-danger { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.alert-danger > .icon { color: var(--danger); }
.alert-warning { border-color: color-mix(in srgb, var(--warning) 40%, transparent); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.alert-warning > .icon { color: var(--warning); }
.alert-success { border-color: color-mix(in srgb, var(--success) 40%, transparent); background: color-mix(in srgb, var(--success) 12%, transparent); align-items: center; }
.alert-success > .icon { color: var(--success); }
.alert-info { border-color: color-mix(in srgb, var(--info) 40%, transparent); background: color-mix(in srgb, var(--info) 12%, transparent); }
.alert-info > .icon { color: var(--info); }
.shake { animation: shake .5s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.toasts { position: fixed; top: 84px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--surface-solid) 90%, transparent);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--info);
    box-shadow: var(--shadow);
    font-size: .9rem;
    animation: toastIn .5s var(--spring) both;
    position: relative;
    overflow: hidden;
}
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; background: currentColor; opacity: .25; animation: toastTimer 6s linear forwards; }
.toast > .icon { margin-top: 2px; color: var(--info); }
.toast span { flex: 1; }
.toast-success { border-left-color: var(--success); }
.toast-success > .icon { color: var(--success); }
.toast-danger { border-left-color: var(--danger); }
.toast-danger > .icon { color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-warning > .icon { color: var(--warning); }
.toast.is-leaving { animation: toastOut .35s var(--ease) forwards; }
.toast-close { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; display: grid; }
.toast-close:hover { color: var(--text); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px); } }
@keyframes toastTimer { from { width: 100%; } to { width: 0; } }

/* ---------- Login / Auth ---------- */
.auth-page { background-size: 44px 44px; }
.auth-layout { flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; min-height: 100dvh; }
.auth-layout-single { grid-template-columns: 1fr; }
.auth-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    overflow: hidden;
}
.auth-hero-inner { position: relative; max-width: 460px; animation: reveal 1s var(--ease) both; }
.auth-hero h2 { font-size: clamp(2.2rem, 4vw, 3.3rem); font-weight: 800; letter-spacing: -0.04em; margin: 22px 0 10px; background: linear-gradient(120deg, var(--text) 30%, #a38bff 60%, #60a5fa); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% auto; animation: gradientMove 8s ease-in-out infinite alternate; }
@keyframes gradientMove { to { background-position: 100% center; } }
.auth-hero p { font-size: 1.1rem; color: var(--text-2); max-width: 380px; }
.floating-cards { position: relative; height: 150px; margin-top: 36px; }
.fc {
    position: absolute;
    display: grid;
    place-items: center;
    width: 76px;
    height: 76px;
    border-radius: 22px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    box-shadow: var(--shadow);
    color: var(--accent);
}
.fc .icon { width: 32px; height: 32px; }
.fc-1 { left: 0; top: 10px; animation: float 6s ease-in-out infinite; }
.fc-2 { left: 120px; top: 50px; color: #60a5fa; animation: float 7s ease-in-out -2s infinite; }
.fc-3 { left: 240px; top: 0; color: #e879f9; animation: float 8s ease-in-out -4s infinite; }
@keyframes float { 50% { transform: translateY(-16px) rotate(4deg); } }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 72px 24px 40px; }
.auth-card { width: 100%; max-width: 430px; padding: 34px; margin: 0; animation: cardIn .9s var(--spring) both .1s; }
.auth-card-wide { max-width: 560px; }
@keyframes cardIn { from { opacity: 0; transform: translateY(30px) scale(.96); } }
.auth-card-head { text-align: center; margin-bottom: 24px; }
.auth-card-head .brand-mark { width: 54px; height: 54px; border-radius: 17px; margin-bottom: 16px; font-size: 1.5rem; }
.auth-card-head .brand-mark .icon { width: 26px; height: 26px; }
.auth-card-head h1 { font-size: 1.65rem; }
.auth-card-head p { margin: 0; }
.auth-foot { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); font-size: .9rem; flex-wrap: wrap; }
.auth-foot a { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

.success-state { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.success-state .alert { text-align: left; margin: 12px 0; }
.success-check {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #10b981);
    color: #fff;
    margin-bottom: 14px;
    box-shadow: 0 16px 40px -12px rgba(34,197,94,.8);
    animation: pop .7s var(--spring) both;
}
.success-check .icon { width: 42px; height: 42px; stroke-width: 3; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .4s ease forwards; }
@keyframes pop { from { transform: scale(0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

.check-list { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 6px; font-size: .88rem; }
.check-list li { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 9px; background: var(--surface); }
.check-list .ok .icon { color: var(--success); }
.check-list .fail { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.check-list .fail .icon { color: var(--danger); }
.check-list .warn .icon { color: var(--warning); }

/* ---------- Startseite / Kacheln ---------- */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin: 18px 0 30px; flex-wrap: wrap; }
.hero-title { font-size: clamp(1.9rem, 3.4vw, 2.7rem); font-weight: 800; letter-spacing: -0.035em; margin-bottom: 6px; }
.hero p { margin: 0; }
.eyebrow { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; margin: 0 0 8px; background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out 1s 2; }
@keyframes wave { 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50%, 100% { transform: rotate(0); } }

.search-field { position: relative; display: flex; align-items: center; min-width: 240px; }
.search-field > .icon { position: absolute; left: 13px; color: var(--muted); width: 17px; height: 17px; pointer-events: none; }
.search-field input { padding-left: 40px !important; border-radius: 999px !important; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 22px; perspective: 1200px; }
.tile {
    --accent: #7c5cff;
    --rx: 0deg;
    --ry: 0deg;
    --mx: 50%;
    --my: 50%;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 250px;
    padding: 24px;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    box-shadow: var(--shadow);
    overflow: hidden;
    isolation: isolate;
    transform: rotateX(var(--rx)) rotateY(var(--ry));
    transform-style: preserve-3d;
    transition: transform .5s var(--ease), box-shadow .4s var(--ease), border-color .3s;
    animation: tileIn .8s var(--spring) both;
    animation-delay: calc(var(--i, 0) * 90ms + 150ms);
}
@keyframes tileIn { from { opacity: 0; transform: translateY(40px) scale(.94); } }
.tile::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in srgb, var(--accent) 22%, transparent), transparent 45%);
    opacity: 0;
    transition: opacity .4s;
}
.tile::after {
    content: "";
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 2px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: .7;
}
.tile:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 30px 60px -25px color-mix(in srgb, var(--accent) 55%, transparent); }
.tile:hover::before { opacity: 1; }
.tile.is-tilting { transition: transform .1s linear, box-shadow .4s, border-color .3s; }
.tile-glow { position: absolute; width: 180px; height: 180px; right: -60px; top: -60px; border-radius: 50%; background: var(--accent); filter: blur(60px); opacity: .28; z-index: -1; transition: opacity .4s, transform .6s var(--ease); }
.tile:hover .tile-glow { opacity: .45; transform: scale(1.25); }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; transform: translateZ(30px); }
.tile-icon {
    display: grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 17px;
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000));
    color: #fff;
    box-shadow: 0 12px 26px -10px var(--accent), inset 0 1px 0 rgba(255,255,255,.3);
    transition: transform .5s var(--spring);
}
.tile-icon .icon { width: 27px; height: 27px; }
.tile:hover .tile-icon { transform: scale(1.08) rotate(-6deg); }
.tile-count {
    display: inline-grid;
    place-items: center;
    min-width: 26px;
    height: 26px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: .78rem;
    font-weight: 750;
    box-shadow: 0 6px 16px -6px var(--danger);
    animation: pop .5s var(--spring) both, countPulse 2.4s ease-in-out 1s infinite;
}
@keyframes countPulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--danger) 18%, transparent); } }
.tile-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tile-badges .badge-accent { background: color-mix(in srgb, var(--accent) 22%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: color-mix(in srgb, var(--accent) 55%, var(--text)); }
.tile-title { font-size: 1.3rem; font-weight: 750; margin-bottom: 8px; transform: translateZ(20px); }
.tile-desc { color: var(--muted); font-size: .92rem; margin-bottom: 22px; flex: 1; transform: translateZ(10px); }
.tile-footer { transform: translateZ(25px); }
.btn-tile {
    --btn-bg: color-mix(in srgb, var(--accent) 16%, transparent);
    --btn-color: var(--text);
    border-color: color-mix(in srgb, var(--accent) 35%, transparent);
    width: 100%;
    justify-content: space-between;
    padding: 12px 16px;
}
.tile:hover .btn-tile { --btn-bg: var(--accent); --btn-color: #fff; border-color: transparent; box-shadow: 0 12px 26px -12px var(--accent); }
.tile.is-locked { filter: grayscale(.85); opacity: .72; }
.tile.is-locked:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.tile.is-locked .tile-icon { box-shadow: none; }
.tile-locked { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--border-strong); color: var(--text-2); font-size: .9rem; font-weight: 600; }
.tile-locked span { display: flex; flex-direction: column; }
.tile-locked small { font-weight: 450; color: var(--muted); }
.tile-locked .icon { color: var(--warning); animation: lockWiggle 3s ease-in-out infinite; }
@keyframes lockWiggle { 0%, 90%, 100% { transform: rotate(0); } 93% { transform: rotate(-12deg); } 96% { transform: rotate(12deg); } }
.tile.is-hidden { display: none; }
.empty-filter { text-align: center; margin-top: 30px; }

.announcement {
    --tone: var(--info);
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    margin-bottom: 14px;
    border-radius: var(--radius);
    background: linear-gradient(120deg, color-mix(in srgb, var(--tone) 16%, var(--surface)), var(--surface));
    border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    box-shadow: var(--shadow-sm);
    transition: opacity .3s, transform .3s var(--ease), max-height .4s var(--ease), margin .4s, padding .4s;
}
.announcement-success { --tone: var(--success); }
.announcement-warning { --tone: var(--warning); }
.announcement-danger { --tone: var(--danger); }
.announcement-icon { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 12px; background: var(--tone); color: #fff; box-shadow: 0 8px 18px -8px var(--tone); }
.announcement-body { flex: 1; min-width: 0; }
.announcement-body p { margin: 4px 0 0; color: var(--text-2); font-size: .92rem; }
.announcement.is-dismissed { opacity: 0; transform: translateX(30px); }
.announcement-admin.is-muted { opacity: .6; }
.announcement-admin .row-actions { flex-shrink: 0; }

.empty-state { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty-state > .icon { width: 54px; height: 54px; color: var(--accent); opacity: .7; margin-bottom: 14px; animation: float 5s ease-in-out infinite; }
.empty-state h2 { color: var(--text); }
.empty-mini { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); font-size: .9rem; }
.empty-mini .icon { color: var(--success); }

/* ---------- Modulseiten ---------- */
.module-header { display: flex; align-items: center; gap: 16px; margin: 10px 0 26px; }
.module-header h1 { margin: 0; }
.module-header-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000)); color: #fff; box-shadow: 0 12px 26px -10px var(--accent); }
.module-header-icon .icon { width: 26px; height: 26px; }
.module-placeholder { text-align: center; padding: 56px 24px; }
.module-placeholder-icon { display: inline-grid; place-items: center; width: 90px; height: 90px; border-radius: 28px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000)); color: #fff; margin-bottom: 20px; box-shadow: 0 20px 40px -14px var(--accent); animation: float 6s ease-in-out infinite; }
.module-placeholder-icon .icon { width: 44px; height: 44px; }
.module-placeholder p { max-width: 560px; margin-left: auto; margin-right: auto; }

.notice-card { text-align: center; padding: 44px 32px; width: 100%; }
.notice-icon { display: inline-grid; place-items: center; width: 76px; height: 76px; border-radius: 24px; background: var(--gradient); color: #fff; margin-bottom: 18px; box-shadow: 0 16px 36px -14px rgba(124,92,255,.9); animation: pop .6s var(--spring) both; }
.notice-icon .icon { width: 36px; height: 36px; }
.notice-warning .notice-icon { background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 16px 36px -14px rgba(245,158,11,.9); }
.notice-danger .notice-icon { background: linear-gradient(135deg, #f43f5e, #ef4444); box-shadow: 0 16px 36px -14px rgba(239,68,68,.9); }
.notice-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }

/* ---------- Profil ---------- */
.profile-hero { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.profile-hero h1 { margin-bottom: 2px; }
.profile-hero p { margin-bottom: 10px; }
.profile-avatar { position: relative; }
.profile-avatar .avatar { box-shadow: 0 0 0 4px var(--surface-2), 0 18px 40px -16px rgba(124,92,255,.8); }
.avatar-upload { position: absolute; right: -4px; bottom: -4px; }
.avatar-upload .icon-btn { width: 36px; height: 36px; border-radius: 50%; cursor: pointer; }
.profile-meta { flex: 1; min-width: 220px; }
.profile-hero-action { align-self: flex-start; }

.tabs { display: flex; gap: 6px; margin-bottom: 20px; padding: 5px; border-radius: 15px; background: var(--surface); border: 1px solid var(--border); overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 11px; color: var(--muted); font-weight: 650; font-size: .92rem; white-space: nowrap; transition: all .25s var(--ease); }
.tab:hover { color: var(--text); background: var(--surface-2); }
.tab.is-active { background: var(--gradient); color: #fff; box-shadow: 0 8px 20px -10px rgba(124,92,255,.9); }

.twofa-setup { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: start; }
.qr-box { width: 200px; height: 200px; padding: 12px; border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); animation: pop .5s var(--spring) both; }
.qr-box svg { width: 100%; height: 100%; }
.steps { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 10px; color: var(--text-2); }
.secret-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.secret { font-size: .95rem; letter-spacing: .08em; padding: 6px 10px; user-select: all; }

.session-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.session-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.session-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-3); color: var(--accent); }
.app-device-list { margin-top: 18px; }
.app-device-info { flex: 1; min-width: 0; }
.app-device-info strong { overflow-wrap: anywhere; }
@media (max-width: 560px) {
    .app-device-list .session-item { flex-wrap: wrap; }
    .app-device-list .app-device-info { flex-basis: calc(100% - 52px); }
    .app-device-list form { margin-left: 52px; }
}

/* ---------- Admin-Layout ---------- */
.admin-shell { flex: 1; display: grid; align-content: start; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; width: 100%; max-width: 1440px; margin: 0 auto; padding: 24px; }
.admin-sidebar { position: sticky; top: calc(var(--topbar-h) + 24px); align-self: start; }
.admin-sidebar nav { display: flex; flex-direction: column; gap: 3px; padding: 10px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); animation: reveal .6s var(--ease) both; }
.admin-nav-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; color: var(--text-2); font-weight: 600; font-size: .92rem; transition: all .2s var(--ease); }
.admin-nav-link:hover { background: var(--surface-2); color: var(--text); transform: translateX(3px); }
.admin-nav-link .icon { width: 18px; height: 18px; color: var(--muted); transition: color .2s; }
.admin-nav-link.is-active { background: var(--gradient); color: #fff; box-shadow: 0 10px 22px -12px rgba(124,92,255,.95); }
.admin-nav-link.is-active .icon { color: #fff; }
.nav-count { margin-left: auto; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--danger); color: #fff; font-size: .74rem; text-align: center; animation: pop .5s var(--spring); }
.admin-content { min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.filter-bar { justify-content: flex-start; }
.filter-bar select { width: auto; min-width: 170px; }
.inline-form { display: inline-flex; margin: 0; }
.push-right { margin-left: auto; }

/* Statistik-Karten */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    box-shadow: var(--shadow-sm);
    color: var(--text);
    overflow: hidden;
    transition: transform .35s var(--spring), border-color .3s, box-shadow .3s;
}
.stat-card::after { content: ""; position: absolute; width: 120px; height: 120px; right: -40px; bottom: -50px; border-radius: 50%; background: var(--accent); filter: blur(45px); opacity: .25; transition: opacity .3s; }
.stat-card:hover { transform: translateY(-4px); color: var(--text); border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 20px 40px -20px color-mix(in srgb, var(--accent) 60%, transparent); }
.stat-card:hover::after { opacity: .45; }
.stat-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); margin-bottom: 8px; }
.stat-value { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 1rem; color: var(--muted); font-weight: 600; }
.stat-label { color: var(--muted); font-size: .86rem; font-weight: 550; }
.stat-card .pulse-dot { position: absolute; top: 20px; right: 20px; }

/* Balkendiagramm */
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 220px; padding-top: 10px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.bar-stack { flex: 1; width: 100%; max-width: 34px; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 8px; background: var(--surface); overflow: hidden; }
.bar { display: block; width: 100%; height: var(--h); transform-origin: bottom; animation: grow .9s var(--spring) both; animation-delay: calc(var(--i, 0) * 45ms + 250ms); }
.bar-ok { background: var(--gradient); }
.bar-fail { background: color-mix(in srgb, var(--danger) 80%, transparent); }
.bar-col:hover .bar-stack { box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 40%, transparent); }
.bar-label { font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
@keyframes grow { from { transform: scaleY(0); } }

.hbar-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 14px; }
.hbar-head { display: flex; justify-content: space-between; align-items: center; font-size: .88rem; margin-bottom: 6px; }
.hbar-head span { display: flex; align-items: center; gap: 8px; }
.hbar-head .icon { color: var(--accent); width: 16px; height: 16px; }
.hbar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.hbar span { display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #fff)); transform-origin: left; animation: growX 1s var(--spring) both; animation-delay: calc(var(--i, 0) * 80ms + 300ms); }
@keyframes growX { from { transform: scaleX(0); } }

.timeline, .mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.timeline li, .mini-list li { display: flex; gap: 12px; align-items: flex-start; padding: 9px 8px; border-radius: 11px; font-size: .9rem; transition: background .2s; }
.timeline li:hover, .mini-list li:hover { background: var(--surface); }
.timeline-icon { display: grid; place-items: center; width: 32px; height: 32px; flex-shrink: 0; border-radius: 10px; background: var(--surface-2); color: var(--accent); }
.timeline-icon .icon { width: 16px; height: 16px; }
.timeline-icon.is-danger { color: var(--danger); }

/* Tabellen */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; padding: 13px 16px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { transition: background .2s; }
.table tbody tr:hover { background: var(--surface); }
.table tbody tr:last-child td { border-bottom: 0; }
.table-compact td { padding: 9px 16px; }
/* Handy: Tabellen als gestapelte Karten (Spaltennamen setzt app.js als data-th) */
@media (max-width: 640px) {
    .table:not(.no-stack), .table:not(.no-stack) > tbody, .table:not(.no-stack) > tbody > tr, .table:not(.no-stack) > tbody > tr > td { display: block; width: 100%; }
    .table:not(.no-stack) > thead { display: none; }
    .table:not(.no-stack) > tbody > tr { padding: 10px 14px; border-bottom: 1px solid var(--border); }
    .table:not(.no-stack) > tbody > tr:last-child { border-bottom: 0; }
    .table:not(.no-stack) > tbody > tr > td { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-width: 0; padding: 5px 0; border: 0; text-align: right; overflow-wrap: anywhere; }
    .table:not(.no-stack) > tbody > tr > td::before { content: attr(data-th); flex-shrink: 0; max-width: 45%; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; text-align: left; }
    .table:not(.no-stack) > tbody > tr > td:not([data-th])::before, .table:not(.no-stack) > tbody > tr > td[data-th=""]::before { display: none; }
    .table:not(.no-stack) > tbody > tr > td[data-th=""] { justify-content: flex-end; }
    .table:not(.no-stack) > tbody > tr > td:first-child { justify-content: flex-start; text-align: left; font-weight: 650; }
    .table:not(.no-stack) > tbody > tr > td:first-child::before { display: none; }
    .table:not(.no-stack) > tbody > tr > td[colspan] { justify-content: center; text-align: center; }
    .table-wrap:has(> .table:not(.no-stack)) { overflow-x: visible; }
}
.user-cell { display: flex; align-items: center; gap: 11px; color: var(--text); min-width: 0; }
.user-cell:hover { color: var(--text); }
.user-cell > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.user-cell small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }
.row-actions { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.row-actions .icon-btn { width: 34px; height: 34px; }
.row-actions form { margin: 0; display: inline-flex; }
.device { display: inline-flex; align-items: center; gap: 7px; }
.device .icon { color: var(--muted); }
.audit-action { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-weight: 600; white-space: nowrap; }
.audit-action .icon { color: var(--accent); width: 16px; height: 16px; }
.audit-details { color: var(--text-2); max-width: 420px; word-break: break-word; }

.pagination { display: flex; gap: 6px; justify-content: center; margin: 20px 0; flex-wrap: wrap; }
.pagination-link { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-weight: 600; font-size: .88rem; transition: all .2s; }
.pagination-link:hover { background: var(--surface-3); color: var(--text); }
.pagination-link.is-active { background: var(--gradient); color: #fff; border-color: transparent; }
.pagination-gap { padding: 0 4px; color: var(--muted); align-self: center; }

/* User-Detail */
.user-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.user-hero-meta { flex: 1; min-width: 240px; }
.user-hero-meta h2 { font-size: 1.4rem; display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.user-hero-meta p { margin: 0 0 8px; }
.user-hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.action-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }

.perm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.perm-item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); flex-wrap: wrap; transition: border-color .2s; }
.perm-item.is-blocked { border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: color-mix(in srgb, var(--danger) 7%, var(--surface)); }
.perm-icon, .module-row-icon, .matrix-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #000)); color: #fff; flex-shrink: 0; }
.perm-icon .icon, .module-row-icon .icon { width: 19px; height: 19px; }
.perm-meta { flex: 1; min-width: 160px; }
.perm-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.perm-form input { width: 200px !important; }

/* Anfragen */
.request-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 18px; }
.request-card { margin: 0; display: flex; flex-direction: column; gap: 14px; }
.request-card.status-pending { border-left: 3px solid var(--warning); }
.request-card.status-approved { border-left: 3px solid var(--success); }
.request-card.status-denied { border-left: 3px solid var(--danger); }
.request-head { display: flex; align-items: center; gap: 12px; }
.request-head h3 { margin: 0; }
.request-head > div { flex: 1; min-width: 0; }
.request-head a { font-size: .88rem; }
.request-message { margin: 0; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--surface); border-left: 3px solid var(--accent); color: var(--text-2); font-size: .93rem; white-space: pre-line; }
.request-meta { display: flex; flex-wrap: wrap; gap: 14px; }
.request-meta span { display: inline-flex; align-items: center; gap: 5px; }
.request-meta .icon { width: 14px; height: 14px; }
.request-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: auto; }

/* Module (Admin) */
.module-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.module-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin: 0; flex-wrap: wrap; border-left: 3px solid var(--accent); }
.module-row.is-inactive { opacity: .6; }
.module-row .inactive-badge { display: none; }
.module-row.is-inactive .inactive-badge { display: inline-flex; }
.module-row-meta { flex: 1; min-width: 200px; }
.module-row-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.drag-handle { cursor: grab; color: var(--muted); display: grid; padding: 4px; border-radius: 8px; touch-action: none; }
.drag-handle:hover { color: var(--text); background: var(--surface-2); }
.sortable-ghost { opacity: .35; }
.sortable-chosen { box-shadow: 0 20px 40px -12px rgba(124,92,255,.6) !important; transform: scale(1.01); }
.sortable-drag { opacity: .95; }

.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.editor-preview { position: sticky; top: calc(var(--topbar-h) + 24px); }
.editor-preview .tile { animation: none; }

.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; max-height: 220px; overflow-y: auto; padding: 8px; border-radius: var(--radius-sm); background: var(--input-bg); border: 1px solid var(--border); }
.icon-option input { position: absolute; opacity: 0; pointer-events: none; }
.icon-option span { display: grid; place-items: center; height: 44px; border-radius: 10px; color: var(--text-2); cursor: pointer; transition: all .2s var(--ease); border: 1px solid transparent; }
.icon-option span:hover { background: var(--surface-3); color: var(--text); transform: scale(1.08); }
.icon-option input:checked + span { background: var(--gradient); color: #fff; box-shadow: 0 6px 16px -6px rgba(124,92,255,.9); }
.icon-option input:focus-visible + span { border-color: var(--accent); }
.icon-search { max-width: 260px; }

.color-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
input[type="color"] { width: 52px; height: 44px; border: 1px solid var(--border); border-radius: 12px; background: var(--input-bg); padding: 4px; cursor: pointer; }
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 8px; }
.color-presets { display: flex; gap: 6px; flex-wrap: wrap; }
.color-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--surface-solid); background: var(--c); cursor: pointer; box-shadow: 0 0 0 1px var(--border); transition: transform .25s var(--spring); }
.color-dot:hover { transform: scale(1.2); }
.color-dot.is-active { box-shadow: 0 0 0 2px var(--c); }

/* Matrix */
.matrix th, .matrix td { text-align: center; }
.matrix .sticky-col { position: sticky; left: 0; z-index: 2; text-align: left; background: color-mix(in srgb, var(--surface-solid) 94%, transparent); min-width: 220px; }
.matrix-head { min-width: 130px; text-transform: none !important; letter-spacing: 0 !important; }
.matrix-head-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .82rem; color: var(--text); }
.matrix-head .matrix-icon { width: 32px; height: 32px; border-radius: 10px; }
.matrix-head .matrix-icon .icon { width: 16px; height: 16px; }
.matrix-head .dropdown-menu { text-align: left; right: auto; left: 50%; transform: translate(-50%, -8px) scale(.97); transform-origin: top center; }
.matrix-head .dropdown.is-open .dropdown-menu { transform: translate(-50%, 0); }
.perm-toggle {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    border: 1px solid color-mix(in srgb, var(--success) 40%, transparent);
    background: color-mix(in srgb, var(--success) 14%, transparent);
    color: var(--success);
    cursor: pointer;
    transition: all .3s var(--spring);
}
.perm-toggle:hover { transform: scale(1.1); }
.perm-toggle > span { grid-area: 1 / 1; display: grid; transition: transform .35s var(--spring), opacity .2s; }
.perm-toggle .perm-off { transform: scale(0) rotate(-90deg); opacity: 0; }
.perm-toggle.is-blocked { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.perm-toggle.is-blocked .perm-on { transform: scale(0) rotate(90deg); opacity: 0; }
.perm-toggle.is-blocked .perm-off { transform: none; opacity: 1; }
.perm-toggle.is-admin { cursor: default; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.perm-toggle.is-admin:hover { transform: none; }
.perm-toggle.is-busy { opacity: .5; pointer-events: none; }

/* Key/Value-Liste */
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0 0 18px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.details summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .9rem; }
.table-sizes { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; font-size: .85rem; }
.table-sizes li { display: flex; justify-content: space-between; gap: 10px; }

/* ---------- Modals ---------- */
.modal {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    max-width: min(520px, calc(100vw - 32px));
    width: 100%;
    overflow: visible;
}
.modal::backdrop { background: rgba(5, 4, 20, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fadeIn .3s ease both; }
.modal[open] .modal-card { animation: modalIn .45s var(--spring) both; }
.modal.is-closing .modal-card { animation: modalOut .2s var(--ease) forwards; }
.modal.is-closing::backdrop { animation: fadeOut .2s ease forwards; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(24px) scale(.95); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(12px) scale(.97); } }
.modal-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 26px;
    border-radius: 22px;
    background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
    border: 1px solid var(--border-strong);
    box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
}
.modal-head { display: flex; gap: 16px; align-items: flex-start; }
.modal-head h2 { margin-bottom: 4px; }
.modal-head p { margin: 0; }
.modal-icon { display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; border-radius: 15px; color: #fff; background: var(--gradient); }
.modal-icon-danger { background: linear-gradient(135deg, #f43f5e, #ef4444); box-shadow: 0 10px 24px -10px rgba(239,68,68,.9); }
.modal-icon-warning { background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 10px 24px -10px rgba(245,158,11,.9); }
.modal-icon-success { background: linear-gradient(135deg, #22c55e, #10b981); box-shadow: 0 10px 24px -10px rgba(34,197,94,.9); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* ---------- Footer ---------- */
.site-footer { text-align: center; padding: 22px; color: var(--muted); font-size: .82rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .admin-shell { grid-template-columns: minmax(0, 1fr); }
    .admin-sidebar { min-width: 0; }
    .admin-sidebar { position: static; }
    .admin-sidebar nav { flex-direction: row; overflow-x: auto; scrollbar-width: none; }
    .admin-sidebar nav::-webkit-scrollbar { display: none; }
    .admin-nav-link { white-space: nowrap; }
    .admin-nav-link:hover { transform: none; }
    .admin-sidebar nav { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); padding-right: 28px; }
    .grid-3-1 { grid-template-columns: minmax(0, 1fr); }
    .editor-layout { grid-template-columns: minmax(0, 1fr); }
    .editor-preview { position: static; max-width: 360px; }
}
@media (max-width: 900px) {
    .auth-layout { grid-template-columns: 1fr; }
    .auth-hero { display: none; }
    .grid-2 { grid-template-columns: minmax(0, 1fr); }
    .hide-md { display: none; }
    .request-list { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    body { font-size: 14.5px; }
    .container, .admin-shell { padding: 18px 14px 36px; }
    .topbar { padding: 0 14px; }
    .brand-name, .hide-sm { display: none; }
    .user-chip { padding: 3px; }
    .auth-card { padding: 26px 20px; }
    .tile-grid { grid-template-columns: 1fr; }
    .twofa-setup { grid-template-columns: 1fr; justify-items: center; }
    .toasts { left: 16px; right: 16px; top: 76px; max-width: none; }
    .search-field { min-width: 0; width: 100%; }
    .perm-form input { width: 100% !important; }
    .modal-card { padding: 20px; }
    .stat-value { font-size: 1.45rem; }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-icon { width: 34px; height: 34px; margin-bottom: 4px; }
    .corner-controls { top: 12px; right: 12px; }
    .btn { white-space: normal; text-align: center; }
    .alert { flex-wrap: wrap; }
    .alert > form { margin-left: auto; }
    .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .kv dd { margin-bottom: 10px; }
    .user-cell small { white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 480px) {
    .topbar { gap: 8px; padding: 0 10px; }
    .topbar-actions { gap: 6px; min-width: 0; }
    .topbar-lang { display: none; }
    .dropdown-lang { display: flex; }
    .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.table .user-cell > span:last-child { white-space: nowrap; }

/* Ladebalken bei weicher Navigation */
.nav-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200; pointer-events: none; background: var(--gradient); transform: scaleX(0); transform-origin: left; opacity: 0; transition: transform .25s var(--ease), opacity .3s; }
.nav-progress.is-active { opacity: 1; transform: scaleX(.7); transition: transform 2.5s cubic-bezier(.1, .7, .2, 1), opacity .1s; }
