:root {
    --bg: #0f1115;
    --panel: #0e0f11;
    --border: #2b2f39;
    --text: #e7e9ee;
    --muted: #97a1af;
    --accent: #7fe3d1;
    --btn: #171a1f;
    --btnh: #1e232b;
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    font-family: Inter, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 20px
}

/* layout: фикс. левая колонка 360px */
body>.flex {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
    align-items: start
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px
}

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

.small,
.small.m {
    color: var(--muted);
    font-size: 12px
}

.inactive {
    opacity: .65
}

.badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    color: var(--muted)
}

.badge.code {
    letter-spacing: .2px
}

/* inputs */
input,
select,
textarea {
    width: 100%;
    background: #0f1217;
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 8px;
    padding: 8px 10px;
    outline: none
}

input:focus,
select:focus,
textarea:focus {
    border-color: #3a4352;
    box-shadow: 0 0 0 3px rgba(127, 227, 209, .08)
}

select[multiple] {
    min-width: 320px;
    min-height: 120px
}

/* buttons */
.btn,
button.btn {
    display: inline-block;
    background: var(--btn);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: .15s ease;
    text-decoration: none
}

.btn:hover {
    background: var(--btnh);
    transform: translateY(-1px);
    border-color: #3a4352
}

.btn:active {
    transform: translateY(0)
}

button[disabled],
.btn[disabled] {
    opacity: .5;
    cursor: not-allowed
}

/* tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0
}

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

th {
    color: #cfd6e4;
    font-weight: 600;
    background: var(--panel)
}

th.num,
td.num {
    width: 44px;
    text-align: right;
    padding-right: 10px
}

/* unified grid for forms: Название | slug | Порядок | Статус */
/* grid без slug: Название | Порядок | Статус */
.grid3 {
    display: grid;
    grid-template-columns: 2fr 120px 150px;
    gap: 12px;
    align-items: end;
}

.grid3>div>label {
    display: block;
    margin: 0 0 4px;
    color: var(--muted);
    font-size: 12px;
}

.actions {
    white-space: nowrap;
}

.inline-edit {
    display: inline-block;
    margin-right: 8px;
}

.btn-danger {
    background: #1a0f10;
    border: 1px solid #5a2020;
    color: #ffd8d8;
}

.btn-danger:hover {
    border-color: #8a3a3a;
}