/*
 * Theme tokens. Dark is the default palette; the light palette is switched in with
 * html[data-theme="light"] (set by the boot script in <head> from the saved choice or the OS setting).
 * Every colour in the site's CSS reads these variables, with the dark value as its fallback.
 */
:root {
    color-scheme: dark;
    --ve-canvas: #0f1012;
    --ve-canvas-rgb: 15, 16, 18;
    --ve-surface: #17181b;
    --ve-surface-rgb: 23, 24, 27;
    --ve-surface-2: #1e2024;
    --ve-raised: #26282d;
    --ve-input: #141518;
    --ve-hover: #1f2024;
    --ve-edge: #34363c;
    --ve-edge-rgb: 52, 54, 60;
    --ve-line: rgba(255, 255, 255, 0.08);
    --ve-line-strong: rgba(255, 255, 255, 0.14);
    --ve-ov: 255, 255, 255;
    --ve-text: #f2f3f5;
    --ve-text-strong: #fff;
    --ve-text-2: #c9ccd2;
    --ve-text-muted: #9b9ea6;
    --ve-text-dim: #8c9099;
    --ve-text-meta: #8f9397;
    --ve-text-soft: #a3a7b0;
    --ve-text-faint: #888c95;
    --ve-link-alpha: 1;
    --ve-control-edge: #4b4f58;
    --ve-accent: #4a7dff;
    --ve-accent-rgb: 74, 125, 255;
    --ve-accent-hover: #1f52e6;
    --ve-accent-text: #9db8ff;
    --ve-accent-fg: #6c94ff;
    --ve-accent-soft: rgba(74, 125, 255, 0.12);
    --ve-link-hover: #86a8ff;
    --ve-fill: #2a62ff;
    --ve-fill-hover: #1f52e6;
    --ve-on-accent: #fff;
    --ve-sky: #8ad0ff;
    --ve-danger: #ff7b78;
    --ve-danger-soft: #ff9a97;
    --ve-success: #3ecf8e;
    --ve-scrim: rgba(0, 0, 0, 0.6);
}

html[data-theme="light"] {
    color-scheme: light;
    --ve-canvas: #f4f6f9;
    --ve-canvas-rgb: 244, 246, 249;
    --ve-surface: #fff;
    --ve-surface-rgb: 255, 255, 255;
    --ve-surface-2: #f0f2f6;
    --ve-raised: #e6e9ef;
    --ve-input: #fff;
    --ve-hover: #eceff4;
    --ve-edge: #d3d8e0;
    --ve-edge-rgb: 211, 216, 224;
    --ve-line: rgba(15, 23, 42, 0.1);
    --ve-line-strong: rgba(15, 23, 42, 0.3);
    --ve-ov: 15, 23, 42;
    --ve-text: #1b1f26;
    --ve-text-strong: #0d1117;
    --ve-text-2: #3b424d;
    --ve-text-muted: #535a66;
    --ve-text-dim: #5c6370;
    --ve-text-meta: #5c6370;
    --ve-text-soft: #535a66;
    --ve-text-faint: #666d7a;
    --ve-accent: #1b4ed8;
    --ve-accent-rgb: 27, 78, 216;
    --ve-accent-hover: #1a45c2;
    --ve-accent-text: #1a45c2;
    --ve-accent-fg: #1b4ed8;
    --ve-accent-soft: rgba(31, 85, 232, 0.1);
    --ve-link-hover: #1a45c2;
    --ve-fill: #2a62ff;
    --ve-fill-hover: #1f52e6;
    --ve-on-accent: #fff;
    --ve-sky: #0b6fa8;
    --ve-danger: #c62828;
    --ve-danger-soft: #a61e1e;
    --ve-success: #15803d;
    --ve-scrim: rgba(15, 23, 42, 0.45);
    --ve-ink: #1b1f26;
    --ve-t-red: #b42318;
    --ve-t-green: #146c36;
    --ve-t-blue: #1b4ed8;
    --ve-t-soft: #3a414c;
    --ve-t-dim: #5a626e;
    --ve-edge-bg: #edf0f5;
    --ve-control-edge: #98a2b3;
    --ve-ok-dot: #15803d;
    --ve-amber: #8a5a00;
    --ve-link-alpha: 1;
    --ve-ink-2: #535a66;
    --ve-on-fill: #fff;
    --ve-g-mid: #5c6370;
    --ve-g-soft: #3b424d;
    --ve-g-hi: #1b1f26;
    --ve-red-soft: #a61e1e;
    --ve-red: #c62828;
    --ve-ok: #0f6b34;
    --ve-sky-soft: #1a45c2;
    --ve-g-bg-surface: #fff;
    --ve-g-bg-raised: #f0f2f6;
    --ve-g-bg-canvas: #f4f6f9;
    --ve-g-edge: #d3d8e0;
    --ve-scrim-rgb: 15, 23, 42;
    --ve-danger-rgb: 198, 40, 40;
}

