/* ==============================================================
   PSB PPRQ - Custom Styles
   mobile-hard-layout-fix | mobile-drawer-no-blur-fix
   mobile-layer-fix-final | mobile-click-fix-final
   ============================================================== */

/* ----- Login Page ----- */
.login-page {
  background: linear-gradient(135deg, #15803d 0%, #166534 60%, #14532d 100%);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.login-shell {
  box-shadow: 0 25px 60px rgba(0,0,0,0.35);
}

.login-brand {
  background: linear-gradient(160deg, #15803d 0%, #166534 50%, #14532d 100%);
  border-radius: 2rem 0 0 2rem;
  overflow: hidden;
}

.login-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255,255,255,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(255,255,255,0.04) 0%, transparent 50%);
  pointer-events: none;
}

.login-stat {
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  backdrop-filter: blur(4px);
}

.login-stat span {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.65);
  margin-bottom: 4px;
}

.login-stat strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
}

.login-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 0.9rem;
  pointer-events: none;
}

.btn-primary {
  background: linear-gradient(135deg, #15803d, #166534);
  color: white;
  border: none;
  transition: all 0.2s;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #16a34a, #15803d);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22, 101, 52, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ----- Sidebar Desktop ----- */
aside.sidebar-desktop {
  width: 15rem;
  background: linear-gradient(180deg, #166534 0%, #14532d 100%);
  box-shadow: 2px 0 20px rgba(0,0,0,0.15);
  z-index: 30;
}

aside.sidebar-desktop a,
aside.sidebar-desktop button {
  color: rgba(255,255,255,0.82);
  padding: 8px 14px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  display: block;
  font-size: 0.875rem;
}

aside.sidebar-desktop a:hover,
aside.sidebar-desktop button:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

aside.sidebar-desktop a.active,
aside.sidebar-desktop button.active {
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-weight: 600;
}

.sidebar-brand {
  background: linear-gradient(135deg, #15803d, #166534);
}

/* ----- Mobile Menu Drawer (fixed overlay) ----- */
#sidebar-mobile {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 15rem;
  background: linear-gradient(180deg, #166534 0%, #14532d 100%);
  z-index: 9999 !important;
  isolation: isolate !important;
  filter: none !important;
  padding-top: 60px;
  overflow-y: auto;
  box-shadow: 4px 0 20px rgba(0,0,0,0.3);
}

#sidebar-mobile.is-open {
  display: flex;
  flex-direction: column;
}

#sidebar-mobile a,
#sidebar-mobile button {
  color: rgba(255,255,255,0.85);
  padding: 10px 18px;
  border-radius: 0;
  transition: background 0.15s;
  text-decoration: none;
  display: block;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

#sidebar-mobile a:hover,
#sidebar-mobile button:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

#sidebar-mobile a.active {
  background: rgba(255,255,255,0.18);
  color: #fff;
}

.mobile-drawer-close {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 10003;
  background: rgba(255,255,255,0.15);
  color: white;
  border: none;
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  line-height: 1;
  display: none;
}

#sidebar-mobile.is-open + .mobile-drawer-close,
body.mobile-menu-open .mobile-drawer-close {
  display: block;
}

/* mobile-hard-layout-fix */
aside.sidebar-desktop {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  min-width: 0 !important;
  transform: translateX(-110%) !important;
  pointer-events: none !important;
}

/* mobile-drawer-no-blur-fix */
.mobile-menu-backdrop {
  display: none !important;
  opacity: 0 !important;
  pointer-events: none !important;
  background: transparent !important;
}

/* mobile-layer-fix-final */
#sidebar-mobile {
  z-index: 9999 !important;
  isolation: isolate !important;
  filter: none !important;
}

/* mobile-click-fix-final */
#sidebar-mobile,
#sidebar-mobile.is-open {
  pointer-events: auto !important;
}

#sidebar-mobile:before,
#sidebar-mobile:after {
  pointer-events: none !important;
}

#sidebar-mobile .sidebar-link,
#sidebar-mobile a,
#sidebar-mobile button {
  position: relative !important;
  z-index: 10002 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
}

#sidebar-mobile .sidebar-link *,
#sidebar-mobile a *,
#sidebar-mobile button * {
  pointer-events: none !important;
}

.mobile-drawer-close {
  pointer-events: auto !important;
  cursor: pointer !important;
  touch-action: manipulation !important;
}

/* ----- Main Content ----- */
.main-content {
  transition: margin-left 0.3s;
}

@media (min-width: 1024px) {
  aside.sidebar-desktop {
    display: flex !important;
    visibility: visible !important;
    width: 15rem !important;
    min-width: 15rem !important;
    transform: none !important;
    pointer-events: auto !important;
  }
  .main-content {
    margin-left: 15rem !important;
  }
  #sidebar-mobile { display: none !important; }
  .mobile-drawer-close { display: none !important; }
}

/* ----- Page Hero ----- */
.page-hero {
  padding: 1.5rem 0;
}

.page-hero p {
  color: #15803d;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.25rem;
}

.page-hero h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #111827;
}

.page-hero span {
  font-size: 0.875rem;
  color: #6b7280;
}

/* ----- Status Badge ----- */
.status-lunas {
  background: #d1fae5;
  color: #065f46;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-belum_bayar {
  background: #fee2e2;
  color: #991b1b;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-cicilan {
  background: #fef3c7;
  color: #92400e;
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* ----- Demographic Card (Dashboard) ----- */
.demo-shell {
  background: white;
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border: 1px solid #e5e7eb;
}

.demo-orb {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.demo-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f3f4f6;
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 0.78rem;
  color: #374151;
  margin: 3px;
}

.demo-bar-track {
  height: 6px;
  background: #e5e7eb;
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 6px;
}

.demo-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s ease;
}

/* ----- Toast Notification ----- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #111827;
  color: white;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  pointer-events: auto;
  animation: toastIn 0.3s ease;
  max-width: 320px;
}

.toast.error {
  background: #dc2626;
}

.toast.success {
  background: #16a34a;
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ----- Modal ----- */
#modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#modal-overlay.is-open {
  display: flex;
}

#modal {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

/* ----- Loading Overlay ----- */
#loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  z-index: 99998;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
}

#loading-overlay.is-open {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e5e7eb;
  border-top-color: #15803d;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ----- Skeleton ----- */
.skeleton {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ----- Utility ----- */
.text-gold { color: #b8860b; }
.bg-gold { background-color: #b8860b; }
.border-gold { border-color: #b8860b; }

.receipt-header-line {
  border-bottom: 3px double #166534;
}

/* ----- Print Receipt ----- */
@media print {
  .no-print { display: none !important; }
  body { background: white !important; }
}
/* v:20260508-final1 */
