/*
 * Emaar Al Diyafa brand layer.
 *
 * WHY THIS FILE EXISTS
 * Skote ships Bootstrap 5.0.0-beta2, which declares --bs-primary in :root but never
 * reads it — var()-driven theming only arrived in 5.2. Setting --bs-primary to gold
 * changes nothing. The template's indigo #556ee6 is hardcoded ~35x in bootstrap.min.css
 * and ~80x in app.min.css (plus identical counts in their -dark twins), and there is no
 * SCSS source and no build step, so the brand colour cannot be recompiled.
 *
 * The override therefore re-declares the reachable selectors here. Loaded LAST in
 * _Head.cshtml and _AuthLayout.cshtml, so at equal specificity it wins on source order —
 * including over !important rules, which lose to a later !important. It also sits outside
 * the light/dark switcher, which only rewrites the href on #bootstrap-style / #app-style,
 * so one file covers both themes. Same strategy as sidebar-custom.css.
 *
 * Only selectors this app actually renders are restated. Most of app.min.css's indigo
 * belongs to unreachable Skote demo components (gmaps, wizards, product swatches,
 * ion-rangeslider, owl carousels) and is deliberately left alone.
 *
 * COLOUR SPLIT — this is a legibility rule, not a preference.
 *   white on #B59349 (Gold)        = 2.90:1  fails WCAG AA
 *   white on #9A692B (Gold Copper) = 4.70:1  passes
 *   #B59349 on #2a3042 (sidebar)   = 4.53:1  passes
 * So anything carrying small text uses Copper; Gold carries the identity everywhere it is
 * decorative — borders, tints, focus rings, gradients, and the dark sidebar, where it passes.
 *
 * TYPOGRAPHY is intentionally untouched. Trajan Pro / DIN Next LT Arabic are licensed
 * faces with no webfont files in the repo. When they arrive: add @font-face here plus
 * :root{--bs-font-sans-serif:...} — that variable IS consumed by this Bootstrap build.
 */

