[hidden] { display: none !important; }

body {
    display: block;
    padding: 24px 16px;
}

.config-card {
    width: min(1800px, 100%);
    max-width: none;
    margin: 0 auto;
    padding: 28px 24px 24px;
}

.config-head {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.head-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 9px 15px;
    font-size: 13px;
}

.config-layout {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 20px;
    min-height: 480px;
}

.side-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(0, 0, 0, .2);
    align-self: start;
}

.nav-item {
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: .18s ease;
}

.nav-item:hover,
.nav-item.is-active {
    color: var(--text);
    border-color: rgba(79, 140, 255, .4);
    background: rgba(79, 140, 255, .14);
}

.config-content { min-width: 0; }
.config-section h2,
.modal-panel h2 { margin: 0; font-size: 20px; }
.config-section p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }

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

.section-tip {
    padding: 10px 12px;
    border-left: 3px solid var(--accent-2);
    background: rgba(34, 211, 238, .07);
    line-height: 1.6;
}

.table-wrap {
    margin-top: 18px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

table {
    width: 100%;
    min-width: 960px;
    border-collapse: collapse;
    font-size: 12px;
}

th, td {
    padding: 11px 9px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

th {
    color: var(--muted);
    background: rgba(255, 255, 255, .045);
    font-weight: 600;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, .025); }
.empty-cell { text-align: center; color: var(--muted); padding: 30px; }

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    color: #d5f7e0;
    background: rgba(52, 211, 153, .12);
}

.status-badge.is-off {
    color: #fecaca;
    background: rgba(248, 113, 113, .12);
}

.row-actions { display: flex; gap: 6px; }
.action-btn {
    padding: 5px 8px;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--text);
    background: rgba(255, 255, 255, .055);
    font: inherit;
    cursor: pointer;
}
.action-btn:hover { border-color: var(--accent); }
.action-btn.danger { color: #fca5a5; }
.action-btn:disabled { opacity: .45; cursor: not-allowed; }

.system-form {
    display: grid;
    gap: 20px;
    max-width: 600px;
    margin-top: 28px;
}

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

.field { display: grid; gap: 8px; }
.field label { color: var(--text); font-size: 13px; font-weight: 600; }
.field small { color: var(--muted); font-size: 12px; line-height: 1.5; }
.input {
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: none;
    color: var(--text);
    background: rgba(0, 0, 0, .28);
    font: inherit;
    font-size: 13px;
    box-sizing: border-box;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79, 140, 255, .12); }
.input:disabled { opacity: .6; }
.color-input { min-height: 44px; padding: 5px 8px; cursor: pointer; }
select.input option { color: #111827; }

.checkbox-field {
    display: flex;
    align-items: center;
    align-self: end;
    gap: 9px;
    min-height: 42px;
    color: var(--text);
    font-size: 13px;
}
.checkbox-field input { width: 17px; height: 17px; accent-color: var(--accent); }

.permission-message,
.page-message,
.modal-message {
    padding: 13px 16px;
    border: 1px solid rgba(248, 113, 113, .4);
    border-radius: 10px;
    color: #fecaca;
    background: rgba(248, 113, 113, .1);
    font-size: 14px;
    line-height: 1.6;
}
.permission-message { margin-bottom: 20px; text-align: center; }
.page-message.is-ok,
.modal-message.is-ok {
    color: #bbf7d0;
    border-color: rgba(52, 211, 153, .4);
    background: rgba(52, 211, 153, .1);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, .72);
}
.modal-panel {
    width: min(680px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #101829;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .55);
}
.modal-panel-small { width: min(460px, 100%); }
.modal-panel h2 { margin-bottom: 22px; }
.modal-panel form { display: grid; gap: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-message { margin: 0; }

@media (max-width: 800px) {
    body { padding: 20px 12px; }
    .config-card { padding: 24px 18px; }
    .config-layout { grid-template-columns: 1fr; }
    .side-nav { flex-direction: row; }
    .nav-item { flex: 1; text-align: center; }
    .form-grid { grid-template-columns: 1fr; }
    .section-heading { align-items: flex-start; flex-direction: column; }
}
