/* ================================================================
   NUBISS DARK THEME — single dark palette for every Vuexy layout
   ----------------------------------------------------------------
   Linked LAST in <head> so it wins over demo.css, nubiss_dt_theme.css
   and ai_chat.css by source order, not only by specificity.

   Every rule is scoped to html[data-nv-theme="dark"], the attribute
   stamped by templates/partial/nav/theme_boot.html. Light mode is
   never touched: the --nv-* tokens are defined in dark ONLY, so
   templates can write `var(--nv-surface, #fff)` and keep their exact
   light value through the fallback.

   Palette mirrors nubissFusion (static/custom/css/nb.css) — keep the
   values in sync when either side changes.
   ================================================================ */

/* ── Tokens ── */
html[data-nv-theme="dark"] {
    --nv-canvas:       #0B1230;   /* page background                    */
    --nv-surface:      #141C45;   /* cards, bars, modals, dropdowns     */
    --nv-surface-2:    #1B2454;   /* inset: inputs, chips, table heads  */
    --nv-ink:          #E8EDF9;   /* body text, 13.9:1 on surface       */
    --nv-muted:        #9DAAD0;   /* secondary text, 7.1:1 on surface   */
    --nv-line:         rgba(255, 255, 255, 0.08);
    --nv-line-2:       rgba(255, 255, 255, 0.16);
    --nv-card-border:  rgba(255, 255, 255, 0.14);
    --nv-accent:       #3457C9;   /* solid fills, 6.3:1 with white      */
    --nv-accent-hover: #2A49B0;
    --nv-accent-text:  #8FA7F0;   /* links / accent text, 7.0:1         */
    --nv-accent-tint:  rgba(143, 167, 240, 0.14);
    --nv-accent-rgb:   143, 167, 240;
    --nv-row-alt:      rgba(255, 255, 255, 0.07);
    --nv-success:      #3FBF72;
    --nv-success-rgb:  63, 191, 114;
    --nv-warning:      #E0A03A;
    --nv-warning-rgb:  224, 160, 58;
    --nv-danger:       #FF6B75;
    --nv-danger-rgb:   255, 107, 117;
    --nv-info:         #5CC8E0;
    --nv-info-rgb:     92, 200, 224;
    --nv-band:         linear-gradient(140deg, #1B3F9E 0%, #15307F 50%, #0B1F55 100%);
    --nv-shadow-card:  0 1px 2px rgba(0, 0, 0, 0.5), 0 6px 18px rgba(0, 0, 0, 0.35);
    --nv-shadow:       0 10px 40px rgba(0, 0, 0, 0.45);
    --nv-shadow-lg:    0 30px 70px rgba(0, 0, 0, 0.6);

    /* Bootstrap variables, for the components that read them */
    --bs-body-bg: var(--nv-canvas);
    --bs-body-color: var(--nv-ink);
    --bs-body-color-rgb: 232, 237, 249;
    --bs-heading-color: var(--nv-ink);
    --bs-emphasis-color: var(--nv-ink);
    --bs-emphasis-color-rgb: 232, 237, 249;
    --bs-secondary-color: var(--nv-muted);
    --bs-tertiary-color: var(--nv-muted);
    --bs-secondary-bg: var(--nv-surface-2);
    --bs-tertiary-bg: var(--nv-surface-2);
    --bs-border-color: var(--nv-line-2);
    --bs-border-color-translucent: var(--nv-line);
    --bs-link-color: var(--nv-accent-text);
    --bs-link-color-rgb: 143, 167, 240;
    --bs-link-hover-color: #B3C3F5;
    --bs-link-hover-color-rgb: 179, 195, 245;
    --bs-primary: var(--nv-accent);
    --bs-primary-rgb: 52, 87, 201;
    --bs-primary-text-emphasis: var(--nv-accent-text);
    --bs-info-text-emphasis: var(--nv-info);
    --bs-success-text-emphasis: var(--nv-success);
    --bs-warning-text-emphasis: var(--nv-warning);
    --bs-danger-text-emphasis: var(--nv-danger);
    --bs-secondary-text-emphasis: var(--nv-muted);
    --bs-light-text-emphasis: var(--nv-ink);
    --bs-dark-text-emphasis: var(--nv-ink);
    --bs-primary-bg-subtle: var(--nv-accent-tint);
    --bs-info-bg-subtle: rgba(var(--nv-info-rgb), 0.16);
    --bs-success-bg-subtle: rgba(var(--nv-success-rgb), 0.16);
    --bs-warning-bg-subtle: rgba(var(--nv-warning-rgb), 0.16);
    --bs-danger-bg-subtle: rgba(var(--nv-danger-rgb), 0.16);
    --bs-secondary-bg-subtle: var(--nv-surface-2);
    --bs-light-bg-subtle: var(--nv-surface-2);
    --bs-dark-bg-subtle: var(--nv-surface-2);
    --bs-primary-border-subtle: rgba(var(--nv-accent-rgb), 0.35);
    --bs-card-bg: var(--nv-surface);
    --bs-modal-bg: var(--nv-surface);
    --bs-dropdown-bg: var(--nv-surface);
    --bs-offcanvas-bg: var(--nv-surface);

    /* Nubiss list-page design system (nubiss_dt_theme.css) */
    --pg-bg: transparent;
    --pg-card: var(--nv-surface);
    --pg-border: var(--nv-card-border);
    --pg-text: var(--nv-ink);
    --pg-muted: var(--nv-muted);
    --pg-teal: var(--nv-info);
    --pg-success: var(--nv-success);
    --pg-warn: var(--nv-warning);
    --pg-danger: var(--nv-danger);
    --pg-teal-lt: rgba(var(--nv-info-rgb), 0.16);
    --pg-success-lt: rgba(var(--nv-success-rgb), 0.16);
    --pg-warn-lt: rgba(var(--nv-warning-rgb), 0.16);
    --pg-danger-lt: rgba(var(--nv-danger-rgb), 0.16);
    --pg-shadow: var(--nv-shadow-card);
    --pg-shadow-lg: var(--nv-shadow);

    /* Patient profile (parallel --pp-* system) */
    --pp-bg: transparent;
    --pp-card: var(--nv-surface);
    --pp-border: var(--nv-card-border);
    --pp-text: var(--nv-ink);
    --pp-muted: var(--nv-muted);
    --pp-teal-lt: rgba(var(--nv-info-rgb), 0.16);
    --pp-success-lt: rgba(var(--nv-success-rgb), 0.16);
    --pp-warn-lt: rgba(var(--nv-warning-rgb), 0.16);
    --pp-danger-lt: rgba(var(--nv-danger-rgb), 0.16);
    --pp-shadow: var(--nv-shadow-card);
    --pp-shadow-lg: var(--nv-shadow);

    color-scheme: dark;
}

/* ── Page ── */
html[data-nv-theme="dark"] body {
    background: var(--nv-canvas);
    color: var(--nv-ink);
}
html[data-nv-theme="dark"] h1, html[data-nv-theme="dark"] h2, html[data-nv-theme="dark"] h3,
html[data-nv-theme="dark"] h4, html[data-nv-theme="dark"] h5, html[data-nv-theme="dark"] h6,
html[data-nv-theme="dark"] .h1, html[data-nv-theme="dark"] .h2, html[data-nv-theme="dark"] .h3,
html[data-nv-theme="dark"] .h4, html[data-nv-theme="dark"] .h5, html[data-nv-theme="dark"] .h6,
html[data-nv-theme="dark"] .card-title { color: var(--nv-ink); }
html[data-nv-theme="dark"] hr { border-color: var(--nv-line-2); opacity: 1; }

/* ── Utilities (core-dark sets these with !important) ── */
html[data-nv-theme="dark"] .text-muted,
html[data-nv-theme="dark"] .text-secondary,
html[data-nv-theme="dark"] .text-body-secondary,
html[data-nv-theme="dark"] .text-body-tertiary { color: var(--nv-muted) !important; }
html[data-nv-theme="dark"] .text-body,
html[data-nv-theme="dark"] .text-heading,
html[data-nv-theme="dark"] .text-dark,
html[data-nv-theme="dark"] .text-black,
html[data-nv-theme="dark"] .text-body-emphasis { color: var(--nv-ink) !important; }
html[data-nv-theme="dark"] .bg-white,
html[data-nv-theme="dark"] .bg-light,
html[data-nv-theme="dark"] .bg-body,
html[data-nv-theme="dark"] .bg-body-tertiary { background-color: var(--nv-surface-2) !important; }
html[data-nv-theme="dark"] .card.bg-white,
html[data-nv-theme="dark"] .card.bg-light { background-color: var(--nv-surface) !important; }
html[data-nv-theme="dark"] .border,
html[data-nv-theme="dark"] .border-top,
html[data-nv-theme="dark"] .border-bottom,
html[data-nv-theme="dark"] .border-start,
html[data-nv-theme="dark"] .border-end { border-color: var(--nv-line-2) !important; }
html[data-nv-theme="dark"] .text-primary { color: var(--nv-accent-text) !important; }
html[data-nv-theme="dark"] .text-success { color: var(--nv-success) !important; }
html[data-nv-theme="dark"] .text-warning { color: var(--nv-warning) !important; }
html[data-nv-theme="dark"] .text-danger { color: var(--nv-danger) !important; }
html[data-nv-theme="dark"] .text-info { color: var(--nv-info) !important; }

/* Widgets that can only draw on white (signature pads, document previews,
   QR codes, map tiles) opt out of the dark palette. */
html[data-nv-theme="dark"] .nv-light-island {
    color-scheme: light;
    --nv-surface: #ffffff; --nv-surface-2: #f1f4f9; --nv-ink: #0f172a; --nv-muted: #5b6b8a;
    --nv-line: #e6ecf3; --nv-line-2: #cdd7e3; --nv-accent-text: #13348b;
    --bs-body-color: #0f172a; --bs-heading-color: #0f172a; --bs-border-color: #e6ecf3;
    background-color: #ffffff !important;
    color: #0f172a;
}

/* ── Links: Bootstrap's `a` rule reads --bs-link-color-rgb (set above); a blanket
   a:not(...) rule outranked component classes, so none is declared. ── */

/* ── Primary / brand components (Vuexy hardcodes #7367f0) ── */
html[data-nv-theme="dark"] .btn-primary {
    color: #fff !important; background-color: var(--nv-accent) !important;
    border-color: var(--nv-accent) !important; box-shadow: none;
}
html[data-nv-theme="dark"] .btn-primary:hover,
html[data-nv-theme="dark"] .btn-primary:focus,
html[data-nv-theme="dark"] .btn-primary:active,
html[data-nv-theme="dark"] .btn-primary.active {
    color: #fff !important; background-color: var(--nv-accent-hover) !important;
    border-color: var(--nv-accent-hover) !important;
}
html[data-nv-theme="dark"] .btn-primary:disabled,
html[data-nv-theme="dark"] .btn-primary.disabled { opacity: .55; }
html[data-nv-theme="dark"] .btn-outline-primary {
    color: var(--nv-accent-text) !important; border-color: var(--nv-accent-text) !important;
    background-color: transparent !important;
}
html[data-nv-theme="dark"] .btn-outline-primary:hover,
html[data-nv-theme="dark"] .btn-outline-primary:active,
html[data-nv-theme="dark"] .btn-outline-primary.active,
html[data-nv-theme="dark"] .btn-check:checked + .btn-outline-primary {
    color: #fff !important; background-color: var(--nv-accent) !important;
    border-color: var(--nv-accent) !important;
}
html[data-nv-theme="dark"] .btn-label-primary {
    color: var(--nv-accent-text) !important; background-color: var(--nv-accent-tint) !important;
    border-color: transparent !important;
}
html[data-nv-theme="dark"] .btn-label-primary:hover { color: #fff !important; background-color: var(--nv-accent) !important; }
html[data-nv-theme="dark"] .btn-text-primary { color: var(--nv-accent-text) !important; }
html[data-nv-theme="dark"] .btn-text-secondary { color: var(--nv-ink) !important; }
html[data-nv-theme="dark"] .btn-text-secondary:hover { background-color: var(--nv-surface-2) !important; }
html[data-nv-theme="dark"] .btn-light,
html[data-nv-theme="dark"] .btn-outline-secondary,
html[data-nv-theme="dark"] .btn-label-secondary,
html[data-nv-theme="dark"] .btn-secondary {
    background-color: var(--nv-surface-2) !important; border-color: var(--nv-line-2) !important;
    color: var(--nv-ink) !important;
}
html[data-nv-theme="dark"] .btn-light:hover,
html[data-nv-theme="dark"] .btn-outline-secondary:hover,
html[data-nv-theme="dark"] .btn-label-secondary:hover,
html[data-nv-theme="dark"] .btn-secondary:hover { background-color: rgba(255, 255, 255, 0.16) !important; }
html[data-nv-theme="dark"] .btn-outline-secondary:disabled,
html[data-nv-theme="dark"] .btn-outline-secondary.disabled { color: var(--nv-muted) !important; opacity: .7; }
html[data-nv-theme="dark"] .btn-success { background-color: #2FA35F !important; border-color: #2FA35F !important; color: #fff !important; }
html[data-nv-theme="dark"] .btn-outline-success { color: var(--nv-success) !important; border-color: var(--nv-success) !important; }
html[data-nv-theme="dark"] .btn-outline-success:hover,
html[data-nv-theme="dark"] .btn-check:checked + .btn-outline-success { background-color: #2FA35F !important; border-color: #2FA35F !important; color: #fff !important; }
html[data-nv-theme="dark"] .btn-outline-danger { color: var(--nv-danger) !important; border-color: var(--nv-danger) !important; }
html[data-nv-theme="dark"] .btn-outline-danger:hover { background-color: #D9414C !important; border-color: #D9414C !important; color: #fff !important; }
html[data-nv-theme="dark"] .btn-outline-warning { color: var(--nv-warning) !important; border-color: var(--nv-warning) !important; }
html[data-nv-theme="dark"] .btn-outline-info { color: var(--nv-info) !important; border-color: var(--nv-info) !important; }

html[data-nv-theme="dark"] .bg-primary { background-color: var(--nv-accent) !important; }
html[data-nv-theme="dark"] .badge.bg-primary,
html[data-nv-theme="dark"] .text-bg-primary { background-color: var(--nv-accent) !important; color: #fff !important; }
html[data-nv-theme="dark"] .progress { background-color: var(--nv-surface-2); }
html[data-nv-theme="dark"] .progress-bar:not([class*="bg-"]) { background-color: var(--nv-accent); }

/* Label badges: tint + readable text */
html[data-nv-theme="dark"] .bg-label-primary { background-color: var(--nv-accent-tint) !important; color: var(--nv-accent-text) !important; }
html[data-nv-theme="dark"] .bg-label-info { background-color: rgba(var(--nv-info-rgb), 0.16) !important; color: var(--nv-info) !important; }
html[data-nv-theme="dark"] .bg-label-success,
html[data-nv-theme="dark"] .btn-label-success { background-color: rgba(var(--nv-success-rgb), 0.16) !important; color: var(--nv-success) !important; }
html[data-nv-theme="dark"] .bg-label-warning,
html[data-nv-theme="dark"] .btn-label-warning { background-color: rgba(var(--nv-warning-rgb), 0.16) !important; color: var(--nv-warning) !important; }
html[data-nv-theme="dark"] .bg-label-danger,
html[data-nv-theme="dark"] .btn-label-danger { background-color: rgba(var(--nv-danger-rgb), 0.16) !important; color: var(--nv-danger) !important; }
html[data-nv-theme="dark"] .bg-label-secondary,
html[data-nv-theme="dark"] .bg-label-dark,
html[data-nv-theme="dark"] .bg-label-light { background-color: var(--nv-surface-2) !important; color: var(--nv-muted) !important; }

/* Alerts */
html[data-nv-theme="dark"] .alert { border-color: transparent !important; }
html[data-nv-theme="dark"] .alert-primary { background-color: var(--nv-accent-tint) !important; color: var(--nv-accent-text) !important; }
html[data-nv-theme="dark"] .alert-info { background-color: rgba(var(--nv-info-rgb), 0.14) !important; color: var(--nv-info) !important; }
html[data-nv-theme="dark"] .alert-success { background-color: rgba(var(--nv-success-rgb), 0.14) !important; color: var(--nv-success) !important; }
html[data-nv-theme="dark"] .alert-warning { background-color: rgba(var(--nv-warning-rgb), 0.14) !important; color: var(--nv-warning) !important; }
html[data-nv-theme="dark"] .alert-danger { background-color: rgba(var(--nv-danger-rgb), 0.14) !important; color: var(--nv-danger) !important; }
html[data-nv-theme="dark"] .alert-secondary,
html[data-nv-theme="dark"] .alert-light,
html[data-nv-theme="dark"] .alert-dark { background-color: var(--nv-surface-2) !important; color: var(--nv-ink) !important; }
html[data-nv-theme="dark"] .alert .alert-link { color: inherit; font-weight: 700; }
html[data-nv-theme="dark"] .alert .btn-close,
html[data-nv-theme="dark"] .offcanvas .btn-close { filter: invert(1) brightness(2); }

/* ── Surfaces ── */
html[data-nv-theme="dark"] .card {
    background-color: var(--nv-surface);
    border: 1px solid var(--nv-card-border);
    box-shadow: var(--nv-shadow-card);
    color: var(--nv-ink);
}
html[data-nv-theme="dark"] .card .card-header { border-bottom-color: var(--nv-line); color: var(--nv-ink); }
html[data-nv-theme="dark"] .card-footer { border-top-color: var(--nv-line); background: transparent; }
html[data-nv-theme="dark"] .card-subtitle { color: var(--nv-muted); }
html[data-nv-theme="dark"] .list-group-item { background-color: transparent; border-color: var(--nv-line); color: var(--nv-ink); }
html[data-nv-theme="dark"] .list-group-item-action:hover,
html[data-nv-theme="dark"] .list-group-item-action:focus { background-color: var(--nv-surface-2); color: var(--nv-ink); }
html[data-nv-theme="dark"] .accordion-item { background-color: var(--nv-surface); border-color: var(--nv-line-2); color: var(--nv-ink); }
html[data-nv-theme="dark"] .accordion-button { background-color: var(--nv-surface); color: var(--nv-ink); }
html[data-nv-theme="dark"] .accordion-button:not(.collapsed) { background-color: var(--nv-surface-2); color: var(--nv-ink); }
html[data-nv-theme="dark"] .toast,
html[data-nv-theme="dark"] .offcanvas,
html[data-nv-theme="dark"] .popover { background-color: var(--nv-surface); color: var(--nv-ink); border-color: var(--nv-line-2); }
html[data-nv-theme="dark"] .popover-header { background-color: var(--nv-surface-2); color: var(--nv-ink); border-color: var(--nv-line); }
html[data-nv-theme="dark"] .popover-body { color: var(--nv-ink); }

/* Dropdowns */
html[data-nv-theme="dark"] .dropdown-menu {
    background-color: var(--nv-surface); border: 1px solid var(--nv-line-2);
    box-shadow: var(--nv-shadow); color: var(--nv-ink);
}
html[data-nv-theme="dark"] .dropdown-item { color: var(--nv-ink); }
html[data-nv-theme="dark"] .dropdown-item:hover,
html[data-nv-theme="dark"] .dropdown-item:focus { background-color: var(--nv-surface-2); color: var(--nv-accent-text); }
html[data-nv-theme="dark"] .dropdown-item.active,
html[data-nv-theme="dark"] .dropdown-item:active { background-color: var(--nv-accent-tint) !important; color: var(--nv-accent-text) !important; }
html[data-nv-theme="dark"] .dropdown-header { color: var(--nv-muted); }
html[data-nv-theme="dark"] .dropdown-divider { border-color: var(--nv-line-2); }

/* ── Modals: one treatment on every layout ── */
html[data-nv-theme="dark"] .modal .modal-content,
html[data-nv-theme="dark"] .modal-content {
    background-color: var(--nv-surface); color: var(--nv-ink);
    border: 1px solid var(--nv-card-border); box-shadow: var(--nv-shadow-lg);
}
html[data-nv-theme="dark"] .modal .modal-header { background: var(--nv-band); border-color: transparent; }
html[data-nv-theme="dark"] .modal .modal-header .modal-title { color: #fff; }
html[data-nv-theme="dark"] .modal .modal-body { background-color: var(--nv-surface); color: var(--nv-ink); }
html[data-nv-theme="dark"] .modal .modal-footer { background: var(--nv-surface-2); border-top: 1px solid var(--nv-line); }
html[data-nv-theme="dark"] .modal .form-label { color: var(--nv-muted); }
html[data-nv-theme="dark"] .modal .btn-close { filter: invert(1) brightness(2); }
html[data-nv-theme="dark"] .modal-backdrop { background-color: #050916; }

/* ── Forms ── */
html[data-nv-theme="dark"] .form-control,
html[data-nv-theme="dark"] .form-select,
html[data-nv-theme="dark"] .modal .form-control,
html[data-nv-theme="dark"] .modal .form-select,
html[data-nv-theme="dark"] .pg-filter-bar .form-control,
html[data-nv-theme="dark"] .pg-filter-bar .form-select {
    background-color: var(--nv-surface-2); border-color: var(--nv-line-2); color: var(--nv-ink);
}
html[data-nv-theme="dark"] .form-control::placeholder { color: var(--nv-muted); opacity: .8; }
html[data-nv-theme="dark"] .form-control:hover:not([disabled]):not(:focus),
html[data-nv-theme="dark"] .form-select:hover:not([disabled]):not(:focus) { border-color: rgba(255, 255, 255, 0.3); }
html[data-nv-theme="dark"] .form-control:focus,
html[data-nv-theme="dark"] .form-select:focus,
html[data-nv-theme="dark"] .form-check-input:focus {
    border-color: var(--nv-accent-text) !important;
    box-shadow: 0 0 0 0.15rem rgba(var(--nv-accent-rgb), 0.25) !important;
    background-color: var(--nv-surface-2); color: var(--nv-ink);
}
html[data-nv-theme="dark"] .form-control:disabled,
html[data-nv-theme="dark"] .form-control[readonly],
html[data-nv-theme="dark"] .form-select:disabled {
    background-color: rgba(255, 255, 255, 0.04); color: var(--nv-muted); border-color: var(--nv-line);
}
html[data-nv-theme="dark"] .form-label,
html[data-nv-theme="dark"] .col-form-label,
html[data-nv-theme="dark"] .form-check-label { color: var(--nv-ink); }
html[data-nv-theme="dark"] .form-text { color: var(--nv-muted); }
html[data-nv-theme="dark"] .input-group-text { background-color: var(--nv-surface-2); border-color: var(--nv-line-2); color: var(--nv-muted); }
html[data-nv-theme="dark"] .form-check-input { background-color: var(--nv-surface-2); border-color: rgba(255, 255, 255, 0.3); }
/* Unchecked switch: the track must read against the card */
html[data-nv-theme="dark"] .form-switch .form-check-input:not(:checked) {
    background-color: rgba(255, 255, 255, 0.2); border-color: transparent;
}
html[data-nv-theme="dark"] .form-check-input:checked { background-color: var(--nv-accent) !important; border-color: var(--nv-accent) !important; }
html[data-nv-theme="dark"] .form-switch .form-check-input:checked {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e") !important;
}

/* ── Pagination, tabs, pills ── */
html[data-nv-theme="dark"] .page-link { background-color: var(--nv-surface-2); color: var(--nv-ink); border-color: transparent; }
html[data-nv-theme="dark"] .page-link:hover { background-color: var(--nv-accent-tint); color: var(--nv-accent-text); }
html[data-nv-theme="dark"] .page-item.disabled .page-link { background-color: rgba(255, 255, 255, 0.04); color: var(--nv-muted); opacity: .75; }
html[data-nv-theme="dark"] .page-item.active .page-link,
html[data-nv-theme="dark"] .nav-pills .nav-link.active,
html[data-nv-theme="dark"] .list-group-item.active {
    background-color: var(--nv-accent) !important; border-color: var(--nv-accent) !important; color: #fff !important;
}
html[data-nv-theme="dark"] .nav-tabs,
html[data-nv-theme="dark"] .nav-tabs .nav-link { border-color: var(--nv-line); }
html[data-nv-theme="dark"] .nav-tabs .nav-link,
html[data-nv-theme="dark"] .nav-pills .nav-link { color: var(--nv-muted); }
html[data-nv-theme="dark"] .nav-tabs .nav-link:hover,
html[data-nv-theme="dark"] .nav-pills .nav-link:not(.active):hover { color: var(--nv-accent-text); }
html[data-nv-theme="dark"] .nav-tabs .nav-link.active,
html[data-nv-theme="dark"] .nav-tabs .nav-link.active:hover {
    color: var(--nv-accent-text) !important; background: transparent !important;
    box-shadow: 0 -2px 0 var(--nv-accent-text) inset !important;
}
html[data-nv-theme="dark"] .tab-content { background: transparent; }

/* ── Shell: top bar + sidebar ── */
html[data-nv-theme="dark"] .layout-navbar.navbar-detached,
html[data-nv-theme="dark"] .layout-navbar-fixed .layout-navbar.navbar-detached,
html[data-nv-theme="dark"] .bg-navbar-theme {
    background: var(--nv-surface) !important; color: var(--nv-ink) !important;
    border: 1px solid var(--nv-card-border);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4) !important;
    -webkit-backdrop-filter: none; backdrop-filter: none;
}
html[data-nv-theme="dark"] .layout-navbar .navbar-nav .nav-link,
html[data-nv-theme="dark"] .layout-navbar .nav-item .nav-link,
html[data-nv-theme="dark"] .layout-menu-toggle .nav-link { color: var(--nv-ink); }
html[data-nv-theme="dark"] .layout-navbar .search-input-wrapper,
html[data-nv-theme="dark"] .layout-navbar .search-input-wrapper .search-input { background-color: var(--nv-surface) !important; color: var(--nv-ink); }

html[data-nv-theme="dark"] .bg-menu-theme { background-color: var(--nv-surface) !important; color: var(--nv-ink) !important; }
html[data-nv-theme="dark"] .layout-menu { border-right: 1px solid var(--nv-line); box-shadow: none; }
html[data-nv-theme="dark"] .bg-menu-theme .menu-link,
html[data-nv-theme="dark"] .bg-menu-theme .menu-inner > .menu-item > .menu-link { color: var(--nv-ink) !important; }
html[data-nv-theme="dark"] .bg-menu-theme .menu-header,
html[data-nv-theme="dark"] .bg-menu-theme .menu-header .menu-header-text { color: var(--nv-muted) !important; }
html[data-nv-theme="dark"] .bg-menu-theme .menu-inner .menu-item .menu-link:hover {
    background: var(--nv-surface-2) !important; color: var(--nv-accent-text) !important;
}
html[data-nv-theme="dark"] .bg-menu-theme.menu-vertical .menu-item.active > .menu-link:not(.menu-toggle) {
    background: var(--nv-accent-tint) !important; color: var(--nv-accent-text) !important;
    box-shadow: none !important; font-weight: 600;
}
html[data-nv-theme="dark"] .bg-menu-theme .menu-inner .menu-item.open > .menu-link.menu-toggle,
html[data-nv-theme="dark"] .bg-menu-theme .menu-inner .menu-item.active > .menu-link.menu-toggle {
    background: transparent !important; color: var(--nv-accent-text) !important; box-shadow: none !important;
}
html[data-nv-theme="dark"] .bg-menu-theme .menu-inner .menu-sub > .menu-item.active > .menu-link { color: var(--nv-accent-text) !important; }
html[data-nv-theme="dark"] .menu-item.active > .menu-link .menu-icon { color: inherit !important; }
html[data-nv-theme="dark"] .bg-menu-theme .menu-inner-shadow { background: linear-gradient(var(--nv-surface) 41%, rgba(20, 28, 69, 0.11) 95%, rgba(20, 28, 69, 0)) !important; }
html[data-nv-theme="dark"] .footer.bg-footer-theme,
html[data-nv-theme="dark"] .content-footer { background: transparent !important; color: var(--nv-muted); }

/* ── Tables ── */
html[data-nv-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--nv-ink);
    --bs-table-border-color: var(--nv-line);
    --bs-table-striped-bg: var(--nv-row-alt);
    --bs-table-striped-color: var(--nv-ink);
    --bs-table-hover-bg: var(--nv-accent-tint);
    --bs-table-hover-color: var(--nv-ink);
    --bs-table-active-bg: var(--nv-accent-tint);
    --bs-table-active-color: var(--nv-ink);
    color: var(--nv-ink);
}
html[data-nv-theme="dark"] .table > thead th,
html[data-nv-theme="dark"] .table > thead td { color: var(--nv-muted); border-bottom-color: var(--nv-line-2); }
html[data-nv-theme="dark"] .table-light,
html[data-nv-theme="dark"] .table > thead.table-light th,
html[data-nv-theme="dark"] .table .table-light th {
    --bs-table-bg: var(--nv-surface-2); --bs-table-color: var(--nv-muted);
    background-color: var(--nv-surface-2) !important; color: var(--nv-muted) !important;
    border-color: var(--nv-line-2) !important;
}

/* DataTables */
html[data-nv-theme="dark"] table.dataTable thead th {
    color: var(--nv-muted); background: var(--nv-surface-2);
    border-bottom: 1px solid var(--nv-line-2) !important;
}
html[data-nv-theme="dark"] table.dataTable > tbody > tr.even > * { background-color: var(--nv-row-alt); --bs-table-bg-type: transparent; }
html[data-nv-theme="dark"] table.dataTable tbody tr:hover > td { background-color: var(--nv-accent-tint); }
html[data-nv-theme="dark"] table.dataTable > thead .sorting::before,
html[data-nv-theme="dark"] table.dataTable > thead .sorting::after,
html[data-nv-theme="dark"] table.dataTable > thead .sorting_asc::before,
html[data-nv-theme="dark"] table.dataTable > thead .sorting_asc::after,
html[data-nv-theme="dark"] table.dataTable > thead .sorting_desc::before,
html[data-nv-theme="dark"] table.dataTable > thead .sorting_desc::after { color: var(--nv-accent-text); }
html[data-nv-theme="dark"] div.dataTables_wrapper div.dataTables_info,
html[data-nv-theme="dark"] div.dataTables_wrapper div.dataTables_length label,
html[data-nv-theme="dark"] div.dataTables_wrapper div.dataTables_filter label { color: var(--nv-muted); }
html[data-nv-theme="dark"] div.dataTables_wrapper div.dataTables_filter input,
html[data-nv-theme="dark"] div.dataTables_wrapper div.dataTables_length select,
html[data-nv-theme="dark"] .pg-table-wrap .dataTables_wrapper .dataTables_filter input,
html[data-nv-theme="dark"] .pp-table-wrap .dataTables_wrapper .dataTables_filter input {
    background-color: var(--nv-surface-2); border-color: var(--nv-line-2); color: var(--nv-ink);
}
html[data-nv-theme="dark"] table.dataTable > tbody > tr.child,
html[data-nv-theme="dark"] table.dataTable > tbody > tr.child:hover > td { background-color: var(--nv-surface-2); }
html[data-nv-theme="dark"] table.dataTable > tbody > tr.child ul.dtr-details > li { border-bottom-color: var(--nv-line); }
html[data-nv-theme="dark"] table.dataTable > tbody > tr.child span.dtr-title { color: var(--nv-muted); }
html[data-nv-theme="dark"] .dtr-bs-modal .table td { color: var(--nv-ink); }

/* ── Nubiss list-page system (nubiss_dt_theme.css) ── */
html[data-nv-theme="dark"] .pg-header {
    background: var(--nv-band);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: var(--nv-shadow-card);
}
html[data-nv-theme="dark"] .pg-header-sub { color: rgba(255, 255, 255, 0.74); }
html[data-nv-theme="dark"] .pg-header-pill { color: rgba(255, 255, 255, 0.9); }
html[data-nv-theme="dark"] .pg-btn-solid,
html[data-nv-theme="dark"] .pg-btn-solid:hover { background: #fff; color: #0B1F55; }
html[data-nv-theme="dark"] .pg-panel-head,
html[data-nv-theme="dark"] .pp-panel-head,
html[data-nv-theme="dark"] #HealthDeclaration .pp-panel > .card > h5.card-header { background: var(--nv-surface-2); border-bottom-color: var(--nv-line); }
html[data-nv-theme="dark"] .pg-table-wrap .table thead th,
html[data-nv-theme="dark"] .pp-table-wrap .table thead th,
html[data-nv-theme="dark"] .patient-appointments-list table thead th { background: var(--nv-surface-2); color: var(--nv-muted); }
html[data-nv-theme="dark"] .pg-table-wrap .table tbody td { border-bottom-color: var(--nv-line); }
html[data-nv-theme="dark"] .pg-table-wrap .table tbody tr:hover,
html[data-nv-theme="dark"] .pp-table-wrap .table tbody tr:hover { background: var(--nv-accent-tint); }
html[data-nv-theme="dark"] .pg-loading .pg-progress,
html[data-nv-theme="dark"] .sum-progress { background: var(--nv-line-2); }
html[data-nv-theme="dark"] .pg-badge-neu,
html[data-nv-theme="dark"] .pp-badge-neu { background: var(--nv-surface-2); color: var(--nv-muted); }
html[data-nv-theme="dark"] .pg-badge-purple,
html[data-nv-theme="dark"] .ai-id-chip.ref { background: rgba(167, 139, 250, 0.18); color: #C4B5FD; }
html[data-nv-theme="dark"] .pg-act,
html[data-nv-theme="dark"] .pp-act { background: var(--nv-surface-2); border-color: var(--nv-line-2); color: var(--nv-muted); }
html[data-nv-theme="dark"] .pg-act:hover { background: var(--nv-accent); border-color: var(--nv-accent); color: #fff; }
html[data-nv-theme="dark"] .pg-act.edit:hover { background: #2A8FA6; border-color: #2A8FA6; }
html[data-nv-theme="dark"] .pg-act.danger:hover { background: #D9414C; border-color: #D9414C; }
html[data-nv-theme="dark"] .pg-id { background: var(--nv-surface-2); border-color: var(--nv-line-2); }
html[data-nv-theme="dark"] .sum-placeholder { background: var(--nv-surface-2); }

/* ── Select2 / flatpickr ── */
html[data-nv-theme="dark"] .select2-container--default .select2-selection {
    border-color: var(--nv-line-2) !important; background: var(--nv-surface-2) !important;
}
html[data-nv-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__rendered,
html[data-nv-theme="dark"] .select2-container--default .select2-search__field { color: var(--nv-ink) !important; }
html[data-nv-theme="dark"] .select2-container--default .select2-selection--single .select2-selection__placeholder,
html[data-nv-theme="dark"] .select2-container--default .select2-search__field::placeholder { color: var(--nv-muted) !important; }
html[data-nv-theme="dark"] .select2-container--default.select2-container--focus .select2-selection,
html[data-nv-theme="dark"] .select2-container--default.select2-container--open .select2-selection {
    border-color: var(--nv-accent-text) !important; box-shadow: 0 0 0 0.15rem rgba(var(--nv-accent-rgb), 0.25) !important;
}
html[data-nv-theme="dark"] .select2-dropdown { background-color: var(--nv-surface) !important; border-color: var(--nv-line-2) !important; box-shadow: var(--nv-shadow); }
html[data-nv-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--nv-surface-2) !important; border-color: var(--nv-line-2) !important;
}
html[data-nv-theme="dark"] .select2-container--default .select2-results__option { color: var(--nv-ink); }
html[data-nv-theme="dark"] .select2-container--default .select2-results__option--highlighted[aria-selected],
html[data-nv-theme="dark"] .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
    background-color: var(--nv-accent-tint) !important; color: var(--nv-accent-text) !important;
}
html[data-nv-theme="dark"] .select2-container--default .select2-results__option[aria-selected="true"],
html[data-nv-theme="dark"] .select2-container--default .select2-results__option--selected {
    background-color: var(--nv-accent) !important; color: #fff !important;
}
html[data-nv-theme="dark"] .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--nv-accent-tint) !important; color: var(--nv-accent-text) !important; border: 0 !important;
}
html[data-nv-theme="dark"] .flatpickr-calendar,
html[data-nv-theme="dark"] .flatpickr-time,
html[data-nv-theme="dark"] .flatpickr-time input { background: var(--nv-surface) !important; color: var(--nv-ink); }
html[data-nv-theme="dark"] .flatpickr-calendar { border: 1px solid var(--nv-line-2); box-shadow: var(--nv-shadow); }
html[data-nv-theme="dark"] .flatpickr-day,
html[data-nv-theme="dark"] .flatpickr-current-month,
html[data-nv-theme="dark"] .flatpickr-current-month input.cur-year,
html[data-nv-theme="dark"] .flatpickr-monthDropdown-months { color: var(--nv-ink); }
html[data-nv-theme="dark"] span.flatpickr-weekday,
html[data-nv-theme="dark"] .flatpickr-day.prevMonthDay,
html[data-nv-theme="dark"] .flatpickr-day.nextMonthDay,
html[data-nv-theme="dark"] .flatpickr-day.flatpickr-disabled { color: var(--nv-muted); }
html[data-nv-theme="dark"] .flatpickr-day:hover { background: var(--nv-surface-2); border-color: var(--nv-surface-2); }
html[data-nv-theme="dark"] .flatpickr-day.selected,
html[data-nv-theme="dark"] .flatpickr-day.selected:hover { background: var(--nv-accent); border-color: var(--nv-accent); color: #fff; }
html[data-nv-theme="dark"] .flatpickr-day.today { border-color: var(--nv-accent-text); }
html[data-nv-theme="dark"] .flatpickr-prev-month,
html[data-nv-theme="dark"] .flatpickr-next-month { background-color: var(--nv-surface-2); }

/* ── FullCalendar + calendar chrome ── */
html[data-nv-theme="dark"] .fc {
    --fc-border-color: var(--nv-line-2);
    --fc-page-bg-color: var(--nv-surface);
    --fc-neutral-bg-color: var(--nv-surface-2);
    --fc-today-bg-color: var(--nv-accent-tint);
    --fc-list-event-hover-bg-color: var(--nv-surface-2);
}
html[data-nv-theme="dark"] .fc .fc-toolbar-title,
html[data-nv-theme="dark"] .fc .fc-col-header-cell-cushion,
html[data-nv-theme="dark"] .fc .fc-daygrid-day-number,
html[data-nv-theme="dark"] .fc .fc-list-day-cushion,
html[data-nv-theme="dark"] .fc .fc-list-event td { color: var(--nv-ink); }
html[data-nv-theme="dark"] .fc .fc-timegrid-axis-cushion,
html[data-nv-theme="dark"] .fc .fc-timegrid-slot-label-cushion,
html[data-nv-theme="dark"] .fc .fc-day-other .fc-daygrid-day-top { color: var(--nv-muted); }
html[data-nv-theme="dark"] .fc table.fc-scrollgrid,
html[data-nv-theme="dark"] .fc table.fc-scrollgrid td,
html[data-nv-theme="dark"] .fc table.fc-scrollgrid .fc-col-header .fc-col-header-cell,
html[data-nv-theme="dark"] .fc .fc-list .fc-list-table th,
html[data-nv-theme="dark"] .fc .fc-list .fc-list-table .fc-list-event td { border-color: var(--nv-line-2); }
html[data-nv-theme="dark"] .fc .fc-day-today:not(.fc-col-header-cell) { background-color: var(--nv-accent-tint) !important; }
html[data-nv-theme="dark"] .fc .fc-popover { background-color: var(--nv-surface); border-color: var(--nv-line-2); box-shadow: var(--nv-shadow); }
html[data-nv-theme="dark"] .fc .fc-popover .fc-popover-header,
html[data-nv-theme="dark"] .fc .fc-list .fc-list-table .fc-list-day th,
html[data-nv-theme="dark"] .fc .fc-list-sticky .fc-list-day > * { background: var(--nv-surface-2); color: var(--nv-ink); }
html[data-nv-theme="dark"] .app-calendar-wrapper,
html[data-nv-theme="dark"] .app-calendar-wrapper .app-calendar-sidebar,
html[data-nv-theme="dark"] .app-calendar-wrapper .app-calendar-content { background-color: var(--nv-surface); border-color: var(--nv-line-2); }
html[data-nv-theme="dark"] .event-tooltip {
    background-color: var(--nv-surface-2); color: var(--nv-ink);
    border: 1px solid var(--nv-line-2); box-shadow: var(--nv-shadow);
}

/* ── Leaflet (tiles stay light; chrome goes dark) ── */
html[data-nv-theme="dark"] .leaflet-popup-content-wrapper,
html[data-nv-theme="dark"] .leaflet-popup-tip,
html[data-nv-theme="dark"] .leaflet-bar a,
html[data-nv-theme="dark"] .leaflet-control-layers { background: var(--nv-surface); color: var(--nv-ink); border-color: var(--nv-line-2); }
html[data-nv-theme="dark"] .leaflet-container a.leaflet-popup-close-button { color: var(--nv-muted); }
html[data-nv-theme="dark"] .leaflet-control-attribution { background: rgba(20, 28, 69, 0.8); color: var(--nv-muted); }

/* ── SweetAlert / tooltips ── */
html[data-nv-theme="dark"] .swal2-modal.swal2-popup { background: var(--nv-surface); color: var(--nv-ink); border: 1px solid var(--nv-card-border); }
html[data-nv-theme="dark"] .swal2-popup .swal2-title,
html[data-nv-theme="dark"] .swal2-popup .swal2-html-container { color: var(--nv-ink); }
html[data-nv-theme="dark"] .tooltip .tooltip-inner { background-color: #2A3570; color: #fff; }

/* ── AI chat widget (ai_chat.css is light-hardcoded) ── */
html[data-nv-theme="dark"] #ai-chat-root {
    --panel: var(--nv-surface);
    --text: var(--nv-ink);
    --muted: var(--nv-muted);
    --border: var(--nv-line-2);
    --accent: var(--nv-accent);
    --ring: rgba(var(--nv-accent-rgb), 0.3);
}
html[data-nv-theme="dark"] #ai-chat-root .ai-panel { box-shadow: var(--nv-shadow-lg); }
html[data-nv-theme="dark"] #ai-chat-root .ai-header,
html[data-nv-theme="dark"] #ai-chat-root .ai-privacy-tip,
html[data-nv-theme="dark"] #ai-chat-root .ai-msg--ai .ai-bubble,
html[data-nv-theme="dark"] #ai-chat-root .ai-chip,
html[data-nv-theme="dark"] #ai-chat-root .ai-input { background: var(--nv-surface-2); color: var(--nv-ink); }
html[data-nv-theme="dark"] #ai-chat-root .ai-privacy-tip,
html[data-nv-theme="dark"] #ai-chat-root .ai-pii-note,
html[data-nv-theme="dark"] #ai-chat-root .ai-sources,
html[data-nv-theme="dark"] #ai-chat-root .ai-icon-btn,
html[data-nv-theme="dark"] #ai-chat-root .ai-input::placeholder { color: var(--nv-muted); }
html[data-nv-theme="dark"] #ai-chat-root .ai-footer { background: var(--nv-surface); }
html[data-nv-theme="dark"] #ai-chat-root .ai-avatar { background: var(--nv-surface-2); }
html[data-nv-theme="dark"] #ai-chat-root .ai-body::-webkit-scrollbar-thumb { background: var(--nv-line-2); }
html[data-nv-theme="dark"] #ai-chat-root .ai-chip:hover { background: var(--nv-accent-tint); border-color: var(--nv-accent-text); color: var(--nv-accent-text); }
html[data-nv-theme="dark"] #ai-chat-root .ai-icon-btn:hover { color: var(--nv-ink); background: var(--nv-surface-2); }
html[data-nv-theme="dark"] #ai-chat-root .ai-bubble a { color: var(--nv-accent-text); }
html[data-nv-theme="dark"] #ai-chat-root .ai-msg--user .ai-bubble a { color: #fff; }
html[data-nv-theme="dark"] #ai-chat-root .ai-bubble code { background: rgba(var(--nv-accent-rgb), 0.18); }
html[data-nv-theme="dark"] #ai-chat-root .ai-callout { background: var(--nv-surface-2); color: var(--nv-ink); border-color: var(--nv-line-2); }
html[data-nv-theme="dark"] #ai-chat-root .ai-callout.ai-safe { background: rgba(var(--nv-success-rgb), 0.14); border-color: rgba(var(--nv-success-rgb), 0.35); }
html[data-nv-theme="dark"] #ai-chat-root .ai-typing .dot { background: var(--nv-muted); }

/* ── Health questionnaires / declaration forms ── */
html[data-nv-theme="dark"] .slider-container { background-color: var(--nv-surface-2); }
html[data-nv-theme="dark"] input:checked ~ .slider-container { background-color: rgba(var(--nv-accent-rgb), 0.28); }
html[data-nv-theme="dark"] .slider-text,
html[data-nv-theme="dark"] .health-declaration-details,
html[data-nv-theme="dark"] .response-question,
html[data-nv-theme="dark"] .fts-name { color: var(--nv-ink); }
html[data-nv-theme="dark"] .response-item { background-color: var(--nv-surface-2); }
html[data-nv-theme="dark"] .response-item:hover,
html[data-nv-theme="dark"] .fts-card.active { background: var(--nv-accent-tint); }
html[data-nv-theme="dark"] .fts-card,
html[data-nv-theme="dark"] .vas-wrap,
html[data-nv-theme="dark"] .q-block { background: var(--nv-surface); }
html[data-nv-theme="dark"] .skeleton { background: var(--nv-line-2); }
html[data-nv-theme="dark"] .readonly-field { background: var(--nv-surface-2) !important; color: var(--nv-ink); }
html[data-nv-theme="dark"] .sticky-actions { background: var(--nv-surface); border-top-color: var(--nv-line-2); }

/* ── Messaging ── */
html[data-nv-theme="dark"] .thread-item:hover { background-color: var(--nv-surface-2); }
html[data-nv-theme="dark"] .thread-item.has-unread { background-color: var(--nv-accent-tint); }
html[data-nv-theme="dark"] .thread-subject,
html[data-nv-theme="dark"] .msg-sender { color: var(--nv-ink); }
html[data-nv-theme="dark"] .thread-preview,
html[data-nv-theme="dark"] .thread-time,
html[data-nv-theme="dark"] .empty-state i { color: var(--nv-muted); }
html[data-nv-theme="dark"] .chat-header,
html[data-nv-theme="dark"] .chat-footer { background: var(--nv-surface); border-color: var(--nv-line-2); }
html[data-nv-theme="dark"] .chat-messages { background: var(--nv-canvas); }
html[data-nv-theme="dark"] .msg-row.received .msg-bubble { background: var(--nv-surface-2); border-color: var(--nv-line-2); color: var(--nv-ink); }
html[data-nv-theme="dark"] .date-separator span { background: var(--nv-canvas); color: var(--nv-muted); }

/* ── Focus ── */
html[data-nv-theme="dark"] a:focus-visible,
html[data-nv-theme="dark"] .btn:focus-visible,
html[data-nv-theme="dark"] .menu-link:focus-visible,
html[data-nv-theme="dark"] .page-link:focus-visible,
html[data-nv-theme="dark"] .pg-act:focus-visible {
    outline: 2px solid var(--nv-accent-text); outline-offset: 2px;
}

/* ── FullCalendar view switcher (Vuexy paints it purple-on-purple) ── */
html[data-nv-theme="dark"] .fc .fc-toolbar .fc-button-group .fc-button-primary:not(.fc-prev-button):not(.fc-next-button),
html[data-nv-theme="dark"] .fc .fc-toolbar .fc-today-button {
    background-color: var(--nv-surface-2) !important; border-color: var(--nv-line-2) !important;
    color: var(--nv-ink) !important;
}
html[data-nv-theme="dark"] .fc .fc-toolbar .fc-button-group .fc-button-primary.fc-button-active:not(.fc-prev-button):not(.fc-next-button) {
    background-color: var(--nv-accent) !important; border-color: var(--nv-accent) !important;
    color: #fff !important;
}
html[data-nv-theme="dark"] .fc .fc-toolbar .fc-prev-button .fc-icon,
html[data-nv-theme="dark"] .fc .fc-toolbar .fc-next-button .fc-icon { color: var(--nv-ink); }

/* ── Auth pages (login, register, password reset, OTP) ── */
html[data-nv-theme="dark"] .authentication-wrapper .authentication-bg { background-color: var(--nv-surface) !important; }
html[data-nv-theme="dark"] .auth-cover-bg-color { background-color: var(--nv-canvas) !important; }
html[data-nv-theme="dark"] .authentication-wrapper .authentication-inner .card { background-color: var(--nv-surface); }
html[data-nv-theme="dark"] .authentication-wrapper .divider .divider-text { color: var(--nv-muted); }
html[data-nv-theme="dark"] .authentication-wrapper .divider .divider-text::before,
html[data-nv-theme="dark"] .authentication-wrapper .divider .divider-text::after { border-color: var(--nv-line-2); }
html[data-nv-theme="dark"] .input-group-merge .input-group-text { background-color: var(--nv-surface-2); }
html[data-nv-theme="dark"] input:-webkit-autofill,
html[data-nv-theme="dark"] input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--nv-ink);
    -webkit-box-shadow: 0 0 0 1000px #1B2454 inset;
    caret-color: var(--nv-ink);
}

/* Plain links (see the note in nubiss_shell.css): zero-specificity, so any
   component class on a link keeps control of its own colour. */
:where(html[data-nv-theme="dark"]) a { color: #8FA7F0; }
:where(html[data-nv-theme="dark"]) a:hover { color: #B3C3F5; }

/* Calendar events: switch to the dark background/text pair (see nubiss_shell.css). */
html[data-nv-theme="dark"] .fc .nv-cal-event,
html[data-nv-theme="dark"] .fc .nv-cal-event.fc-daygrid-dot-event,
html[data-nv-theme="dark"] .fc .fc-list-event.nv-cal-event td {
    background-color: var(--nv-ev-bg-dark) !important;
    border-color: color-mix(in srgb, var(--nv-ev-bg-dark) 70%, #ffffff 18%) !important;
    color: var(--nv-ev-fg-dark) !important;
    --fc-event-text-color: var(--nv-ev-fg-dark);
}
html[data-nv-theme="dark"] .fc .nv-cal-event .fc-event-main,
html[data-nv-theme="dark"] .fc .nv-cal-event .fc-event-title,
html[data-nv-theme="dark"] .fc .nv-cal-event .fc-event-time,
html[data-nv-theme="dark"] .fc .nv-cal-event .fc-list-event-title,
html[data-nv-theme="dark"] .fc .nv-cal-event .fc-list-event-title a,
html[data-nv-theme="dark"] .fc .nv-cal-event .custom-list-view-content { color: var(--nv-ev-fg-dark) !important; }
html[data-nv-theme="dark"] .fc .nv-cal-event .fc-daygrid-event-dot { border-color: var(--nv-ev-fg-dark) !important; }
