﻿/* HSEHub 360 — product design tokens (world-class identity layer) */
:root {
    --hse-navy: #0b2a4a;
    --hse-navy-mid: #13315c;
    --hse-navy-light: #1a4a7a;
    --hse-teal: #0d9488;
    --hse-teal-soft: #ccfbf1;
    --hse-amber: #d97706;
    --hse-danger: #b91c1c;
    --hse-success: #047857;
    --hse-surface: #f7f9fc;
    --hse-ink: #0f172a;
    --hse-muted: #64748b;
    --hse-border: #e2e8f0;
    --hse-radius: 12px;
    --hse-radius-sm: 8px;
    --hse-font-display: "Segoe UI", "Tahoma", "Arial", sans-serif;
    --hse-font-body: "Segoe UI", "Tahoma", "Arial", sans-serif;
    --hse-shadow: 0 8px 24px rgba(11, 42, 74, 0.08);

    /* Align legacy tokens with brand */
    --primary-color: var(--hse-navy-mid);
    --primary-dark: var(--hse-navy);
    --primary-light: var(--hse-navy-light);
    --success-color: var(--hse-success);
    --warning-color: var(--hse-amber);
    --danger-color: var(--hse-danger);
    --sidebar-bg: linear-gradient(180deg, var(--hse-navy) 0%, var(--hse-navy-mid) 55%, var(--hse-navy) 100%);
    --login-bg: linear-gradient(135deg, var(--hse-navy) 0%, var(--hse-navy-light) 100%);
}

.hse-trust-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin: 14px 0 4px;
    padding: 10px 8px;
    border-top: 1px solid var(--hse-border);
}
.hse-trust-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--hse-muted);
    background: var(--hse-surface);
    border: 1px solid var(--hse-border);
    border-radius: 999px;
    padding: 4px 10px;
    line-height: 1.3;
}
.hse-trust-chip strong { color: var(--hse-navy-mid); font-weight: 600; }

.hse-empty-state {
    text-align: center;
    padding: 2.5rem 1.25rem;
    color: var(--hse-muted);
    background: var(--hse-surface);
    border: 1px dashed var(--hse-border);
    border-radius: var(--hse-radius);
}
.hse-empty-state__title {
    color: var(--hse-ink);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
}
.hse-empty-state__hint { margin: 0; font-size: 0.9rem; }

.hse-danger-zone {
    border: 1px solid #fecaca;
    border-radius: var(--hse-radius);
    background: #fff;
    box-shadow: var(--hse-shadow);
}

.hse-onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(11, 42, 74, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.hse-onboarding-card {
    width: min(560px, 100%);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    font-family: var(--hse-font-body);
}
.hse-onboarding-card__head {
    background: linear-gradient(135deg, var(--hse-navy), var(--hse-navy-light));
    color: #fff;
    padding: 18px 20px;
}
.hse-onboarding-card__body { padding: 18px 20px; }
.hse-onboarding-card__foot {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 20px 18px;
    border-top: 1px solid var(--hse-border);
}
.hse-onboarding-steps {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}
.hse-onboarding-steps span {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: #e2e8f0;
}
.hse-onboarding-steps span.is-active { background: var(--hse-teal); }
.hse-onboarding-steps span.is-done { background: var(--hse-navy-mid); }

.hse-exec-board {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin: 12px 0 18px;
}
.hse-exec-card {
    background: #fff;
    border: 1px solid var(--hse-border);
    border-radius: var(--hse-radius-sm);
    padding: 14px;
    box-shadow: var(--hse-shadow);
}
.hse-exec-card__label {
    font-size: 12px;
    color: var(--hse-muted);
    margin-bottom: 6px;
}
.hse-exec-card__value {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--hse-navy);
    font-variant-numeric: tabular-nums;
}
.hse-site-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--hse-teal-soft);
    color: #115e59;
}

