/* GamePanel – Basis-Design (UI-Kit). Themes überschreiben die Variablen in :root
   oder ergänzen eigene CSS-Dateien. Keine externen Schriften/CDNs (DSGVO). */

:root {
    --primary: #5b8cff;
    --primary-contrast: #ffffff;
    --accent: #22c3a6;
    --danger: #ef5b6a;
    --warning: #f2b33d;
    --success: #2fbf71;
    --info: #4fa3ff;
    --radius: 10px;
    --radius-sm: 6px;
    --sidebar-width: 252px;
    --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, monospace;

    --bg: #f4f6fa;
    --bg-elev: #ffffff;
    --bg-soft: #eef1f6;
    --bg-sidebar: #12151d;
    --text: #1b2030;
    --text-soft: #5d6578;
    --text-sidebar: #c4c9d6;
    --border: #e2e6ee;
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .05);
    --console-bg: #0c0e13;
    --console-text: #d6dbe6;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0f1117;
        --bg-elev: #171a23;
        --bg-soft: #1e222d;
        --bg-sidebar: #0b0d12;
        --text: #e6e8ee;
        --text-soft: #9aa1b2;
        --border: #272c38;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    }
}

:root[data-theme="dark"] {
    --bg: #0f1117;
    --bg-elev: #171a23;
    --bg-soft: #1e222d;
    --bg-sidebar: #0b0d12;
    --text: #e6e8ee;
    --text-soft: #9aa1b2;
    --border: #272c38;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.55; color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.25; font-weight: 650; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
code, pre, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--bg-soft); padding: 1px 6px; border-radius: 4px; }
pre.code { background: var(--console-bg); color: var(--console-text); padding: 12px 14px; border-radius: var(--radius-sm); overflow: auto; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
img { max-width: 100%; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.muted { color: var(--text-soft); }
.small { font-size: .86em; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.flex { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- Gerüst ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-width) 1fr; min-height: 100vh; }
.sidebar { background: var(--bg-sidebar); color: var(--text-sidebar); position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; color: #fff; font-weight: 700; font-size: 1.08rem; text-decoration: none; }
.sidebar .brand img { max-height: 30px; }
.sidebar .brand .logo-dot { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, var(--primary), var(--accent)); display: grid; place-items: center; color: #fff; }
.nav-group { padding: 6px 12px; }
.nav-group-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #6c7488; padding: 10px 10px 4px; }
.nav-link { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; color: var(--text-sidebar); text-decoration: none; font-size: .93rem; }
.nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav-link.active { background: rgba(91, 140, 255, .16); color: #fff; }
.nav-link.active .icon { color: var(--primary); }
.nav-sub { padding-left: 39px; }
.nav-sub .nav-link { padding: 5px 10px; font-size: .88rem; }
.sidebar-footer { margin-top: auto; padding: 14px 20px; font-size: .78rem; color: #6c7488; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 26px; background: var(--bg-elev); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.topbar .search { flex: 1; max-width: 420px; }
.topbar .search input { background: var(--bg-soft); border-color: transparent; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--text-soft); cursor: pointer; position: relative; }
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }
.icon-btn .dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.menu-toggle { display: none; }
.content { padding: 26px; max-width: 1440px; width: 100%; }
.impersonation-bar { background: var(--warning); color: #241a00; padding: 8px 26px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }

.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-header h1 { margin: 0; }
.page-header .subtitle { color: var(--text-soft); margin-top: 4px; }
.breadcrumb { font-size: .85rem; color: var(--text-soft); margin-bottom: 6px; }
.breadcrumb a { color: var(--text-soft); }

/* ---------- Karten, Raster ---------- */
.card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; min-width: 0; }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card-header h2, .card-header h3 { margin: 0; font-size: 1rem; }
.card-body { padding: 18px; }
.card-body.p-0 { padding: 0; }
.card-footer { padding: 12px 18px; border-top: 1px solid var(--border); background: var(--bg-soft); border-radius: 0 0 var(--radius) var(--radius); }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }

.stat { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; }
.stat .stat-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: rgba(91, 140, 255, .12); color: var(--primary); }
.stat .stat-icon.green { background: rgba(47, 191, 113, .12); color: var(--success); }
.stat .stat-icon.orange { background: rgba(242, 179, 61, .14); color: var(--warning); }
.stat .stat-icon.red { background: rgba(239, 91, 106, .12); color: var(--danger); }
.stat .stat-value { font-size: 1.45rem; font-weight: 700; line-height: 1.1; }
.stat .stat-label { color: var(--text-soft); font-size: .85rem; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; }
.kv dt { color: var(--text-soft); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-soft); font-weight: 600; background: var(--bg-soft); }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg-soft); }
.table td.actions { text-align: right; white-space: nowrap; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 36px 18px; text-align: center; color: var(--text-soft); }
.empty .icon { width: 36px; height: 36px; opacity: .5; display: block; margin: 0 auto 8px; }