:root {
    /* Raw palette — fixed values, never theme-dependent. */
    --brand-gold: #B59349; /* Pantone 1245 C — identity */
    --brand-gold-rgb: 181, 147, 73;
    --brand-copper: #9A692B; /* Pantone 724 C */
    --brand-copper-rgb: 154, 105, 43;
    --brand-copper-dark: #8A5F26; /* hover */
    --brand-copper-darker: #75501F; /* pressed */
    --brand-light-grey: #F1F1F1; /* Pantone 538 C */
    --brand-off-white: #E2DBCB; /* Pantone 454 C */
    --brand-gradient: linear-gradient(90deg, #9A692B 0%, #B59349 55%, #D9B45F 100%);
    /* Semantic — INK is the brand colour for text on the page surface, FILL is the brand
       colour for solid blocks carrying white text. They diverge by theme; see below. */
    --brand-ink: var(--brand-copper);
    --brand-ink-hover: var(--brand-copper-dark);
    --brand-fill: var(--brand-copper);
    /* Surfaces — consumed by task-cards.css, dashboard.css and the _CommentsChat panel,
       none of which the theme switcher touches. One set, four consumers. */
    --surface-card: #fff;
    --surface-sunken: #f1f3f7;
    --surface-hover: #f8f9fa;
    --surface-line: #eff2f7;
    --surface-line-strong: #c9cfde;
    --surface-ring: #fff;
    --surface-text: #495057;
    --shadow-color: rgba(18, 38, 63, .18); /* card lift */
    --shadow-color-soft: rgba(18, 38, 63, .10); /* chat bubbles, avatar rings */
}

/* ── Dark theme ───────────────────────────────────────────────────────────────
 * data-theme is stamped on <html> by the inline script in _Head.cshtml / _AuthLayout.cshtml.
 * It exists because Skote's switcher rewrites only the #bootstrap-style / #app-style hrefs
 * and sets no class or attribute — without the stamp nothing here could react at all.
 *
 * THE PALETTE INVERTS, and this is the whole point of splitting ink from fill:
 *   copper #9A692B on the dark card #2a3042 = 2.8:1  (fails)
 *   gold   #B59349 on the dark card #2a3042 = 5.1:1  (passes)
 * So INK becomes gold. FILL stays copper — white on copper is 4.70:1 regardless of what
 * is behind the block, so solid brand buttons and badges are correct in both themes.
 *
 * #32394e is the vendor's single hairline colour in dark (borders, tables, modals,
 * dropdowns). Matching it is what keeps our components looking native.
 */

html[data-theme="dark"] {
    /* Warm charcoal, replacing Skote's blue-navy (#222736 / #2a3042 / #32394e). The stock
       dark build is cool-toned and actively fights a warm gold identity — gold on navy
       reads as an accent bolted onto someone else's theme. These are neutral-warm greys
       drawn toward the brand, so gold sits inside the family instead of on top of it.
       It also measures better: gold on #24201B is 5.57:1 against 4.52:1 on the navy card. */
    --dk-page: #1B1815;
    --dk-card: #24201B;
    --dk-raised: #2C2721; /* topbar, footer, inputs — one step above the card */
    --dk-line: #3A342C;
    --dk-line-strong: #4A4238;
    --dk-text: #C9C2B6; /* 9.15:1 on the card */
    --dk-muted: #9A9287; /* 5.26:1, and dimmer than body text */
    --brand-ink: var(--brand-gold);
    --brand-ink-hover: #C9A961;
    --surface-card: var(--dk-card);
    --surface-sunken: var(--dk-raised);
    --surface-hover: var(--dk-raised);
    --surface-line: var(--dk-line);
    --surface-line-strong: var(--dk-line-strong);
    --surface-ring: var(--dk-card);
    --surface-text: var(--dk-text);
    --shadow-color: rgba(0, 0, 0, .45);
    --shadow-color-soft: rgba(0, 0, 0, .30);
}


/* ══ Bootstrap layer ═══════════════════════════════════════════════════════════
 * Mirrors the shape of the rules in bootstrap.min.css, !important included where
 * the original carries it.
 */

/* ── Links ──────────────────────────────────────────────────────────────────
 * Text on the page surface, so these take INK — copper on light, gold on dark. */

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

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

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

    .link-primary:focus,
    .link-primary:hover {
        color: var(--brand-ink-hover);
    }

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

    .btn-link:hover {
        color: var(--brand-ink-hover);
    }

/* ── Buttons ──────────────────────────────────────────────────────────────── */

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

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

.btn-check:focus + .btn-primary,
.btn-primary:focus {
    color: #fff;
    background-color: var(--brand-copper-dark);
    border-color: var(--brand-copper-dark);
    -webkit-box-shadow: 0 0 0 .15rem rgba(var(--brand-gold-rgb), .5);
    box-shadow: 0 0 0 .15rem rgba(var(--brand-gold-rgb), .5);
}

.btn-check:active + .btn-primary,
.btn-check:checked + .btn-primary,
.btn-primary.active,
.btn-primary:active,
.show > .btn-primary.dropdown-toggle {
    color: #fff;
    background-color: var(--brand-copper-darker);
    border-color: var(--brand-copper-darker);
}

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

/* Resting outline is text-on-surface (INK); the hover state becomes a fill carrying
   white, so it reverts to copper. */
.btn-outline-primary {
    color: var(--brand-ink);
    border-color: var(--brand-ink);
}

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

.btn-check:focus + .btn-outline-primary,
.btn-outline-primary:focus {
    -webkit-box-shadow: 0 0 0 .15rem rgba(var(--brand-gold-rgb), .5);
    box-shadow: 0 0 0 .15rem rgba(var(--brand-gold-rgb), .5);
}

.btn-check:active + .btn-outline-primary,
.btn-check:checked + .btn-outline-primary,
.btn-outline-primary.active,
.btn-outline-primary.dropdown-toggle.show,
.btn-outline-primary:active {
    color: #fff;
    background-color: var(--brand-copper);
    border-color: var(--brand-copper);
}

.btn-outline-primary.disabled,
.btn-outline-primary:disabled {
    color: var(--brand-ink);
    background-color: transparent;
}

/* ── Soft action buttons ──────────────────────────────────────────────────────
 * The row actions in every list page were three saturated blocks (blue view, green
 * edit, red delete) — loud on a long table, and the blue/green were stock Skote
 * semantics rather than anything meaningful. These are the quiet equivalents: a tinted
 * square with a coloured glyph, matching the .bg-soft-* badge language already used for
 * every status, role and priority chip, so the table reads as one system.
 *
 * The hierarchy is deliberate: view is neutral (passive), edit carries the single brand
 * accent in the row, delete stays red so the dangerous one still announces itself.
 * Hover deepens the tint rather than changing hue — the colour already said what it is.
 */

.btn-soft-secondary,
.btn-soft-primary,
.btn-soft-success,
.btn-soft-warning,
.btn-soft-danger {
    border: none;
}

.btn-soft-secondary {
    background-color: rgba(116, 120, 141, .15);
    color: #74788d;
}

    .btn-soft-secondary:hover,
    .btn-soft-secondary:focus {
        background-color: rgba(116, 120, 141, .28);
        color: #5d6070;
    }

.btn-soft-primary {
    background-color: rgba(var(--brand-gold-rgb), .18);
    color: var(--brand-ink);
}

    .btn-soft-primary:hover,
    .btn-soft-primary:focus {
        background-color: rgba(var(--brand-gold-rgb), .32);
        color: var(--brand-ink-hover);
    }

/* Success and warning exist for the controls whose colour carries real meaning — the
   schedule pause/resume pair and the user activate/deactivate toggle. They are softened
   to match the language, not recoloured, because the hue is the message there. */
.btn-soft-success {
    background-color: rgba(52, 195, 143, .15);
    color: #2a9c74;
}

    .btn-soft-success:hover,
    .btn-soft-success:focus {
        background-color: rgba(52, 195, 143, .28);
        color: #218060;
    }

.btn-soft-warning {
    background-color: rgba(241, 180, 76, .18);
    color: #b6812a;
}

    .btn-soft-warning:hover,
    .btn-soft-warning:focus {
        background-color: rgba(241, 180, 76, .32);
        color: #96691f;
    }

/* The glyph is a deepened red, not Skote's #f46a6a: that measures 2.95:1 on white, under
   even the 3:1 floor for non-text UI. The tint stays the lighter brand red. */
.btn-soft-danger {
    background-color: rgba(244, 106, 106, .15);
    color: #d64545;
}

    .btn-soft-danger:hover,
    .btn-soft-danger:focus {
        background-color: rgba(244, 106, 106, .28);
        color: #bf3a3a;
    }

/* On the warm dark ground the neutral tint disappears and the reds/greys need lifting. */
html[data-theme="dark"] .btn-soft-secondary {
    background-color: rgba(255, 255, 255, .10);
    color: var(--dk-muted);
}

    html[data-theme="dark"] .btn-soft-secondary:hover,
    html[data-theme="dark"] .btn-soft-secondary:focus {
        background-color: rgba(255, 255, 255, .18);
        color: var(--dk-text);
    }

html[data-theme="dark"] .btn-soft-success {
    background-color: rgba(52, 195, 143, .20);
    color: #5fd3ac;
}

html[data-theme="dark"] .btn-soft-warning {
    background-color: rgba(241, 180, 76, .20);
    color: #f0c274;
}

html[data-theme="dark"] .btn-soft-danger {
    background-color: rgba(244, 106, 106, .20);
    color: #f78b8b;
}

    html[data-theme="dark"] .btn-soft-danger:hover,
    html[data-theme="dark"] .btn-soft-danger:focus {
        background-color: rgba(244, 106, 106, .32);
        color: #ffa5a5;
    }

/* Generic focus ring — every button in the app, not just primary. */
.btn-check:focus + .btn,
.btn:focus {
    -webkit-box-shadow: 0 0 0 .15rem rgba(var(--brand-gold-rgb), .25);
    box-shadow: 0 0 0 .15rem rgba(var(--brand-gold-rgb), .25);
}

/* app.min.css adds `label { margin-bottom: .5rem }` — stock Bootstrap 5 Reboot does not — and
   .btn never resets it. A btn-check segmented control is built from <label class="btn"> inside a
   .btn-group, which is inline-FLEX, so that 8px lands on the flex line's cross size and the whole
   control renders 8px taller than the inputs beside it. Measured: group 44.5px vs label 36.5px vs
   .form-select 36.5px, which is why the Task/Create recurrence pills would not line up with the
   selects next to them. The EN|عر switcher is built from <button>, so it was never affected — this
   guards any future label-based group. */
.btn-group > .btn {
    margin-bottom: 0;
}

/* ── Form controls ────────────────────────────────────────────────────────── */

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

    .form-check-input[type=checkbox]:indeterminate {
        background-color: var(--brand-copper);
        border-color: var(--brand-copper);
    }

    .form-check-input:focus,
    .form-select:focus {
        border-color: var(--brand-gold);
        -webkit-box-shadow: 0 0 0 .15rem rgba(var(--brand-gold-rgb), .25);
        box-shadow: 0 0 0 .15rem rgba(var(--brand-gold-rgb), .25);
    }

/* Skote flattens the text-input focus ring to none; a hairline gold border is the
   only affordance these fields get, so it is worth restoring. */
.form-control:focus {
    border-color: var(--brand-gold);
}

/* The date fields are [readonly] (they are driven by the datepicker popup), and Bootstrap
   greys readonly inputs out. The views countered that with a hardcoded .bg-white, which
   forced white in dark mode too — two glaring white boxes on the Task form. Handled here
   per theme instead, so the class could be removed from the markup. */
.datepicker-input[readonly] {
    background-color: #fff;
}

html[data-theme="dark"] .datepicker-input[readonly] {
    background-color: var(--dk-raised);
}

.form-range::-webkit-slider-thumb {
    background-color: var(--brand-copper);
}

.form-range::-moz-range-thumb {
    background-color: var(--brand-copper);
}

/* ── Navigation, pagination, progress ─────────────────────────────────────── */

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    color: #fff;
    background-color: var(--brand-copper);
}

