/* Shared light/dark theme layer */
:root{
  color-scheme: light;
  --theme-bg:#f4f8ff;
  --theme-panel:#ffffff;
  --theme-panel-2:#f7fbff;
  --theme-text:#142b45;
  --theme-muted:#6e8198;
  --theme-line:#dfe9f5;
  --theme-blue:#1673ea;
  --theme-shadow:0 10px 32px rgba(43,83,132,.08);
}
html[data-theme="dark"]{
  color-scheme: dark;
  --theme-bg:#0b1220;
  --theme-panel:#121c2d;
  --theme-panel-2:#172337;
  --theme-text:#e9f2ff;
  --theme-muted:#9eb0c7;
  --theme-line:#2a3a51;
  --theme-blue:#5fa7ff;
  --theme-shadow:0 16px 36px rgba(0,0,0,.28);
  --bg:#0b1220;--panel:#121c2d;--ink:#e9f2ff;--muted:#9eb0c7;--line:#2a3a51;
  --blue:#5fa7ff;--blue-strong:#77b6ff;--blue2:#172c48;--green:#52c99a;--red:#ff7474;--orange:#f2a657;
}
.theme-toggle{display:inline-grid;place-items:center;width:38px;height:38px;border-radius:12px;border:1px solid #dce7f3;background:#fff;color:#1e426a;cursor:pointer;transition:.18s;box-shadow:0 4px 12px rgba(26,73,123,.04)}
.theme-toggle:hover{transform:translateY(-1px);background:#edf5ff;border-color:#bdd5f4}.theme-toggle .sun,.theme-toggle .moon{font-size:17px;line-height:1}.theme-toggle .sun{display:none}html[data-theme="dark"] .theme-toggle .sun{display:inline}html[data-theme="dark"] .theme-toggle .moon{display:none}
.auth-theme-toggle{position:fixed;top:20px;right:22px;z-index:120}
@media(max-width:720px){.auth-theme-toggle{top:12px;right:12px}}

/* Dashboard dark mode */
html[data-theme="dark"] body{background:#0b1220!important;color:var(--theme-text)}
html[data-theme="dark"] .sidebar{background:linear-gradient(180deg,#101a2a 0%,#0d1726 60%,#0a1320 100%);border-right-color:#24354b;box-shadow:8px 0 26px rgba(0,0,0,.12)}
html[data-theme="dark"] .sidebar:after{border-color:rgba(95,167,255,.06)}
html[data-theme="dark"] .brand h1{color:#eef6ff}html[data-theme="dark"] .brand p,html[data-theme="dark"] .sidebar-foot{color:#8fa2ba}
html[data-theme="dark"] .nav-link{color:#b8c7d9}html[data-theme="dark"] .nav-link:before{color:#8ea6c1}html[data-theme="dark"] .nav-link:hover{background:#15263d;color:#71b1ff}html[data-theme="dark"] .nav-link.active{background:linear-gradient(135deg,#2f79d8,#245fb0);box-shadow:0 10px 24px rgba(24,85,159,.28)}
html[data-theme="dark"] .main:before{background:radial-gradient(circle at 84% 9%,rgba(44,113,191,.22),transparent 28%),radial-gradient(circle at 24% 78%,rgba(45,91,143,.14),transparent 25%),linear-gradient(180deg,#0b1321,#0a111d)}
html[data-theme="dark"] .topbar{background:rgba(14,23,38,.9);border-bottom-color:#26374d;box-shadow:0 5px 22px rgba(0,0,0,.12)}html[data-theme="dark"] .topbar>small{color:#adc0d7}
html[data-theme="dark"] .theme-toggle,html[data-theme="dark"] .notification-bell{background:#152238;border-color:#2b3d55;color:#ddecff}
html[data-theme="dark"] .theme-toggle:hover,html[data-theme="dark"] .notification-bell:hover{background:#1b2d49;border-color:#3f5d80}
html[data-theme="dark"] .role-badge{background:#173255;color:#7bb8ff;border-color:#244d79}
html[data-theme="dark"] .btn.secondary{background:#172337;color:#b9c9dc;border-color:#2b3d55}html[data-theme="dark"] .btn.secondary:hover{background:#1d2c43}
html[data-theme="dark"] .panel,html[data-theme="dark"] .card,html[data-theme="dark"] .kpi,html[data-theme="dark"] .notice{background:#121c2d;border-color:#293a51;box-shadow:var(--theme-shadow)}
html[data-theme="dark"] .panel h3,html[data-theme="dark"] .card h3,html[data-theme="dark"] .page-head h1,html[data-theme="dark"] .page-head h2{color:#edf5ff}
html[data-theme="dark"] .card p,html[data-theme="dark"] .page-head p,html[data-theme="dark"] .subtext,html[data-theme="dark"] .muted{color:#97aac2}
html[data-theme="dark"] .card:hover{border-color:#3a5574;box-shadow:0 18px 38px rgba(0,0,0,.28)}
html[data-theme="dark"] .table-wrap th{background:#172337;color:#aac0da}html[data-theme="dark"] .table-wrap td,html[data-theme="dark"] .table-wrap th{border-bottom-color:#27384e}html[data-theme="dark"] .table-wrap tbody tr:hover{background:#16253b}
html[data-theme="dark"] .filter-grid input,html[data-theme="dark"] .filter-grid select,html[data-theme="dark"] .form input,html[data-theme="dark"] .form select,html[data-theme="dark"] .form textarea,html[data-theme="dark"] .search{background:#0f1929;color:#eaf3ff;border-color:#2a3b52}html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#6f829a}
html[data-theme="dark"] dialog{background:#121c2d;color:#eaf3ff}html[data-theme="dark"] dialog::backdrop{background:rgba(0,0,0,.62)}
html[data-theme="dark"] .notification-panel{background:#121c2d;border-color:#2a3b52}html[data-theme="dark"] .notification-head{border-bottom-color:#2a3b52}html[data-theme="dark"] .notification-item{background:#121c2d;border-bottom-color:#223147}html[data-theme="dark"] .notification-item:hover{background:#17253a}html[data-theme="dark"] .notification-item.unread{background:#152b46}html[data-theme="dark"] .notification-item small{color:#a8bad0}html[data-theme="dark"] .notification-more{background:#0f1929;color:#72b1ff}
html[data-theme="dark"] .education-tab,html[data-theme="dark"] .activity-tab{background:#18253a;color:#b7c7da;border-color:#2c3d54}html[data-theme="dark"] .education-tab:hover,html[data-theme="dark"] .activity-tab:hover{background:#1c3150;color:#7ab9ff}html[data-theme="dark"] .education-tab.active,html[data-theme="dark"] .activity-tab.active{background:#2b70c9;color:#fff}
html[data-theme="dark"] .worker-checklist,html[data-theme="dark"] .worker-option,html[data-theme="dark"] .standards-grid label,html[data-theme="dark"] .detail-card{border-color:#2a3b52;background:#101a2b}
html[data-theme="dark"] .calendar-weekdays{background:#172337}html[data-theme="dark"] .calendar-weekdays span{color:#a8bbd1}html[data-theme="dark"] .calendar-day{background:#101a2b;border-color:#2a3b52;color:#eaf3ff}html[data-theme="dark"] .calendar-day:hover{background:#162a43}html[data-theme="dark"] .calendar-day b{color:#e7f2ff}html[data-theme="dark"] .calendar-event{background:#18385f;color:#8bc2ff}
html[data-theme="dark"] .recent-activity-item,html[data-theme="dark"] .activity-item{border-bottom-color:#2a3b52}html[data-theme="dark"] .recent-activity-item p,html[data-theme="dark"] .activity-item p{color:#a6b8cf}html[data-theme="dark"] .activity-item.unread{background:#15263d}
html[data-theme="dark"] .legal-note{background:#322817;border-color:#5b4828;color:#e5c88f}

/* Home hero and cards */
html[data-theme="dark"] .home-hero{background:linear-gradient(118deg,#121f33 0%,#152942 48%,#173553 100%);border-color:#29425f;box-shadow:0 16px 38px rgba(0,0,0,.24)}html[data-theme="dark"] .home-hero:before{background:radial-gradient(circle,rgba(78,139,207,.18),rgba(0,0,0,0) 66%)}html[data-theme="dark"] .home-hero h2{color:#eff7ff}html[data-theme="dark"] .home-hero p{color:#b8cae0}html[data-theme="dark"] .hero-meta{color:#90a9c3}html[data-theme="dark"] .hero-meta span:first-child{background:#132740;border-color:#2b4c6d;color:#82bdff}html[data-theme="dark"] .hero-visual:before{background:linear-gradient(90deg,#152942 0%,rgba(21,41,66,.72) 21%,rgba(21,41,66,0) 63%)}html[data-theme="dark"] .hero-visual img{opacity:.42;filter:saturate(.7) brightness(.65) contrast(1.05)}html[data-theme="dark"] .hero-slogan{color:#91aecb}html[data-theme="dark"] .hero-slogan b{color:#d5eaff}
html[data-theme="dark"] .shortcut-card{background:linear-gradient(150deg,#121d30,#101a2b);border-color:#293c55}html[data-theme="dark"] .shortcut-icon{background:#18314f;color:#79b8ff}html[data-theme="dark"] .shortcut-arrow{background:#16243a;border-color:#2f4661;color:#8fbcf1}html[data-theme="dark"] .shortcut-card h3{color:#edf5ff}html[data-theme="dark"] .shortcut-card p{color:#9db0c8}
html[data-theme="dark"] .current-status-panel{background:linear-gradient(180deg,#121c2d,#101927)}html[data-theme="dark"] .home-kpis .kpi{background:linear-gradient(145deg,#152238,#101927);border-color:#2a3c54}html[data-theme="dark"] .home-kpis .kpi-icon{background:#18314f}html[data-theme="dark"] .home-kpis .kpi strong{color:#edf6ff}html[data-theme="dark"] .home-kpis .kpi strong em{color:#91a7c0}

/* Login + signup dark mode */
html[data-theme="dark"] body.login-page,html[data-theme="dark"] body.signup-page{background:#0b1220;color:#eaf3ff}
html[data-theme="dark"] .login-shell,html[data-theme="dark"] .signup-shell{background:linear-gradient(135deg,#0d1626 0%,#101c2e 52%,#0b1321 100%)}
html[data-theme="dark"] .login-intro,html[data-theme="dark"] .signup-intro{background:linear-gradient(135deg,rgba(16,27,44,.98),rgba(19,38,61,.94))}
html[data-theme="dark"] .intro-brand,html[data-theme="dark"] .intro-copy p,html[data-theme="dark"] .intro-footer,html[data-theme="dark"] .mini-feature p,html[data-theme="dark"] .feature-card p,html[data-theme="dark"] .safety-copy,html[data-theme="dark"] .top-motto{color:#9eb2cb}
html[data-theme="dark"] .brand-helmet svg{fill:#8db6e4}html[data-theme="dark"] .brand-divider{background:#405a77}
html[data-theme="dark"] .intro-copy h1{color:#eff6ff}html[data-theme="dark"] .intro-copy h1 strong{color:#65aaff}
html[data-theme="dark"] .feature-card,html[data-theme="dark"] .step-card{background:rgba(20,32,51,.92);border-color:#2a3c55;box-shadow:0 16px 34px rgba(0,0,0,.16)}html[data-theme="dark"] .feature-card h2,html[data-theme="dark"] .step-card h2,html[data-theme="dark"] .mini-feature b{color:#eaf3ff}
html[data-theme="dark"] .login-area,html[data-theme="dark"] .signup-area{background:rgba(8,14,24,.22)}
html[data-theme="dark"] .login-card,html[data-theme="dark"] .signup-card{background:#121c2d;border-color:#293a51;box-shadow:0 28px 70px rgba(0,0,0,.36)}html[data-theme="dark"] .login-card header h2,html[data-theme="dark"] .signup-card header h2{color:#edf6ff}html[data-theme="dark"] .login-card header p,html[data-theme="dark"] .signup-card header p,html[data-theme="dark"] .approval-note,html[data-theme="dark"] .back-login{color:#9fb1c8}
html[data-theme="dark"] .field{color:#dbe7f5}html[data-theme="dark"] .input-box{background:#0f1929;border-color:#2b3d55}html[data-theme="dark"] .input-box:focus-within{border-color:#5fa7ff;box-shadow:0 0 0 3px rgba(95,167,255,.12)}html[data-theme="dark"] .input-box input,html[data-theme="dark"] .input-box select{color:#edf5ff}html[data-theme="dark"] .input-icon{color:#8da6c2}
html[data-theme="dark"] .remember,html[data-theme="dark"] .login-options,html[data-theme="dark"] .field-help{color:#9caec4}html[data-theme="dark"] .or span,html[data-theme="dark"] .back-login{border-color:#2b3a50}
html[data-theme="dark"] .signup-button,html[data-theme="dark"] .privacy-detail{background:#121c2d;border-color:#3a5270;color:#7cb8ff}
html[data-theme="dark"] .system-notice,html[data-theme="dark"] .privacy-box{background:#15263e;border-color:#2d4563;color:#bcd0e8}html[data-theme="dark"] .system-notice b,html[data-theme="dark"] .privacy-title b{color:#d8e9fb}html[data-theme="dark"] .system-notice p,html[data-theme="dark"] .privacy-box ul,html[data-theme="dark"] .agree-row{color:#9fb4cc}
html[data-theme="dark"] .privacy-dialog-card{color:#eaf3ff}html[data-theme="dark"] .privacy-dialog-card p{color:#a8bad0}

/* v20 polished modal dark mode */
html[data-theme="dark"] dialog{border-color:#2b3e56;background:#111b2b}
html[data-theme="dark"] .modal-polished{background:#111b2b;color:#eaf3ff}
html[data-theme="dark"] .modal-polished .modal-head{background:linear-gradient(180deg,#142034,#111b2b);border-bottom-color:#2a3a50}
html[data-theme="dark"] .modal-polished .modal-head h3{color:#eef6ff}html[data-theme="dark"] .modal-polished .modal-head p{color:#96abc4}
html[data-theme="dark"] .modal-icon{background:linear-gradient(145deg,#18314f,#13243a);border-color:#2f4a67;box-shadow:none}html[data-theme="dark"] .modal-close{color:#99aec6}html[data-theme="dark"] .modal-close:hover{background:#1b2c45;color:#82bdff}
html[data-theme="dark"] .modal-polished .form label{color:#dce9f8}html[data-theme="dark"] .field-shell{background:#0e1828;border-color:#2b3e56}html[data-theme="dark"] .field-shell:focus-within{border-color:#5fa7ff;box-shadow:0 0 0 3px rgba(95,167,255,.10)}html[data-theme="dark"] .field-icon{background:#142238;border-right-color:#2a3a50;color:#94aac3}
html[data-theme="dark"] .modal-polished .field-shell input,html[data-theme="dark"] .modal-polished .field-shell select,html[data-theme="dark"] .modal-polished .field-shell textarea{color:#edf5ff!important}
html[data-theme="dark"] .modal-polished .worker-checklist,html[data-theme="dark"] .modal-polished .detail-card{background:#0e1828;border-color:#2b3e56}
html[data-theme="dark"] .modal-info{background:#14263e;border-color:#294566;color:#a9c5e5}html[data-theme="dark"] .modal-actions{background:#0f1928;border-top-color:#2a3a50}html[data-theme="dark"] .modal-actions .modal-cancel{background:#172337;color:#b9c9dc;border-color:#2b3e56}
html[data-theme="dark"] .password-dialog,html[data-theme="dark"] .privacy-dialog{background:#111b2b;border-color:#2b3e56}html[data-theme="dark"] .password-dialog-card,html[data-theme="dark"] .privacy-dialog-card{color:#eaf3ff}html[data-theme="dark"] .password-dialog-card h3,html[data-theme="dark"] .privacy-dialog-card h3{color:#eef6ff}html[data-theme="dark"] .password-dialog-card h3:before,html[data-theme="dark"] .privacy-dialog-card h3:before{background:#18314f;border-color:#2f4a67}html[data-theme="dark"] .password-dialog-card p{color:#9fb3cb}html[data-theme="dark"] .privacy-dialog-card p{background:#101b2d;border-color:#2b3e56;color:#9fb3cb}html[data-theme="dark"] .privacy-dialog-card p b{color:#ddecff}
