:root {
    --bg: #f4f6fb;
    --card: #ffffff;
    --text: #172033;
    --muted: #667085;
    --line: #e5e7eb;
    --primary: #14532d;
    --primary-2: #16a34a;
    --danger: #b42318;
    --warning: #b54708;
    --shadow: 0 10px 25px rgba(15, 23, 42, .08);
    --radius: 18px;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.logo {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: white;
    display: grid;
    place-items: center;
    font-weight: 800;
}
.nav { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.nav a {
    padding: 9px 12px;
    border-radius: 999px;
    background: #f0fdf4;
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
}

.container { max-width: 1220px; margin: 0 auto; padding: 28px 20px; }
.page-title { margin-bottom: 18px; }
h1 { margin: 0; font-size: 25px; letter-spacing: -.02em; }
h2 { margin: 0 0 14px; font-size: 18px; }
h3 { margin: 0 0 12px; font-size: 15px; }

.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)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
}
.metric span { display: block; color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.metric strong { display: block; margin-top: 8px; font-size: 30px; letter-spacing: -.04em; }
.metric small { display: block; margin-top: 6px; color: var(--muted); }

.filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
}
.form-row { display: grid; gap: 7px; }
label { font-weight: 700; color: #344054; font-size: 13px; }
input, select, textarea {
    width: 100%;
    border: 1px solid #d0d5dd;
    border-radius: 12px;
    padding: 11px 12px;
    font: inherit;
    background: white;
    color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
input[readonly] { background: #f9fafb; color: var(--muted); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    padding: 11px 14px;
    font-weight: 800;
    cursor: pointer;
    background: var(--primary);
    color: white;
    text-decoration: none;
    min-height: 42px;
}
.btn:hover { text-decoration: none; filter: brightness(.96); }
.btn.secondary { background: #eef4ff; color: #3538cd; }
.btn.light { background: #f2f4f7; color: #344054; }
.btn.danger { background: #fee4e2; color: var(--danger); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.table-wrap { overflow-x: auto; }
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: middle; }
th { color: #475467; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: #f9fafb; }
td.number, th.number { text-align: right; font-variant-numeric: tabular-nums; }
tr:hover td { background: #fcfcfd; }

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 12px;
    font-weight: 800;
    background: #ecfdf3;
    color: #027a48;
}
.badge.off { background: #f2f4f7; color: #667085; }
.badge.admin { background: #eef4ff; color: #3538cd; }

.alert {
    border-radius: 14px;
    padding: 13px 15px;
    margin-bottom: 16px;
    font-weight: 700;
}
.alert.success { background: #ecfdf3; color: #027a48; border: 1px solid #abefc6; }
.alert.error { background: #fef3f2; color: #b42318; border: 1px solid #fecdca; }
.alert.info { background: #eff8ff; color: #175cd3; border: 1px solid #b2ddff; }

.progress-line {
    height: 10px;
    background: #eef2f6;
    border-radius: 999px;
    overflow: hidden;
    min-width: 130px;
}
.progress-line span {
    display: block;
    height: 100%;
    max-width: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
}
.kpi-ok { color: #027a48; font-weight: 800; }
.kpi-warn { color: var(--warning); font-weight: 800; }
.kpi-bad { color: var(--danger); font-weight: 800; }

.footer { color: var(--muted); text-align: center; padding: 25px 10px 35px; font-size: 12px; }
.login-shell { max-width: 450px; margin: 60px auto; }
.help { color: var(--muted); font-size: 12px; line-height: 1.45; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

@media (max-width: 900px) {
    .topbar { align-items: flex-start; flex-direction: column; }
    .grid-2, .grid-3, .grid-4, .filters { grid-template-columns: 1fr; }
    .container { padding: 20px 12px; }
    h1 { font-size: 22px; }
}