.nav-tabs-custom .nav-item .nav-link::after {
    background: var(--brand-gold);
}

.nav-tabs-custom .nav-item .nav-link.active {
    color: var(--brand-ink);
}

.page-link:hover,
.page-link:focus {
    color: var(--brand-ink-hover);
}

.page-link:focus {
    -webkit-box-shadow: 0 0 0 .15rem rgba(var(--brand-gold-rgb), .25);
    box-shadow: 0 0 0 .15rem rgba(var(--brand-gold-rgb), .25);
}

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

.progress-bar {
    background-color: var(--brand-copper);
}

.list-group-item.active {
    color: #fff;
    background-color: var(--brand-copper);
    border-color: var(--brand-copper);
}

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

/* ── Colour utilities ─────────────────────────────────────────────────────── */

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

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

    .bg-primary.bg-soft {
        background-color: rgba(var(--brand-gold-rgb), .22) !important;
    }

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

.badge-soft-primary {
    color: var(--brand-ink);
    background-color: rgba(var(--brand-gold-rgb), .18);
}

    .badge-soft-primary[href]:focus,
    .badge-soft-primary[href]:hover {
        color: var(--brand-ink);
        background-color: rgba(var(--brand-gold-rgb), .4);
    }


/* ══ Skote app layer ═══════════════════════════════════════════════════════════ */

