:root {
    --bg-shell: radial-gradient(circle at top, #111827 0, #020617 45%, #000 100%);
    --bg-body: #020617;
    --bg-card: #020617;
    --bg-card-soft: #020617;
    --border-subtle: #1f2937;
    --accent: #3b82f6;
    --accent-soft: #1d4ed8;
    --accent-muted: #60a5fa;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
    --danger: #f97373;
    --success: #22c55e;
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 8px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-shell);
    color: var(--text-main);
}

/* App-Shell mit Header + Sidebar */

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 40;
    backdrop-filter: blur(18px);
    background: linear-gradient(to right, rgba(15,23,42,0.96), rgba(2,6,23,0.96));
    border-bottom: 1px solid rgba(31,41,55,0.9);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    background: radial-gradient(circle at 30% 30%, #4b5563, #020617);
}

.header-title {
    display: flex;
    flex-direction: column;
}

.header-title-main {
    font-size: 15px;
    font-weight: 600;
}

.header-title-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.header-user {
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(55,65,81,0.9);
    background: rgba(15,23,42,0.8);
}

.header-logout a {
    color: #fca5a5;
    text-decoration: none;
    font-size: 13px;
}

.header-logout a:hover {
    text-decoration: underline;
}

/* Layout mit Sidebar */

.app-body {
    flex: 1;
    display: flex;
    min-height: 0;
}

.app-sidebar {
    width: 220px;
    background: #020617;
    border-right: 1px solid #1f2937;
    padding: 16px 12px;
}

.sidebar-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 8px;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}

.sidebar-nav li {
    margin-bottom: 4px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 13px;
    color: #e5e7eb;
    text-decoration: none;
    border: 1px solid transparent;
}

.sidebar-link span.icon {
    font-size: 14px;
}

.sidebar-link:hover {
    background: #111827;
    border-color: #1f2937;
}

.sidebar-link.active {
    background: #1d4ed8;
    border-color: #3b82f6;
    color: #f9fafb;
}

/* Hauptbereich */

.app-main-wrapper {
    flex: 1;
    padding: 24px 16px 32px;
    min-width: 0;
}

.app-main {
    max-width: 1100px;
    margin: 0 auto;
}

/* Cards */

.card {
    background: radial-gradient(circle at top left, #111827 0, #020617 60%);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    margin-bottom: 22px;
    border: 1px solid rgba(31,41,55,0.9);
    box-shadow: 0 18px 40px rgba(15,23,42,0.8);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* Formulare */

label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 10px 11px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: #020617;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    margin-bottom: 10px;
    resize: vertical;
}

input::placeholder,
textarea::placeholder {
    color: #6b7280;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(59,130,246,0.45);
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 14px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.08s ease;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent-soft);
    color: #f9fafb;
}

.btn-primary:hover {
    background: var(--accent-soft);
    transform: translateY(-1px);
}

.btn-secondary {
    background: transparent;
    border-color: var(--border-subtle);
    color: var(--text-muted);
}

.btn-secondary:hover {
    background: #020617;
    border-color: #4b5563;
}

.btn-sm {
    padding: 6px 10px;
    font-size: 12px;
}

/* Status Messages */

.status-success {
    background: rgba(34,197,94,0.12);
    border: 1px solid rgba(34,197,94,0.6);
    color: #bbf7d0;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    font-size: 13px;
}

.status-error {
    background: rgba(248,113,113,0.1);
    border: 1px solid #f97373;
    color: #fecaca;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
    font-size: 13px;
}

/* Tabellen */

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table thead {
    background: #020617;
}

.table th,
.table td {
    padding: 8px 8px;
    border-bottom: 1px solid #1f2937;
}

.table th {
    text-align: left;
    font-weight: 500;
    color: var(--text-muted);
    font-size: 12px;
}

.table tr:nth-child(even) td {
    background: #020617;
}

/* Login Layout */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-shell);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: radial-gradient(circle at top left, #111827 0, #020617 70%);
    border-radius: 18px;
    border: 1px solid rgba(31,41,55,0.9);
    padding: 24px 24px 20px;
    box-shadow: 0 22px 60px rgba(15,23,42,0.95);
}

.auth-logo {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 20%, #4b5563, #020617);
    font-weight: 700;
    font-size: 18px;
    margin-bottom: 10px;
}

.auth-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 18px;
}

.auth-footer {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--accent-muted);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Dashboard Grids */

.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr);
    gap: 18px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.metric-card {
    background: #020617;
    border-radius: 14px;
    border: 1px solid #1f2937;
    padding: 14px 16px;
}

.metric-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.metric-value {
    font-size: 18px;
    font-weight: 600;
}

/* Links */

a {
    color: var(--accent-muted);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

@media (max-width: 880px) {
    .app-body {
        flex-direction: column;
    }
    .app-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #1f2937;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
    .sidebar-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        margin-right: 12px;
    }
    .app-main-wrapper {
        padding-top: 16px;
    }
    .grid-2 {
        grid-template-columns: minmax(0, 1fr);
    }
}
