
/* ABUYA MANAGEMENT - Global readability patch
   Tujuan: memperbaiki kontras teks/form/tabel tanpa mengubah logika PHP/database.
*/
.access-dark{
  --ui-text:#f8fafc;
  --ui-text-soft:#cbd5e1;
  --ui-muted:#94a3b8;
  --ui-border:#334155;
}
.access-dark,
.access-dark body{ color:var(--ui-text); }

.access-dark h1,.access-dark h2,.access-dark h3,.access-dark h4,
.access-dark h5,.access-dark h6,
.access-dark p,.access-dark span,
.access-dark div,.access-dark li,
.access-dark td,.access-dark th,
.access-dark label,.access-dark .form-label,
.access-dark .form-check-label,
.access-dark .form-text,
.access-dark small{
  /* only applies where Bootstrap/theme has inherited an unreadable dark color */
}
.access-dark label,
.access-dark .form-label,
.access-dark .form-check-label{
  color:var(--ui-text) !important;
  font-weight:600;
}
.access-dark .text-dark,
.access-dark .text-body{
  color:var(--ui-text) !important;
}
.access-dark .text-muted,
.access-dark .text-secondary,
.access-dark .form-text{
  color:var(--ui-text-soft) !important;
}
.access-dark small{ color:var(--ui-text-soft); }
.access-dark input,
.access-dark textarea,
.access-dark select,
.access-dark .form-control,
.access-dark .form-select{
  color:#f8fafc !important;
  background-color:#0b1329;
  border-color:#334155;
}
.access-dark input::placeholder,
.access-dark textarea::placeholder{
  color:#94a3b8 !important;
  opacity:1;
}
.access-dark select option{
  color:#1e293b;
  background:#fff;
}
.access-dark .table td,
.access-dark .table th{
  color:#f8fafc;
}
.access-dark .table .text-dark,
.access-dark .table .text-body{
  color:#f8fafc !important;
}
.access-dark a:not(.btn){
  color:#fbbf24;
}
.access-dark .card,
.access-dark .card-body,
.access-dark .card-header{
  color:#f8fafc;
}
.access-dark hr{ border-color:#475569; opacity:1; }
.access-dark .alert{ color:#f8fafc; }
.access-dark .btn-outline-light{ color:#f8fafc; }

.access-light{
  --ui-text:#1e293b;
  --ui-muted:#64748b;
}
.access-light,
.access-light body{ color:var(--ui-text); }
.access-light label,
.access-light .form-label,
.access-light .form-check-label{
  color:#334155 !important;
  font-weight:600;
}
.access-light .text-muted,
.access-light .text-secondary,
.access-light .form-text{
  color:#64748b !important;
}
.access-light input,
.access-light textarea,
.access-light select,
.access-light .form-control,
.access-light .form-select{
  color:#1e293b !important;
}
.access-light input::placeholder,
.access-light textarea::placeholder{
  color:#64748b !important;
  opacity:1;
}
.access-light select option{
  color:#1e293b;
  background:#fff;
}
.access-light .table td,
.access-light .table th{
  color:#1e293b;
}
.access-light .table .text-muted,
.access-light .table .text-secondary{
  color:#64748b !important;
}
.access-light .card,
.access-light .card-body,
.access-light .card-header{
  color:#1e293b;
}

/* Readability v2: jangan paksa teks putih pada tabel putih. */
.access-dark .table:not(.table-dark) td,
.access-dark .table:not(.table-dark) th {
  color:#1e293b !important;
  background-color:#fff;
}
.access-dark .table:not(.table-dark) thead th {
  color:#fff !important;
  background-color:#0b1329 !important;
}
.access-dark .table.table-dark td,
.access-dark .table.table-dark th { color:#f8fafc !important; }
.access-dark .table.table-dark input,
.access-dark .table.table-dark select,
.access-dark .table.table-dark textarea { color:#f8fafc !important; background:#0b1329 !important; }
.access-dark .table:not(.table-dark) .text-muted,
.access-dark .table:not(.table-dark) .text-secondary { color:#64748b !important; }
.access-dark .table:not(.table-dark) a { color:#0369a1 !important; }
.access-dark .text-white { color:#f8fafc !important; }
.access-dark .bg-white { color:#1e293b !important; }


/* ==========================================================
   ABUYA GLOBAL THEME SYSTEM
   User preference is stored in localStorage and shared by all pages.
   ========================================================== */
:root.abuya-theme-light {
  color-scheme: light;
}
:root.abuya-theme-dark {
  color-scheme: dark;
}

body.theme-light,
body.abuya-theme-light {
  background:#f5f7fb !important;
  color:#1e293b !important;
}
body.theme-dark,
body.abuya-theme-dark {
  background:#0f172a !important;
  color:#e5e7eb !important;
}

/* Common surfaces */
.theme-light .card,
.theme-light .cardx,
.theme-light .card-stat,
.theme-light .card-login,
.theme-light .am-card,
.theme-light .card-body,
.theme-light .card-header,
.theme-light .modal-content {
  background:#ffffff !important;
  color:#1e293b !important;
  border-color:#dbe3ef !important;
}
.theme-dark .card,
.theme-dark .cardx,
.theme-dark .card-stat,
.theme-dark .card-login,
.theme-dark .am-card,
.theme-dark .card-body,
.theme-dark .card-header,
.theme-dark .modal-content {
  background:#17213d !important;
  color:#f8fafc !important;
  border-color:#334155 !important;
}

/* Form readability */
.theme-light input,.theme-light textarea,.theme-light select,
.theme-light .form-control,.theme-light .form-select {
  background:#fff !important;
  color:#1e293b !important;
  border-color:#cbd5e1 !important;
}
.theme-dark input,.theme-dark textarea,.theme-dark select,
.theme-dark .form-control,.theme-dark .form-select {
  background:#0b1329 !important;
  color:#f8fafc !important;
  border-color:#475569 !important;
}
.theme-light input::placeholder,.theme-light textarea::placeholder { color:#64748b !important; }
.theme-dark input::placeholder,.theme-dark textarea::placeholder { color:#94a3b8 !important; }

/* Text helpers */
.theme-light .text-white { color:#1e293b !important; }
.theme-dark .text-dark,
.theme-dark .text-body { color:#f8fafc !important; }
.theme-dark .text-muted,
.theme-dark .text-secondary,
.theme-dark .help,
.theme-dark .small-muted,
.theme-dark .sub { color:#cbd5e1 !important; }

/* Tables */
.theme-light .table:not(.table-dark) td,
.theme-light .table:not(.table-dark) th { color:#1e293b !important; background:#fff !important; }
.theme-light .table:not(.table-dark) thead th { background:#0b1329 !important; color:#fff !important; }
.theme-dark .table:not(.table-dark) td,
.theme-dark .table:not(.table-dark) th { color:#e5e7eb !important; background:#17213d !important; }
.theme-dark .table:not(.table-dark) thead th { background:#0b1329 !important; color:#fff !important; }
.theme-dark .table-striped>tbody>tr:nth-of-type(odd)>* { --bs-table-accent-bg:#1c2948 !important; }

/* Login becomes brighter but still calm */
body.theme-light .card-login {
  box-shadow:0 20px 50px rgba(15,23,42,.12) !important;
}
body.theme-light .card-login .brand { color:#0f172a !important; }
body.theme-light .card-login .sub { color:#64748b !important; }
body.theme-light .card-login label { color:#334155 !important; }
body.theme-light .card-login .form-control {
  background:#ffffff !important;
  color:#172033 !important;
}
body.theme-dark .card-login {
  box-shadow:0 20px 50px rgba(0,0,0,.25) !important;
}

/* Universal theme button */
.abuya-theme-toggle {
  position:fixed;
  right:18px;
  bottom:18px;
  z-index:99999;
  border:1px solid rgba(148,163,184,.45);
  border-radius:999px;
  padding:8px 13px;
  background:#0b1329;
  color:#fff;
  font:700 12px/1 'Plus Jakarta Sans',sans-serif;
  box-shadow:0 6px 20px rgba(15,23,42,.18);
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:7px;
}
.theme-light .abuya-theme-toggle,
body.theme-light .abuya-theme-toggle {
  background:#fff;
  color:#0f172a;
  border-color:#cbd5e1;
}
.abuya-theme-icon { font-size:14px; }
.abuya-theme-text { letter-spacing:.2px; }
@media(max-width:600px){
  .abuya-theme-toggle{right:10px;bottom:10px;padding:8px 11px}
  .abuya-theme-text{display:none}
}

/* Theme toggle hard-fix: ensure browser always styles the generated button. */
button#abuyaThemeToggle.abuya-theme-toggle{
  position:fixed !important;
  right:18px !important;
  bottom:18px !important;
  left:auto !important;
  top:auto !important;
  z-index:2147483647 !important;
  min-width:94px !important;
  width:auto !important;
  height:38px !important;
  padding:0 14px !important;
  margin:0 !important;
  border:1px solid #cbd5e1 !important;
  border-radius:999px !important;
  background:#ffffff !important;
  color:#0f172a !important;
  font:700 12px/38px "Plus Jakarta Sans",Arial,sans-serif !important;
  box-shadow:0 8px 24px rgba(15,23,42,.18) !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:7px !important;
  cursor:pointer !important;
}
body.theme-dark button#abuyaThemeToggle.abuya-theme-toggle{
  background:#0b1329 !important;
  color:#f8fafc !important;
  border-color:#475569 !important;
}
