* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  padding: 0;
  background: #ecfdf5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.title {
  color: #5C6AC4;
}

/* Local utility styles replacing the Tailwind CDN dependency. */
.w-full { width: 100%; }
.max-w-md { max-width: 28rem; }
.max-w-sm { max-width: 24rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.hidden { display: none !important; }
.flex { display: flex; }
.grid { display: grid; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-col { flex-direction: column; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: .75rem; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { inset: 0; }
.z-50 { z-index: 50; }
.z-40 { z-index: 40; }
.z-30 { z-index: 30; }
.cursor-pointer { cursor: pointer; }

/* Core local utilities used by the application. */
.h-screen { height: 100vh; }
.h-\[100dvh\] { height: 100dvh; }
.min-h-\[80vh\] { min-height: 80vh; }
.h-10 { height: 2.5rem; }
.w-10 { width: 2.5rem; }
.w-16 { width: 4rem; }
.h-16 { height: 4rem; }
.h-40 { height: 10rem; }
.w-40 { width: 10rem; }
.w-44 { width: 11rem; }
.h-44 { height: 11rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-3 { padding: .75rem; }
.px-3 { padding-left: .75rem; padding-right: .75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-3 { padding-top: .75rem; padding-bottom: .75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.flex-1 { flex: 1 1 0%; }
.flex-none { flex: none; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.text-center { text-align: center; }
.text-white { color: #fff; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-brand-500 { color: #10b981; }
.text-brand-600, .text-brand-700 { color: #047857; }
.bg-white { background: #fff; }
.bg-gray-50 { background: #f9fafb; }
.bg-gray-100 { background: #f3f4f6; }
.bg-brand-700 { background: #047857; }
.bg-brand-600 { background: #059669; }
.bg-black\/60 { background: rgb(0 0 0 / 60%); }
.border { border-width: 1px; border-style: solid; }
.border-gray-100 { border-color: #f3f4f6; }
.border-gray-200 { border-color: #e5e7eb; }
.rounded-xl { border-radius: .75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.shadow-sm { box-shadow: 0 1px 3px rgb(0 0 0 / 10%); }
.shadow-xl, .shadow-2xl { box-shadow: 0 15px 35px rgb(0 0 0 / 18%); }
.space-y-2 > * + * { margin-top: .5rem; }
.space-y-3 > * + * { margin-top: .75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-5 > * + * { margin-top: 1.25rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2 / span 2; }
.top-4 { top: 1rem; }
.left-1\/2 { left: 50%; }
.-translate-x-1\/2 { transform: translateX(-50%); }

/* Fallback visual styles for the authentication controls. */
.app-login-button {
  width: 100%;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid #047857;
  border-radius: 0.75rem;
  background: #047857;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25rem;
  box-shadow: 0 8px 18px rgba(4, 120, 87, 0.25);
  transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.app-login-button:hover {
  background: #065f46;
  box-shadow: 0 10px 22px rgba(4, 120, 87, 0.35);
}

.app-login-button:active {
  transform: translateY(1px);
}

.app-login-button:focus-visible,
.app-logout-button:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}

.app-logout-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 0.75rem;
  background: #ffffff;
  color: #065f46;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.app-logout-button:hover {
  background: #fef3c7;
  color: #92400e;
}

.app-logout-button:active {
  transform: translateY(1px);
}

/* Unggah foto anggota */
.member-photo-upload-field {
  padding: .7rem;
  border: 1px dashed #a7f3d0;
  border-radius: .85rem;
  background: #f0fdf8;
}

.member-photo-action-button {
  min-height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  padding: .35rem .55rem;
  border: 1px solid #a7f3d0;
  border-radius: .65rem;
  background: #ecfdf5;
  color: #047857;
  font-size: .68rem;
  font-weight: 700;
  cursor: pointer;
}

.member-photo-action-button:hover {
  background: #d1fae5;
  border-color: #10b981;
}

.member-photo-detail-action {
  width: auto;
  min-width: 10rem;
  margin: 0 auto;
  background: #ecfdf5;
  color: #065f46;
  border-color: #10b981;
}

.member-photo-status {
  margin: .35rem 0 0;
  color: #64748b;
  font-size: .65rem;
  line-height: 1.2;
  text-align: center;
}

#detail-member-photo-file {
  display: none !important;
}

#anggota-container > .bg-white {
  min-width: 0;
}

#anggota-container .anggota-card-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.portal-photo-upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .2rem;
  width: 100%;
  margin-top: .35rem;
  padding: .3rem .4rem;
  border: 1px solid rgba(255, 255, 255, .55);
  border-radius: .6rem;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  cursor: pointer;
}

.portal-photo-upload-button:hover {
  background: rgba(255, 255, 255, .28);
}

.anggota-card-actions {
  flex: 0 0 auto;
}

/* Member card media */
.member-card-info {
  min-width: 0;
  flex: 1 1 auto;
}

.member-card-info h4,
.member-card-info p {
  overflow-wrap: anywhere;
}

.member-photo { 
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #047857;
  background: #d1fae5;
  border: 2px solid rgba(255, 255, 255, 0.75);
}

.member-photo i {
  font-size: 1.75rem;
}

.member-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.member-photo-small {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  border-color: #a7f3d0;
}

.member-photo-large {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1.25rem;
  color: #065f46;
}

.member-photo-modal {
  width: 4.75rem;
  height: 4.75rem;
  border-radius: 1.25rem;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

/* Duka cost checklist */
.duka-cost-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 6.5rem;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem;
  border: 1px solid #fde68a;
  border-radius: 0.75rem;
  background: #ffffff;
  font-size: 0.7rem;
}

.duka-cost-item.is-selected {
  border-color: #f59e0b;
  background: #fffbeb;
}

.duka-cost-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: #d97706;
}

.duka-cost-label {
  min-width: 0;
  color: #78350f;
  font-weight: 600;
}

.duka-item-amount {
  width: 100%;
  min-width: 0;
  padding: 0.4rem 0.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.55rem;
  font-size: 0.7rem;
  outline: none;
}

.duka-item-amount:focus {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px #fde68a;
}

.duka-item-amount:disabled {
  background: #f3f4f6;
  color: #9ca3af;
}

/* The utility class is also defined here so visibility does not depend on CDN loading. */
.hidden {
  display: none !important;
}

/* Dashboard summary layout */
.dashboard-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr));
  gap: .75rem;
  width: 100%;
}

.dashboard-summary-card {
  display: block;
  min-width: 0;
  min-height: 8.5rem;
  padding: 1rem;
  overflow: hidden;
}

.dashboard-balance-card {
  display: block !important;
  min-height: 9.5rem;
  padding: 1.1rem;
  background: linear-gradient(135deg, #047857, #065f46) !important;
  color: #ffffff !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.dashboard-balance-card h3,
.dashboard-balance-card p,
.dashboard-balance-card span,
.dashboard-balance-card i {
  visibility: visible;
}

.dashboard-summary-card p,
.dashboard-summary-card h3 {
  overflow-wrap: anywhere;
}

@media (max-width: 420px) {
  .dashboard-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-balance-card {
    grid-column: 1 / -1;
    min-height: 9.5rem;
  }
}

/* Polished application theme */
:root {
  --brand-900: #064e3b;
  --brand-800: #065f46;
  --brand-700: #047857;
  --brand-600: #059669;
  --brand-500: #10b981;
  --ink: #172033;
  --muted: #64748b;
  --line: #e2e8f0;
  --surface: #ffffff;
  --soft: #f1f8f5;
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, .06);
  --shadow-card: 0 12px 30px rgba(15, 23, 42, .08);
}

body {
  background:
    radial-gradient(circle at 10% 0%, rgba(167, 243, 208, .7), transparent 28rem),
    linear-gradient(135deg, #f0fdf8 0%, #f8fafc 52%, #ecfdf5 100%);
  color: var(--ink);
}

#app-shell {
  background: #f8fafc;
  box-shadow: 0 24px 70px rgba(6, 78, 59, .16);
}

#main-header {
  background: linear-gradient(135deg, var(--brand-900), var(--brand-700));
  min-height: 76px;
  padding-top: 1rem;
  padding-bottom: 1rem;
  box-shadow: 0 8px 20px rgba(6, 78, 59, .2);
}

#main-header h1 {
  letter-spacing: .1em;
}

#main-header > div:last-child {
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
}

/* Header portal anggota: aksi dan notifikasi berada di bawah identitas STM. */
#main-header.member-portal-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .65rem;
  align-items: stretch;
}

#main-header.member-portal-header > div:first-child {
  width: 100%;
}

#main-header.member-portal-header > div:last-child {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: .4rem;
}

#main-header.member-portal-header .app-header-toast {
  order: 1;
  max-width: min(100%, 22rem);
}

#main-header.member-portal-header #btn-member-portal {
  order: 2;
}

#main-header.member-portal-header #btn-logout {
  order: 3;
}

.app-header-toast {
  min-width: 0;
  max-width: min(16rem, 42vw);
  transition: opacity .25s ease, transform .25s ease;
}

.app-header-toast-content {
  display: flex;
  align-items: center;
  gap: .4rem;
  min-width: 0;
  padding: .5rem .7rem;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: .75rem;
  background: rgba(15, 23, 42, .82);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .18);
}

.app-header-toast-content i {
  flex: 0 0 auto;
  color: #6ee7b7;
  font-size: 1rem;
}

.app-header-toast-content span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#main-container {
  padding: 1.25rem;
  background: linear-gradient(180deg, #f8fafc 0%, #f0fdf8 100%);
}

#main-container > section:not(#sec-login) > div:first-child h2,
#view-broadcast > div:first-child h2 {
  letter-spacing: -.025em;
}

