:root {
    --brand: #dd3333;
    --brand-dark: #b82a2a;
    --brand-rgb: 221, 51, 51;

    /* Re-point Bootstrap's own primary-color variables at the brand color so any
       untouched Bootstrap component (links, focus rings, etc.) inherits it too. */
    --bs-primary: var(--brand);
    --bs-primary-rgb: var(--brand-rgb);
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: var(--brand-rgb);
    --bs-link-hover-color: var(--brand-dark);
    --bs-focus-ring-color: rgba(var(--brand-rgb), .25);
}

body {
    background-color: #f5f6fa;
}

a {
    color: var(--brand);
}

a:hover {
    color: var(--brand-dark);
}

.navbar-brand {
    font-weight: 600;
}

.btn-brand,
.btn-primary {
    background-color: var(--brand);
    border-color: var(--brand);
    color: #fff;
}

.btn-brand:hover,
.btn-brand:focus,
.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--brand-dark);
    border-color: var(--brand-dark);
    color: #fff;
}

.text-primary {
    color: var(--brand) !important;
}

.bg-primary {
    background-color: var(--brand) !important;
}

.border-primary {
    border-color: var(--brand) !important;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .25rem rgba(var(--brand-rgb), .25);
}

.form-check-input:checked {
    background-color: var(--brand);
    border-color: var(--brand);
}

.form-check-input:focus {
    box-shadow: 0 0 0 .25rem rgba(var(--brand-rgb), .25);
}

.page-link {
    color: var(--brand);
}

.page-link:hover {
    color: var(--brand-dark);
}

.page-item.active .page-link {
    background-color: var(--brand);
    border-color: var(--brand);
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--brand);
}

.accordion-button:not(.collapsed) {
    color: var(--brand-dark);
    background-color: rgba(var(--brand-rgb), .08);
}

.accordion-button:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 .25rem rgba(var(--brand-rgb), .25);
}

.card {
    border: 1px solid #eef0f5;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.card-link-hover {
    transition: box-shadow .15s ease, transform .15s ease;
}

.card-link-hover:hover {
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
    transform: translateY(-1px);
}

/* Admin shell */
.admin-sidebar {
    width: 260px;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    background-color: #111827;
    color: #d1d5db;
}

.admin-sidebar .nav-link {
    color: #d1d5db;
    border-radius: .375rem;
}

.admin-sidebar .nav-link:hover {
    background-color: #1f2937;
    color: #fff;
}

.admin-sidebar .nav-link.active {
    background-color: var(--brand);
    color: #fff;
}

.admin-sidebar .navbar-brand {
    color: #fff;
}

.sidebar-logo {
    width: 100%;
    max-width: 190px;
    height: auto;
}

/* Admin table action buttons, styled like the DataTables pagination controls */
.action-pagination .page-link {
    color: #495057;
    padding: .3rem .55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.action-pagination .page-link:hover,
.action-pagination .page-link:focus {
    color: var(--brand);
    background-color: rgba(var(--brand-rgb), .08);
    z-index: 1;
}

.action-pagination .page-link.action-danger:hover,
.action-pagination .page-link.action-danger:focus {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

.admin-sidebar .nav-link {
    position: relative;
    transition: background-color .15s ease, color .15s ease;
}

.admin-sidebar .nav-link.active::before {
    content: "";
    position: absolute;
    left: -.75rem;
    top: .25rem;
    bottom: .25rem;
    width: 3px;
    border-radius: 2px;
    background-color: #fff;
}

.admin-sidebar .nav-section-label {
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6b7280;
    padding: .5rem .75rem .25rem;
}

.admin-content {
    background-color: #f5f6fa;
    min-height: 100vh;
    min-width: 0;
}

.admin-topbar {
    padding: .85rem 1.5rem;
}

.admin-topbar h1 {
    font-size: 1.125rem;
}

.sidebar-toggle {
    color: #fff;
    background: transparent;
    border: none;
    font-size: 1.375rem;
    padding: .25rem .5rem;
    line-height: 1;
}

.sidebar-backdrop {
    display: none;
}

/* Below the lg breakpoint the sidebar becomes an off-canvas panel — fixed,
   off-screen by default, and slid in over the content via .show — instead
   of a static 260px column that would otherwise eat most of a phone screen. */
@media (max-width: 991.98px) {
    .admin-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1045;
        transform: translateX(-100%);
        transition: transform .25s ease;
    }

    .admin-sidebar.show {
        transform: translateX(0);
    }

    .sidebar-backdrop.show {
        display: block;
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, .5);
        z-index: 1044;
    }
}

@media (min-width: 992px) {
    .sidebar-toggle {
        display: none;
    }
}

.topbar-user-toggle {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .25rem .5rem;
    border-radius: .5rem;
    transition: background-color .15s ease;
}