/* ===== Executive KPI panel (dashboard) ===== */
#hse-executive-board.hse-exec-panel,
.hse-exec-panel {
    margin: 0 0 1.35rem;
    padding: 0;
    border-radius: calc(var(--hse-radius) + 2px);
    border: 1px solid rgba(19, 49, 92, 0.12);
    background:
        linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    box-shadow: var(--hse-shadow);
    overflow: hidden;
    text-align: start;
    direction: inherit;
}
.hse-exec-panel__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    background:
        linear-gradient(135deg, var(--hse-navy) 0%, var(--hse-navy-mid) 55%, #0f4c5c 100%);
    color: #fff;
}
.hse-exec-panel__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}
.hse-exec-panel__logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.35);
    flex-shrink: 0;
}
.hse-exec-panel__titles {
    min-width: 0;
}
.hse-exec-panel__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(204, 251, 241, 0.95);
    margin-bottom: 0.15rem;
}
.hse-exec-panel__title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--hse-font-display);
    color: #fff;
    line-height: 1.3;
}
.hse-exec-panel__sub {
    margin: 0.2rem 0 0;
    font-size: 0.8rem;
    color: rgba(226, 232, 240, 0.88);
    line-height: 1.45;
    max-width: 36rem;
}
.hse-exec-panel__refresh {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.hse-exec-panel__refresh:hover {
    background: rgba(13, 148, 136, 0.45);
    transform: translateY(-1px);
}
.hse-exec-panel__refresh:active {
    transform: translateY(0);
}
.hse-exec-board--dashboard {
    margin: 0;
    padding: 1rem 1.1rem 0.35rem;
    gap: 0.85rem;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}
.hse-exec-board--dashboard .hse-exec-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.95rem 1rem 0.9rem;
    border-radius: var(--hse-radius);
    border: 1px solid rgba(226, 232, 240, 0.95);
    background: linear-gradient(165deg, #fff 0%, #f8fafc 100%);
    box-shadow: 0 4px 14px rgba(11, 42, 74, 0.05);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.hse-exec-board--dashboard .hse-exec-card::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--hse-teal);
    opacity: 0.85;
}
.hse-exec-board--dashboard .hse-exec-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(11, 42, 74, 0.1);
    border-color: rgba(13, 148, 136, 0.28);
}
.hse-exec-card__top {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}
.hse-exec-card__icon {
    width: 1.7rem;
    height: 1.7rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(13, 148, 136, 0.12);
    color: var(--hse-teal);
    font-size: 0.78rem;
    flex-shrink: 0;
}
.hse-exec-board--dashboard .hse-exec-card__label {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hse-muted);
    line-height: 1.3;
}
.hse-exec-board--dashboard .hse-exec-card__value {
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--hse-navy);
    line-height: 1.15;
}
.hse-exec-card__hint {
    font-size: 0.7rem;
    color: #94a3b8;
    line-height: 1.35;
}
.hse-exec-card--ok::before { background: var(--hse-success); }
.hse-exec-card--ok .hse-exec-card__icon {
    background: rgba(4, 120, 87, 0.12);
    color: var(--hse-success);
}
.hse-exec-card--warn::before { background: var(--hse-amber); }
.hse-exec-card--warn .hse-exec-card__icon {
    background: rgba(217, 119, 6, 0.14);
    color: var(--hse-amber);
}
.hse-exec-card--alert::before { background: var(--hse-danger); }
.hse-exec-card--alert .hse-exec-card__icon {
    background: rgba(185, 28, 28, 0.12);
    color: var(--hse-danger);
}
.hse-exec-panel__sites {
    padding: 0.75rem 1.1rem 1.05rem;
    border-top: 1px solid rgba(226, 232, 240, 0.9);
    background: rgba(247, 250, 252, 0.65);
}
.hse-exec-panel__sites-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--hse-navy-mid);
    margin-bottom: 0.45rem;
}
.hse-exec-panel__sites-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.hse-exec-panel__sites-row .hse-site-chip {
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(13, 148, 136, 0.22);
    background: #fff;
    color: #0f766e;
    font-weight: 600;
}
.hse-exec-panel__sites-row .hse-site-chip strong {
    margin-inline-start: 0.2rem;
    color: var(--hse-navy);
    font-variant-numeric: tabular-nums;
}
.hse-exec-panel__empty {
    font-size: 0.8rem;
    color: var(--hse-muted);
}