/* ── Menu active state (generic) ──────────────────────────────────────────────
 * .mm-active carries !important upstream. The coloured-sidebar rules in the section
 * below are more specific AND !important, so this generic rule only reaches the light
 * sidebar and the (unused) horizontal nav.
 */

.mm-active,
.mm-active > a,
.mm-active > a i,
.mm-active > i,
.mm-active .active,
.mm-active .active i {
    color: var(--brand-copper) !important;
}

/* ── Settings right bar ───────────────────────────────────────────────────────
 * The scrim behind the settings panel. Skote's light build uses rgba(52,58,64,.55) —
 * Bootstrap's blue-grey — and the dark build uses rgba(239,242,247,.55), i.e. a near-WHITE
 * scrim laid over a dark page, which washes the whole app out instead of dimming it.
 * A scrim should always be darker than what it covers, and warm to match the surfaces.
 */

.rightbar-overlay {
    background-color: rgba(27, 24, 21, .5);
}

html[data-theme="dark"] .rightbar-overlay {
    background-color: rgba(12, 10, 9, .66);
}

html[data-theme="dark"] .right-bar {
    background-color: var(--dk-card);
}

    html[data-theme="dark"] .right-bar .right-bar-toggle {
        color: var(--dk-card);
    }

/* ── Topbar ───────────────────────────────────────────────────────────────────
 * The guideline's gradient bar, as a hairline under the fixed header. A pseudo-element
 * rather than a border so it adds no height and cannot shift the 70px content offset.
 */

#page-topbar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -3px;
    height: 3px;
    background: var(--brand-gradient);
}

/* ── Components ───────────────────────────────────────────────────────────── */

