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

.metric-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 16px;
    min-height: 96px;
}

.metric {
    font-size: 30px;
    font-weight: 700;
    margin-top: 10px;
    letter-spacing: -0.03em;
    line-height: 1;
}

.metric-label {
    color: var(--muted);
    font-size: 15px;
}

.split-2 {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 14px;
    align-items: start;
}

.loading,
.empty {
    padding: 20px 12px;
    text-align: center;
    color: var(--muted);
}

.card.empty {
    min-height: auto;
    text-align: left;
}

.cta-card {
    display: grid;
    gap: 12px;
}

.cta-card p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.5;
}

.section-title {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 600;
}

.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.toolbar input {
    max-width: 280px;
    margin: 0;
}

.spacer {
    flex: 1;
}

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

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

th {
    color: var(--muted);
    font-size: 15px;
    font-weight: 600;
    text-transform: none;
}

.table-wrap {
    overflow: auto;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    background: #eef2f4;
    color: #415468;
}

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

.badge.draft {
    background: #fff4d9;
    color: var(--warn);
}

.badge.archived {
    background: #eef1f3;
    color: #667788;
}

.tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.tabs button {
    border: 0;
    background: #e8eff1;
    color: #35525a;
    border-radius: 999px;
    padding: 8px 14px;
}

.tabs button.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

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

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

.field-hint {
    margin-top: -8px;
    margin-bottom: 8px;
    font-size: 15px;
    color: var(--muted);
}

.field-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.field-required {
    color: var(--danger);
    font-weight: 700;
    line-height: 1;
}

.switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-2);
}

.switch-row strong {
    display: block;
    font-size: 16px;
}

.slot-list {
    display: grid;
    gap: 12px;
}

.slot-item {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    background: var(--surface-2);
    display: grid;
    gap: 10px;
}

.slot-item .row {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.5fr) minmax(0, 0.85fr);
    gap: 10px;
    align-items: end;
}

.slot-item .row > label {
    margin-bottom: 0;
}

.slot-item .row input,
.slot-item .row select {
    min-height: 44px;
    box-sizing: border-box;
}

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

.stack {
    display: grid;
    gap: 14px;
}

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

.kv-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
}

.kv-row span:first-child {
    color: var(--muted);
}

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: #17353a;
    color: #fff;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    z-index: 50;
}

pre.code {
    margin: 0;
    padding: 14px;
    background: #0f2428;
    color: #d7ecee;
    border-radius: 12px;
    overflow: auto;
    font-size: 14px;
    line-height: 1.5;
}

.linkish {
    border: 0;
    background: transparent;
    color: var(--accent);
    padding: 0;
    text-decoration: underline;
}

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

    .sidebar {
        height: auto;
        position: static;
    }

    .side-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .split-2,
    .form-grid,
    .slot-item .row,
    .grid {
        grid-template-columns: 1fr;
    }

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

