/* =====================================================================
   Kontora · Design-System
   Dark SaaS · Primärblau #1a56ff · strothmann.online-Stil
   ===================================================================== */

:root {
    --blue:        #1a56ff;
    --blue-soft:   #2f6bff;
    --blue-600:    #1546d6;
    --blue-dim:    rgba(26, 86, 255, 0.14);
    --blue-glow:   rgba(26, 86, 255, 0.40);

    --bg:          #0a0d18;
    --bg-2:        #0f1320;
    --surface:     #141a2b;
    --surface-2:   #172036;
    --surface-3:   #1f2942;
    --border:      #243049;
    --border-soft: #1c2538;

    --text:        #eef2fb;
    --text-soft:   #9aa6c4;
    --text-dim:    #6b7799;

    --success:     #2fd081;
    --info:        #2f6bff;
    --warning:     #f5b23d;
    --danger:      #ff5d6c;

    --radius:      14px;
    --radius-sm:   10px;
    --radius-lg:   20px;

    --shadow:      0 12px 40px rgba(0, 0, 0, 0.45);
    --shadow-sm:   0 4px 16px rgba(0, 0, 0, 0.3);

    --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --display: 'Sora', var(--sans);
}

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

body {
    font-family: var(--sans);
    background:
        radial-gradient(1000px 560px at 82% -10%, rgba(26, 86, 255, 0.20), transparent 58%),
        radial-gradient(820px 480px at -8% 8%, rgba(20, 56, 168, 0.12), transparent 55%),
        var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }

/* ---------- App-Shell ---------- */
.app-shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