/* Tinted panel with a gold edge — the contract block and the recurring-schedule block
   on the Task forms. The edge is a LOGICAL border, so it mirrors in Arabic on its own
   and needs no rtl.css entry (same reasoning as org-chart.css). This replaces three
   inline copies that hardcoded #B59349 and a physical border-left, which stayed on the
   trailing edge in RTL. !important beats Bootstrap's .border shorthand on the same box. */
.panel-accent {
    background-color: rgba(var(--brand-gold-rgb), .08);
    border-inline-start: 3px solid var(--brand-gold) !important;
}

.avatar-title {
    background-color: var(--brand-copper);
}

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

    .form-radio-primary .form-check-input:checked:after {
        background-color: var(--brand-copper);
    }

input[switch]:checked + label,
input[switch=primary]:checked + label {
    background-color: var(--brand-copper);
}

.card-radio-input:checked + .card-radio {
    border-color: var(--brand-gold) !important;
}

.waves-effect.waves-primary .waves-ripple {
    background-color: rgba(var(--brand-gold-rgb), .4);
}

/* Select2 — the assignee picker on Task Create/Edit. */
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option[aria-selected=true]:hover {
    background-color: var(--brand-copper);
}

/* SweetAlert2 + Toastr accents. */
.swal2-loader {
    border-color: var(--brand-copper) transparent var(--brand-copper) transparent;
}

.toast-primary {
    border: 2px solid var(--brand-copper) !important;
    background-color: rgba(var(--brand-copper-rgb), .8) !important;
}

/* Vendor chat styles — the app's own chat lives in _CommentsChat.cshtml, but these
   leak into any .chat-conversation markup Skote renders. */
.chat-conversation .conversation-list .ctext-wrap {
    background-color: rgba(var(--brand-gold-rgb), .12);
}

    .chat-conversation .conversation-list .ctext-wrap .conversation-name {
        color: var(--brand-ink);
    }

.message-list li.active,
.message-list li.active:hover {
    -webkit-box-shadow: inset 3px 0 0 var(--brand-gold);
    box-shadow: inset 3px 0 0 var(--brand-gold);
}


/* ══ Coloured sidebar ══════════════════════════════════════════════════════════
 * _Layout.cshtml sets body[data-sidebar="colored"], which activates 23 vendor rules
 * (identical in app.min.css and app-dark.min.css) built for a saturated brand sidebar.
 * They are all keyed on Skote's #556ee6; this section repaints them Gold Copper.
 *
 * Specificity, not source order, is what matters here — the vendor reaches 1,3,3
 * (body[data-sidebar=colored] #sidebar-menu ul li a i), so the overrides restate the
 * same selector shape. Being later in the file is not enough on its own.
 *
 * WHY EVERY LABEL IS PURE WHITE. On #9A692B, white measures 4.70:1 — that is the
 * ceiling, not headroom. Skote's own hierarchy dims inactive links to
 * rgba(255,255,255,.6), which lands near 2.5:1 here and fails AA outright. So the
 * hierarchy is carried by size, weight, letter-spacing and the active pill instead of
 * opacity. Icons are the one exception: they are non-text UI (3:1 threshold), so a
 * slight dim is safe and keeps some depth. Do not "restore" dimmed labels.
 *
 * Hover goes DARKER, never lighter, for the same reason — lightening the background
 * drops white below AA.
 */

body[data-sidebar=colored] .vertical-menu,
body[data-sidebar=colored] .navbar-brand-box {
    background-color: var(--brand-copper);
}

body[data-sidebar=colored] #sidebar-menu ul li a,
body[data-sidebar=colored] #sidebar-menu ul li a:hover,
body[data-sidebar=colored] #sidebar-menu ul li ul.sub-menu li a,
body[data-sidebar=colored] #sidebar-menu ul li ul.sub-menu li a:hover {
    color: #fff;
}

body[data-sidebar=colored] #sidebar-menu ul li a i {
    color: rgba(255, 255, 255, .85);
}

body[data-sidebar=colored] #sidebar-menu ul li a:hover i {
    color: #fff;
}

body[data-sidebar=colored] #sidebar-menu ul li a:hover {
    background-color: rgba(0, 0, 0, .12);
}

/* Section labels: tracking is now what separates a heading from a nav row. */
body[data-sidebar=colored] #sidebar-menu ul li.menu-title {
    color: #fff;
    letter-spacing: .08em;
}

