:root {
    --bg: #f4f7fb;
    --card: #ffffff;
    --ink: #102033;
    --muted: #627084;
    --line: #dbe4ef;
    --primary: #075da8;
    --primary-dark: #064777;
    --ok: #0f766e;
    --warn: #b7791f;
    --bad: #b42318;
    --soft-ok: #dff7ef;
    --soft-warn: #fff2cc;
    --soft-bad: #fde2e1;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
.app-shell { min-height: 100vh; display: flex; }
.sidebar {
    width: 245px;
    background: #0d2744;
    color: #fff;
    padding: 18px 14px;
    position: fixed;
    inset: 0 auto 0 0;
}
.brand { display: flex; gap: 10px; align-items: center; margin-bottom: 22px; }
.brand-mark {
    width: 42px; height: 42px; border-radius: 12px;
    background: #fff; color: #0d2744; font-weight: 800;
    display: grid; place-items: center;
}
.brand span { display: block; font-size: 12px; color: #b5c8db; margin-top: 3px; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a {
    color: #dbeafe; padding: 10px 12px; border-radius: 10px;
}
.sidebar nav a:hover { background: rgba(255,255,255,.11); }
.content { margin-left: 245px; padding: 24px; width: calc(100% - 245px); }
.content-login { width: 100%; padding: 24px; display: grid; place-items: center; }
.page-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 18px; gap: 16px;
}
.page-head h1 { margin: 0 0 4px 0; font-size: 26px; }
.page-head p { margin: 0; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
    background: var(--card); border: 1px solid var(--line);
    border-radius: 16px; padding: 18px;
    box-shadow: 0 8px 22px rgba(15, 43, 75, .06);
}
.card h2, .card h3 { margin-top: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 15px; }
.kpi strong { font-size: 24px; display: block; }
.kpi span { color: var(--muted); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
table { border-collapse: collapse; width: 100%; min-width: 720px; }
th, td { padding: 10px 11px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #eef4fb; font-weight: 700; color: #20364f; position: sticky; top: 0; }
tr:hover td { background: #fafcff; }
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.badge.ok { background: var(--soft-ok); color: var(--ok); }
.badge.warn { background: var(--soft-warn); color: var(--warn); }
.badge.bad { background: var(--soft-bad); color: var(--bad); }
.badge.gray { background: #eef2f7; color: #475569; }
.alert {
    padding: 12px 14px; border-radius: 12px; margin-bottom: 12px;
    border: 1px solid var(--line); background: #fff;
}
.alert.success { background: var(--soft-ok); color: var(--ok); }
.alert.error { background: var(--soft-bad); color: var(--bad); }
.alert.warning { background: var(--soft-warn); color: var(--warn); }
form .row { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
label { display: grid; gap: 6px; font-weight: 700; }
input, select, textarea {
    width: 100%; padding: 11px 12px; border: 1px solid #cbd5e1;
    border-radius: 10px; font: inherit; background: #fff;
}
textarea { min-height: 90px; }
button, .btn {
    border: 0; background: var(--primary); color: #fff;
    padding: 11px 14px; border-radius: 10px; font-weight: 700;
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
button:hover, .btn:hover { background: var(--primary-dark); color: #fff; }
.btn.secondary { background: #e2e8f0; color: #0f172a; }
.btn.danger { background: #b42318; }
.muted { color: var(--muted); }
pre {
    white-space: pre-wrap; background: #0f172a; color: #e2e8f0;
    padding: 14px; border-radius: 12px; overflow: auto;
}
.login-card { width: min(430px, 100%); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.copy-box {
    background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
.copy-box textarea { min-height: 70px; margin-top: 8px; }
@media (max-width: 900px) {
    .sidebar { position: static; width: 100%; }
    .app-shell { display: block; }
    .content { margin-left: 0; width: 100%; }
    .grid-2, .grid-3, .kpis, form .row { grid-template-columns: 1fr; }
}
