/* =========================================================
   Area 3 V259.30 - Night Mode Precision Contrast Pass
   Loaded after V259.29.
   Rule:
   - dark surface => light readable text
   - intentionally light islands (donut centers) => dark navy text
   Applies on desktop and mobile.
   ========================================================= */

html[data-theme="dark"]{
  --a3v25930-text:#f3f5f8;
  --a3v25930-muted:#b9c1cc;
  --a3v25930-link:#8bc2ff;
  --a3v25930-link-hover:#b7d9ff;
  --a3v25930-navy:#172b4d;
  --a3v25930-surface:#2f2f2f;
  --a3v25930-surface-2:#292929;
  --a3v25930-border:#4a4a4a;
}

/* =========================================================
   1. TASK DETAIL - eliminate legacy navy/dark text on dark cards
   ========================================================= */
html[data-theme="dark"] body .detail-card.task-detail-report-hero-v69 .activity-progress-card-v18413 .activity-progress-card-title-v18413,
html[data-theme="dark"] body .task-detail-report-hero-v69 .activity-progress-card-v18413 .activity-progress-card-title-v18413,
html[data-theme="dark"] body .detail-card.task-detail-report-hero-v69 .activity-progress-card-v18413 .task-detail-ring-inner-v69 b,
html[data-theme="dark"] body .task-detail-report-hero-v69 .activity-progress-card-v18413 .task-detail-ring-inner-v69 b,
html[data-theme="dark"] body .detail-card.task-detail-report-hero-v69 .activity-progress-line-v18413 b,
html[data-theme="dark"] body .task-detail-report-hero-v69 .activity-progress-line-v18413 b{
  color:var(--a3v25930-text)!important;
  -webkit-text-fill-color:var(--a3v25930-text)!important;
  text-shadow:none!important;
}

html[data-theme="dark"] body .detail-card.task-detail-report-hero-v69 .task-plain-info-v56,
html[data-theme="dark"] body .detail-card.task-detail-report-hero-v69 .task-plain-info-v56 span,
html[data-theme="dark"] body .detail-card.task-detail-report-hero-v69 .task-plain-info-v56 b,
html[data-theme="dark"] body .task-detail-report-hero-v69 .task-plain-info-v56,
html[data-theme="dark"] body .task-detail-report-hero-v69 .task-plain-info-v56 span,
html[data-theme="dark"] body .task-detail-report-hero-v69 .task-plain-info-v56 b{
  color:var(--a3v25930-text)!important;
  -webkit-text-fill-color:var(--a3v25930-text)!important;
}

html[data-theme="dark"] body .task-detail-report-hero-v69 .task-update-before-v259,
html[data-theme="dark"] body .task-detail-report-hero-v69 .task-update-before-v259 span{
  color:var(--a3v25930-muted)!important;
  -webkit-text-fill-color:var(--a3v25930-muted)!important;
}
html[data-theme="dark"] body .task-detail-report-hero-v69 .task-update-before-v259 b{
  color:var(--a3v25930-text)!important;
  -webkit-text-fill-color:var(--a3v25930-text)!important;
}
html[data-theme="dark"] body .detail-card.task-detail-report-hero-v69 .meta,
html[data-theme="dark"] body .task-detail-report-hero-v69 .meta{
  color:var(--a3v25930-muted)!important;
  -webkit-text-fill-color:var(--a3v25930-muted)!important;
}

/* Update Penjelasan + PIC / notification blocks. */
html[data-theme="dark"] body .task-update-reference-v259 label,
html[data-theme="dark"] body .task-quick-head-v238 h3,
html[data-theme="dark"] body .task-quick-field-v238 label,
html[data-theme="dark"] body .task-quick-explanation-v238 label,
html[data-theme="dark"] body .task-quick-section-v238 > label,
html[data-theme="dark"] body .task-update-edit-text-v2593 > span{
  color:var(--a3v25930-text)!important;
  -webkit-text-fill-color:var(--a3v25930-text)!important;
}
html[data-theme="dark"] body .task-quick-head-v238 small,
html[data-theme="dark"] body .task-quick-hint-v238,
html[data-theme="dark"] body .task-explanation-log-v259 .task-quick-head-v238 small,
html[data-theme="dark"] body .task-update-table-v259 td small,
html[data-theme="dark"] body .task-update-table-v259 .empty{
  color:var(--a3v25930-muted)!important;
  -webkit-text-fill-color:var(--a3v25930-muted)!important;
}
html[data-theme="dark"] body .task-update-table-v259 th,
html[data-theme="dark"] body .task-update-table-v259 td,
html[data-theme="dark"] body .task-update-history-text-v2593{
  color:var(--a3v25930-text)!important;
  -webkit-text-fill-color:var(--a3v25930-text)!important;
  border-color:var(--a3v25930-border)!important;
}
html[data-theme="dark"] body .task-update-table-v259 th{
  background:#303744!important;
  background-color:#303744!important;
}