/* Active item — gold on copper would be 1.8:1, so the accent bar goes white. */
body[data-sidebar=colored] #side-menu li.mm-active > a {
    background-color: rgba(255, 255, 255, .16);
    box-shadow: inset 3px 0 0 0 #fff;
}

/* Collapsed rail. The vendor widens the hovered row to #5e76e7 — LIGHTER than its
   base — which is exactly the move that breaks white text on copper. */
body[data-sidebar=colored].vertical-collpsed .vertical-menu #sidebar-menu > ul > li:hover > a {
    background-color: var(--brand-copper-dark);
    color: #fff;
}

/* The collapsed sub-menu flyout panel stays WHITE in this variant (unlike the dark one,
   which repaints it), so these read copper-on-white rather than white-on-copper. This
   app's sidebar is a flat list with no ul.sub-menu, so nothing renders them today —
   they are here so adding a sub-menu later cannot reintroduce Skote blue. */
body[data-sidebar=colored].vertical-collpsed .vertical-menu #sidebar-menu ul li.mm-active .active,
body[data-sidebar=colored].vertical-collpsed .vertical-menu #sidebar-menu ul li ul.sub-menu li.mm-active,
body[data-sidebar=colored].vertical-collpsed .vertical-menu #sidebar-menu ul li ul.sub-menu li.mm-active > a,
body[data-sidebar=colored].vertical-collpsed .vertical-menu #sidebar-menu ul li ul.sub-menu li.mm-active > a i {
    color: var(--brand-copper) !important;
}

body[data-sidebar=colored].vertical-collpsed .vertical-menu #sidebar-menu ul li ul.sub-menu li a:hover {
    color: var(--brand-copper);
}

/* ── Sidebar chrome ───────────────────────────────────────────────────────────
 * Geometry for these lives in sidebar-custom.css; only colour belongs here. The CTA
 * needs .btn-primary in the selector to outrank the .btn-primary rules further up.
 */

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

    .sidebar-cta .btn.btn-primary:hover,
    .sidebar-cta .btn.btn-primary:focus {
        background-color: var(--brand-off-white);
        border-color: var(--brand-off-white);
        color: var(--brand-copper-dark);
    }

/* RoleBadge returns semantic pairs (CEO -> "bg-soft-danger text-danger"). A red tint on
   copper is muddy and illegible, so on this sidebar the chip goes translucent white.
   !important is required: text-danger and friends carry it. */
body[data-sidebar=colored] .sidebar-scope .badge {
    background-color: rgba(255, 255, 255, .2) !important;
    color: #fff !important;
}

/* Nav count badges — bg-primary is copper, which vanishes into the sidebar. */
body[data-sidebar=colored] #side-menu .badge.bg-primary {
    background-color: #fff !important;
    color: var(--brand-copper) !important;
}

body[data-sidebar=colored] #side-menu .badge.bg-secondary {
    background-color: rgba(255, 255, 255, .24) !important;
    color: #fff !important;
}


/* ══ Auth pages ════════════════════════════════════════════════════════════════
 * _AuthLayout.cshtml loads no other custom stylesheet, so the login/access-denied
 * finish lives here. The card already carries .overflow-hidden, so the gradient edge
 * clips to its radius.
 */

.account-pages .card {
    position: relative;
}

/* The banner is .bg-primary.bg-soft with .text-primary copy on top. Copper on the gold
   tint measures 3.8:1 — fine for the heading, short of AA for the paragraph beneath it —
   so the banner drops one step. INK-hover rather than a literal: in dark the same tint
   sits over #2a3042 and needs the light end of the ramp, not the dark one. */
.account-pages .bg-primary.bg-soft .text-primary {
    color: var(--brand-ink-hover) !important;
}


/* ══ Missing soft utilities — MUST STAY LAST ═══════════════════════════════════
 * The six badge helpers (TaskStatusBadge, TaskPriorityBadge, RoleBadge,
 * DeadlineBadge, ScheduleDisplay, NotificationDisplay) all return "bg-soft-X text-X"
 * pairs, and views use bg-soft-primary 28x — but NO .bg-soft-* rule exists anywhere in
 * the loaded stylesheets. Skote only ships .badge-soft-* and the compound
 * .bg-primary.bg-soft, so every one of those badges renders as coloured text on no tint
 * at all. Defining them here is what makes the helpers do what they claim.
 * Hues match Skote's semantic palette; only primary is rebranded.
 *
 * Position matters: these are utilities and carry the same specificity (0,1,0) as the
 * components they override. The dashboard KPI tiles are
 * <span class="avatar-title rounded-circle bg-soft-@k.Color text-@k.Color">, and
 * .avatar-title sets its own background — so with this block earlier in the file every
 * KPI circle rendered solid copper instead of its semantic tint. Keep it at the bottom.
 */

