/* =============================================================
   MODE PAGI & MALAM — inti tema global Service Desk SISI
   ------------------------------------------------------------
   Satu berkas untuk SEMUA halaman. Dimuat paling akhir di
   setiap <head>, jadi atribut data-theme/html menentukan warna.

   Cara kerja:
     <html> dan <body> sama-sama diberi data-theme="light"|"dark".
     - Aturan di berkas ini memakai  html[data-theme="dark"] ...
       sehingga tidak perlu urutan muat.
     - Aturan lama dashboard memakai html[data-theme="dark"] ...
       tetap berlaku karena atributnya dipasang di <body> juga.

   Token warna diambil dari palet gelap dashboard yang sudah ada
   (#0b1120 / #131d33 / #18243d / #e6edf7) supaya tidak terblick
   dua gaya yang berbeda.
   ============================================================= */

/* ---------- 1. Token ---------- */
:root{
  color-scheme:light;
  /* Teks redup dinaikkan dari #627d98 ke #546e89. Nilai lama hanya
     mencapai rasio 4,28:1 di atas putih - di bawah ambang keterbacaan
     4,5:1 yang diminta WCAG AA. Yang baru 4,81:1 di latar paling
     terang yang dipakai situs. */
  --muted:#546e89;
  --theme-muted:#546e89;
  --admin-muted:#546e89;
  --sd-bg:#f4f7fb;
  --sd-panel:#ffffff;
  --sd-panel-2:#f7fafd;
  --sd-panel-3:#f8fbfe;
  --sd-panel-hover:#f8fafc;
  --sd-text:#102a43;
  --sd-text-soft:#486581;
  --sd-text-faint:#829ab1;
  --sd-line:#d9e2ec;
  --sd-line-soft:#e7eef5;
  --sd-accent:#0f4c81;
  --sd-accent-2:#145da0;
  --sd-chip:#eaf4fd;
  --sd-chip-text:#0f4c81;
  --sd-input:#ffffff;
  --sd-shadow:0 10px 28px rgba(16,42,67,.08);
  --sd-shadow-sm:0 4px 14px rgba(16,42,67,.06);
  --sd-tema-bg:#f7fbfe;
  --sd-tema-bg-2:#eef5fb;
  --sd-ok:#0a6b3d;   --sd-ok-bg:#eafaf0;   --sd-ok-line:#b7e0c6;
  --sd-bad:#b42318;  --sd-bad-bg:#fff6f6;  --sd-bad-line:#f0c2c2;
  --sd-warn:#7d5a16; --sd-warn-bg:#2a2312; --sd-warn-line:#4a3a18;
  --sd-note-bg:#12233c;
}
html[data-theme="dark"]{
  color-scheme:dark;
  /* Token milik berkas lain juga ikut dinaikkan agar teks redup di
     mode malam tidak menebal di panel yang lebih terang. */
  --muted:#8a9cb8;
  --theme-muted:#8a9cb8;
  --admin-muted:#8a9cb8;
  --sd-bg:#0b1120;
  --sd-panel:#131d33;
  --sd-panel-2:#18243d;
  --sd-panel-3:#101a2e;
  --sd-panel-hover:#1a2742;
  --sd-text:#e6edf7;
  --sd-text-soft:#9aabc4;
  --sd-text-faint:#8a9cb8;
  --sd-line:#243352;
  --sd-line-soft:#1c2841;
  --sd-accent:#7db4f5;
  --sd-accent-2:#a9cdfa;
  --sd-chip:#1b2a49;
  --sd-chip-text:#a9cdfa;
  --sd-input:#0f1729;
  --sd-shadow:0 10px 28px rgba(0,0,0,.34);
  --sd-shadow-sm:0 4px 14px rgba(0,0,0,.28);
  --sd-tema-bg:#16223c;
  --sd-tema-bg-2:#1c2b49;
  --sd-ok:#4ade80;   --sd-ok-bg:#0f2e26;   --sd-ok-line:#1f5c48;
  --sd-bad:#fca5a5; --sd-bad-bg:#33201f;  --sd-bad-line:#6b3833;
  --sd-warn:#fbbf24; --sd-warn-bg:#33291a; --sd-warn-line:#6b5320;
  --sd-note-bg:#12233c;
}

