:root {
    --bg: #f6f7f8;
    --panel: #ffffff;
    --ink: #18212f;
    --muted: #627084;
    --line: #d9dee7;
    --accent: #0d766e;
    --accent-dark: #075d57;
    --warn: #9a6200;
    --bad: #a12828;
    --ok: #1e7550;
}

* {
    box-sizing: border-box;
}

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

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px 24px;
    background: #102033;
    color: #fff;
}

.topbar span {
    color: #b8c4d2;
    margin-left: 10px;
}

.topbar nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.topbar a {
    color: #fff;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 6px;
}

.topbar a:hover {
    background: rgba(255, 255, 255, 0.12);
}

.page {
    max-width: 1320px;
    margin: 0 auto;
    padding: 22px;
}

.hero, .panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 16px;
}

.hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

h1, h2, h3 {
    margin: 0 0 10px;
}

p {
    color: var(--muted);
    line-height: 1.5;
}

.button, button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    padding: 9px 13px;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.button:hover, button:hover {
    background: var(--accent-dark);
}

.button.secondary {
    background: #334155;
}

.button.light {
    background: #eef2f7;
    color: var(--ink);
}

button.danger {
    background: var(--bad);
}

button.danger:hover {
    background: #7f1d1d;
}

.actions form {
    margin: 0;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

label {
    font-weight: 700;
}

input, select {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 8px 10px;
    background: #fff;
    color: var(--ink);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

th, td {
    border-bottom: 1px solid var(--line);
    padding: 9px 8px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #eef2f7;
    font-size: 12px;
    text-transform: uppercase;
    color: #475569;
}

.table-wrap {
    overflow-x: auto;
}

.metric {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.metric strong {
    display: block;
    font-size: 26px;
}

.metric span {
    color: var(--muted);
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 700;
    background: #e9eef5;
}

.badge.ok {
    color: var(--ok);
    background: #e5f4ec;
}

.badge.warning {
    color: var(--warn);
    background: #fff3d8;
}

.badge.problem {
    color: var(--bad);
    background: #ffe6e6;
}

.flash {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    background: #fff;
}

.flash.success {
    border-color: #b7dbc8;
    background: #edf8f1;
}

.flash.error {
    border-color: #efb5b5;
    background: #fff1f1;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.filters {
    display: grid;
    grid-template-columns: repeat(5, minmax(120px, 1fr));
    gap: 10px;
    align-items: end;
}

.mono {
    font-family: Consolas, Monaco, monospace;
    font-size: 12px;
    white-space: pre-wrap;
}

@media (max-width: 820px) {
    .topbar, .hero {
        flex-direction: column;
    }

    .grid, .form-grid, .filters {
        grid-template-columns: 1fr;
    }
}