.topbar-user-toggle:hover,
.topbar-user-toggle:focus {
    background-color: rgba(255, 255, 255, .15);
    color: #fff;
}

.topbar-user-toggle .avatar-circle {
    width: 32px;
    height: 32px;
    font-size: .75rem;
    background-color: rgba(255, 255, 255, .2);
    color: #fff;
}

.topbar-user-toggle::after {
    display: none;
}

.topbar-user-role {
    font-size: .7rem;
    color: rgba(255, 255, 255, .75);
}

.topbar-iam-btn {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .6rem;
    border-radius: .5rem;
    font-size: .85rem;
    background-color: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .25);
    transition: background-color .15s ease;
}

.topbar-iam-btn:hover,
.topbar-iam-btn:focus {
    background-color: rgba(255, 255, 255, .22);
    color: #fff;
}

.admin-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    background-color: rgba(255, 255, 255, .12);
    border: 1px solid transparent;
    border-radius: .375rem;
    padding: .3rem .6rem;
    width: 190px;
    transition: width .2s ease, background-color .2s ease, border-color .2s ease;
}

.admin-search:focus-within {
    width: 260px;
    background-color: #fff;
    border-color: rgba(255, 255, 255, .5);
}

.admin-search-icon {
    color: rgba(255, 255, 255, .75);
    font-size: .85rem;
    flex-shrink: 0;
}

.admin-search:focus-within .admin-search-icon {
    color: #9aa0a6;
}

.admin-search-input {
    flex: 1 1 auto;
    background: transparent;
    border: none;
    outline: none;
    box-shadow: none !important;
    color: #fff;
    font-size: .85rem;
    padding: 0;
}

.admin-search-input::placeholder {
    color: rgba(255, 255, 255, .65);
}

.admin-search:focus-within .admin-search-input {
    color: #202124;
}

.admin-search:focus-within .admin-search-input::placeholder {
    color: #9aa0a6;
}

/* Suggestions dropdown for the admin topbar search — a tighter re-skin of
   .ui-autocomplete to match the compact .admin-search box instead of the
   larger public-site search bar it was originally styled for. */
.admin-search-suggestions {
    border-radius: .5rem;
    padding: 4px 0;
}

.admin-search-suggestions .ui-menu-item-wrapper {
    padding: 7px 14px;
    gap: 10px;
    font-size: .8125rem;
}

.admin-search-suggestions .suggest-icon {
    font-size: .8rem;
}

.admin-search-suggestions .suggest-type {
    font-size: .65rem;
}

.admin-search-suggestions .admin-search-empty .ui-menu-item-wrapper {
    color: #9aa0a6;
    cursor: default;
    justify-content: center;
    text-align: center;
}

.admin-search-suggestions .admin-search-skeleton-item .ui-menu-item-wrapper {
    cursor: default;
}

.admin-search-skeleton-icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
}

.admin-search-skeleton-text {
    height: .7rem;
    border-radius: .25rem;
}

.idle-timeout-badge {
    display: inline-flex;
    align-items: center;
    font-size: .75rem;
    color: rgba(255, 255, 255, .85);
    background-color: rgba(255, 255, 255, .12);
    border-radius: .375rem;
    padding: .3rem .55rem;
    white-space: nowrap;
}

/* Dashboard greeting card */
.greeting-card {
    background: linear-gradient(135deg, rgba(var(--brand-rgb), .08), rgba(13, 110, 253, .06));
    border: 1px solid rgba(var(--brand-rgb), .15);
    border-radius: .5rem;
    padding: .45rem .85rem;
}

.greeting-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    flex-shrink: 0;
}

.greeting-card-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.35;
}

.greeting-text {
    font-size: .9rem;
    color: #374151;
}

.greeting-quote {
    font-size: .75rem;
    color: #6b7280;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(28rem, 60vw);
}

.greeting-quote-author {
    font-style: normal;
}

.greeting-wave {
    display: inline-block;
    animation: greeting-wave-motion 1.6s ease-in-out infinite;
    transform-origin: 70% 70%;
}

@keyframes greeting-wave-motion {
    0%, 60%, 100% { transform: rotate(0deg); }
    10%, 30% { transform: rotate(-12deg); }
    20%, 40% { transform: rotate(12deg); }
}