/* No-script fallback: follow the OS when the boot script did not run. */
@media (prefers-color-scheme: light) {
    html:not([data-theme]) {
        color-scheme: light;
        --ve-canvas: #f4f6f9;
        --ve-canvas-rgb: 244, 246, 249;
        --ve-surface: #fff;
        --ve-surface-rgb: 255, 255, 255;
        --ve-surface-2: #f0f2f6;
        --ve-raised: #e6e9ef;
        --ve-input: #fff;
        --ve-hover: #eceff4;
        --ve-edge: #d3d8e0;
        --ve-edge-rgb: 211, 216, 224;
        --ve-line: rgba(15, 23, 42, 0.1);
        --ve-line-strong: rgba(15, 23, 42, 0.3);
        --ve-ov: 15, 23, 42;
        --ve-text: #1b1f26;
        --ve-text-strong: #0d1117;
        --ve-text-2: #3b424d;
        --ve-text-muted: #535a66;
        --ve-text-dim: #5c6370;
        --ve-text-meta: #5c6370;
        --ve-text-soft: #535a66;
        --ve-text-faint: #666d7a;
        --ve-accent: #1b4ed8;
        --ve-accent-rgb: 27, 78, 216;
        --ve-accent-hover: #1a45c2;
        --ve-accent-text: #1a45c2;
        --ve-accent-fg: #1b4ed8;
        --ve-accent-soft: rgba(31, 85, 232, 0.1);
        --ve-link-hover: #1a45c2;
        --ve-sky: #0b6fa8;
        --ve-danger: #c62828;
        --ve-danger-soft: #a61e1e;
        --ve-success: #15803d;
        --ve-scrim: rgba(15, 23, 42, 0.45);
        --ve-ink: #1b1f26;
    --ve-t-red: #b42318;
    --ve-t-green: #146c36;
    --ve-t-blue: #1b4ed8;
    --ve-t-soft: #3a414c;
    --ve-t-dim: #5a626e;
        --ve-edge-bg: #edf0f5;
        --ve-control-edge: #98a2b3;
        --ve-ok-dot: #15803d;
        --ve-amber: #8a5a00;
        --ve-link-alpha: 1;
        --ve-ink-2: #535a66;
        --ve-on-fill: #fff;
        --ve-g-mid: #5c6370;
        --ve-g-soft: #3b424d;
        --ve-g-hi: #1b1f26;
        --ve-red-soft: #a61e1e;
        --ve-red: #c62828;
        --ve-ok: #0f6b34;
        --ve-sky-soft: #1a45c2;
        --ve-g-bg-surface: #fff;
        --ve-g-bg-raised: #f0f2f6;
        --ve-g-bg-canvas: #f4f6f9;
        --ve-g-edge: #d3d8e0;
        --ve-scrim-rgb: 15, 23, 42;
        --ve-danger-rgb: 198, 40, 40;
    }
}