.bg-white {
  background: rgba(255, 255, 255, .94);
}

.bg-white.rounded-2xl,
.bg-white.rounded-3xl {
  border-color: rgba(226, 232, 240, .9);
  box-shadow: var(--shadow-soft);
}

#sec-login > div {
  border: 0;
  box-shadow: var(--shadow-card);
  padding: 2rem;
}

#sec-login h2 {
  color: var(--brand-900);
  font-size: 1.45rem;
}

#sec-login .w-16 {
  background: linear-gradient(135deg, #d1fae5, #ecfdf5);
  box-shadow: 0 8px 18px rgba(16, 185, 129, .15);
}

input, textarea, select {
  background-color: #fff;
  color: var(--ink);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--brand-500) !important;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .14);
}

button {
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, color .18s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

.app-login-button {
  min-height: 50px;
  border: 0;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--brand-700), var(--brand-500));
  box-shadow: 0 10px 20px rgba(5, 150, 105, .22);
}

.app-login-button:hover {
  background: linear-gradient(135deg, var(--brand-800), var(--brand-600));
}

#nav-pengurus {
  padding-top: .65rem;
  padding-bottom: .7rem;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 -8px 20px rgba(15, 23, 42, .05);
}

#nav-pengurus button {
  border-radius: .9rem;
}