/* Activity Timeline on task detail. */
html[data-theme="dark"] body .activity-master-v18413 > h3,
html[data-theme="dark"] body .activity-group-v18413 .activity-group-head-v18413 h4,
html[data-theme="dark"] body .activity-summary b,
html[data-theme="dark"] body .activity-summary span,
html[data-theme="dark"] body .activity-table-v6 td,
html[data-theme="dark"] body .activity-table-v6 td b,
html[data-theme="dark"] body .activity-duration-auto-v214{
  color:var(--a3v25930-text)!important;
  -webkit-text-fill-color:var(--a3v25930-text)!important;
}
html[data-theme="dark"] body .activity-group-v18413 .activity-group-head-v18413 small,
html[data-theme="dark"] body .gantt-view-controls-v218 small{
  color:var(--a3v25930-muted)!important;
  -webkit-text-fill-color:var(--a3v25930-muted)!important;
}
html[data-theme="dark"] body .activity-table-v6 td a,
html[data-theme="dark"] body .activity-group-v18413 a:not(.btn){
  color:var(--a3v25930-link)!important;
  -webkit-text-fill-color:var(--a3v25930-link)!important;
}
html[data-theme="dark"] body .activity-view-switch-v218{
  background:#252525!important;
  border-color:var(--a3v25930-border)!important;
}
html[data-theme="dark"] body .activity-view-switch-v218 .btn:not(.active){
  background:transparent!important;
  color:var(--a3v25930-link)!important;
  -webkit-text-fill-color:var(--a3v25930-link)!important;
}
html[data-theme="dark"] body .activity-duration-auto-v214{
  background:#292929!important;
  border-color:var(--a3v25930-border)!important;
}

/* Linked equipment / result cards inside Task Detail. */
html[data-theme="dark"] body .linked-graphic-card-v27 .linked-graphic-main-v27,
html[data-theme="dark"] body .linked-graphic-card-v27 .linked-graphic-main-v27 span,
html[data-theme="dark"] body .equipment-mini-card-v6 .linked-graphic-main-v27 span{
  color:var(--a3v25930-text)!important;
  -webkit-text-fill-color:var(--a3v25930-text)!important;
}
html[data-theme="dark"] body .linked-graphic-card-v27 .linked-graphic-main-v27 b,
html[data-theme="dark"] body .equipment-mini-card-v6 .linked-graphic-main-v27 b,
html[data-theme="dark"] body .equipment-mini-card b,
html[data-theme="dark"] body .task-button b{
  color:var(--a3v25930-link)!important;
  -webkit-text-fill-color:var(--a3v25930-link)!important;
}
html[data-theme="dark"] body .linked-graphic-card-v27 .linked-graphic-main-v27 small,
html[data-theme="dark"] body .equipment-mini-card-v6 .linked-graphic-main-v27 small,
html[data-theme="dark"] body .alat-result-body small{
  color:var(--a3v25930-muted)!important;
  -webkit-text-fill-color:var(--a3v25930-muted)!important;
}
html[data-theme="dark"] body .alat-result-body strong{
  color:var(--a3v25930-text)!important;
  -webkit-text-fill-color:var(--a3v25930-text)!important;
}
html[data-theme="dark"] body .compact-details > summary,
html[data-theme="dark"] body .detail-mini-summary-v18{
  color:var(--a3v25930-link)!important;
  -webkit-text-fill-color:var(--a3v25930-link)!important;
}

/* =========================================================
   2. DASHBOARD DONUTS - LIGHT CENTER stays light, text NAVY
   User explicitly requested this instead of dark-center/white-text.
   ========================================================= */
html[data-theme="dark"] body .dashboard-page-v81 .pie-v52::after,
html[data-theme="dark"] body .dashboard-chart-card-v52 .pie-v52::after{
  background:#ffffff!important;
  background-color:#ffffff!important;
  box-shadow:inset 0 0 0 1px #d7e1ec!important;
}
html[data-theme="dark"] body .dashboard-page-v81 .pie-v52 > span,
html[data-theme="dark"] body .dashboard-chart-card-v52 .pie-v52 > span{
  position:relative!important;
  z-index:2!important;
  background:transparent!important;
  background-color:transparent!important;
  border:0!important;
  box-shadow:none!important;
  color:var(--a3v25930-navy)!important;
  -webkit-text-fill-color:var(--a3v25930-navy)!important;
  text-shadow:none!important;
  text-decoration:none!important;
}

