/* =====================================================================
   SWISS GUARD — BRAND LAYER  (swiss-brand.css)
   Aligns the whole command platform with www.swisssystems.co.za.

   How it works
   ------------
   1. Brand tokens live on :root as --sw-*.
   2. The legacy per-view tokens (--text, --panel, --st-brand, --od-*,
      --sg-* ...) are re-pointed at the brand with `html:root`, which
      out-ranks the plain `:root` blocks repeated inside ~200 views, so
      every page picks up the brand without its markup being touched.
   3. Shared components (.hero*, .panel, KPI tiles, tables, forms,
      Bootstrap, DataTables, Select2, SweetAlert2, toastr, tooltips) get
      brand styling. Colour overrides use `html body` specificity so they
      beat the copy-pasted per-view <style> blocks; structure (padding,
      grid, sizes) is left to each view so nothing re-flows.
   4. Opt out on any element with class `sg-raw`.

   Loaded LAST in <head> by _Layout.cshtml / _EmployeeZoneLayout.cshtml.
   ===================================================================== */

/* ---------- 1. Brand tokens (mirrors swisssystems.co.za site.css) ---------- */
:root {
    --sw-ink: #001433;
    --sw-ink-2: #0a2748;
    --sw-ink-3: #143a6b;
    --sw-navy: #282C68;
    --sw-blue: #5D6BA9;
    --sw-blue-2: #7d89c0;
    --sw-blue-soft: #eef0f8;
    --sw-blue-soft-2: #e1e5f3;
    --sw-paper: #ffffff;
    --sw-paper-2: #f6f8fb;
    --sw-paper-3: #eef2f8;
    --sw-green: #1f9d6b;
    --sw-green-hi: #25b87d;
    --sw-green-lo: #178556;
    --sw-green-soft: #e6f6ef;
    --sw-amber: #d98a0b;
    --sw-amber-soft: #fff5e0;
    --sw-red: #d9384a;
    --sw-red-soft: #fdecee;
    --sw-text: #001433;
    --sw-text-2: #3b4a64;
    --sw-text-3: #6b7a93;
    --sw-text-on-navy: #e9eef6;
    --sw-line: rgba(0,20,51,.09);
    --sw-line-2: rgba(0,20,51,.14);
    --sw-shadow-1: 0 1px 2px rgba(0,20,51,.05);
    --sw-shadow-2: 0 6px 18px rgba(0,20,51,.06), 0 2px 4px rgba(0,20,51,.04);
    --sw-shadow-3: 0 18px 44px rgba(0,20,51,.11), 0 4px 10px rgba(0,20,51,.05);
    --sw-radius: 14px;
    --sw-radius-lg: 20px;
    --sw-radius-sm: 10px;
    --sw-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --sw-font-display: 'Inter Tight', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --sw-mono: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
    --sw-grad-navy: radial-gradient(120% 120% at 100% -10%, rgba(93,107,169,.38) 0, rgba(93,107,169,0) 52%), linear-gradient(135deg, #001433 0%, #0a2748 46%, #1f2a63 78%, #282C68 100%);
    --sw-grad-green: linear-gradient(180deg, #1f9d6b 0%, #178556 100%);
    --sw-focus: 0 0 0 .22rem rgba(93,107,169,.28);
    /* Bootstrap 5.3 runtime variables */
    --bs-primary: #282C68;
    --bs-primary-rgb: 40,44,104;
    --bs-success: #1f9d6b;
    --bs-success-rgb: 31,157,107;
    --bs-info: #5D6BA9;
    --bs-info-rgb: 93,107,169;
    --bs-danger: #d9384a;
    --bs-danger-rgb: 217,56,74;
    --bs-warning: #e9a23b;
    --bs-warning-rgb: 233,162,59;
    --bs-dark: #001433;
    --bs-dark-rgb: 0,20,51;
    --bs-body-color: #001433;
    --bs-body-color-rgb: 0,20,51;
    --bs-secondary-color: rgba(59,74,100,.85);
    --bs-link-color: #282C68;
    --bs-link-color-rgb: 40,44,104;
    --bs-link-hover-color: #5D6BA9;
    --bs-link-hover-color-rgb: 93,107,169;
    --bs-border-color: rgba(0,20,51,.12);
    --bs-primary-bg-subtle: #eef0f8;
    --bs-primary-border-subtle: #c9cfe6;
    --bs-primary-text-emphasis: #282C68;
    --bs-success-bg-subtle: #e6f6ef;
    --bs-success-text-emphasis: #145f43;
    --bs-font-sans-serif: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    --bs-font-monospace: 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;
}

/* ---------- 2. Re-point legacy per-view tokens at the brand ---------- */
html:root {
    /* _Layout */
    --sg-bg: #f6f8fb;
    --sg-bg-2: #eef2f8;
    --sg-border: rgba(0,20,51,.09);
    --sg-text: #001433;
    --sg-muted: #5b6a84;
    --sg-navy-1: #001433;
    --sg-navy-2: #0a2748;
    --sg-navy-3: #143a6b;
    --sg-navy-4: #282C68;
    --sg-blue: #5D6BA9;
    --sg-green: #1f9d6b;
    --sg-red: #d9384a;
    --sg-shadow-lg: 0 18px 44px rgba(0,20,51,.10);
    --sg-shadow-md: 0 10px 24px rgba(0,20,51,.07);
    --sg-shadow-sm: 0 6px 14px rgba(0,20,51,.05);
    /* generic per-view tokens */
    --bg-1: #f6f8fb;
    --bg-2: #eef2f8;
    --border: rgba(0,20,51,.09);
    --text: #001433;
    --muted: #5b6a84;
    --shadow-lg: 0 18px 44px rgba(0,20,51,.10);
    --shadow-md: 0 10px 24px rgba(0,20,51,.07);
    --shadow-sm: 0 6px 14px rgba(0,20,51,.05);
    --navy: #001433;
    --navy-1: #001433;
    --navy-2: #0a2748;
    --navy-3: #143a6b;
    --navy-4: #282C68;
    --slate: #3b4a64;
    --blue: #5D6BA9;
    --green: #1f9d6b;
    --red: #d9384a;
    /* Stores / Occurrence / Fleet design kits */
    --st-ink: #001433;   --od-ink: #001433;
    --st-ink-2: #0a2748; --od-ink-2: #0a2748;
    --st-ink-3: #3b4a64; --od-ink-3: #3b4a64;
    --st-ink-4: #5b6a84; --od-ink-4: #5b6a84;
    --st-ink-5: #8d9ab0; --od-ink-5: #8d9ab0;
    --st-divider: #e8ecf3; --od-divider: #e8ecf3;
    --st-surface-2: #f8f9fc; --od-surface-2: #f8f9fc;
    --st-surface-3: #f1f4f9; --od-surface-3: #f1f4f9;
    --st-border-2: #d3d9e5; --od-border-2: #d3d9e5;
    --st-brand: #282C68; --od-brand: #282C68;
    --st-brand-2: #1f2356; --od-brand-2: #1f2356;
    --st-brand-3: #5D6BA9; --od-brand-3: #5D6BA9;
    --st-brand-soft: #eef0f8; --od-brand-soft: #eef0f8;
    --st-ok: #1f9d6b;   --od-ok: #1f9d6b;
    --st-ok-2: #157a52; --od-ok-2: #157a52;
    --st-danger: #d9384a; --od-danger: #d9384a;
    --st-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --st-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- 3. Base ---------- */
html body {
    font-family: var(--sw-font);
    color: var(--sw-text);
    background:
        radial-gradient(1100px 520px at 105% -8%, rgba(93,107,169,.11), rgba(93,107,169,0) 60%),
        radial-gradient(900px 480px at -8% 4%, rgba(40,44,104,.07), rgba(40,44,104,0) 60%),
        linear-gradient(180deg, #f6f8fb 0%, #eef2f8 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv11", "ss01";
}

::selection { background: rgba(93,107,169,.24); color: #001433; }


h1, h2, h3, h4, .h1, .h2, .h3, .h4,
.hero-title, [class$="-hero-title"], .page-title {
    font-family: var(--sw-font-display);
    letter-spacing: -.022em;
}

.tabular, .num, [class*="-value"], [class*="kpi"] .value, .hero-mini-value {
    font-variant-numeric: tabular-nums;
}

code, kbd, .mono, .font-monospace { font-family: var(--sw-mono); }

/* Thin branded scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(40,44,104,.28) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: rgba(40,44,104,.22); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background-color: rgba(40,44,104,.38); }
*::-webkit-scrollbar-track { background: transparent; }

/* Visible keyboard focus everywhere */
:focus-visible { outline: 2px solid var(--sw-blue); outline-offset: 2px; }

/* ---------- 4. Navbar (refines _Layout's .sg-navbar) ---------- */
html body .sg-navbar {
    background: var(--sw-grad-navy);
    border: 1px solid rgba(255,255,255,.07);
    box-shadow: 0 18px 40px rgba(0,20,51,.20);
}
html body .sg-navbar::after {
    /* Orbit-ring signature from the Swiss Systems mark */
    right: -120px; bottom: auto; top: -190px;
    width: 440px; height: 440px;
    background: radial-gradient(circle closest-side, transparent 0 70%, rgba(255,255,255,.08) 70.5% 71.2%, transparent 71.7% 96%, rgba(159,176,230,.12) 96.5% 97.3%, transparent 97.8%);
    transform: rotate(-18deg) scaleY(.6);
}
html body .sg-dropdown-item:hover,
html body .sg-dropdown-item:focus { background: var(--sw-blue-soft) !important; color: var(--sw-navy) !important; }
html body .sg-dropdown-item i.material-icons,
html body .sg-dropdown-item i.bi { color: var(--sw-blue); }
html body .sg-nav-link.active { background: rgba(255,255,255,.13); box-shadow: inset 0 -2px 0 var(--sw-green-hi); }
html body .sg-user-avatar { background: linear-gradient(135deg, #5D6BA9, #282C68); border-color: rgba(255,255,255,.22); }

.sg-clock {
    display: inline-flex; flex-direction: column; align-items: flex-end;
    line-height: 1; color: #fff; padding: .2rem .55rem;
    font-family: var(--sw-font-display);
}
.sg-clock-time { font-size: .95rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.sg-clock-date { font-size: .64rem; font-weight: 600; color: rgba(233,238,246,.66); margin-top: .2rem; }
@media (max-width: 1399.98px) { .sg-clock { display: none; } }

/* ---------- 4b. Navbar fit: one row on desktop, drawer below 1200px ---------- */
html body .sg-nav-cluster { flex-wrap: nowrap !important; }
@media (min-width: 1200px) {
    html body #mainNav.offcanvas-xl { flex: 1 1 auto; min-width: 0; }
    html body #mainNav .offcanvas-body { display: flex; align-items: center; gap: .4rem; min-width: 0; }
    html body .sg-nav-right { flex-wrap: nowrap; }
}
/* progressive compaction as the window narrows */
@media (min-width: 1200px) and (max-width: 1599.98px) {
    html body .sg-brand-copy { display: none !important; }
    html body .sg-user-name { display: none; }
    html body .sg-user-pill { padding: .3rem; }
}
@media (min-width: 1200px) and (max-width: 1399.98px) {
    html body .sg-nav-link { padding: .42rem .42rem !important; font-size: .76rem; gap: .25rem; }
    html body .sg-nav-link i.material-icons, html body .sg-nav-link i.bi { font-size: .88rem; }
}
/* More (priority+) menu */
html body .sg-more-menu { padding: .55rem !important; max-height: calc(100vh - 140px); overflow-y: auto; min-width: 280px; }
html body .sg-more-menu.two-col { width: min(640px, 92vw); grid-template-columns: 1fr 1fr; gap: .2rem .6rem; }
html body .sg-more-menu.two-col.show { display: grid; }
.sg-more-group { break-inside: avoid; padding-bottom: .35rem; }
.sg-more-head { display: flex; align-items: center; gap: .5rem; padding: .45rem .7rem .3rem; font-family: var(--sw-font-display); font-weight: 700; font-size: .82rem; color: var(--sw-navy); border-bottom: 1px solid var(--sw-line); margin-bottom: .2rem; }
.sg-more-head i { font-size: 1rem; color: var(--sw-blue); }
/* live link pill */
.sg-live { display: inline-flex; align-items: center; gap: .4rem; padding: .32rem .62rem; border-radius: 999px; font-size: .72rem; font-weight: 700; color: #fff; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); white-space: nowrap; }
.sg-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #25b87d; box-shadow: 0 0 0 0 rgba(37,184,125,.6); animation: sg-live-ping 2s ease-out infinite; }
.sg-live[data-state="reconnecting"] .sg-live-dot { background: #f2b544; animation-duration: .9s; }
.sg-live[data-state="disconnected"] .sg-live-dot { background: #ff6b7a; animation: none; }
.sg-live[data-state="disconnected"] { background: rgba(217,56,74,.22); border-color: rgba(255,107,122,.45); }
@keyframes sg-live-ping { 0% { box-shadow: 0 0 0 0 rgba(37,184,125,.55); } 80%, 100% { box-shadow: 0 0 0 8px rgba(37,184,125,0); } }
#sgLiveMobile { padding: .4rem; margin-left: auto; margin-right: .5rem; }
/* mobile / tablet drawer */
.sg-offcanvas-close { width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.08); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
html body .navbar-toggler.sg-toggler { font-size: 1.35rem; line-height: 1; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
@media (min-width: 1200px) { html body .navbar-toggler.sg-toggler { display: none !important; } }
@media (max-width: 1199.98px) {
    html body #mainNav.offcanvas-xl {
        --bs-offcanvas-width: min(380px, 92vw);
        background: var(--sw-grad-navy); color: #fff; border-left: 1px solid rgba(255,255,255,.08);
        margin-top: 0 !important; padding-top: 0 !important; border-top: 0 !important;
    }
    html body #mainNav .offcanvas-header { border-bottom: 1px solid rgba(255,255,255,.08); padding: .9rem 1rem; }
    html body #mainNav .offcanvas-body { display: flex; flex-direction: column; gap: .4rem; padding: .7rem .8rem 1.2rem; }
    html body #mainNav .sg-nav-link { width: 100%; justify-content: flex-start; padding: .7rem .8rem !important; font-size: .9rem; border-radius: 12px; }
    html body #mainNav .sg-nav-link.dropdown-toggle::after { display: inline-block !important; margin-left: auto; }
    html body #mainNav .dropdown-menu.sg-dropdown { background: rgba(255,255,255,.06) !important; border: 0 !important; box-shadow: none !important; margin: .2rem 0 .4rem !important; min-width: 0; }
    html body #mainNav .sg-dropdown-item { color: rgba(233,238,246,.92) !important; }
    html body #mainNav .sg-dropdown-item:hover, html body #mainNav .sg-dropdown-item:focus { background: rgba(255,255,255,.10) !important; color: #fff !important; }
    html body #mainNav .sg-dropdown-item i.material-icons, html body #mainNav .sg-dropdown-item i.bi { color: #9fb0e6; }
    html body #mainNav .sg-section-label { color: rgba(233,238,246,.55); }
    html body #mainNav .sg-nav-right { border-top: 1px solid rgba(255,255,255,.08); padding-top: .6rem; margin-top: auto; gap: .5rem !important; }
    html body #mainNav .sg-user-pill { width: 100%; border-radius: 14px; justify-content: flex-start; }
    html body #mainNav .sg-logout-btn { width: 100%; border-radius: 14px; }
    html body .sg-more { display: none !important; }
    /* backdrop-filter on the bar would trap the fixed drawer inside it; and the
       drawer lives inside the fixed bar, so lift the bar above the offcanvas backdrop */
    html body .sg-navbar { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
    html body .sg-navbar-wrap { z-index: 1046; }
    html body #mainNav .sg-nav-cluster, html body #mainNav .sg-nav-right { width: 100%; margin: 0 !important; align-items: stretch !important; }
    html body #mainNav .sg-nav-cluster > .nav-item, html body #mainNav .sg-nav-right > .nav-item { width: 100%; }
    html body #mainNav .sg-offcanvas-close { margin-left: auto; }
    html body #mainNav .offcanvas-header .sg-brand-copy { display: flex !important; }
}

html body .sg-footer {
    background: rgba(255,255,255,.82);
    border-color: var(--sw-line);
    color: var(--sw-text-3);
    backdrop-filter: blur(10px);
}
html body .sg-footer a { color: var(--sw-navy); }
.sg-footer-inner { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: 0 1.1rem; }
.sg-footer-brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--sw-text-2); }
.sg-footer-brand .sg-orbit-mini { width: 22px; height: 22px; }
@media (max-width: 575.98px) {
  .hero-bottom { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sg-footer-brand { flex-wrap: wrap; white-space: normal; min-width: 0; max-width: 100%; }
}
.sg-footer-meta { display: inline-flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.sg-footer-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sw-green); box-shadow: 0 0 0 3px rgba(31,157,107,.18); display: inline-block; margin-right: .35rem; }

/* ---------- 5. Hero family (every *-hero variant in the app) ---------- */
.hero {
    position: relative; overflow: hidden;
    border-radius: 22px;
    padding: 1.05rem 1.15rem 1rem;
    color: #fff;
    margin-bottom: .9rem;
}
.hero-top { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; flex-wrap: wrap; }
.hero-badge { display: inline-flex; align-items: center; gap: .45rem; padding: .32rem .66rem; border-radius: 999px; font-weight: 700; font-size: .72rem; }
.hero-title { margin: .5rem 0 .2rem; font-size: 1.55rem; font-weight: 800; line-height: 1.05; color: #fff; }
.hero-sub { max-width: 820px; color: rgba(233,238,246,.82); font-size: .86rem; line-height: 1.4; margin: 0; }
.hero-actions { display: flex; gap: .55rem; flex-wrap: wrap; align-items: flex-start; }
.hero-btn, .hero-btn-ghost {
    border-radius: 12px; padding: .6rem .86rem; font-weight: 700; font-size: .8rem;
    display: inline-flex; align-items: center; gap: .45rem; text-decoration: none;
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease; white-space: nowrap; cursor: pointer;
}
.hero-chip-row { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: .65rem; }
.hero-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .62rem; border-radius: 999px; font-size: .76rem; font-weight: 600; }
.hero-bottom { position: relative; z-index: 1; margin-top: .8rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .65rem; }
.hero-mini { border-radius: 14px; padding: .7rem .82rem; position: relative; overflow: hidden; }
.hero-mini-label { font-size: .72rem; font-weight: 600; color: rgba(233,238,246,.72); }
.hero-mini-value { font-family: var(--sw-font-display); font-size: 1.45rem; font-weight: 800; line-height: 1.05; margin-top: .2rem; color: #fff; }
.hero-mini-sub { font-size: .72rem; color: rgba(233,238,246,.62); margin-top: .15rem; }
.hero-badge { background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.16); color: #fff; }
.hero-chip { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.14); color: #fff; }
.hero-mini { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); }
.hero-left { flex: 1 1 620px; min-width: 260px; }

/* Brand colour — beats the per-view copies */
html body .hero:not(.sg-raw):not(.danger):not(.incident-hero),
html body [class*="-hero"]:not([class*="-hero-"]):not(.sg-raw):not(.danger):not(.incident-hero):not(.dashboard-hero-light) {
    background: linear-gradient(90deg, #5D6BA9 0 62%, #9FB0E6 62% 84%, #25b87d 84% 100%) bottom / 100% 3px no-repeat, var(--sw-grad-navy) !important;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 44px rgba(0,20,51,.16), 0 2px 6px rgba(0,20,51,.08);
    border: 1px solid rgba(255,255,255,.06);
}
/* orbit rings replace the generic glow circle */
html body .hero:not(.sg-raw):not(.danger):not(.incident-hero)::after,
html body [class*="-hero"]:not([class*="-hero-"]):not(.sg-raw):not(.danger):not(.incident-hero)::after {
    content: ""; position: absolute; pointer-events: none;
    right: -60px; top: -90px; bottom: auto; left: auto;
    width: 520px; height: 520px; border-radius: 50%;
    right: -170px; top: -200px;
    background: radial-gradient(circle closest-side, transparent 0 61%, rgba(255,255,255,.10) 61.4% 62%, transparent 62.4% 79%, rgba(159,176,230,.13) 79.4% 80%, transparent 80.4% 97%, rgba(255,255,255,.07) 97.4% 98.2%, transparent 98.6%) !important;
    border: 0; box-shadow: none;
    transform: rotate(-22deg) scaleY(.58);
    z-index: 0;
}
html body .hero-btn:not(.danger), html body [class*="-hero-btn"]:not([class*="-ghost"]):not(.danger) {
    background: #fff; color: var(--sw-navy); border: 0;
    box-shadow: 0 8px 18px rgba(0,0,0,.14);
}
html body .hero-btn:hover, html body [class*="-hero-btn"]:not([class*="-ghost"]):hover { color: var(--sw-ink); transform: translateY(-1px); box-shadow: 0 12px 24px rgba(0,0,0,.18); }
html body .hero-btn-ghost, html body [class*="-hero-btn-ghost"] {
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); color: #fff;
}
html body .hero-btn-ghost:hover, html body [class*="-hero-btn-ghost"]:hover { background: rgba(255,255,255,.16); color: #fff; transform: translateY(-1px); }
html body .hero-sub, html body [class*="-hero-sub"] { color: rgba(233,238,246,.84); }

/* ---------- 6. Generic page header for plain views ---------- */
.sg-page { max-width: 1480px; margin: 0 auto; padding: .35rem .9rem 1.2rem; }
.sg-hero-icon {
    width: 46px; height: 46px; border-radius: 14px; flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.16); font-size: 1.3rem; color: #fff;
}
.sg-hero-head { display: flex; gap: .9rem; align-items: center; }

/* ---------- 7. Panels & cards ---------- */
html body .panel:not(.sg-raw):not(.danger):not(.incident-hero), html body .card:not(.sg-raw):not(.danger):not(.incident-hero):not(.text-bg-primary):not(.bg-primary):not(.bg-dark):not(.bg-success):not(.bg-danger):not(.bg-warning):not(.bg-info) {
    border-color: var(--sw-line);
}
html body .card { border-radius: var(--sw-radius-lg); box-shadow: var(--sw-shadow-2); border: 1px solid var(--sw-line); }
html body .card-header {
    background: linear-gradient(180deg, #fff 0%, #f8f9fc 100%);
    border-bottom: 1px solid var(--sw-line);
    font-weight: 700; color: var(--sw-ink);
}
html body .card-header:first-child { border-radius: calc(var(--sw-radius-lg) - 1px) calc(var(--sw-radius-lg) - 1px) 0 0; }
html body .card-header.bg-primary, html body .card-header.bg-dark {
    background: var(--sw-grad-navy) !important; color: #fff; border-bottom: 0;
}
html body .card-title { font-family: var(--sw-font-display); font-weight: 700; color: var(--sw-ink); }

/* KPI tile helper usable on any page */
.sg-kpi {
    position: relative; overflow: hidden; background: #fff; border: 1px solid var(--sw-line);
    border-radius: 18px; padding: 1rem 1.05rem; box-shadow: var(--sw-shadow-2);
    transition: transform .16s ease, box-shadow .16s ease;
}
a.sg-kpi:hover, .sg-kpi.is-link:hover { transform: translateY(-2px); box-shadow: var(--sw-shadow-3); }
.sg-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.sg-kpi-label { font-size: .78rem; font-weight: 600; color: var(--sw-text-2); }
.sg-kpi-value { font-family: var(--sw-font-display); font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; color: var(--sw-ink); line-height: 1.05; margin-top: .45rem; font-variant-numeric: tabular-nums; }
.sg-kpi-sub { font-size: .76rem; color: var(--sw-text-3); margin-top: .2rem; }
.sg-chip-icon {
    width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.05rem; background: var(--sw-blue-soft); color: var(--sw-navy); flex: 0 0 auto;
}
.sg-chip-icon.is-green { background: var(--sw-green-soft); color: var(--sw-green-lo); }
.sg-chip-icon.is-amber { background: var(--sw-amber-soft); color: #a8660a; }
.sg-chip-icon.is-red { background: var(--sw-red-soft); color: var(--sw-red); }
.sg-chip-icon.is-ink { background: var(--sw-ink); color: #fff; }

/* Panel helper for plain views (header + body) */
.sg-panel { background: #fff; border: 1px solid var(--sw-line); border-radius: 20px; box-shadow: var(--sw-shadow-2); overflow: hidden; margin-bottom: 1rem; }
.sg-panel-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .85rem 1.1rem; border-bottom: 1px solid var(--sw-line); background: linear-gradient(180deg, #fff 0%, #f8f9fc 100%); }
.sg-panel-title { display: inline-flex; align-items: center; gap: .6rem; margin: 0; font-family: var(--sw-font-display); font-size: .98rem; font-weight: 700; color: var(--sw-ink); }
.sg-panel-title .sg-chip-icon { width: 32px; height: 32px; border-radius: 10px; font-size: .95rem; }
.sg-panel-sub { font-size: .8rem; color: var(--sw-text-3); margin: .1rem 0 0; }
.sg-panel-body { padding: 1.1rem; }
.sg-panel > .table-responsive > .table, .sg-panel > .table { margin-bottom: 0; }
.sg-panel-foot { padding: .8rem 1.1rem; border-top: 1px solid var(--sw-line); background: #fafbfd; display: flex; gap: .5rem; justify-content: flex-end; flex-wrap: wrap; }
.sg-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.sg-form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .9rem 1rem; }
.sg-actions { display: inline-flex; gap: .35rem; flex-wrap: wrap; }
.sg-icon-btn { width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--sw-line-2); background: #fff; color: var(--sw-navy); transition: background .14s ease, color .14s ease, border-color .14s ease; }
.sg-icon-btn:hover { background: var(--sw-navy); color: #fff; border-color: var(--sw-navy); }
.sg-icon-btn.is-danger:hover { background: var(--sw-red); border-color: var(--sw-red); }
.sg-status { display: inline-flex; align-items: center; gap: .38rem; padding: .25rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 600; background: var(--sw-paper-3); color: var(--sw-text-2); }
.sg-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.sg-status.ok { background: var(--sw-green-soft); color: #157a52; }
.sg-status.warn { background: var(--sw-amber-soft); color: #a8660a; }
.sg-status.bad { background: var(--sw-red-soft); color: #b8293a; }
.sg-status.info { background: var(--sw-blue-soft); color: var(--sw-navy); }
.sg-status.muted { background: #eef1f6; color: #6b7a93; }

/* Page width + filter toolbar + loading (kit v2) */
.sg-page.is-wide { max-width: none; }
.sg-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; padding: .75rem 1.1rem; border-bottom: 1px solid var(--sw-line); background: #fff; }
.sg-toolbar .sg-search { position: relative; flex: 1 1 260px; min-width: 200px; }
.sg-toolbar .sg-search i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: #8d9ab0; pointer-events: none; }
.sg-toolbar .sg-search .form-control { padding-left: 2.2rem; }
.sg-toolbar .form-select, .sg-toolbar .form-control { width: auto; min-width: 150px; }
.sg-toolbar .sg-toolbar-end { margin-left: auto; display: inline-flex; gap: .45rem; flex-wrap: wrap; }
@media (max-width: 575.98px) { .sg-toolbar .form-select, .sg-toolbar .form-control { width: 100%; } .sg-toolbar .sg-toolbar-end { margin-left: 0; width: 100%; } }
.sg-skeleton { position: relative; overflow: hidden; background: #edf1f7; border-radius: 8px; min-height: 1em; }
.sg-skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent); animation: sg-shimmer 1.3s infinite; }
@keyframes sg-shimmer { to { transform: translateX(100%); } }
.sg-loading { display: flex; align-items: center; justify-content: center; gap: .6rem; padding: 2rem 1rem; color: var(--sw-text-3); font-size: .86rem; }
.sg-loading::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--sw-blue-soft-2); border-top-color: var(--sw-navy); animation: sg-rot .7s linear infinite; }
.sg-section-title { font-family: var(--sw-font-display); font-size: 1rem; font-weight: 700; color: var(--sw-ink); margin: 1.2rem 0 .6rem; display: flex; align-items: center; gap: .5rem; }
.sg-dl { display: grid; grid-template-columns: minmax(130px, 34%) 1fr; gap: .5rem 1rem; margin: 0; font-size: .88rem; }
.sg-dl dt { color: var(--sw-text-3); font-weight: 600; }
.sg-dl dd { margin: 0; color: var(--sw-ink); }
@media (max-width: 575.98px) { .sg-dl { grid-template-columns: 1fr; } .sg-dl dd { margin-bottom: .5rem; } }
.sg-tabs { display: flex; gap: .3rem; flex-wrap: wrap; padding: .35rem; background: var(--sw-paper-3); border-radius: 14px; margin-bottom: 1rem; }
.sg-tabs .nav-link, .sg-tabs a, .sg-tabs button { border: 0; background: transparent; color: var(--sw-text-2); font-weight: 600; font-size: .84rem; padding: .5rem .85rem; border-radius: 10px; text-decoration: none; }
.sg-tabs .active, .sg-tabs .nav-link.active { background: #fff; color: var(--sw-navy); box-shadow: var(--sw-shadow-1); }

/* Empty state */
.sg-empty { text-align: center; padding: 2.4rem 1rem; color: var(--sw-text-3); }
.sg-empty i { font-size: 2rem; color: var(--sw-blue-2); display: block; margin-bottom: .55rem; }
.sg-empty strong { display: block; color: var(--sw-ink); font-size: .98rem; margin-bottom: .2rem; }

/* ---------- 8. Buttons ---------- */
html body .btn { font-weight: 600; border-radius: 11px; letter-spacing: -.005em; transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease, border-color .14s ease, color .14s ease; }
html body .btn:active { transform: translateY(1px); }
html body .btn:focus-visible { box-shadow: var(--sw-focus); }
html body .btn-primary {
    --bs-btn-bg: #282C68; --bs-btn-border-color: #282C68;
    --bs-btn-hover-bg: #1f2356; --bs-btn-hover-border-color: #1f2356;
    --bs-btn-active-bg: #181b45; --bs-btn-active-border-color: #181b45;
    --bs-btn-disabled-bg: #6d72a3; --bs-btn-disabled-border-color: #6d72a3;
    --bs-btn-focus-shadow-rgb: 93,107,169;
    background-image: linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,0));
    box-shadow: 0 6px 16px rgba(40,44,104,.22);
}
html body .btn-primary:hover { box-shadow: 0 10px 24px rgba(40,44,104,.30); }
html body .btn-success {
    --bs-btn-bg: #1f9d6b; --bs-btn-border-color: #1f9d6b;
    --bs-btn-hover-bg: #25b87d; --bs-btn-hover-border-color: #25b87d;
    --bs-btn-active-bg: #178556; --bs-btn-active-border-color: #178556;
    --bs-btn-focus-shadow-rgb: 31,157,107;
    box-shadow: 0 6px 18px rgba(31,157,107,.24);
}
html body .btn-success:hover { box-shadow: 0 10px 26px rgba(31,157,107,.34); }
html body .btn-info {
    --bs-btn-color: #fff; --bs-btn-bg: #5D6BA9; --bs-btn-border-color: #5D6BA9;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #4d5a96; --bs-btn-hover-border-color: #4d5a96;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #424e85;
}
html body .btn-danger {
    --bs-btn-bg: #d9384a; --bs-btn-border-color: #d9384a;
    --bs-btn-hover-bg: #c22d3e; --bs-btn-hover-border-color: #c22d3e;
    --bs-btn-active-bg: #a82434;
}
html body .btn-dark { --bs-btn-bg: #001433; --bs-btn-border-color: #001433; --bs-btn-hover-bg: #0a2748; --bs-btn-hover-border-color: #0a2748; }
html body .btn-outline-primary {
    --bs-btn-color: #282C68; --bs-btn-border-color: rgba(40,44,104,.35);
    --bs-btn-hover-bg: #282C68; --bs-btn-hover-border-color: #282C68; --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #1f2356; --bs-btn-active-border-color: #1f2356;
}
html body .btn-outline-secondary {
    --bs-btn-color: #3b4a64; --bs-btn-border-color: rgba(0,20,51,.16);
    --bs-btn-hover-bg: #eef0f8; --bs-btn-hover-color: #282C68; --bs-btn-hover-border-color: rgba(40,44,104,.28);
    --bs-btn-active-bg: #e1e5f3; --bs-btn-active-color: #282C68;
}
html body .btn-outline-success { --bs-btn-color: #178556; --bs-btn-border-color: rgba(31,157,107,.4); --bs-btn-hover-bg: #1f9d6b; --bs-btn-hover-border-color: #1f9d6b; }
html body .btn-outline-danger { --bs-btn-color: #c22d3e; --bs-btn-border-color: rgba(217,56,74,.38); --bs-btn-hover-bg: #d9384a; --bs-btn-hover-border-color: #d9384a; }
html body .btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--sw-line-2); --bs-btn-hover-bg: #eef0f8; --bs-btn-hover-border-color: rgba(40,44,104,.25); --bs-btn-color: #0a2748; }
html body .btn-link { --bs-btn-color: #282C68; --bs-btn-hover-color: #5D6BA9; }

/* Busy state applied by swiss-ui.js on POST submit */
.btn.sg-busy, button.sg-busy { position: relative; pointer-events: none; opacity: .85; }
.sg-busy .sg-spin { display: inline-block; width: .95em; height: .95em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: sg-rot .7s linear infinite; vertical-align: -.12em; margin-right: .4rem; }
@keyframes sg-rot { to { transform: rotate(360deg); } }

/* ---------- 9. Forms ---------- */
html body .form-control, html body .form-select {
    border-color: rgba(0,20,51,.14);
    border-radius: 11px;
    color: var(--sw-ink);
    transition: border-color .14s ease, box-shadow .14s ease, background-color .14s ease;
}
html body .form-control:hover, html body .form-select:hover { border-color: rgba(40,44,104,.30); }
html body .form-control:focus, html body .form-select:focus,
html body .select2-container--focus .select2-selection,
html body .select2-container--open .select2-selection {
    border-color: var(--sw-blue) !important;
    box-shadow: var(--sw-focus) !important;
}
html body .form-control::placeholder { color: #9aa6ba; }
html body .form-label, html body label.control-label { font-weight: 600; font-size: .82rem; color: var(--sw-text-2); margin-bottom: .32rem; }
html body .form-check-input:checked { background-color: var(--sw-navy); border-color: var(--sw-navy); }
html body .form-check-input:focus { box-shadow: var(--sw-focus); border-color: var(--sw-blue); }
html body .form-switch .form-check-input:checked { background-color: var(--sw-green); border-color: var(--sw-green); }
html body .input-group-text { background: var(--sw-paper-2); border-color: rgba(0,20,51,.14); color: var(--sw-text-2); }
html body .form-range::-webkit-slider-thumb { background: var(--sw-navy); }
html body .text-danger.field-validation-error, html body .field-validation-error { font-size: .78rem; font-weight: 600; color: var(--sw-red) !important; }
html body .input-validation-error { border-color: var(--sw-red) !important; background-color: #fffafa; }
html body .validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }
html body .validation-summary-valid { display: none !important; }
html body .validation-summary-errors {
    background: var(--sw-red-soft); border: 1px solid rgba(217,56,74,.22); color: #9d2232;
    border-radius: 12px; padding: .65rem .85rem; font-size: .85rem; margin-bottom: .8rem;
}

/* Select2 */
html body .select2-container--default .select2-selection--single,
html body .select2-container--default .select2-selection--multiple,
html body .select2-container--bootstrap-5 .select2-selection {
    border-color: rgba(0,20,51,.14); border-radius: 11px; min-height: 38px;
}
html body .select2-container--default .select2-results__option--highlighted[aria-selected],
html body .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable,
html body .select2-container--bootstrap-5 .select2-results__option--highlighted { background: var(--sw-navy) !important; color: #fff !important; }
html body .select2-dropdown { border-color: rgba(0,20,51,.14); border-radius: 12px; overflow: hidden; box-shadow: var(--sw-shadow-3); }
html body .select2-container--default .select2-selection--multiple .select2-selection__choice { background: var(--sw-blue-soft); border-color: var(--sw-blue-soft-2); color: var(--sw-navy); border-radius: 8px; }

/* ---------- 10. Tables & DataTables ---------- */
html body .table { --bs-table-color: var(--sw-ink); --bs-table-hover-bg: rgba(93,107,169,.06); --bs-table-striped-bg: rgba(0,20,51,.018); border-color: var(--sw-line); }
html body .table > thead > tr > th, html body table.dataTable > thead > tr > th {
    font-size: .72rem; font-weight: 700; letter-spacing: .02em;
    color: var(--sw-text-2); background: #f6f8fb; border-bottom: 1px solid var(--sw-line-2) !important;
    white-space: nowrap; vertical-align: middle;
}
html body .table > thead.table-dark > tr > th, html body .table-dark > thead > tr > th {
    background: var(--sw-ink) !important; color: #fff; border-color: rgba(255,255,255,.08) !important;
}
html body .table > :not(caption) > * > * { border-bottom-color: var(--sw-line); }
html body .table > tbody > tr { transition: background-color .12s ease; }
html body .table-light, html body thead.table-light { --bs-table-bg: #f6f8fb; --bs-table-color: var(--sw-text-2); }

html body .dataTables_wrapper .dataTables_filter input,
html body .dataTables_wrapper .dataTables_length select,
html body div.dt-container .dt-search input,
html body div.dt-container .dt-length select {
    border: 1px solid rgba(0,20,51,.14); border-radius: 10px; padding: .32rem .6rem; outline: 0;
}
html body .dataTables_wrapper .dataTables_filter input:focus,
html body div.dt-container .dt-search input:focus { border-color: var(--sw-blue); box-shadow: var(--sw-focus); }
html body .dataTables_wrapper .dataTables_info, html body div.dt-container .dt-info { font-size: .8rem; color: var(--sw-text-3); }
html body .page-link { color: var(--sw-navy); border-color: var(--sw-line); }
html body .page-link:hover { background: var(--sw-blue-soft); color: var(--sw-navy); }
html body .page-item.active .page-link, html body .active > .page-link {
    background: var(--sw-navy); border-color: var(--sw-navy); color: #fff;
}
html body .dataTables_wrapper .dataTables_paginate .paginate_button.current,
html body .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover,
html body div.dt-container .dt-paging .dt-paging-button.current,
html body div.dt-container .dt-paging .dt-paging-button.current:hover {
    background: var(--sw-navy) !important; border-color: var(--sw-navy) !important; color: #fff !important; border-radius: 9px;
}
html body .dataTables_wrapper .dataTables_paginate .paginate_button:hover,
html body div.dt-container .dt-paging .dt-paging-button:hover { background: var(--sw-blue-soft) !important; border-color: var(--sw-blue-soft-2) !important; color: var(--sw-navy) !important; border-radius: 9px; }
html body .dt-buttons .btn, html body .dt-buttons .dt-button {
    border-radius: 10px !important; font-weight: 600; font-size: .78rem;
}
html body button.dt-button, html body div.dt-button, html body a.dt-button {
    background: #fff !important; border: 1px solid rgba(0,20,51,.14) !important; color: var(--sw-ink-2) !important;
}
html body button.dt-button:hover, html body a.dt-button:hover { background: var(--sw-blue-soft) !important; border-color: rgba(40,44,104,.28) !important; }

/* ---------- 11. Badges, alerts, tabs, misc ---------- */
html body .badge { font-weight: 600; letter-spacing: .005em; border-radius: 8px; padding: .38em .62em; }
html body .badge.rounded-pill { border-radius: 999px; }
html body .bg-primary { background-color: var(--sw-navy) !important; }
html body .bg-success { background-color: var(--sw-green) !important; }
html body .bg-info { background-color: var(--sw-blue) !important; }
html body .bg-danger { background-color: var(--sw-red) !important; }
html body .bg-dark { background-color: var(--sw-ink) !important; }
html body .text-primary { color: var(--sw-navy) !important; }
html body .text-success { color: var(--sw-green-lo) !important; }
html body .text-info { color: var(--sw-blue) !important; }
html body .text-muted { color: #6b7a93 !important; }
html body .border-primary { border-color: var(--sw-navy) !important; }

html body .alert { border-radius: 14px; border-width: 1px; font-size: .88rem; }
html body .alert-primary, html body .alert-info { background: var(--sw-blue-soft); border-color: var(--sw-blue-soft-2); color: var(--sw-navy); }
html body .alert-success { background: var(--sw-green-soft); border-color: #bfe6d4; color: #145f43; }
html body .alert-danger { background: var(--sw-red-soft); border-color: #f5c6cc; color: #9d2232; }
html body .alert-warning { background: var(--sw-amber-soft); border-color: #f6dcaa; color: #7a4c06; }

html body .nav-tabs { border-bottom-color: var(--sw-line-2); }
html body .nav-tabs .nav-link { color: var(--sw-text-2); font-weight: 600; border: 0; border-bottom: 2px solid transparent; }
html body .nav-tabs .nav-link:hover { color: var(--sw-navy); border-bottom-color: var(--sw-blue-soft-2); }
html body .nav-tabs .nav-link.active { color: var(--sw-navy); background: transparent; border-bottom-color: var(--sw-navy); }
html body .nav-pills .nav-link { color: var(--sw-text-2); font-weight: 600; border-radius: 10px; }
html body .nav-pills .nav-link.active, html body .nav-pills .show > .nav-link { background: var(--sw-navy); color: #fff; }

html body .progress { background: var(--sw-paper-3); border-radius: 999px; }
html body .progress-bar { background-color: var(--sw-navy); }
html body .progress-bar.bg-success { background-color: var(--sw-green) !important; }

html body .list-group-item.active { background: var(--sw-navy); border-color: var(--sw-navy); }
html body .breadcrumb-item a { color: var(--sw-blue); font-weight: 600; }

html body .dropdown-menu:not(.sg-dropdown) { border-color: var(--sw-line); border-radius: 14px; box-shadow: var(--sw-shadow-3); padding: .35rem; }
html body .dropdown-menu:not(.sg-dropdown) .dropdown-item { border-radius: 9px; font-size: .86rem; }
html body .dropdown-menu:not(.sg-dropdown) .dropdown-item:hover, html body .dropdown-item:focus { background: var(--sw-blue-soft); color: var(--sw-navy); }
html body .dropdown-item.active, html body .dropdown-item:active { background: var(--sw-navy); color: #fff; }

/* Modals */
html body .modal-content { border: 0; border-radius: 20px; box-shadow: 0 30px 80px rgba(0,20,51,.28); overflow: hidden; }
html body .modal-header { border-bottom: 1px solid var(--sw-line); background: linear-gradient(180deg, #fff, #f8f9fc); }
html body .modal-header.bg-primary, html body .modal-header.bg-dark { background: var(--sw-grad-navy) !important; color: #fff; }
html body .modal-header.bg-primary .btn-close, html body .modal-header.bg-dark .btn-close { filter: invert(1) grayscale(1) brightness(2); }
html body .modal-title { font-family: var(--sw-font-display); font-weight: 700; }
html body .modal-footer { border-top: 1px solid var(--sw-line); background: #fafbfd; }
html body .modal-backdrop.show { opacity: .55; background: #001433; }
html body .offcanvas { border: 0; box-shadow: 0 30px 80px rgba(0,20,51,.25); }

/* ---------- 12. Tooltips & popovers ---------- */
html body .tooltip { --bs-tooltip-bg: #001433; --bs-tooltip-color: #e9eef6; --bs-tooltip-border-radius: 9px; --bs-tooltip-padding-x: .65rem; --bs-tooltip-padding-y: .42rem; --bs-tooltip-font-size: .76rem; --bs-tooltip-opacity: 1; font-family: var(--sw-font); font-weight: 500; }
html body .tooltip .tooltip-inner { box-shadow: 0 10px 24px rgba(0,20,51,.25); border: 1px solid rgba(93,107,169,.35); max-width: 280px; text-align: left; }
html body .popover { --bs-popover-border-color: var(--sw-line); --bs-popover-border-radius: 14px; --bs-popover-header-bg: #f6f8fb; box-shadow: var(--sw-shadow-3); font-family: var(--sw-font); }

/* ---------- 13. SweetAlert2 / toastr / NProgress ---------- */
html body .swal2-popup { font-family: var(--sw-font) !important; border-radius: 20px; color: var(--sw-ink); }
html body .swal2-popup.swal2-toast { border-radius: 14px; box-shadow: 0 14px 34px rgba(0,20,51,.18) !important; }
html body .swal2-title { font-family: var(--sw-font-display) !important; color: var(--sw-ink); letter-spacing: -.02em; }
html body .swal2-styled.swal2-confirm { background: var(--sw-navy) !important; border-radius: 11px !important; font-weight: 600; box-shadow: 0 6px 16px rgba(40,44,104,.25); }
html body .swal2-styled.swal2-confirm:focus { box-shadow: var(--sw-focus) !important; }
html body .swal2-styled.swal2-cancel { background: #eef0f8 !important; color: var(--sw-navy) !important; border-radius: 11px !important; font-weight: 600; }
html body .swal2-styled.swal2-deny { background: var(--sw-red) !important; border-radius: 11px !important; }
html body .swal2-timer-progress-bar { background: rgba(93,107,169,.55); }
html body .swal2-icon.swal2-success [class^='swal2-success-line'] { background-color: var(--sw-green); }
html body .swal2-icon.swal2-success .swal2-success-ring { border-color: rgba(31,157,107,.3); }

html body #toast-container > div { border-radius: 14px; box-shadow: 0 14px 34px rgba(0,20,51,.22); opacity: .97; font-family: var(--sw-font); padding-top: 14px; padding-bottom: 14px; }
html body #toast-container > .toast-success { background-color: #178556; }
html body #toast-container > .toast-error { background-color: #b8293a; }
html body #toast-container > .toast-info { background-color: #282C68; }
html body #toast-container > .toast-warning { background-color: #b9740a; }

#nprogress .bar { background: linear-gradient(90deg, #5D6BA9, #25b87d) !important; height: 3px !important; }
#nprogress .peg { box-shadow: 0 0 10px #25b87d, 0 0 5px #5D6BA9 !important; }
#nprogress .spinner { display: none !important; }

/* ---------- 14. Back-to-top ---------- */
.sg-top {
    position: fixed; right: 18px; bottom: 18px; z-index: 1030;
    width: 42px; height: 42px; border-radius: 13px; border: 1px solid rgba(255,255,255,.14);
    background: var(--sw-grad-navy); color: #fff; display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 12px 26px rgba(0,20,51,.25); opacity: 0; transform: translateY(10px); pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.sg-top.show { opacity: 1; transform: none; pointer-events: auto; }
.sg-top:hover { color: #fff; }

/* ---------- 15. Orbit mark (inline SVG helper) ---------- */
.sg-orbit-mini { display: inline-block; vertical-align: middle; }

/* ---------- 16. Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
    html body { background: #fff !important; }
    .sg-navbar-wrap, .sg-footer, .sg-top, #nprogress { display: none !important; }
    main.sg-main { padding-top: 0 !important; }
    html body .hero, html body [class*="-hero"]:not([class*="-hero-"]) { box-shadow: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- 17. Kit additions requested by module owners ---------- */
@media (pointer: coarse) {
    .sg-icon-btn { width: 40px; height: 40px; }
    html body .btn-sm { min-height: 40px; }
}
.sg-tabs .tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: .35rem; border-radius: 999px; background: var(--sw-blue-soft-2); color: var(--sw-navy); font-size: .7rem; font-weight: 700; }
.sg-tabs .active .tab-count { background: var(--sw-navy); color: #fff; }
a.sg-kpi.is-active, button.sg-kpi.is-active, .sg-kpi.is-active { border-color: var(--sw-navy); box-shadow: 0 0 0 2px rgba(40,44,104,.18), var(--sw-shadow-2); }
button.sg-kpi { text-align: left; width: 100%; cursor: pointer; }
.hero-chip.is-alert { background: rgba(217,56,74,.24); border-color: rgba(255,107,122,.5); }
.hero-chip .muted { color: rgba(233,238,246,.6); font-weight: 500; }
.sg-panel > .dataTables_wrapper, .sg-panel .dataTables_wrapper > .row:first-child, .sg-panel .dataTables_wrapper > .row:last-child { padding-left: 1rem; padding-right: 1rem; }
.sg-panel .dataTables_wrapper > .row:first-child { padding-top: .8rem; }
.sg-panel .dataTables_wrapper > .row:last-child { padding-bottom: .8rem; }
.sg-panel-sticky-foot { position: sticky; bottom: 0; z-index: 5; }
/* file picker */
.sg-file { position: relative; display: flex; align-items: center; gap: .75rem; padding: .8rem .95rem; border: 1.5px dashed var(--sw-line-2); border-radius: 14px; background: #fafbfd; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.sg-file:hover, .sg-file:focus-within { border-color: var(--sw-blue); background: var(--sw-blue-soft); }
.sg-file input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.sg-file-icon { width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: #fff; color: var(--sw-navy); border: 1px solid var(--sw-line); font-size: 1.1rem; flex: 0 0 auto; }
.sg-file-text { font-size: .86rem; color: var(--sw-text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 18. Colour & atmosphere ---------- */
/* Faint orbit rings in the page canvas (behind everything, never interactive) */
html body.sg-app::before {
    content: ""; position: fixed; z-index: -1; pointer-events: none;
    right: -260px; top: 40px; width: 900px; height: 900px; opacity: .55;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 900 900'%3E%3Cg fill='none' transform='translate(450 450) rotate(-22) scale(1 .58)'%3E%3Ccircle r='260' stroke='%235D6BA9' stroke-opacity='.10'/%3E%3Ccircle r='340' stroke='%23282C68' stroke-opacity='.07' stroke-dasharray='2 8'/%3E%3Ccircle r='430' stroke='%235D6BA9' stroke-opacity='.08'/%3E%3Ccircle cx='260' r='5' fill='%231f9d6b' fill-opacity='.35'/%3E%3Ccircle cx='-340' r='4' fill='%235D6BA9' fill-opacity='.35'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain;
}
html body.sg-app::after {
    content: ""; position: fixed; z-index: -1; pointer-events: none; inset: 0;
    background-image: radial-gradient(rgba(40,44,104,.055) 1px, transparent 1.2px);
    background-size: 22px 22px;
    -webkit-mask-image: linear-gradient(180deg, #000 0, rgba(0,0,0,.35) 380px, transparent 900px);
            mask-image: linear-gradient(180deg, #000 0, rgba(0,0,0,.35) 380px, transparent 900px);
}

/* KPI tiles pick up a tinted wash + accent bar from their icon tone */
.sg-kpi::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 3px; background: linear-gradient(90deg, var(--sw-navy), var(--sw-blue)); opacity: .9; }
.sg-kpi:has(.sg-chip-icon.is-green)::before { background: linear-gradient(90deg, #1f9d6b, #25b87d); }
.sg-kpi:has(.sg-chip-icon.is-amber)::before { background: linear-gradient(90deg, #d98a0b, #f2b544); }
.sg-kpi:has(.sg-chip-icon.is-red)::before { background: linear-gradient(90deg, #d9384a, #ff6b7a); }
.sg-kpi:has(.sg-chip-icon.is-ink)::before { background: linear-gradient(90deg, #001433, #282C68); }
.sg-kpi { background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%); }
.sg-kpi:has(.sg-chip-icon.is-green) { background: linear-gradient(160deg, rgba(31,157,107,.06), #fff 55%); }
.sg-kpi:has(.sg-chip-icon.is-amber) { background: linear-gradient(160deg, rgba(217,138,11,.07), #fff 55%); }
.sg-kpi:has(.sg-chip-icon.is-red) { background: linear-gradient(160deg, rgba(217,56,74,.06), #fff 55%); }
.sg-kpi:has(.sg-chip-icon:not(.is-green):not(.is-amber):not(.is-red):not(.is-ink)) { background: linear-gradient(160deg, rgba(93,107,169,.07), #fff 55%); }

/* Panel heads get a whisper of brand colour */
html body .sg-panel-head { background: linear-gradient(180deg, #fff 0%, #f7f8fd 100%); border-bottom-color: rgba(93,107,169,.14); }
html body .sg-panel { transition: box-shadow .18s ease; }
html body .sg-panel:hover { box-shadow: 0 10px 28px rgba(0,20,51,.08), 0 2px 6px rgba(0,20,51,.04); }

/* Table header: periwinkle hairline on top */
html body .table > thead > tr > th, html body table.dataTables_wrapper > thead > tr > th { box-shadow: inset 0 2px 0 rgba(93,107,169,.22); }

/* Status pills a touch richer */
.sg-status.ok { box-shadow: inset 0 0 0 1px rgba(31,157,107,.18); }
.sg-status.warn { box-shadow: inset 0 0 0 1px rgba(217,138,11,.22); }
.sg-status.bad { box-shadow: inset 0 0 0 1px rgba(217,56,74,.2); }
.sg-status.info { box-shadow: inset 0 0 0 1px rgba(93,107,169,.22); }

/* Section titles with a tri-colour tick */
.sg-section-title::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: linear-gradient(180deg, var(--sw-navy), var(--sw-green)); display: inline-block; }

/* Empty states: soft illustration ring */
.sg-empty i { width: 64px; height: 64px; border-radius: 50%; display: inline-flex !important; align-items: center; justify-content: center; margin: 0 auto .7rem !important; background: radial-gradient(circle, #fff 55%, var(--sw-blue-soft) 56%); box-shadow: 0 0 0 8px rgba(93,107,169,.06); }

@media print { html body.sg-app::before, html body.sg-app::after { display: none !important; } }

/* ================================================================
   Guarding module strip (_GuardingNav) — sits above every page of
   the module (hub, patrols, rosters, bookings) so it reads as one.
   ================================================================ */
.sg-modbar-wrap { max-width: 1480px; margin: 0 auto; padding: .6rem .9rem 0; }
.sg-modbar {
  display: flex; align-items: center; gap: .5rem; min-width: 0;
  padding: .35rem; border-radius: 16px;
  background: #fff; border: 1px solid var(--sw-line);
  box-shadow: var(--sw-shadow-1);
}
.sg-modbar-brand {
  display: inline-flex; align-items: center; gap: .45rem; flex: none;
  padding: .45rem .8rem; border-radius: 12px; text-decoration: none;
  background: var(--sw-grad-navy, linear-gradient(135deg, #001433, #282C68)); color: #fff;
  font-family: "Inter Tight", Inter, system-ui, sans-serif; font-weight: 700; font-size: .86rem; letter-spacing: .01em;
}
.sg-modbar-brand:hover { color: #fff; filter: brightness(1.08); }
.sg-modbar-tabs, .sg-modbar-end { display: flex; align-items: center; gap: .2rem; min-width: 0; }
.sg-modbar-tabs { flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.sg-modbar-tabs::-webkit-scrollbar { display: none; }
.sg-modbar-end { flex: none; padding-left: .35rem; border-left: 1px solid var(--sw-line); }
.sg-modbar-tab {
  display: inline-flex; align-items: center; gap: .4rem; flex: none; white-space: nowrap;
  min-height: 40px; padding: .4rem .75rem; border-radius: 10px; text-decoration: none;
  color: var(--sw-text-2); font-weight: 600; font-size: .84rem;
  transition: background .15s ease, color .15s ease;
}
.sg-modbar-tab i { font-size: 1rem; opacity: .8; }
.sg-modbar-tab:hover { background: var(--sw-paper-3, #eef1f7); color: var(--sw-navy); }
.sg-modbar-tab.active { background: var(--sw-blue-soft-2, #e8ebf6); color: var(--sw-navy); box-shadow: inset 0 -2px 0 var(--sw-green); }
.sg-modbar-tab.active i { opacity: 1; color: var(--sw-navy); }
.sg-modbar-tab:focus-visible, .sg-modbar-brand:focus-visible { outline: 2px solid var(--sw-blue, #5D6BA9); outline-offset: 2px; }
@media (max-width: 767.98px) {
  .sg-modbar-brand span { display: none; }
  .sg-modbar-end span { display: none; }
  .sg-modbar-wrap { padding: .5rem .6rem 0; }
}
@media print { .sg-modbar-wrap { display: none !important; } }

/* ================================================================
   MEGA MENUS (top nav, from Helpers/NavCatalog.cs) + module strip groups
   ================================================================ */
.sg-mega .sg-mega-head { display: none; }
.sg-mega-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sg-mega-label { font-weight: 700; }
.sg-mega-hint { font-size: .72rem; font-weight: 500; color: var(--sw-text-3, #6b7a93); white-space: normal; }
@media (min-width: 1200px) {
  html body .sg-mega { padding: 0 !important; overflow: hidden; border: 1px solid var(--sw-line) !important; background: #fff !important; backdrop-filter: none !important; }
  html body .sg-mega.cols-1 { width: 330px; }
  html body .sg-mega.cols-2 { width: min(620px, calc(100vw - 32px)); }
  html body .sg-mega.cols-3 { width: min(900px, calc(100vw - 32px)); }
  .sg-mega .sg-mega-head {
    display: flex; align-items: center; gap: .8rem; padding: .9rem 1rem;
    background: var(--sw-grad-navy); color: #fff;
  }
  .sg-mega-icon { flex: none; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,.12); font-size: 1.2rem; }
  .sg-mega-intro { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
  .sg-mega-title { font-family: var(--sw-font-display, "Inter Tight"), Inter, sans-serif; font-weight: 800; font-size: 1rem; }
  .sg-mega-blurb { font-size: .76rem; color: rgba(233,238,246,.78); }
  .sg-mega-home { flex: none; font-size: .76rem; font-weight: 700; color: #fff; text-decoration: none; padding: .4rem .7rem; border-radius: 999px; background: rgba(255,255,255,.12); white-space: nowrap; }
  .sg-mega-home:hover { background: rgba(255,255,255,.22); color: #fff; }
  .sg-mega-grid { padding: .6rem; column-gap: .6rem; }
  .sg-mega.cols-2 .sg-mega-grid { columns: 2; }
  .sg-mega.cols-3 .sg-mega-grid { columns: 3; }
  .sg-mega-col { break-inside: avoid; padding-bottom: .35rem; }
  html body .sg-mega .sg-mega-link { align-items: flex-start !important; white-space: normal; }
  html body .sg-mega .sg-mega-link .nav-icon { margin-top: 1px; }
  html body .sg-mega .sg-mega-link.active { background: var(--sw-blue-soft) !important; }
  html body .sg-mega .sg-mega-link.active .sg-mega-label { color: var(--sw-navy); }
  html body .sg-mega .sg-mega-link.active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--sw-green); }
}
@media (max-width: 1199.98px) {
  /* drawer: compact list, hints stay but quiet */
  html body #mainNav .sg-mega-hint { color: rgba(233,238,246,.5); font-size: .7rem; }
  html body #mainNav .sg-mega-link { align-items: flex-start !important; }
  html body #mainNav .sg-mega-link.active { background: rgba(255,255,255,.12) !important; }
}
/* More (priority+) menu clones items: keep hints out of it */
html body .sg-more-menu .sg-mega-hint { display: none; }

/* module strip: open group + dropdown groups */
.sg-modbar-group { display: inline-flex; align-items: center; gap: .15rem; flex: none; padding: .15rem .2rem .15rem .55rem; border-radius: 12px; background: var(--sw-paper-3, #eef2f8); }
.sg-modbar-group-label { display: inline-flex; align-items: center; gap: .35rem; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--sw-text-3, #6b7a93); margin-right: .25rem; white-space: nowrap; }
.sg-modbar-group-label i { font-size: .9rem; color: var(--sw-blue); }
.sg-modbar-group .sg-modbar-tab { min-height: 36px; padding: .35rem .65rem; }
.sg-modbar-group .sg-modbar-tab.active { background: #fff; box-shadow: var(--sw-shadow-1), inset 0 -2px 0 var(--sw-green); }
.sg-modbar-dd { flex: none; }
.sg-modbar-dd > .sg-modbar-tab { border: 0; background: transparent; }
.sg-modbar-dd > .dropdown-toggle::after { margin-left: .25rem; vertical-align: .15em; border-top-width: .28em; border-right-width: .28em; border-left-width: .28em; opacity: .6; }
@media (max-width: 767.98px) {
  .sg-modbar-group-label { display: none; }
}

/* module strip: a closed dropdown must never take part in layout (it widened the page on phones) */
.sg-modbar-dd > .dropdown-menu:not(.show) { display: none !important; }

/* =====================================================================
   Page anatomy v5 (round 14) — one structure for every module
   hub:    .sg-page.is-wide > section.hero > .sg-kpis > .sg-hub(.sg-hub-main + .sg-hub-side)
   list:   .sg-page > section.hero > [.sg-kpis] > .sg-panel(.sg-toolbar + table)
   detail: .sg-page > section.hero > .sg-hub(main panels + side panels)
   form:   .sg-page > section.hero > .sg-panel(s) with .sg-form-grid + .sg-panel-sticky-foot
   ===================================================================== */
.sg-hub { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start; }
.sg-hub.is-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.sg-hub-main, .sg-hub-side { min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.sg-hub-main > .sg-panel, .sg-hub-side > .sg-panel { margin-bottom: 0; }
.sg-hub + .sg-hub, .sg-kpis + .sg-hub { margin-top: 0; }
.sg-hub + .sg-panel, .sg-hub + .sg-hub { margin-top: 1rem; }
@media (max-width: 1199.98px) { .sg-hub, .sg-hub.is-even { grid-template-columns: minmax(0, 1fr); } }

/* panel head with an icon chip: .sg-panel-head > .sg-panel-heading(.sg-chip-icon + div(.sg-panel-title + .sg-panel-sub)) + .sg-panel-tools */
.sg-panel-heading { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.sg-panel-heading .sg-chip-icon { flex: none; }
.sg-panel-tools { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin-left: auto; }

/* side quick links */
.sg-linklist { list-style: none; margin: 0; padding: .35rem; display: flex; flex-direction: column; gap: 2px; }
.sg-linklist a { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: 12px; color: var(--sw-ink); text-decoration: none; min-height: 44px; }
.sg-linklist a:hover, .sg-linklist a:focus-visible { background: var(--sw-blue-soft, #eef1fb); }
.sg-linklist a > i:first-child { width: 32px; height: 32px; border-radius: 10px; display: inline-grid; place-items: center; background: var(--sw-paper-3, #eef2f8); color: var(--sw-navy); flex: none; }
.sg-linklist .sg-link-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sg-linklist .sg-link-text b { font-weight: 650; font-size: .88rem; }
.sg-linklist .sg-link-text small { color: var(--sw-text-3, #6b7a93); font-size: .75rem; line-height: 1.3; }
.sg-linklist .sg-link-count { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--sw-navy); }
.sg-linklist .sg-link-count.is-red { color: var(--sw-red); }
.sg-linklist .sg-link-count.is-amber { color: var(--sw-amber); }

/* attention rows inside a panel: .sg-rows > .sg-row(.sg-row-tone + .sg-row-main(b + small) + .sg-row-meta + .sg-row-act) */
.sg-rows { display: flex; flex-direction: column; }
.sg-row { display: flex; align-items: center; gap: .8rem; padding: .7rem 1.1rem; border-top: 1px solid var(--sw-line); min-height: 52px; }
.sg-rows > .sg-row:first-child { border-top: 0; }
.sg-row-tone { width: 4px; align-self: stretch; border-radius: 4px; background: var(--sw-line); flex: none; }
.sg-row-tone.is-red { background: var(--sw-red); } .sg-row-tone.is-amber { background: var(--sw-amber); } .sg-row-tone.is-green { background: var(--sw-green); } .sg-row-tone.is-ink { background: var(--sw-navy); }
.sg-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sg-row-main b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-row-main small { color: var(--sw-text-3, #6b7a93); font-size: .76rem; }
.sg-row-meta { color: var(--sw-text-3, #6b7a93); font-size: .78rem; white-space: nowrap; }
.sg-row-act { flex: none; }
@media (max-width: 575.98px) { .sg-row { flex-wrap: wrap; } .sg-row-meta { order: 3; width: 100%; padding-left: calc(4px + .8rem); } }

/* hero: hubs keep KPIs out of the hero (use .sg-kpis below it); a compact hero for list / form / detail pages */
.hero.is-compact { padding: .85rem 1.1rem .85rem; }
.hero.is-compact .hero-title { font-size: 1.3rem; margin-top: .4rem; }
.hero.is-compact .hero-chip-row { margin-top: .5rem; }
/* scope switch inside hero actions (Me / Team, month) */
.hero-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16); }
.hero-seg > a, .hero-seg > button { border: 0; background: transparent; color: rgba(255,255,255,.85); font-weight: 700; font-size: .78rem; padding: .45rem .7rem; border-radius: 9px; text-decoration: none; display: inline-flex; align-items: center; gap: .35rem; }
.hero-seg > .active, .hero-seg > [aria-pressed="true"] { background: #fff; color: var(--sw-navy); }
/* anatomy v5 — follow-ups from the module passes */
a.sg-kpi, a.sg-kpi:hover, a.sg-kpi:focus { text-decoration: none; color: inherit; display: block; }
button.sg-kpi { display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; font: inherit; color: inherit; }
ul.sg-rows, ol.sg-rows { list-style: none; margin: 0; padding: 0; }
.sg-panel-heading .sg-chip-icon { width: 32px; height: 32px; border-radius: 10px; font-size: .95rem; }
.hero-actions .form-select, .hero-actions .form-control { min-height: 38px; border-radius: 12px; font-size: .8rem; font-weight: 600; border-color: rgba(255,255,255,.22); background-color: rgba(255,255,255,.1); color: #fff; max-width: 220px; }
.hero-actions .form-select option { color: var(--sw-ink); }
.sg-text-block { white-space: pre-line; overflow-wrap: anywhere; line-height: 1.5; }
.sg-file.has-file { border-color: var(--sw-green); background: rgba(31,157,107,.06); }
.sg-file.has-file .sg-file-text { white-space: normal; }
@media (max-width: 575.98px) {
  .sg-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .sg-kpi { padding: .8rem .85rem; border-radius: 16px; }
  .sg-kpi-value { font-size: 1.5rem; }
  .sg-kpi-top .sg-chip-icon { width: 30px; height: 30px; font-size: .9rem; }
}
/* role gate: a "Go to" row whose link was hidden for this user collapses */
.sg-linklist > li:not(:has(a, button)) { display: none; }