/* Dashboard stat cards */
.stat-card {
    text-decoration: none;
    color: inherit;
    display: block;
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: .65rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-icon-red { background-color: rgba(var(--brand-rgb), .12); color: var(--brand-dark); }
.stat-icon-blue { background-color: rgba(13, 110, 253, .12); color: #0d6efd; }
.stat-icon-teal { background-color: rgba(13, 161, 149, .12); color: #0d9488; }
.stat-icon-amber { background-color: rgba(217, 119, 6, .12); color: #d97706; }
.stat-icon-purple { background-color: rgba(124, 58, 237, .12); color: #7c3aed; }

.stat-icon-sm {
    width: 34px;
    height: 34px;
    font-size: .95rem;
    border-radius: .55rem;
}

.sortable-handle {
    cursor: grab;
    color: #9ca3af;
}

.sortable-placeholder {
    background-color: #eef2ff;
    border: 1px dashed var(--brand);
}

/* Google-style search box */
.google-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    height: 44px;
    padding: 0 16px;
    transition: box-shadow .2s ease, border-color .2s ease;
}

.google-search:hover {
    box-shadow: 0 1px 6px rgba(32, 33, 36, .2);
    border-color: transparent;
}

.google-search:focus-within {
    box-shadow: 0 1px 8px rgba(32, 33, 36, .28);
    border-color: transparent;
}

.google-search-sm {
    height: 36px;
    border-radius: 18px;
    padding: 0 14px;
}

.google-search-icon-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    padding: 0;
    color: #9aa0a6;
    font-size: 1rem;
    flex-shrink: 0;
    cursor: pointer;
}

.google-search-sm .google-search-icon-btn {
    font-size: .9rem;
}

.google-search-icon-btn:hover {
    color: var(--brand);
}

.google-search-input {
    flex: 1 1 auto;
    border: none;
    outline: none;
    box-shadow: none !important;
    background: transparent;
    padding: 0;
    font-size: .95rem;
    color: #202124;
}

.google-search-sm .google-search-input {
    font-size: .875rem;
}

.google-search-input::placeholder {
    color: #9aa0a6;
}

.google-search-input:focus {
    outline: none;
    box-shadow: none !important;
}

.google-search-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border-width: 2px;
    color: var(--brand);
    flex-shrink: 0;
}

.google-search-spinner.is-visible {
    display: inline-block;
}

/* Google-style search suggestions (jQuery UI autocomplete re-skin) */
.ui-autocomplete {
    max-height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 2000;
    list-style: none;
    margin: 4px 0 0;
    padding: 8px 0;
    background: #fff;
    border: 1px solid #dfe1e5;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(32, 33, 36, .12), 0 1px 3px rgba(32, 33, 36, .08);
}

.ui-autocomplete .ui-menu-item {
    padding: 0;
    border: none;
}

.ui-autocomplete .ui-menu-item-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 20px;
    font-size: .95rem;
    line-height: 1.3;
    color: #202124;
    background: none;
    border: none;
    margin: 0;
    cursor: pointer;
}

.ui-autocomplete .ui-menu-item-wrapper.ui-state-active,
.ui-autocomplete .ui-menu-item-wrapper.ui-state-focus {
    background-color: #f1f3f4;
    border: none;
    color: #202124;
}

.ui-autocomplete .suggest-icon {
    color: #9aa0a6;
    font-size: .95rem;
    flex-shrink: 0;
}

.ui-autocomplete .suggest-text {
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ui-autocomplete .suggest-type {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #9aa0a6;
    flex-shrink: 0;
}

/* ---------------------------------------------------------------------
   Help-center layout system (hero, card grid, article/TOC, footer)
   --------------------------------------------------------------------- */

.kb-hero {
    background: radial-gradient(circle at top, #1b232f 0%, #10151c 70%);
    color: #fff;
    padding: 76px 0 92px;
    text-align: center;
}

.kb-eyebrow {
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .75rem;
    font-weight: 700;
    color: var(--brand);
    margin-bottom: .5rem;
}

.kb-hero .kb-eyebrow {
    color: rgba(255, 255, 255, .55);
}

.kb-hero h1 {
    font-weight: 700;
    font-size: 2.25rem;
    margin-bottom: .6rem;
}

.kb-hero p {
    color: rgba(255, 255, 255, .68);
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

.kb-section-heading {
    font-weight: 700;
}

.google-search-lg {
    height: 56px;
    border-radius: 28px;
    padding: 0 22px;
    max-width: 640px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .3);
}

.google-search-lg .google-search-icon-btn {
    font-size: 1.15rem;
}

.google-search-lg .google-search-input {
    font-size: 1.05rem;
}

/* Category / subcategory tiles */
.kb-card {
    display: block;
    background: #fff;
    border: 1px solid #eef0f5;
    border-radius: 14px;
    padding: 28px;
    height: 100%;
    text-decoration: none;
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

.kb-card:hover {
    box-shadow: 0 12px 24px rgba(16, 24, 40, .08);
    transform: translateY(-2px);
    border-color: #dfe3ea;
}

.kb-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(var(--brand-rgb), .1);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin-bottom: 16px;
}

.kb-card h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #202124;
    margin-bottom: 6px;
}

.kb-card p {
    color: #6b7280;
    font-size: .875rem;
    margin-bottom: 12px;
}

/* Article / result list rows (subcategory listing, search results) */
.kb-article-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    border: 1px solid #eef0f5;
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.kb-article-row:hover {
    box-shadow: 0 6px 16px rgba(16, 24, 40, .06);
    border-color: #dfe3ea;
}

.kb-article-row .kb-article-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: rgba(var(--brand-rgb), .1);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: .95rem;
}

.kb-article-row h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #202124;
    margin-bottom: 2px;
}

