/* Tema gelap seluruh website (9 Okt 2026).
 * Aktif bila <html> punya class "dsh-dark" (diatur skrip di app/lib.php:
 * pilihan tombol bulan/matahari di header, disimpan di localStorage
 * "wpz4_theme"; kunjungan pertama mengikuti pengaturan HP).
 * Halaman dengan CSS sendiri (dashboard-f.css, leaderboard-a.css,
 * peserta-d.css, badge) sudah punya aturan gelap sendiri dengan palet yang
 * sama. File ini melengkapi bagian bersama (header, kartu, form, tabel,
 * timeline, artikel, admin). Mode terang tidak terpengaruh.
 * Palet: latar #140d0e, kartu #201718, kartu dalam #2a1d1f, garis #302426,
 * teks #f4f2ee, teks redup #b3ad9f, aksen #5fd4c7. */

html.dsh-dark { color-scheme: dark; --bg:#0b1716; --ink:#eef7f5; --brand-dark:#5fd4c7; }
html.dsh-dark body { background:#0b1716; color:#eef7f5; }
/* tautan polos (tanpa kelas) dibuat mint; :where() = tidak mengalahkan aturan kelas mana pun */
:where(html.dsh-dark main a) { color:#5fd4c7; }
:where(html.dsh-dark main a:visited) { color:#5fd4c7; }
html.dsh-dark ::selection { background:#0a4f4f; color:#fff; }

/* ---- Header: tombol tema + menu dropdown HP ---- */
@media (max-width:1230px) {
  html.dsh-dark .hd-menu { background:#201718; box-shadow:0 16px 30px rgba(0,0,0,.55); border:1px solid #302426; }
  html.dsh-dark .hd-link { color:#e6e1d5; }
  html.dsh-dark .hd-link svg { color:#5fd4c7; }
  html.dsh-dark .hd-link:hover { background:#2a1d1f; color:#fff; }
  html.dsh-dark .hd-link.hd-active, html.dsh-dark .hd-link.hd-active:hover { background:#0f3d3a; color:#5fd4c7; }
  html.dsh-dark .hd-login { border-color:#443335; color:#e6e1d5; }
  html.dsh-dark .hd-icon-btn { color:#b3ad9f; }
}

/* ---- Kartu & permukaan ---- */
html.dsh-dark .card, html.dsh-dark .feed-item, html.dsh-dark .photo-slot, html.dsh-dark .tpl-card {
  background:#201718; border-color:#302426; }
html.dsh-dark .stat-box, html.dsh-dark .metrics-full .box, html.dsh-dark .lb-row,
html.dsh-dark .day-points-row td, html.dsh-dark .art-img-story, html.dsh-dark .tpl-mini { background:#2a1d1f; border-color:#302426; }
html.dsh-dark .tpl-mini-line { background:#443335; }
html.dsh-dark .tpl-card { border-color:#443335; }
html.dsh-dark .week-formula { background:#0f3d3a; border-color:#1f5f5a; color:#e9e1cf; }
html.dsh-dark .comments, html.dsh-dark .ai-coach-hr { border-color:#302426; }
html.dsh-dark .ai-coach-hr { border-top-color:#302426; }
html.dsh-dark footer.site { color:#947f82; }
html.dsh-dark code { background:#302426; color:#e9e1cf; }
html.dsh-dark img.shot { border-color:#443335; }
html.dsh-dark .feed-photo, html.dsh-dark .feed-map { background:#2a1b1d; }
html.dsh-dark .feed-photo { filter:brightness(.94); }

/* ---- Teks ---- */
html.dsh-dark .hint, html.dsh-dark .feed-item .meta, html.dsh-dark .like-names, html.dsh-dark .week-block .wk-meta,
html.dsh-dark .stat-box .l, html.dsh-dark .metrics-full .box .l, html.dsh-dark .feed-empty,
html.dsh-dark .art-meta, html.dsh-dark .art-cover figcaption, html.dsh-dark .art-img-full figcaption,
html.dsh-dark .art-img-float figcaption, html.dsh-dark .lb-row .stats, html.dsh-dark .lb-row .rk,
html.dsh-dark .ai-chat-typing, html.dsh-dark .ai-chat-ai.is-fallback { color:#b3ad9f; }
html.dsh-dark .metrics .metric, html.dsh-dark .day-points-row td, html.dsh-dark .art-excerpt,
html.dsh-dark .art-img-story figcaption { color:#d3cec4; }
html.dsh-dark .art-title { color:#f4f2ee; }
html.dsh-dark .art-body { color:#e6e3db; }
html.dsh-dark .art-kicker { color:#5fd4c7; }
html.dsh-dark .day-points-row.day-excluded td { color:#ff9a9a; }
html.dsh-dark .like-names b, html.dsh-dark .comment-list .comment b, html.dsh-dark .metrics .metric b,
html.dsh-dark .feed-item .who, html.dsh-dark .art-meta .author, html.dsh-dark .ai-coach-msg strong,
html.dsh-dark .stat-box .n, html.dsh-dark .metrics-full .box .n, html.dsh-dark .lb-row .pts,
html.dsh-dark .week-block h3, html.dsh-dark .week-formula strong { color:#5fd4c7; }

/* ---- Form ---- */
html.dsh-dark input[type=text], html.dsh-dark input[type=email], html.dsh-dark input[type=tel],
html.dsh-dark input[type=password], html.dsh-dark input[type=number], html.dsh-dark input[type=date],
html.dsh-dark input[type=search], html.dsh-dark input[type=url], html.dsh-dark select, html.dsh-dark textarea {
  background:#1a1011; color:#f4f2ee; border-color:#443335; }
html.dsh-dark input::placeholder, html.dsh-dark textarea::placeholder { color:#947f82; opacity:1; }
html.dsh-dark input:focus, html.dsh-dark select:focus, html.dsh-dark textarea:focus { outline:2px solid #14b8a6; outline-offset:0; border-color:#14b8a6; }
html.dsh-dark button:hover, html.dsh-dark .btn:hover { background:#14b8a6; }
html.dsh-dark .hd-burger:hover, html.dsh-dark .hd-theme:hover { background:rgba(255,255,255,.22); }
html.dsh-dark .feed-new-banner button { background:#0a4f4f; }
html.dsh-dark .alert.error { background:#3b1b1b; color:#ffb4b4; border-color:#5c2a2a; }
html.dsh-dark .alert.success { background:#0f3d3a; color:#5fd4c7; border-color:#1f5f5a; }

/* ---- Tabel ---- */
html.dsh-dark table.clean td, html.dsh-dark table.wk-table tr.wk-act { border-bottom-color:#302426; }
html.dsh-dark table.clean th { color:#e9e1cf; }
html.dsh-dark .table-scroll { scrollbar-color:#443335 #201718; }
html.dsh-dark .table-scroll::-webkit-scrollbar-track { background:#201718; }
html.dsh-dark .table-scroll::-webkit-scrollbar-thumb { background:#443335; }
html.dsh-dark .row-actions a, html.dsh-dark .row-actions button.linklike { color:#5fd4c7; }
html.dsh-dark .row-actions button.linklike.danger, html.dsh-dark .row-actions a.danger { color:#ff9a9a; }
@media (max-width:640px) {
  html.dsh-dark table.wk-table td.c-stat::before { color:#b3ad9f; }
  html.dsh-dark table.wk-table td.c-tgl { color:#5fd4c7; }
}

/* ---- Lencana kecil, suka, komentar, chat ---- */
html.dsh-dark .badge { background:#3a2f14; color:#f3c978; }
html.dsh-dark .badge-device { background:#0f3d3a; color:#5fd4c7; }
html.dsh-dark .badge-excluded { background:#3b1b1b; color:#ffb4b4; }
html.dsh-dark .badge-oa { background:#0f3d3a; color:#5fd4c7; }
html.dsh-dark .badge-pay { background:#302426; color:#b3ad9f; }
html.dsh-dark .like-btn { border-color:#443335; color:#b3ad9f; }
html.dsh-dark .like-btn.liked { background:#3b1b2a; border-color:#6b2f47; color:#ff8fb0; }
html.dsh-dark .comment-form .comment-error, html.dsh-dark .ai-chat-error { color:#ffb4b4; }
html.dsh-dark .ai-chat-ai { background:#2a1d1f; color:#f4f2ee; }
html.dsh-dark .ai-chat-ai.is-fallback { background:#201718; }

/* ---- Leaderboard lama (.lb-*) bila masih dipakai ---- */
html.dsh-dark .lb-row .name { color:#f4f2ee; }

/* ---- Warna inline yang umum di halaman lain (admin dsb.) ---- */
html.dsh-dark [style*="color:#9b1c1c"] { color:#ff9a9a !important; }
html.dsh-dark [style*="color:#5c0a16"] { color:#e5c06f !important; }
html.dsh-dark [style*="color:#8a6416"] { color:#f3c978 !important; }
html.dsh-dark [style*="background:#f6f1e6"] { background:#3d1218 !important; color:#f0d28f !important; }
html.dsh-dark [style*="background:#fde8e8"] { background:#3b1b1b !important; color:#ffb4b4 !important; }
html.dsh-dark [style*="background:#fef3d7"] { background:#3a2f14 !important; color:#f3c978 !important; }
html.dsh-dark [style*="background:#fff;"], html.dsh-dark [style*="background:#ffffff"] { background:#201718 !important; }
html.dsh-dark [style*="background:#f8f7f6"], html.dsh-dark [style*="background:#f2f1ee"] { background:#2a1d1f !important; }

@media (prefers-reduced-motion: no-preference) {
  html.dsh-dark body, html.dsh-dark .card { transition:background-color .2s ease, color .2s ease; }
}

/* ---- Dasbor Panitia (admin/dasbor.php) ---- */
html.dsh-dark .dp .dp-sub, html.dsh-dark .dp-tile .l, html.dsh-dark .dp-tile .n small, html.dsh-dark .dp-d.same,
html.dsh-dark .dp-ctitle small, html.dsh-dark .dp-person .who > span, html.dsh-dark .dp-hbar .v,
html.dsh-dark .dp table.dp-t th, html.dsh-dark .dp-hlab span { color:#b3ad9f; }
html.dsh-dark .dp-tile, html.dsh-dark .dp-card { background:#201718; border-color:#302426; }
html.dsh-dark .dp-tile .n, html.dsh-dark .dp-seg, html.dsh-dark .dp-card h2, html.dsh-dark .dp-ctitle { color:#f4f2ee; }
html.dsh-dark .dp-d.up { color:#5fd4c7; } html.dsh-dark .dp-d.down { color:#ff9a8a; }
html.dsh-dark .dp-stack, html.dsh-dark .dp-hbar .tr { background:#302426; }
html.dsh-dark .dp-seg { background:#201718; border-color:#443335; }
html.dsh-dark .dp-seg.on { background:#f4f2ee; color:#140d0e; border-color:#f4f2ee; }
html.dsh-dark .dp-person, html.dsh-dark .dp table.dp-t th, html.dsh-dark .dp table.dp-t td { border-color:#302426; }
html.dsh-dark .dp-btn { background:transparent; color:#5fd4c7; border-color:#2f8f8c; }
html.dsh-dark .dp-btn.fill { background:#14b8a6; color:#fff; border-color:#14b8a6; }
html.dsh-dark .dp-btn.mute { border-color:#443335; color:#b3ad9f; }
html.dsh-dark .dp-btn.warn { border-color:#ff9a8a; color:#ff9a8a; }
html.dsh-dark .dp-flash.ok { background:#0f3d3a; color:#5fd4c7; } html.dsh-dark .dp-flash.err { background:#3b1b1b; color:#ffb4b4; }
html.dsh-dark .dp-h { background:#2a1d1f; } html.dsh-dark .dp-h a, html.dsh-dark .dp details summary { color:#5fd4c7; }
html.dsh-dark .dp-hbar .tr i, html.dsh-dark .dp-hist i { background:#14b8a6; }
html.dsh-dark .dp-chart text[fill="#2b1d1f"] { fill:#f4f2ee; }
html.dsh-dark .dp-chart text[fill="#5c6b66"] { fill:#b3ad9f; }
html.dsh-dark .dp-chart line[stroke="#e0ddd7"] { stroke:#443335; }
html.dsh-dark .dp-chart line[stroke="#f2f1ee"] { stroke:#302426; }