#nav-pengurus button:hover {
  background: #ecfdf5;
}

.member-photo {
  box-shadow: inset 0 0 0 1px rgba(4, 120, 87, .08);
}

#view-portal-member .bg-gradient-to-br {
  box-shadow: 0 16px 32px rgba(6, 78, 59, .2);
}

/* Tombol simpan perubahan profil anggota */
.app-profile-save-button {
  width: 100%;
  min-height: 3.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: .25rem;
  padding: .85rem 1rem;
  border: 2px solid #047857;
  border-radius: 1rem;
  background: linear-gradient(135deg, #047857, #059669);
  color: #ffffff !important;
  font-size: .85rem;
  font-weight: 800;
  line-height: 1.25rem;
  box-shadow: 0 8px 18px rgba(4, 120, 87, .28);
}

.app-profile-save-button i {
  font-size: 1.15rem;
}

.app-profile-save-button:hover {
  background: linear-gradient(135deg, #065f46, #047857);
  box-shadow: 0 10px 22px rgba(4, 120, 87, .38);
}

.app-profile-save-button:focus-visible {
  outline: 3px solid #fbbf24;
  outline-offset: 3px;
}

/* Tombol pembayaran pada kartu QRIS anggota */
.member-payment-button {
  width: 100%;
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .7rem 1rem;
  border: 1px solid #047857;
  border-radius: .85rem;
  background: linear-gradient(135deg, #059669, #047857);
  color: #fff;
  font-size: .75rem;
  font-weight: 800;
  box-shadow: 0 6px 14px rgba(4, 120, 87, .2);
}

.member-payment-button:hover {
  background: linear-gradient(135deg, #047857, #065f46);
}

/* Modal surfaces */
[id^="modal-"] {
  background: rgba(15, 23, 42, .62);
  padding: 1rem;
}

[id^="modal-"] > div {
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, .65);
  box-shadow: 0 24px 70px rgba(15, 23, 42, .25);
  animation: modal-in .2s ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#toast > div {
  box-shadow: 0 12px 30px rgba(15, 23, 42, .22);
}

/* Kontras tombol navigasi bawah */
#nav-pengurus button {
  min-height: 3.25rem;
  color: #64748b !important;
  background: #ffffff;
  border: 1px solid transparent;
}

#nav-pengurus button.text-brand-600,
#nav-pengurus button.text-brand-700 {
  color: #ffffff !important;
  background: #047857 !important;
  border-color: #065f46 !important;
  box-shadow: 0 5px 12px rgba(4, 120, 87, .28);
}

#nav-pengurus button:not(.text-brand-600):not(.text-brand-700) {
  color: #334155 !important;
  background: #ffffff !important;
  border-color: #e2e8f0;
}

