:root {
    color-scheme: dark;
    --bg: #09111f;
    --panel: #111d31;
    --panel2: #172640;
    --line: #2b3c58;
    --text: #eef5ff;
    --muted: #9db0ca;
    --accent: #62d5b0;
    --danger: #ff7b86;
    font: 15px/1.5 Inter, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at top right, #17304a 0, var(--bg) 42%); color: var(--text); min-height: 100vh; }
a { color: #8edfc6; text-decoration: none; }
button, input, select { font: inherit; }
button { border: 0; border-radius: 8px; padding: .68rem 1rem; background: var(--accent); color: #07140f; font-weight: 700; cursor: pointer; }
button.danger, .danger { background: var(--danger); color: #23070a; }
.link { background: none; color: var(--muted); padding: 0; }
.login { display: grid; place-items: center; padding: 2rem; }
.login-card { width: min(440px, 100%); padding: 2rem; border: 1px solid var(--line); border-radius: 20px; background: rgba(17, 29, 49, .96); box-shadow: 0 24px 70px #0008; }
.eyebrow { font-size: .72rem; letter-spacing: .16em; color: var(--accent); }
label { display: grid; gap: .38rem; color: var(--muted); }
input, select { width: 100%; padding: .72rem .8rem; border-radius: 8px; border: 1px solid var(--line); background: #0b1729; color: var(--text); }
form { display: grid; gap: 1rem; }
.alert { padding: .75rem; border-radius: 8px; }
.alert.error { background: #521d28; color: #ffd9df; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 230px; padding: 1.5rem; background: #0d192b; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.sidebar h2 { margin: 0; }
.sidebar p { margin: .2rem 0 2rem; color: var(--muted); }
.sidebar nav { display: grid; gap: .35rem; }
nav a { padding: .7rem .8rem; border-radius: 8px; color: var(--muted); }
nav a.active { background: var(--panel2); color: var(--text); }
.sidebar footer { margin-top: auto; display: grid; gap: .5rem; color: var(--muted); }
.content { margin-left: 230px; padding: 2rem; max-width: 1500px; }
.content.narrow { max-width: 800px; }
.panel { background: rgba(17, 29, 49, .94); border: 1px solid var(--line); border-radius: 14px; padding: 1.2rem; margin: 1rem 0; }
.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.metric { padding: 1rem; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.metric span, .metric small, td small { display: block; color: var(--muted); }
.metric strong { display: block; font-size: 1.8rem; margin-top: .4rem; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .78rem; color: var(--muted); text-transform: uppercase; }
.filters, .inline-form, .status-row, .actions { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem; }
.filters { margin-bottom: 1rem; }
.filters input { min-width: 260px; }
.inline-form label { min-width: 160px; }
.form-grid { display: grid; gap: 1rem; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.two button { grid-column: 1 / -1; }
.compact { display: inline-flex; flex-direction: row; gap: .4rem; align-items: center; }
.compact input { min-width: 160px; padding: .45rem; }
.compact button { padding: .48rem .65rem; }
.actions { min-width: 210px; }
.pagination { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.pagination a { display: block; padding: .45rem .72rem; border: 1px solid var(--line); border-radius: 7px; }
.pagination a.active { background: var(--accent); border-color: var(--accent); color: #07140f; }
@media (max-width: 800px) {
    .sidebar { position: static; width: auto; }
    .content { margin-left: 0; padding: 1rem; }
    .form-grid.two { grid-template-columns: 1fr; }
    .sidebar nav { grid-template-columns: repeat(2, 1fr); }
}