@media (max-width: 640px) {
    .hse-exec-panel__head {
        padding: 0.9rem 1rem;
    }
    .hse-exec-panel__title {
        font-size: 1rem;
    }
    .hse-exec-board--dashboard {
        padding: 0.85rem 0.85rem 0.25rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

[data-theme="dark"] .hse-exec-panel {
    background: var(--card-bg, #1e293b);
    border-color: var(--border-color, #334155);
}
[data-theme="dark"] .hse-exec-board--dashboard .hse-exec-card {
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(51, 65, 85, 0.9);
}
[data-theme="dark"] .hse-exec-board--dashboard .hse-exec-card__value {
    color: #e2e8f0;
}
[data-theme="dark"] .hse-exec-panel__sites {
    background: rgba(15, 23, 42, 0.35);
    border-top-color: rgba(51, 65, 85, 0.9);
}
[data-theme="dark"] .hse-exec-panel__sites-row .hse-site-chip {
    background: rgba(15, 23, 42, 0.7);
    color: #5eead4;
}

#hse-compliance-section,
#hse-org-sites-panel,
#hse-notify-prefs-panel {
    margin-top: 1rem;
}

/* ===== Settings shell (RTL-first, HSEHub brand) ===== */
#settings-section {
    --hse-set-rail-w: 260px;
    position: relative;
    isolation: isolate;
}

#settings-section .hse-settings-hero {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    padding: 1.15rem 1.35rem 1.25rem;
    border-radius: var(--hse-radius);
    border: 1px solid rgba(19, 49, 92, 0.12);
    background:
        linear-gradient(135deg, rgba(13, 148, 136, 0.14) 0%, transparent 42%),
        linear-gradient(225deg, rgba(11, 42, 74, 0.09) 0%, transparent 58%),
        linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: var(--hse-shadow);
    text-align: start;
    direction: inherit;
}
#settings-section .hse-settings-hero__brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-start;
}
#settings-section .hse-settings-hero__logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(11, 42, 74, 0.1);
    box-shadow: 0 4px 12px rgba(11, 42, 74, 0.08);
    flex-shrink: 0;
}
#settings-section .hse-settings-hero__brand-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.28rem;
    min-width: 0;
}
#settings-section .hse-settings-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--hse-navy);
    background: rgba(13, 148, 136, 0.14);
    border: 1px solid rgba(13, 148, 136, 0.28);
}
#settings-section .hse-settings-hero__badge i {
    color: var(--hse-teal);
}
#settings-section .hse-settings-hero__tagline {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--hse-muted);
    letter-spacing: 0.02em;
}
#settings-section .hse-settings-hero__copy {
    width: 100%;
    text-align: start;
}
#settings-section .hse-settings-hero__title,
#settings-section .hse-settings-hero .section-title {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    width: 100%;
    margin: 0 0 0.35rem;
    color: var(--hse-navy);
    text-align: start;
    font-family: var(--hse-font-display);
}
#settings-section .hse-settings-hero__title i,
#settings-section .hse-settings-hero .section-title i {
    color: var(--hse-teal);
    margin-inline-end: 0.65rem;
    margin-inline-start: 0;
    margin-left: 0;
    margin-right: 0;
}
#settings-section .hse-settings-hero__subtitle,
#settings-section .hse-settings-hero .section-subtitle {
    color: var(--hse-muted);
    max-width: 40rem;
    margin: 0;
    margin-inline-end: auto;
    margin-inline-start: 0;
    line-height: 1.55;
    text-align: start;
}

/*
  Inherit page direction (no forced LTR):
  - Arabic RTL → rail on the RIGHT (start), content on the LEFT
  - English LTR → rail on the LEFT (start), content on the RIGHT
*/
#settings-section .hse-settings-shell {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1.15rem;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

#settings-section .hse-settings-rail {
    flex: 0 0 var(--hse-set-rail-w);
    width: var(--hse-set-rail-w);
    max-width: var(--hse-set-rail-w);
    position: sticky;
    top: 0.75rem;
    z-index: 2;
    max-height: calc(100vh - 5.5rem);
    overflow-x: hidden;
    overflow-y: auto;
    background: linear-gradient(165deg, #0b2a4a 0%, #13315c 48%, #0d4a5c 100%);
    border: 1px solid rgba(11, 42, 74, 0.35);
    border-radius: var(--hse-radius);
    box-shadow: var(--hse-shadow);
    padding: 0.85rem 0.65rem 1rem;
    color: #e2e8f0;
    -webkit-overflow-scrolling: touch;
}

#settings-section .hse-settings-main {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    background: #fff;
    border: 1px solid var(--hse-border);
    border-radius: var(--hse-radius);
    box-shadow: var(--hse-shadow);
    padding: 1.15rem 1.25rem 1.5rem;
    text-align: start;
}