/* ---------- Formulare ---------- */
.form label, label.field { display: block; margin-bottom: 14px; font-weight: 550; font-size: .9rem; }
.form label > input, .form label > select, .form label > textarea, label.field > input, label.field > select, label.field > textarea { margin-top: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=search], input[type=date], input[type=datetime-local], input[type=tel], input:not([type]), select, textarea {
    display: block; width: 100%; padding: 9px 11px; font: inherit; font-weight: 400; color: var(--text); background: var(--bg-elev);
    border: 1px solid var(--border); border-radius: var(--radius-sm); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91, 140, 255, .2); }
textarea { min-height: 110px; resize: vertical; }
textarea.code-editor { font-family: var(--mono); font-size: 13px; min-height: 420px; background: var(--console-bg); color: var(--console-text); tab-size: 4; white-space: pre; }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; accent-color: var(--primary); vertical-align: -3px; margin-right: 6px; }
label.check { display: flex; align-items: center; gap: 4px; font-weight: 400; margin-bottom: 10px; }
.help { font-size: .82rem; color: var(--text-soft); font-weight: 400; margin-top: 4px; }
.field-error { color: var(--danger); font-size: .82rem; margin-top: 4px; font-weight: 500; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; flex-wrap: wrap; }
.input-group { display: flex; }
.input-group input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 4px; margin: 0 0 16px; }
legend { padding: 0 6px; font-weight: 600; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 15px; font: inherit; font-weight: 600; font-size: .9rem; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--bg-elev); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, opacity .15s; }
.btn:hover { background: var(--bg-soft); text-decoration: none; }
.btn:disabled, .btn.disabled { opacity: .55; pointer-events: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-contrast); }
.btn-primary:hover { background: var(--primary); filter: brightness(1.08); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: var(--success); filter: brightness(1.08); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger); filter: brightness(1.08); }
.btn-warning { background: var(--warning); border-color: var(--warning); color: #241a00; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { padding: 5px 10px; font-size: .82rem; }
.btn-lg { padding: 12px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn .icon { width: 16px; height: 16px; }
form.inline { display: inline; }

/* ---------- Badges, Hinweise ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: rgba(47, 191, 113, .14); color: var(--success); }
.badge-warn { background: rgba(242, 179, 61, .18); color: #b07a10; }
.badge-bad { background: rgba(239, 91, 106, .14); color: var(--danger); }
.badge-info { background: rgba(79, 163, 255, .14); color: var(--info); }
.badge-muted { background: var(--bg-soft); color: var(--text-soft); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 4px; background: var(--bg-soft); font-size: .78rem; color: var(--text-soft); }
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid transparent; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: rgba(47, 191, 113, .1); border-color: rgba(47, 191, 113, .35); }
.alert-error { background: rgba(239, 91, 106, .1); border-color: rgba(239, 91, 106, .35); }
.alert-warning { background: rgba(242, 179, 61, .12); border-color: rgba(242, 179, 61, .4); }
.alert-info { background: rgba(79, 163, 255, .1); border-color: rgba(79, 163, 255, .35); }
.alert .close { margin-left: auto; background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; font-size: 1.1rem; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a, .tabs button { padding: 10px 14px; border: 0; background: none; font: inherit; font-weight: 550; color: var(--text-soft); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 7px; align-items: center; text-decoration: none; }
.tabs a:hover, .tabs button:hover { color: var(--text); }
.tabs a.active, .tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Fortschritt, Ressourcen ---------- */
.progress { height: 8px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--primary); border-radius: inherit; transition: width .4s; }
.progress.warn > span { background: var(--warning); }
.progress.bad > span { background: var(--danger); }
.meter { display: grid; gap: 4px; margin-bottom: 12px; }
.meter .flex-between { font-size: .85rem; }

/* ---------- Konsole ---------- */
.console { background: var(--console-bg); color: var(--console-text); font-family: var(--mono); font-size: 12.8px; line-height: 1.5; height: 460px; overflow-y: auto; padding: 12px 14px; border-radius: var(--radius-sm) var(--radius-sm) 0 0; white-space: pre-wrap; word-break: break-word; }
.console .line-err { color: #ff8b96; }
.console .line-sys { color: #7fb4ff; }
.console-input { display: flex; }
.console-input input { border-radius: 0 0 0 var(--radius-sm); font-family: var(--mono); background: #11141b; color: var(--console-text); border-color: #232838; }
.console-input .btn { border-radius: 0 0 var(--radius-sm) 0; }

/* ---------- Dateimanager ---------- */
.file-list .table td:first-child { width: 34px; }
.file-list a.dir { font-weight: 600; }
.path-bar { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; font-family: var(--mono); font-size: .9rem; }
.path-bar a { padding: 2px 6px; border-radius: 4px; }

/* ---------- Dialoge, Dropdowns ---------- */
dialog { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-elev); color: var(--text); padding: 0; width: min(560px, 94vw); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
dialog::backdrop { background: rgba(10, 12, 18, .55); }
dialog .dialog-header { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
dialog .dialog-header h3 { margin: 0; }
dialog .dialog-body { padding: 18px; }
dialog .dialog-footer { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px; display: none; z-index: 50; }
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: flex; gap: 9px; align-items: center; width: 100%; padding: 8px 10px; border-radius: 6px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; text-decoration: none; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--bg-soft); }
.dropdown-menu .sep { height: 1px; background: var(--border); margin: 6px 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }

.pagination { display: flex; gap: 4px; justify-content: center; padding: 14px; flex-wrap: wrap; }
.pagination a { min-width: 34px; padding: 6px 10px; text-align: center; border-radius: 6px; border: 1px solid var(--border); color: var(--text); text-decoration: none; }
.pagination a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pagination .gap { padding: 6px; color: var(--text-soft); }

.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 11px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.list li:last-child { border-bottom: 0; }
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 22px; counter-reset: s; flex-wrap: wrap; }
.steps li { counter-increment: s; font-size: .85rem; color: var(--text-soft); display: flex; align-items: center; gap: 6px; }
.steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; background: var(--bg-soft); display: grid; place-items: center; font-size: .75rem; font-weight: 700; }
.steps li.active { color: var(--text); font-weight: 600; }
.steps li.active::before { background: var(--primary); color: #fff; }

/* ---------- Server-Kacheln ---------- */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.server-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; color: var(--text); text-decoration: none; transition: transform .12s, border-color .12s; }
.server-card:hover { transform: translateY(-2px); border-color: var(--primary); text-decoration: none; }
.server-card .game-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--bg-soft); display: grid; place-items: center; overflow: hidden; }
.server-card .game-icon img { width: 100%; height: 100%; object-fit: cover; }
.server-card .addr { font-family: var(--mono); font-size: .88rem; color: var(--text-soft); }

