:root {
    --ink: #172033;
    --muted: #667085;
    --line: #dde3ee;
    --bg: #f4f7fb;
    --panel: #ffffff;
    --nav: #172033;
    --blue: #2357c6;
    --cyan: #0f8b8d;
    --green: #16803c;
    --amber: #b7791f;
    --red: #ba2d2d;
    --shadow: 0 12px 30px rgba(23, 32, 51, .08);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: radial-gradient(circle at top left, #e8f2ff 0, #f4f7fb 320px);
}
a { color: inherit; text-decoration: none; }
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 248px;
    background: linear-gradient(180deg, #172033 0%, #24324d 100%);
    border-right: 0;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 14px; border-bottom: 1px solid var(--line); }
.brand { color: white; border-bottom-color: rgba(255,255,255,.14); }
.brand-mark { width: 42px; height: 42px; border-radius: 8px; background: #f59e0b; color: #172033; display: grid; place-items: center; font-weight: 800; }
.brand small { display: block; color: #b9c4d6; margin-top: 2px; }
nav { display: grid; gap: 4px; }
nav a { padding: 10px 12px; border-radius: 7px; color: #d7deea; }
nav a:hover { background: rgba(255,255,255,.10); color: white; }
.sidebar-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 10px; padding: 12px 6px 0; border-top: 1px solid rgba(255,255,255,.14); color: #b9c4d6; }
.main { margin-left: 248px; padding: 24px; min-height: 100vh; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
h1 { margin: 0; font-size: 26px; line-height: 1.2; }
h2 { margin: 0 0 12px; font-size: 18px; }
p.sub { color: var(--muted); margin: 6px 0 0; }
.grid { display: grid; gap: 14px; }
.grid.kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; }
.grid.two { grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); }
.card, .form-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow);
}
.kpi-card { position: relative; overflow: hidden; }
.kpi-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--cyan); }
.kpi-card:nth-child(2)::before { background: var(--green); }
.kpi-card:nth-child(3)::before { background: var(--amber); }
.kpi-card:nth-child(4)::before { background: var(--red); }
.kpi-card span { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.kpi-card strong { display: block; font-size: 24px; margin-top: 8px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.btn, button {
    border: 0;
    background: var(--blue);
    color: white;
    border-radius: 7px;
    padding: 9px 12px;
    font-weight: 700;
    cursor: pointer;
}
.btn:hover, button:hover { filter: brightness(.96); }
.btn.secondary { background: #e5e7eb; color: #1f2937; }
.btn.danger { background: var(--red); }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 9px 10px;
    font: inherit;
    background: white;
}
textarea { min-height: 82px; resize: vertical; }
label { font-size: 13px; color: #374151; display: grid; gap: 6px; }
.form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.form-grid .wide { grid-column: span 3; }
table { width: 100%; border-collapse: collapse; background: white; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 14px; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #f7f9fd; }
tbody tr:hover { background: #fbfdff; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: white; }
.badge { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #e5e7eb; color: #374151; white-space: nowrap; }
.badge.good { background: #dcfce7; color: var(--green); }
.badge.warn { background: #fef3c7; color: var(--amber); }
.badge.bad { background: #fee2e2; color: var(--red); }
.badge.neutral { background: #e0f2fe; color: #0369a1; }
.progress { min-width: 170px; }
.bar { height: 9px; background: #e5e7eb; border-radius: 999px; overflow: hidden; margin: 5px 0; }
.bar span { display: block; height: 100%; background: var(--cyan); }
.flash { background: #ecfdf5; color: var(--green); border: 1px solid #bbf7d0; padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); background: white; border: 1px solid var(--line); border-radius: 8px; padding: 24px; }
.login-card h1 { margin-bottom: 8px; }
.login-card form { display: grid; gap: 12px; margin-top: 18px; }
.muted { color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 960px) {
    .sidebar { position: static; width: auto; }
    .main { margin-left: 0; padding: 16px; }
    .grid.kpi, .grid.two, .form-grid { grid-template-columns: 1fr; }
    .form-grid .wide { grid-column: auto; }
}