.bg-soft-primary {
    background-color: rgba(var(--brand-gold-rgb), .18);
}

.bg-soft-secondary {
    background-color: rgba(116, 120, 141, .18);
}

.bg-soft-success {
    background-color: rgba(52, 195, 143, .18);
}

.bg-soft-info {
    background-color: rgba(80, 165, 241, .18);
}

.bg-soft-warning {
    background-color: rgba(241, 180, 76, .18);
}

.bg-soft-danger {
    background-color: rgba(244, 106, 106, .18);
}

.bg-soft-dark {
    background-color: rgba(52, 58, 64, .18);
}


/* ══ Dark-theme repairs ════════════════════════════════════════════════════════
 * Skote's dark build has a few of its own defects that make the page look unfinished.
 * These are not brand changes — they are the minimum needed for dark to be usable.
 */

/* ── Surfaces ─────────────────────────────────────────────────────────────────
 * Repaints the blue-navy onto the warm ramp. Deliberately scoped to what this app
 * actually renders — those hexes appear across hundreds of vendor selectors, nearly all
 * of them unused Skote demo components (tui-calendar, dropzone, spectrum, megamenu…).
 * Chasing all of them would be enormous and would break on the next component we adopt;
 * anything missed still lands on a neutral dark and simply looks slightly cool.
 */

html[data-theme="dark"] body {
    background-color: var(--dk-page);
    color: var(--dk-text);
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] #preloader {
    background-color: var(--dk-card);
}

/* Cards lose their edge entirely upstream: border:0 plus a 3%-opacity shadow, so
   separation is a ~5-point luminance step and nothing else. That is the flatness on a
   card-heavy page. */
html[data-theme="dark"] .card {
    border: 1px solid var(--dk-line);
}

/* Card headers are rgba(0,0,0,.03) over the card with a 0-width bottom border — i.e.
   invisible. Lift the fill and restore the divider. */
html[data-theme="dark"] .card-header,
html[data-theme="dark"] .card-footer {
    background-color: rgba(255, 255, 255, .03);
    border-bottom: 1px solid var(--dk-line);
}

html[data-theme="dark"] #page-topbar,
html[data-theme="dark"] .footer,
html[data-theme="dark"] .app-search .form-control,
html[data-theme="dark"] .navbar-header .dropdown .show.header-item {
    background-color: var(--dk-raised);
}

html[data-theme="dark"] .footer,
html[data-theme="dark"] .header-item,
html[data-theme="dark"] .table {
    color: var(--dk-text);
}

/* ── Hairlines ────────────────────────────────────────────────────────────── */

html[data-theme="dark"] .border,
html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border-end,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-start,
html[data-theme="dark"] .border-light {
    border-color: var(--dk-line) !important;
}

html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .table,
html[data-theme="dark"] .table-bordered,
html[data-theme="dark"] .table-bordered td,
html[data-theme="dark"] .table-bordered th,
html[data-theme="dark"] .nav-tabs,
html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    border-color: var(--dk-line);
}

/* ── Form controls ────────────────────────────────────────────────────────── */

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .select2-container .select2-selection--single,
html[data-theme="dark"] .select2-container .select2-selection--multiple,
html[data-theme="dark"] .select2-container--default .select2-search--dropdown .select2-search__field {
    background-color: var(--dk-raised);
    border-color: var(--dk-line);
    color: var(--dk-text);
}

    html[data-theme="dark"] .form-control::placeholder {
        color: var(--dk-muted);
    }

/* ── Text ─────────────────────────────────────────────────────────────────── */

/* The muted ramp is inverted upstream: .text-muted is #c3cbe4, LIGHTER than the body
   text #a6b0cf, so secondary copy shouts. This puts it back below body text while
   staying above the AA floor. */
html[data-theme="dark"] .text-muted {
    color: var(--dk-muted) !important;
}

/* .table-light backs every <thead> in the app; .bg-light backs the Details panels. */
/* Datepicker popup — the calendar itself. Its container inherits .dropdown-menu (already
   repainted above); these are the cells the vendor styles separately. */