.kb-article-row p {
    color: #6b7280;
    font-size: .85rem;
    margin-bottom: 4px;
}

.kb-article-row .kb-article-meta {
    color: #9aa0a6;
    font-size: .75rem;
}

/* ---------------------------------------------------------------------
   Public site "Modern showcase" theme (switchable in Admin > Settings >
   Content > Theme). .modern-hero/.modern-card* are shared across every
   public page via the kb-card/kb-article-row components and the layout's
   theme-modern body class; the rest (trending/resources/cta) are home-
   page-specific sections with no classic equivalent. Deliberately
   lighter/airier than .kb-hero/.kb-card so the two themes read as
   visually distinct, not just re-skinned.
   --------------------------------------------------------------------- */

.modern-hero {
    background: linear-gradient(160deg, rgba(var(--brand-rgb), .1), rgba(var(--brand-rgb), 0) 60%), #fff;
    border-bottom: 1px solid #eef0f5;
    padding: 64px 0 56px;
    text-align: center;
}

.modern-hero h1 {
    font-weight: 700;
    font-size: 2.25rem;
    color: #202124;
    margin-bottom: .6rem;
}

.modern-hero p {
    color: #6b7280;
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

.home-modern-body {
    padding: 56px 0 72px;
}

.home-modern-section {
    margin-bottom: 48px;
}

.home-modern-section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
}

.home-modern-section-head h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #202124;
    margin-bottom: 0;
}

.home-modern-view-all {
    font-size: .8125rem;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
}

.home-modern-view-all:hover {
    color: var(--brand-dark);
    text-decoration: underline;
}

.home-modern-trending-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.home-modern-trending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #eef0f5;
    border-radius: 12px;
    text-decoration: none;
    color: #202124;
    font-size: .875rem;
    font-weight: 500;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.home-modern-trending-item:hover {
    box-shadow: 0 6px 16px rgba(16, 24, 40, .06);
    border-color: #dfe3ea;
}

.home-modern-trending-item i {
    color: var(--brand);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.modern-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.modern-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 12px;
    background: #fff;
    border: 1px solid #eef0f5;
    border-radius: 14px;
    text-decoration: none;
    color: #202124;
    font-size: .8125rem;
    font-weight: 600;
    text-align: center;
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

.modern-card:hover {
    box-shadow: 0 12px 24px rgba(16, 24, 40, .08);
    transform: translateY(-2px);
    border-color: #dfe3ea;
}

.modern-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(var(--brand-rgb), .1);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

/* Article/FAQ/attachment rows — modern counterpart of .kb-article-row,
   used wherever <x-kb-article-row> renders across the public site. */
.modern-article-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid #eef0f5;
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.modern-article-row:hover {
    box-shadow: 0 6px 16px rgba(16, 24, 40, .06);
    border-color: #dfe3ea;
}

.modern-article-row h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #202124;
    margin-bottom: 2px;
}

.modern-article-row p {
    color: #6b7280;
    font-size: .85rem;
    margin-bottom: 4px;
}

.modern-article-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(var(--brand-rgb), .1);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

.modern-article-meta {
    color: #9aa0a6;
    font-size: .75rem;
}

/* Page header banner (breadcrumb + title, via the public layout's
   $header slot) — covers categories index/show, subcategory show,
   article show, and the FAQ index in one place. */
body.theme-modern header.bg-white {
    background: linear-gradient(160deg, rgba(var(--brand-rgb), .08), rgba(var(--brand-rgb), 0) 60%), #fff !important;
}

body.theme-modern .breadcrumb-item.active {
    color: #202124;
    font-weight: 600;
}

/* FAQ accordion */
body.theme-modern .kb-faq .accordion-item {
    border: 1px solid #eef0f5;
    border-radius: 12px !important;
    margin-bottom: 10px;
    overflow: hidden;
}

body.theme-modern .kb-faq .accordion-button {
    font-weight: 600;
}

body.theme-modern .kb-faq .accordion-button:not(.collapsed) {
    background-color: rgba(var(--brand-rgb), .06);
    color: var(--brand-dark);
    box-shadow: none;
}

.home-modern-resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.home-modern-resource-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    background: #fff;
    border: 1px solid #eef0f5;
    border-radius: 14px;
}

.home-modern-resource-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(var(--brand-rgb), .1);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.home-modern-resource-title {
    font-weight: 600;
    color: #202124;
    font-size: .875rem;
    margin-bottom: 2px;
}

.home-modern-resource-link {
    font-size: .8125rem;
    color: var(--brand);
    text-decoration: none;
}

.home-modern-resource-link:hover {
    color: var(--brand-dark);
    text-decoration: underline;
}

