/* Dark theme. Applies only when <html data-theme="dark">. Tool pages keep their own look inside the content area. */
.th-sun{display:none}
html[data-theme=dark] .th-moon{display:none}
html[data-theme=dark] .th-sun{display:inline-flex}
html[data-theme=dark]{color-scheme:dark;--bg:#0d131b;--card:#151d28;--ink:#e5eaf0;--muted:#98a5b6;--line:#263243;--line2:#1d2735;--accent:#12908d;--accent-h:#0e7a77;--accent-soft:#12302f;--danger:#e0675a;--ok:#4cc26b;--warn:#e0a63c}
html[data-theme=dark] body.site{background:var(--bg);color:var(--ink)}
html[data-theme=dark] .content a:not(.btn):not(.tile):not(.contcard):not(.nx-btn),html[data-theme=dark] .modal a:not(.btn){color:var(--ac-t,#5fd6cf)}
html[data-theme=dark] .btn,html[data-theme=dark] button.btn{color:#fff}
html[data-theme=dark] a.btn,html[data-theme=dark] a.btn:hover{color:#fff}
html[data-theme=dark] a.btn.sec,html[data-theme=dark] .content a.btn.sec{color:var(--ink)}
html[data-theme=dark] .btn.sec,html[data-theme=dark] a.btn.sec{background:#1b2533;color:var(--ink);border-color:#33425a}
html[data-theme=dark] .btn.sec:hover{background:#243145;border-color:#43546f}
html[data-theme=dark] .btn.danger{color:#fff}
html[data-theme=dark] label,html[data-theme=dark] .muted{color:var(--muted)}
html[data-theme=dark] input[type=text],html[data-theme=dark] input[type=email],html[data-theme=dark] input[type=password],html[data-theme=dark] input[type=number],html[data-theme=dark] input[type=search],html[data-theme=dark] input[type=date],html[data-theme=dark] select,html[data-theme=dark] textarea{background:#0f1620;border-color:#33425a;color:var(--ink)}
html[data-theme=dark] input:hover,html[data-theme=dark] select:hover,html[data-theme=dark] textarea:hover{border-color:#4a5d7b}
html[data-theme=dark] input:disabled{background:#1a2330;color:var(--muted)}
html[data-theme=dark] ::placeholder{color:#6d7b8e}
html[data-theme=dark] input[type=date]{color-scheme:dark}
/* cards, tiles, tables, modals */
html[data-theme=dark] .card,html[data-theme=dark] .tile,html[data-theme=dark] .up-stats div,html[data-theme=dark] .contcard{background:var(--card);border-color:var(--line);box-shadow:none}
html[data-theme=dark] .tile:hover{border-color:var(--accent)}
html[data-theme=dark] .home .tile.adm .ico{background:color-mix(in srgb,var(--ac-b,#2dd4bf) 12%,#1a2433);color:var(--ac-t,#5fd6cf)}
html[data-theme=dark] table.t th{background:#111a25;color:var(--muted)}
html[data-theme=dark] table.t td,html[data-theme=dark] table.t th{border-color:var(--line2)}
html[data-theme=dark] table.utable tbody tr:hover{background:#18222f}
html[data-theme=dark] .badge{background:#222e3f;color:#c3cddb}
html[data-theme=dark] .badge.warn,html[data-theme=dark] .pill-warn{background:#3a2e12;color:#e8b64d}
html[data-theme=dark] .badge.ok{background:#14301f;color:#58cf7a}
html[data-theme=dark] .badge.bad{background:#3a1b18;color:#ee7d71}
html[data-theme=dark] .notice.ok{background:#12281a;color:#8fe0a8;border-color:#1f4a2d}
html[data-theme=dark] .notice.err{background:#2e1715;color:#f0a39b;border-color:#5a2924}
html[data-theme=dark] .notice.info{background:#14243a;color:#9cc2f0;border-color:#244266}
html[data-theme=dark] .modal-back{background:rgba(3,7,12,.66)}
html[data-theme=dark] .modal{background:var(--card);color:var(--ink);box-shadow:0 24px 60px rgba(0,0,0,.6)}
html[data-theme=dark] .mx{background:#222e3f;color:#c3cddb}html[data-theme=dark] .mx:hover{background:#2c3b52}
html[data-theme=dark] .pchip{background:#222e3f}
html[data-theme=dark] .bar{background:#222e3f}
html[data-theme=dark] .fav:hover{background:#222e3f;color:#c3cddb}
html[data-theme=dark] .ord li,html[data-theme=dark] .obtn{background:#1b2533;color:var(--ink)}
html[data-theme=dark] .obtn:hover{background:#243145}
html[data-theme=dark] .ord li.drag{background:var(--ac-soft,#12302f)}
html[data-theme=dark] .ord .oi,html[data-theme=dark] .ico-inline{color:#a9b6c7}
html[data-theme=dark] .tile .ico,html[data-theme=dark] .contcard .ci{background:var(--ac-soft,#12302f);color:var(--ac-t,#5fd6cf)}
/* inbox */
html[data-theme=dark] .ib-head,html[data-theme=dark] .ib-list,html[data-theme=dark] .cv{background:var(--card)}
html[data-theme=dark] .ib-row:hover,html[data-theme=dark] .nc-row:hover{background:#1a2431}
html[data-theme=dark] .ib-row.unread{background:#12242a}html[data-theme=dark] .ib-row.unread .ib-tx b{color:#fff}
html[data-theme=dark] .cv-back:hover{background:#222e3f}
/* top bar and popups */
html[data-theme=dark] #nx-top{background:#121a25;border-color:var(--line)}
html[data-theme=dark] .nx-title{color:var(--ink)}
html[data-theme=dark] .nx-ib{color:#a9b6c7}
html[data-theme=dark] .nx-ib:hover{background:#222e3f;color:#fff}
html[data-theme=dark] .nx-bub-n{border-color:#121a25}
html[data-theme=dark] .nx-modal,html[data-theme=dark] .nx-modal .nx-mb{background:var(--card);color:var(--ink)}
html[data-theme=dark] .nx-mh,html[data-theme=dark] .nx-mf{border-color:var(--line);background:var(--card)}
html[data-theme=dark] .nx-modal h2,html[data-theme=dark] .nx-modal b{color:var(--ink)}
html[data-theme=dark] .nx-sec,html[data-theme=dark] .nx-modal .muted,html[data-theme=dark] .nx-empty p,html[data-theme=dark] .nx-n-bd p,html[data-theme=dark] .nx-form small,html[data-theme=dark] .nx-prof .acct-mail,html[data-theme=dark] .nx-prof .acct-stats span{color:var(--muted)}
html[data-theme=dark] .nx-empty{color:var(--ink)}
html[data-theme=dark] .nx-n{border-color:var(--line)}
html[data-theme=dark] .nx-n.active{background:#12242a;border-color:#1f4a4d}
html[data-theme=dark] .nx-n.snoozed{background:#2b2512;border-color:#4d4119}
html[data-theme=dark] .nx-n-ic,html[data-theme=dark] .nx-pill{background:var(--ac-soft,#12302f);color:var(--ac-t,#5fd6cf)}
html[data-theme=dark] .nx-pill.ok{background:#14301f;color:#58cf7a}
html[data-theme=dark] .nx-btn,html[data-theme=dark] .nx-modal .btn.sec{background:#1b2533;color:var(--ink);border-color:#33425a}
html[data-theme=dark] .nx-btn:hover,html[data-theme=dark] .nx-modal .btn.sec:hover{background:#243145}
html[data-theme=dark] .nx-btn.pri{background:var(--accent);border-color:var(--accent);color:#fff}
html[data-theme=dark] .nx-x{color:#a9b6c7}html[data-theme=dark] .nx-x:hover{background:#222e3f}
html[data-theme=dark] .nx-thread{background:#0f1620}
html[data-theme=dark] .nx-msg.them .nx-bub{background:#1b2533;border-color:var(--line);color:var(--ink)}
html[data-theme=dark] .nx-send{background:var(--card);border-color:var(--line)}
html[data-theme=dark] .nx-send textarea,html[data-theme=dark] .nx-form input{background:#0f1620;border-color:#33425a;color:var(--ink)}
html[data-theme=dark] .nx-prof .acct-stats div{background:#1b2533}
html[data-theme=dark] .nx-modal .pend{border-color:var(--line)}
/* page picker */
html[data-theme=dark] .pk{background:var(--card);border-color:var(--line)}
html[data-theme=dark] .pk-bar{background:#111a25;border-color:var(--line);color:var(--muted)}
html[data-theme=dark] .pk-count,html[data-theme=dark] .pk-exp-h b{color:var(--ink)}
html[data-theme=dark] .pk-links button{color:var(--ac-t,#5fd6cf)}
html[data-theme=dark] .pk-links button:hover{background:#1c2c3a}
html[data-theme=dark] .pk-row{color:var(--ink);border-color:var(--line2)}
html[data-theme=dark] .pk-row:nth-child(odd){border-color:var(--line2)}
html[data-theme=dark] .pk-row:hover{background:#18222f}
html[data-theme=dark] .pk-row:has(input:checked){background:#122528}
html[data-theme=dark] .pk-open{color:#738196}
html[data-theme=dark] .pk-sw{background:#3a4a62}
html[data-theme=dark] .pk-row input:checked~.pk-sw,html[data-theme=dark] .pk-switch input:checked~.pk-sw{background:var(--ac,#12908d)}
html[data-theme=dark] .pk-tag{background:#14301f;color:#58cf7a}
html[data-theme=dark] .pk-ic{color:#a9b6c7}
html[data-theme=dark] .pk-st{color:var(--ac-t,#5fd6cf)}html[data-theme=dark] .pk-st.warn{color:#ee7d71}
html[data-theme=dark] .pk-pickbox{background:#0f1620;border-color:#4a5d7b}
html[data-theme=dark] .pk.sel .pk-row.picked{background:var(--ac-soft,#12302f);box-shadow:inset 0 0 0 1.5px var(--ac,#12908d)}
html[data-theme=dark] .pk-links .pk-expbtn{background:#1b2533;border-color:#33425a}
html[data-theme=dark] .pk.sel .pk-expbtn{background:var(--ac,#12908d);border-color:var(--ac,#12908d)}
html[data-theme=dark] .pk-exp{background:#111a25;border-color:var(--line)}
html[data-theme=dark] .pk-exp-h button{color:var(--ac-t,#5fd6cf)}
html[data-theme=dark] .ud{color:var(--muted)}html[data-theme=dark] .ud-lab{color:#a9b6c7}
html[data-theme=dark] .ud-in{background:#0f1620;border-color:#33425a;color:var(--ink)}
html[data-theme=dark] .ud-chips button{background:#1b2533;border-color:#33425a;color:#c3cddb}
html[data-theme=dark] .ud-chips button:hover{background:#243145}
html[data-theme=dark] .ud-chips button.on{background:var(--ac,#12908d);border-color:var(--ac,#12908d);color:#fff}
html[data-theme=dark] .ud-sum{color:var(--ac-t,#5fd6cf)}html[data-theme=dark] .ud-sum.warn{color:#ee7d71}
html[data-theme=dark] .exp{color:#e0a63c}
html[data-theme=dark] .nx-x,html[data-theme=dark] .nx-modal .nx-x{background:#222e3f;color:#c3cddb}
html[data-theme=dark] .pk-on{color:var(--ac-t,#5fd6cf)}html[data-theme=dark] .pk-off{color:var(--muted)}
html[data-theme=dark] .errp-card{box-shadow:none}
html[data-theme=dark] .errp-ic{box-shadow:0 0 0 10px rgba(18,144,141,.1)}
html[data-theme=dark] .errp-ic.lock{background:#3a2e12;color:#e8b64d;box-shadow:0 0 0 10px rgba(232,182,77,.08)}
html[data-theme=dark] .errp-page .ci{background:var(--ac-soft,#12302f);color:var(--ac-t,#5fd6cf)}
html[data-theme=dark] .errp-sent{background:#12281a;color:#8fe0a8;border-color:#1f4a2d}
html[data-theme=dark] .errp-code{background:var(--ac-soft,#12302f);color:var(--ac-t,#5fd6cf)}
html[data-theme=dark] .gchip{background:var(--ac-soft,#12302f);color:var(--ac-t,#5fd6cf)}
html[data-theme=dark] .gper{border-color:var(--card)}
html[data-theme=dark] .notice.warn{background:#2b2512;color:#e8c46a;border-color:#4d4119}
html[data-theme=dark] .seg a.on{color:#fff}
html[data-theme=dark] .bc-col i,html[data-theme=dark] .hb-t i{background:#2cb5b1}
html[data-theme=dark] .ch-tip{background:#e5eaf0;color:#0d131b}
html[data-theme=dark] .msgr,html[data-theme=dark] .mg-list{background:var(--card)}
html[data-theme=dark] .mg-pane{background:#0f1620}
html[data-theme=dark] .mg-row.on{background:var(--ac-soft,#12302f)}
html[data-theme=dark] .ib-av,html[data-theme=dark] .cv-av,html[data-theme=dark] .uav{background:#243145}

html[data-theme=dark] .pk-gr{background:#223044;color:#a9b6c8}

html[data-theme=dark] .atabs{background:#151e2b}
html[data-theme=dark] .atabs a{color:#93a1b5}
html[data-theme=dark] .atabs a:hover{color:#e6edf6}
html[data-theme=dark] .atabs a.on{background:#243247;color:var(--ac-t,#5fd6cf);box-shadow:none}
html[data-theme=dark] .content.full .atabs-wrap{border-color:var(--line2)}
html[data-theme=dark] .rq-av{background:var(--ac-soft,#12302f);color:var(--ac-t,#5eead4)}html[data-theme=dark] .rq-page{border-color:#2b3a50}html[data-theme=dark] .rq-act{border-color:#2b3a50}
html[data-theme=dark] .mt-bar{background:#3a2c0e;color:#fcd34d;border-color:#7a5a12}
html[data-theme=dark] .rq-row input[type=date],html[data-theme=dark] .utools input[type=date]{background:#1b2533;border-color:#2b3a50;color:var(--ink);color-scheme:dark}
