:root {
    --ink: #1c2430;
    --muted: #5c6b7a;
    --line: #d7dee6;
    --bg: #f4f7fa;
    --card: #fff;
    --brand: #16324f;
    --accent: #0f6e8c;
    --danger: #9d2c2c;
    --ok: #176b45;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font: 15px/1.5 "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
}

a { color: var(--accent); }

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.5rem;
    background: var(--brand);
    color: #fff;
}

.brand { font-weight: 650; letter-spacing: 0.02em; }

.top nav, .top form { display: flex; align-items: center; gap: 1rem; }

.top a, .top button {
    color: #fff;
    text-decoration: none;
    background: none;
    border: 0;
    font: inherit;
    cursor: pointer;
    padding: 0;
}

.top a:hover, .top button:hover { text-decoration: underline; }

.wrap {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 1.25rem;
    max-width: 1100px;
    margin: 1.5rem auto;
    padding: 0 1rem 2rem;
}

.wrap.solo { grid-template-columns: 1fr; max-width: 720px; }

main, .side {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1.25rem 1.4rem;
}

h1 { margin: 0 0 0.75rem; font-size: 1.45rem; }

.lead { color: var(--muted); margin-top: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; }

.card {
    display: block;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
}

.card:hover { border-color: var(--accent); }

.card strong { display: block; }

.card span { color: var(--muted); font-size: 0.92rem; }

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

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

th { font-size: 0.82rem; color: var(--muted); font-weight: 650; }

.filters input {
    width: 100%;
    min-width: 4.5rem;
    padding: 0.25rem 0.35rem;
    border: 1px solid var(--line);
    border-radius: 4px;
}

.actions { white-space: nowrap; }

.actions form { display: inline; }

.actions button, button.linkish {
    background: none;
    border: 0;
    color: var(--danger);
    font: inherit;
    cursor: pointer;
    padding: 0;
}

.pill {
    display: inline-block;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.8rem;
}

.pill.on { background: #e5f6ee; color: var(--ok); }
.pill.off { background: #f8e8e8; color: var(--danger); }

.pager { display: flex; gap: 0.8rem; align-items: center; margin-top: 0.8rem; }
.muted { color: var(--muted); }

.side h2 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li { margin: 0.35rem 0; }
.side form { margin: 0; }

label { display: block; font-weight: 650; margin: 0.8rem 0 0.25rem; }

input[type="text"], input[type="password"], input[type="number"], input[type="email"], input[type="datetime-local"], select {
    width: 100%;
    max-width: 28rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
}

.hint, .error { font-size: 0.88rem; }
.hint { color: var(--muted); }
.error { color: var(--danger); }

.alert { padding: 0.6rem 0.75rem; border-radius: 6px; margin-bottom: 0.8rem; }
.alert.ok { background: #e5f6ee; color: var(--ok); }
.alert.bad { background: #f8e8e8; color: var(--danger); }

button.primary, a.button {
    display: inline-block;
    margin-top: 1rem;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 6px;
    padding: 0.45rem 0.9rem;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
}

.check { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.8rem; }
.check label { margin: 0; font-weight: 500; }

dl { display: grid; grid-template-columns: 11rem 1fr; gap: 0.35rem 0.75rem; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; }

@media (max-width: 800px) {
    .wrap { grid-template-columns: 1fr; }
    .top { flex-direction: column; align-items: flex-start; }
}