.home-modern-cta {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    border-radius: 20px;
    padding: 44px 32px;
    text-align: center;
}

.home-modern-cta-content h2 {
    color: #fff;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: .5rem;
}

.home-modern-cta-content p {
    color: rgba(255, 255, 255, .85);
    margin-bottom: 1.25rem;
}

/* Breadcrumb refinement */
.breadcrumb {
    font-size: .8rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "\203A";
    color: #c7cad1;
}

.breadcrumb-item a {
    color: #6b7280;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: var(--brand);
}

.breadcrumb-item.active {
    color: #202124;
    font-weight: 500;
}

/* Article page body + sidebar */
.kb-article-body {
    font-size: 1rem;
    line-height: 1.8;
    color: #333;
}

.kb-article-body h1,
.kb-article-body h2,
.kb-article-body h3,
.kb-article-body h4,
.kb-article-body h5,
.kb-article-body h6 {
    font-weight: 700;
    margin-top: 1.75rem;
    margin-bottom: .75rem;
}

.kb-article-body p {
    margin-bottom: 1rem;
}

.kb-article-body ul,
.kb-article-body ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.kb-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: .5rem 0;
}

.kb-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
    font-size: .9rem;
}

.kb-article-body table th,
.kb-article-body table td {
    border: 1px solid #dfe3ea;
    padding: .5rem .75rem;
}

.kb-article-body table th {
    background: #f5f6fa;
    font-weight: 600;
}

.kb-article-body blockquote {
    border-left: 3px solid var(--brand);
    margin: 1.25rem 0;
    padding: .25rem 0 .25rem 1rem;
    color: #5f6368;
}

.kb-article-body pre {
    background: #f5f6fa;
    border: 1px solid #eef0f5;
    border-radius: 8px;
    padding: 1rem;
    overflow-x: auto;
}

.kb-article-body code {
    background: #f1f3f4;
    border-radius: 4px;
    padding: .15rem .35rem;
    font-size: .875em;
}

.kb-article-body pre code {
    background: none;
    padding: 0;
}

.kb-article-body hr {
    margin: 2rem 0;
    border-color: #eef0f5;
}

.kb-article-body a {
    color: var(--brand);
}

.kb-sidebar-card {
    background: #fff;
    border: 1px solid #eef0f5;
    border-radius: 14px;
    padding: 20px;
}

.kb-sidebar-title {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #9aa0a6;
    font-weight: 700;
    margin-bottom: 12px;
}

.kb-sidebar-card a {
    display: block;
    padding: 8px 0;
    font-size: .875rem;
    color: #5f6368;
    text-decoration: none;
    border-left: 2px solid transparent;
    padding-left: 10px;
}

.kb-sidebar-card a:hover {
    color: var(--brand);
    border-left-color: var(--brand);
}

.kb-sidebar-card a.active {
    color: var(--brand-dark);
    font-weight: 600;
    border-left-color: var(--brand);
}

/* FAQ accordion re-skin */
.kb-faq .accordion-item {
    border: 1px solid #eef0f5;
    border-radius: 12px !important;
    margin-bottom: 10px;
    overflow: hidden;
}

.kb-faq .accordion-button {
    font-weight: 500;
    padding: 16px 20px;
}

.kb-faq .accordion-button:not(.collapsed) {
    box-shadow: none;
}

.kb-faq .accordion-body {
    padding: 4px 20px 20px;
}

/* Footer */
.kb-footer {
    background: #10151c;
    color: rgba(255, 255, 255, .65);
    padding: 48px 0 24px;
    margin-top: 64px;
}

.kb-footer h6 {
    color: #fff;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 14px;
}

.kb-footer p {
    font-size: .85rem;
    max-width: 280px;
}

.kb-footer a {
    color: rgba(255, 255, 255, .65);
    text-decoration: none;
    display: block;
    padding: 4px 0;
    font-size: .875rem;
}

.kb-footer a:hover {
    color: #fff;
}

.kb-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, .1);
    margin-top: 32px;
    padding-top: 20px;
    font-size: .8rem;
    color: rgba(255, 255, 255, .45);
}

/* Global page/operation loading overlay */
.page-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity .2s ease;
}

.page-loader.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.page-loader-spinner {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.page-loader-spinner::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 4px solid rgba(var(--brand-rgb), .15);
    border-top-color: var(--brand);
    animation: page-loader-spin .9s linear infinite;
}

.page-loader img {
    height: 76px;
    position: relative;
}

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

/* Compact DataTables styling to match the admin table look elsewhere */
.dataTables_wrapper {
    font-size: .875rem;
}

.dataTables_length select {
    display: inline-block;
    width: auto;
    padding: .25rem 1.75rem .25rem .5rem;
    font-size: .8125rem;
    border-color: #dee2e6;
    border-radius: .375rem;
}

