/* APK Emergency Dark Contrast 2027
   Static only. No observers, no redraw loops. Load last. */

html[data-apk-theme="dark"],
html[data-apk-theme-mode="dark"],
html[data-bs-theme="dark"],
html.dark{
  color-scheme:dark;
}

html[data-apk-theme="dark"] body,
body[data-apk-theme="dark"],
html[data-apk-theme-mode="dark"] body,
html[data-bs-theme="dark"] body,
html.dark body,
body.dark{
  background:#07111f!important;
  color:#eaf2ff!important;
  -webkit-text-fill-color:initial!important;
}

html[data-apk-theme="dark"] body #main,
body[data-apk-theme="dark"] #main,
html[data-apk-theme-mode="dark"] body #main,
html[data-bs-theme="dark"] body #main,
html.dark body #main,
body.dark #main{
  background:linear-gradient(135deg,#07111f 0%,#0b1728 58%,#140d25 100%)!important;
  color:#eaf2ff!important;
}

html[data-apk-theme="dark"] body #main h1,
html[data-apk-theme="dark"] body #main h2,
html[data-apk-theme="dark"] body #main h3,
html[data-apk-theme="dark"] body #main h4,
html[data-apk-theme="dark"] body #main h5,
html[data-apk-theme="dark"] body #main h6,
html[data-apk-theme="dark"] body #main label,
html[data-apk-theme="dark"] body #main p,
html[data-apk-theme="dark"] body #main span,
html[data-apk-theme="dark"] body #main small,
html[data-apk-theme="dark"] body #main strong,
html[data-apk-theme="dark"] body #main b,
html[data-apk-theme="dark"] body #main div,
html[data-apk-theme="dark"] body #main td,
html[data-apk-theme="dark"] body #main th,
body[data-apk-theme="dark"] #main h1,
body[data-apk-theme="dark"] #main h2,
body[data-apk-theme="dark"] #main h3,
body[data-apk-theme="dark"] #main h4,
body[data-apk-theme="dark"] #main h5,
body[data-apk-theme="dark"] #main h6,
body[data-apk-theme="dark"] #main label,
body[data-apk-theme="dark"] #main p,
body[data-apk-theme="dark"] #main span,
body[data-apk-theme="dark"] #main small,
body[data-apk-theme="dark"] #main strong,
body[data-apk-theme="dark"] #main b,
body[data-apk-theme="dark"] #main div,
body[data-apk-theme="dark"] #main td,
body[data-apk-theme="dark"] #main th{
  color:#eaf2ff!important;
}

html[data-apk-theme="dark"] body #main .text-muted,
body[data-apk-theme="dark"] #main .text-muted,
html[data-apk-theme="dark"] body #main small,
body[data-apk-theme="dark"] #main small,
html[data-apk-theme="dark"] body #main .dataTables_info,
body[data-apk-theme="dark"] #main .dataTables_info{
  color:#b9c8dd!important;
}

html[data-apk-theme="dark"] body #main .card,
html[data-apk-theme="dark"] body #main .card-body,
html[data-apk-theme="dark"] body #main .form-group,
html[data-apk-theme="dark"] body #main .table-responsive,
html[data-apk-theme="dark"] body #main .dataTables_wrapper,
html[data-apk-theme="dark"] body #main .modal-content,
html[data-apk-theme="dark"] body #main .apk-entry-dialog,
html[data-apk-theme="dark"] body #main .pf-card,
html[data-apk-theme="dark"] body #main .pf-status-card,
body[data-apk-theme="dark"] #main .card,
body[data-apk-theme="dark"] #main .card-body,
body[data-apk-theme="dark"] #main .form-group,
body[data-apk-theme="dark"] #main .table-responsive,
body[data-apk-theme="dark"] #main .dataTables_wrapper,
body[data-apk-theme="dark"] #main .modal-content,
body[data-apk-theme="dark"] #main .apk-entry-dialog,
body[data-apk-theme="dark"] #main .pf-card,
body[data-apk-theme="dark"] #main .pf-status-card{
  background:#0e1d31!important;
  border-color:rgba(125,170,235,.28)!important;
  color:#eaf2ff!important;
}

