:root {
    --bg: #f4f7f6;
    --panel: #ffffff;
    --text: #17201c;
    --muted: #6b766f;
    --line: #dde5e0;
    --green: #128c7e;
    --green-strong: #075e54;
    --blue: #2563eb;
    --red: #dc2626;
    --amber: #b45309;
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
}

a {
    color: inherit;
    text-decoration: none;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #eef8f5 0%, #f6f8fb 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: 0 14px 40px rgba(17, 24, 39, .08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--green-strong);
    color: #fff;
    font-weight: 800;
}

.brand-title {
    font-size: 20px;
    font-weight: 750;
}

.brand-subtitle {
    color: var(--muted);
    font-size: 13px;
    margin-top: 2px;
}

.field {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
}

.field label {
    color: #34423b;
    font-size: 13px;
    font-weight: 650;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid #cfd8d3;
    border-radius: var(--radius);
    padding: 11px 12px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

textarea {
    min-height: 96px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--green);
    outline: 3px solid rgba(18, 140, 126, .12);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border: 0;
    border-radius: var(--radius);
    padding: 0 14px;
    background: var(--green-strong);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.button.secondary {
    background: #eef3f1;
    color: #1f2a25;
}

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

.button.full {
    width: 100%;
}

.alert {
    border-radius: var(--radius);
    padding: 11px 12px;
    margin-bottom: 16px;
    background: #fff4f4;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert.success {
    background: #effaf4;
    border-color: #bbf7d0;
    color: #166534;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
}

.sidebar {
    background: #0b1f1c;
    color: #d8e7e2;
    padding: 20px 16px;
}

.sidebar .brand {
    margin-bottom: 28px;
}

.sidebar .brand-mark {
    background: #25d366;
    color: #07231f;
}

.nav {
    display: grid;
    gap: 5px;
}

.nav a {
    border-radius: var(--radius);
    padding: 11px 12px;
    color: #d8e7e2;
}

.nav a.active,
.nav a:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.main {
    min-width: 0;
}

.topbar {
    min-height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.topbar h1 {
    font-size: 22px;
    margin: 0;
}

.content {
    padding: 28px;
}

.grid {
    display: grid;
    gap: 16px;
}

.stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat,
.panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.stat {
    padding: 18px;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.stat-value {
    margin-top: 8px;
    font-size: 30px;
    font-weight: 800;
}

.panel {
    padding: 18px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.panel-title {
    font-size: 17px;
    font-weight: 800;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border-radius: 999px;
    padding: 0 9px;
    background: #eef3f1;
    color: #34423b;
    font-size: 12px;
    font-weight: 750;
}

.badge.ok {
    background: #dcfce7;
    color: #166534;
}

.badge.warn {
    background: #fef3c7;
    color: #92400e;
}

.badge.bad {
    background: #fee2e2;
    color: #991b1b;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    word-break: break-all;
}

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

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

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }

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

    .topbar,
    .content {
        padding-left: 18px;
        padding-right: 18px;
    }
}
