:root {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --brand: #155690;
    --brand-dark: #0f3f69;
    --ok: #087f5b;
    --error: #b42318;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--text);
}

a { color: inherit; }

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 250px;
    padding: 24px;
    background: #0b1220;
    color: white;
}

.brand {
    font-weight: 800;
    font-size: 22px;
    letter-spacing: -0.04em;
    margin-bottom: 4px;
}

.sidebar small { color: #9ca3af; }
.sidebar nav { margin-top: 34px; display: grid; gap: 8px; }
.sidebar nav a,
.logout {
    text-decoration: none;
    color: #cbd5e1;
    padding: 11px 12px;
    border-radius: 12px;
    display: block;
}
.sidebar nav a.active,
.sidebar nav a:hover,
.logout:hover {
    background: rgba(255,255,255,.10);
    color: #fff;
}
.logout { position: absolute; left: 24px; right: 24px; bottom: 24px; }

.content {
    margin-left: 250px;
    padding: 32px;
    max-width: 1480px;
}

h1 { font-size: 34px; letter-spacing: -0.04em; margin: 0 0 18px; }
h2 { font-size: 20px; margin: 0 0 16px; }
p { color: var(--muted); line-height: 1.55; }

.hero,
.panel,
.card,
.login-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
}

.hero { padding: 30px; margin-bottom: 22px; }
.panel { padding: 22px; margin-bottom: 22px; overflow: auto; }
.grid { display: grid; gap: 18px; }
.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.cards { grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 22px; }
.card { padding: 20px; }
.card span { color: var(--muted); font-size: 13px; }
.card strong { display: block; margin-top: 8px; font-size: 28px; letter-spacing: -0.04em; }

label { display: grid; gap: 7px; color: #374151; font-weight: 600; margin-bottom: 14px; }
input, textarea, select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 11px 12px;
    font: inherit;
    background: #fff;
}
textarea { resize: vertical; }

.btn {
    appearance: none;
    border: 0;
    background: var(--brand);
    color: white;
    border-radius: 12px;
    padding: 11px 16px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    justify-content: center;
}
.btn:hover { background: var(--brand-dark); }
.btn.small { padding: 7px 10px; font-size: 13px; }

table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { border-bottom: 1px solid var(--line); padding: 12px 10px; text-align: left; vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; }
.inline { display: flex; gap: 8px; align-items: center; margin: 0; }
.inline select { min-width: 140px; }

.note {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px;
    margin: 12px 0;
    background: #fbfdff;
}
pre {
    white-space: pre-wrap;
    color: #374151;
    font-family: inherit;
    margin-bottom: 0;
}

.flash {
    padding: 12px 14px;
    border-radius: 14px;
    margin-bottom: 16px;
}
.ok { background: #e6fcf5; color: var(--ok); }
.error { background: #fff1f0; color: var(--error); }

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top left, rgba(21,86,144,.22), transparent 36rem),
        var(--bg);
}
.login-card {
    width: min(440px, calc(100vw - 32px));
    padding: 30px;
}
.login-card h1 { margin-bottom: 8px; }
code {
    background: #eef2ff;
    padding: 2px 6px;
    border-radius: 7px;
}

@media (max-width: 1050px) {
    .sidebar { position: static; width: auto; }
    .logout { position: static; margin-top: 16px; }
    .content { margin-left: 0; padding: 18px; }
    .cards, .two, .three { grid-template-columns: 1fr; }
}
