/* Dark theme - generated from app.css by darkgen.py, then hand-tuned rules at the end. */
html[data-theme="dark"] .topbar { background:rgba(23,33,52,0.92); }
html[data-theme="dark"] .menu-btn { color:#9dbcf2; }
html[data-theme="dark"] .company { color:#9dbcf2; background:#192c4d; }
html[data-theme="dark"] .avatar { background:#172134; color:#9dbcf2; }
html[data-theme="dark"] .page-title { color:#a8bee6; }
html[data-theme="dark"] .card { border:1px solid #304369; }
html[data-theme="dark"] .card-title { color:#afc0df; }
html[data-theme="dark"] .flash.ok { background:#194d2b; color:#a2ecc0; border:1px solid #2a6f41; }
html[data-theme="dark"] .flash.error { background:#4d1919; color:#eaa4a4; border:1px solid #6f2a2a; }
html[data-theme="dark"] .stat-ico.navy svg { stroke:#9dbcf2; }
html[data-theme="dark"] .countdown { color:#eaaaa3; }
html[data-theme="dark"] .switch span { background:#223050; }
html[data-theme="dark"] .switch span::before { background:#172134; }
html[data-theme="dark"] .day.is-today { background:#192a4d; }
html[data-theme="dark"] .day-detail p { color:#b4bfd0; }
html[data-theme="dark"] .pill { background:#223050; }
html[data-theme="dark"] .pill.st-present { background:#264d19; color:#b2eda1; }
html[data-theme="dark"] .pill.st-late { background:#4d3f19; color:#f1d99d; }
html[data-theme="dark"] .pill.st-absent { background:#4d1919; color:#eaa4a4; }
html[data-theme="dark"] .pill.st-leave { background:#31194d; color:#c4a6e8; }
html[data-theme="dark"] .pill.st-holiday { background:#194d41; color:#9df1e0; }
html[data-theme="dark"] .pill.st-weekly-off,
html[data-theme="dark"] .pill.st-today { background:#232f43; color:#b4bfd0; }
html[data-theme="dark"] .tabs button { background:#172134; }
html[data-theme="dark"] .group-head { background:#252c41; }
html[data-theme="dark"] .btn.ghost { background:#232f43; }
html[data-theme="dark"] .form label { color:#b4bfd0; }
html[data-theme="dark"] .form input:not([type=checkbox]),
html[data-theme="dark"] .form select,
html[data-theme="dark"] .form textarea { border:1px solid #2a3752; background:#172134; }
html[data-theme="dark"] .form input:focus,
html[data-theme="dark"] .form select:focus,
html[data-theme="dark"] .form textarea:focus { outline:2px solid #2a426f; }
html[data-theme="dark"] .form input:disabled { background:#1d2840; color:#b4bfd0; }
html[data-theme="dark"] .section-label { color:#9dbcf2; }
html[data-theme="dark"] .tile { background:#172134; }
html[data-theme="dark"] .balance { background:#172134; }
html[data-theme="dark"] .balance b { color:#9dbcf2; }
html[data-theme="dark"] .balance .meter { background:#232f43; }
html[data-theme="dark"] .week-strip div { background:#192a4d; }
html[data-theme="dark"] .payslip { background:#172134; }
html[data-theme="dark"] .payslip h1 { color:#9dbcf2; }
html[data-theme="dark"] .net { background:#19314d; }
html[data-theme="dark"] .auth-page { background:#172134; }
html[data-theme="dark"] .mock { background:#172134; }
html[data-theme="dark"] .mock-tile { border:1px solid #314368; color:#afc0df; }
html[data-theme="dark"] .mock-tile i { background:#212d45; }
html[data-theme="dark"] .t-purple { color:#c5a2ec; }
html[data-theme="dark"] .mock-bars { border-bottom:1px solid #314368; }
html[data-theme="dark"] .auth-box h1 { color:#a8bee6; }
html[data-theme="dark"] .field input { background:#1c2e4a !important; }
html[data-theme="dark"] .forgot { color:#a1bced; }
html[data-theme="dark"] .setup-note { background:#192c4d; color:#a9bee5; }
html[data-theme="dark"] .error-box { background:#172134; }
html[data-theme="dark"] .loc { color:#b4bfd0; }
html[data-theme="dark"] .proof img { border:2px solid #324667; }
html[data-theme="dark"] .thumb { border:1px solid #324667; }
html[data-theme="dark"] .selfie-note { background:#4d3f19; color:#f1db9d; }
html[data-theme="dark"] .kiosk-help { background:#192c4d; color:#a9bee5; }
html[data-theme="dark"] .kiosk-search input { border:1px solid #2a3752; background:#172134; }
html[data-theme="dark"] .kiosk-times { background:#1c2e4a; }
html[data-theme="dark"] .manual[open] summary { background:#1d2d49; }
html[data-theme="dark"] .manual-form { background:#1c2e4a; }
html[data-theme="dark"] .tbl td { color:#b5c2d9; }
html[data-theme="dark"] .tbl th { color:#b4bfd0; }
html[data-theme="dark"] .card-title { color:#a8bee6; }
html[data-theme="dark"] .tabs { background:#1f2e47; }
html[data-theme="dark"] .group-head { background:#1e2f48; color:#b9c3d5; }
html[data-theme="dark"] .day.sel { background:#192c4d; }
html[data-theme="dark"] .quick a,
html[data-theme="dark"] .quick button { background:#192a4d; border:1px solid #334466; color:#b5c2d9; }
html[data-theme="dark"] .quick a:hover,
html[data-theme="dark"] .quick button:hover { background:#192c4d; }
html[data-theme="dark"] .q-ico.blue { background:#192c4d; color:#9dbcf1; }
html[data-theme="dark"] .q-ico.purple { background:#31194d; color:#c5a2ec; }
html[data-theme="dark"] .q-ico.red { background:#4d1919; color:#eda1a1; }
html[data-theme="dark"] .q-ico.gold { background:#4d3e19; }
html[data-theme="dark"] .start-brand img { background:#172134; }
html[data-theme="dark"] .start-card { background:#172134; }
html[data-theme="dark"] .start-card h1 { color:#a8bee6; }
html[data-theme="dark"] .start-clock { background:#192d4d; }
html[data-theme="dark"] .start-clock b { color:#a8bee6; }
html[data-theme="dark"] .chip { background:#192c4d; color:#a9bee5; }
html[data-theme="dark"] .chip.ok { background:#194d2b; color:#a2ecc0; }
html[data-theme="dark"] .chip.warn { background:#4d3f19; color:#f1d99d; }
html[data-theme="dark"] .start-cta { color:#a8bee6; }
html[data-theme="dark"] .start-steps li { color:#b4bfd0; }
html[data-theme="dark"] .start-steps span { background:#192c4d; color:#9dbcf2; }
html[data-theme="dark"] .home-notice { background:#172134; color:#b5c2d9; }
html[data-theme="dark"] .home-notice b { color:#a8bee6; }
html[data-theme="dark"] .home-panel { background:#172134; }
html[data-theme="dark"] .today-strip.out { background:#4d3f19; color:#f1db9d; }
html[data-theme="dark"] .today-strip.in { background:#194d2b; color:#a2ecc0; }
html[data-theme="dark"] .today-strip.done { background:#192a4d; color:#a9bee5; }
html[data-theme="dark"] .home-q { color:#a8bee6; }
html[data-theme="dark"] .lock-hint { background:#4d3f19; color:#f1db9d; }
html[data-theme="dark"] .app-tile { color:#b5c2d9; }
html[data-theme="dark"] .app-tile:hover { background:#192d4d; }
html[data-theme="dark"] .app-ico { background:#192c4d; }
html[data-theme="dark"] .app-ico.navy { color:#aabfe4; background:#192c4d; }
html[data-theme="dark"] .app-ico.blue { color:#9dbcf1; background:#192c4d; }
html[data-theme="dark"] .app-ico.gold { background:#4d3e19; }
html[data-theme="dark"] .app-ico.purple { color:#c5a2ec; background:#31194d; }
html[data-theme="dark"] .app-ico.teal { background:#194d40; }
html[data-theme="dark"] .app-ico.pink { color:#eba3bf; background:#4d192d; }
html[data-theme="dark"] .app-ico.green { background:#194d2e; }
html[data-theme="dark"] .app-ico.red { color:#eda1a1; background:#4d1919; }
html[data-theme="dark"] .clock-main { background:#172134; }
html[data-theme="dark"] .clock-map { background:#172134; }
html[data-theme="dark"] .clock-addr { color:#b5c2d9; }
html[data-theme="dark"] .map-box { background:#1a2e4c repeating-linear-gradient(45deg, #1a2e4c 0 14px, #192f4d 14px 28px); }
html[data-theme="dark"] .map-wait { color:#b9c3d5; }
html[data-theme="dark"] .map-wait b { color:#a2ecc0; }
html[data-theme="dark"] .spinner { border:4px solid #2b456e; }
html[data-theme="dark"] .clock-io b { background:#1f2f47; color:#b5c2d9; }
html[data-theme="dark"] .clock-done { background:#194d2b; color:#a2ecc0; }
html[data-theme="dark"] .month-nav input[type=month] { border:1px solid #2a3752; background:#172134; }
html[data-theme="dark"] .table-search { border:1px solid #2a3752; }
html[data-theme="dark"] .month-tbl td:first-child { background:#172134; }
html[data-theme="dark"] .c-leave { color:#c4a9e5; }
html[data-theme="dark"] .c-absent { color:#e9a4a4; }
html[data-theme="dark"] .role-badge { color:#f1da9d; }
html[data-theme="dark"] .seg { background:#1f2e47; }
html[data-theme="dark"] .seg a { color:#b4bfd0; }
html[data-theme="dark"] .section-title { color:#a8bee6; }
html[data-theme="dark"] .lday { background:#192d4d; color:#9dbcf1; }
html[data-theme="dark"] .lday.has { background:#172134; }
html[data-theme="dark"] .lday.now { background:#192c4d; }
html[data-theme="dark"] .on-day b { color:#9dbcf1; }
html[data-theme="dark"] .lrow a { color:#9dbcf1; }
html[data-theme="dark"] .saved-addr { color:#b4bfd0; }
html[data-theme="dark"] .home-panel { border:1px solid #324667; }
html[data-theme="dark"] .steps li::before { background:#223050; border:3px solid #2a3752; }
html[data-theme="dark"] .steps li:not(:last-child)::after { background:#223050; }
html[data-theme="dark"] .req-reason { background:#192a4d; }
html[data-theme="dark"] img.avatar { background:#1f2e47; }
html[data-theme="dark"] .ot-note { background:#194d2e; color:#a6e8c9; }
html[data-theme="dark"] .note-input { border:1px solid #2a3752; }
html[data-theme="dark"] .mail-status.ok { background:#194d2b; color:#a6e8c9; border:1px solid #2a6f41; }
html[data-theme="dark"] .mail-status.bad { background:#4d3f19; color:#f1d99d; border:1px solid #6f5e2a; }
html[data-theme="dark"] .howto code { background:#1f2e47; }
html[data-theme="dark"] .mail-warn { background:#4d3f19; color:#f1d99d; }
html[data-theme="dark"] .rules-list { color:#b4bfd0; }
html[data-theme="dark"] .hol-edit select { border:1px solid #2a3752; background:#172134; }
html[data-theme="dark"] .auth-page { background:#192d4d; }
html[data-theme="dark"] .auth-panel { background:radial-gradient(600px 400px at 50% 0%, #192d4d, transparent 70%), #192d4d; }
html[data-theme="dark"] .auth-box { background:#172134; border:1px solid #324667; }
html[data-theme="dark"] .lbl { color:#b9c3d5 !important; }
html[data-theme="dark"] .field.ico-left input { background:#1c2e4a !important; border:1.5px solid #354864 !important; }
html[data-theme="dark"] .field.ico-left input:focus { background:#172134 !important; }
html[data-theme="dark"] .field.ico-left:focus-within .lead { stroke:#9dbcf1; }
html[data-theme="dark"] .auth-row .check { color:#b4bfd0; }
html[data-theme="dark"] .auth-note { background:#192d4d; color:#b4bfd0; }
html[data-theme="dark"] .auth-note svg { stroke:#9dbcf1; }
html[data-theme="dark"] .pf-hero { background:#172134; border:1px solid #304369; }
html[data-theme="dark"] .avatar.xxl { border:5px solid #2a3752; }
html[data-theme="dark"] .pf-cam { border:3px solid #2a3752; }
html[data-theme="dark"] .pf-name h1 { color:#a8bee6; }
html[data-theme="dark"] .pf-role { background:#4d3e19; color:#f1db9d; }
html[data-theme="dark"] .pf-admin { background:#192c4d; color:#a1bced; }
html[data-theme="dark"] .pf-chips span { background:#192d4d; border:1px solid #324667; color:#b9c3d5; }
html[data-theme="dark"] .pf-stats b { color:#a8bee6; }
html[data-theme="dark"] .pf-stats .hl { background:linear-gradient(135deg, #19314d, #194d2f); }
html[data-theme="dark"] .pf-stats .hl b { color:#a6e8c1; }
html[data-theme="dark"] .pf-info div { background:#1c2e4a; border:1px solid #334466; }
html[data-theme="dark"] .pf-info dd { color:#b5c2d9; }
html[data-theme="dark"] .pf-edit { border-top:1px dashed #354864; }
html[data-theme="dark"] .pf-sub { color:#9dbcf1; }
html[data-theme="dark"] .pw-meter { background:#232f43; }
html[data-theme="dark"] .pf-tip { background:#192d4d; color:#b4bfd0; }
html[data-theme="dark"] .flash-x { background:rgba(255,255,255,0.08); }
html[data-theme="dark"] .flash-x:hover { background:rgba(255,255,255,0.16); }
html[data-theme="dark"] .stat-strip { background:#172134; border:1px solid #304369; }
html[data-theme="dark"] .ss { border-right:1px solid #354764; border-bottom:1px solid #354764; }
html[data-theme="dark"] .ss small::before { background:#223050; }
html[data-theme="dark"] .ss b { color:#a8bee6; }
html[data-theme="dark"] .rules-box summary { color:#9dbcf1; }
html[data-theme="dark"] .rules-box summary::before { background:#192c4d; color:#9dbcf1; }
html[data-theme="dark"] .app-tile { border:1px solid #334466; background:#1d2840; }
html[data-theme="dark"] .app-tile:hover { border-color:#2a456f; background:#192e4d; }
html[data-theme="dark"] .tbl th { background:#1c2e4a; }
html[data-theme="dark"] .tbl tbody tr:hover td { background:#1d2840; }
html[data-theme="dark"] .theme-btn { border:1px solid #2e456b; background:#192d4d; color:#aabfe4; }
html[data-theme="dark"] .card-title .count { background:#4d1919; color:#eaaaa3; }
html[data-theme="dark"] .card-title .count.zero { background:#194d2b; color:#a6e8c1; }
html[data-theme="dark"] .empty-state svg { background:#194d2e; }
html[data-theme="dark"] .note-input { border:1px solid #2a3752; }
html[data-theme="dark"] .rules-list li { background:#1c2e4a; border:1px solid #334466; }
html[data-theme="dark"] .ht-grid div { background:#1c2e4a; border:1px solid #334466; }
html[data-theme="dark"] .month-tbl .sal { background:#194d2a; color:#a6e8c1; }
html[data-theme="dark"] .month-tbl th.sal { background:#194d2e !important; color:#a6e8c1; }
html[data-theme="dark"] .sticky-first th:first-child { background:#1c2e4a; }
html[data-theme="dark"] .card { border:1px solid #304369; }
html[data-theme="dark"] .acct-row.danger { border-color:#6f2a2a; background:#4d1919; }
html[data-theme="dark"] .emp-toolbar select { background:#172134; }
html[data-theme="dark"] .emp-toolbar input[type=search] { background:#172134; }
html[data-theme="dark"] .dchip { border:1px solid #2e456b; background:#192a4d; color:#b9c3d5; }
html[data-theme="dark"] .dchip b { background:#1e2e48; color:#aabfe4; }
html[data-theme="dark"] .dchip:hover { border-color:#2b456e; }
html[data-theme="dark"] .emp-tbl .dept-row td { background:#192d4d; border-bottom:1px solid #2a466f; }
html[data-theme="dark"] .emp-tbl .dept-row:hover td { background:#192d4d !important; }
html[data-theme="dark"] .dept-name { color:#aabfe4; }
html[data-theme="dark"] .bk-box { border:1px solid #304369; }
html[data-theme="dark"] .missed-out { background:#4d3f19; color:#f1db9d; border:1px solid #6f5c2a; }
html[data-theme="dark"] .btn.fix-hot { background:#4d3f19; color:#f1db9d; border-color:#6f5c2a; }
html[data-theme="dark"] .voice-mic { background:#192c4d; color:#aabfe4; }
html[data-theme="dark"] .voice-mic:hover { background:#192c4d; }
html[data-theme="dark"] .voice-lang { border:1px solid #354864; background:#172134; color:#b9c3d5; }
html[data-theme="dark"] .voice-msg { color:#f1c19d; }
html[data-theme="dark"] .ss small { color:#b4bfd0; }
html[data-theme="dark"] .ss.salary { background:#194d29; }
@media print {
    html[data-theme="dark"] body { background:#172134; }
}
@media (max-width: 900px) {
    html[data-theme="dark"] .auth-panel { background:#192d4d; }
}
@media (min-width: 1100px) {
    html[data-theme="dark"] .home-today { border:1px solid #304369; }
}

/* ---------- hand-tuned dark rules ---------- */
html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0c1322; --card: #151f31; --ink: #e6ecf5; --muted: #95a2b8; --line: #243149;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 28px rgba(0,0,0,.35);
}
html[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
html[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #0b1426 0%, #101d36 100%); border-right: 1px solid #1c2842; }
html[data-theme="dark"] .side-nav a.on, html[data-theme="dark"] .side-foot a.on { background: #25375a; color: #fff; box-shadow: inset 3px 0 0 #5ea8ff; }
html[data-theme="dark"] .topbar { background: rgba(12,19,34,.88); border-bottom-color: #1e2a42; }
html[data-theme="dark"] .card, html[data-theme="dark"] .stat-strip,
html[data-theme="dark"] .pf-hero, html[data-theme="dark"] .home-panel { border-color: #213049; }
html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
html[data-theme="dark"] select, html[data-theme="dark"] textarea {
    background-color: #1a263b; color: var(--ink); border-color: #2c3b58;
}
html[data-theme="dark"] input::placeholder, html[data-theme="dark"] textarea::placeholder { color: #6f7d95; }
html[data-theme="dark"] input:focus, html[data-theme="dark"] select:focus, html[data-theme="dark"] textarea:focus { border-color: #5ea8ff; }
html[data-theme="dark"] .tbl th { background: #1a2539; color: #9fb0c9; border-bottom-color: #26344e; }
html[data-theme="dark"] .tbl td { border-bottom-color: #213049; }
html[data-theme="dark"] .tbl tbody tr:hover td { background: #1a2539; }
html[data-theme="dark"] .btn.ghost, html[data-theme="dark"] .btn.light { background: #22304a; color: #dbe4f3; border-color: #2e3e5c; }
html[data-theme="dark"] .btn.primary { background: #2d5aa8; }
html[data-theme="dark"] .btn.primary:hover { background: #3567bd; }
html[data-theme="dark"] .company { background: #1b2944; color: #b9cff5; }
html[data-theme="dark"] .avatar:not(.photo):not([class*=" c"]) { background: #22304a; color: #cfe0ff; }
html[data-theme="dark"] .flash-x { background: rgba(255,255,255,.1); }
html[data-theme="dark"] .pf-stats .hl b { color: #7ee2a8; }
html[data-theme="dark"] .ss b, html[data-theme="dark"] .pf-stats b, html[data-theme="dark"] .pf-name h1 { color: #eef3fb; }
html[data-theme="dark"] .avatar.xxl, html[data-theme="dark"] .pf-cam { border-color: #151f31; }
html[data-theme="dark"] .map-box { background: #1a263b repeating-linear-gradient(45deg, #1a263b 0 14px, #1e2b42 14px 28px); }
html[data-theme="dark"] .auth-panel { background: radial-gradient(600px 400px at 50% 0%, #15233d, transparent 70%), var(--bg); }
html[data-theme="dark"] .auth-box { background: #151f31; border-color: #223049; box-shadow: 0 24px 60px rgba(0,0,0,.45); }
html[data-theme="dark"] .field.ico-left input { background: #1a263b !important; border-color: #2c3b58 !important; }
html[data-theme="dark"] .field.ico-left input:focus { background: #1d2a41 !important; border-color: #5ea8ff !important; }
html[data-theme="dark"] a.link, html[data-theme="dark"] .howto a, html[data-theme="dark"] .forgot a, html[data-theme="dark"] .forgot { color: #7fb2ff; }
html[data-theme="dark"] code { background: #22304a; color: #dbe4f3; }
html[data-theme="dark"] img.avatar.photo { border-color: #151f31; }
html[data-theme="dark"] ::-webkit-scrollbar-track { background: #0f1729; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #2a3955; border-radius: 8px; }
html[data-theme="dark"] .foot { color: #6f7d95; }
html[data-theme="dark"] .theme-btn { background: #1b2944; color: #ffd166; border-color: #2a3a5a; }
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after {
    transition: background-color .35s ease, color .35s ease, border-color .35s ease, fill .35s ease !important;
}
html[data-theme="dark"] .tile { border-top-color: #213049; border-right-color: #213049; border-bottom-color: #213049; }
html[data-theme="dark"] .page-title, html[data-theme="dark"] .card-title, html[data-theme="dark"] .auth-box h1,
html[data-theme="dark"] .home-q, html[data-theme="dark"] .ht-head h3 { color: #eef3fb; }
html[data-theme="dark"] .dchip.on { background: #2d5aa8; border-color: #2d5aa8; color: #fff; }
html[data-theme="dark"] .dchip.on b { background: rgba(255,255,255,.2); color: #fff; }
html[data-theme="dark"] .ss { --c: #cbd5e1; }
html[data-theme="dark"] .ss small { color: #aab6c8; }
html[data-theme="dark"] .ss b { color: var(--c); }
html[data-theme="dark"] .ss.present { --c: #4ade80; } html[data-theme="dark"] .ss.late { --c: #fbbf24; } html[data-theme="dark"] .ss.half { --c: #fb923c; }
html[data-theme="dark"] .ss.leave { --c: #c084fc; } html[data-theme="dark"] .ss.absent { --c: #f87171; } html[data-theme="dark"] .ss.holiday { --c: #2dd4bf; }
html[data-theme="dark"] .ss.extra { --c: #34d399; } html[data-theme="dark"] .ss.lop { --c: #fca5a5; }
html[data-theme="dark"] .ss.hours, html[data-theme="dark"] .ss.ot { --c: #60a5fa; }
html[data-theme="dark"] .ss.salary { --c: #86efac; background: #12301f; } html[data-theme="dark"] .ss.working { --c: #cbd5e1; } html[data-theme="dark"] .ss.auto { --c: #facc15; }

html[data-theme="dark"] .crop-box { background: #1a263b; }
html[data-theme="dark"] .crop-zoom { color: #9fb0c9; }
html[data-theme="dark"] .crop-zoom input { accent-color: #5ea8ff; }
