:root {
    --bg: #0f172a;            /* Hintergrund App */
    --bg-elevated: #020617;   /* Sidebar, Topbar */
    --bg-card: #0b1220;
    --bg-card-soft: #020617;
    --border-subtle: rgba(148, 163, 184, 0.2);
    --primary: #3b82f6;
    --primary-soft: rgba(59, 130, 246, 0.1);
    --primary-dark: #2563eb;
    --accent: #22c55e;
    --danger: #ef4444;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    --radius-card: 16px;
    --radius-pill: 999px;
    --shadow-soft: 0 20px 40px rgba(15, 23, 42, 0.45);
}

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

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    font-family: var(--font-main);
    background: radial-gradient(circle at top, #1e293b 0, #020617 45%, #000 100%);
    color: var(--text);
}

/* App Shell */

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */

.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #020617 0%, #020617 40%, #111827 100%);
    border-right: 1px solid rgba(148, 163, 184, 0.2);
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px 16px 8px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.3);
}

.sidebar-logo {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: radial-gradient(circle at 20% 0, #22c55e, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    letter-spacing: 0.06em;
    font-size: 14px;
    color: #0f172a;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.8);
}

.sidebar-title span {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: #e5e7eb;
}

.sidebar-title small {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 2px;
}

.sidebar-nav {
    margin-top: 8px;
    flex: 1;
}

.sidebar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li {
    margin-bottom: 6px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 10px;
    text-decoration: none;
    color: #d1d5db;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease, transform 0.08s ease;
}

.nav-link:hover {
    background: rgba(55, 65, 81, 0.9);
    color: #f9fafb;
    transform: translateX(2px);
}

/* Sidebar Footer */

.sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-mini {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: linear-gradient(135deg, #22c55e, #3b82f6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #0f172a;
}

.user-mini-info span {
    display: block;
    font-size: 14px;
    color: #e5e7eb;
}

.user-mini-info small {
    display: block;
    font-size: 11px;
    color: #9ca3af;
}

/* Main Area */

.main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: calc(100% - 260px);
}

/* Topbar */

.topbar {
    height: 60px;
    padding: 0 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: radial-gradient(circle at top left, #1e293b 0, #020617 50%, #000 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.7);
}

.topbar-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Main Content */

.main-content {
    padding: 22px 26px 30px;
    max-width: 1120px;
    margin: 0 auto;
    width: 100%;
}

/* Cards */

.card {
    background: radial-gradient(circle at top left, rgba(30, 64, 175, 0.28), rgba(15, 23, 42, 0.98));
    border-radius: var(--radius-card);
    padding: 20px 22px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.35);
    backdrop-filter: blur(16px);
}

.card + .card {
    margin-top: 18px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
}

/* Headings */

h1 {
    font-size: 22px;
    margin: 0 0 10px;
}

h2 {
    font-size: 17px;
    margin: 0 0 8px;
}

h3 {
    font-size: 15px;
    margin: 12px 0 4px;
}

/* Text */

p {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 14px;
    color: #e5e7eb;
}

.text-muted {
    color: var(--text-muted);
    font-size: 13px;
}

/* Forms */

.form-row {
    margin-bottom: 10px;
}

label {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    max-width: 380px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(15, 23, 42, 0.7);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

textarea {
    resize: vertical;
    min-height: 80px;
    max-width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.6);
    background: rgba(15, 23, 42, 0.95);
}

/* Buttons */

button,
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 999px;
    border: none;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.06s ease, box-shadow 0.15s ease;
}

button:active,
.btn:active {
    transform: translateY(1px);
}

.btn-primary,
button {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.45);
}

.btn-primary:hover,
button:hover {
    background: linear-gradient(135deg, var(--primary-dark), #1d4ed8);
}

.btn-ghost {
    background: rgba(15, 23, 42, 0.8);
    color: var(--text);
    border: 1px solid rgba(148, 163, 184, 0.4);
}

.btn-ghost:hover {
    background: rgba(31, 41, 55, 0.95);
}

.btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

/* Messages */

.message-error,
.message-success {
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 10px;
    border: 1px solid;
}

.message-error {
    background: rgba(185, 28, 28, 0.12);
    border-color: rgba(248, 113, 113, 0.7);
    color: #fecaca;
}

.message-success {
    background: rgba(22, 101, 52, 0.12);
    border-color: rgba(34, 197, 94, 0.7);
    color: #bbf7d0;
}

/* Tables */

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

th, td {
    font-size: 13px;
}

th {
    color: var(--text-muted);
}

tbody tr:hover {
    background: rgba(15, 23, 42, 0.65);
}

/* Footer */

.footer {
    border-top: 1px solid rgba(148, 163, 184, 0.3);
    padding: 10px 26px;
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(2, 6, 23, 0.9);
}

/* Login: Fullscreen centered */

body.login-layout {
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, #1e293b 0, #020617 50%, #000 100%);
}

.login-card {
    width: 360px;
    background: radial-gradient(circle at top left, rgba(30, 64, 175, 0.5), rgba(15, 23, 42, 0.98));
    border-radius: 18px;
    padding: 22px 24px 20px;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.45);
    backdrop-filter: blur(18px);
}

.login-card h1 {
    margin-bottom: 8px;
}

.login-card p {
    font-size: 13px;
    color: var(--text-muted);
}

/* KPI Cards */

.kpi-card {
    background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.15), rgba(15, 23, 42, 0.98));
    border-radius: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.45);
}

.kpi-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
}

.kpi-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.kpi-link {
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
}

.kpi-link:hover {
    text-decoration: underline;
}