:root {
    --fnp-primary: #6f42c1;
    --fnp-sidebar: #20232a;
    --fnp-bg: #f6f7fb;
}

body {
    background: var(--fnp-bg);
}

.admin-shell {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    background: var(--fnp-sidebar);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex: 0 0 270px;
    min-height: 100vh;
    position: sticky;
    top: 0;
}

.brand {
    align-items: center;
    display: flex;
    gap: .75rem;
    font-weight: 700;
    padding: 1rem;
}

.brand-mark {
    align-items: center;
    background: var(--fnp-primary);
    border-radius: .5rem;
    color: #fff;
    display: inline-flex;
    font-weight: 800;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.admin-sidebar .nav {
    padding: 0 .75rem;
}

.admin-sidebar .nav-link {
    border-radius: .5rem;
    color: rgba(255,255,255,.78);
    padding: .55rem .75rem;
}

.admin-sidebar .nav-link.active,
.admin-sidebar .nav-link:hover {
    background: rgba(255,255,255,.12);
    color: #fff;
}

.admin-main {
    min-width: 0;
    flex: 1;
}

.admin-topbar {
    align-items: center;
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.08);
    display: flex;
    gap: 1rem;
    min-height: 68px;
    padding: .75rem 1.25rem;
}

.btn-primary {
    --bs-btn-bg: var(--fnp-primary);
    --bs-btn-border-color: var(--fnp-primary);
    --bs-btn-hover-bg: #5d35a6;
    --bs-btn-hover-border-color: #5d35a6;
}

.card {
    border-color: rgba(0,0,0,.08);
    border-radius: .5rem;
}

.table {
    vertical-align: middle;
}

.table-admin-compact {
    font-size: .875rem;
}

.table-admin-compact > :not(caption) > * > * {
    padding: .38rem .45rem;
}

.questions-table {
    font-size: .8125rem;
}

.btn-icon {
    align-items: center;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    padding: 0;
    width: 30px;
}

.questions-table .question-title-cell {
    max-width: 220px;
}

.questions-table .question-categories-cell {
    max-width: 150px;
}

.questions-table .question-title-cell,
.questions-table .question-categories-cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-preview-trigger {
    cursor: default;
    position: relative;
}

.media-preview-popover {
    background: #fff;
    border: 1px solid rgba(0,0,0,.14);
    border-radius: .5rem;
    box-shadow: 0 .75rem 2rem rgba(32,35,42,.18);
    color: #212529;
    display: none;
    gap: .5rem;
    left: 0;
    max-width: 420px;
    padding: .5rem;
    position: absolute;
    top: calc(100% + .45rem);
    z-index: 1080;
}

.media-preview-trigger:hover .media-preview-popover,
.media-preview-popover.is-floating {
    display: flex;
}

.media-preview-popover.is-floating {
    position: fixed;
}

.media-preview-popover img,
.media-preview-video {
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    height: 96px;
    object-fit: cover;
    width: 128px;
}

.media-preview-video {
    align-items: center;
    color: #6c757d;
    display: inline-flex;
    justify-content: center;
}

.auth-body {
    background: linear-gradient(135deg, #f6f7fb, #ffffff);
}

.auth-wrap {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}

.auth-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,.08);
    border-radius: .5rem;
    box-shadow: 0 1rem 3rem rgba(32,35,42,.08);
    max-width: 430px;
    padding: 2rem;
    width: 100%;
}

.metric {
    font-size: 1.65rem;
    font-weight: 800;
}

.pre-wrap {
    white-space: pre-wrap;
}

.media-thumb {
    aspect-ratio: 1;
    border: 1px solid #dee2e6;
    border-radius: .375rem;
    height: 44px;
    object-fit: cover;
    width: 44px;
}

.form-label.required::after {
    color: #dc3545;
    content: " *";
    font-weight: 700;
}

.required-mark {
    color: #dc3545;
    font-weight: 800;
}

.media-state {
    align-items: center;
    border: 1px solid #ced4da;
    border-radius: 999px;
    display: inline-flex;
    font-size: .8rem;
    font-weight: 800;
    height: 26px;
    justify-content: center;
    line-height: 1;
    margin-right: .35rem;
    width: 26px;
}

.media-state-none {
    background: #f8f9fa;
    color: #6c757d;
}

.media-state-single {
    background: #e7f1ff;
    border-color: #9ec5fe;
    color: #0d6efd;
}

.media-state-multiple {
    background: #e8f5e9;
    border-color: #a3cfbb;
    color: #146c43;
}

.media-state-video {
    background: #fff3cd;
    border-color: #ffda6a;
    color: #997404;
}

.rich-editor {
    border: 1px solid #ced4da;
    border-radius: .375rem;
    overflow: hidden;
}

.rich-editor-toolbar {
    background: #f8f9fa;
    border-bottom: 1px solid #ced4da;
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    padding: .35rem;
}

.rich-editor-toolbar .btn {
    min-width: 34px;
}

.rich-editor-surface {
    background: #fff;
    border: 0;
    color: #212529;
    line-height: 1.5;
    min-height: 128px;
    padding: .65rem .75rem;
    white-space: pre-wrap;
}

.rich-editor-surface:focus {
    outline: 0;
}

.rich-editor:focus-within {
    border-color: #86b7fe;
    box-shadow: 0 0 0 .25rem rgba(13,110,253,.25);
}

.rich-editor.is-invalid {
    border-color: #dc3545;
}

.rich-editor.is-invalid:focus-within {
    box-shadow: 0 0 0 .25rem rgba(220,53,69,.25);
}

@media (max-width: 991.98px) {
    .admin-sidebar {
        bottom: 0;
        left: -280px;
        position: fixed;
        top: 0;
        transition: left .2s ease;
        z-index: 1040;
    }

    .admin-sidebar.open {
        left: 0;
    }
}