#nav-pengurus button:hover {
  color: #ffffff !important;
  background: #059669 !important;
  border-color: #047857 !important;
}

#nav-pengurus button:not(.text-brand-600):not(.text-brand-700):hover {
  color: #065f46 !important;
  background: #d1fae5 !important;
  border-color: #6ee7b7;
}

#nav-pengurus button span,
#nav-pengurus button i {
  color: inherit;
}

/* Teks tombol aksi selalu kontras dengan latarnya */
button.bg-white,
button.bg-gray-100 {
  color: #374151;
}

button.bg-emerald-100,
button.bg-brand-50 {
  color: #065f46;
}

/* Warna tombol aksi: utility lokal agar teks putih selalu memiliki latar kontras. */
.bg-amber-500 { background-color: #f59e0b; }
.bg-amber-600 { background-color: #d97706; }
.bg-amber-700 { background-color: #b45309; }
.bg-emerald-500 { background-color: #10b981; }
.bg-emerald-600 { background-color: #059669; }
.bg-emerald-700 { background-color: #047857; }
.bg-rose-600 { background-color: #e11d48; }
.bg-rose-700 { background-color: #be123c; }
.bg-blue-600 { background-color: #2563eb; }
.bg-blue-700 { background-color: #1d4ed8; }

button.bg-amber-600,
button.bg-emerald-600,
button.bg-rose-600,
button.bg-blue-600,
button.bg-brand-600 {
  color: #ffffff !important;
  border-color: transparent;
  font-weight: 700;
}

button.bg-amber-600:hover { background-color: #b45309 !important; }
button.bg-emerald-600:hover,
button.bg-brand-600:hover { background-color: #047857 !important; }
button.bg-rose-600:hover { background-color: #be123c !important; }
button.bg-blue-600:hover { background-color: #1d4ed8 !important; }

/* Navigasi aktif/nonaktif dibuat tegas dan tidak bergantung pada CDN. */
#nav-pengurus button {
  color: #334155 !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
}

#nav-pengurus button.text-brand-600,
#nav-pengurus button.text-brand-700 {
  color: #ffffff !important;
  background: #047857 !important;
  border-color: #064e3b !important;
  box-shadow: 0 6px 14px rgba(4, 120, 87, .32);
}

#nav-pengurus button.text-brand-600:hover,
#nav-pengurus button.text-brand-700:hover {
  color: #ffffff !important;
  background: #065f46 !important;
}

#nav-pengurus button:not(.text-brand-600):not(.text-brand-700):hover {
  color: #064e3b !important;
  background: #d1fae5 !important;
  border-color: #10b981 !important;
}

@media (max-width: 420px) {
  #main-container { padding: 1rem; }
  #sec-login > div { padding: 1.35rem; }
  #main-header { padding-left: 1rem; padding-right: 1rem; }
  .duka-cost-item { grid-template-columns: auto minmax(0, 1fr); }
  .duka-item-amount { grid-column: 2; }
}

/* Tombol aksi anggota baru */
.new-member-action-button {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .5rem .75rem;
  border: 1px solid #047857;
  border-radius: .75rem;
  background: #059669;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1rem;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(4, 120, 87, .2);
}

.new-member-action-button:hover {
  background: #047857;
  border-color: #064e3b;
}

.member-exit-action-button {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .5rem .75rem;
  border: 1px solid #be123c;
  border-radius: .75rem;
  background: #e11d48;
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1rem;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(225, 29, 72, .2);
}

.member-exit-action-button:hover {
  background: #be123c;
  border-color: #9f1239;
}

/* Tombol Pemutihan: oranye tegas agar berbeda dari Anggota Keluar. */
.bg-orange-600 { background-color: #ea580c; }
.bg-orange-700 { background-color: #c2410c; }

.member-writeoff-action-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  padding: .5rem .75rem;
  border: 1px solid #c2410c !important;
  border-radius: .75rem;
  background: #ea580c !important;
  color: #ffffff !important;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1rem;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(234, 88, 12, .28);
}

.member-writeoff-action-button:hover {
  background: #c2410c !important;
  border-color: #9a3412 !important;
}

/* Tombol eksekusi pemutihan: oranye hanya saat siap dijalankan. */
#btn-eksekusi-pemutihan:not(:disabled) {
  background: #ea580c !important;
  border: 1px solid #c2410c !important;
  color: #ffffff !important;
  opacity: 1 !important;
  cursor: pointer;
  box-shadow: 0 5px 12px rgba(234, 88, 12, .28);
}

#btn-eksekusi-pemutihan:not(:disabled):hover {
  background: #c2410c !important;
  border-color: #9a3412 !important;
}

#btn-eksekusi-pemutihan:disabled {
  background: #cbd5e1 !important;
  border-color: #94a3b8 !important;
  color: #64748b !important;
  opacity: .7 !important;
  cursor: not-allowed;
  box-shadow: none;
}

.dashboard-outstanding-card {
  border: 3px solid #f97316 !important;
  box-shadow: 0 2px 10px rgba(249, 115, 22, .32) !important;
}

.dashboard-outstanding-card p,
.dashboard-outstanding-card .ph-warning {
  color: #ea580c !important;
}

.new-member-requirements-highlight {
  animation: new-member-highlight 1.2s ease;
}

@keyframes new-member-highlight {
  0%, 100% { box-shadow: var(--shadow-soft); }
  45% { box-shadow: 0 0 0 4px rgba(16, 185, 129, .28), var(--shadow-card); }
}

/* Kartu kewajiban anggota baru */
.new-member-requirements-card {
  padding: 1rem;
  border: 1px solid #a7f3d0;
  border-radius: 1rem;
  background: linear-gradient(135deg, #ecfdf5, #ffffff);
  box-shadow: var(--shadow-soft);
}

.new-member-requirements-heading {
  display: flex;
  align-items: center;
  gap: .7rem;
  margin-bottom: .8rem;
}

.new-member-requirements-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  border-radius: .75rem;
  background: #047857;
  color: #fff;
  font-size: 1.15rem;
}

.new-member-requirements-heading h3 {
  margin: 0;
  color: #064e3b;
  font-size: .85rem;
  font-weight: 800;
}

.new-member-requirements-heading p {
  margin: .15rem 0 0;
  color: #64748b;
  font-size: .68rem;
}

.new-member-requirements-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}

.new-member-requirement-item {
  min-width: 0;
  padding: .65rem;
  border: 1px solid #d1fae5;
  border-radius: .75rem;
  background: rgba(255, 255, 255, .8);
}

.new-member-requirement-item span {
  display: block;
  color: #64748b;
  font-size: .65rem;
  line-height: 1.2;
}

.new-member-requirement-item strong {
  display: block;
  margin-top: .25rem;
  color: #047857;
  font-size: .78rem;
  overflow-wrap: anywhere;
}

.new-member-requirements-note {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin: .75rem 0 0;
  color: #047857;
  font-size: .65rem;
}

@media (max-width: 520px) {
  .anggota-header-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 360px) {
  .new-member-requirements-grid { grid-template-columns: 1fr; }
}

/* Samakan ukuran seluruh tombol aksi pada menu Anggota. */
.anggota-header-actions > button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .25rem;
  min-height: 2.5rem;
  height: 2.5rem;
  padding: .5rem .75rem;
  border-width: 1px;
  border-style: solid;
  border-radius: .75rem;
  font-size: .75rem;
  font-weight: 700;
  line-height: 1rem;
  white-space: nowrap;
  box-sizing: border-box;
}

.anggota-header-actions > button i {
  font-size: 1rem;
  line-height: 1;
}

@media (max-width: 520px) {
  .anggota-header-actions > button {
    flex: 1 1 auto;
  }
}

/* Responsive mobile layout */
@media (max-width: 639px) {
  body {
    overflow-x: hidden;
  }

  #app-shell {
    width: 100%;
    min-width: 0;
  }

  #main-header {
    min-height: 68px;
    padding: .75rem 1rem;
    gap: .65rem;
  }

  #main-header > div:first-child {
    min-width: 0;
    gap: .6rem;
  }

  #main-header > div:first-child > div:first-child {
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    font-size: 1.25rem;
  }

  #main-header h1 {
    font-size: .82rem;
    white-space: nowrap;
  }

  #main-header p {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #main-header > div:last-child {
    gap: .35rem;
  }

  .app-header-toast {
    position: absolute;
    top: calc(100% + .45rem);
    right: .75rem;
    z-index: 5;
    width: min(78vw, 18rem);
    max-width: none;
  }

  #main-header.member-portal-header .app-header-toast {
    position: static;
    top: auto;
    right: auto;
    z-index: auto;
    width: auto;
    max-width: 100%;
    flex: 1 1 100%;
  }

  .app-logout-button {
    min-height: 34px;
    padding: .4rem .6rem;
    font-size: .68rem;
  }

  #main-container {
    padding: .9rem;
    padding-bottom: 1.25rem;
  }

  #main-container > section:not(#sec-login) {
    min-width: 0;
  }

  #sec-login {
    min-height: calc(100dvh - 7rem);
    padding: .5rem 0;
  }

  #sec-login > div {
    padding: 1.25rem;
    border-radius: 1.35rem;
  }

  .dashboard-heading,
  #view-kas > div:first-child {
    align-items: flex-start;
    gap: .75rem;
  }

  .dashboard-heading > span {
    flex: 0 0 auto;
  }

  .dashboard-summary-card {
    min-height: 7.5rem;
    padding: .8rem;
  }

  .dashboard-summary-card p {
    font-size: .68rem;
  }

  .dashboard-summary-card .text-sm {
    font-size: .78rem;
  }

  .anggota-header-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: .5rem;
  }

  .anggota-header-actions > button {
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 2.75rem;
    padding: .5rem .4rem;
    white-space: normal;
    text-align: center;
  }

  .anggota-header-actions > button:last-child {
    grid-column: 1 / -1;
  }

  #view-anggota .bg-white.p-3\.5,
  #kas-history-list .bg-white.p-3\.5 {
    align-items: flex-start;
    gap: .65rem;
  }

  #view-anggota .bg-white.p-3\.5 > div:first-child,
  #kas-history-list .bg-white.p-3\.5 > div:first-child {
    min-width: 0;
  }

  #view-anggota .bg-white.p-3\.5 h4,
  #view-anggota .bg-white.p-3\.5 p,
  #kas-history-list .bg-white.p-3\.5 h4,
  #kas-history-list .bg-white.p-3\.5 p {
    overflow-wrap: anywhere;
  }

  #view-anggota .bg-white.p-3\.5 > button {
    flex: 0 0 auto;
  }

  #view-anggota .anggota-card-actions {
    flex: 0 0 auto;
    max-width: 7rem;
  }

  #view-anggota .member-photo-action-button {
    min-width: 2.5rem;
    padding-left: .4rem;
    padding-right: .4rem;
  }

  #view-anggota .member-photo-action-button span {
    display: none;
  }

  #view-kas > div:first-child {
    flex-wrap: wrap;
  }

  #view-kas > div:first-child > button {
    width: 100%;
  }

  #view-pengaturan > .bg-amber-50 {
    align-items: flex-start;
    flex-direction: column;
  }

  #view-pengaturan > .bg-amber-50 button {
    width: 100%;
  }

  #nav-pengurus {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: .2rem;
    padding: .45rem .4rem calc(.45rem + env(safe-area-inset-bottom));
  }

  #nav-pengurus button {
    min-height: 3rem;
    padding: .35rem .15rem;
  }

  #nav-pengurus button i {
    font-size: 1.15rem;
  }

  #nav-pengurus button span {
    font-size: .58rem;
  }

  [id^="modal-"] {
    align-items: flex-end;
    padding: .65rem;
  }

  [id^="modal-"] > div {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 1.3rem);
    padding: 1rem;
    border-radius: 1.35rem;
  }

  .duka-cost-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .duka-item-amount {
    grid-column: 2;
  }

  .member-photo-large {
    width: 3.75rem;
    height: 3.75rem;
  }

  #view-portal-member .grid-cols-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  #main-container {
    padding-left: .7rem;
    padding-right: .7rem;
  }

  #main-header {
    padding-left: .75rem;
    padding-right: .75rem;
  }

  #main-header h1 {
    font-size: .75rem;
  }

  #main-header p {
    font-size: .62rem;
  }

  .anggota-header-actions {
    grid-template-columns: 1fr;
  }

  .anggota-header-actions > button:last-child {
    grid-column: auto;
  }

  .dashboard-summary-grid {
    gap: .5rem;
  }

  .dashboard-summary-card {
    padding: .7rem;
  }
}