/* Surfaces that stay dark in both themes (video player, media preview stage). */
.ve-dark,
html[data-theme="light"] .ve-dark {
    color-scheme: dark;
    --ve-canvas: #0f1012;
    --ve-canvas-rgb: 15, 16, 18;
    --ve-surface: #17181b;
    --ve-surface-rgb: 23, 24, 27;
    --ve-surface-2: #1e2024;
    --ve-raised: #26282d;
    --ve-input: #141518;
    --ve-hover: #1f2024;
    --ve-edge: #34363c;
    --ve-edge-rgb: 52, 54, 60;
    --ve-line: rgba(255, 255, 255, 0.08);
    --ve-line-strong: rgba(255, 255, 255, 0.14);
    --ve-ov: 255, 255, 255;
    --ve-text: #f2f3f5;
    --ve-text-strong: #fff;
    --ve-text-2: #c9ccd2;
    --ve-text-muted: #9b9ea6;
    --ve-text-dim: #8c9099;
    --ve-text-meta: #8f9397;
    --ve-text-soft: #a3a7b0;
    --ve-text-faint: #888c95;
    --ve-accent: #4a7dff;
    --ve-accent-rgb: 74, 125, 255;
    --ve-accent-hover: #1f52e6;
    --ve-accent-text: #9db8ff;
    --ve-accent-fg: #6c94ff;
    --ve-accent-soft: rgba(74, 125, 255, 0.12);
    --ve-link-hover: #86a8ff;
    --ve-sky: #8ad0ff;
    --ve-danger: #ff7b78;
    --ve-danger-soft: #ff9a97;
    --ve-success: #3ecf8e;
    --ve-g-mid: initial;
    --ve-g-soft: initial;
    --ve-g-hi: initial;
    --ve-red-soft: initial;
    --ve-red: initial;
    --ve-ok: initial;
    --ve-sky-soft: initial;
    --ve-g-bg-surface: initial;
    --ve-g-bg-raised: initial;
    --ve-g-bg-canvas: initial;
    --ve-g-edge: initial;
    --ve-scrim-rgb: initial;
    --ve-danger-rgb: initial;
    --ve-ink: initial;
    --ve-t-red: initial;
    --ve-t-green: initial;
    --ve-t-blue: initial;
    --ve-t-soft: initial;
    --ve-t-dim: initial;
    --ve-edge-bg: initial;
    --ve-control-edge: #4b4f58;
    --ve-ok-dot: initial;
    --ve-amber: initial;
    --ve-link-alpha: 1;
    --ve-ink-2: initial;
    --ve-on-fill: initial;
    color: var(--ve-text);
}

/* Header/footer wordmark size on pages that do not carry the runtime logo styles (admin). */
.ve-text-logo { display: block; width: auto; height: 29px; max-width: none; }
.ve-text-logo--footer { height: 20px; }