/* ---------- Auth-Seiten ---------- */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 10% -10%, rgba(91, 140, 255, .18), transparent), radial-gradient(900px 500px at 110% 110%, rgba(34, 195, 166, .14), transparent), var(--bg); }
.auth-card { width: min(420px, 100%); background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 30px; box-shadow: var(--shadow); }
.auth-card.wide { width: min(720px, 100%); }
.brand-lg { font-size: 1.4rem; font-weight: 750; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.auth-links { display: flex; justify-content: space-between; font-size: .88rem; margin-top: 14px; }

/* ---------- Öffentliche Seiten ---------- */
.site-header { background: var(--bg-elev); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 30; }
.site-header .inner, .site-footer .inner, .container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.site-header .inner { display: flex; align-items: center; gap: 24px; height: 66px; }
.site-header .brand { font-weight: 750; font-size: 1.15rem; color: var(--text); display: flex; gap: 10px; align-items: center; text-decoration: none; }
.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-nav a { padding: 8px 12px; border-radius: 8px; color: var(--text); font-weight: 550; text-decoration: none; }
.site-nav a:hover, .site-nav a.active { background: var(--bg-soft); }
.site-header .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.hero { padding: 80px 0 60px; background: radial-gradient(900px 400px at 20% 0%, rgba(91, 140, 255, .2), transparent), radial-gradient(700px 400px at 100% 100%, rgba(34, 195, 166, .15), transparent); }
.hero h1 { font-size: clamp(2rem, 4vw, 3rem); max-width: 800px; }
.hero p { font-size: 1.15rem; color: var(--text-soft); max-width: 680px; }
.section { padding: 50px 0; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.product-card { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); }
.product-card .price { font-size: 1.6rem; font-weight: 750; }
.product-card .price small { font-size: .85rem; color: var(--text-soft); font-weight: 500; }
.product-card ul { padding-left: 18px; margin: 0; color: var(--text-soft); }
.product-card .btn { margin-top: auto; }
.prose { max-width: 820px; }
.prose h2 { margin-top: 1.6em; }
.prose img { border-radius: var(--radius); }
.prose table { border-collapse: collapse; width: 100%; }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 10px; }
.prose blockquote { border-left: 3px solid var(--primary); margin: 0 0 1em; padding: 4px 16px; color: var(--text-soft); }
.site-footer { border-top: 1px solid var(--border); padding: 30px 0; margin-top: 40px; color: var(--text-soft); font-size: .9rem; }
.site-footer .inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.site-footer a { color: var(--text-soft); margin-right: 14px; }

/* ---------- Responsiv ---------- */
@media (max-width: 1100px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .layout-side { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .app { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-width); z-index: 60; transform: translateX(-100%); transition: transform .2s; }
    body.nav-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .5); }
    .menu-toggle { display: inline-grid; }
    .content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .site-nav { display: none; }
    body.nav-open .site-nav { display: flex; position: absolute; top: 66px; left: 0; right: 0; background: var(--bg-elev); flex-direction: column; padding: 10px; border-bottom: 1px solid var(--border); }
    .kv { grid-template-columns: 1fr; gap: 2px 0; }
    .kv dd { margin-bottom: 8px; }
}
@media print {
    .sidebar, .topbar, .page-header .actions, .btn { display: none !important; }
    .app { display: block; }
    body { background: #fff; color: #000; }
}