/* Same visual logic for PR/PO donut centers. */
html[data-theme="dark"] body .proc-dashboard-v190 .proc-pie-v190::after{
  background:#ffffff!important;
  background-color:#ffffff!important;
}
html[data-theme="dark"] body .proc-dashboard-v190 .proc-pie-v190 span,
html[data-theme="dark"] body .proc-dashboard-v190 .proc-pie-v190 span b{
  color:var(--a3v25930-navy)!important;
  -webkit-text-fill-color:var(--a3v25930-navy)!important;
  text-shadow:none!important;
}
html[data-theme="dark"] body .proc-dashboard-v190 .proc-pie-v190 span small{
  color:#475569!important;
  -webkit-text-fill-color:#475569!important;
}

/* Dashboard titles / filters / heatmap: dark surface => light text. */
html[data-theme="dark"] body .dashboard-page-v81 .chart-card-head-v52 h2,
html[data-theme="dark"] body .dashboard-page-v81 .inventory-card-filter-v114 label,
html[data-theme="dark"] body .dashboard-page-v81 .hm-head-v113 h2,
html[data-theme="dark"] body .status-heatmap-inside-card-v114 .hm-head-v113 h2,
html[data-theme="dark"] body .status-heatmap-full-v116 .hm-head-v113 h2,
html[data-theme="dark"] body .hm-analysis-card-v113 h3,
html[data-theme="dark"] body .hm-summary-card-v113 b,
html[data-theme="dark"] body .hm-equipment-v113 b{
  color:var(--a3v25930-text)!important;
  -webkit-text-fill-color:var(--a3v25930-text)!important;
}
html[data-theme="dark"] body .dashboard-page-v81 .chart-card-head-v52 span,
html[data-theme="dark"] body .dashboard-page-v81 .hm-head-v113 p,
html[data-theme="dark"] body .hm-summary-card-v113 small,
html[data-theme="dark"] body .hm-equipment-v113 small{
  color:var(--a3v25930-muted)!important;
  -webkit-text-fill-color:var(--a3v25930-muted)!important;
}
html[data-theme="dark"] body .dashboard-page-v81 .chart-legend-v52 a,
html[data-theme="dark"] body .dashboard-page-v81 .chart-legend-v52 a b{
  color:var(--a3v25930-text)!important;
  -webkit-text-fill-color:var(--a3v25930-text)!important;
}
html[data-theme="dark"] body .dashboard-page-v81 .chart-legend-v52 a span{
  color:var(--a3v25930-muted)!important;
  -webkit-text-fill-color:var(--a3v25930-muted)!important;
}

/* =========================================================
   3. KNOWN LEGACY NAVY TEXT - precision fixes across modules
   ========================================================= */

/* VMI links are dark blue in the legacy stylesheet. */
html[data-theme="dark"] body .vmi-subaction-row-v25923r5 .vmi-subaction-link-v25923r5,
html[data-theme="dark"] body .vmi-subaction-row-v25923r5 .vmi-subaction-link-v25923r5:visited{
  color:var(--a3v25930-link)!important;
  -webkit-text-fill-color:var(--a3v25930-link)!important;
}
html[data-theme="dark"] body .vmi-subaction-row-v25923r5 .vmi-subaction-link-v25923r5:hover,
html[data-theme="dark"] body .vmi-subaction-row-v25923r5 .vmi-subaction-link-v25923r5:focus{
  color:var(--a3v25930-link-hover)!important;
  -webkit-text-fill-color:var(--a3v25930-link-hover)!important;
}
html[data-theme="dark"] body .vmi-mn-v300,
html[data-theme="dark"] body .vmi-sync-panel-v300 small,
html[data-theme="dark"] body .vmi-section-head-v300 small,
html[data-theme="dark"] body .vmi-report-metrics-v300 small{
  color:var(--a3v25930-muted)!important;
  -webkit-text-fill-color:var(--a3v25930-muted)!important;
}

/* Inventory detail values. */
html[data-theme="dark"] body .inventory-detail-grid-v170 > div b{
  color:var(--a3v25930-text)!important;
  -webkit-text-fill-color:var(--a3v25930-text)!important;
}
html[data-theme="dark"] body .inventory-detail-grid-v170 > div small{
  color:var(--a3v25930-muted)!important;
  -webkit-text-fill-color:var(--a3v25930-muted)!important;
}

/* Contracts. */
html[data-theme="dark"] body .contract-kpi-grid > div b,
html[data-theme="dark"] body .contract-detail-grid > div b{
  color:var(--a3v25930-text)!important;
  -webkit-text-fill-color:var(--a3v25930-text)!important;
}
html[data-theme="dark"] body .contract-kpi-grid small,
html[data-theme="dark"] body .contract-detail-grid small{
  color:var(--a3v25930-muted)!important;
  -webkit-text-fill-color:var(--a3v25930-muted)!important;
}
html[data-theme="dark"] body .contract-doc-card b,
html[data-theme="dark"] body .contract-add-doc summary{
  color:var(--a3v25930-link)!important;
  -webkit-text-fill-color:var(--a3v25930-link)!important;
}