/* ---------- 2. Tombol pengalih ---------- */
.tema-btn{
  display:inline-flex;align-items:center;gap:7px;
  min-height:36px;padding:0 13px;
  border:1px solid #cbdff1;border-radius:999px;
  background:linear-gradient(180deg,#ffffff,#f2f8fd);
  color:#145da0;
  font:inherit;font-size:12.5px;font-weight:800;line-height:1;
  white-space:nowrap;cursor:pointer;text-decoration:none;
  box-shadow:0 2px 6px rgba(16,42,67,.06);
  transition:background .18s,color .18s,border-color .18s,transform .18s,box-shadow .18s;
}
.tema-btn:hover{background:#145da0;border-color:#145da0;color:#fff;transform:translateY(-1px);box-shadow:0 6px 14px rgba(15,76,129,.22)}
.tema-btn:active{transform:translateY(0)}
.tema-btn:focus-visible{outline:3px solid #8bb9df;outline-offset:2px}
.tema-btn .tema-ikon{font-size:14px;line-height:1}
html[data-theme="dark"] .tema-btn{
  background:linear-gradient(180deg,#1c2b49,#16223c);
  border-color:#31456d;color:#cfe1f8;
}
html[data-theme="dark"] .tema-btn:hover{background:#2b4270;border-color:#4a6ea8;color:#fff}
/* Varian untuk topbar dashboard/admin yang warnanya gelap. */
.dashboard-topbar .tema-btn,
.admin-topbar .tema-btn{
  background:rgba(255,255,255,.12);
  border-color:rgba(255,255,255,.32);
  color:#fff;
  box-shadow:none;
}
.dashboard-topbar .tema-btn:hover,
.admin-topbar .tema-btn:hover{background:#fff;border-color:#fff;color:#0b2d4d}
html[data-theme="dark"] .dashboard-topbar .tema-btn,
html[data-theme="dark"] .admin-topbar .tema-btn{background:rgba(255,255,255,.10);border-color:rgba(255,255,255,.30);color:#eaf2ff}
/* Saat disorot di mode malam, tombol tema JANGAN berubah putih -
   putih menyala di tengah topbar gelap terlihat seperti lubang.
   Diganti memakai aksen biru, sejalan dengan tombol lain. */
html[data-theme="dark"] .dashboard-topbar .tema-btn:hover,
html[data-theme="dark"] .admin-topbar .tema-btn:hover{background:#1d4e86;border-color:#2a63a6;color:#fff}
@media (max-width:600px){
  .tema-btn{padding:0 10px;min-height:34px}
  .tema-btn .tema-teks{display:none}
}

/* ---------- 3. Latar halaman ---------- */
html[data-theme="dark"] body{background:var(--sd-bg);color:var(--sd-text)}
html[data-theme="dark"] .home-page{background:var(--sd-bg);color:var(--sd-text)}
html[data-theme="dark"] .document-page{background:var(--sd-bg)}
html[data-theme="dark"] .login-page{
  background:radial-gradient(circle at 20% 20%,#16233c,transparent 34%),linear-gradient(135deg,#0b1120,#111c31);
}
html[data-theme="dark"] .admin-shell{background:linear-gradient(135deg,#0b1120 0%,#111c31 100%)}
html[data-theme="dark"] ::selection{background:#1e3a5f;color:#e6edf7}

/* ---------- 4. Header & navigasi ---------- */
/* Teks item navigasi tidak boleh patah menjadi 2 baris saat header
   menyempit. Sebelumnya "🔒 Login Admin" dan "System Online" terbelah
   sehingga header tampak berantakan di ujung kanan. Dengan nowrap,
   wadah yang mengatur tata letak. */
header .nav-menu > a,
header .nav-menu .dropbtn,
header .nav-menu .btn-login,
header .nav-menu .status-online,
header .nav-menu .tema-btn{white-space:nowrap}
header .nav-menu .status-online,
header .nav-menu .btn-login,
header .nav-menu .tema-btn{flex:0 0 auto}
/* Di bawah 900px header dibiarkan membungkus (wrap) sehingga item yang
   sudah nowrap turun ke baris berikutnya, bukan meluber keluar tepi
   kanan. Aturan .nav-menu{flex-wrap:wrap} bawaan baru aktif di 768px;
   celah 769-900px itulah yang sebelumnya memicu luberan. */
@media(max-width:900px){
  header{flex-wrap:wrap!important;row-gap:10px}
  header .nav-menu{flex-wrap:wrap;justify-content:center;row-gap:8px;max-width:100%}
  header .logo-area{max-width:100%}
}
html[data-theme="dark"] header{background:var(--sd-panel);border-bottom-color:var(--sd-line);box-shadow:0 2px 12px rgba(0,0,0,.4)}
html[data-theme="dark"] .logo-area{color:var(--sd-text)}
html[data-theme="dark"] .logo-icon{background:#1b2a49;color:var(--sd-accent-2)}
html[data-theme="dark"] .nav-menu a,
html[data-theme="dark"] .dropbtn{color:var(--sd-text-soft)}
html[data-theme="dark"] .nav-menu a:hover,
html[data-theme="dark"] .nav-menu a.active,
html[data-theme="dark"] .dropbtn:hover{color:var(--sd-accent-2)}
html[data-theme="dark"] .nav-menu a:hover{background:#1b2a49}
html[data-theme="dark"] .nav-menu a.active,
html[data-theme="dark"] .dropdown-content a.active{background:#1e3a5f!important;color:#fff!important}
html[data-theme="dark"] .nav-menu a.active:hover,
html[data-theme="dark"] .dropdown-content a.active:hover{background:#274b76!important;color:#fff!important}
html[data-theme="dark"] .dropdown-content{background:var(--sd-panel-2);border-color:var(--sd-line);box-shadow:0 12px 28px rgba(0,0,0,.5)}
html[data-theme="dark"] .dropdown-content a{color:var(--sd-text-soft)}
html[data-theme="dark"] .dropdown-content a:hover{background:#1b2a49;color:var(--sd-accent-2)}
html[data-theme="dark"] .dropdown.is-current > .dropbtn{background:#1b2a49;color:var(--sd-accent-2)}
html[data-theme="dark"] .dropbtn:focus-visible,
html[data-theme="dark"] .dropdown-content a:focus-visible{outline-color:var(--sd-accent);background:#1b2a49}
html[data-theme="dark"] .status-online{color:#7fe3b0;background:#0f2e26;border-color:#1f5c48}
html[data-theme="dark"] .status-dot{background:#34d399;box-shadow:0 0 0 2px rgba(52,211,153,.28)}
html[data-theme="dark"] .shift-badge{background:#1e3a5f;color:#dbeafe}
html[data-theme="dark"] footer,
html[data-theme="dark"] .dashboard-footer{background:var(--sd-panel);border-top-color:var(--sd-line);color:var(--sd-text-faint)}
html[data-theme="dark"] .agent-page .app-main > footer{background:var(--sd-panel)}

/* ---------- 5. Panel, kartu, judul ---------- */
html[data-theme="dark"] .card-section,
html[data-theme="dark"] .sheet-wrapper,
html[data-theme="dark"] .document-page .card-section,
html[data-theme="dark"] .document-page .sheet-wrapper,
html[data-theme="dark"] .agent-page .sheet-wrapper{
  background:var(--sd-panel);border-color:var(--sd-line);box-shadow:var(--sd-shadow);
}
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .document-page .section-title,
html[data-theme="dark"] .home-page .section-title,
html[data-theme="dark"] .manual-category{color:var(--sd-accent-2)!important}
html[data-theme="dark"] .document-page .manual-category{border-left-color:#0ea5a4!important}
html[data-theme="dark"] .page-description,
html[data-theme="dark"] .announcement-head p,
html[data-theme="dark"] .announcement-status,
html[data-theme="dark"] .inbound-head p,
html[data-theme="dark"] .rekap-sync-status{color:var(--sd-text-soft)}
html[data-theme="dark"] .hero-banner{background:linear-gradient(135deg,#0f2440 0%,#16375c 100%)}
html[data-theme="dark"] .hero-banner .quote{color:#b9d2ea}
html[data-theme="dark"] .hero-banner .desc{color:#d5e5f2}

/* Kotak aplikasi & tupoksi */
html[data-theme="dark"] .tupoksi-item{background:var(--sd-panel-2);border-color:var(--sd-line);color:var(--sd-text-soft)}
html[data-theme="dark"] .app-box{background:var(--sd-panel);border-color:var(--sd-line)}
html[data-theme="dark"] .app-box:hover{border-color:#3c6699;background:#16223c}
html[data-theme="dark"] .app-icon{background:#1b2a49;color:var(--sd-accent-2)}
html[data-theme="dark"] .app-name{color:var(--sd-text)}
html[data-theme="dark"] .app-url{color:var(--sd-text-faint)}

/* Kartu shift & rekap */
html[data-theme="dark"] .shift-card{background:var(--sd-panel-2);border-color:var(--sd-line)}
html[data-theme="dark"] .home-page .shift-card.active{background:#16223c;border-color:#3c6699;box-shadow:0 5px 14px rgba(0,0,0,.3)}
html[data-theme="dark"] .shift-card-title{color:var(--sd-text)}
html[data-theme="dark"] .shift-card-time{color:var(--sd-text-soft)}
html[data-theme="dark"] .shift-card-time small,
html[data-theme="dark"] .shift-card-note{color:var(--sd-text-faint)}
html[data-theme="dark"] .shift-card-note.is-active{color:var(--sd-accent-2)}
html[data-theme="dark"] .home-page .shift-card.active::before{background:var(--sd-accent-2)}
html[data-theme="dark"] .shift-badge-run{background:#1e3a5f}
html[data-theme="dark"] .home-page .rekap-item{border-bottom-color:var(--sd-line-soft);color:var(--sd-text-soft)}
html[data-theme="dark"] .home-page .rekap-item strong{color:var(--sd-accent-2)}
html[data-theme="dark"] .rekap-date{background:var(--sd-chip);color:var(--sd-chip-text)}

/* ---------- 6. Form ---------- */
html[data-theme="dark"] .form-label{color:var(--sd-text-soft)}
html[data-theme="dark"] .form-input{background:var(--sd-input);border-color:var(--sd-line);color:var(--sd-text)}
html[data-theme="dark"] .form-input:focus{border-color:var(--sd-accent-2);box-shadow:0 0 0 3px rgba(125,180,245,.18)}
html[data-theme="dark"] .login-title,
html[data-theme="dark"] .login-page .login-title{color:var(--sd-accent-2)}
html[data-theme="dark"] .login-subtitle{color:var(--sd-text-faint)}
html[data-theme="dark"] .login-card{background:var(--sd-panel);border-color:var(--sd-line);box-shadow:0 20px 60px rgba(0,0,0,.45)}
html[data-theme="dark"] .login-error{background:#33201f;border-color:#6b3833;color:#fca5a5}
html[data-theme="dark"] .login-wrapper{background:transparent}
html[data-theme="dark"] .btn-submit{background:linear-gradient(110deg,#1d4e86,#0f766e)}
html[data-theme="dark"] .btn-submit:hover{background:linear-gradient(110deg,#2a63a6,#0d9488)}

/* ---------- 7. Tabel ---------- */
html[data-theme="dark"] .nato-table,
html[data-theme="dark"] .inbound-table-wrap,
html[data-theme="dark"] .announcement-table-wrap,
html[data-theme="dark"] .admin-table-wrap,
html[data-theme="dark"] .dashboard-user-list{background:var(--sd-panel);border-color:var(--sd-line);box-shadow:var(--sd-shadow)}
html[data-theme="dark"] .nato-table td,
html[data-theme="dark"] .inbound-table td,
html[data-theme="dark"] .announcement-table td,
html[data-theme="dark"] .admin-table td{border-bottom-color:var(--sd-line-soft);color:var(--sd-text-soft)}
html[data-theme="dark"] .nato-table th,
html[data-theme="dark"] .inbound-table th,
html[data-theme="dark"] .announcement-table th,
html[data-theme="dark"] .admin-table th{background:var(--sd-panel-2);color:var(--sd-accent-2);border-bottom-color:var(--sd-line)}
html[data-theme="dark"] .nato-table th{background:#1e3a5f;color:#fff}
html[data-theme="dark"] .nato-table tr:hover td,
html[data-theme="dark"] .inbound-table tbody tr:hover td,
html[data-theme="dark"] .announcement-table tbody tr:hover td,
html[data-theme="dark"] .admin-table tr:hover td{background:#16223c}
html[data-theme="dark"] .inbound-table tbody tr:nth-child(even) td,
html[data-theme="dark"] .announcement-table tbody tr:nth-child(even) td{background:#101a2e}
html[data-theme="dark"] .inbound-table tbody tr:nth-child(even) td:hover,
html[data-theme="dark"] .announcement-table tbody tr:nth-child(even) td:hover{background:#16223c}
html[data-theme="dark"] .char-badge{background:#1b2a49;color:var(--sd-accent-2)}
html[data-theme="dark"] .inbound-table .cell-name,
html[data-theme="dark"] .announcement-table .cell-subject{color:var(--sd-text)}
html[data-theme="dark"] .inbound-table .cell-email,
html[data-theme="dark"] .inbound-table .cell-media,
html[data-theme="dark"] .inbound-table .cell-shift,
html[data-theme="dark"] .announcement-table .cell-sender{color:var(--sd-text-soft)}
html[data-theme="dark"] .inbound-table .cell-customer{color:var(--sd-text-soft)}
html[data-theme="dark"] .inbound-table .col-tgl,
html[data-theme="dark"] .inbound-table .col-no,
html[data-theme="dark"] .announcement-table .cell-date{color:var(--sd-accent-2)}
html[data-theme="dark"] .inbound-table .col-num,
html[data-theme="dark"] .inbound-break-row b{color:var(--sd-accent-2)}
html[data-theme="dark"] .inbound-table .cell-remark,
html[data-theme="dark"] .announcement-table .col-no,
html[data-theme="dark"] .inbound-foot{color:var(--sd-text-faint)}
html[data-theme="dark"] .inbound-foot a{color:var(--sd-accent-2)}
html[data-theme="dark"] .inbound-empty,
html[data-theme="dark"] .announcement-empty,
html[data-theme="dark"] .admin-table-empty{color:var(--sd-text-faint)!important}

/* ---------- 8. Tombol, chip, lencana ---------- */
html[data-theme="dark"] .inbound-btn{background:var(--sd-panel);border-color:var(--sd-line);color:var(--sd-accent-2)}
html[data-theme="dark"] .inbound-btn:hover{background:#1b2a49}
html[data-theme="dark"] .inbound-btn-primary{background:#1d4e86;border-color:#1d4e86;color:#fff}
html[data-theme="dark"] .inbound-btn-primary:hover{background:#2a63a6}
html[data-theme="dark"] .inbound-btn-danger{background:var(--sd-panel);border-color:var(--sd-bad-line);color:var(--sd-bad)}
html[data-theme="dark"] .inbound-btn-danger:hover{background:var(--sd-bad-bg)}
html[data-theme="dark"] .btn-open-pdf,
html[data-theme="dark"] .btn-external{background:linear-gradient(110deg,#1d4e86,#0f766e)!important}
html[data-theme="dark"] .btn-open-pdf:hover,
html[data-theme="dark"] .btn-external:hover{background:linear-gradient(110deg,#2a63a6,#0d9488)!important}
html[data-theme="dark"] .announcement-pdf,
html[data-theme="dark"] .ins-dl,
html[data-theme="dark"] .ins-card-link{background:#1d4e86;color:#fff}
html[data-theme="dark"] .announcement-pdf:hover,
html[data-theme="dark"] .ins-dl:hover,
html[data-theme="dark"] .ins-card-link:hover{background:#2a63a6}
html[data-theme="dark"] .ins-card-link.is-off{background:var(--sd-chip);color:var(--sd-text-faint)}
html[data-theme="dark"] .ins-dl.is-kosong,
html[data-theme="dark"] .ins-dl.is-kosong:hover{background:var(--sd-chip);color:var(--sd-text-faint)}
html[data-theme="dark"] .announcement-readonly{background:#16223c;border-color:#31456d;color:var(--sd-accent-2)}

/* Status inbound */
html[data-theme="dark"] .ib-status.draf{background:var(--sd-chip);color:var(--sd-text-soft)}
html[data-theme="dark"] .ib-status.diverifikasi{background:#16223c;color:var(--sd-accent-2)}
html[data-theme="dark"] .ib-status.selesai{background:var(--sd-ok-bg);color:var(--sd-ok)}
html[data-theme="dark"] .ib-flash{background:var(--sd-ok-bg);border-color:var(--sd-ok-line);color:var(--sd-ok)}
html[data-theme="dark"] .ib-flash.is-err{background:var(--sd-bad-bg);border-color:var(--sd-bad-line);color:var(--sd-bad)}
html[data-theme="dark"] .ib-aksi-btn{background:var(--sd-panel);border-color:var(--sd-line);color:var(--sd-accent-2)}
html[data-theme="dark"] .ib-aksi-btn:hover{background:#1b2a49;border-color:var(--sd-accent)}
html[data-theme="dark"] .ib-aksi-btn.is-danger{border-color:var(--sd-bad-line);color:var(--sd-bad)}
html[data-theme="dark"] .ib-aksi-btn.is-danger:hover{background:var(--sd-bad-bg);border-color:var(--sd-bad)}
html[data-theme="dark"] .ib-loading{border-color:var(--sd-line);border-top-color:var(--sd-accent-2)}

/* ---------- 9. Carousel & daftar (announcement / manual book) ---------- */
html[data-theme="dark"] .insight,
html[data-theme="dark"] .ins-summary-block,
html[data-theme="dark"] .ins-stat,
html[data-theme="dark"] .ins-stat-hero{background:var(--sd-panel);border-color:var(--sd-line);box-shadow:var(--sd-shadow)}
html[data-theme="dark"] .ins-stat-hero{background:linear-gradient(180deg,#18243d,#131d33)}
html[data-theme="dark"] .insight-viewport{background:var(--sd-panel-3)}
html[data-theme="dark"] .insight-kicker{color:#a9d3f5}
html[data-theme="dark"] .ins-slide-ikon,
html[data-theme="dark"] .ins-sum-ikon{background:#1b2a49;border-color:#31456d;color:var(--sd-accent-2)}
html[data-theme="dark"] .ins-slide-head h3,
html[data-theme="dark"] .ins-sum-head h3,
html[data-theme="dark"] .ins-card-title,
html[data-theme="dark"] .ins-item-title,
html[data-theme="dark"] .ins-sla-card h3,
html[data-theme="dark"] .ins-coach h3{color:var(--sd-text)}
html[data-theme="dark"] .ins-slide-head p,
html[data-theme="dark"] .ins-sum-head p,
html[data-theme="dark"] .ins-card-sender,
html[data-theme="dark"] .ins-item-meta,
html[data-theme="dark"] .ins-mini-title,
html[data-theme="dark"] .ins-list-hint,
html[data-theme="dark"] .ins-list-hint b,
html[data-theme="dark"] .ins-spack-legend,
html[data-theme="dark"] .ins-bar-lab{color:var(--sd-text-faint)}
html[data-theme="dark"] .ins-card,
html[data-theme="dark"] .ins-sla-card,
html[data-theme="dark"] .ins-coach{border-color:var(--sd-line)}
html[data-theme="dark"] .ins-card:hover{border-color:#3c6699;box-shadow:0 8px 20px rgba(0,0,0,.34)}
html[data-theme="dark"] .ins-card-no,
html[data-theme="dark"] .ins-avatar{background:#1d4e86}
html[data-theme="dark"] .ins-card-date,
html[data-theme="dark"] .ins-metric-value,
html[data-theme="dark"] .ins-stat strong,
html[data-theme="dark"] .ins-stat-hero strong,
html[data-theme="dark"] .ins-link,
html[data-theme="dark"] .ins-coach p b{color:var(--sd-accent-2)}
html[data-theme="dark"] .ins-metric-label,
html[data-theme="dark"] .ins-stat span{color:var(--sd-text-faint)}
html[data-theme="dark"] .ins-bar,
html[data-theme="dark"] .ins-jenis-bar{background:var(--sd-line-soft)}
html[data-theme="dark"] .ins-spark-wrap{border-top-color:var(--sd-line-soft)}
html[data-theme="dark"] .ins-item{border-bottom-color:var(--sd-line-soft)}
/* Kartu slide carousel (mode malam) */
html[data-theme="dark"] .ins-slide .ins-item{background:#0f1a2e;border-color:#2a3a5c}
/* Tanggal unggah di kartu carousel (mode malam): tidak boleh latar putih. */
html[data-theme="dark"] #insightCarousel .ins-item-date,
html[data-theme="dark"] #insightCarousel .ins-item-date{
  background:#1b2a49;border-color:#2a3a5c;color:var(--sd-accent-2);
}
html[data-theme="dark"] .ins-item-meta{color:var(--sd-text-faint)}
html[data-theme="dark"] .ins-date,
html[data-theme="dark"] .ins-search__chip{background:#1b2a49;color:var(--sd-accent-2)}
html[data-theme="dark"] .ins-date i{color:var(--sd-text-faint)}
html[data-theme="dark"] .ins-jenis b,
html[data-theme="dark"] .ins-sender{color:var(--sd-text-soft);border-bottom-color:var(--sd-line-soft)}
html[data-theme="dark"] .ins-sender b{color:var(--sd-accent-2)}
html[data-theme="dark"] .ins-coach p{color:var(--sd-text-soft)}
html[data-theme="dark"] .ins-coach-susah{color:#fbbf24!important}
html[data-theme="dark"] .ins-kosong,
html[data-theme="dark"] .ins-list-empty,
html[data-theme="dark"] #manualInsight .ins-kosong{color:var(--sd-text-faint)}
html[data-theme="dark"] .ins-dot{background:#31456d}
html[data-theme="dark"] .ins-dot.is-active{background:var(--sd-accent-2)}
html[data-theme="dark"] .ins-dot:focus-visible{outline-color:var(--sd-accent)}

/* Tombol carousel (panah < > dan tombol jeda/putar).
   Di mode pagi tombol ini sengaja dibuat putih tipis translusen di atas
   header berwarna. Di mode malam latarnya sudah gelap, jadi putih 12%
   terlihat sebagai tombol putih pudar yang tidak menyatu dengan tema.
   Di sini warnanya diselaraskan: latar panel gelap, teks biru muda. */
html[data-theme="dark"] .insight-arrow,
html[data-theme="dark"] .insight-play{
  background:var(--sd-chip);
  border-color:var(--sd-line);
  color:var(--sd-accent-2);
}
html[data-theme="dark"] .insight-arrow:hover,
html[data-theme="dark"] .insight-play:hover{
  background:#1b2a49;
  border-color:var(--sd-accent);
  color:var(--sd-accent-2);
}
html[data-theme="dark"] .insight-arrow:focus-visible,
html[data-theme="dark"] .insight-play:focus-visible{
  outline-color:var(--sd-accent);
}
/* Saat carousel sedang berhenti, tombol berubah jadi "putar".
   Aturan aslinya memakai selektor ber-ID (#insightCarousel,
   #manualInsight) yang lebih kuat, jadi di sini kekhususannya
   disamakan supaya tetap memakai warna tema malam. */
html[data-theme="dark"] #insightCarousel[data-playing="false"] .insight-play,
html[data-theme="dark"] #manualInsight[data-playing="false"] .insight-play,
html[data-theme="dark"] .insight-play.is-paused{
  background:var(--sd-accent-2);
  border-color:var(--sd-accent-2);
  color:#0b1120;
}
html[data-theme="dark"] .insight-progress{background:var(--sd-line-soft)}
html[data-theme="dark"] .ins-bars{border-bottom-color:var(--sd-line)}
html[data-theme="dark"] .ins-bar-val{color:var(--sd-accent-2)}

/* Gradasi tepi bawah daftar: putih di mode pagi, jadi gelap di mode malam. */
html[data-theme="dark"] .ins-list-wrap::after{background:linear-gradient(180deg,rgba(19,29,51,0),rgba(19,29,51,.96))}
html[data-theme="dark"] .ins-list-full::-webkit-scrollbar-track{background:var(--sd-panel-3)}
html[data-theme="dark"] .ins-list-full::-webkit-scrollbar-thumb{background:#31456d;border-color:var(--sd-panel-3)}
html[data-theme="dark"] .ins-list-full::-webkit-scrollbar-thumb:hover{background:#3c6699}
html[data-theme="dark"] .ins-sum-head-sep{border-top-color:var(--sd-line-soft)}
html[data-theme="dark"] ::-webkit-scrollbar-track{background:var(--sd-panel-3)}
html[data-theme="dark"] ::-webkit-scrollbar-thumb{background:#31456d;border-color:var(--sd-panel-3)}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover{background:#3c6699}

/* Pencarian & saring */
html[data-theme="dark"] .ins-search,
html[data-theme="dark"] .manual-search{background:var(--sd-panel-2);border-color:var(--sd-line);box-shadow:var(--sd-shadow-sm)}
html[data-theme="dark"] .ins-search:focus-within{border-color:var(--sd-accent);box-shadow:0 0 0 3px rgba(125,180,245,.16)}
html[data-theme="dark"] .ins-search-input,
html[data-theme="dark"] .manual-search-input{color:var(--sd-text)}
html[data-theme="dark"] .ins-search-input::placeholder,
html[data-theme="dark"] .manual-search-input::placeholder{color:var(--sd-text-faint)}
html[data-theme="dark"] .ins-search-clear,
html[data-theme="dark"] .manual-search-clear{background:var(--sd-chip);color:var(--sd-text-soft)}
html[data-theme="dark"] .ins-search-clear:hover{background:var(--sd-accent-2);color:#0b1120}
html[data-theme="dark"] .ins-chip{border-color:var(--sd-line);background:var(--sd-panel);color:var(--sd-text-soft)}
html[data-theme="dark"] .ins-chip b{color:var(--sd-accent-2)}
html[data-theme="dark"] .ins-chip:hover{border-color:#3c6699;background:#16223c}
html[data-theme="dark"] .ins-chip.is-active{background:#1d4e86;border-color:#1d4e86;color:#fff}
html[data-theme="dark"] .ins-chip.is-active b{color:#a9d3f5}
html[data-theme="dark"] .ins-kind.ann{background:#16223c;color:var(--sd-accent-2)}
html[data-theme="dark"] .ins-kind.upd{background:var(--sd-warn-bg);color:var(--sd-warn)}
html[data-theme="dark"] .ins-kind.rem{background:var(--sd-bad-bg);color:var(--sd-bad)}
html[data-theme="dark"] .ins-kind.inf{background:var(--sd-chip);color:var(--sd-text-soft)}

/* ---------- 10. Manual Book ---------- */
html[data-theme="dark"] .manual-search-input{background:var(--sd-input);border-color:var(--sd-line)}
html[data-theme="dark"] .manual-search-input:focus{border-color:var(--sd-accent);box-shadow:0 0 0 4px rgba(125,180,245,.15)}
html[data-theme="dark"] .manual-search-result,
html[data-theme="dark"] #manualSearchResult,
html[data-theme="dark"] .manual-no-result-text b,
html[data-theme="dark"] .manual-count,
html[data-theme="dark"] .manual-wrapper .announcement-readonly b{color:var(--sd-accent-2)}
html[data-theme="dark"] .manual-search-hint,
html[data-theme="dark"] .manual-no-result-text,
html[data-theme="dark"] .manual-footnote,
html[data-theme="dark"] .manual-footnote b{color:var(--sd-text-faint)}
html[data-theme="dark"] .manual-search-hint kbd,
html[data-theme="dark"] .ins-list-hint kbd{background:var(--sd-panel);border-color:var(--sd-line);color:var(--sd-text-soft)}
html[data-theme="dark"] .manual-count{background:var(--sd-chip)}
html[data-theme="dark"] .manual-no-result{background:var(--sd-panel-3);border-color:var(--sd-line)}
html[data-theme="dark"] .manual-no-result-btn{background:linear-gradient(110deg,#1d4e86,#0f766e)}
html[data-theme="dark"] .manual-mark{background:#4a3a18;color:#fde68a}
html[data-theme="dark"] .manual-match{background:var(--sd-panel-2);border-color:var(--sd-line);color:var(--sd-text-soft)}
html[data-theme="dark"] .manual-category-nama{color:var(--sd-accent-2)}
html[data-theme="dark"] .document-page .manual-wrapper .manual-card{border-bottom-color:var(--sd-line-soft)}
html[data-theme="dark"] .document-page .manual-wrapper .manual-card:hover{background:#16223c}
html[data-theme="dark"] .document-page .manual-wrapper .manual-card .ins-item-title{color:var(--sd-text)}
html[data-theme="dark"] .document-page .manual-wrapper .manual-card .ins-item-meta{color:var(--sd-text-faint)}
html[data-theme="dark"] .document-page .manual-wrapper .manual-card .ins-kind{background:var(--sd-chip);color:var(--sd-text-soft)}
html[data-theme="dark"] .document-page .manual-wrapper .manual-date-chip{background:#1b2a49;color:var(--sd-accent-2)}
html[data-theme="dark"] .document-page .manual-wrapper .manual-dl{background:#1d4e86;color:#fff}
html[data-theme="dark"] .document-page .manual-wrapper .manual-dl:hover{background:#2a63a6;color:#fff}
html[data-theme="dark"] .document-page .manual-wrapper .manual-dl:focus-visible{outline-color:var(--sd-accent)}

/* ---------- 11. Halaman utama: kartu rekap & trend ---------- */
html[data-theme="dark"] .rekap-total,
html[data-theme="dark"] .trend-panel,
html[data-theme="dark"] .rekap-filter-panel{
  background:linear-gradient(180deg,#18243d 0%,#131d33 100%);
  border-color:var(--sd-line);box-shadow:var(--sd-shadow);
}
html[data-theme="dark"] .rekap-total-overdue{background:linear-gradient(180deg,#1f1a24 0%,#161320 100%);border-color:var(--sd-bad-line)}
html[data-theme="dark"] .rekap-total-task,
html[data-theme="dark"] .trend-panel-task{background:linear-gradient(180deg,#14252b 0%,#101d24 100%);border-color:#1f4a4e}
html[data-theme="dark"] .rekap-total-label{color:var(--sd-text)}
html[data-theme="dark"] .rekap-total-value{color:var(--sd-accent-2)}
html[data-theme="dark"] .rekap-total-overdue .rekap-total-value{color:#fca5a5}
html[data-theme="dark"] .rekap-total-task .rekap-total-value{color:#5eead4}
html[data-theme="dark"] .rekap-total.is-error .rekap-total-value{color:var(--sd-text-faint)}
html[data-theme="dark"] .rekap-total-note,
html[data-theme="dark"] .rekap-total-note b{color:var(--sd-text-faint)}
html[data-theme="dark"] .rekap-total.is-error .rekap-total-value{font-size:34px}
html[data-theme="dark"] .rekap-total-icon{background:#1b2a49}
html[data-theme="dark"] .rekap-total-overdue .rekap-total-icon{background:var(--sd-bad-bg)}
html[data-theme="dark"] .rekap-total-task .rekap-total-icon{background:#0f2e33}
html[data-theme="dark"] .rekap-total-inbound .rekap-total-value{color:#5eead4}
html[data-theme="dark"] .rekap-total-inbound .rekap-total-icon{background:#0f2e33;color:#5eead4}

html[data-theme="dark"] .rekap-filter-head{border-bottom-color:var(--sd-line-soft)}
html[data-theme="dark"] .rekap-filter-title{color:var(--sd-accent-2)}
html[data-theme="dark"] .rekap-filter-row > .rekap-field > label,
html[data-theme="dark"] .rekap-date-range label{color:var(--sd-text-soft)}
html[data-theme="dark"] .rekap-date-range{background:var(--sd-panel-3);border-color:var(--sd-line)}
html[data-theme="dark"] .rekap-date-input{background:var(--sd-input);border-color:var(--sd-line);color:var(--sd-text)}
html[data-theme="dark"] .rekap-date-input:hover{border-color:#3c6699}
html[data-theme="dark"] .rekap-period{background:#1d4e86;border-color:#1a4577}
html[data-theme="dark"] .rekap-period:hover{background:#2a63a6}
html[data-theme="dark"] .rekap-export-btn{background:var(--sd-panel);color:var(--sd-accent-2);border-color:var(--sd-accent)}
html[data-theme="dark"] .rekap-export-btn:hover{background:#1b2a49}
html[data-theme="dark"] .rekap-apply-btn{background:#1d4e86;border-color:#1a4577}
html[data-theme="dark"] .rekap-apply-btn:hover{background:#2a63a6}
html[data-theme="dark"] .rekap-total-note.is-period{color:var(--sd-text-soft)}

html[data-theme="dark"] .trend-title{color:var(--sd-text)}
html[data-theme="dark"] .trend-sub,
html[data-theme="dark"] .trend-legend{color:var(--sd-text-soft)}
html[data-theme="dark"] .trend-yaxis,
html[data-theme="dark"] .trend-x,
html[data-theme="dark"] .trend-foot,
html[data-theme="dark"] .trend-empty{color:var(--sd-text-faint)}
html[data-theme="dark"] .trend-lines i{background:var(--sd-line-soft)}
html[data-theme="dark"] .trend-avg{border-top-color:var(--sd-line)}
html[data-theme="dark"] .trend-avg span{background:var(--sd-panel-2);color:var(--sd-text-soft)}
html[data-theme="dark"] .trend-col::before{background:var(--sd-line)}
html[data-theme="dark"] .trend-dot{border-color:var(--sd-panel-2)}
html[data-theme="dark"] .trend-legend-dot{border-color:var(--sd-panel-2)}
html[data-theme="dark"] .trend-legend-val{background:var(--sd-panel-2);color:var(--sd-text)}
html[data-theme="dark"] .trend-val{color:#7fb3e8}
html[data-theme="dark"] .trend-dot.is-zero{background:#44587a}
html[data-theme="dark"] .trend-chart.is-error .trend-empty{color:var(--sd-bad)}

/* ---------- 12. Halaman inbound ---------- */
html[data-theme="dark"] .inbound-filter,
html[data-theme="dark"] .inbound-form,
html[data-theme="dark"] .agent-page .inbound-form{background:var(--sd-panel-3);border-color:var(--sd-line)}
html[data-theme="dark"] .inbound-field label,
html[data-theme="dark"] .inbound-status,
html[data-theme="dark"] .inbound-status-inline,
html[data-theme="dark"] .agent-page .inbound-field label{color:var(--sd-text-soft)}
html[data-theme="dark"] .inbound-field input,
html[data-theme="dark"] .inbound-field select,
html[data-theme="dark"] .inbound-field textarea,
html[data-theme="dark"] .agent-page .inbound-field input,
html[data-theme="dark"] .agent-page .inbound-field select,
html[data-theme="dark"] .agent-page .inbound-field textarea{
  background:var(--sd-input);border-color:var(--sd-line);color:var(--sd-text);
}
html[data-theme="dark"] .agent-page .inbound-field select{
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aabc4' d='M1.4 1.4 6 6l4.6-4.6'/%3E%3C/svg%3E");
}
html[data-theme="dark"] .inbound-field input:hover,
html[data-theme="dark"] .agent-page .inbound-field input:hover,
html[data-theme="dark"] .agent-page .inbound-field select:hover{border-color:#3c6699}
html[data-theme="dark"] .inbound-field input::placeholder,
html[data-theme="dark"] .agent-page .inbound-field input::placeholder{color:var(--sd-text-faint)}
html[data-theme="dark"] .agent-page .inbound-form-foot{border-top-color:var(--sd-line)}
html[data-theme="dark"] .ib-ts{background:linear-gradient(180deg,#16223c,#101a2e);border-color:var(--sd-line);color:var(--sd-text)}
html[data-theme="dark"] .ib-ts.is-kunci{background:linear-gradient(180deg,#101a2e,#0d1526);color:var(--sd-text-soft)}
html[data-theme="dark"] .ib-ts-note{color:var(--sd-text-faint)}

html[data-theme="dark"] .inbound-card,
html[data-theme="dark"] .inbound-break{background:var(--sd-panel);border-color:var(--sd-line)}
html[data-theme="dark"] .inbound-card strong{color:var(--sd-accent-2)}
html[data-theme="dark"] .inbound-card-label,
html[data-theme="dark"] .inbound-card-note,
html[data-theme="dark"] .inbound-break-empty{color:var(--sd-text-faint)}
html[data-theme="dark"] .inbound-break-title{color:var(--sd-text-soft)}
html[data-theme="dark"] .inbound-break-label{color:var(--sd-text-soft)}
html[data-theme="dark"] .inbound-break-bar{background:var(--sd-line-soft)}
html[data-theme="dark"] .inbound-status-inline.is-ok{color:var(--sd-ok)}
html[data-theme="dark"] .inbound-status-inline.is-err{color:var(--sd-bad)}
html[data-theme="dark"] .ib-denied{background:var(--sd-bad-bg);border-color:var(--sd-bad-line)}
html[data-theme="dark"] .ib-denied h2{color:var(--sd-bad)}
html[data-theme="dark"] .ib-denied p{color:#f0b4b0}

/* ---------- 13. Admin & akun ---------- */
html[data-theme="dark"] .dashboard-topbar-link{border-color:var(--sd-line);background:var(--sd-panel-2);color:var(--sd-accent-2)}
html[data-theme="dark"] .dashboard-topbar-link:hover{background:#2a63a6;border-color:#2a63a6;color:#fff}
html[data-theme="dark"] .dashboard-user{background:linear-gradient(180deg,#18243d,#131d33);border-color:var(--sd-line);color:var(--sd-text);box-shadow:none}
html[data-theme="dark"] .dashboard-user:hover{border-color:#3c6699;box-shadow:0 5px 14px rgba(0,0,0,.3)}
html[data-theme="dark"] .dashboard-user-name{color:var(--sd-text)}
html[data-theme="dark"] .dashboard-user-role{background:#0f766e}
html[data-theme="dark"] .dashboard-account-sep{background:linear-gradient(180deg,var(--sd-line),#1a2640)}
html[data-theme="dark"] .dashboard-logout{background:#13233c!important;border-color:var(--sd-line)!important;color:var(--sd-accent-2)}
html[data-theme="dark"] .dashboard-logout:hover{background:#2a63a6!important;border-color:#2a63a6!important;color:#fff!important}
html[data-theme="dark"] .dashboard-user-form,
html[data-theme="dark"] .dashboard-user-management{background:var(--sd-panel);border-color:var(--sd-line)}
html[data-theme="dark"] .dashboard-user-management .dashboard-section-head{border-bottom-color:var(--sd-line-soft)}
html[data-theme="dark"] .dashboard-input,
html[data-theme="dark"] .dashboard-select{background:var(--sd-input);border-color:var(--sd-line);color:var(--sd-text)}
html[data-theme="dark"] .dashboard-field label{color:var(--sd-text-soft)}
html[data-theme="dark"] .dashboard-form-message.is-error{background:var(--sd-bad-bg);border-color:var(--sd-bad-line);color:var(--sd-bad)}
html[data-theme="dark"] .dashboard-form-message.is-success{background:var(--sd-ok-bg);border-color:var(--sd-ok-line);color:var(--sd-ok)}
html[data-theme="dark"] .admin-error{background:var(--sd-bad-bg);border-color:var(--sd-bad-line);color:var(--sd-bad)}

/* ---------- 14. Kotak catatan ---------- */
html[data-theme="dark"] .db-warn{background:var(--sd-warn-bg);border-color:var(--sd-warn-line);color:var(--sd-warn);box-shadow:none}
html[data-theme="dark"] .db-warn p{color:var(--sd-warn)}
html[data-theme="dark"] .sheet-notice{background:var(--sd-note-bg);border-color:var(--sd-line);color:var(--sd-text-soft)}
html[data-theme="dark"] .sheet-notice strong,
html[data-theme="dark"] .sheet-notice em{color:var(--sd-accent-2)}
html[data-theme="dark"] .btn-action-row,
html[data-theme="dark"] .document-page .btn-action-row{border-bottom-color:var(--sd-line)}
html[data-theme="dark"] .iframe-container{background:var(--sd-panel);border-color:var(--sd-line)}

/* =============================================================
   16. Keterbacaan teks redup
   ------------------------------------------------------------
   Banyak berkas lama menuliskan warna redup (#627d98) secara langsung,
   jadi tidak ikut berubah ketika token --muted dinaikkan. Aturan di
   bawah menimpa daftar warna itu pada kedua mode.

   Semua angka rasio dihitung dengan rumus WCAG 2.1 dan sudah diuji
   ulang lewat audit kontras di peramban.
   ============================================================= */

/* --- Mode pagi: teks redup #627d98 -> #546e89 (4,81:1) --- */
html:not([data-theme="dark"]) footer,
html:not([data-theme="dark"]) .dashboard-footer,
html:not([data-theme="dark"]) .announcement-head p,
html:not([data-theme="dark"]) .announcement-status,
html:not([data-theme="dark"]) .inbound-head p,
html:not([data-theme="dark"]) .inbound-field label,
html:not([data-theme="dark"]) .inbound-status,
html:not([data-theme="dark"]) .inbound-status-inline,
html:not([data-theme="dark"]) .inbound-break-title,
html:not([data-theme="dark"]) .inbound-table .cell-remark,
html:not([data-theme="dark"]) .ib-modal-head p,
html:not([data-theme="dark"]) .ib-modal-ts small,
html:not([data-theme="dark"]) .ib-modal-msg,
html:not([data-theme="dark"]) .ins-mini-title,
html:not([data-theme="dark"]) .ins-date i,
html:not([data-theme="dark"]) .ins-sum-head p,
html:not([data-theme="dark"]) .ins-slide-head p,
html:not([data-theme="dark"]) .ins-item-meta,
html:not([data-theme="dark"]) .ins-list-hint,
html:not([data-theme="dark"]) .ins-stat span,
html:not([data-theme="dark"]) .ins-metric-label,
html:not([data-theme="dark"]) .document-page .page-description,
html:not([data-theme="dark"]) .document-page .card-section>p,
html:not([data-theme="dark"]) .document-page .sheet-wrapper p,
html:not([data-theme="dark"]) .rekap-sync-status,
html:not([data-theme="dark"]) .rekap-loading,
html:not([data-theme="dark"]) .rekap-tab span,
html:not([data-theme="dark"]) .home-rekap-panel .dashboard-section-head p,
html:not([data-theme="dark"]) .home-page .app-url,
html:not([data-theme="dark"]) .rekap-total-note.is-period,
html:not([data-theme="dark"]) .trend-sub,
html:not([data-theme="dark"]) .trend-legend,
html:not([data-theme="dark"]) .manual-search-hint,
html:not([data-theme="dark"]) .manual-footnote,
html:not([data-theme="dark"]) .manual-no-result-text,
html:not([data-theme="dark"]) .sheet-notice,
html:not([data-theme="dark"]) .personil-shift-time,
html:not([data-theme="dark"]) .dashboard-last-updated,
html:not([data-theme="dark"]) .dashboard-field label,
html:not([data-theme="dark"]) .dashboard-label,
html:not([data-theme="dark"]) .dashboard-hero p,
html:not([data-theme="dark"]) .dashboard-section-head p,
html:not([data-theme="dark"]) .dashboard-status,
html:not([data-theme="dark"]) .dashboard-access-label,
html:not([data-theme="dark"]) .dashboard-history-label,
html:not([data-theme="dark"]) .dashboard-empty,
html:not([data-theme="dark"]) .dashboard-nav a,
html:not([data-theme="dark"]) .admin-hero p,
html:not([data-theme="dark"]) .admin-section p,
html:not([data-theme="dark"]) .admin-stat-label,
html:not([data-theme="dark"]) .admin-status,
html:not([data-theme="dark"]) .trend-x,
html:not([data-theme="dark"]) .trend-foot{
  color:#546e89;
}

/* Lencana "System Online": hijau #059669 (3,58:1) -> #036b4c (6,21:1) */
html:not([data-theme="dark"]) .status-online{color:#036b4c}

/* Lencana shift: putih di atas warna latar lencana.
   Merah 3,82:1 -> 4,59 · biru 3,15:1 -> 4,55 · abu 2,56:1 -> 4,61 */
html:not([data-theme="dark"]) .personil-name-badge.shift-1{background:#d73c2c}
html:not([data-theme="dark"]) .personil-name-badge.shift-3{background:#177bbe}
html:not([data-theme="dark"]) .personil-name-badge.libur{background:#687879}

/* --- Mode malam: teks yang masih menulis #627d98 langsung --- */
html[data-theme="dark"] .announcement-head p,
html[data-theme="dark"] .announcement-status,
html[data-theme="dark"] .inbound-head p,
html[data-theme="dark"] .inbound-field label,
html[data-theme="dark"] .inbound-status,
html[data-theme="dark"] .inbound-status-inline,
html[data-theme="dark"] .inbound-break-title,
html[data-theme="dark"] .inbound-table .cell-remark,
html[data-theme="dark"] .ib-modal-head p,
html[data-theme="dark"] .ib-modal-ts small,
html[data-theme="dark"] .ib-modal-msg,
html[data-theme="dark"] .ins-mini-title,
html[data-theme="dark"] .ins-date i,
html[data-theme="dark"] .ins-sum-head p,
html[data-theme="dark"] .ins-slide-head p,
html[data-theme="dark"] .ins-item-meta,
html[data-theme="dark"] .ins-list-hint,
html[data-theme="dark"] .ins-stat span,
html[data-theme="dark"] .ins-metric-label,
html[data-theme="dark"] .document-page .page-description,
html[data-theme="dark"] .document-page .card-section>p,
html[data-theme="dark"] .document-page .sheet-wrapper p,
html[data-theme="dark"] .rekap-sync-status,
html[data-theme="dark"] .rekap-loading,
html[data-theme="dark"] .rekap-tab span,
html[data-theme="dark"] .home-rekap-panel .dashboard-section-head p,
html[data-theme="dark"] .home-page .app-url,
html[data-theme="dark"] .rekap-total-note.is-period,
html[data-theme="dark"] .trend-sub,
html[data-theme="dark"] .trend-legend,
html[data-theme="dark"] .trend-x,
html[data-theme="dark"] .trend-foot,
html[data-theme="dark"] .manual-search-hint,
html[data-theme="dark"] .manual-footnote,
html[data-theme="dark"] .manual-no-result-text,
html[data-theme="dark"] .sheet-notice,
html[data-theme="dark"] .personil-shift-time,
html[data-theme="dark"] .dashboard-last-updated,
html[data-theme="dark"] .dashboard-field label,
html[data-theme="dark"] .dashboard-label,
html[data-theme="dark"] .dashboard-hero p,
html[data-theme="dark"] .dashboard-section-head p,
html[data-theme="dark"] .dashboard-status,
html[data-theme="dark"] .dashboard-access-label,
html[data-theme="dark"] .dashboard-history-label,
html[data-theme="dark"] .dashboard-empty,
html[data-theme="dark"] .dashboard-nav a,
html[data-theme="dark"] .admin-hero p,
html[data-theme="dark"] .admin-section p,
html[data-theme="dark"] .admin-stat-label,
html[data-theme="dark"] .admin-status{
  color:var(--sd-text-faint);
}

/* Lencana shift di mode malam memakai warna yang lebih gelap supaya
   teks putihnya tetap terbaca di atas panel gelap. */
html[data-theme="dark"] .personil-name-badge{background:#1d4e86}
html[data-theme="dark"] .personil-name-badge.shift-1{background:#8f2a20}
html[data-theme="dark"] .personil-name-badge.shift-2{background:#8a6d12;color:#1a1206}
html[data-theme="dark"] .personil-name-badge.shift-3{background:#14507f}
html[data-theme="dark"] .personil-name-badge.double-shift{background:#4d2c66}
html[data-theme="dark"] .personil-name-badge.libur{background:#3d4a4a}
html[data-theme="dark"] .personil-name-badge .kode-shift{background:rgba(255,255,255,.18)}

/* Panel rekap di halaman utama: section ini punya aturan sendiri di
   responsive.css dan TIDAK memakai kelas .card-section, jadi perlu
   ditulis terpisah - tanpa ini panelnya tetap putih di mode malam. */
html[data-theme="dark"] .home-rekap-panel{background:var(--sd-panel);border-color:var(--sd-line);box-shadow:var(--sd-shadow)}
html[data-theme="dark"] .home-rekap-panel .dashboard-section-head h2{color:var(--sd-text)}

/* Teks meta di baris dokumen Manual Book memakai aturan manual-docs.css
   yang spesifisitasnya lebih tinggi, jadi ikut ditimpa di sini. */
html:not([data-theme="dark"]) .document-page .manual-wrapper .manual-card .ins-item-meta{color:#546e89}
html[data-theme="dark"] .document-page .manual-wrapper .manual-card .ins-item-meta{color:var(--sd-text-faint)}

/* --- Panel personil: gayanya ditulis inline di index.html (di dalam
   <body>), jadi tidak bisa di(tokenisasi). Perlu ditimpa satu per satu
   supaya tidak tetap putih di mode malam. --- */
html[data-theme="dark"] .shift-personil-list{background:var(--sd-panel);border:1px solid var(--sd-line)}
html[data-theme="dark"] .personil-shift-group{background:var(--sd-panel-2);border-color:var(--sd-line)}
html[data-theme="dark"] .personil-shift-header{border-bottom-color:var(--sd-line)}
html[data-theme="dark"] .personil-shift-title{color:var(--sd-accent-2)}
html[data-theme="dark"] .personil-loading,
html[data-theme="dark"] .personil-kosong{color:var(--sd-text-faint)}
html:not([data-theme="dark"]) .personil-loading{color:#546e89}
html:not([data-theme="dark"]) .personil-kosong{color:#5c6f80}

/* =============================================================
   17. Mode malam untuk dashboard
   ------------------------------------------------------------
   Mode gelap dashboard sudah ada sebelumnya, tapi beberapa warna
   masih memakai nilai mode pagi sehingga teksnya nyaris tak
   terlihat (contoh: 110 tautan "Unduh" hanya mencapai 1,89:1).
   Bagian ini menyelaraskannya dengan palet panel yang gelap.
   ============================================================= */
/* Teks mode malam dibuat PUTIH. Beberapa halaman dashboard memakai
   `.dashboard-page{--ink:var(--theme-ink)}` sehingga menimpa --ink milik
   <html>; karena itu --theme-* juga harus ikut diterangkan di mode gelap.
   Tanpa ini, judul seperti "📊 Kinerja Service Desk (Summary)" tetap
   biru-gelap di atas latar gelap dan nyaris tak terbaca. */
html[data-theme="dark"]{
  --ink:#ffffff;
  --sd-text:#ffffff;
  --theme-ink:#ffffff;
  --theme-muted:#9aabc4;
  --theme-line:#243352;
  --theme-bg:#0b1120;
}

/* Teks yang masih di-hardcode gelap oleh beberapa komponen: dibuat
   terang/putih di mode malam agar terbaca di atas panel gelap.
   Aturan di theme-core.css (dimuat paling akhir) menang atas
   dashboard.css/style.css maupun CSS khusus tiap bagian. */
html[data-theme="dark"] .maint-overlay{background:linear-gradient(135deg,#0b1120,#111c31)}
html[data-theme="dark"] .maint-box h2{color:#ffffff}
html[data-theme="dark"] .maint-box p{color:#9aabc4}
html[data-theme="dark"] .wa-qr-note{color:#9aabc4}
html[data-theme="dark"] .sc-title{color:#ffffff}
html[data-theme="dark"] .sc-field>span{color:#cfe1f8}
html[data-theme="dark"] .sc-sheet{background:#16223c;color:#a9cdfa}
html[data-theme="dark"] .mgg-detail>summary{color:#ffffff}
/* Modal Service Catalog (dipakai juga di dashboard, yang tidak memuat
   service-catalog.css) — dibuat gelap agar teks putih tidak di atas putih. */
html[data-theme="dark"] .sc-modal{background:rgba(2,8,23,.66)}
html[data-theme="dark"] .sc-modal-box{background:#131d33;border:1px solid #243a5e;color:#ffffff}
html[data-theme="dark"] .sc-modal-head,
html[data-theme="dark"] .sc-modal-foot{border-color:#243a5e}
html[data-theme="dark"] .sc-modal-foot{background:#101a2e}
html[data-theme="dark"] .sc-modal-head p{color:#9fb3c8}
html[data-theme="dark"] .sc-edit-field>span{color:#9fb3c8}
html[data-theme="dark"] .sc-edit-field input,
html[data-theme="dark"] .sc-edit-field textarea{background:#101a2e;border-color:#31456d;color:#e6edf7}

/* Aksen biru #3b82f6 hanya mencapai 3,87:1 di atas panel gelap,
   jadi dinaikkan ke #5b9df8 (5,17:1). */
html[data-theme="dark"] .dashboard-card a:not([class*="btn"]):not([class*="button"]),
html[data-theme="dark"] .content a:not([class*="btn"]):not([class*="button"]),
html[data-theme="dark"] .stat-ico.c-accent,
html[data-theme="dark"] .jad-sel.is-s1,
html[data-theme="dark"] .kolom-count,
html[data-theme="dark"] a.sb-item.is-active,
html[data-theme="dark"] .dashboard-small-button.secondary,
html[data-theme="dark"] .dashboard-link{
  color:#5b9df8;
}
/* Teal #0e7490 hanya 2,75:1 di atas #0d2c34 -> #22b8cf (6,18:1) */
html[data-theme="dark"] .jad-sel.is-dispen{color:#22b8cf}
/* Kartu logo SISI tetap putih agar mark tetap terbaca di mode gelap. */
html[data-theme="dark"] .sb-brand-icon{background:#fff}
/* Teks kecil */
html[data-theme="dark"] .backup-stat-label,
html[data-theme="dark"] .backup-foot span,
html[data-theme="dark"] .sb-foot-meta small,
html[data-theme="dark"] .sb-foot-meta,
html[data-theme="dark"] .dashboard-card small{color:#8a9cb8}
/* Lencana berlatar terang ikut gelap */
html[data-theme="dark"] .peng-sumber.is-sheets{background:#1b2a49;color:#9aabc4;border-color:#31456d}
html[data-theme="dark"] .peng-sumber.is-dashboard{background:#0f2e26;color:#6ee7b7;border-color:#1f5c48}
html[data-theme="dark"] .ins-kind.ann{background:#16223c;color:#7db4f5}
/* Lencana jenis berkas di kartu Manual Book.
   Aturan asli `manual-docs.css` memakai tiga kelas
   (".document-page .manual-wrapper .manual-card .ins-kind") sehingga
   MENGALAHKAN `html[data-theme="dark"] .ins-kind.inf` yang hanya satu
   kelas. Akibatnya lencana "PDF"/"EXCEL" tetap biru muda terang di
   tengah panel gelap. Aturan di bawah menyamakan kekhususannya. */
html[data-theme="dark"] .document-page .manual-wrapper .manual-card .ins-kind,
html[data-theme="dark"] .document-page .manual-wrapper .manual-card .ins-kind.inf,
html[data-theme="dark"] .document-page .manual-wrapper .manual-card .ins-kind.ann,
html[data-theme="dark"] .document-page .manual-wrapper .manual-card .ins-kind.upd,
html[data-theme="dark"] .document-page .manual-wrapper .manual-card .ins-kind.rem{
  background:var(--sd-chip);
  color:var(--sd-accent-2);
}

/* Lencana jenis pengumuman (Announcement / Update / Reminder / Info).
   Kelasnya `.peng-jenis` dengan warna latar pastel terang, dan modul
   tema sebelumnya BELUM punya aturan untuknya - inilah yang membuat
   lencana "PDF"/"2 Jam Lalu" tampak biru muda terang di panel gelap. */
html[data-theme="dark"] .peng-jenis.ann{background:#16223c;color:var(--sd-accent-2);border-color:#31456d}
html[data-theme="dark"] .peng-jenis.upd{background:var(--sd-warn-bg);color:var(--sd-warn);border-color:var(--sd-warn-line)}
html[data-theme="dark"] .peng-jenis.rem{background:var(--sd-bad-bg);color:var(--sd-bad);border-color:var(--sd-bad-line)}
html[data-theme="dark"] .peng-jenis.inf{background:var(--sd-chip);color:var(--sd-text-soft);border-color:var(--sd-line)}

/* Lencana format berkas di tabel Manual Book dashboard. */
html[data-theme="dark"] .mb-format{background:var(--sd-chip);color:var(--sd-accent-2);border-color:var(--sd-line)}

/* ---------- Wadah yang tertinggal terang di mode malam ----------
   Aturan gelap bawaan dashboard hanya mengubah border pada beberapa
   komponen ini, jadi latar putihnya masih terlihat. */
html[data-theme="dark"] .doc-cat{background:#1b2a49;border-color:#31456d;color:#cfe1f8}
html[data-theme="dark"] .doc-cat:hover{background:#24365c;border-color:#4a6ea8;color:#fff}
html[data-theme="dark"] .doc-cat.is-active{background:#1d4e86;border-color:#1d4e86;color:#fff}
html[data-theme="dark"] .doc-cat-badge.is-mb{background:#16223c;color:#7db4f5}
html[data-theme="dark"] .doc-cat-badge.is-ann{background:#0f2e26;color:#6ee7b7}

html[data-theme="dark"] .peng-form{background:#101a2e;border-color:var(--sd-line)}
html[data-theme="dark"] .peng-form .dashboard-field>span{color:var(--sd-text-soft)}
html[data-theme="dark"] .peng-form .dashboard-field>span small{color:var(--sd-text-faint)}
html[data-theme="dark"] .peng-form input[type="file"]::file-selector-button{color:var(--sd-text-soft)}

html[data-theme="dark"] .backup-bar{background:#16223c}
html[data-theme="dark"] .dashboard-error{background:#33201f;border-color:#6b3833;color:#fca5a5}
/* Form Akses Odoo (mode malam) */
html[data-theme="dark"] .odoo-field span{color:#a9bcd4}
html[data-theme="dark"] .odoo-field input{background:#0f1a2e;border-color:#31456d;color:#e4edf7}
html[data-theme="dark"] .odoo-field input:focus{border-color:#5b9df8;box-shadow:0 0 0 3px rgba(91,157,248,.2)}
html[data-theme="dark"] .odoo-field input::placeholder{color:#6b7f9c}
html[data-theme="dark"] .odoo-note,
html[data-theme="dark"] .odoo-hint{color:#8a9cb8}
html[data-theme="dark"] .odoo-success{background:#0f2e26;border-color:#1f5c48;color:#6ee7b7}
/* Daftar koneksi Odoo (multi-koneksi, mode malam) */
html[data-theme="dark"] .odoo-sub{color:#7db4f5}
html[data-theme="dark"] .odoo-count{color:#8a9cb8}
html[data-theme="dark"] .odoo-divider{background:#22314f}
html[data-theme="dark"] .odoo-list-empty{color:#8a9cb8}
html[data-theme="dark"] .odoo-item{background:#0f1a2e;border-color:#2a3a5c}
html[data-theme="dark"] .odoo-item-title{color:#cfe0f5}
html[data-theme="dark"] .odoo-item-title .odoo-tag{background:#1a2c4a;color:#9dc4f8}
html[data-theme="dark"] .odoo-item-title .odoo-tag.is-off{background:#232c3c;color:#8b98ab}
html[data-theme="dark"] .odoo-item-meta{color:#8a9cb8}
html[data-theme="dark"] .odoo-item-key{color:#6b7f9c}
html[data-theme="dark"] .odoo-add{background:#101c30;border-color:#2f4064}
html[data-theme="dark"] .odoo-add summary{color:#7db4f5}
html[data-theme="dark"] .dashboard-small-button.primary{background:#1d4e86;border-color:#1d4e86;color:#fff}
html[data-theme="dark"] .dashboard-small-button.primary:hover:not(:disabled){background:#2a5fa0;border-color:#2a5fa0}
html[data-theme="dark"] .ib-modal-ts{background:#16223c;border-color:var(--sd-line);color:var(--sd-accent-2)}

/* =============================================================
   18. Mode malam untuk panel Total Project
   ============================================================= */
html[data-theme="dark"] .home-project-panel{background:var(--sd-panel);border-color:var(--sd-line);box-shadow:var(--sd-shadow)}
html[data-theme="dark"] .home-project-panel h2{color:var(--sd-accent-2)}
html[data-theme="dark"] .home-project-panel .dashboard-section-head p{color:var(--sd-text-faint)}
html[data-theme="dark"] .project-box{background:linear-gradient(180deg,#18243d 0%,#131d33 100%);border-color:var(--sd-line)}
html[data-theme="dark"] .project-box-sub{background:linear-gradient(180deg,#14252b 0%,#101d24 100%);border-color:#1f4a4e}
html[data-theme="dark"] .project-box-label{color:var(--sd-text)}
html[data-theme="dark"] .project-box-value{color:var(--sd-accent-2)}
html[data-theme="dark"] .project-box-sub .project-box-value{color:#5eead4}
html[data-theme="dark"] .project-box-icon{background:#1b2a49}
html[data-theme="dark"] .project-box-sub .project-box-icon{background:#0f2e33;color:#5eead4}
html[data-theme="dark"] .project-box-note{color:var(--sd-text-faint)}
html[data-theme="dark"] .project-box.is-error .project-box-value{color:var(--sd-text-faint)}

/* =============================================================
   19. Mode malam untuk section Total Project di dashboard
   ============================================================= */
html[data-theme="dark"] .prj-stat{background:var(--sd-panel);border-color:var(--sd-line)}
html[data-theme="dark"] .prj-stat:nth-child(2){border-color:#1f4a4e}
html[data-theme="dark"] .prj-stat span{color:var(--sd-text-faint)}
html[data-theme="dark"] .prj-stat strong{color:var(--sd-accent-2)}
html[data-theme="dark"] .prj-stat:nth-child(2) strong{color:#5eead4}
html[data-theme="dark"] .prj-stat:nth-child(3) strong{color:#93c5fd}
html[data-theme="dark"] .prj-form{background:var(--sd-panel-3);border-color:var(--sd-line)}
html[data-theme="dark"] .prj-form .dashboard-field span{color:var(--sd-text-soft)}
html[data-theme="dark"] .prj-form .dashboard-field span small{color:var(--sd-text-faint)}
html[data-theme="dark"] .prj-tabel .prj-nama{color:var(--sd-text)}
html[data-theme="dark"] .prj-tabel .prj-company,
html[data-theme="dark"] .prj-tabel .prj-pm{color:var(--sd-text-soft)}
html[data-theme="dark"] .prj-tabel .prj-remark,
html[data-theme="dark"] .prj-tabel .prj-kosong{color:var(--sd-text-faint)}
html[data-theme="dark"] .prj-tabel .prj-col-no,
html[data-theme="dark"] .prj-tabel .prj-periode{color:var(--sd-accent-2)}
html[data-theme="dark"] .prj-tabel .prj-kosong{color:#5b6b83!important}
html[data-theme="dark"] .prj-tabel .prj-col-no .prj-kosong{color:var(--sd-text-faint)!important}
html[data-theme="dark"] .prj-btn{background:var(--sd-panel);border-color:var(--sd-line);color:var(--sd-accent-2)}
html[data-theme="dark"] .prj-btn:hover{background:#1b2a49;border-color:var(--sd-accent)}
html[data-theme="dark"] .prj-btn.is-danger{border-color:var(--sd-bad-line);color:var(--sd-bad)}
html[data-theme="dark"] .prj-btn.is-danger:hover{background:var(--sd-bad-bg)}
html[data-theme="dark"] .prj-flash{background:var(--sd-ok-bg);border-color:var(--sd-ok-line);color:var(--sd-ok)}
html[data-theme="dark"] .prj-flash.is-err{background:var(--sd-bad-bg);border-color:var(--sd-bad-line);color:var(--sd-bad)}

/* ---------- 15. Pergantian halus ---------- */
@media (prefers-reduced-motion:no-preference){
  body,header,footer,.card-section,.sheet-wrapper,.insight,.ins-summary-block,
  .rekap-total,.trend-panel,.rekap-filter-panel,.inbound-card,.inbound-break,
  .manual-search,.ins-search,.ins-card,.ins-stat,.tupoksi-item,.app-box,
  .shift-card,.manual-no-result,.inbound-filter,.inbound-form,.dashboard-user,
  .nato-table,.inbound-table-wrap,.announcement-table-wrap{
    transition:background-color .22s ease,border-color .22s ease,color .22s ease,box-shadow .22s ease;
  }
}












