:root {
    --bg: #f2f4ef;
    --panel: #ffffff;
    --panel-soft: #eef3ec;
    --text: #162117;
    --muted: #627164;
    --line: #d8ded5;
    --accent: #176a5b;
    --accent-dark: #114f44;
    --danger: #b42318;
    --success: #13795b;
    --shadow: 0 20px 48px rgba(22, 33, 23, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(23, 106, 91, 0.08), transparent 22%),
        linear-gradient(180deg, #f8fbf7 0%, var(--bg) 100%);
}

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

a:hover {
    text-decoration: underline;
}

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

.sidebar {
    background: #0e1f1a;
    color: #fff;
    padding: 24px 18px;
}

.brand {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
}

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

.nav a {
    color: #dbe7e1;
    padding: 10px 12px;
    border-radius: 12px;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.08);
    text-decoration: none;
}

.sidebar-foot {
    margin-top: 28px;
    color: #9fb4ab;
    font-size: 14px;
}

.content {
    padding: 28px;
}

.page-head h1,
.panel h2 {
    margin-top: 0;
}

.panel,
.metric,
.login-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.panel {
    padding: 20px;
    margin-bottom: 20px;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.metric {
    padding: 18px;
}

.metric-label {
    display: block;
    color: var(--muted);
    margin-bottom: 8px;
}

.metric-value {
    font-size: 30px;
    font-weight: 700;
}

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

.spaced-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

input[type="text"],
input[type="password"],
input[type="url"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    margin-bottom: 14px;
}

select[multiple] {
    min-height: 150px;
}

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

button,
.button {
    display: inline-block;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    padding: 11px 16px;
    font-weight: 600;
    cursor: pointer;
}

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

.button-secondary {
    background: var(--panel-soft);
    color: var(--text);
}

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

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

.flash {
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
}

.flash-success {
    background: #ecfdf3;
    color: var(--success);
    border: 1px solid #abefc6;
}

.flash-error {
    background: #fef3f2;
    color: var(--danger);
    border: 1px solid #fecdca;
}

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

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: var(--panel-soft);
}

.badge-on {
    background: #ecfdf3;
    color: var(--success);
}

.badge-off {
    background: #fef3f2;
    color: var(--danger);
}

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

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

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

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

.code-box {
    background: #0f172a;
    color: #dbeafe;
    border-radius: 12px;
    padding: 12px;
    overflow-x: auto;
    font-family: Consolas, monospace;
    font-size: 13px;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-card {
    width: min(100%, 480px);
    padding: 30px;
}

.help {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 14px;
}

.top-gap {
    margin-top: 16px;
}

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

    .grid-2 {
        grid-template-columns: 1fr;
    }
}