/* ---- Light theme: contrast fixes for legacy/bootstrap pieces (loaded on every page) --------------- */
html[data-theme="light"] :is(input, select, textarea, .form-control):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="file"]) { border-color: var(--ve-control-edge) !important; }
html[data-theme="light"] .btn-white { border-color: var(--ve-control-edge); }
html[data-theme="light"] .btn-secondary, html[data-theme="light"] .btn-secondary:hover, html[data-theme="light"] .btn-secondary:focus { background: var(--ve-surface-2); border-color: var(--ve-control-edge); color: var(--ve-text-strong); }
html[data-theme="light"] .btn-secondary:hover { background: var(--ve-hover); }
html[data-theme="light"] code { color: #a3195b; }
html[data-theme="light"] .text-muted { color: var(--ve-text-muted) !important; }
html[data-theme="light"] i[style*="grey"], html[data-theme="light"] i[style*="gray"] { color: var(--ve-text-dim) !important; }

/* Light theme: bootstrap status badges need darker fills for white text (WCAG AA) */
html[data-theme="light"] .badge-success { background-color: #1e7e34; }
html[data-theme="light"] .badge-info { background-color: #117a8b; }
html[data-theme="light"] .badge-danger { background-color: #b02a37; }
html[data-theme="light"] .badge-primary { background-color: #1b4ed8; }
html[data-theme="light"] .badge-secondary { background-color: #565e66; }

/* Status text colours that read well on both themes (bright on dark, deep on light). */
.text-danger { color: var(--ve-t-red, #ff6b6f) !important; }
.text-success { color: var(--ve-t-green, #5fd68a) !important; }
i.text-danger, i.text-success { --fa-primary-opacity: 1; --fa-secondary-opacity: .5; }

/* Notice lines with a leading icon: icon hangs in the margin so wrapped text stays aligned. */
p:has(> i.fa-exclamation-square:first-child) { position: relative; padding-left: 28px; }
p:has(> i.fa-exclamation-square:first-child) > i:first-child { position: absolute; left: 0; top: .15em; margin: 0 !important; font-size: 1.05em; }

/* Chart hover boxes follow the theme. */
.morris-hover.morris-default-style { background: var(--ve-surface-2, #1e2024) !important; border: 1px solid var(--ve-line-strong, rgba(255, 255, 255, 0.18)) !important; border-radius: 4px; color: var(--ve-text, #f2f3f5) !important; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18); }

/* Page-to-page navigation without a visible reload: the header and sidebar stay in place and only the content cross-fades. */
@view-transition { navigation: auto; }
body.ve-app > .main-menu { view-transition-name: ve-top; }
body.ve-app > .sidebar { view-transition-name: ve-side; }
::view-transition-group(root) { animation-duration: .14s; }
::view-transition-old(root), ::view-transition-new(root) { animation-timing-function: ease-out; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* Dark theme: control edges, alerts, code and bootstrap greys that were too faint. */
html:not([data-theme="light"]) :is(input, select, textarea, .form-control):not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="range"]):not([type="file"]):not(.jscolor):not(:focus) { border-color: var(--ve-control-edge, #4b4f58); }
html:not([data-theme="light"]) :is(.btn-secondary, .btn-white, .admin-shell .btn-sm):not(:focus) { border-color: var(--ve-control-edge, #4b4f58); }
html:not([data-theme="light"]) .alert-info { background: rgba(23, 162, 184, 0.12); border-color: rgba(23, 162, 184, 0.45); color: var(--ve-text, #f2f3f5); }
html:not([data-theme="light"]) .alert-success { background: rgba(40, 167, 69, 0.12); border-color: rgba(40, 167, 69, 0.45); color: var(--ve-text, #f2f3f5); }
html:not([data-theme="light"]) .alert-warning { background: rgba(224, 183, 42, 0.12); border-color: rgba(224, 183, 42, 0.45); color: var(--ve-text, #f2f3f5); }
html:not([data-theme="light"]) .alert-danger { background: rgba(220, 53, 69, 0.12); border-color: rgba(220, 53, 69, 0.45); color: var(--ve-text, #f2f3f5); }
html:not([data-theme="light"]) code { color: #ff8fbd; }
.text-muted { color: var(--ve-text-muted, #9b9ea6) !important; }
i[style*="grey"], i[style*="gray"] { color: var(--ve-text-dim, #8c9099) !important; }

/* Status badges: white text needs a deep enough fill on both themes. */
.badge-success { background-color: #1e7e34; }
.badge-info { background-color: #117a8b; }
.badge-danger { background-color: #b02a37; }
.badge-primary { background-color: var(--ve-fill, #2a62ff); }
.badge-secondary { background-color: #565e66; }

/* Admin section navigation: same icon weight and colour logic for every item. */
a[data-admin-section-link] { color: var(--ve-text-muted, #9b9ea6); }
a[data-admin-section-link]:hover { color: var(--ve-text-strong, #fff); }
a[data-admin-section-link].active { color: var(--ve-accent-fg, #6c94ff); }
a[data-admin-section-link] > i { color: inherit !important; --fa-primary-opacity: 1; --fa-secondary-opacity: .5; }

/* Page-change progress bar (ve_nav.js): appears only when a page takes longer than ~120ms. */
.ve-nav-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 2147483000; height: 2px; pointer-events: none; background: var(--ve-accent, #4a7dff); transform: scaleX(0); transform-origin: 0 50%; opacity: 0; }
.ve-nav-bar.is-on { opacity: 1; transform: scaleX(.8); transition: transform 4s cubic-bezier(.08,.7,.2,1); }
.ve-nav-bar.is-done { transform: scaleX(1); opacity: 0; transition: transform .2s ease, opacity .25s ease .1s; }

/* Notifications panel: shared here so pages without theme.css (admin) get the same themed panel. */
.dropdown-menu.notifications-box .title { background: var(--ve-surface-2); border-bottom-color: var(--ve-line); }
.dropdown-menu.notifications-box .title span { color: var(--ve-text-strong,#fff); }
.dropdown-menu.notifications-box .title a { color: var(--ve-accent-fg); background: transparent; }
.dropdown-menu.notifications-box .title a:hover { background: var(--ve-accent-soft); color: var(--ve-accent-fg); }
.dropdown-menu.notifications-box { background: var(--ve-surface); }
.dropdown-menu.notifications-box .title { background: var(--ve-surface); border-bottom: 1px solid var(--ve-line); padding: 14px 16px; }
.dropdown-menu.notifications-box .title span { font-size: 1rem; font-weight: 600; }
.dropdown-menu.notifications-box .notifications-list li { border-bottom: 1px solid var(--ve-line); padding: 12px 16px; }
.dropdown-menu.notifications-box .notifications-list li:hover { background: rgba(var(--ve-ov,255,255,255),0.03); }
.dropdown-menu.notifications-box .notifications-list li:not(.new) { opacity: 1; }
.dropdown-menu.notifications-box .notifications-list li:not(.new) a.description strong { color: var(--ve-text-muted); }
.dropdown-menu.notifications-box .notifications-list li a { color: var(--ve-text); }
.dropdown-menu.notifications-box .notifications-list li a.description strong { color: var(--ve-text-strong,#fff); font-size: .9286rem; font-weight: 600; }
.dropdown-menu.notifications-box .notifications-list li a.description p { color: var(--ve-text-muted); font-size: .8571rem; margin: 2px 0 6px; }
.dropdown-menu.notifications-box .notifications-list li a.description span { color: var(--ve-text-faint); font-weight: 500; font-size: .7857rem; }
.dropdown-menu.notifications-box .notifications-list li a.description span i { color: var(--ve-text-faint); }
.dropdown-menu.notifications-box .notifications-list li.new { position: relative; }
.dropdown-menu.notifications-box .notifications-list li.new:before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--ve-accent); }
.dropdown-menu.notifications-box .notifications-list li a.mark_read { color: var(--ve-accent-fg); }
.dropdown-menu.notifications-box .notifications-list li a.mark_read:hover { color: var(--ve-t-blue,#86a8ff); }
.dropdown-menu.notifications-box .btn-link { color: var(--ve-text-muted); }
.dropdown-menu.notifications-box .btn-link.text-danger { color: var(--ve-danger,#ff7b78) !important; }
.dropdown-menu.notifications-box .title .notification-clear-all { color: var(--ve-accent-fg, #6c94ff) !important; font-size: .8125rem; font-weight: 600; text-decoration: none; cursor: pointer; }
.dropdown-menu.notifications-box .title .notification-clear-all:hover { color: var(--ve-text-strong, #fff) !important; text-decoration: underline; }
.dropdown-menu.notifications-box { border: 1px solid var(--ve-line, rgba(255,255,255,.08)); color: var(--ve-text, #f2f3f5); }
.dropdown-menu.notifications-box .notifications-list li a.description { color: var(--ve-text, #f2f3f5); }

/* Invalid form fields (ve_forms.js, browser validation, Bootstrap's .is-invalid): always a red outline. */
:root { --ve-invalid: #ff6b6f; --ve-invalid-ring: rgba(255, 107, 111, .22); }
html[data-theme="light"] { --ve-invalid: #d92d20; --ve-invalid-ring: rgba(217, 45, 32, .18); }
:is(input, select, textarea, .form-control, .custom-select, .ve-select__trigger)[aria-invalid="true"],
:is(input, select, textarea, .form-control, .custom-select, .ve-select__trigger).ve-invalid,
.form-control.is-invalid, .custom-select.is-invalid {
    border-color: var(--ve-invalid) !important;
    box-shadow: inset 0 0 0 1px var(--ve-invalid) !important;
    background-image: none;
}
:is(input, select, textarea, .form-control, .custom-select, .ve-select__trigger)[aria-invalid="true"]:focus,
:is(input, select, textarea, .form-control, .custom-select, .ve-select__trigger).ve-invalid:focus,
.form-control.is-invalid:focus {
    border-color: var(--ve-invalid) !important;
    box-shadow: inset 0 0 0 1px var(--ve-invalid), 0 0 0 3px var(--ve-invalid-ring) !important;
    outline: none;
}
.invalid-feedback, .text-danger.ve-host-suggest__msg { color: var(--ve-invalid); }

/* Page notices (data-ve-flash): fade out on their own; the x closes one right away. */
.ve-flash { position: relative; padding-right: 44px !important; }
.ve-flash__close {
    position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
    width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px;
    background: transparent; color: inherit; opacity: .65; font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.ve-flash__close:hover, .ve-flash__close:focus-visible { opacity: 1; background: rgba(0, 0, 0, .08); outline: 0; }
html[data-theme="dark"] .ve-flash__close:hover, html[data-theme="dark"] .ve-flash__close:focus-visible { background: rgba(255, 255, 255, .1); }

/* App top bar (dashboard + backend): the bell, stop-impersonation and account menu stay in one row at
   every width (Bootstrap stacks .navbar-nav below "lg", which made the bar taller than the section row
   under it). Up to 768px the section menu is a slide-in panel (panel.min.css), so the menu button is
   shown up to there; from 769px the section row is always visible. */
@media (min-width: 576px) {
    nav.main-menu > .container-fluid > .navbar-nav.ml-auto { flex-direction: row; align-items: center; }
}
@media (min-width: 769px) {
    nav.main-menu > .container-fluid > .navbar-toggler[data-target="#menu"] { display: none; }
}
@media (min-width: 576px) and (max-width: 768px) {
    nav.main-menu > .container-fluid { flex-wrap: nowrap; }
    nav.main-menu > .container-fluid > .navbar-nav.ml-auto { order: 1; padding-right: 4px !important; }
    nav.main-menu > .container-fluid > .navbar-toggler[data-target="#menu"] { order: 2; flex: none; display: block; padding: 4px 6px; font-size: 1.5rem; line-height: 1; }
    /* The section row is a slide-in panel here, so the content needs no room for it. */
    nav.sidebar#menu ~ .container-fluid.mt-sm-5,
    nav.sidebar#menu ~ .container-fluid.pt-sm-5 { margin-top: 0 !important; padding-top: 24px !important; }
}
/* Phones: logo, bell and menu button share one row (the button used to wrap onto a second line). */
@media (max-width: 575.98px) {
    nav.main-menu > .container-fluid { flex-wrap: nowrap; }
    nav.main-menu > .container-fluid > .navbar-brand { flex: 0 1 auto; min-width: 0; margin-right: 8px; }
    nav.main-menu > .container-fluid > .navbar-brand .ve-text-logo--nav { width: auto; max-width: 100%; height: 26px; }
    nav.main-menu > .container-fluid > .navbar-toggler { flex: none; padding: 4px 6px; font-size: 1.5rem; line-height: 1; }
    nav.main-menu > .container-fluid > .notifications-mobile { flex: none; }
    nav.main-menu .notifications-mobile .nav-item .nav-link.dropdown-toggle { position: relative; display: block; width: 50px; padding: 8px 12px; }
    nav.main-menu .notifications-mobile .nav-item .nav-link.dropdown-toggle:after { content: none; }
    nav.main-menu .notifications-mobile .nav-link .count {
        position: absolute; top: 4px; left: 24px; right: auto; min-width: 18px; height: 18px; padding: 3px 4px;
        border-radius: 4px; background: var(--ve-fill, #2a62ff); color: var(--ve-on-accent, #fff);
        font-size: .625rem; font-weight: 700; line-height: 12px; text-align: center;
    }
    nav.main-menu .notifications-mobile .dropdown-menu { width: calc(100vw - 24px); max-width: 360px; right: -48px; left: auto; }
}

/* Section bar under the top bar (#menu, dashboard + backend): always one row. Tighter spacing on
   mid-size screens and sideways scrolling as a last resort, instead of wrapping under the content. */
@media (min-width: 769px) {
    nav.sidebar#menu > .container-fluid > ul.nav {
        flex-wrap: nowrap;
        justify-content: safe center;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }
    nav.sidebar#menu > .container-fluid > ul.nav::-webkit-scrollbar { display: none; }
    nav.sidebar#menu ul.nav > .nav-item { flex: 0 0 auto; }
    nav.sidebar#menu ul.nav .nav-link { white-space: nowrap; }
}
@media (min-width: 769px) and (max-width: 1399.98px) {
    nav.sidebar#menu ul.nav .nav-link { display: inline-flex; align-items: center; gap: 7px; padding-left: 10px; padding-right: 10px; font-size: .9375rem; }
    nav.sidebar#menu ul.nav .nav-link i { position: static; transform: none; font-size: 18px; width: auto; }
}
@media (min-width: 769px) and (max-width: 1099.98px) {
    nav.sidebar#menu ul.nav .nav-link { gap: 5px; padding-left: 6px; padding-right: 6px; font-size: .8125rem; }
    nav.sidebar#menu ul.nav .nav-link i { font-size: 15px; }
}

/* Date range form (Reports): From and To stay side by side down to ~320px; the button goes under
   them on narrow screens. Labels sit beside the fields on wide screens and above them otherwise. */
.ve-range-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; margin: 0 0 8px; }
.ve-range-form__field { min-width: 0; }
.ve-range-form__field > label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--ve-text-muted); }
.ve-range-form__field .input-group, .ve-range-form__field .ve-date, .ve-range-form__field .ve-date__trigger { width: 100%; min-width: 0; }
.ve-range-form__field .ve-date__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ve-range-form__submit { grid-column: 1 / -1; }
.ve-range-form__submit .btn { width: 100%; }
@media (min-width: 768px) {
    .ve-range-form { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 24px; }
    .ve-range-form__field { display: flex; align-items: center; gap: 12px; }
    .ve-range-form__field > label { margin: 0; font-size: inherit; font-weight: 400; }
    .ve-range-form__field .input-group { width: 220px; }
    .ve-range-form__submit .btn { width: auto; }
}
@media (max-width: 419.98px) {
    .ve-range-form { gap: 8px; }
    .ve-range-form__field .ve-date__trigger { padding-left: 10px; padding-right: 10px; font-size: 14px; }
    .ve-range-form__field .ve-date__icon { display: none; }
}

/* DMCA Manager: the notices table scrolls sideways inside its card instead of widening the page. */
.settings-table-wrap.dmca-card { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.settings-table-wrap.dmca-card > .table { min-width: 640px; }

/* Profile image picker (Settings → General). */
.ve-avatar-field { display: flex; align-items: center; gap: 18px; margin: 0 0 24px; padding: 16px; border: 1px solid var(--ve-line-strong); border-radius: 3px; background: var(--ve-surface-2); }
.ve-avatar-field__preview { flex: 0 0 72px; width: 72px; height: 72px; border-radius: 50%; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--ve-raised); box-shadow: 0 0 0 1px var(--ve-line-strong); color: var(--ve-text-muted); font-size: 28px; }
.ve-avatar-field__preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ve-avatar-field__body { min-width: 0; flex: 1 1 auto; }
.ve-avatar-field__label { display: block; font-weight: 600; color: var(--ve-text-strong); margin-bottom: 2px; }
.ve-avatar-field__hint { margin: 0 0 10px; font-size: 13px; color: var(--ve-text-muted); }
.ve-avatar-field__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ve-avatar-field__actions .btn i { margin-right: 4px; }
.ve-avatar-field__input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.ve-avatar-field [data-avatar-pick] { cursor: pointer; }
.ve-avatar-field [data-avatar-pick]:focus-visible { outline: 2px solid var(--ve-accent); outline-offset: 2px; }
.ve-avatar-field__input:focus-visible + .btn, .ve-avatar-field [data-avatar-pick]:focus-within { outline: 2px solid var(--ve-accent); outline-offset: 2px; }
.ve-avatar-field__message { min-height: 0; margin-top: 8px; font-size: 13px; color: var(--ve-text-muted); }
.ve-avatar-field__message:empty { display: none; }
.ve-avatar-field__message.is-error { color: var(--ve-danger); }
.ve-avatar-field__message.is-ok { color: var(--ve-success); }
.ve-avatar-field.is-busy [data-avatar-pick], .ve-avatar-field.is-busy [data-avatar-remove] { opacity: .6; pointer-events: none; }
@media (max-width: 575px) { .ve-avatar-field { align-items: flex-start; gap: 14px; } .ve-avatar-field__preview { flex-basis: 56px; width: 56px; height: 56px; font-size: 22px; } }
.ve-avatar-field [data-avatar-pick].ve-invalid { border-color: var(--ve-invalid) !important; box-shadow: 0 0 0 1px var(--ve-invalid), 0 0 0 4px var(--ve-invalid-ring) !important; }
.ve-avatar-field.has-error .ve-avatar-field__preview { box-shadow: 0 0 0 2px var(--ve-invalid); }
.ve-avatar-field__message.is-error { color: var(--ve-invalid); }
