/* Page loader */
#pageLoader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 250, 252, 0.72);
    backdrop-filter: blur(4px);
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

#pageLoader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

#pageLoader .page-loader-spinner {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 3px solid #fed7aa;
    border-top-color: var(--kv-orange-dark);
    animation: page-loader-spin 0.7s linear infinite;
}

@keyframes page-loader-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Sidebar overlay */
.sidebar-overlay {
    z-index: 1035;
    background: rgba(2, 6, 23, 0.45);
    backdrop-filter: blur(4px);
}

/* Tables */
.col-title {
    min-width: 13.75rem;
}

.col-actions {
    width: 6.25rem;
}

/* Profile */
.profile-form-card {
    max-width: 36rem;
}

/* Color preset swatches */
.color-picker-preset[data-color="#8B5CF6"] { background-color: #8B5CF6; }
.color-picker-preset[data-color="#F59E0B"] { background-color: #F59E0B; }
.color-picker-preset[data-color="#6366F1"] { background-color: #6366F1; }
.color-picker-preset[data-color="#10B981"] { background-color: #10B981; }
.color-picker-preset[data-color="#EC4899"] { background-color: #EC4899; }
.color-picker-preset[data-color="#EF4444"] { background-color: #EF4444; }
.color-picker-preset[data-color="#06B6D4"] { background-color: #06B6D4; }
.color-picker-preset[data-color="#14B8A6"] { background-color: #14B8A6; }
.color-picker-preset[data-color="#3B82F6"] { background-color: #3B82F6; }
.color-picker-preset[data-color="#64748B"] { background-color: #64748B; }
.color-picker-preset[data-color="#0EA5E9"] { background-color: #0EA5E9; }
.color-picker-preset[data-color="#A855F7"] { background-color: #A855F7; }
.color-picker-preset[data-color="#F97316"] { background-color: #F97316; }
.color-picker-preset[data-color="#84CC16"] { background-color: #84CC16; }
.color-picker-preset[data-color="#E11D48"] { background-color: #E11D48; }
.color-picker-preset[data-color="#0F172A"] { background-color: #0F172A; }

/* Select2 */
.select2-container--bootstrap-5 .select2-selection {
    min-height: 31px;
    font-size: 0.875rem;
}

.select2-container--bootstrap-5 .select2-selection--multiple {
    min-height: 31px;
    padding: 0.15rem 0.35rem;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    padding: 0;
    margin: 0;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin: 0;
    padding: 0.05rem 0.4rem 0.05rem 0.15rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.3;
    border-radius: 999px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #c2410c;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove {
    width: 1rem;
    height: 1rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 999px;
    font-size: 0.85rem;
    line-height: 1;
    color: #ea580c;
    background: transparent;
    order: -1;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__remove:hover {
    background: #ffedd5;
    color: #9a3412;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__choice__display {
    padding: 0;
    cursor: default;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-search {
    margin: 0;
    min-height: auto;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-search .select2-search__field {
    margin: 0;
    height: 1.35rem;
    min-height: 1.35rem;
    font-size: 0.8rem;
    line-height: 1.35rem;
}

.select2-container--bootstrap-5 .select2-dropdown .select2-results__option {
    font-size: 0.82rem;
    padding: 0.35rem 0.65rem;
}

/* SEO counters */
.seo-count.is-warn {
    color: #b45309;
}

.seo-count.is-over {
    color: #dc2626;
}

/* Summernote */
.note-editor.note-frame,
.note-editor.note-airframe {
    border-radius: 0.75rem;
    border-color: #e2e8f0;
}

.note-editor .note-toolbar {
    background: #f8fafc;
    border-bottom-color: #eef2f7;
    border-radius: 0.75rem 0.75rem 0 0;
}

.note-editor .note-statusbar {
    background: #f8fafc;
    border-radius: 0 0 0.75rem 0.75rem;
}

.note-editor.note-frame.fullscreen,
.note-editor.note-frame:focus-within {
    border-color: #fb923c;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12);
}

#articleBody {
    display: none;
}

/* Login */
.login-page {
    min-height: 100vh;
    font-family: var(--bs-body-font-family);
    background:
        radial-gradient(ellipse 70% 50% at 50% -10%, rgba(249, 115, 22, 0.28), transparent 55%),
        radial-gradient(ellipse 45% 35% at 90% 100%, rgba(14, 165, 233, 0.14), transparent 50%),
        linear-gradient(160deg, #0b1220 0%, #1e293b 45%, #020617 100%);
}

.login-card {
    width: 100%;
    max-width: 380px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.15rem;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
    overflow: hidden;
}

.login-card .card-body {
    padding: 1.75rem 1.5rem 1.5rem;
}

.login-header {
    margin-bottom: 1.35rem;
}

.login-brand-mark,
.login-brand-logo {
    width: 36px;
    height: 36px;
    margin-bottom: 0.75rem;
}

.login-brand-mark {
    border-radius: 10px;
    background: linear-gradient(135deg, var(--kv-orange), var(--kv-orange-dark));
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(var(--bs-primary-rgb), 0.28);
}

.login-brand-logo {
    object-fit: contain;
    border-radius: 8px;
}

.login-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--kv-ink);
    margin: 0 0 0.2rem;
}

.login-subtitle {
    font-size: 0.8125rem;
    color: #64748b;
    margin: 0;
    line-height: 1.45;
}

.login-card .form-label {
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
}

.login-alert {
    --bs-alert-padding-y: 0.4rem;
    --bs-alert-padding-x: 0.65rem;
    padding: 0.4rem 0.65rem;
    margin-bottom: 0.85rem;
    border-radius: 0.5rem;
    font-size: 0.78rem;
    line-height: 1.35;
    box-shadow: none;
}

.login-field {
    position: relative;
    display: block;
}

.login-field-icon {
    position: absolute;
    left: 12px;
    top: 0;
    bottom: 0;
    width: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.9rem;
    pointer-events: none;
    z-index: 3;
}

.login-card .login-input {
    height: 40px;
    padding: 0.4rem 0.85rem 0.4rem 2.35rem;
    border-radius: 0.65rem;
    border-color: #e2e8f0;
    background-color: #f8fafc;
    box-shadow: none;
    font-size: 0.875rem;
}

.login-card .login-input-password {
    padding-right: 2.5rem;
}

.login-card .login-input:focus {
    background-color: #fff;
    border-color: #fb923c;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.login-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: #94a3b8;
    border-radius: 0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    box-shadow: none;
    z-index: 3;
}

.login-toggle:hover,
.login-toggle:focus-visible {
    color: #475569;
    background: #eef2f7;
}

.login-submit {
    height: 40px;
    border-radius: 0.65rem;
    font-size: 0.875rem;
    padding: 0.4rem 1rem;
    box-shadow: 0 5px 14px rgba(249, 115, 22, 0.22);
}

.login-submit:hover {
    box-shadow: 0 7px 16px rgba(249, 115, 22, 0.28);
}