.dataTables_length label,
.dataTables_info {
    color: #6b7280;
    font-size: .8125rem;
    margin-bottom: 0;
}

table.dataTable thead th {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6b7280;
    font-weight: 700;
    padding: .65rem .75rem;
    white-space: nowrap;
}

table.dataTable tbody td {
    padding: .5rem .75rem;
    font-size: .875rem;
}

table.dataTable thead th.sorting:before,
table.dataTable thead th.sorting:after,
table.dataTable thead th.sorting_asc:before,
table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:before,
table.dataTable thead th.sorting_desc:after {
    font-size: .65rem;
    right: .6em;
    opacity: .35;
}

table.dataTable thead th.sorting_asc:after,
table.dataTable thead th.sorting_desc:before {
    opacity: .9;
    color: var(--brand);
}

.dataTables_wrapper .dataTables_paginate .pagination {
    margin-bottom: 0;
}

.dataTables_wrapper .dataTables_paginate .page-link {
    padding: .3rem .65rem;
    font-size: .8125rem;
}

.dataTables_processing {
    font-size: .8125rem;
    color: #6b7280;
}

.order-input {
    text-align: center;
}

/* Admin create/edit form pages */
.form-page-card {
    border-radius: .75rem;
}

.form-page-card > .card-header {
    background-color: #fff;
    border-bottom: 1px solid #eef0f5;
    padding: .9rem 1.25rem;
}

.form-page-card > .card-header h2 {
    font-size: .9375rem;
    font-weight: 600;
    margin-bottom: .125rem;
}

.form-page-card > .card-header p {
    font-size: .8125rem;
    color: #6b7280;
    margin-bottom: 0;
}

.form-page-card > .card-body {
    padding: 1.25rem;
}

.form-page-card > .card-footer {
    background-color: #fafbfc;
    border-top: 1px solid #eef0f5;
    padding: .9rem 1.25rem;
}

.form-sidebar-card {
    border-radius: .75rem;
}

.form-sidebar-card > .card-header {
    background-color: #fafbfc;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6b7280;
    padding: .6rem 1rem;
}

.form-sidebar-card > .card-body {
    padding: 1rem;
}

.form-sidebar-card > .card-footer {
    background-color: #fafbfc;
    border-top: 1px solid #eef0f5;
    padding: .75rem 1rem;
}

/* Settings page — flat, minimal, row-based layout (no cards, icons, or
   gradients): a plain text nav on the left and a divided list of setting
   rows on the right, each with its label/description on the left and its
   control on the right. */
.settings-shell {
    display: flex;
    gap: 2rem;
}

.settings-nav-col {
    flex: 0 0 200px;
    padding-right: 1.25rem;
    border-right: 1px solid #eef0f5;
}

.settings-content-col {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 680px;
}

