/* APK Approval Role + Dark Final 2027
   Final layer: separate Admin/Pracetak approval views and fix any white cards/tables left in dark mode. */

/* Approval sections: make top/bottom visual hierarchy clear */
.apk-approval-section--pending{
  border-left: 5px solid #ef3f7a !important;
}
.apk-approval-section--history{
  border-left: 5px solid #22c55e !important;
}
.apk-approval-section--history .apk-action-cell{
  min-width: 140px !important;
}
.apk-approval-section--history .apk-action-form,
.apk-approval-section--history button[name="approve_spec"],
.apk-approval-section--history button[name="approve"],
.apk-approval-section--history button[name="del_spec"],
.apk-approval-section--history button[name="edit"]{
  display:none !important;
}

/* Strong dark-mode reset for approval/history tables that legacy table CSS can still turn white. */
html[data-apk-theme="dark"] .apk-approval-section,
html[data-apk-theme="dark"] .apk-approval-section--pending,
html[data-apk-theme="dark"] .apk-approval-section--history{
  background: linear-gradient(180deg,#0f1d33 0%,#0a1628 100%) !important;
  color: #f8fbff !important;
  -webkit-text-fill-color: initial !important;
  border-color: rgba(125,166,238,.34) !important;
  box-shadow: 0 24px 70px rgba(0,0,0,.40) !important;
}
html[data-apk-theme="dark"] .apk-approval-section--pending{
  border-left-color:#f472b6 !important;
}
html[data-apk-theme="dark"] .apk-approval-section--history{
  border-left-color:#34d399 !important;
}
html[data-apk-theme="dark"] .apk-approval-section :where(h1,h2,h3,h4,h5,h6,.apk-section-kicker,.apk-section-title,.apk-section-title *,p,span,small,strong,b,label,div){
  color:#f8fbff !important;
  -webkit-text-fill-color: currentColor !important;
}
html[data-apk-theme="dark"] .apk-approval-section .apk-section-title p{
  color:#bed0ea !important;
  -webkit-text-fill-color:#bed0ea !important;
}

/* DataTables and legacy table wrapper inside approval sections */
html[data-apk-theme="dark"] .apk-approval-section :where(.table-responsive,.apk-table-shell,.dataTables_wrapper,.dataTables_scroll,.dataTables_scrollBody){
  background:#0c1a2d !important;
  color:#f8fbff !important;
  border-color:rgba(148,178,220,.28) !important;
}
html[data-apk-theme="dark"] .apk-approval-section :where(table,.table,.dataTable,.apk-data-table){
  background:#0c1a2d !important;
  color:#f8fbff !important;
  border-color:rgba(148,178,220,.28) !important;
}
html[data-apk-theme="dark"] .apk-approval-section :where(thead,thead tr,thead th){
  background:#182b48 !important;
  color:#eaf2ff !important;
  -webkit-text-fill-color:#eaf2ff !important;
  border-color:rgba(148,178,220,.32) !important;
}
html[data-apk-theme="dark"] .apk-approval-section :where(tbody,tr,td){
  color:#f8fbff !important;
  -webkit-text-fill-color:#f8fbff !important;
  border-color:rgba(148,178,220,.25) !important;
}
html[data-apk-theme="dark"] .apk-approval-section tbody tr,
html[data-apk-theme="dark"] .apk-approval-section .odd,
html[data-apk-theme="dark"] .apk-approval-section .even{
  background:#0f1f35 !important;
}
html[data-apk-theme="dark"] .apk-approval-section tbody tr:nth-child(even){
  background:#142640 !important;
}
html[data-apk-theme="dark"] .apk-approval-section tbody td{
  background:transparent !important;
}

/* DataTables controls in dark mode */
html[data-apk-theme="dark"] .apk-approval-section :where(.dataTables_length,.dataTables_filter,.dataTables_info,.dataTables_paginate,.dataTables_length label,.dataTables_filter label){
  color:#dbeafe !important;
  -webkit-text-fill-color:#dbeafe !important;
}
html[data-apk-theme="dark"] .apk-approval-section :where(.dataTables_filter input,.dataTables_length select){
  background:#0b1729 !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  border:1px solid rgba(148,178,220,.45) !important;
}
html[data-apk-theme="dark"] .apk-approval-section .paginate_button,
html[data-apk-theme="dark"] .apk-approval-section .dataTables_paginate .paginate_button{
  background:#0b1729 !important;
  color:#eaf2ff !important;
  -webkit-text-fill-color:#eaf2ff !important;
  border:1px solid rgba(148,178,220,.34) !important;
}
html[data-apk-theme="dark"] .apk-approval-section .paginate_button.current,
html[data-apk-theme="dark"] .apk-approval-section .dataTables_paginate .paginate_button.current{
  background:linear-gradient(135deg,#2563eb,#7c3aed) !important;
  color:#fff !important;
  -webkit-text-fill-color:#fff !important;
}

/* Role-specific action button labels need strong contrast */
.apk-action-btn--success,
button[name="approve_spec"],
button[name="approve"]{
  background: linear-gradient(135deg,#16a34a,#0ea5e9) !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
  box-shadow:0 14px 30px rgba(14,165,233,.24) !important;
}
html[data-apk-theme="dark"] .apk-action-btn--success,
html[data-apk-theme="dark"] button[name="approve_spec"],
html[data-apk-theme="dark"] button[name="approve"]{
  background: linear-gradient(135deg,#10b981,#38bdf8) !important;
  color:#06111f !important;
  -webkit-text-fill-color:#06111f !important;
  text-shadow:none !important;
}

/* Sidebar submenu: final guard, because fresh-2026 had white submenu cards. */
html[data-apk-theme="dark"] #sidebar :where(.submenu,.sidebar-submenu,ul.menu-sub,ul.submenu,.submenu.active,.sidebar-item .submenu){
  background:linear-gradient(180deg,#0f1e34,#132947) !important;
  border:1px solid rgba(148,178,220,.25) !important;
  color:#eaf2ff !important;
}
html[data-apk-theme="dark"] #sidebar :where(.submenu a,.sidebar-submenu a,ul.menu-sub a,ul.submenu a,.submenu li a){
  color:#eaf2ff !important;
  -webkit-text-fill-color:#eaf2ff !important;
  opacity:1 !important;
}
html[data-apk-theme="dark"] #sidebar :where(.submenu a:hover,.sidebar-submenu a:hover,.submenu li.active a){
  background:rgba(96,165,250,.15) !important;
  color:#ffffff !important;
  -webkit-text-fill-color:#ffffff !important;
}
