/* Staff / portal appearance prefs */
html {
    --ati-brightness: 1;
}

html[data-font="sm"] { font-size: 14px; }
html[data-font="md"] { font-size: 16px; }
html[data-font="lg"] { font-size: 18px; }

#atiBrightnessVeil {
    position: fixed;
    inset: 0;
    z-index: 1010;
    pointer-events: none;
    background: #000;
    opacity: 0;
}

html[data-theme="dark"] {
    --bg-primary: #101814;
    --bg-secondary: #1a2420;
    --text-primary: #e7f3ea;
    --text-secondary: #b4c7ba;
    --glass-bg: rgba(22, 32, 28, 0.96);
    --glass-border: rgba(255, 255, 255, 0.12);
    color-scheme: dark;
}

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

html[data-theme="dark"] .dashboard-layout {
    background:
        radial-gradient(ellipse 70% 55% at 0% 0%, rgba(51, 116, 24, 0.18), transparent 52%),
        #121c18 !important;
}

html[data-theme="dark"] .dashboard-panel,
html[data-theme="dark"] .profile-header,
html[data-theme="dark"] .card,
html[data-theme="dark"] .hr-panel,
html[data-theme="dark"] .data-table {
    background: #1a2420;
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .data-table th,
html[data-theme="dark"] .data-table td {
    color: var(--text-primary);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .profile-header {
    background: #1a2420 !important;
}

html[data-theme="dark"] .no-print[style*="background-color: #ffffff"] {
    background-color: #1a2420 !important;
    border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

html[data-theme="dark"] .no-print[style*="background-color: #ffffff"] span {
    color: #d7e8dc !important;
}

html[data-theme="dark"] .profile-dropdown-menu {
    background: #1f2c27 !important;
}

html[data-theme="dark"] .profile-dropdown-menu .nav-logout:hover,
html[data-theme="dark"] .profile-dropdown-menu a.nav-logout:hover {
    background: rgba(220, 38, 38, 0.18) !important;
    color: #fca5a5 !important;
}

html[data-theme="dark"] .hris-doc-card,
html[data-theme="dark"] .stat-card {
    background: #1a2420;
}

html[data-theme="dark"].staff-mobile,
html[data-theme="dark"] body.staff-mobile {
    background: #101814 !important;
    --sm-wash: #101814;
    --sm-card: #1a2420;
    --sm-ink: #e7f3ea;
    --sm-muted: #b4c7ba;
    --sm-line: rgba(255, 255, 255, 0.1);
    --sm-mint: #24352a;
}

.nav-account-bar {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 0.5rem;
    overflow: hidden;
}

.nav-account-bar .profile-dropdown-btn {
    background: transparent;
    color: #fff;
}

.nav-settings-wrap {
    position: relative;
    margin-right: 0.45rem;
    flex-shrink: 0;
}

.nav-settings-icon {
    background: transparent !important;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.28);
    border-right: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 0;
    width: 36px;
    min-height: 36px;
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
}

.nav-account-bar .profile-dropdown-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.profile-dropdown-menu .profile-dropdown-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 1.25rem;
    color: #1f2937 !important;
    text-decoration: none;
    text-align: left;
    background: transparent !important;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0;
    font: inherit;
    font-size: inherit;
    font-weight: 500;
    cursor: pointer;
    min-height: 0;
    line-height: inherit;
    -webkit-appearance: none;
    appearance: none;
    box-shadow: none;
}

.profile-dropdown-menu .profile-dropdown-item:last-child {
    border-bottom: none;
}

.profile-dropdown-menu .profile-dropdown-item:hover {
    background: #f8fafc !important;
}

.profile-dropdown-menu .nav-logout:hover,
.profile-dropdown-menu a.nav-logout:hover {
    background: #fef2f2 !important;
    color: #dc2626 !important;
}
.app-sidebar a[href*="logout.php"]:hover,
.hris-sidebar a[href*="logout.php"]:hover,
#sidebar a[href*="logout.php"]:hover {
    color: #fecaca !important;
}

.profile-dropdown-menu .nav-settings-icon {
    width: 100%;
    color: #1f2937 !important;
    justify-content: flex-start;
}

.nav-account-cluster {
    position: relative;
    z-index: 11000;
    overflow: visible;
}

.st-settings-pop {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    left: auto;
    width: min(420px, calc(100vw - 1.5rem));
    z-index: 20000;
    display: none;
    text-align: left;
    color: var(--text-primary) !important;
    max-height: min(80vh, 640px);
    overflow-y: auto;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
    padding: 1.15rem 1.25rem 1.25rem;
    background: #fff !important;
    border: 1px solid var(--glass-border);
    margin: 0;
    max-width: min(420px, calc(100vw - 1.5rem));
}

.st-settings-pop h1,
.st-settings-pop h3,
.st-settings-pop p,
.st-settings-pop strong,
.st-settings-pop span,
.st-settings-pop label {
    color: var(--text-primary) !important;
}

.st-settings-pop p,
.st-settings-pop .st-lead {
    color: var(--text-secondary) !important;
}

.st-settings-pop.st-settings {
    width: min(420px, calc(100vw - 1.5rem));
    max-width: min(420px, calc(100vw - 1.5rem));
    margin: 0;
}

.st-settings-pop.is-open {
    display: block !important;
}

.st-settings-pop[hidden] {
    display: none !important;
}

.st-settings-main {
    display: flex !important;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
}

.st-settings {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
}

.st-settings h1 {
    font-size: 1.45rem;
    margin: 0 0 0.35rem;
}

.st-settings .st-lead {
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.st-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--glass-border);
}

.st-row:last-of-type {
    border-bottom: none;
}

.st-row h3 {
    font-size: 0.95rem;
    margin: 0 0 0.2rem;
}

.st-row p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.st-seg {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.st-seg button {
    border: 1px solid var(--glass-border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 999px;
    padding: 0.4rem 0.85rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

.st-seg button.is-on {
    background: #1E5128;
    border-color: #1E5128;
    color: #fff;
}

.st-range {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 200px;
    flex: 1;
}

.st-range input[type="range"] {
    flex: 1;
    accent-color: #1E5128;
}

.st-switch {
    position: relative;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}

.st-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.st-switch span {
    position: absolute;
    inset: 0;
    background: #cbd5d1;
    border-radius: 999px;
    cursor: pointer;
    transition: 0.2s;
}

.st-switch span::after {
    content: "";
    position: absolute;
    width: 22px;
    height: 22px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.2s;
}

.st-switch input:checked + span {
    background: #1E5128;
}

.st-switch input:checked + span::after {
    transform: translateX(20px);
}

.st-reset {
    margin-top: 1rem;
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    border-radius: 0.5rem;
    padding: 0.55rem 0.9rem;
    cursor: pointer;
    font-weight: 600;
}