html[data-apk-theme="dark"] body #main input,
html[data-apk-theme="dark"] body #main select,
html[data-apk-theme="dark"] body #main textarea,
html[data-apk-theme="dark"] body #main .form-control,
html[data-apk-theme="dark"] body #main .select2-selection,
body[data-apk-theme="dark"] #main input,
body[data-apk-theme="dark"] #main select,
body[data-apk-theme="dark"] #main textarea,
body[data-apk-theme="dark"] #main .form-control,
body[data-apk-theme="dark"] #main .select2-selection{
  background:#10243d!important;
  color:#f8fbff!important;
  -webkit-text-fill-color:#f8fbff!important;
  border-color:rgba(125,170,235,.48)!important;
}

html[data-apk-theme="dark"] body #main input::placeholder,
html[data-apk-theme="dark"] body #main textarea::placeholder,
body[data-apk-theme="dark"] #main input::placeholder,
body[data-apk-theme="dark"] #main textarea::placeholder{
  color:#b9c8dd!important;
  -webkit-text-fill-color:#b9c8dd!important;
  opacity:1!important;
}

html[data-apk-theme="dark"] body #main table.dataTable,
body[data-apk-theme="dark"] #main table.dataTable,
html[data-apk-theme="dark"] body #main table,
body[data-apk-theme="dark"] #main table{
  background:#0e1d31!important;
  color:#eaf2ff!important;
}
html[data-apk-theme="dark"] body #main table.dataTable thead th,
body[data-apk-theme="dark"] #main table.dataTable thead th,
html[data-apk-theme="dark"] body #main table thead th,
body[data-apk-theme="dark"] #main table thead th{
  background:#142844!important;
  color:#f8fbff!important;
  -webkit-text-fill-color:#f8fbff!important;
  border-color:rgba(125,170,235,.32)!important;
}
html[data-apk-theme="dark"] body #main table.dataTable tbody tr,
body[data-apk-theme="dark"] #main table.dataTable tbody tr,
html[data-apk-theme="dark"] body #main table tbody tr,
body[data-apk-theme="dark"] #main table tbody tr{
  background:#0f2036!important;
  color:#eaf2ff!important;
}
html[data-apk-theme="dark"] body #main table.dataTable tbody tr:nth-child(even),
body[data-apk-theme="dark"] #main table.dataTable tbody tr:nth-child(even),
html[data-apk-theme="dark"] body #main table tbody tr:nth-child(even),
body[data-apk-theme="dark"] #main table tbody tr:nth-child(even){
  background:#132944!important;
}
html[data-apk-theme="dark"] body #main table.dataTable tbody td,
body[data-apk-theme="dark"] #main table.dataTable tbody td,
html[data-apk-theme="dark"] body #main table tbody td,
body[data-apk-theme="dark"] #main table tbody td{
  color:#eaf2ff!important;
  -webkit-text-fill-color:#eaf2ff!important;
  border-color:rgba(125,170,235,.22)!important;
}

html[data-apk-theme="dark"] body a:not(.btn):not(.button):not(.paginate_button),
body[data-apk-theme="dark"] a:not(.btn):not(.button):not(.paginate_button){
  color:#93c5fd!important;
}

/* Do not let button children inherit low-contrast table/link color. */
html[data-apk-theme="dark"] body button,
html[data-apk-theme="dark"] body .btn,
html[data-apk-theme="dark"] body .button,
html[data-apk-theme="dark"] body input[type="submit"],
html[data-apk-theme="dark"] body input[type="button"],
body[data-apk-theme="dark"] button,
body[data-apk-theme="dark"] .btn,
body[data-apk-theme="dark"] .button,
body[data-apk-theme="dark"] input[type="submit"],
body[data-apk-theme="dark"] input[type="button"]{
  opacity:1!important;
  visibility:visible!important;
}
html[data-apk-theme="dark"] body .btn-primary,
html[data-apk-theme="dark"] body .btn-info,
html[data-apk-theme="dark"] body .btn-success,
html[data-apk-theme="dark"] body .btn-danger,
html[data-apk-theme="dark"] body .apk-flow-link,
html[data-apk-theme="dark"] body .apk-print-button,
html[data-apk-theme="dark"] body .print-button,
body[data-apk-theme="dark"] .btn-primary,
body[data-apk-theme="dark"] .btn-info,
body[data-apk-theme="dark"] .btn-success,
body[data-apk-theme="dark"] .btn-danger,
body[data-apk-theme="dark"] .apk-flow-link,
body[data-apk-theme="dark"] .apk-print-button,
body[data-apk-theme="dark"] .print-button{
  color:#ffffff!important;
  -webkit-text-fill-color:#ffffff!important;
}
