:root {
    color-scheme: light;
    --bg: #f6f7f9;
    --surface: #ffffff;
    --ink: #1f2933;
    --muted: #667085;
    --line: #d8dee7;
    --primary: #176b5d;
    --primary-strong: #105348;
    --danger: #b42318;
    --danger-bg: #fff2f0;
    --focus: #2e90fa;
}

* {
    box-sizing: border-box;
}

html {
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
}

body {
    margin: 0;
    min-height: 100vh;
}

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

a:hover {
    text-decoration: underline;
}

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

.brand {
    color: var(--ink);
    font-size: 18px;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 18px;
}

.nav a {
    color: var(--muted);
    font-weight: 600;
}

.shell {
    margin: 0 auto;
    max-width: 1180px;
    padding: 32px;
}

.footer {
    color: var(--muted);
    margin: 24px auto;
    max-width: 1180px;
    padding: 0 32px;
}

.hero {
    align-items: center;
    background: linear-gradient(135deg, #ffffff, #eef7f4);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    padding: 36px;
}

.hero h1,
.section-header h1 {
    font-size: 34px;
    line-height: 1.15;
    margin: 0;
}

.hero p {
    color: var(--muted);
    font-size: 17px;
    line-height: 1.6;
    max-width: 720px;
}

.eyebrow {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.metrics {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 20px;
}

.metrics article,
.panel,
.table-wrap {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.metrics article {
    padding: 22px;
}

.metrics strong {
    display: block;
    font-size: 22px;
}

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

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

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

.toolbar input {
    flex: 1;
}

.button,
button {
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    min-height: 42px;
    padding: 0 16px;
}

.button:hover,
button:hover {
    text-decoration: none;
}

.button.primary,
button.primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.button.primary:hover,
button.primary:hover {
    background: var(--primary-strong);
}

.button.ghost {
    background: transparent;
}

.button.danger,
button.danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #ffffff;
}

.button-row,
.form-actions {
    display: flex;
    gap: 10px;
}

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

table {
    border-collapse: collapse;
    min-width: 860px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #f9fafb;
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

tr:last-child td {
    border-bottom: 0;
}

.actions-cell {
    white-space: nowrap;
}

.actions-cell a {
    font-weight: 700;
    margin-right: 10px;
}

.empty {
    color: var(--muted);
    padding: 28px;
    text-align: center;
}

.status {
    border-radius: 999px;
    display: inline-flex;
    font-size: 13px;
    font-weight: 800;
    padding: 4px 10px;
}

.status.ok {
    background: #e8f7ef;
    color: #067647;
}

.status.off {
    background: #f2f4f7;
    color: #667085;
}

.panel {
    padding: 24px;
}

.danger-panel {
    background: var(--danger-bg);
}

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

.form-grid label {
    color: var(--ink);
    display: grid;
    font-weight: 700;
    gap: 8px;
}

.form-grid .wide {
    grid-column: 1 / -1;
}

.checkline {
    align-items: center;
    display: flex !important;
    gap: 10px !important;
}

input,
textarea {
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
    min-height: 42px;
    padding: 10px 12px;
    width: 100%;
}

input[type="checkbox"] {
    min-height: auto;
    width: auto;
}

input:focus,
textarea:focus,
button:focus,
.button:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 3px rgba(46, 144, 250, 0.18);
    outline: none;
}

.validation,
.field-validation-error {
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
}

.details dl {
    display: grid;
    gap: 14px 24px;
    grid-template-columns: 180px minmax(0, 1fr);
    margin: 0;
}

.details dt {
    color: var(--muted);
    font-weight: 800;
}

.details dd {
    margin: 0;
}

.form-actions {
    margin-top: 22px;
}

@media (max-width: 760px) {
    .topbar,
    .hero,
    .section-header,
    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .shell {
        padding: 20px;
    }

    .hero {
        padding: 24px;
    }

    .hero h1,
    .section-header h1 {
        font-size: 28px;
    }

    .metrics,
    .form-grid,
    .details dl {
        grid-template-columns: 1fr;
    }
}
