body {
    background: #f3f5f7;
    color: #243140;
}

.backend-topbar {
    background: #1b2836;
    border: 0;
}

.backend-topbar .navbar-brand {
    color: #fff;
    font-weight: 600;
}

.backend-login-wrap {
    max-width: 420px;
    margin: 90px auto 0;
}

.backend-shell {
    display: flex;
    min-height: calc(100vh - 50px);
}

.backend-sidebar {
    width: 210px;
    flex: 0 0 210px;
    background: #243447;
    color: #d5deE8;
}

.backend-sidebar a {
    display: block;
    color: #d5dee8;
    padding: 14px 18px;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.backend-sidebar a:hover,
.backend-sidebar a.active {
    background: #1b2836;
    color: #fff;
    border-left-color: #4da3ff;
}

.backend-main {
    flex: 1;
    padding: 22px 24px 40px;
    min-width: 0;
}

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

.page-head h1 {
    margin: 0;
    font-size: 22px;
}

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

.stat-card {
    background: #fff;
    border: 1px solid #e4e8ee;
    border-radius: 4px;
    padding: 16px;
}

.stat-card .num {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
}

.stat-card .label {
    color: #6b7785;
    margin-top: 4px;
}

.panel {
    box-shadow: none;
}

.table > thead > tr > th {
    background: #f7f9fb;
}

.stem-cell {
    max-width: 420px;
    white-space: normal;
    word-break: break-word;
}

.answer-cell {
    max-width: 240px;
    color: #526070;
    white-space: normal;
    word-break: break-word;
}

.row-actions form {
    display: inline-block;
}

.row-actions .btn {
    margin-bottom: 4px;
}

.filter-bar .form-control {
    margin-bottom: 8px;
}

.q-panel {
    border: 1px solid #e4e8ee;
    background: #fbfcfd;
    padding: 12px;
    margin-bottom: 12px;
}

.help-note {
    color: #6b7785;
    margin-bottom: 8px;
}

.status-on {
    color: #1f7a3a;
}

.status-off {
    color: #b35309;
}

.cat-name {
    white-space: nowrap;
}

@media (max-width: 900px) {
    .backend-shell {
        display: block;
    }
    .backend-sidebar {
        width: auto;
    }
    .backend-sidebar a {
        display: inline-block;
    }
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .page-head {
        display: block;
    }
    .page-head .btn,
    .page-head .btn-group {
        margin-top: 8px;
    }
}