.settings-flat-nav {
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.settings-flat-nav-item {
    text-align: left;
    background: none;
    border: none;
    border-radius: .5rem;
    padding: .45rem .75rem;
    font-size: .875rem;
    font-weight: 500;
    color: #374151;
    transition: background-color .15s ease, color .15s ease;
}

.settings-flat-nav-item:hover {
    background-color: #f3f4f6;
}

.settings-flat-nav-item.active {
    background-color: rgba(var(--brand-rgb), .08);
    color: var(--brand-dark);
    font-weight: 600;
}

/* Matches .form-page-card > .card-header h2/p exactly — same heading and
   description treatment used on every other admin create/edit page. */
.settings-section-title {
    font-size: .9375rem;
    font-weight: 600;
    margin-bottom: .125rem;
}

.settings-section-desc {
    font-size: .8125rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

/* Matches .admin-sidebar .nav-section-label — the app's existing pattern
   for a small uppercase grouping label. */
.settings-subheading {
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6b7280;
    padding: .85rem 0 .25rem;
}

.settings-subheading:first-of-type {
    padding-top: 0;
}

.settings-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    padding: .75rem 0;
    border-bottom: 1px solid #f0f1f4;
}

.settings-row:last-child {
    border-bottom: none;
}

.settings-row-info {
    flex: 1 1 260px;
}

.settings-row-info .form-text {
    margin-top: 0;
}

.settings-row-control {
    flex: 0 0 240px;
    max-width: 240px;
}

.settings-row-control.is-wide {
    flex-basis: 320px;
    max-width: 320px;
}

.settings-row-actions {
    display: flex;
    gap: .5rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.settings-save-row {
    display: flex;
    justify-content: flex-end;
    padding-top: 1rem;
}

.settings-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.settings-status-dot.is-live { background-color: #16a34a; }
.settings-status-dot.is-log { background-color: #d97706; }

@media (max-width: 767.98px) {
    .settings-shell {
        flex-direction: column;
        gap: 1.5rem;
    }

    .settings-nav-col {
        flex: 1 1 auto;
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid #eef0f5;
        padding-bottom: 1rem;
    }

    .settings-flat-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .settings-row {
        flex-direction: column;
        gap: .75rem;
    }

    .settings-row-control,
    .settings-row-control.is-wide {
        flex: 1 1 auto;
        max-width: 100%;
        width: 100%;
    }
}

.attachment-list .list-group-item {
    border-left: 0;
    border-right: 0;
    padding: .55rem .1rem;
}

.attachment-list .list-group-item:first-child {
    border-top: 0;
}

.attachment-list .list-group-item:last-child {
    border-bottom: 0;
}

.avatar-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: rgba(var(--brand-rgb), .12);
    color: var(--brand-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .875rem;
    flex-shrink: 0;
}

/* Dashboard chart containers — fixed, compact heights so Chart.js (with
   maintainAspectRatio:false) renders small instead of filling the card. */
.chart-box {
    position: relative;
    height: 190px;
}

.chart-box-sm {
    position: relative;
    height: 160px;
    width: 100%;
}

/* Dashboard chart drill-down modal */
.drilldown-header {
    background: linear-gradient(135deg, rgba(var(--brand-rgb), .06), rgba(var(--brand-rgb), 0));
    border-bottom: 1px solid #eef0f5;
    padding: 1.1rem 1.5rem;
}

.drilldown-header .modal-title {
    font-size: 1.1rem;
    font-weight: 700;
}

.drilldown-header-icon {
    width: 40px;
    height: 40px;
    border-radius: .65rem;
    background-color: rgba(var(--brand-rgb), .12);
    color: var(--brand-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

#drillDownList {
    max-height: 60vh;
    overflow-y: auto;
}

.drilldown-item {
    padding: .75rem 1.5rem;
    transition: background-color .12s ease;
}

.drilldown-item:hover {
    background-color: #fafbfc;
}

.drilldown-item-icon {
    width: 38px;
    height: 38px;
    border-radius: .55rem;
    background-color: rgba(13, 110, 253, .1);
    color: #0d6efd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.drilldown-item-icon.is-published {
    background-color: rgba(25, 135, 84, .1);
    color: #198754;
}

.drilldown-item-icon.is-draft {
    background-color: rgba(108, 117, 125, .12);
    color: #6c757d;
}

.drilldown-item-views {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    color: #6b7280;
    font-size: .8125rem;
    white-space: nowrap;
}

.drilldown-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: #9ca3af;
}

.drilldown-empty i {
    font-size: 2rem;
    display: block;
    margin-bottom: .5rem;
}

/* Article preview dialog */
.article-preview-header {
    background: linear-gradient(135deg, rgba(var(--brand-rgb), .06), rgba(var(--brand-rgb), 0));
    border-bottom: 1px solid #eef0f5;
    padding: 1.25rem 1.5rem;
}

.article-preview-header .modal-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.article-preview-excerpt {
    border-left: 3px solid var(--brand);
    padding: .5rem 0 .5rem 1rem;
    color: #4b5563;
    font-style: italic;
}

.faq-preview-answer {
    white-space: pre-line;
    font-size: 1.05rem;
    line-height: 1.7;
    color: #374151;
}

.article-preview-skeleton-title {
    height: 1.5rem;
    margin-bottom: 1rem;
    border-radius: .375rem;
}

.article-preview-skeleton-chip {
    height: 1.35rem;
    border-radius: 50rem;
}

.article-preview-skeleton-line {
    height: .85rem;
    margin-bottom: .75rem;
    border-radius: .25rem;
}

#articlePreviewContent {
    animation: article-preview-fade-in .2s ease both;
}

@keyframes article-preview-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Attachment preview dialog */
.attachment-preview-header {
    background: linear-gradient(135deg, rgba(var(--brand-rgb), .06), rgba(var(--brand-rgb), 0));
    border-bottom: 1px solid #eef0f5;
    padding: 1.1rem 1.5rem;
}

.attachment-preview-header .modal-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.attachment-preview-icon {
    width: 42px;
    height: 42px;
    border-radius: .65rem;
    background-color: rgba(var(--brand-rgb), .12);
    color: var(--brand-dark);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.attachment-preview-body {
    padding: 0;
}

.attachment-preview-body-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fb;
    background-image: linear-gradient(45deg, #eef0f4 25%, transparent 25%), linear-gradient(-45deg, #eef0f4 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #eef0f4 75%), linear-gradient(-45deg, transparent 75%, #eef0f4 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0;
    padding: 1.5rem;
    max-height: 70vh;
    overflow: auto;
}

.attachment-preview-body-image img {
    max-width: 100%;
    max-height: 65vh;
    object-fit: contain;
    border-radius: .5rem;
    box-shadow: 0 .5rem 1.5rem rgba(17, 24, 39, .12);
    background-color: #fff;
}

.attachment-preview-body-pdf embed {
    display: block;
    width: 100%;
    height: 70vh;
    border: 0;
}

.attachment-preview-body-empty {
    padding: 3.5rem 1.5rem;
    text-align: center;
    color: #6b7280;
}

.attachment-preview-body-empty i {
    font-size: 2.75rem;
    color: rgba(var(--brand-rgb), .35);
    display: block;
    margin-bottom: .75rem;
}

.attachment-thumb-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
}

.attachment-thumb-card {
    width: 110px;
    text-decoration: none;
    color: inherit;
}

.attachment-thumb-card:hover .attachment-thumb-frame {
    border-color: var(--brand);
}

.attachment-thumb-frame {
    width: 110px;
    height: 110px;
    border: 1px solid #e5e7eb;
    border-radius: .5rem;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fb;
    transition: border-color .15s ease;
}

.attachment-thumb-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-thumb-frame embed {
    width: 140%;
    height: 140%;
    pointer-events: none;
}

.attachment-thumb-frame .bi {
    font-size: 2rem;
    color: var(--brand);
}

.attachment-thumb-name {
    font-size: .75rem;
    margin-top: .35rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-thumb-size {
    font-size: .6875rem;
    text-align: center;
    display: block;
    color: #6b7280;
}

/* Auth pages (login/register/forgot-password/etc.) split-screen shell */
.auth-shell {
    min-height: 100vh;
    display: flex;
}

.auth-brand-panel {
    flex: 0 0 44%;
    max-width: 560px;
    padding: 3rem;
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 55%, #6e1919 100%);
}

.auth-brand-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 12% 18%, rgba(255, 255, 255, .14) 0, transparent 45%),
        radial-gradient(circle at 88% 82%, rgba(255, 255, 255, .12) 0, transparent 42%);
}

.auth-brand-logo {
    position: relative;
    z-index: 1;
    display: inline-block;
}

.auth-brand-logo img {
    height: 40px;
}

.auth-brand-copy {
    position: relative;
    z-index: 1;
    max-width: 380px;
}

.auth-brand-copy h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: .75rem;
}

.auth-brand-copy p {
    color: rgba(255, 255, 255, .85);
    margin-bottom: 1.75rem;
}

.auth-brand-features {
    margin: 0;
}

.auth-brand-features li {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-bottom: .85rem;
    font-size: .925rem;
    color: rgba(255, 255, 255, .92);
}

.auth-brand-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: .5rem;
    background: rgba(255, 255, 255, .15);
    flex-shrink: 0;
}

