/* SATRIA V22.3: deterministic contrast layer loaded last on every page. */
:root{
  --s23-ink:#0b2948;
  --s23-muted:#58718a;
  --s23-white:#ffffff;
  --s23-blue:#1677e8;
  --s23-blue-dark:#0755b2;
  --s23-line:#cdddeb;
  --s23-soft:#eef6ff;
  --s23-green:#116a4b;
  --s23-amber:#8a5a0a;
  --s23-red:#92263a;
  --s23-slate:#35556f;
}

/* Computed by satria-v22.3-contrast-engine.js. */
[data-satria-contrast="on-dark"]{
  color:var(--s23-white)!important;
}
[data-satria-contrast="on-dark"] > i,
[data-satria-contrast="on-dark"] > span,
[data-satria-contrast="on-dark"] > strong,
[data-satria-contrast="on-dark"] > small,
[data-satria-contrast="on-dark"] > b,
[data-satria-contrast="on-dark"] > svg{
  color:inherit!important;
  fill:currentColor;
}
[data-satria-contrast="on-light"]{
  color:var(--s23-ink)!important;
}
[data-satria-contrast="on-light"] > i,
[data-satria-contrast="on-light"] > span,
[data-satria-contrast="on-light"] > strong,
[data-satria-contrast="on-light"] > small,
[data-satria-contrast="on-light"] > b,
[data-satria-contrast="on-light"] > svg{
  color:inherit!important;
  fill:currentColor;
}

/* Primary and destructive controls always use white labels. */
.button.primary,.btn-primary,.primary-btn,.top-button.primary,.top-button.accent,
.action-button.primary,.context-button.primary,.v12-btn.primary,.v12-btn.success,
button.primary,button.success,button.danger,.button.danger,.btn-danger,
.nav-item.active,.context-tab.active,.rail-link.active,.rail-item.active,
.view-buttons button.active,.bottom-nav button.active,.public-user-tabs button.active{
  color:#fff!important;
}
.button.primary *, .btn-primary *, .primary-btn *, .top-button.primary *, .top-button.accent *,
.action-button.primary *, .context-button.primary *, .v12-btn.primary *, .v12-btn.success *,
button.primary *, button.success *, button.danger *, .button.danger *, .btn-danger *,
.nav-item.active *, .context-tab.active *, .rail-link.active *, .rail-item.active *,
.view-buttons button.active *, .bottom-nav button.active *, .public-user-tabs button.active *{
  color:inherit!important;
}

/* Light secondary controls always use dark/navy labels. */
.button:not(.primary):not(.danger):not(.success),
.action-button:not(.primary):not(.danger),
.context-button:not(.primary),
.table-action,.top-button:not(.primary):not(.accent),
.row-actions button[aria-disabled="true"],
button[aria-disabled="true"]{
  color:var(--s23-ink)!important;
}
.button:not(.primary):not(.danger):not(.success) *,
.action-button:not(.primary):not(.danger) *,
.context-button:not(.primary) *,
.table-action *, .top-button:not(.primary):not(.accent) *,
.row-actions button[aria-disabled="true"] *, button[aria-disabled="true"] *{
  color:inherit!important;
}

/* Explicit accessible status pairs. */
.badge.good,.status.good,.status-pill.good,.condition-pill.good,.condition-badge.good,
.priority-pill.p5,.v12-status.Aman,.v12-status.Selesai{
  background:#dff6ec!important;color:#075f42!important;border-color:#b8e7d5!important;
}
.badge.warn,.status.warn,.status-pill.warn,.condition-pill.light,.condition-badge.light,
.priority-pill.p3,.v12-status.p3,.v12-status.Perlu{
  background:#fff0ce!important;color:#744800!important;border-color:#efd495!important;
}
.condition-pill.medium,.condition-badge.medium,.priority-pill.p2,.v12-status.p2,.v12-status.Risiko{
  background:#ffe6d8!important;color:#823f19!important;border-color:#efb998!important;
}
.badge.bad,.status.bad,.status-pill.bad,.condition-pill.heavy,.condition-badge.heavy,
.priority-pill.p1,.v12-status.p1,.v12-status.Kritis{
  background:#ffe0e5!important;color:#8a1f34!important;border-color:#efb2bd!important;
}
.badge.blue,.status.neutral,.status-pill.neutral,.condition-pill.unknown,.condition-badge.unknown,
.priority-pill.p4,.priority-pill.p5:not(.condition-pill){
  background:#e6f2ff!important;color:#0755a7!important;border-color:#b9d7f3!important;
}
.badge,.status,.status-pill,.condition-pill,.condition-badge,.priority-pill,.chip,.pill{
  font-weight:800!important;
  opacity:1!important;
}
.badge *, .status *, .status-pill *, .condition-pill *, .condition-badge *, .priority-pill *, .chip *, .pill *{
  color:inherit!important;
}

/* Dark action clusters, including dynamically generated asset actions. */
.row-actions button:not([aria-disabled="true"]),
.row-actions a,
.priority-actions button.primary,
.map-panel button.active,
.control-panel button.active{
  color:#fff!important;
  background:#123f67!important;
  border-color:#3274a9!important;
}
.row-actions button:not([aria-disabled="true"]) *,
.row-actions a *, .priority-actions button.primary *,
.map-panel button.active *, .control-panel button.active *{color:inherit!important}
.row-actions button[aria-disabled="true"],button[aria-disabled="true"]{
  color:#41586c!important;
  background:#e3ebf2!important;
  border-color:#c5d3df!important;
  opacity:1!important;
  cursor:not-allowed!important;
}

/* Forms and tables remain readable regardless of inherited theme variables. */
input,select,textarea{
  color:var(--s23-ink)!important;
}
input::placeholder,textarea::placeholder{
  color:#71889e!important;opacity:1!important;
}
select option{color:var(--s23-ink)!important;background:#fff!important}
thead th{color:#294966!important;background:#eaf3fb!important}
tbody td{color:#173650!important}

/* Dialogs are light surfaces unless a page explicitly uses a map popup. */
dialog.modal,.modal:not(.maplibregl-popup-content){
  color:var(--s23-ink)!important;
  background:#fff!important;
}
dialog.modal h1,dialog.modal h2,dialog.modal h3,dialog.modal label,
.modal:not(.maplibregl-popup-content) h1,.modal:not(.maplibregl-popup-content) h2,
.modal:not(.maplibregl-popup-content) h3,.modal:not(.maplibregl-popup-content) label{
  color:var(--s23-ink)!important;
}
dialog.modal small,.modal:not(.maplibregl-popup-content) small{color:var(--s23-muted)!important}

/* Preserve intentionally dark map/panorama surfaces. */
.maplibregl-popup-content,.satria-popup,.map-panel,.control-panel,
body[data-v22-page="map"] .map-panel,body[data-v22-page="map"] .control-panel,
.panorama-shell,.viewer-shell{
  color:#f3f8fc;
}
.maplibregl-popup-content strong,.satria-popup strong{color:#fff!important}
.maplibregl-popup-content small,.satria-popup small{color:#b5c8d8!important}

@media(max-width:720px){
  .button,.top-button,.action-button,.context-button{min-height:40px}
  .row-actions{gap:7px!important;flex-wrap:wrap!important}
  .row-actions button,.row-actions a{min-height:34px!important}
}

@media print{
  [data-satria-contrast]{color:#172f45!important}
}