#settings-section .hse-settings-search {
    position: relative;
    margin-bottom: 0.75rem;
}
#settings-section .hse-settings-search i {
    position: absolute;
    inset-inline-end: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(226, 232, 240, 0.65);
    font-size: 0.8rem;
    pointer-events: none;
}
#settings-section .hse-settings-search input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: var(--hse-radius-sm);
    background: rgba(255, 255, 255, 0.08);
    color: #f8fafc;
    padding-block: 0.55rem;
    padding-inline: 0.75rem 2rem;
    font-size: 0.84rem;
    outline: none;
    text-align: start;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
#settings-section .hse-settings-search input::placeholder {
    color: rgba(226, 232, 240, 0.55);
}
#settings-section .hse-settings-search input:focus {
    border-color: rgba(45, 212, 191, 0.7);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.28);
    background: rgba(255, 255, 255, 0.12);
}

#settings-section .hse-settings-nav {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    border-radius: 0 !important;
}

#settings-section .hse-settings-nav-group {
    margin-bottom: 0.55rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
#settings-section .hse-settings-nav-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
#settings-section .hse-settings-nav-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(148, 163, 184, 0.95);
    padding: 0.15rem 0.55rem 0.4rem;
    text-align: start;
}

#settings-section .hse-settings-nav .tab-btn,
#settings-section .hse-settings-nav .hse-settings-nav-item {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-align: start !important;
    border: 1px solid transparent !important;
    border-bottom: 1px solid transparent !important;
    border-radius: 10px !important;
    padding: 0.55rem 0.6rem !important;
    margin: 0.1rem 0 !important;
    background: transparent !important;
    color: #e2e8f0 !important;
    font-size: 0.84rem !important;
    font-weight: 600 !important;
    box-shadow: none !important;
    white-space: nowrap;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}
#settings-section .hse-settings-nav .tab-btn::before {
    display: none !important;
    content: none !important;
}
#settings-section .hse-settings-nav .tab-btn i {
    margin-inline-end: 0.55rem !important;
    margin-inline-start: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 1.55rem;
    height: 1.55rem;
    flex: 0 0 1.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #99f6e4 !important;
    font-size: 0.78rem !important;
}
#settings-section .hse-settings-nav .tab-btn:hover {
    background: rgba(255, 255, 255, 0.09) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}
#settings-section .hse-settings-nav .tab-btn:hover i {
    background: rgba(13, 148, 136, 0.3);
    color: #ccfbf1 !important;
}
#settings-section .hse-settings-nav .tab-btn.active {
    background: linear-gradient(
        to left,
        rgba(13, 148, 136, 0.38),
        rgba(255, 255, 255, 0.08)
    ) !important;
    color: #fff !important;
    border-color: rgba(45, 212, 191, 0.45) !important;
    box-shadow: none !important;
    border-inline-start: 3px solid #2dd4bf !important;
}
#settings-section .hse-settings-nav .tab-btn.active i {
    background: rgba(13, 148, 136, 0.5);
    color: #fff !important;
}
#settings-section .hse-settings-nav .tab-btn.is-hidden {
    display: none !important;
}
#settings-section .hse-settings-nav-group.is-empty {
    display: none;
}

#settings-section .hse-settings-main > .tab-content.active {
    animation: hseSettingsFade 0.22s ease;
}
@keyframes hseSettingsFade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

#settings-section .hse-settings-main .settings-group {
    margin-bottom: 0;
    margin-top: 0 !important;
}
#settings-section .hse-settings-main .settings-group-header {
    border-bottom: 2px solid rgba(13, 148, 136, 0.22);
    margin-bottom: 1.1rem;
    padding-bottom: 0.8rem;
    text-align: start;
}
#settings-section .hse-settings-main .settings-group-title {
    font-size: 1.15rem;
    color: var(--hse-navy);
}
#settings-section .hse-settings-main .settings-group-title i {
    color: var(--hse-teal);
}
#settings-section .hse-settings-main .content-card {
    border: 1px solid var(--hse-border);
    border-radius: var(--hse-radius-sm);
    box-shadow: none;
    overflow: hidden;
    background: #fff;
}
#settings-section .hse-settings-main .card-header {
    background: linear-gradient(to left, rgba(11, 42, 74, 0.04), rgba(13, 148, 136, 0.07));
    border-bottom: 1px solid var(--hse-border);
}
#settings-section .hse-settings-main .card-title {
    color: var(--hse-navy-mid);
}

