/* shared.sa design layer. Loaded last on every layout.
   Identity: the folder tab. Flat navy and royal surfaces, amber only for the upload action and the active item. */

:root {
    --ds-navy: var(--secondaryColor, #002369);
    --ds-royal: var(--primaryColor, #0045ad);
    --ds-amber: #f5a623;
    --ds-amber-ink: #2e1f00;
    --ds-paper: #f2f5fb;
    --ds-surface: #ffffff;
    --ds-ink: #0e1e3f;
    --ds-muted: #4e5f7c;
    --ds-line: #d6e0f0;
    --ds-line-strong: #a9bad6;
    --ds-tint: #e8effb;
    --ds-link: var(--ds-royal);
    --ds-on-navy: #ffffff;
    --ds-on-navy-soft: #c9d7f2;
    --ds-ok: #0b7a4f;
    --ds-warn: #9a5f00;
    --ds-danger: #b3261e;
    --ds-r-surface: 14px;
    --ds-r-control: 9px;
    --ds-font-body: "Cairo", "Segoe UI", Tahoma, sans-serif;
    --ds-font-display: "Cairo", "Segoe UI", Tahoma, sans-serif;
    --ds-tab-w: 118px;
    --ds-tab-h: 13px;
}

/* Arabic is always Cairo. English pages use IBM Plex Sans, which has no Arabic letters, so any Arabic on them still falls through to Cairo. */
html:not([dir="rtl"]):not([lang^="ar"]) {
    --ds-font-body: "IBM Plex Sans", "Cairo", "Segoe UI", sans-serif;
    --ds-font-display: "IBM Plex Sans", "Cairo", "Segoe UI", sans-serif;
}

[data-theme="dark"] {
    --ds-navy: #0a1a44;
    --ds-paper: #081230;
    --ds-surface: #0f1d42;
    --ds-ink: #e9effb;
    --ds-muted: #a9b8d4;
    --ds-line: #24365f;
    --ds-line-strong: #3d527f;
    --ds-tint: #16285a;
    --ds-link: #8db4f5;
    --ds-ok: #4fd19b;
    --ds-warn: #f2bb5c;
    --ds-danger: #ff8d85;
}

/* Type and canvas */
html body {
    font-family: var(--ds-font-body) !important;
    font-size: 16px;
    line-height: 1.65;
    color: var(--ds-ink);
    background: var(--ds-paper);
    -webkit-font-smoothing: antialiased;
}

html body h1, html body h2, html body h3, html body h4, html body h5, html body h6,
html body .h1, html body .h2, html body .h3, html body .h4, html body .h5, html body .h6 {
    font-family: var(--ds-font-display);
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.3;
    color: inherit;
}

html body input, html body select, html body textarea, html body button, html body .btn,
html body .tooltip, html body .popover, html body .dropdown-menu, html body .modal-content {
    font-family: var(--ds-font-body);
}

html body a:not(.btn):not(.page-link):not([class*="btn"]):not([class*="chip"]):not([class*="tab"]):not([class*="badge"]):not([class*="sidebar"]):not([class*="nav-"]):not([class*="fb-"]):not(.post-section):not(.link-white):not(.dropdown-item) {
    color: var(--ds-link);
}
html body a.post-section, html body a.link-white { color: #fff; }
/* Links on the red maintenance strip in the admin panel */
html body .ops-admin-strip a { color: #fff !important; }

html body :focus-visible {
    outline: 3px solid var(--ds-amber);
    outline-offset: 2px;
}

html body .text-muted { color: var(--ds-muted) !important; }

/* Buttons */
html body .btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 1.05rem;
    border-radius: var(--ds-r-control);
    font-weight: 600;
    box-shadow: none !important;
    transform: none !important;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

html body .btn-sm { min-height: 34px; padding: 0.25rem 0.7rem; font-size: 0.85rem; }
html body .btn-lg { min-height: 50px; padding: 0.6rem 1.5rem; font-size: 1.05rem; }

html body .btn.btn-primary, html body.admin-shell .btn.btn-primary {
    background: var(--ds-royal) !important;
    border: 1px solid var(--ds-royal) !important;
    color: #fff !important;
    background-image: none !important;
    opacity: 1 !important;
}

html body .btn.btn-primary:hover, html body .btn.btn-primary:focus,
html body.admin-shell .btn.btn-primary:hover, html body.admin-shell .btn.btn-primary:focus {
    background: var(--ds-navy) !important;
    border-color: var(--ds-navy) !important;
}

html body .btn.btn-secondary, html body .btn.btn-light, html body .btn.btn-outline-secondary {
    background: var(--ds-surface) !important;
    border: 1px solid var(--ds-line-strong) !important;
    color: var(--ds-ink) !important;
}

html body .btn.btn-secondary:hover, html body .btn.btn-light:hover, html body .btn.btn-outline-secondary:hover {
    background: var(--ds-tint) !important;
}

html body .btn.btn-outline-primary {
    background: transparent !important;
    border: 1px solid var(--ds-royal) !important;
    color: var(--ds-link) !important;
}

html body .btn.btn-outline-primary:hover {
    background: var(--ds-royal) !important;
    color: #fff !important;
}

/* Forms */
html body .form-control, html body .form-select, html body .select2-container--bootstrap-5 .select2-selection {
    min-height: 44px;
    border: 1px solid var(--ds-line-strong);
    border-radius: var(--ds-r-control);
    background-color: var(--ds-surface);
    color: var(--ds-ink);
    box-shadow: none;
}

html body textarea.form-control { min-height: 96px; }
html body .form-control-sm, html body .form-select-sm { min-height: 36px; }

html body .form-control:focus, html body .form-select:focus {
    border-color: var(--ds-royal);
    box-shadow: 0 0 0 3px rgba(0, 69, 173, 0.2);
}

html body .form-control::placeholder { color: var(--ds-muted); opacity: 0.85; }
html body .form-label { font-weight: 600; font-size: 0.9rem; color: var(--ds-ink); }

html body .form-check-input:checked {
    background-color: var(--ds-royal);
    border-color: var(--ds-royal);
}

/* Surfaces */
html body .card {
    background: var(--ds-surface);
    border: 1px solid var(--ds-line) !important;
    border-radius: var(--ds-r-surface);
    box-shadow: none !important;
    color: var(--ds-ink);
}

html body .card-header {
    background: transparent;
    border-bottom: 1px solid var(--ds-line);
    font-family: var(--ds-font-display);
    font-weight: 600;
}

html body .card-footer { background: transparent; border-top: 1px solid var(--ds-line); }
html body .shadow-sm, html body .shadow, html body .shadow-lg { box-shadow: none !important; }

/* Tables */
html body .table { color: var(--ds-ink); --bs-table-bg: transparent; }
html body .table > thead > tr > th {
    background: var(--ds-tint);
    color: var(--ds-ink);
    border-bottom: 1px solid var(--ds-line);
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
}
html body .table > tbody > tr > * { border-color: var(--ds-line); vertical-align: middle; }
html body .table-hover > tbody > tr:hover > * { background: var(--ds-tint); --bs-table-accent-bg: transparent; color: var(--ds-ink); }

/* Small parts */
html body .badge { border-radius: 6px; font-weight: 600; padding: 0.32em 0.6em; }

html body .alert {
    border-radius: var(--ds-r-control);
    border: 1px solid var(--ds-line);
    border-inline-start: 4px solid var(--ds-royal);
    background: var(--ds-surface);
    color: var(--ds-ink);
}
html body .alert-danger { border-inline-start-color: var(--ds-danger); }
html body .alert-warning { border-inline-start-color: var(--ds-amber); }
html body .alert-success { border-inline-start-color: var(--ds-ok); }

html body .modal-content, html body .dropdown-menu {
    background: var(--ds-surface);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-r-surface);
    color: var(--ds-ink);
}
html body .dropdown-menu { box-shadow: 0 10px 28px rgba(0, 25, 75, 0.16); padding: 0.4rem; }
html body .dropdown-item { border-radius: 7px; color: var(--ds-ink); padding: 0.5rem 0.7rem; }
html body .dropdown-item:hover { background: var(--ds-tint); color: var(--ds-ink); }
html body .dropdown-item.active { background: var(--ds-royal); color: #fff; }

html body .page-link {
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-color: var(--ds-line);
    background: var(--ds-surface);
    color: var(--ds-link);
}
html body .page-item.active .page-link { background: var(--ds-royal); border-color: var(--ds-royal); color: #fff; }

html body .progress { background: var(--ds-tint); border-radius: 99px; }
html body .progress-bar { background: var(--ds-royal); }
html body .accordion-item { background: var(--ds-surface); border: 1px solid var(--ds-line) !important; border-radius: var(--ds-r-control) !important; margin-bottom: 0.6rem; overflow: hidden; }
html body .accordion-button { background: var(--ds-surface); color: var(--ds-ink); font-weight: 600; box-shadow: none; }
html body .accordion-button:not(.collapsed) { background: var(--ds-tint); color: var(--ds-ink); }

/* The folder tab */
.ds-folder,
html body .fb-upload-card-shell,
html body .user-dashboard .udash-hero,
html body .fb-auth-card,
html body .ops-hero {
    position: relative;
    overflow: visible !important;
    margin-top: var(--ds-tab-h);
    border-start-start-radius: 0 !important;
}

.ds-folder::before,
html body .fb-upload-card-shell::before,
html body .user-dashboard .udash-hero::before,
html body .fb-auth-card::before,
html body .ops-hero::before {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    inset: auto !important;
    inset-block-end: calc(100% - 1px) !important;
    inset-inline-start: 0 !important;
    width: var(--ds-tab-w) !important;
    height: var(--ds-tab-h) !important;
    background: inherit !important;
    background-color: inherit !important;
    border: 0 !important;
    border-radius: 0 !important;
    opacity: 1 !important;
    transform: none !important;
    clip-path: polygon(0 100%, 0 0, 84% 0, 100% 100%);
}

html[dir="rtl"] .ds-folder::before,
html[dir="rtl"] body .fb-upload-card-shell::before,
html[dir="rtl"] body .user-dashboard .udash-hero::before,
html[dir="rtl"] body .fb-auth-card::before,
html[dir="rtl"] body .ops-hero::before {
    clip-path: polygon(100% 100%, 100% 0, 16% 0, 0 100%);
}

/* Public header */
html body .fb-header.fb-header-pro,
html body .fb-header.fb-header-pro.active,
html body .header.v3 .fb-header.fb-header-pro {
    background: var(--ds-navy) !important;
    background-image: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: none !important;
}

html body .fb-header.fb-header-pro.fb-header.fb-header-pro .fb-header-accent { display: none !important; }

/* Public heroes */
html body .page-slider { background-color: var(--ds-navy); }
html body .swiper-bg { opacity: 0.25; }

html body .fb-page-header,
html body .header.v2,
html body .header.fb-page-header {
    background: var(--ds-navy) !important;
    background-image: none !important;
}

html body .fb-page-header::before, html body .fb-page-header::after { display: none !important; }
html body .fb-page-header-badge { display: none !important; }

html body .fb-page-header-inner { padding-block: 2.4rem 3rem; }
html body.fb-public-page .page-title {
    font-family: var(--ds-font-display);
    font-size: clamp(1.7rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #fff !important;
    text-shadow: none;
}
html body.fb-public-page .page-title::after { display: none !important; }

html body .fb-page-main { background: var(--ds-paper); }
html body .page-card, html body .fb-page-shell {
    background: var(--ds-surface);
    border: 1px solid var(--ds-line);
    border-radius: var(--ds-r-surface);
    box-shadow: none !important;
}

/* Upload card on the home page */
html body .fb-upload-card-glow, html body .fb-upload-frame { display: none !important; }

html body .fb-upload-card-shell {
    background: var(--ds-surface) !important;
    border: 1px solid var(--ds-line) !important;
    border-radius: var(--ds-r-surface) !important;
    border-start-start-radius: 0 !important;
    box-shadow: none !important;
}

/* The upload card is the first thing on the page: the hero only gives it a navy edge to overlap */
html body .page-slider:not(.page-slider--banner) .header-content { min-height: 0 !important; padding: 0 !important; height: clamp(3.5rem, 7vw, 5.5rem) !important; overflow: hidden; }
html body .page-slider:not(.page-slider--banner) .header-content .container { display: none !important; }
html body .page-slider:not(.page-slider--banner) > header.header { min-height: 9.5rem !important; height: 9.5rem !important; }
html body .page-slider:not(.page-slider--banner) .swiper { display: none !important; }
html body .fb-upload-card-section { position: relative; z-index: 2; margin-top: clamp(-3.25rem, -5vw, -2.25rem) !important; }
html body .fb-upload-shapes, html body .fb-upload-tray-badge, html body .fb-upload-card-icon-ring { display: none !important; }
html body .fb-upload-card-icon { background: var(--ds-tint) !important; background-image: none !important; box-shadow: none !important; border: 0 !important; color: var(--ds-link) !important; animation: none !important; }
html body .fb-upload-card-icon svg, html body .fb-upload-card-icon svg * { animation: none !important; }
html body .fb-upload-card-title { font-family: var(--ds-font-display); font-weight: 700; color: var(--ds-ink) !important; }
html body .fb-upload-card-eyebrow { color: var(--ds-link) !important; letter-spacing: 0; text-transform: none; }
html body .fb-upload-card-text { color: var(--ds-muted) !important; }
html body .fb-upload-card-tray { background: var(--ds-tint) !important; background-image: none !important; border: 1px dashed var(--ds-line-strong) !important; border-radius: var(--ds-r-control) !important; box-shadow: none !important; }

html body .fb-upload-card-shell .btn.btn-primary,
html body .fb-upload-card-shell .btn.btn-primary:hover {
    background: var(--ds-amber) !important;
    border-color: var(--ds-amber) !important;
    color: var(--ds-amber-ink) !important;
    background-image: none !important;
    font-size: 1.05rem;
    min-height: 52px;
}

html body .fb-upload-card-shell .btn.btn-primary:hover { background: #e39612 !important; border-color: #e39612 !important; }

/* The banner sits in a flex header and its slides are absolute, so without a width it collapses to nothing */
html body .page-slider--banner .fb-header-banner { width: 100% !important; flex: 1 1 100% !important; min-height: 400px; }
@media (max-width: 575.98px) { html body .page-slider--banner .fb-header-banner { min-height: 440px; } }

/* The banner text starts transparent and waits for an entrance animation; it must show even when that never runs */
html body:not(#ds) .fb-header-banner-slide .fb-banner-title,
html body:not(#ds) .fb-header-banner-slide .fb-banner-subtitle,
html body:not(#ds) .fb-header-banner-slide .fb-banner-cta { opacity: 1; transform: none; animation: none !important; }
html body .fb-header-banner-gradient { animation: none !important; opacity: 1 !important; }
html body .fb-banner-title { font-family: var(--ds-font-display); font-weight: 700; color: #fff !important; }
html body .fb-banner-subtitle { color: var(--ds-on-navy-soft) !important; }
html body .fb-header-banner-content { padding: 6.5rem 1rem 5rem !important; }
html body .fb-banner-cta .btn { background: #fff !important; background-image: none !important; border-color: #fff !important; color: var(--ds-navy) !important; box-shadow: none !important; }
/* The generic primary hover paints the button navy, which hid its navy label on the banner */
html body .fb-banner-cta .btn.btn-primary:hover, html body .fb-banner-cta .btn.btn-primary:focus, html body .fb-banner-cta .btn.btn-primary:active {
    background: #e8effb !important; border-color: #e8effb !important; color: var(--ds-navy) !important; opacity: 1 !important;
}
html body .fb-banner-cta .btn.btn-primary:focus-visible { outline: 2px solid #fff !important; outline-offset: 3px; }

/* Home sections */
html body .section-content.bg { background: var(--ds-surface) !important; }
html body .section-content.bg-primary { background: var(--ds-navy) !important; background-image: none !important; }

html body .fb-feature-inner, html body .feature, html body .post, html body .plan, html body .plan-card {
    background: var(--ds-surface) !important;
    background-image: none !important;
    border: 1px solid var(--ds-line) !important;
    border-radius: var(--ds-r-surface) !important;
    box-shadow: none !important;
    transform: none !important;
    transition: border-color 0.15s ease;
}

html body .fb-feature-inner:hover, html body .feature:hover, html body .post:hover, html body .plan:hover, html body .plan-card:hover {
    border-color: var(--ds-royal) !important;
    transform: none !important;
    box-shadow: none !important;
}

html body .fb-feature-inner::before, html body .fb-feature-inner::after,
html body .feature::before, html body .feature::after { display: none !important; }

html body .fb-feature-icon {
    background: var(--ds-tint) !important;
    color: var(--ds-link) !important;
    border-radius: 11px !important;
    box-shadow: none !important;
    transform: none !important;
    animation: none !important;
}

html body .faa-bounce.animated { animation: none !important; }

/* Footer */
html body .fb-footer {
    background: var(--ds-navy) !important;
    background-image: none !important;
}

html body .fb-footer-accent, html body .fb-footer-frame { display: none !important; }

html body .fb-footer-brand {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding-inline: 0 !important;
}

html body .fb-footer-heading::after { background: var(--ds-amber) !important; }

html body .fb-trust-card {
    background: rgba(255, 255, 255, 0.07);
    border-radius: 11px;
}

/* Sign in and sign up */
html body.fb-auth-page { background: var(--ds-paper); }
html body .fb-auth-decor { display: none !important; }
html body .fb-auth-main { background: var(--ds-paper) !important; background-image: none !important; }
html body .fb-auth-main *:not(.spinner-border) { animation: none !important; }

html body.fb-auth-page .fb-auth-card,
html body .fb-auth-card {
    width: min(100%, 460px);
    max-width: 460px;
    padding: 2rem 1.9rem !important;
    background: var(--ds-surface) !important;
    background-image: none !important;
    border: 1px solid var(--ds-line) !important;
    border-radius: var(--ds-r-surface) !important;
    border-start-start-radius: 0 !important;
    box-shadow: none !important;
    opacity: 1 !important;
    transform: none !important;
    overflow: visible !important;
}

html body.fb-auth-page .fb-auth-card.fb-auth-card--wide,
html body .fb-auth-card.fb-auth-card--wide { width: min(100%, 680px); max-width: 680px; }

/* On the pale page the tab reads as a navy folder label on a white sheet. */
html body.fb-auth-page .fb-auth-card::before,
html body .fb-auth-card::before {
    content: "" !important;
    position: absolute !important;
    inset: auto !important;
    inset-block-end: 100% !important;
    inset-inline-start: -1px !important;
    width: var(--ds-tab-w) !important;
    height: var(--ds-tab-h) !important;
    background: var(--ds-navy) !important;
    background-image: none !important;
}

html body.fb-auth-page .fb-auth-card::after,
html body .fb-auth-card::after { display: none !important; }

html body .fb-frame { display: none !important; }
html body.fb-auth-page .fb-auth-card .fb-auth-badge, html body .fb-auth-badge { display: none !important; }
html body.fb-auth-page .fb-auth-card .fb-auth-brand, html body .fb-auth-brand { margin-bottom: 0.35rem; display: block !important; text-align: start !important; }
html body.fb-auth-page .fb-auth-card .fb-auth-brand-name, html body .fb-auth-brand-name { color: var(--ds-link) !important; font-weight: 600; font-size: 0.92rem; margin: 0; text-align: start !important; }
html body .sign-form, html body.fb-auth-page .fb-auth-card .sign-form-header, html body .sign-form-header { padding: 0 !important; border: 0 !important; background: transparent !important; box-shadow: none !important; text-align: start !important; }
html body.fb-auth-page .fb-auth-card .sign-form-title, html body .sign-form-title { font-family: var(--ds-font-display); font-weight: 700; font-size: 1.6rem !important; line-height: 1.3; margin-bottom: 0.25rem; }
html body.fb-auth-page .fb-auth-card .sign-form-text, html body .sign-form-text { color: var(--ds-muted) !important; margin-bottom: 1.25rem; }
html body.fb-auth-page .fb-auth-card .form-control, html body.fb-auth-page .fb-auth-card .form-select { min-height: 48px; border: 1px solid var(--ds-line-strong) !important; border-radius: var(--ds-r-control) !important; background: var(--ds-surface) !important; box-shadow: none !important; font-size: 1rem; }
html body.fb-auth-page .fb-auth-card .form-control:focus, html body.fb-auth-page .fb-auth-card .form-select:focus { border-color: var(--ds-royal) !important; box-shadow: 0 0 0 3px rgba(0, 69, 173, 0.18) !important; }
html body.fb-auth-page .fb-auth-card .btn.btn-primary.btn-lg,
html body.fb-auth-page .fb-auth-card button.btn.btn-primary {
    width: 100%;
    min-height: 48px;
    border-radius: var(--ds-r-control) !important;
    box-shadow: none !important;
    font-family: var(--ds-font-display);
    font-weight: 600 !important;
    transform: none !important;
}

/* Member area */
html body .dash-navbar {
    background: var(--ds-surface) !important;
    background-image: none !important;
    border-bottom: 1px solid var(--ds-line);
    box-shadow: none !important;
    backdrop-filter: none !important;
}

html body .dash-navbar .logo, html body .dash-navbar .logo a, html body .dash-brand-name { color: var(--ds-ink) !important; }

html body .dash-sidebar {
    background: var(--ds-navy) !important;
    background-image: none !important;
    box-shadow: none !important;
    border: 0 !important;
}

html body .dash-sidebar .dash-sidebar-link,
html body .dash-sidebar .dash-sidebar-link-title,
html body .dash-sidebar .dash-sidebar-section { color: var(--ds-on-navy-soft) !important; }

html body .dash-sidebar .dash-sidebar-link {
    background: transparent !important;
    border-radius: 9px;
    box-shadow: none !important;
    transform: none !important;
}

html body .dash-sidebar .dash-sidebar-link:hover { background: rgba(255, 255, 255, 0.08) !important; color: #fff !important; }

html body .dash-sidebar .dash-sidebar-link.current,
html body .dash-sidebar .dash-sidebar-link.active {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 var(--ds-amber) !important;
}

html[dir="rtl"] body .dash-sidebar .dash-sidebar-link.current,
html[dir="rtl"] body .dash-sidebar .dash-sidebar-link.active { box-shadow: inset -3px 0 0 var(--ds-amber) !important; }

html body .dash-sidebar .dash-sidebar-link.current *,
html body .dash-sidebar .dash-sidebar-link.active * { color: #fff !important; }

html body .dash-storage { background: rgba(255, 255, 255, 0.07) !important; border: 0 !important; color: var(--ds-on-navy-soft) !important; }
html body .dash-storage * { color: inherit !important; }
html body .dash-storage-progress, html body .dash-storage .progress { background: rgba(255, 255, 255, 0.16) !important; }
html body .dash-storage .progress-bar { background: var(--ds-amber) !important; }

html body .dash-body, html body .dash-container, html body .dash-page-body { background: var(--ds-paper) !important; background-image: none !important; }
html body .dash-page-title { font-family: var(--ds-font-display); font-weight: 700; color: var(--ds-ink) !important; }
html body .dash-page-footer { background: transparent !important; border-top: 1px solid var(--ds-line); box-shadow: none !important; }

html body .user-dashboard .udash-hero {
    background: var(--ds-navy) !important;
    background-image: none !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: var(--ds-r-surface) !important;
    color: #fff;
}

html body .user-dashboard .udash-stat, html body .user-dashboard .udash-action {
    background: var(--ds-surface) !important;
    background-image: none !important;
    border: 1px solid var(--ds-line) !important;
    border-radius: var(--ds-r-surface) !important;
    box-shadow: none !important;
    transform: none !important;
}

html body .user-dashboard .udash-stat::before { display: none !important; }
html body .user-dashboard .udash-stat:hover, html body .user-dashboard .udash-action:hover { border-color: var(--ds-royal) !important; }

/* The top bar is navy like the public header: its icons and search are drawn in white */
html body .dash.dash-shell .dash-navbar {
    background: var(--ds-navy) !important;
    background-image: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14) !important;
}

html body .dash.dash-shell .dash-navbar .logo,
html body .dash.dash-shell .dash-navbar .logo a,
html body .dash.dash-shell .dash-brand-name { color: #fff !important; }
html body .dash.dash-shell .dash-navbar .dash-nav-link { color: #fff !important; }
html body .dash.dash-shell .dash-navbar .search-input input { color: #fff !important; background: transparent !important; }
html body .dash.dash-shell .dash-navbar .search-input input::placeholder { color: var(--ds-on-navy-soft) !important; }

html body .dash.dash-shell .dash-sidebar .dash-sidebar-container {
    background: var(--ds-navy) !important;
    background-image: none !important;
    border: 0 !important;
    box-shadow: none !important;
}

html body .dash.dash-shell .dash-sidebar-section { color: var(--ds-on-navy-soft) !important; letter-spacing: 0; text-transform: none; font-size: 0.8rem; }
html body .dash.dash-shell .dash-sidebar .dash-sidebar-links .dash-sidebar-link { background: transparent !important; box-shadow: none !important; }
html body .dash.dash-shell .dash-sidebar .dash-sidebar-links .dash-sidebar-link .dash-sidebar-link-title { border-radius: var(--ds-r-control); background: transparent; box-shadow: none; }
html body .dash.dash-shell .dash-sidebar .dash-sidebar-links .dash-sidebar-link .dash-sidebar-link-title i { background: transparent !important; color: var(--ds-on-navy-soft) !important; box-shadow: none !important; }
html body .dash.dash-shell .dash-sidebar .dash-sidebar-links .dash-sidebar-link:hover .dash-sidebar-link-title { background: rgba(255, 255, 255, 0.08) !important; }

html body .dash.dash-shell .dash-sidebar .dash-sidebar-links .dash-sidebar-link.current .dash-sidebar-link-title {
    background: rgba(255, 255, 255, 0.12) !important;
    background-image: none !important;
    box-shadow: inset 3px 0 0 var(--ds-amber) !important;
    color: #fff !important;
}

html[dir="rtl"] body .dash.dash-shell .dash-sidebar .dash-sidebar-links .dash-sidebar-link.current .dash-sidebar-link-title { box-shadow: inset -3px 0 0 var(--ds-amber) !important; }
html body .dash.dash-shell .dash-sidebar .dash-sidebar-links .dash-sidebar-link.current .dash-sidebar-link-title i { color: var(--ds-amber) !important; }
html body .dash.dash-shell .dash-sidebar-footer { background: transparent !important; border-top: 1px solid rgba(255, 255, 255, 0.14) !important; }
html body .dash.dash-shell .dash-storage { background: transparent !important; padding-inline: 0; }

html body .dash.dash-shell .dash-storage .btn.btn-primary {
    background: #fff !important;
    background-image: none !important;
    color: var(--ds-navy) !important;
    box-shadow: none !important;
}

/* Amber marks the upload action, everywhere it appears */
html body .btn[data-upload-btn],
html body .btn:has(> .fa-cloud-upload-alt),
html body .user-dashboard .udash-action:has(.fa-cloud-upload-alt) .udash-action-icon {
    background: var(--ds-amber) !important;
    background-image: none !important;
    border-color: var(--ds-amber) !important;
    color: var(--ds-amber-ink) !important;
    box-shadow: none !important;
}

html body .btn[data-upload-btn] *,
html body .btn:has(> .fa-cloud-upload-alt) *,
html body .user-dashboard .udash-action:has(.fa-cloud-upload-alt) .udash-action-icon * { color: var(--ds-amber-ink) !important; }
html body .btn[data-upload-btn]:hover, html body .btn:has(> .fa-cloud-upload-alt):hover { background: #e09213 !important; }

html body .btn.btn-gradient {
    background: var(--ds-surface) !important;
    background-image: none !important;
    border: 1px solid var(--ds-line-strong) !important;
    color: var(--ds-ink) !important;
    box-shadow: none !important;
}

html body .dash.dash-shell .dash-navbar .dash-nav-link.v2 { display: inline-flex; align-items: center; gap: 0.45rem; }
html body .dash.dash-shell .dash-navbar .language-icon i { margin: 0 !important; }
html body .breadcrumb-item + .breadcrumb-item { padding-inline-start: 0.45rem; }
html body .breadcrumb-item + .breadcrumb-item::before { float: none; padding-inline-end: 0.45rem; padding-inline-start: 0; }
html body .user-dashboard .udash-action-icon { background: var(--ds-tint) !important; background-image: none !important; color: var(--ds-link) !important; box-shadow: none !important; }
html body .user-dashboard .udash-action-icon * { color: inherit !important; }

/* Hero text sits on navy */
html body .user-dashboard .udash-hero-brand { color: var(--ds-on-navy-soft) !important; }
html body .user-dashboard .udash-hero-title,
html body .user-dashboard .udash-hero-title span { color: #fff !important; background: none !important; -webkit-text-fill-color: #fff !important; font-family: var(--ds-font-display); }
html body .user-dashboard .udash-hero::after { display: none !important; }

/* Page heroes inside the two panels are plain surfaces; only the home screens carry the tab */
html body .ufiles-hero, html body .uspaces-hero, html body .upacks-hero, html body .ulan-hero,
html body .fr-hero, html body .tw-hero, html body .su-hero, html body .tpl-gallery-hero,
html body .inv-style-hero, html body .inv-list-hero, html body .cron-hub-hero {
    background: var(--ds-surface) !important;
    background-image: none !important;
    border: 1px solid var(--ds-line) !important;
    border-radius: var(--ds-r-surface) !important;
    box-shadow: none !important;
    color: var(--ds-ink) !important;
    animation: none !important;
}

html body .ufiles-hero::before, html body .uspaces-hero::before, html body .upacks-hero::before, html body .ulan-hero::before,
html body .fr-hero::before, html body .tw-hero::before, html body .su-hero::before, html body .tpl-gallery-hero::before,
html body .inv-style-hero::before, html body .inv-list-hero::before, html body .cron-hub-hero::before,
html body .ufiles-hero::after, html body .uspaces-hero::after, html body .upacks-hero::after, html body .ulan-hero::after,
html body .fr-hero::after, html body .tw-hero::after, html body .su-hero::after, html body .tpl-gallery-hero::after,
html body .inv-style-hero::after, html body .inv-list-hero::after, html body .cron-hub-hero::after { display: none !important; }

/* The files hero only repeats the page title unless it names an open folder */
html body .user-files .ufiles-hero:not(:has(.ufiles-hero-sub)) { display: none !important; }

/* compat.css sets the body to full width, which slides content under the fixed sidebar */
@media (min-width: 1200px) {
    html body .dash .dash-body {
        width: calc(100% - 260px) !important;
        max-width: none !important;
        margin-inline-start: 260px !important;
        margin-inline-end: 0 !important;
    }

    html body .dash.toggle .dash-body { width: 100% !important; margin-inline-start: 0 !important; }
}

/* Stat cards are one white surface whichever colour class they carry, so their numbers stay readable */
html body.admin-shell .vironeer-counter-card[class*="bg-"],
html body.admin-shell .admin-users-stats .vironeer-counter-card[class*="bg-"] {
    background: var(--ds-surface) !important;
    background-image: none !important;
    border: 1px solid var(--ds-line) !important;
    color: var(--ds-ink) !important;
}

html body.admin-shell .vironeer-counter-card[class*="bg-"] .vironeer-counter-card-title,
html body.admin-shell .admin-users-stats .vironeer-counter-card[class*="bg-"] .vironeer-counter-card-title { color: var(--ds-muted) !important; }
html body.admin-shell .vironeer-counter-card[class*="bg-"] .vironeer-counter-card-number,
html body.admin-shell .admin-users-stats .vironeer-counter-card[class*="bg-"] .vironeer-counter-card-number { color: var(--ds-ink) !important; font-family: var(--ds-font-display); }
html body.admin-shell .vironeer-counter-card[class*="bg-"] small { color: var(--ds-muted) !important; }
html body.admin-shell .vironeer-counter-card[class*="bg-"] .vironeer-counter-card-icon { background: var(--ds-tint) !important; background-image: none !important; color: var(--ds-link) !important; box-shadow: none !important; }
html body.admin-shell .vironeer-counter-card[class*="bg-"] .vironeer-counter-card-icon i { color: var(--ds-link) !important; }

/* A collapsed submenu takes no space, so it no longer draws a dark bar between items */
html body.admin-shell .vironeer-sidebar .vironeer-sidebar-menu .vironeer-sidebar-links .vironeer-sidebar-link .vironeer-sidebar-link-menu {
    background: transparent !important;
    margin: 0 !important;
    padding-block: 0 !important;
}

html body.admin-shell .vironeer-page-content .vironeer-page-header .vironeer-user-menu .vironeer-user { padding-block: 0 !important; border: 0 !important; background: transparent !important; }
html body.admin-shell .vironeer-page-content .vironeer-page-header .vironeer-user-menu .vironeer-user img { width: 36px; height: 36px; border: 0 !important; border-radius: 50%; }

/* Long form controls stay inside the phone width */
html body textarea, html body .CodeMirror { max-width: 100%; }

/* On a phone the top bar keeps its icons; the site preview link gives up its place, and long page titles wrap */
@media (max-width: 575.98px) {
    html body.admin-shell .vironeer-page-header .button { display: none !important; }
    html body.admin-shell .h3.text-ellipsis { white-space: normal !important; overflow: visible !important; }
}

html body .fb-feature-glow { display: none !important; }

/* This was a soft fade; flattened to one colour it shows as a tinted block behind the features */
html body .fb-features-section::before { display: none !important; }

/* compat.css gives every image height:auto, which cancels the height the markup asks for and blows logos and avatars up */
html body.admin-shell .vironeer-page-content .card img,
html body.admin-shell .vironeer-page-content .file-preview-box img { max-height: 180px; max-width: 100%; object-fit: contain; }
html body.admin-shell .vironeer-page-content .card img:not([width]),
html body.admin-shell .vironeer-page-content .file-preview-box img:not([width]) { width: auto; }

/* Card headers are one quiet surface; colour classes from the old panel no longer paint them black or blue */
html body.admin-shell .card > .card-header[class*="bg-"],
html body .dash-body .card > .card-header[class*="bg-"] {
    background: var(--ds-surface) !important;
    background-image: none !important;
    border-bottom: 1px solid var(--ds-line) !important;
    color: var(--ds-ink) !important;
}

html body.admin-shell .card > .card-header[class*="bg-"] *,
html body .dash-body .card > .card-header[class*="bg-"] * { color: var(--ds-ink) !important; }

/* Admin panel */
html body.admin-shell .admin-dashboard .adash-hero {
    position: relative;
    margin-top: var(--ds-tab-h);
    background: var(--ds-navy) !important;
    background-image: none !important;
    border: 0 !important;
    border-radius: var(--ds-r-surface) !important;
    border-start-start-radius: 0 !important;
    box-shadow: none !important;
    animation: none !important;
    overflow: visible !important;
}

html body.admin-shell .admin-dashboard .adash-hero::before {
    content: "" !important;
    position: absolute !important;
    inset: auto !important;
    inset-block-end: calc(100% - 1px) !important;
    inset-inline-start: 0 !important;
    width: var(--ds-tab-w) !important;
    height: var(--ds-tab-h) !important;
    background: var(--ds-navy) !important;
    border: 0 !important;
    border-radius: 0 !important;
    opacity: 1 !important;
    transform: none !important;
    clip-path: polygon(0 100%, 0 0, 84% 0, 100% 100%);
}

html[dir="rtl"] body.admin-shell .admin-dashboard .adash-hero::before {
    clip-path: polygon(100% 100%, 100% 0, 16% 0, 0 100%);
}

/* Counter tiles: tint instead of gradient panels */
html body.admin-shell .vironeer-counter-card {
    color: var(--ds-ink) !important;
}

html body.admin-shell .vironeer-counter-card * { color: inherit; }
html body.admin-shell .vironeer-counter-card::before, html body.admin-shell .vironeer-counter-card::after { display: none !important; }

html body.admin-shell .vironeer-counter-card .vironeer-counter-card-icon,
html body.admin-shell .vironeer-counter-card [class*="-icon"] {
    background: var(--ds-tint) !important;
    background-image: none !important;
    color: var(--ds-link) !important;
    border: 0 !important;
    box-shadow: none !important;
}

html body.admin-shell .breadcrumb-item + .breadcrumb-item { padding-inline-start: 0.45rem; }
html body.admin-shell .breadcrumb-item + .breadcrumb-item::before { float: none; padding-inline-end: 0.45rem; padding-inline-start: 0; }

html body.admin-shell .vironeer-sidebar-links-cont { background: transparent !important; border-color: rgba(255, 255, 255, 0.12) !important; }
html body.admin-shell .vironeer-sidebar-links-cont::before, html body.admin-shell .vironeer-sidebar-links-cont::after { background: rgba(255, 255, 255, 0.12) !important; height: 1px !important; }
html body.admin-shell .vironeer-sidebar-header { background: transparent !important; border-color: rgba(255, 255, 255, 0.12) !important; box-shadow: none !important; }

html body.admin-shell { background: var(--ds-paper) !important; background-image: none !important; color: var(--ds-ink); }

html body.admin-shell .vironeer-sidebar {
    background: var(--ds-navy);
    background-image: none;
    box-shadow: none;
    border: 0;
}

html body.admin-shell .vironeer-sidebar .vironeer-sidebar-link { box-shadow: none; }

html body.admin-shell .vironeer-sidebar .vironeer-sidebar-link > .vironeer-sidebar-link-title,
html body.admin-shell .vironeer-sidebar .vironeer-sidebar-link-title { color: var(--ds-on-navy-soft); background: transparent; }

html body.admin-shell .vironeer-sidebar .vironeer-sidebar-link.current > .vironeer-sidebar-link-title {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #fff !important;
    border-radius: 9px;
    box-shadow: inset 3px 0 0 var(--ds-amber) !important;
}

html[dir="rtl"] body.admin-shell .vironeer-sidebar .vironeer-sidebar-link.current > .vironeer-sidebar-link-title {
    box-shadow: inset -3px 0 0 var(--ds-amber) !important;
}

html body.admin-shell .vironeer-page-header {
    background: var(--ds-surface) !important;
    background-image: none !important;
    border-bottom: 1px solid var(--ds-line);
    box-shadow: none !important;
    backdrop-filter: none !important;
}

html body.admin-shell .vironeer-page-content { background: transparent !important; }

html body.admin-shell .vironeer-counter-card,
html body.admin-shell .vironeer-box,
html body.admin-shell .vironeer-random-list {
    background: var(--ds-surface) !important;
    background-image: none !important;
    border: 1px solid var(--ds-line) !important;
    border-radius: var(--ds-r-surface) !important;
    box-shadow: none !important;
    transform: none !important;
}

html body.admin-shell .vironeer-box-header { background: transparent !important; border-bottom: 1px solid var(--ds-line); }
html body.admin-shell .vironeer-box-header-title { font-family: var(--ds-font-display); font-weight: 600; color: var(--ds-ink); }
html body.admin-shell .vironeer-footer { background: transparent !important; border-top: 1px solid var(--ds-line); box-shadow: none !important; color: var(--ds-muted); }

html body.admin-auth { background: var(--ds-navy) !important; background-image: none !important; }
html body.admin-auth .vironeer-sign-form {
    background: var(--ds-surface) !important;
    border: 0 !important;
    border-radius: var(--ds-r-surface) !important;
    box-shadow: none !important;
}

/* Dark mode: surfaces that hard-code light backgrounds */
[data-theme="dark"] body .fb-upload-card-shell { box-shadow: none !important; }

@media (max-width: 767px) {
    html body .btn { min-height: 44px; }
    html body .btn-sm { min-height: 38px; }
    :root { --ds-tab-w: 92px; --ds-tab-h: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    html body *, html body *::before, html body *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Motion. One entrance on the home page, ending with the arrow of the upload icon rising, and one answer to a held file.
   Keyframes only give a start: the resting state is the normal style, so nothing can stay hidden. */
@keyframes ds-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes ds-arrow-rise { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: no-preference) {
    html body:not(#ds) .fb-header-banner-slide.is-active .fb-banner-title { animation: ds-rise 0.56s cubic-bezier(0.22, 1, 0.36, 1) backwards !important; }
    html body:not(#ds) .fb-header-banner-slide.is-active .fb-banner-subtitle { animation: ds-rise 0.56s cubic-bezier(0.22, 1, 0.36, 1) 0.09s backwards !important; }
    html body:not(#ds) .fb-header-banner-slide.is-active .fb-banner-cta { animation: ds-rise 0.56s cubic-bezier(0.22, 1, 0.36, 1) 0.18s backwards !important; }
    html body:not(#ds) .fb-upload-card { animation: ds-rise 0.56s cubic-bezier(0.22, 1, 0.36, 1) 0.26s backwards !important; }
    html body:not(#ds) .fb-upload-card-icon .fb-upload-svg path:nth-child(2) { animation: ds-arrow-rise 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.62s backwards !important; }
    html body:not(#ds) #dropzone > .dz-preview { animation: ds-rise 0.32s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
}

html body .uploadbox .uploadbox-body .uploadbox-body-content .uploadbox-drag { transition: background-color 0.18s ease, border-color 0.18s ease; }
html body .uploadbox .uploadbox-body .uploadbox-body-content .uploadbox-drag-inner i { transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.18s ease; }
html body .uploadbox .uploadbox-body .uploadbox-body-content .uploadbox-drag.is-dragover {
    background: var(--ds-tint) !important;
    background-image: none !important;
    border-color: var(--ds-amber) !important;
    border-style: solid !important;
}
html body .uploadbox .uploadbox-body .uploadbox-body-content .uploadbox-drag.is-dragover .uploadbox-drag-inner i { color: var(--ds-amber) !important; transform: translateY(-8px) scale(1.12); }
html body .uploadbox .uploadbox-body .uploadbox-body-content .uploadbox-drag-inner .uploadbox-drag-release { display: none; }
html body .uploadbox .uploadbox-body .uploadbox-body-content .uploadbox-drag.is-dragover .uploadbox-drag-inner h3:not(.uploadbox-drag-release) { display: none; }
html body .uploadbox .uploadbox-body .uploadbox-body-content .uploadbox-drag.is-dragover .uploadbox-drag-inner .uploadbox-drag-release { display: block; }
html body .uploadbox .uploadbox-body .uploadbox-body-content .uploadbox-drag.is-dragover .uploadbox-drag-inner p { visibility: hidden; }
html body .dropzone.dz-drag-hover { outline: 2px dashed var(--ds-amber); outline-offset: 6px; border-radius: var(--ds-r-control); }

/* The sheet window spans the page, so the wide results stage must not narrow it and leave it off centre */
html body .uploadbox[data-uw-style="sheet"].uw-has-results .uploadbox-content,
html body .uploadbox[data-uw-style="sheet"].active:has(.uploadbox-drag.inactive) .uploadbox-content { width: 100% !important; max-width: 100% !important; }

html[data-theme="dark"] body .uploadbox .uploadbox-content,
html[data-theme="dark"] body .uploadbox .uploadbox-header,
html[data-theme="dark"] body .uploadbox .uploadbox-body { background: var(--ds-surface) !important; color: var(--ds-ink); border-color: var(--ds-line) !important; }
html[data-theme="dark"] body .uploadbox .btn-close { filter: invert(1) brightness(2); opacity: 0.85; }

/* Dark mode: brand text lightens, the upload action keeps its amber, and the desktop menu has no sheet behind it */
html[data-theme="dark"] body:not(#ds),
html[data-theme="dark"] body.fb-public-page,
html[data-theme="dark"] body .fb-page-main,
html[data-theme="dark"] body .section-content { background-color: var(--ds-paper) !important; }
html[data-theme="dark"] body .section-content.bg { background-color: var(--ds-surface) !important; }
html[data-theme="dark"] body .fb-upload-card-shell { background: var(--ds-surface) !important; }
html[data-theme="dark"] body .fb-upload-card-tray { background: var(--ds-tint) !important; }

html[data-theme="dark"] body .dash.dash-shell .dash-page-header .btn[data-upload-btn],
html[data-theme="dark"] body .btn[data-upload-btn],
html[data-theme="dark"] body .btn:has(> .fa-cloud-upload-alt) {
    background: var(--ds-amber) !important;
    background-image: none !important;
    border-color: var(--ds-amber) !important;
    color: var(--ds-amber-ink) !important;
}

html[data-theme="dark"] body .user-dashboard .udash-action-icon { background: var(--ds-tint) !important; color: var(--ds-link) !important; }
html[data-theme="dark"] body .user-dashboard .udash-action:has(.fa-cloud-upload-alt) .udash-action-icon { background: var(--ds-amber) !important; color: var(--ds-amber-ink) !important; }
html[data-theme="dark"] body .user-dashboard .udash-stat i { color: var(--ds-link) !important; }

@media (min-width: 992px) {
    html body .fb-header .nav-bar-links.fb-nav-links { background: transparent !important; }
}

/* The public header is navy on every page, whatever state its old stylesheets assume */
html body .fb-header.fb-header-pro.fb-header.fb-header-pro .logo,
html body .fb-header.fb-header-pro.fb-header.fb-header-pro .logo a,
html body .fb-header.fb-header-pro [class*="brand-name"] { color: #fff !important; }

@media (min-width: 992px) {
    html body .fb-header.fb-header-pro.fb-header.fb-header-pro .fb-nav-link,
    html body .fb-header.fb-header-pro.fb-header.fb-header-pro .fb-nav-item,
    html body .fb-header.fb-header-pro.fb-header.fb-header-pro .fb-nav-item > button,
    html body .fb-header.fb-header-pro.fb-header.fb-header-pro .fb-nav-item i,
    html body .fb-header.fb-header-pro.fb-header.fb-header-pro .fb-theme-toggle,
    html body .fb-header.fb-header-pro.fb-header.fb-header-pro .language-icon,
    html body .fb-header.fb-header-pro.fb-header.fb-header-pro .language-arrow { color: #fff !important; }
    html body .fb-header.fb-header-pro.fb-header.fb-header-pro .fb-nav-link.active { color: var(--ds-amber) !important; }
}

html body .fb-header.fb-header-pro.fb-header.fb-header-pro .btn.btn.fb-btn-signin {
    background: transparent !important;
    background-image: none !important;
    border: 1px solid rgba(255, 255, 255, 0.55) !important;
    color: #fff !important;
    box-shadow: none !important;
}

html body .fb-header.fb-header-pro.fb-header.fb-header-pro .btn.btn.fb-btn-signup {
    background: #fff !important;
    background-image: none !important;
    border: 1px solid #fff !important;
    color: var(--ds-navy) !important;
    box-shadow: none !important;
}

/* Library and developer pages: same flat hero, no glow, readable actions */
html body .public-library .plib-hero, html body .developers-page .dev-hero { background: var(--ds-navy) !important; background-image: none !important; box-shadow: none !important; }
html body .public-library .plib-hero-glow, html body .developers-page .dev-hero-glow { display: none !important; }
html body .public-library .plib-btn-primary, html body .developers-page .dev-btn-solid { background: var(--ds-royal) !important; background-image: none !important; color: #fff !important; }
html body .public-library .plib-btn-primary *, html body .developers-page .dev-btn-solid * { color: #fff !important; }
html body .developers-page .dev-btn-primary { background: #fff !important; background-image: none !important; color: var(--ds-navy) !important; }
html body .developers-page .dev-btn-primary * { color: var(--ds-navy) !important; }
html body .developers-page .dev-btn-ghost { background: transparent !important; border: 1px solid rgba(255, 255, 255, 0.55) !important; color: #fff !important; }
html body .developers-page .dev-btn-ghost * { color: #fff !important; }
html body .public-library .plib-chip.is-active, html body .developers-page .dev-tab.is-active { background: var(--ds-royal) !important; background-image: none !important; border-color: var(--ds-royal) !important; color: #fff !important; }

/* Selected rows in side lists keep readable text */
html body .list-group-item.active, html body .list-group-item.active * { color: #fff !important; }

/* Bigger stat boxes on the member page in the admin panel follow the stat cards */
html body.admin-shell .vironeer-counter-box[class*="bg-"] {
    background: var(--ds-surface) !important;
    background-image: none !important;
    border: 1px solid var(--ds-line) !important;
    border-radius: var(--ds-r-surface) !important;
    box-shadow: none !important;
    color: var(--ds-ink) !important;
}

html body.admin-shell .vironeer-counter-box[class*="bg-"] * { color: var(--ds-ink) !important; }
html body.admin-shell .vironeer-counter-box[class*="bg-"] .vironeer-counter-box-title { color: var(--ds-muted) !important; font-size: 0.95rem; font-weight: 500; }
html body.admin-shell .vironeer-counter-box[class*="bg-"] p,
html body.admin-shell .vironeer-counter-box[class*="bg-"] .vironeer-counter-box-number { font-family: var(--ds-font-display); }
html body.admin-shell .vironeer-counter-box[class*="bg-"] .vironeer-counter-box-icon { color: var(--ds-tint) !important; opacity: 1; }
html body.admin-shell .vironeer-counter-box[class*="bg-"] .vironeer-counter-box-icon * { color: var(--ds-tint) !important; }

/* Switches: flat fill, plain white handle */
html body .toggle.btn .toggle-handle { background: #fff !important; border-color: #fff !important; box-shadow: none !important; }

/* Amber and yellow actions always carry dark text */
html body .btn.btn-warning, html body a.btn.btn-warning { color: var(--ds-amber-ink) !important; }
html[data-theme="dark"] body .fb-upload-card-tray a { color: var(--ds-link) !important; }

/* Dark admin top bar */
html[data-theme="dark"] body.admin-shell .h3,
html[data-theme="dark"] body.admin-shell .vironeer-user-menu .vironeer-user * { color: var(--ds-ink) !important; }
html[data-theme="dark"] body.admin-shell .vironeer-page-header .btn,
html[data-theme="dark"] body.admin-shell .vironeer-page-header button,
html[data-theme="dark"] body.admin-shell .vironeer-page-header .vironeer-sibebar-icon,
html[data-theme="dark"] body.admin-shell .vironeer-page-header .vironeer-notifications-title { background: var(--ds-surface) !important; color: var(--ds-ink) !important; border-color: var(--ds-line-strong) !important; }
html[data-theme="dark"] body.admin-shell .vironeer-page-header i { color: var(--ds-ink) !important; }
html body.admin-shell .vironeer-counter-box[class*="bg-"] .vironeer-counter-box-icon { display: none !important; }

/* Long page lists wrap, otherwise they widen the whole page on a phone */
html body .pagination { flex-wrap: wrap; row-gap: 0.35rem; }

/* The admin stylesheet pins every <footer> to the page bottom; the invoice footer belongs to the document */
html body .inv-doc__footer { position: static; display: block; height: auto; width: auto; padding: 1.25rem 0 0; }

/* The header stays navy when scrolled and on solid pages, so the menu icon stays white in those states too */
html body .fb-header.fb-header-pro.fb-header.fb-header-pro .fb-menu-toggle { background: rgba(255, 255, 255, 0.1) !important; border-color: rgba(255, 255, 255, 0.3) !important; color: #fff !important; }
@media (max-width: 991.98px) { html body .fb-header.fb-header-pro .nav-bar-actions { margin-inline-start: auto !important; margin-inline-end: 0 !important; } }

/* Dark mode for the parts that keep light colours from Bootstrap or the admin stylesheet */
html body .breadcrumb-item.active { color: var(--ds-muted); }
[data-theme="dark"] body.admin-shell h1, [data-theme="dark"] body.admin-shell h2, [data-theme="dark"] body.admin-shell h3, [data-theme="dark"] body.admin-shell h4, [data-theme="dark"] body.admin-shell h5, [data-theme="dark"] body.admin-shell h6, [data-theme="dark"] body.admin-shell .vironeer-box-header-title { color: var(--ds-ink) !important; }
[data-theme="dark"] body .pagination .page-item .page-link { background-color: var(--ds-surface); border-color: var(--ds-line); color: var(--ds-ink); }
[data-theme="dark"] body .pagination .page-item.active .page-link { background-color: var(--ds-royal); border-color: var(--ds-royal); color: #fff; }
[data-theme="dark"] body .pagination .page-item.disabled .page-link { background-color: var(--ds-tint); border-color: var(--ds-line); color: var(--ds-muted); }
[data-theme="dark"] body .input-group-text { background-color: var(--ds-tint); border-color: var(--ds-line); color: var(--ds-ink); }
[data-theme="dark"] body .list-group-item { background-color: var(--ds-surface); border-color: var(--ds-line); color: var(--ds-ink); }
[data-theme="dark"] body .alert { background-color: var(--ds-tint) !important; color: var(--ds-ink) !important; }
[data-theme="dark"] body .alert a { color: var(--ds-link) !important; }
html body .breadcrumb .breadcrumb-item.active { color: var(--ds-muted) !important; }
[data-theme="dark"] body .bg-light, [data-theme="dark"] body .bg-white { background-color: var(--ds-tint) !important; }
[data-theme="dark"] body .text-dark:not(.badge):not(.bg-warning) { color: var(--ds-ink) !important; }

/* The public header is navy in every state, including on the plans page */
html body .fb-header.fb-header-pro .fb-user-menu { background: rgba(255, 255, 255, 0.1) !important; border-color: rgba(255, 255, 255, 0.3) !important; }
html body .fb-header.fb-header-pro .fb-user-menu > .user-name, html body .fb-header.fb-header-pro .fb-user-menu > .nav-bar-user-dropdown-icon { color: #fff !important; }

/* Status colours strong enough for their text */
html body .badge.bg-success, html body .btn-green.toggle-on, html body .badge.tw-badge-wa { background-color: #0b7a4f !important; border-color: #0b7a4f !important; color: #fff !important; }
html body .badge.bg-green, html body .btn.btn-green:not(.toggle-off), html body .counter-card.color-1 { background-color: #0b7a4f !important; border-color: #0b7a4f !important; color: #fff !important; }
html body .btn.btn-green:not(.toggle-off):hover { background-color: #096640 !important; border-color: #096640 !important; }
html body .badge.bg-warning { color: var(--ds-amber-ink) !important; }
html body .badge.bg-info { color: #062a33 !important; }
html body .btn.btn-outline-warning { color: var(--ds-amber-ink) !important; border-color: #a87a00 !important; }
html body .btn.btn-outline-info { color: #0a6c85 !important; border-color: #0a6c85 !important; }
[data-theme="dark"] body .btn.btn-outline-warning { color: var(--ds-warn) !important; border-color: var(--ds-warn) !important; }
[data-theme="dark"] body .btn.btn-outline-info { color: #7fd6ea !important; border-color: #7fd6ea !important; }
html body .btn.btn-outline-warning:hover { color: var(--ds-amber-ink) !important; }
html body .btn.btn-outline-info:hover { color: #062a33 !important; }
html body .pagination .page-item.disabled .page-link { color: var(--ds-muted); }

[data-theme="dark"] body .fb-header.fb-header-pro .fb-nav-upload { background: #fff !important; }

/* The member transactions table can be wider than the space beside the sidebar */
html body .transactions-table .table { overflow-x: auto; }

/* An invoice is a paper document in either theme */
[data-theme="dark"] body .inv-doc {
    --inv-ink: #0f1c33; --inv-muted: #5a6a82; --inv-neutral: #4a5568; --inv-line: rgba(0, 69, 173, 0.14); --inv-soft: #eef5ff; --inv-panel: #ffffff;
    --inv-ok: #0d7a4f; --inv-ok-bg: #e8f7f0; --inv-warn: #b86e00; --inv-warn-bg: #fff4e0; --inv-danger: #c0392b; --inv-danger-bg: #fdecea; --inv-neutral-bg: #eef1f5;
    --ds-ink: #0f1d42; --ds-muted: #4a5672; --ds-line: #d7deec; --ds-tint: #eef3fd; --ds-surface: #ffffff; --ds-link: #0045ad;
    color: #0f1c33;
}