/* Kontras kartu digital anggota: tetap terbaca walaupun utility CSS lokal digunakan. */
#view-portal-member > .bg-gradient-to-br {
  background: linear-gradient(135deg, #064e3b 0%, #047857 52%, #064e3b 100%) !important;
  color: #ffffff !important;
}

#view-portal-member > .bg-gradient-to-br h3,
#view-portal-member > .bg-gradient-to-br p,
#view-portal-member > .bg-gradient-to-br span {
  color: #ffffff !important;
  opacity: 1 !important;
  visibility: visible !important;
}

#view-portal-member > .bg-gradient-to-br #mportal-id,
#view-portal-member > .bg-gradient-to-br #mportal-alamat,
#view-portal-member > .bg-gradient-to-br #mportal-badge-status {
  color: #ffffff !important;
}

#view-portal-member > .bg-gradient-to-br #mportal-id,
#view-portal-member > .bg-gradient-to-br #mportal-alamat {
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

#view-portal-member > .bg-gradient-to-br #mportal-badge-status {
  background: #10b981 !important;
  border: 1px solid rgba(255, 255, 255, .35);
}

@media (max-width: 639px) {
  #view-portal-member > .bg-gradient-to-br {
    padding: 1rem;
  }

  #view-portal-member > .bg-gradient-to-br h3 {
    font-size: 1.05rem;
    line-height: 1.25rem;
  }

  #view-portal-member > .bg-gradient-to-br .mt-6 {
    margin-top: 1.25rem;
  }
}
