.cmms-theme-control {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

.cmms-theme-toggle {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.cmms-theme-toggle i {
    font-size: 1rem;
}

.cmms-theme-menu {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    z-index: 1200;
    display: grid;
    width: min(23.5rem, calc(100vw - 3rem));
    max-height: calc(100dvh - 5rem);
    overflow-y: auto;
    color: var(--cmms-ink, #243447);
    background: var(--cmms-panel, #fff);
    border: 1px solid var(--cmms-border, #d7e0e8);
    border-radius: 0.85rem;
    box-shadow: 0 14px 34px rgba(15, 28, 46, 0.18), 0 2px 6px rgba(15, 28, 46, 0.08);
}

.cmms-theme-menu[hidden],
.cmms-theme-schedule-editor[hidden] {
    display: none !important;
}

.cmms-theme-menu-header,
.cmms-theme-menu-footer {
    padding: 0.85rem 1rem;
}

.cmms-theme-menu-header {
    border-bottom: 1px solid var(--cmms-border, #d7e0e8);
}

.cmms-theme-menu-header h2,
.cmms-theme-schedule h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.cmms-theme-menu-header p,
.cmms-theme-menu-footer,
.cmms-theme-mode-note {
    margin: 0.2rem 0 0;
    color: var(--cmms-steel, #607184);
    font-size: 0.8rem;
    line-height: 1.45;
}

.cmms-theme-options {
    display: grid;
    gap: 0.4rem;
    padding: 0.6rem;
}

.cmms-theme-choice {
    width: 100%;
    min-height: 3.5rem;
    padding: 0.6rem 0.75rem;
    display: grid;
    grid-template-columns: 1rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    text-align: left;
    color: var(--cmms-ink, #243447);
    background: transparent;
    border: 0;
    border-radius: 0.55rem;
}

.cmms-theme-choice:hover,
.cmms-theme-choice:focus-visible {
    background: var(--cmms-surface, #f2f6fa);
}

.cmms-theme-choice[aria-pressed="true"] {
    color: #1d4ed8;
    background: #eef5ff;
}

.cmms-theme-choice[data-theme-mode="dark"] > i {
    color: #6366f1;
}

.cmms-theme-choice[data-theme-mode="auto"] > i {
    color: var(--cmms-steel, #607184);
}

.cmms-theme-choice-copy {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.cmms-theme-choice-copy strong {
    font-size: 0.9rem;
    font-weight: 650;
}

.cmms-theme-choice-copy > span,
.cmms-theme-choice-state {
    color: var(--cmms-steel, #607184);
    font-size: 0.78rem;
}

.cmms-theme-choice-state {
    color: #1d4ed8;
    font-weight: 700;
}

.cmms-theme-schedule {
    display: grid;
    gap: 0.55rem;
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--cmms-border, #d7e0e8);
}

.cmms-theme-schedule h3 {
    font-size: 0.82rem;
}

.cmms-theme-schedule-summary {
    display: grid;
    gap: 0.25rem;
    padding: 0.6rem 0.75rem;
    color: var(--cmms-ink, #243447);
    background: var(--cmms-surface, #f2f6fa);
    border-radius: 0.55rem;
    font-size: 0.8rem;
}

.cmms-theme-schedule-summary p {
    margin: 0;
}

.cmms-theme-schedule-summary strong {
    font-weight: 650;
}

.cmms-theme-mode-note {
    margin: 0;
}

.cmms-theme-schedule-toggle {
    justify-self: start;
    padding: 0;
    color: #1d4ed8;
    background: transparent;
    border: 0;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 650;
    text-align: left;
}

.cmms-theme-schedule-editor {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
}

.cmms-theme-schedule-editor label {
    display: grid;
    gap: 0.25rem;
    color: var(--cmms-steel, #607184);
    font-size: 0.75rem;
    font-weight: 650;
}

.cmms-theme-schedule-editor input {
    width: 100%;
    min-width: 0;
    padding: 0.4rem;
    color: var(--cmms-ink, #243447);
    background: var(--cmms-panel, #fff);
    border: 1px solid var(--cmms-border, #d7e0e8);
    border-radius: 0.4rem;
    font: inherit;
}

.cmms-theme-menu-footer {
    margin: 0;
    border-top: 1px solid var(--cmms-border, #d7e0e8);
}

.cmms-guest-theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1201;
}

.cmms-status-actions > .cmms-theme-control {
    flex: 0 0 auto;
}

html[data-theme="dark"] .cmms-theme-menu {
    border-color: var(--cmms-border);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .cmms-theme-choice[aria-pressed="true"] {
    color: #a9caff;
    background: #1d3048;
}

html[data-theme="dark"] .cmms-theme-choice-state,
html[data-theme="dark"] .cmms-theme-schedule-toggle {
    color: #a9caff;
}

.cmms-theme-toggle {
    white-space: nowrap;
}

@media (max-width: 575.98px) {
    .cmms-theme-menu {
        position: fixed;
        top: var(--cmms-theme-menu-top, 4.5rem);
        right: auto;
        left: 50%;
        width: min(23.5rem, calc(100vw - 1rem));
        transform: translateX(-50%);
    }
}

html[data-theme="light"] .cmms-guest-body {
    background:
        radial-gradient(ellipse 800px 500px at 15% 20%, rgba(13, 138, 106, 0.16), transparent 55%),
        radial-gradient(ellipse 600px 400px at 90% 80%, rgba(29, 78, 216, 0.1), transparent 50%),
        linear-gradient(145deg, #F4F7FA 0%, #E8EEF4 52%, #E1F0EA 100%);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --cmms-ink: #E5EDF4;
    --cmms-ink-soft: #172632;
    --cmms-steel: #A3B2C0;
    --cmms-surface: #111A24;
    --cmms-surface-mid: #18232E;
    --cmms-panel: #1D2A36;
    --cmms-accent: #26B890;
    --cmms-accent-hover: #49D0A9;
    --cmms-accent-soft: #123B34;
    --cmms-accent-glow: rgba(38, 184, 144, 0.22);
    --cmms-warn: #FB923C;
    --cmms-warn-soft: #422B18;
    --cmms-danger: #F87171;
    --cmms-danger-soft: #411F25;
    --cmms-info: #7DB5FF;
    --cmms-info-soft: #1D3048;
    --cmms-border: #354553;
    --cmms-shadow: 0 1px 2px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.18);
    --cmms-shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.3);
    --bs-body-color: #E5EDF4;
    --bs-body-color-rgb: 229, 237, 244;
    --bs-body-bg: #111A24;
    --bs-body-bg-rgb: 17, 26, 36;
    --bs-emphasis-color: #F4F7FA;
    --bs-secondary-color: #A3B2C0;
    --bs-tertiary-color: #8496A6;
    --bs-secondary-bg: #18232E;
    --bs-tertiary-bg: #24323E;
    --bs-border-color: #354553;
    --bs-link-color: #8FC4FF;
    --bs-link-hover-color: #B4D9FF;
}

html[data-theme="dark"] body.cmms-body {
    background:
        radial-gradient(ellipse 900px 480px at 12% -8%, rgba(38, 184, 144, 0.08), transparent 55%),
        radial-gradient(ellipse 700px 420px at 100% 0%, rgba(80, 145, 210, 0.08), transparent 50%),
        linear-gradient(180deg, #18232E 0%, #111A24 100%);
    color: var(--cmms-ink);
}

html[data-theme="dark"] .cmms-topbar {
    background: rgba(24, 35, 46, 0.9);
}

html[data-theme="dark"] .cmms-sidebar {
    background: linear-gradient(165deg, #1B2D38 0%, #101B25 48%, #0A1524 100%);
}

html[data-theme="dark"] .cmms-panel-header,
html[data-theme="dark"] .cmms-table thead th {
    background: linear-gradient(180deg, #263541 0%, #202E3A 100%);
    color: #DDE7EF;
}

html[data-theme="dark"] .cmms-table {
    --cmms-table-row-num: #7AD8BC;
    --cmms-table-row-num-bg: linear-gradient(180deg, #17382F 0%, #1A302C 100%);
    --bs-table-color: var(--cmms-ink);
    --bs-table-bg: var(--cmms-panel);
    --bs-table-border-color: var(--cmms-border);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.025);
    --bs-table-hover-bg: rgba(38, 184, 144, 0.09);
    --bs-table-hover-color: var(--cmms-ink);
}

html[data-theme="dark"] .cmms-table tbody td {
    border-bottom-color: var(--cmms-border);
}

html[data-theme="dark"] .cmms-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.025);
}

html[data-theme="dark"] .cmms-table tbody tr:hover {
    background: rgba(38, 184, 144, 0.09);
}

html[data-theme="dark"] .cmms-table tbody tr:hover td {
    color: var(--cmms-ink);
}

html[data-theme="dark"] .cmms-guest-body {
    color: var(--cmms-ink);
    background:
        radial-gradient(ellipse 800px 500px at 15% 20%, rgba(38, 184, 144, 0.12), transparent 55%),
        radial-gradient(ellipse 600px 400px at 90% 80%, rgba(80, 145, 210, 0.1), transparent 50%),
        linear-gradient(145deg, #111A24 0%, #172632 52%, #12332F 100%);
}

html[data-theme="dark"] .cmms-guest-card {
    border-color: var(--cmms-border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .cmms-status-body {
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(25deg, rgba(94, 234, 212, 0.025) 1px, transparent 1px),
        radial-gradient(ellipse 70% 45% at 8% -8%, rgba(38, 184, 144, 0.16), transparent 55%),
        radial-gradient(ellipse 55% 35% at 100% 0%, rgba(80, 145, 210, 0.12), transparent 52%),
        linear-gradient(180deg, #111A24 0%, #18232E 48%, #102B2A 100%);
    background-size: 46px 46px, 72px 72px, auto, auto, auto;
    color: var(--cmms-ink);
}

html[data-theme="dark"] .cmms-status-hero-card {
    background: linear-gradient(135deg, rgba(29, 42, 54, 0.96), rgba(25, 53, 52, 0.92));
    border-color: rgba(94, 234, 212, 0.18);
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.3), 0 0 0 6px rgba(255, 255, 255, 0.025);
}

html[data-theme="dark"] .cmms-status-hero-card::after {
    background: rgba(80, 145, 210, 0.12);
}

html[data-theme="dark"] .cmms-status-stat {
    background: rgba(24, 35, 46, 0.78);
    border-color: var(--cmms-border);
}

html[data-theme="dark"] .cmms-status-section .cmms-panel-header {
    background: linear-gradient(90deg, #1B3835 0%, #202E3A 100%);
    border-bottom-color: rgba(94, 234, 212, 0.18);
}

html[data-theme="dark"] .cmms-status-replica {
    background: linear-gradient(145deg, #1D2A36 0%, #182B32 100%);
    border-color: var(--cmms-border);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
}

html[data-theme="dark"] .cmms-status-replica.is-self {
    background: linear-gradient(180deg, #183C35 0%, #17332F 100%);
}

html[data-theme="dark"] .cmms-status-replica.is-bad,
html[data-theme="dark"] .cmms-status-probe.is-bad {
    background: linear-gradient(180deg, #3A252B 0%, #2D2026 100%);
}

html[data-theme="dark"] .cmms-status-probe {
    background: #1D2A36;
    border-color: var(--cmms-border);
}

html[data-theme="dark"] .cmms-status-theme-toggle {
    color: var(--cmms-ink);
    border-color: rgba(143, 196, 255, 0.3);
    background: rgba(29, 42, 54, 0.82);
}

html[data-theme="dark"] .ldap-hero {
    border-color: rgba(85, 170, 255, 0.35);
    background: linear-gradient(135deg, rgba(21, 38, 52, 0.96) 0%, rgba(13, 26, 36, 0.88) 40%, rgba(18, 43, 48, 0.96) 100%);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .ldap-hero-sub {
    color: #C9E7FF;
}

html[data-theme="dark"] .ldap-hero-toggles {
    background: rgba(18, 28, 36, 0.9);
    border-color: var(--cmms-border);
}

html[data-theme="dark"] .ldap-section {
    background: linear-gradient(180deg, rgba(18, 28, 36, 0.96) 0%, rgba(17, 26, 36, 0.96) 100%);
    border-color: var(--cmms-border);
    color: var(--cmms-ink);
}

html[data-theme="dark"] .ldap-section-title {
    color: var(--cmms-ink);
    border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .ldap-section-sky {
    background: linear-gradient(180deg, rgba(16, 55, 75, 0.72) 0%, rgba(17, 26, 36, 0.96) 42%);
    border-color: rgba(96, 165, 250, 0.3);
}

html[data-theme="dark"] .ldap-section-sky .ldap-section-title { color: #C3E7FF; border-color: rgba(96, 165, 250, 0.35); }

html[data-theme="dark"] .ldap-section-teal {
    background: linear-gradient(180deg, rgba(9, 46, 53, 0.7) 0%, rgba(17, 26, 36, 0.96) 42%);
    border-color: rgba(45, 212, 191, 0.28);
}

html[data-theme="dark"] .ldap-section-teal .ldap-section-title { color: #B6F3EA; border-color: rgba(45, 212, 191, 0.28); }

html[data-theme="dark"] .ldap-section-amber {
    background: linear-gradient(180deg, rgba(76, 50, 15, 0.72) 0%, rgba(17, 26, 36, 0.96) 42%);
    border-color: rgba(251, 146, 60, 0.28);
}

html[data-theme="dark"] .ldap-section-amber .ldap-section-title { color: #FCD29A; border-color: rgba(251, 146, 60, 0.3); }

html[data-theme="dark"] .ldap-section-blue {
    background: linear-gradient(180deg, rgba(23, 37, 84, 0.7) 0%, rgba(17, 26, 36, 0.96) 42%);
    border-color: rgba(96, 165, 250, 0.26);
}

html[data-theme="dark"] .ldap-section-blue .ldap-section-title { color: #CFE2FF; border-color: rgba(96, 165, 250, 0.25); }

html[data-theme="dark"] .ldap-section-indigo {
    background: linear-gradient(180deg, rgba(34, 33, 81, 0.72) 0%, rgba(17, 26, 36, 0.96) 42%);
    border-color: rgba(129, 140, 248, 0.26);
}

html[data-theme="dark"] .ldap-section-indigo .ldap-section-title { color: #DDD7FF; border-color: rgba(129, 140, 248, 0.25); }

html[data-theme="dark"] .ldap-section-slate {
    background: linear-gradient(180deg, rgba(39, 49, 62, 0.8) 0%, rgba(17, 26, 36, 0.96) 45%);
    border-color: rgba(148, 163, 184, 0.25);
}

html[data-theme="dark"] .ldap-section-slate .ldap-section-title { color: #E2E8F0; border-color: rgba(148, 163, 184, 0.25); }

html[data-theme="dark"] .ldap-settings--ldap .ldap-hero {
    border-color: #3d5b59;
    background: linear-gradient(120deg, #182b30 0%, #1c2936 100%);
    color: var(--cmms-ink);
}

html[data-theme="dark"] .ldap-settings--ldap .ldap-hero-eyebrow,
html[data-theme="dark"] .ldap-settings--ldap .ldap-hero-title,
html[data-theme="dark"] .ldap-settings--ldap .ldap-section-title {
    color: var(--cmms-ink);
}

html[data-theme="dark"] .ldap-settings--ldap .ldap-hero-title i,
html[data-theme="dark"] .ldap-settings--ldap .ldap-section-title i {
    color: var(--cmms-accent-hover);
}

html[data-theme="dark"] .ldap-settings--ldap .ldap-hero-sub,
html[data-theme="dark"] .ldap-settings--ldap .cmms-form-hint {
    color: var(--cmms-steel);
}

html[data-theme="dark"] .ldap-settings--ldap .ldap-hero-toggles,
html[data-theme="dark"] .ldap-settings--ldap .ldap-section {
    border-color: var(--cmms-border);
    background: var(--cmms-panel);
    color: var(--cmms-ink);
    box-shadow: none;
}

html[data-theme="dark"] .ldap-settings--ldap .ldap-section {
    border-left-color: var(--ldap-section-accent, var(--cmms-accent));
}

html[data-theme="dark"] .ldap-settings--ldap .ldap-status-indicator,
html[data-theme="dark"] .ldap-settings--ldap .ldap-hero-meta-item,
html[data-theme="dark"] .ldap-settings--ldap .ldap-transport-chip {
    border-color: #40515e;
    background: #182630;
    color: var(--cmms-ink);
}

html[data-theme="dark"] .ldap-settings--ldap .ldap-status-indicator.is-enabled {
    border-color: #286c58;
    background: #17382f;
    color: #bcebd8;
}

html[data-theme="dark"] .ldap-settings--ldap .ldap-status-indicator.is-disabled {
    background: #26323c;
}

html[data-theme="dark"] .ldap-settings--ldap .ldap-transport-warning {
    border-color: #7a5c2b;
    background: #382d1d;
    color: #f4d28c;
}

html[data-theme="dark"] .ldap-settings--ldap .ldap-transport-warning i {
    color: #f4bd58;
}

html[data-theme="dark"] .ldap-settings--ldap .form-check-label {
    color: var(--cmms-ink);
}

html[data-theme="dark"] .cmms-auth-tabs .nav-link {
    color: var(--cmms-ink);
    background: rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .cmms-auth-tabs .nav-link.active {
    color: #111A24;
    background-color: var(--cmms-accent);
}

html[data-theme="dark"] .cmms-guide-flow-item {
    background: rgba(21, 47, 56, 0.9);
    border-color: rgba(38, 184, 144, 0.28);
    color: #DDFBEF;
}

html[data-theme="dark"] .cmms-guide-role {
    background: rgba(18, 28, 36, 0.96);
    border-color: var(--cmms-border);
}

html[data-theme="dark"] .cmms-guide-role h4,
html[data-theme="dark"] .cmms-guide-role p,
html[data-theme="dark"] .cmms-guide-process-list {
    color: var(--cmms-ink);
}

html[data-theme="dark"] .cmms-guide-role p,
html[data-theme="dark"] .cmms-guide-process-list {
    color: var(--cmms-steel);
}

html[data-theme="dark"] .cmms-settings-chip {
    background: rgba(18, 28, 36, 0.96);
    border-color: var(--cmms-border);
    color: var(--cmms-ink);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .cmms-settings-section {
    background: linear-gradient(180deg, rgba(18, 28, 36, 0.96) 0%, rgba(17, 26, 36, 0.96) 100%);
    border-color: var(--cmms-border);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .cmms-settings-section-head,
html[data-theme="dark"] .cmms-settings-savebar {
    background: linear-gradient(180deg, rgba(24, 34, 44, 0.96) 0%, rgba(17, 26, 36, 0.98) 100%);
    border-color: var(--cmms-border);
}

html[data-theme="dark"] .cmms-settings-emoji {
    background: rgba(20, 30, 39, 0.92);
    border-color: var(--cmms-border);
    color: var(--cmms-ink);
}

html[data-theme="dark"] .cmms-settings-note,
html[data-theme="dark"] .cmms-settings-card,
html[data-theme="dark"] .cmms-disclosure {
    background: rgba(18, 28, 36, 0.92);
    border-color: var(--cmms-border);
    color: var(--cmms-ink);
}

html[data-theme="dark"] .cmms-settings-sub,
html[data-theme="dark"] .cmms-settings-note,
html[data-theme="dark"] .cmms-settings-savebar-hint,
html[data-theme="dark"] .cmms-fieldset-count,
html[data-theme="dark"] .cmms-disclosure-body,
html[data-theme="dark"] .cmms-fieldset-name {
    color: var(--cmms-ink);
}

html[data-theme="dark"] .cmms-settings-savebar {
    box-shadow: 0 -10px 22px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .cmms-settings-card .form-control,
html[data-theme="dark"] .cmms-settings-card .form-select {
    background-color: rgba(23, 35, 46, 0.96);
    border-color: var(--cmms-border);
    color: var(--cmms-ink);
}

html[data-theme="dark"] .cmms-token-once {
    background: rgba(66, 44, 18, 0.74);
    border-color: rgba(251, 146, 60, 0.35);
    color: var(--cmms-ink);
}

html[data-theme="dark"] .cmms-token-value,
html[data-theme="dark"] .cmms-webhook-events {
    background: rgba(17, 26, 36, 0.96);
    border-color: var(--cmms-border);
    color: var(--cmms-ink);
}

html[data-theme="dark"] .border.rounded-3.p-3,
html[data-theme="dark"] .cmms-panel .border.rounded-3.p-3 {
    background: rgba(17, 26, 36, 0.96);
    border-color: var(--cmms-border) !important;
    color: var(--cmms-ink);
}

html[data-theme="dark"] .cmms-fieldset-head {
    background: linear-gradient(180deg, rgba(24, 34, 44, 0.96) 0%, rgba(17, 26, 36, 0.98) 100%);
    border-color: var(--cmms-border);
}

html[data-theme="dark"] .cmms-field-status-yes {
    background: rgba(13, 85, 69, 0.76);
    color: #DDFBEF;
}

html[data-theme="dark"] .cmms-field-status-no {
    background: rgba(56, 65, 75, 0.9);
    color: var(--cmms-steel);
}

html[data-theme="dark"] .cmms-panel {
    background: linear-gradient(180deg, rgba(18, 28, 36, 0.96) 0%, rgba(17, 26, 36, 0.96) 100%);
    border-color: var(--cmms-border);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .cmms-panel-header,
html[data-theme="dark"] .cmms-panel-body,
html[data-theme="dark"] .cmms-panel .table-responsive,
html[data-theme="dark"] .cmms-panel .table,
html[data-theme="dark"] .cmms-panel .table td,
html[data-theme="dark"] .cmms-panel .table th,
html[data-theme="dark"] .cmms-panel .border.rounded-3.p-3,
html[data-theme="dark"] .cmms-panel pre,
html[data-theme="dark"] .cmms-panel code {
    background-color: transparent;
    color: var(--cmms-ink);
}

html[data-theme="dark"] .cmms-panel .table,
html[data-theme="dark"] .cmms-panel .table td,
html[data-theme="dark"] .cmms-panel .table th,
html[data-theme="dark"] .cmms-panel .border.rounded-3.p-3 {
    background: rgba(17, 26, 36, 0.96);
    border-color: var(--cmms-border) !important;
}

html[data-theme="dark"] .cmms-panel .table td,
html[data-theme="dark"] .cmms-panel .table th,
html[data-theme="dark"] .cmms-panel .border.rounded-3.p-3 .small,
html[data-theme="dark"] .cmms-panel .small.text-steel,
html[data-theme="dark"] .cmms-panel .text-steel {
    color: var(--cmms-steel) !important;
}

html[data-theme="dark"] .cmms-alert-status-card {
    border-color: rgba(38, 184, 144, 0.34);
    background: linear-gradient(135deg, rgba(18, 43, 40, 0.96) 0%, rgba(23, 39, 52, 0.96) 58%, rgba(17, 26, 36, 0.96) 100%);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

html[data-theme="dark"] .cmms-alert-status-title {
    color: #DDFBEF;
}

html[data-theme="dark"] .cmms-alert-status-emoji,
html[data-theme="dark"] .cmms-alert-chip,
html[data-theme="dark"] .cmms-alert-channel-emoji,
html[data-theme="dark"] .cmms-alert-section-emoji {
    background: rgba(24, 34, 44, 0.96);
    border-color: var(--cmms-border);
    color: var(--cmms-ink);
}

html[data-theme="dark"] .cmms-alert-chip {
    background: rgba(18, 28, 36, 0.94);
    color: var(--cmms-steel);
    border-color: var(--cmms-border);
}

html[data-theme="dark"] .cmms-alert-chip.is-on {
    border-color: rgba(38, 184, 144, 0.36);
    color: #DDFBEF;
}

html[data-theme="dark"] .cmms-alert-chip.is-off {
    background: rgba(38, 49, 60, 0.9);
    border-color: var(--cmms-border);
    color: var(--cmms-steel);
}

html[data-theme="dark"] .cmms-alert-status-count {
    background: linear-gradient(145deg, #1f9a79 0%, var(--cmms-accent) 100%);
    color: #101A22;
}

html[data-theme="dark"] .cmms-alert-status-count.is-off {
    background: linear-gradient(180deg, rgba(43, 52, 62, 0.95) 0%, rgba(29, 38, 47, 0.95) 100%);
    color: var(--cmms-steel);
}

html[data-theme="dark"] .cmms-alert-channel,
html[data-theme="dark"] .cmms-alert-section,
html[data-theme="dark"] .cmms-alert-switch {
    background: linear-gradient(180deg, rgba(18, 28, 36, 0.96) 0%, rgba(17, 26, 36, 0.96) 100%);
    border-color: var(--cmms-border);
    color: var(--cmms-ink);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}

html[data-theme="dark"] .cmms-alert-channel-title,
html[data-theme="dark"] .cmms-alert-channel-note,
html[data-theme="dark"] .cmms-alert-section-title,
html[data-theme="dark"] .cmms-alert-section-note,
html[data-theme="dark"] .cmms-alert-switch .form-check-label,
html[data-theme="dark"] .cmms-alert-channel-pill {
    color: var(--cmms-ink);
}

html[data-theme="dark"] .cmms-alert-channel-pill {
    background: rgba(38, 49, 60, 0.9);
    border-color: var(--cmms-border);
}

html[data-theme="dark"] .cmms-alert-channel-pill.is-on {
    background: rgba(18, 70, 58, 0.9);
    border-color: rgba(38, 184, 144, 0.34);
    color: #DDFBEF;
}

html[data-theme="dark"] .cmms-alert-channel-pill.is-warn {
    background: rgba(82, 57, 17, 0.88);
    border-color: rgba(251, 146, 60, 0.34);
    color: #FCD29A;
}

html[data-theme="dark"] .cmms-alert-channel--email,
html[data-theme="dark"] .cmms-alert-switch--email {
    background: linear-gradient(180deg, rgba(16, 35, 50, 0.95) 0%, rgba(17, 26, 36, 0.96) 60%);
    border-color: rgba(96, 165, 250, 0.26);
}

html[data-theme="dark"] .cmms-alert-channel--email .cmms-alert-channel-title,
html[data-theme="dark"] .cmms-alert-channel--email .cmms-alert-channel-note {
    color: #CFE2FF;
}

html[data-theme="dark"] .cmms-alert-channel--sms,
html[data-theme="dark"] .cmms-alert-switch--sms {
    background: linear-gradient(180deg, rgba(34, 25, 54, 0.9) 0%, rgba(17, 26, 36, 0.96) 60%);
    border-color: rgba(168, 139, 250, 0.28);
}

html[data-theme="dark"] .cmms-alert-channel--sms .cmms-alert-channel-title,
html[data-theme="dark"] .cmms-alert-channel--sms .cmms-alert-channel-note {
    color: #DDD7FF;
}

html[data-theme="dark"] .cmms-alert-channel--news,
html[data-theme="dark"] .cmms-alert-switch--news {
    background: linear-gradient(180deg, rgba(63, 43, 19, 0.88) 0%, rgba(17, 26, 36, 0.96) 60%);
    border-color: rgba(251, 146, 60, 0.28);
}

html[data-theme="dark"] .cmms-alert-channel--news .cmms-alert-channel-title,
html[data-theme="dark"] .cmms-alert-channel--news .cmms-alert-channel-note {
    color: #FCD29A;
}

html[data-theme="dark"] .cmms-alert-section--iot {
    background: linear-gradient(160deg, rgba(10, 43, 38, 0.8) 0%, rgba(15, 31, 39, 0.94) 55%, rgba(17, 26, 36, 0.96) 100%);
    border-color: rgba(52, 211, 153, 0.28);
}

html[data-theme="dark"] .cmms-alert-section--iot .cmms-alert-section-title { color: #BAF7D7; }

html[data-theme="dark"] .cmms-alert-section--pm {
    background: linear-gradient(160deg, rgba(73, 41, 9, 0.8) 0%, rgba(30, 28, 24, 0.96) 55%, rgba(17, 26, 36, 0.96) 100%);
    border-color: rgba(251, 146, 60, 0.28);
}

html[data-theme="dark"] .cmms-alert-section--pm .cmms-alert-section-title { color: #FCD29A; }

html[data-theme="dark"] .cmms-alert-section--news {
    background: linear-gradient(160deg, rgba(20, 30, 62, 0.78) 0%, rgba(29, 30, 49, 0.96) 55%, rgba(17, 26, 36, 0.96) 100%);
    border-color: rgba(129, 140, 248, 0.28);
}

html[data-theme="dark"] .cmms-alert-section--news .cmms-alert-section-title { color: #D6D2FF; }

html[data-theme="dark"] .cmms-alert-status-card,
html[data-theme="dark"] .cmms-alert-section,
html[data-theme="dark"] .cmms-alert-channel,
html[data-theme="dark"] .cmms-alert-switch, 
html[data-theme="dark"] .cmms-alert-switch .form-check-label,
html[data-theme="dark"] .cmms-alert-switch .cmms-form-hint {
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-control[readonly],
html[data-theme="dark"] .input-group-text {
    color: var(--cmms-ink);
    background-color: #17232E;
    border-color: var(--cmms-border);
}

html[data-theme="dark"] .form-control::placeholder {
    color: #8496A6;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
    color: var(--cmms-ink);
    background-color: #17232E;
}

html[data-theme="dark"] .form-select option {
    color: var(--cmms-ink);
    background-color: var(--cmms-panel);
}

html[data-theme="dark"] .cmms-brand-preview,
html[data-theme="dark"] .bg-white,
html[data-theme="dark"] .bg-light,
html[data-theme="dark"] .table-light {
    color: var(--cmms-ink) !important;
    background-color: #24323E !important;
}

html[data-theme="dark"] .text-dark {
    color: var(--cmms-ink) !important;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .text-secondary {
    color: var(--cmms-steel) !important;
}

html[data-theme="dark"] .border,
html[data-theme="dark"] .border-top,
html[data-theme="dark"] .border-bottom,
html[data-theme="dark"] .border-start,
html[data-theme="dark"] .border-end {
    border-color: var(--cmms-border) !important;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .popover,
html[data-theme="dark"] .toast,
html[data-theme="dark"] .accordion-item {
    color: var(--cmms-ink);
    background-color: var(--cmms-panel);
    border-color: var(--cmms-border);
}

html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .accordion-button {
    color: var(--cmms-ink);
}

html[data-theme="dark"] .dropdown-item:hover,
html[data-theme="dark"] .dropdown-item:focus,
html[data-theme="dark"] .accordion-button,
html[data-theme="dark"] .accordion-button:not(.collapsed) {
    background-color: #263541;
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer,
html[data-theme="dark"] .accordion-button::after {
    border-color: var(--cmms-border);
}

html[data-theme="dark"] .alert-light,
html[data-theme="dark"] .alert-secondary {
    color: var(--cmms-ink);
    background-color: #24323E;
    border-color: var(--cmms-border);
}

html[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

@media (max-width: 575.98px) {
    .cmms-theme-toggle-label {
        display: none;
    }

    .cmms-theme-toggle {
        width: 2.25rem;
        height: 2.25rem;
        padding: 0;
    }
}

html[data-theme="dark"] .cmms-status-mode-strip {
    background: rgba(18, 59, 52, 0.72);
    border-color: rgba(74, 208, 169, 0.28);
}

html[data-theme="dark"] .cmms-status-mode-strip.is-windows-single {
    background: rgba(66, 43, 24, 0.72);
    border-color: rgba(251, 146, 60, 0.32);
}

html[data-theme="dark"] .cmms-status-mode-features span {
    background: rgba(29, 42, 54, 0.82);
    border-color: rgba(74, 208, 169, 0.24);
}

html[data-theme="dark"] .cmms-status-mode-strip.is-windows-single .cmms-status-mode-features span {
    border-color: rgba(251, 146, 60, 0.28);
}