html[data-theme="dark"] .datepicker table tr td.day:hover,
html[data-theme="dark"] .datepicker table tr td.day.focused,
html[data-theme="dark"] .datepicker table tr td span:hover {
    background: var(--dk-raised);
}

html[data-theme="dark"] .datepicker table tr td.new,
html[data-theme="dark"] .datepicker table tr td.old,
html[data-theme="dark"] .datepicker table tr td span.new,
html[data-theme="dark"] .datepicker table tr td span.old {
    color: var(--dk-muted);
}

/* Input-group addons keep Bootstrap's light #eff2f7 fill in dark mode, so every one of them
   reads as a white block: the Login password toggle, the Notes counters on the Organization /
   Corporation / Section edit forms, and the "days" suffix on the Task form's warning window. */
html[data-theme="dark"] .input-group-text {
    background-color: var(--dk-raised);
    border-color: var(--dk-line);
    color: var(--dk-text);
}

/* Timepicker popup (Due Time on the Task form). Like the datepicker its container inherits
   .dropdown-menu, but the vendor styles the arrows, the hour/minute boxes and the caret
   separately — all authored for a light panel, so on dark they came out as dark-on-dark
   chevrons, two white input boxes and a white triangle. */
html[data-theme="dark"] .bootstrap-timepicker-widget table td a {
    color: var(--dk-text);
}

html[data-theme="dark"] .bootstrap-timepicker-widget table td a:hover {
    background: var(--dk-raised);
    border-color: var(--dk-line-strong);
}

html[data-theme="dark"] .bootstrap-timepicker-widget table td input {
    background: var(--dk-raised);
    color: var(--dk-text);
    border-color: var(--dk-line);
}

/* The little caret: :before is the border, :after the fill. */
html[data-theme="dark"] .bootstrap-timepicker-widget.dropdown-menu:before {
    border-bottom-color: var(--dk-line-strong);
}

html[data-theme="dark"] .bootstrap-timepicker-widget.dropdown-menu:after {
    border-bottom-color: var(--dk-card);
}

/* DataTables' Previous/Next sit on the vendor's navy in every list page. The active page
   is a copper fill and stays as it is. */
html[data-theme="dark"] .page-link,
html[data-theme="dark"] .page-link:hover,
html[data-theme="dark"] .page-link:focus,
html[data-theme="dark"] .page-item.disabled .page-link {
    background-color: var(--dk-raised);
    border-color: var(--dk-line);
}

    html[data-theme="dark"] .page-item.disabled .page-link {
        color: var(--dk-muted);
    }

html[data-theme="dark"] .table-light,
html[data-theme="dark"] .bg-light {
    --bs-table-bg: var(--dk-raised);
    background-color: var(--dk-raised) !important;
    color: var(--dk-text) !important;
    border-color: var(--dk-line);
}

/* Chart text is painted by vendor CSS (with !important on the legend), not by the
   foreColor in chart-theme.js — so it has to be repainted here or the labels stay cool
   grey on the warm ground. */
html[data-theme="dark"] .apexcharts-legend-text {
    color: var(--dk-text) !important;
}

html[data-theme="dark"] .apexcharts-xaxis text,
html[data-theme="dark"] .apexcharts-yaxis text,
html[data-theme="dark"] .apex-charts text {
    fill: var(--dk-text);
}

/* A dark tint on a dark card shows nothing. Used by the six views that render
   "badge bg-soft-dark text-dark". */
html[data-theme="dark"] .bg-soft-dark {
    background-color: rgba(255, 255, 255, .12);
}

/* sweetalert2.min.css is loaded as its own <link> and is never theme-swapped, so every
   confirm dialog is a white slab in dark mode. */
html[data-theme="dark"] .swal2-popup {
    background: var(--dk-card);
    color: var(--dk-text);
}

    html[data-theme="dark"] .swal2-popup .swal2-title,
    html[data-theme="dark"] .swal2-popup .swal2-html-container {
        color: #EDE7DC;
    }

html[data-theme="dark"] .swal2-popup .swal2-input,
html[data-theme="dark"] .swal2-popup .swal2-textarea {
    background: var(--dk-raised);
    border-color: var(--dk-line);
    color: var(--dk-text);
}

    .account-pages .card::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: var(--brand-gradient);
        z-index: 2;
    }
