/* v2.2 patch - FIX BUTTON VISIBILITY & SPEC COMPLIANCE - 2026-09-08 */
/* Ensure legacy CSS variables have fallbacks if header not loaded */
:root{
  --accent: var(--brand, #0ea5e9);
  --primary: var(--brand, #0ea5e9);
  --secondary: #0f172a;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --bg-body: #f8fafc;
}

/* Base table modernization */
table{border-collapse:separate!important;border-spacing:0!important}
th{background:#f8fafc!important;color:#0f172a!important;font-weight:700!important;font-size:12px!important;letter-spacing:.06em!important;text-transform:uppercase!important}
td{font-size:14px!important}
tr:hover td{background:#f8fafc!important}
.card{border-radius:16px!important}
.input, input[type=text], input[type=date], input[type=email], input[type=password], input[type=number], select, textarea{border-radius:10px!important; border:1px solid #cbd5e1!important;}

/* ===== BUTTON SYSTEM v2.2 - Fix invisible buttons ===== */
/* Ensure all buttons have visible text and proper contrast */
button, .btn, a.btn, input[type="submit"], input[type="button"]{
  border-radius:10px!important;
  font-weight:600!important;
  font-size:14px!important;
  line-height:1.2!important;
  cursor:pointer!important;
  transition:all .18s!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  text-decoration:none!important;
  white-space:nowrap!important;
  min-height:38px!important;
  box-sizing:border-box!important;
}

/* Primary buttons - using brand */
button[style*="var(--accent)"], a[style*="var(--accent)"],
button[style*="var(--primary)"], a[style*="var(--primary)"]{
  background:var(--brand)!important;
  color:white!important;
  border:1px solid var(--brand)!important;
}
button[style*="var(--secondary)"], a[style*="var(--secondary)"]{
  background:#0f172a!important;
  color:white!important;
  border:1px solid #0f172a!important;
}

/* Fix secondary button text visibility */
button[style*="background: var(--secondary)"]{background:#0f172a!important;color:white!important;}

/* Fix cancel buttons with #ccc - improve contrast */
button[style*="background: #ccc"], button[style*="background:#ccc"]{
  background:#e2e8f0!important;
  color:#334155!important;
  border:1px solid #cbd5e1!important;
}

/* Fix danger buttons */
button[style*="background: #ef4444"], a[style*="background: #ef4444"]{
  background:#ef4444!important;
  color:white!important;
}

/* Fix success buttons */
button[style*="background: #10b981"], a[style*="background: #10b981"],
button[style*="background: #059669"], a[style*="background: #059669"]{
  background:#10b981!important;
  color:white!important;
}

/* Fix ghost/outline buttons */
button[style*="background: white"], a[style*="background: white"]{
  background:white!important;
  color:#0f172a!important;
  border:1px solid #cbd5e1!important;
}

/* Ensure icon buttons (edit/delete) are visible */
a[style*="color: var(--accent)"]{color:var(--brand)!important;}
a[style*="color: var(--accent)"]:hover{color:var(--brand-dark)!important;}

/* Table header fix */
th[style*="color: var(--secondary)"]{color:#0f172a!important;}

/* Muted text fix */
[style*="color: var(--text-muted)"]{color:#64748b!important;}
[style*="color: var(--text-main)"]{color:#0f172a!important;}

/* Ensure modal buttons are visible */
#modalCreate button, #modalCreateBulk button, #modalManageJenis button,
#modalPengumuman button, #modalAcara button{
  min-height:38px!important;
}

/* Fix pagination buttons */
a[style*="background: var(--primary)"]{background:var(--brand)!important;color:white!important;}

/* Responsive button stacking */
@media(max-width:640px){
  .page-content [style*="display: flex"][style*="gap"]{
    flex-wrap:wrap!important;
  }
  button, .btn, a[style*="background"]{
    width:auto!important;
    min-width:0!important;
  }
}

/* Ensure no button is hidden by overflow */
.card [style*="overflow-x: auto"]{overflow-x:auto!important;-webkit-overflow-scrolling:touch!important;padding-bottom:4px!important;}
.card{overflow:visible!important;}

/* Fix print view buttons */
.no-print button, .no-print a{
  display:inline-flex!important;
}