/* Linimasa. */
html[data-theme="dark"] body .linimasa-card-v145 h4,
html[data-theme="dark"] body .linimasa-card-v146 h4{
  color:var(--a3v25930-text)!important;
  -webkit-text-fill-color:var(--a3v25930-text)!important;
}

/* Notes. */
html[data-theme="dark"] body .notes-title-v179 h1,
html[data-theme="dark"] body .note-card-v179 header b{
  color:var(--a3v25930-text)!important;
  -webkit-text-fill-color:var(--a3v25930-text)!important;
}
html[data-theme="dark"] body .notes-title-v179 p,
html[data-theme="dark"] body .note-card-v179 header time{
  color:var(--a3v25930-muted)!important;
  -webkit-text-fill-color:var(--a3v25930-muted)!important;
}
html[data-theme="dark"] body .notes-title-v179 small,
html[data-theme="dark"] body .note-ai-v179 strong{
  color:var(--a3v25930-link)!important;
  -webkit-text-fill-color:var(--a3v25930-link)!important;
}
html[data-theme="dark"] body .notes-title-v179 > span{
  background:#243342!important;
  color:#9fd0ff!important;
  -webkit-text-fill-color:#9fd0ff!important;
}
html[data-theme="dark"] body .ai-action-card-v181{
  background:#27313b!important;
  border-color:#496273!important;
  color:var(--a3v25930-text)!important;
  -webkit-text-fill-color:var(--a3v25930-text)!important;
}

/* Home / shared legacy headings that previously force navy. */
html[data-theme="dark"] body .home-search-page h1{
  color:var(--a3v25930-text)!important;
  -webkit-text-fill-color:var(--a3v25930-text)!important;
}

/* =========================================================
   4. Common dark-surface safety net (headings / labels only)
   Avoid blanket descendant recoloring so semantic badges and
   deliberate light islands keep their intended foreground.
   ========================================================= */
html[data-theme="dark"] body .compact-panel > h1,
html[data-theme="dark"] body .compact-panel > h2,
html[data-theme="dark"] body .compact-panel > h3,
html[data-theme="dark"] body .compact-panel > h4,
html[data-theme="dark"] body .section-card > h1,
html[data-theme="dark"] body .section-card > h2,
html[data-theme="dark"] body .section-card > h3,
html[data-theme="dark"] body .section-card > h4,
html[data-theme="dark"] body .filter-card > h2,
html[data-theme="dark"] body .filter-card > h3,
html[data-theme="dark"] body .search-panel > h2,
html[data-theme="dark"] body .search-panel > h3{
  color:var(--a3v25930-text)!important;
  -webkit-text-fill-color:var(--a3v25930-text)!important;
}

html[data-theme="dark"] body .compact-panel label,
html[data-theme="dark"] body .section-card label,
html[data-theme="dark"] body .filter-card label,
html[data-theme="dark"] body .search-panel label{
  color:var(--a3v25930-text)!important;
  -webkit-text-fill-color:var(--a3v25930-text)!important;
}

html[data-theme="dark"] body .hint,
html[data-theme="dark"] body .empty:not(.status):not(.pill){
  color:var(--a3v25930-muted)!important;
  -webkit-text-fill-color:var(--a3v25930-muted)!important;
}

/* Native dropdown options: prevent light text on light native popup where supported. */
html[data-theme="dark"] body select option{
  background:#292929!important;
  color:#f3f5f8!important;
}

/* Links on dark surfaces stay visibly blue, never legacy navy. */
html[data-theme="dark"] body .compact-panel a:not(.btn):not(.status):not(.pill):not(.detail-status),
html[data-theme="dark"] body .section-card a:not(.btn):not(.status):not(.pill):not(.detail-status){
  color:var(--a3v25930-link)!important;
  -webkit-text-fill-color:var(--a3v25930-link)!important;
}
html[data-theme="dark"] body .compact-panel a:not(.btn):hover,
html[data-theme="dark"] body .section-card a:not(.btn):hover{
  color:var(--a3v25930-link-hover)!important;
  -webkit-text-fill-color:var(--a3v25930-link-hover)!important;
}

/* Print remains light / ink-friendly. */
@media print{
  html[data-theme="dark"] body .dashboard-page-v81 .pie-v52::after,
  html[data-theme="dark"] body .dashboard-chart-card-v52 .pie-v52::after{
    background:#fff!important;
  }
  html[data-theme="dark"] body .dashboard-page-v81 .pie-v52 > span,
  html[data-theme="dark"] body .dashboard-chart-card-v52 .pie-v52 > span{
    color:#172b4d!important;
    -webkit-text-fill-color:#172b4d!important;
  }
}