.auth-brand-footer {
    position: relative;
    z-index: 1;
    margin: 0;
    font-size: .8rem;
    color: rgba(255, 255, 255, .6);
}

.auth-brand-footer a {
    color: rgba(255, 255, 255, .85);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, .35);
}

.auth-brand-footer a:hover {
    color: #fff;
}

.auth-form-panel {
    flex: 1 1 auto;
    padding: 2rem 1.5rem;
    background-color: #f7f7fb;
}

.auth-form-wrap {
    width: 100%;
    max-width: 400px;
    animation: auth-fade-up .5s ease both;
}

@keyframes auth-fade-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    background: #fff;
    border-radius: 1rem;
    padding: 2.25rem;
    border: 1px solid rgba(17, 24, 39, .04);
    box-shadow: 0 1rem 3rem rgba(17, 24, 39, .08);
}

.auth-title {
    font-weight: 700;
    margin-bottom: .25rem;
}

.auth-subtitle {
    color: #6b7280;
    margin-bottom: 1.75rem;
}

.auth-input-group .input-group-text {
    background-color: #fff;
    color: #9ca3af;
    border-right: 0;
}

.auth-input-group .form-control {
    border-left: 0;
}

.auth-input-group .form-control:focus {
    box-shadow: none;
}

.auth-input-group:focus-within .input-group-text,
.auth-input-group:focus-within .form-control,
.auth-input-group:focus-within .password-toggle-btn {
    border-color: var(--brand);
}

.auth-input-group:focus-within .input-group-text {
    color: var(--brand);
}

.password-toggle-btn {
    background-color: #fff;
    border: 1px solid var(--bs-border-color);
    border-left: 0;
    color: #9ca3af;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus {
    background-color: #fff;
    color: var(--brand);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: #9ca3af;
    font-size: .8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(17, 24, 39, .08);
}

.auth-divider span {
    padding: 0 .75rem;
}

.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    background-color: #fff;
    border: 1px solid rgba(17, 24, 39, .12);
    color: #3c4043;
    font-weight: 500;
    padding: .55rem 1rem;
    border-radius: .5rem;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.google-signin-btn:hover,
.google-signin-btn:focus {
    box-shadow: 0 1px 3px rgba(17, 24, 39, .12);
    border-color: rgba(17, 24, 39, .2);
    color: #3c4043;
}

@media (max-width: 991.98px) {
    .auth-form-panel {
        background-color: #fff;
    }
}