#settings-section .hse-settings-search-empty {
    display: none;
    font-size: 0.8rem;
    color: rgba(226, 232, 240, 0.7);
    padding: 0.75rem 0.55rem;
    text-align: center;
}
#settings-section .hse-settings-search-empty.is-visible {
    display: block;
}

html[lang="en"] #settings-section .hse-settings-nav .tab-btn.active,
body[lang="en"] #settings-section .hse-settings-nav .tab-btn.active,
.ltr #settings-section .hse-settings-nav .tab-btn.active,
[dir="ltr"] #settings-section .hse-settings-nav .tab-btn.active {
    background: linear-gradient(
        to right,
        rgba(13, 148, 136, 0.38),
        rgba(255, 255, 255, 0.08)
    ) !important;
}

@media (max-width: 1100px) {
    #settings-section { --hse-set-rail-w: 232px; }
}

@media (max-width: 960px) {
    #settings-section .hse-settings-shell {
        flex-direction: column;
    }
    #settings-section .hse-settings-rail {
        flex: none;
        width: 100%;
        max-width: none;
        position: static;
        max-height: none;
        overflow: visible;
    }
    #settings-section .hse-settings-nav {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 0.4rem;
        overflow-x: auto;
        padding-bottom: 0.2rem !important;
        -webkit-overflow-scrolling: touch;
    }
    #settings-section .hse-settings-nav-group {
        display: flex;
        flex: 0 0 auto;
        margin: 0;
        padding: 0;
        border: none;
        gap: 0.4rem;
    }
    #settings-section .hse-settings-nav-label { display: none; }
    #settings-section .hse-settings-nav .tab-btn {
        width: auto !important;
        white-space: nowrap;
        background: rgba(255, 255, 255, 0.08) !important;
        border: 1px solid rgba(255, 255, 255, 0.14) !important;
        border-inline-start-width: 1px !important;
    }
    #settings-section .hse-settings-nav .tab-btn.active {
        border-color: rgba(45, 212, 191, 0.55) !important;
        border-inline-start: 1px solid rgba(45, 212, 191, 0.55) !important;
        background: rgba(13, 148, 136, 0.35) !important;
    }
}

.hse-page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--hse-border);
}
.hse-page-header__title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hse-navy);
    font-family: var(--hse-font-display);
}
.hse-page-header__sub {
    margin: 0.25rem 0 0;
    font-size: 0.9rem;
    color: var(--hse-muted);
}
.hse-page-header__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.hse-section-card {
    background: #fff;
    border: 1px solid var(--hse-border);
    border-radius: var(--hse-radius);
    box-shadow: var(--hse-shadow);
    padding: 1rem 1.15rem;
    margin-bottom: 1rem;
}

/* Unify legacy empty states with HSE empty chrome */
.empty-state.hse-empty-state,
.empty-state.hse-empty-enhanced,
.section-content .empty-state {
    text-align: center;
    padding: 2.5rem 1.25rem;
    color: var(--hse-muted);
    background: var(--hse-surface);
    border: 1px dashed var(--hse-border);
    border-radius: var(--hse-radius);
}
.section-content .empty-state p,
.empty-state.hse-empty-enhanced p {
    margin: 0;
    font-size: 0.9rem;
}

[data-theme="dark"] #settings-section .hse-settings-hero,
[data-theme="dark"] #settings-section .hse-settings-main {
    background: var(--card-bg, #1e293b);
    border-color: var(--border-color, #334155);
}
[data-theme="dark"] #settings-section .hse-settings-hero__logo {
    background: rgba(15, 23, 42, 0.6);
    border-color: rgba(148, 163, 184, 0.25);
}
[data-theme="dark"] #settings-section .hse-settings-hero__title,
[data-theme="dark"] #settings-section .hse-settings-hero .section-title {
    color: #e2e8f0;
}
[data-theme="dark"] #settings-section .hse-settings-main .card-header {
    background: rgba(15, 23, 42, 0.45);
}
[data-theme="dark"] #settings-section .hse-settings-main .content-card {
    background: var(--card-bg, #1e293b);
}