.sidebar {
    background: linear-gradient(180deg, var(--surface) 0%, var(--bg-2) 100%);
    border-right: 1px solid var(--border-soft);
    padding: 22px 16px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 22px; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 12px;
    display: grid; place-items: center;
    font-family: var(--display); font-weight: 800; font-size: 20px; color: #fff;
    background: linear-gradient(135deg, #1a56ff, #0c2e9e);
    box-shadow: 0 8px 24px var(--blue-glow);
}
.brand-text { font-family: var(--display); font-weight: 600; font-size: 19px; letter-spacing: -0.01em; }

.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    color: var(--text-soft); font-weight: 500; font-size: 14.5px;
    transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.is-active {
    background: linear-gradient(90deg, rgba(26, 86, 255, 0.18), rgba(26, 86, 255, 0.05));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(26, 86, 255, 0.3);
}
.nav-ic { width: 20px; height: 20px; display: grid; place-items: center; flex-shrink: 0; }
.nav-ic svg { width: 19px; height: 19px; }

/* Gruppierte Navigation (Untermenüs per <details>) */
.nav-group { border-radius: var(--radius-sm); }
.nav-group-head { cursor: pointer; list-style: none; user-select: none; }
.nav-group-head::-webkit-details-marker { display: none; }
.nav-grp-label { flex: 1; }
.nav-caret { margin-left: auto; opacity: .45; display: grid; place-items: center; transition: transform .18s ease; }
.nav-caret svg { width: 15px; height: 15px; }
.nav-group[open] > .nav-group-head .nav-caret { transform: rotate(90deg); }
.nav-sub { display: flex; flex-direction: column; gap: 2px; margin: 2px 0 4px; padding-left: 10px;
           border-left: 1px solid var(--border-soft); margin-left: 21px; }
.nav-sublink { padding: 8px 10px; font-size: 13.5px; }
.nav-sublink .nav-ic { width: 17px; height: 17px; opacity: .8; }
.nav-sublink .nav-ic svg { width: 16px; height: 16px; }

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.nav-muted { color: var(--text-dim); }
.ver { font-size: 11px; color: var(--text-dim); padding: 10px 12px 0; letter-spacing: .04em; }

/* ---------- Main ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 22px 34px 18px;
}
.eyebrow {
    display: inline-block;
    font-size: 10px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
    color: var(--blue-soft);
    background: var(--blue-dim);
    border: 1px solid rgba(47, 107, 255, 0.3);
    padding: 5px 12px; border-radius: 999px;
    margin-bottom: 10px;
}
.page-title { font-family: var(--display); font-size: 27px; font-weight: 600; letter-spacing: -0.02em; }

.topbar-right { display: flex; align-items: center; gap: 14px; }
.icon-btn {
    width: 40px; height: 40px; border-radius: 11px; cursor: pointer;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text-soft); display: grid; place-items: center;
    transition: border-color .15s, color .15s;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { color: var(--text); border-color: var(--blue); }
.avatar {
    width: 40px; height: 40px; border-radius: 11px;
    background: linear-gradient(135deg, #1a56ff, #0c2e9e);
    color: #fff; font-weight: 600; display: grid; place-items: center;
    box-shadow: 0 4px 14px var(--blue-glow);
}

.content { padding: 8px 34px 40px; flex: 1; }

.app-foot {
    display: flex; justify-content: space-between;
    padding: 18px 34px; border-top: 1px solid var(--border-soft);
    color: var(--text-dim); font-size: 12.5px;
}
.app-foot a { color: var(--text-soft); }
.app-foot a:hover { color: var(--blue); }

/* ---------- Flash ---------- */
.flash-stack { padding: 0 34px; display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.flash {
    padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
    border: 1px solid var(--border);
}
.flash-success { background: rgba(45, 212, 167, 0.1); border-color: rgba(45, 212, 167, 0.3); color: #7defcf; }
.flash-error   { background: rgba(255, 93, 108, 0.1); border-color: rgba(255, 93, 108, 0.3); color: #ffaab2; }
.flash-info    { background: rgba(77, 155, 255, 0.1); border-color: rgba(77, 155, 255, 0.3); color: #a8cdff; }

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
}
.card-lg { padding: 26px; border-radius: var(--radius-lg); }

.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

/* KPI-Karten */
.kpi { display: flex; flex-direction: column; gap: 10px; }
.kpi-label { font-size: 12.5px; color: var(--text-dim); font-weight: 500; }
.kpi-value { font-family: var(--display); font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.kpi-row { display: flex; align-items: baseline; justify-content: space-between; }
.kpi-trend { font-size: 12.5px; font-weight: 600; }
.kpi-up   { color: var(--success); }
.kpi-down { color: var(--danger); }
.kpi-spark { height: 36px; margin-top: 2px; }
.kpi-spark svg { width: 100%; height: 100%; }

/* Sektionskopf */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 30px 0 14px; }
.section-head h2 { font-family: var(--display); font-size: 18px; font-weight: 600; }
.section-head .eyebrow { margin-bottom: 0; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: var(--radius-sm); cursor: pointer;
    font-family: var(--sans); font-size: 14px; font-weight: 600;
    border: 1px solid transparent; transition: transform .08s, box-shadow .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn-primary {
    background: linear-gradient(135deg, var(--blue), #3d6bff);
    color: #fff; box-shadow: 0 8px 22px var(--blue-glow);
}
.btn-primary:hover { box-shadow: 0 10px 30px var(--blue-glow); }
.btn-ghost {
    background: var(--surface-2); color: var(--text); border-color: var(--border);
}
.btn-ghost:hover { border-color: var(--blue); }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border-soft); }
table.data { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 14px; }
table.data thead th {
    text-align: left; padding: 13px 18px; color: var(--text-dim);
    font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}
table.data tbody td { padding: 14px 18px; border-bottom: 1px solid var(--border-soft); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr:hover { background: var(--surface-2); }
.t-right { text-align: right; }
.t-mono { font-variant-numeric: tabular-nums; }
.t-strong { font-weight: 600; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
    border: 1px solid transparent;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-neutral { color: var(--text-soft); background: var(--surface-3); }
.badge-info    { color: var(--info);    background: rgba(47, 107, 255, 0.14); }
.badge-success { color: var(--success); background: rgba(47, 208, 129, 0.12); }
.badge-danger  { color: var(--danger);  background: rgba(255, 93, 108, 0.12); }

/* ---------- Formulare ---------- */
.form-grid { display: grid; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-soft); }
.field input, .field select, .field textarea {
    background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 11px 14px; color: var(--text); font-family: var(--sans); font-size: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.field textarea { resize: vertical; min-height: 44px; line-height: 1.5; }
.field input[type=file] { padding: 9px 12px; font-size: 13px; color: var(--text-soft); }
.field input:focus, .field select:focus, .field textarea:focus {
    outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 86, 255, 0.15);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row.triple { grid-template-columns: 1fr 1fr 1fr; }
.form-sec { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-dim); margin: 12px 0 -4px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

/* ---------- Empty State ---------- */
.empty {
    text-align: center; padding: 56px 20px; color: var(--text-dim);
}
.empty-ic {
    width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px;
    background: var(--surface-2); border: 1px solid var(--border);
    display: grid; place-items: center; color: var(--blue);
}
.empty-ic svg { width: 26px; height: 26px; }
.empty h3 { font-family: var(--display); font-size: 17px; color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 14px; max-width: 380px; margin: 0 auto 18px; }

/* Demo-Hinweis */
.demo-note {
    font-size: 12px; color: var(--warning);
    background: rgba(245, 181, 61, 0.08); border: 1px solid rgba(245, 181, 61, 0.25);
    border-radius: var(--radius-sm); padding: 9px 13px; margin-bottom: 18px;
    display: inline-flex; align-items: center; gap: 8px;
}

/* ---------- Auth ---------- */
.auth-wrap { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-card {
    width: 100%; max-width: 408px;
    background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg); padding: 38px 34px; box-shadow: var(--shadow);
}
.auth-brand { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 8px; }
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head h1 { font-family: var(--display); font-size: 23px; font-weight: 600; margin-top: 14px; }
.auth-head p { color: var(--text-dim); font-size: 14px; margin-top: 6px; }
.auth-card .btn { width: 100%; justify-content: center; margin-top: 6px; }
.auth-alt { text-align: center; margin-top: 20px; font-size: 13.5px; color: var(--text-dim); }
.auth-alt a { color: var(--blue); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
    .sidebar-foot { margin-top: 0; border-top: none; }
    .nav { flex-direction: row; flex-wrap: wrap; }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .grid-4 { grid-template-columns: 1fr; }
    .content, .topbar, .flash-stack { padding-left: 18px; padding-right: 18px; }
    .field-row, .field-row.triple { grid-template-columns: 1fr; }
}
