@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root{
  --primary: #8B8FFF;
  --primary-dark: #6D74F5;
  --primary-light: #23244B;
  --accent: #6FA8FF;
  --pink: #FF8FA3;
  --bg-1: #0F1020;
  --bg-2: #15162E;
  --card-bg: #1B1C38;
  --card-bg-2: #21224A;
  --text-light: #EDEDF7;
  --text-muted: #9497B8;
  --border-soft: #2B2C55;
  --success: #3DD598;
  --danger: #FF6B81;
  --radius: 18px;
  --shadow-soft: 0 10px 30px rgba(0,0,0,0.35);
}

*{ box-sizing: border-box; }

body{
  font-family: 'Poppins', sans-serif;
  background: radial-gradient(circle at 10% 0%, #1A1B3D 0%, #0F1020 45%, #16111F 100%);
  color: var(--text-light);
  min-height: 100vh;
}

a{ text-decoration: none; }

/* ===== Auth Pages ===== */
.auth-wrapper{
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-card{
  background: var(--card-bg);
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-soft);
}
.auth-card::before{
  content:"";
  position:absolute; top:-60px; right:-60px;
  width:180px; height:180px; border-radius:50%;
  background: radial-gradient(circle, var(--primary-light), transparent 70%);
}
.auth-title{
  font-weight: 800;
  font-size: 1.5rem;
  color: #fff;
  text-align: center;
  line-height: 1.35;
  margin-bottom: 6px;
}
.auth-sub{
  text-align:center;
  color: var(--text-muted);
  font-size: .85rem;
  margin-bottom: 26px;
}
.form-label{ font-weight: 600; font-size: .85rem; color: var(--text-light); }
.form-text{ color: var(--text-muted); font-size: .76rem; }
.form-control, .form-select{
  border-radius: 14px;
  border: 1.5px solid var(--border-soft);
  padding: 11px 14px;
  background: var(--bg-2);
  color: var(--text-light);
  font-size: .92rem;
}
.form-control::placeholder{ color: #6C6E96; }
.form-control:focus, .form-select:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
  background: var(--bg-2);
  color: var(--text-light);
}
.form-control[readonly]{ background: var(--bg-2); opacity:.85; }
.form-select option{ background: var(--bg-2); color: var(--text-light); }
.input-group .btn-eye{
  border: 1.5px solid var(--border-soft);
  border-left: none;
  background: var(--bg-2);
  border-radius: 0 14px 14px 0;
  color: var(--text-muted);
}
.input-group .form-control{ border-radius: 14px 0 0 14px; }

.btn-primary-soft{
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: #fff;
  border-radius: 14px;
  padding: 11px;
  font-weight: 600;
  width: 100%;
  box-shadow: 0 8px 20px rgba(109,116,245,0.45);
  transition: .2s;
}
.btn-primary-soft:hover{ transform: translateY(-1px); box-shadow: 0 10px 24px rgba(109,116,245,0.55); color:#fff; }

.auth-links{
  text-align: center;
  margin-top: 18px;
  font-size: .85rem;
}
.auth-links a{
  color: var(--primary);
  font-weight: 600;
}
.auth-links a:hover{ text-decoration: underline; color: #fff; }

/* ===== Layout (Admin/Member) ===== */
.app-sidebar{
  width: 260px;
  min-height: 100vh;
  background: var(--card-bg);
  box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  position: fixed;
  top:0; left:0;
  z-index: 1030;
  transition: transform .25s ease;
  display:flex; flex-direction:column;
  border-right: 1px solid var(--border-soft);
}
.app-sidebar .brand{
  padding: 26px 22px 18px;
  font-weight: 800;
  color: #fff;
  font-size: 1.05rem;
  line-height: 1.3;
  border-bottom: 1px solid var(--border-soft);
}
.app-sidebar .nav-link{
  color: var(--text-muted);
  font-weight: 600;
  font-size: .9rem;
  padding: 12px 22px;
  border-radius: 0;
  display:flex; align-items:center; gap:12px;
  border-left: 3px solid transparent;
}
.app-sidebar .nav-link i{ font-size: 1.1rem; width: 22px; text-align:center; }
.app-sidebar .nav-link.active, .app-sidebar .nav-link:hover{
  background: var(--primary-light);
  color: #fff;
  border-left-color: var(--primary);
}
.app-sidebar .logout-area{ margin-top:auto; padding: 18px 22px; border-top: 1px solid var(--border-soft); }

.app-content{
  margin-left: 260px;
  padding: 26px 28px 60px;
  min-height: 100vh;
}
.app-topbar{
  display:flex; align-items:center; justify-content: space-between;
  margin-bottom: 22px;
}
.app-topbar h4{ font-weight: 800; margin:0; color: #fff; }
.app-topbar .user-chip{
  background: var(--card-bg); border-radius: 30px; padding: 8px 16px;
  box-shadow: var(--shadow-soft); font-weight:600; font-size:.85rem;
  display:flex; align-items:center; gap:8px;
  color: var(--text-light);
  border: 1px solid var(--border-soft);
}
.btn-burger{
  display:none;
  background: var(--card-bg); border: 1px solid var(--border-soft); border-radius:12px; width:42px; height:42px;
  box-shadow: var(--shadow-soft);
  color: var(--text-light);
}

.soft-card{
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
  padding: 22px;
  margin-bottom: 22px;
}
.stat-card{
  border-radius: var(--radius);
  padding: 20px 22px;
  color: #fff;
  box-shadow: var(--shadow-soft);
  margin-bottom: 22px;
}
.stat-card.awal{ background: linear-gradient(135deg, #4A5AE8, #6D74F5); }
.stat-card.sisa{ background: linear-gradient(135deg, #1FA97C, #3DD598); }
.stat-card .label{ font-size:.8rem; opacity:.9; font-weight:600; }
.stat-card .value{ font-size:1.5rem; font-weight:800; margin-top:4px; }

.table-soft{
  font-size: .88rem;
  color: var(--text-light);
  background-color: var(--card-bg);
  --bs-table-bg: var(--card-bg);
  --bs-table-color: var(--text-light);
  --bs-table-striped-bg: var(--card-bg-2);
  --bs-table-striped-color: var(--text-light);
  --bs-table-hover-bg: rgba(255,255,255,0.04);
  --bs-table-hover-color: var(--text-light);
  border-collapse: separate;
}
.table-soft > :not(caption) > * > *{
  background-color: var(--card-bg);
  color: var(--text-light);
  box-shadow: none;
}
.table-soft thead th{
  background-color: var(--primary-light) !important;
  --bs-table-bg: var(--primary-light);
}
.table-soft tbody td{ background-color: var(--card-bg) !important; }
.table-soft tbody tr:hover td{ background-color: rgba(255,255,255,0.04) !important; }
.table-soft thead th{
  background: var(--primary-light);
  color: #C7C9FF;
  font-weight: 700;
  border: none;
  padding: 12px 14px;
  white-space: nowrap;
}
.table-soft thead th:first-child{ border-radius: 12px 0 0 12px; }
.table-soft thead th:last-child{ border-radius: 0 12px 12px 0; }
.table-soft td{ padding: 12px 14px; vertical-align: middle; border-color: var(--border-soft); color: var(--text-light); }
.table-soft tbody tr:hover{ background: rgba(255,255,255,0.02); }

.badge-status{
  padding: 5px 14px;
  border-radius: 30px;
  font-weight: 700;
  font-size: .74rem;
}
.badge-aktif{ background: rgba(61,213,152,0.15); color: #3DD598; }
.badge-nonaktif{ background: rgba(255,107,129,0.15); color: #FF6B81; }

.thumb-sm{
  width: 46px; height: 46px; object-fit: cover; border-radius: 10px;
  cursor: pointer; border: 2px solid var(--border-soft);
}

.btn-soft-primary{
  background: var(--primary-light); color: #C7C9FF;
  border: none; border-radius: 10px; font-weight:600; font-size:.8rem;
  padding: 6px 12px;
}
.btn-soft-danger{
  background: rgba(255,107,129,0.15); color: #FF6B81;
  border: none; border-radius: 10px; font-weight:600; font-size:.8rem;
  padding: 6px 12px;
}
.btn-soft-primary:hover{ background: var(--primary); color:#fff; }
.btn-soft-danger:hover{ background: var(--danger); color:#fff; }

.gallery-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px,1fr));
  gap: 16px;
}
.gallery-item{
  background: var(--card-bg); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
  position: relative;
}
.gallery-item [data-img-popup]{ cursor: pointer; }
.gallery-item img{ width:100%; height: 140px; object-fit: cover; display:block; }
.gallery-item .cap{ padding: 8px 10px; font-size: .78rem; color: var(--text-muted); white-space: nowrap; overflow:hidden; text-overflow: ellipsis; }
.gallery-del-btn{
  position: absolute;
  top: 8px; right: 8px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,107,129,0.92);
  color: #fff;
  border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  z-index: 5;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.gallery-del-btn:hover{ background: #FF6B81; }

.saldo-banner{
  background: linear-gradient(135deg, var(--primary-dark), var(--pink));
  color:#fff; border-radius: var(--radius); padding: 20px 24px;
  margin-bottom: 22px; box-shadow: var(--shadow-soft);
  display:flex; align-items:center; justify-content: space-between; flex-wrap: wrap; gap:10px;
}
.saldo-banner .label{ font-size:.82rem; opacity:.9; font-weight:600; }
.saldo-banner .value{ font-size:1.6rem; font-weight:800; }

.overlay-backdrop{
  display:none; position: fixed; inset:0; background: rgba(0,0,0,.6); z-index: 1020;
}

/* Modals & alerts in dark mode */
.modal-content{
  background: var(--card-bg);
  color: var(--text-light);
  border: 1px solid var(--border-soft);
  max-height: 88vh;
  overflow-y: auto;
}
.modal-header .btn-close{ filter: invert(1) grayscale(100%) brightness(200%); }
.modal-backdrop.show{ opacity: .75; }
.alert-success{ background: rgba(61,213,152,0.12); color: #3DD598; border: 1px solid rgba(61,213,152,0.3); }
.alert-danger{ background: rgba(255,107,129,0.12); color: #FF6B81; border: 1px solid rgba(255,107,129,0.3); }
.alert-warning{ background: rgba(255,193,102,0.12); color: #FFC166; border: 1px solid rgba(255,193,102,0.3); }
.text-primary{ color: var(--primary) !important; }
.text-muted{ color: var(--text-muted) !important; }

.wa-float{
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  box-shadow: 0 8px 24px rgba(37,211,102,0.45);
  z-index: 1040;
  transition: transform .2s;
}
.wa-float:hover{ transform: scale(1.08); color: #fff; }

.table-soft tfoot td{
  font-weight: 800;
  background: var(--primary-light);
  color: #fff;
  border: none;
}
.table-soft tfoot td:first-child{ border-radius: 0 0 0 12px; }
.table-soft tfoot td:last-child{ border-radius: 0 0 12px 0; }

@media (max-width: 991px){
  .app-sidebar{ transform: translateX(-100%); }
  .app-sidebar.show{ transform: translateX(0); }
  .app-content{ margin-left: 0; padding: 18px; }
  .btn-burger{ display:inline-flex; align-items:center; justify-content:center; }
  .overlay-backdrop.show{ display:block; }
}

/* ===== Custom File Input (ganti tampilan bawaan browser yg suka berantakan/kepotong) ===== */
.file-input-hidden{
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}
.file-input-btn{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--bg-2);
  border: 1.5px solid var(--border-soft);
  color: var(--text-light);
  border-radius: 14px;
  padding: 11px 16px;
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  transition: .2s;
  margin: 0;
}
.file-input-btn:hover{ border-color: var(--primary); color:#fff; }
.file-input-status{
  color: var(--text-muted);
  font-size: .78rem;
  margin-top: 6px;
  word-break: break-word;
}
.file-preview-grid{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.file-preview-thumb-wrap{
  position: relative;
  width: 64px;
  height: 64px;
}
.file-preview-thumb{
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  display: block;
}
