:root {
    --bg: #f4f5f7;
    --panel: #ffffff;
    --text: #17202a;
    --muted: #64748b;
    --line: #d9dee7;
    --dark: #0f172a;
    --accent: #1f2937;
    --danger: #b91c1c;
    --success: #166534;
    --warn: #92400e;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }
.auth-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 420px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; box-shadow: 0 20px 50px rgba(15,23,42,.10); }
.auth-card.wide { max-width: 860px; }
.auth-card h1 { margin: 0 0 8px; }
.install-wrap { width: 100%; display: flex; justify-content: center; }
.muted { color: var(--muted); }
label { display: block; font-weight: 650; margin: 14px 0; }
input, textarea, select { width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; font: inherit; }
textarea { min-height: 140px; resize: vertical; }
.button, button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 14px; border: 0; border-radius: 10px; background: var(--accent); color: white; font-weight: 750; cursor: pointer; text-decoration: none; }
.button:hover { text-decoration: none; background: #111827; }
.button.secondary { background: #e5e7eb; color: #111827; }
.button.danger { background: var(--danger); }
.button.full { width: 100%; }
.alert { padding: 12px 14px; border-radius: 10px; margin: 12px 0; border: 1px solid var(--line); }
.alert.error { background: #fef2f2; color: #7f1d1d; border-color: #fecaca; }
.alert.success { background: #f0fdf4; color: #14532d; border-color: #bbf7d0; }
.alert.warn { background: #fffbeb; color: #78350f; border-color: #fde68a; }
.check-grid { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 12px 0 20px; }
.check-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--line); background: white; }
.check-row:last-child { border-bottom: 0; }
.ok { color: var(--success); }
.bad { color: var(--danger); }
.grid-form h2 { grid-column: 1 / -1; margin: 24px 0 4px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px 1fr; }
.sidebar { background: #0f172a; color: white; padding: 20px 16px; }
.brand { font-size: 22px; font-weight: 850; margin-bottom: 22px; }
.nav a { display: block; color: #dbeafe; padding: 10px 12px; border-radius: 10px; margin: 3px 0; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.12); text-decoration: none; color: white; }
.main { padding: 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.topbar h1 { margin: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px; margin-bottom: 20px; box-shadow: 0 10px 30px rgba(15,23,42,.04); }
.panel h2, .panel h3 { margin-top: 0; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat { background: white; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.stat strong { display: block; font-size: 28px; margin-top: 6px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 11px 10px; vertical-align: top; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form { display: inline; }
.badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; background: #e5e7eb; color: #111827; font-size: 12px; font-weight: 750; }
.badge.warn { background: #fef3c7; color: #78350f; }
.badge.danger { background: #fee2e2; color: #7f1d1d; }
.timeline { border-left: 3px solid var(--line); margin-left: 10px; padding-left: 18px; }
.timeline-item { margin-bottom: 18px; position: relative; }
.timeline-item:before { content: ""; width: 11px; height: 11px; background: #111827; border-radius: 50%; position: absolute; left: -25px; top: 6px; }
.help { color: var(--muted); font-size: 13px; margin-top: 4px; }
.footer-version { margin-top: 30px; color: #94a3b8; font-size: 12px; }
@media (max-width: 900px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .grid.two, .grid.three { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; gap: 12px; flex-direction: column; }
}

.install-body {
    min-height: 100vh;
    padding: 28px;
    background: var(--bg);
}
.install-shell {
    width: 100%;
    max-width: 920px;
    margin: 0 auto;
}
.install-shell h1 {
    margin: 0 0 6px;
    font-size: clamp(30px, 5vw, 48px);
    letter-spacing: -0.04em;
}
.eyebrow {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.install-form {
    display: grid;
    gap: 18px;
}
.install-form fieldset {
    border: 1px solid var(--line);
    border-radius: 14px;
    margin: 0;
    padding: 18px;
}
.install-form legend {
    padding: 0 8px;
    font-weight: 850;
}
.install-form label span {
    display: block;
    color: #1f2937;
    font-size: 13px;
    font-weight: 800;
}
.install-form label small {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    margin-top: 5px;
}
.readonly-field {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
    margin-top: 14px;
    padding: 12px 14px;
}
.readonly-field span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.install-footer {
    color: var(--muted);
    font-size: 12px;
    margin: 24px 0 0;
}
