/* ============================================================
   IURAN KELAS 1B - STYLE.CSS
   Tema: gradasi ungu tua ala fintech modern, kartu putih melayang,
   navbar pill mengambang dengan ikon bubble aktif
   ============================================================ */

:root {
  --primary: #6C3BFF;
  --dark-purple: #4B20C9;
  --light-purple: #8B63FF;
  --bg: #F6F4FC;
  --text: #222222;
  --muted: #8A8A9A;
  --white: #FFFFFF;
  --success: #16A34A;
  --success-bg: #DCFCE7;
  --warning: #F59E0B;
  --warning-bg: #FEF3C7;
  --info: #3B82F6;
  --info-bg: #DBEAFE;
  --danger: #EF4444;
  --danger-bg: #FEE2E2;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow: 0 4px 16px rgba(76, 32, 201, 0.08);
  --shadow-lg: 0 10px 30px rgba(76, 32, 201, 0.15);
  --app-gradient: linear-gradient(165deg, #7B4CFF 0%, #5A28D6 40%, #2E1063 100%);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #E9E5F7;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------- Mobile-only container ---------- */
.app-shell {
  max-width: 430px;
  min-width: 320px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  background: var(--app-gradient);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,0.12);
}

@media (min-width: 431px) {
  body { background: #DCD5F0; padding: 20px 0; }
  .app-shell { height: calc(100vh - 40px); height: calc(100dvh - 40px); border-radius: 28px; overflow: hidden; }
}

.app-content {
  flex: 1 1 auto;
  min-height: 0;
  padding: 16px 16px 6px 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------- Splash screen ---------- */
.splash-screen {
  background: transparent;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--white);
  text-align: center;
  padding: 24px;
}
.splash-icon {
  width: 96px; height: 96px;
  background: rgba(255,255,255,0.15);
  border-radius: 26px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  font-size: 40px;
}
.splash-screen h1 { font-size: 22px; font-weight: 700; margin: 6px 0; }
.splash-screen p { font-size: 13px; opacity: 0.85; max-width: 260px; }
.splash-loader {
  margin-top: 40px;
  width: 140px; height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 4px;
  overflow: hidden;
}
.splash-loader span {
  display: block; height: 100%; width: 40%;
  background: var(--white);
  border-radius: 4px;
  animation: loadbar 1.1s ease-in-out infinite;
}
@keyframes loadbar {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

/* ---------- Login screen ---------- */
.login-wrap {
  height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding: 32px 24px;
  background: transparent;
  overflow-y: auto;
}
.login-logo {
  width: 64px; height: 64px; border-radius: 18px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 26px; margin-bottom: 18px;
}
.login-wrap h2 { margin: 0 0 4px 0; font-size: 22px; color: var(--white); }
.login-wrap .sub { color: rgba(255,255,255,0.75); font-size: 13px; margin-bottom: 24px; }
.login-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  box-shadow: 0 20px 50px rgba(20,5,60,0.35);
}

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.field .input-wrap { position: relative; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid #E3DEF5;
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.field .toggle-pass {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: 16px; background: none; border: none; padding: 4px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 14px;
  background: linear-gradient(135deg, var(--primary), var(--dark-purple));
  color: var(--white);
  box-shadow: 0 6px 16px rgba(108,59,255,0.35);
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.btn-outline {
  background: var(--white);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  box-shadow: none;
}
.btn-sm { padding: 9px 14px; font-size: 13px; width: auto; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-danger { background: linear-gradient(135deg, #F87171, var(--danger)); }
.btn-muted { background: #EDEAF7; color: var(--dark-purple); box-shadow: none; }

.login-error {
  background: var(--danger-bg); color: #B91C1C;
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 16px;
}
.login-footer { text-align: center; margin-top: 22px; }
.login-footer a { color: var(--white); font-size: 13px; font-weight: 600; text-decoration: underline; }
.login-copy { text-align: center; color: rgba(255,255,255,0.7); font-size: 11px; margin-top: 40px; }

/* ---------- Top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 2px 14px 2px;
  background: transparent;
}
.topbar .greet h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--white); }
.topbar .greet span.sub { font-size: 12px; color: rgba(255,255,255,0.7); }
.topbar-back {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 2px 10px 2px;
}
.topbar-back .icon-btn { font-size: 20px; }
.topbar-back h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--white); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--light-purple), var(--dark-purple));
  border: 2px solid rgba(255,255,255,0.55);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 14px;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--white); color: var(--dark-purple);
  border: none; font-size: 16px; box-shadow: 0 4px 14px rgba(20,5,60,0.25);
  position: relative;
}
.icon-btn .dot {
  position: absolute; top: 6px; right: 7px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
  border: 2px solid var(--white);
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--dark-purple) 100%);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 16px 40px rgba(15,3,45,0.45);
}
.card-hero .label { font-size: 12px; opacity: 0.85; }
.card-hero .amount { font-size: 26px; font-weight: 800; margin: 4px 0 12px 0; }
.hero-split { display: flex; gap: 12px; }
.hero-split .box {
  flex: 1; background: rgba(255,255,255,0.15); border-radius: 12px; padding: 10px 12px;
}
.hero-split .box .t { font-size: 11px; opacity: 0.85; }
.hero-split .box .v { font-size: 15px; font-weight: 700; margin-top: 2px; }

.card-title {
  font-size: 14px; font-weight: 700; margin: 0 0 12px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.card-title .link { font-size: 12px; color: var(--primary); font-weight: 600; }

.list-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #F0EDFA;
}
.list-row:last-child { border-bottom: none; }
.list-row .left .name { font-weight: 700; font-size: 13.5px; }
.list-row .left .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.list-row .right { text-align: right; }
.list-row .right .amt { font-weight: 700; font-size: 13.5px; }

/* Item menu (Menu Admin/Orang Tua) dengan ikon bubble */
.menu-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 2px; border-bottom: 1px solid #F0EDFA;
}
.menu-row:last-child { border-bottom: none; }
.menu-row .menu-ic {
  width: 36px; height: 36px; border-radius: 11px; flex-shrink: 0;
  background: #EEEAFB; color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.menu-row .menu-ic svg { width: 18px; height: 18px; }
.menu-row .menu-label { font-weight: 700; font-size: 13.5px; color: var(--text); }

.badge {
  display: inline-block; font-size: 10.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 20px; letter-spacing: 0.2px;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: #B45309; }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-muted { background: #EDEAF7; color: var(--muted); }

/* Stat grid (admin dashboard) */
.stat-grid { display: flex; gap: 12px; margin-bottom: 14px; }
.stat-box {
  flex: 1; background: var(--white); border-radius: var(--radius-md);
  padding: 14px; text-align: center; box-shadow: var(--shadow);
}
.stat-box .num { font-size: 20px; font-weight: 800; color: var(--dark-purple); }
.stat-box .lbl { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Donut progress (SVG based, used in dashboard) */
.donut-wrap { position: relative; width: 84px; height: 84px; }
.donut-wrap .pct {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; color: var(--dark-purple);
}

.progress-row { margin-bottom: 12px; }
.progress-row .top { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; }
.progress-bar { height: 8px; background: #EDEAF7; border-radius: 8px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; border-radius: 8px; background: linear-gradient(90deg, var(--primary), var(--light-purple)); }

/* ---------- Bottom Navigation (floating pill, ikon bubble aktif) ---------- */
.bottom-nav {
  flex: 0 0 auto;
  margin: 0 14px calc(14px + env(safe-area-inset-bottom, 0px)) 14px;
  background: var(--white);
  display: flex;
  border-radius: 26px;
  box-shadow: 0 14px 34px rgba(15,3,45,0.35);
  padding: 8px 6px;
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 10px; font-weight: 600; padding: 6px 2px;
  border-radius: 18px;
  transition: color .15s;
}
.bottom-nav a .ic {
  width: 34px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  transition: background .18s, box-shadow .18s;
}
.bottom-nav a .ic svg { width: 20px; height: 20px; }
.bottom-nav a.active { color: var(--dark-purple); }
.bottom-nav a.active .ic {
  background: linear-gradient(135deg, var(--primary), var(--dark-purple));
  box-shadow: 0 6px 14px rgba(108,59,255,0.45);
  color: var(--white);
}

/* ---------- Forms / inputs section ---------- */
.section-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; margin: 18px 0 10px 0; }
.select-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--white); border: 1.5px solid #E3DEF5;
  padding: 10px 14px; border-radius: 12px; font-size: 13px; font-weight: 600;
  width: 100%; justify-content: space-between; margin-bottom: 14px;
}

/* Toggle switch (settings screen) */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 0; border-bottom: 1px solid #F0EDFA;
}
.toggle-row:last-child { border-bottom: none; }
.toggle-row .txt { font-size: 13.5px; font-weight: 600; max-width: 75%; }
.switch { position: relative; display: inline-block; width: 44px; height: 25px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background-color: #D9D4EC; border-radius: 30px; transition: .2s;
}
.switch .slider:before {
  position: absolute; content: ""; height: 19px; width: 19px; left: 3px; bottom: 3px;
  background-color: white; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background-color: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(19px); }

/* Table for reports */
.table-wrap { overflow-x: auto; }
table.simple { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.simple th { text-align: left; color: var(--muted); font-weight: 700; padding: 8px 6px; border-bottom: 2px solid #EEEAF9; white-space: nowrap; }
table.simple td { padding: 9px 6px; border-bottom: 1px solid #F3F0FA; white-space: nowrap; }

.empty-state { text-align: center; padding: 34px 14px; color: var(--muted); background: var(--white); border-radius: var(--radius-lg); }
.empty-state .ic { font-size: 40px; margin-bottom: 10px; }

.alert { padding: 12px 14px; border-radius: 12px; font-size: 13px; margin-bottom: 14px; }
.alert-success { background: var(--success-bg); color: #15803D; }
.alert-error { background: var(--danger-bg); color: #B91C1C; }

.fab {
  position: fixed; bottom: 90px; right: calc(50% - 195px + 20px);
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--dark-purple));
  color: white; font-size: 24px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(108,59,255,0.4); border: none; z-index: 20;
}
@media (max-width: 430px) { .fab { right: 20px; } }

.chip-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 4px; }
.chip-tabs a {
  padding: 8px 16px; border-radius: 20px; font-size: 12.5px; font-weight: 700;
  background: var(--white); color: var(--muted); white-space: nowrap; box-shadow: var(--shadow);
}
.chip-tabs a.active { background: linear-gradient(135deg, var(--primary), var(--dark-purple)); color: white; }

.search-box { position: relative; margin-bottom: 14px; }
.search-box input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  border: none;
  border-radius: 16px;
  background: var(--white);
  font-size: 14px;
  color: var(--text);
  outline: none;
  box-shadow: 0 8px 22px rgba(20,5,60,0.18);
}
.search-box input::placeholder { color: var(--muted); }
.search-box .ic {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  color: var(--muted); display: flex; align-items: center; pointer-events: none;
}
.search-box .ic svg { width: 18px; height: 18px; }

.avatar-sm { width: 42px; height: 42px; border-radius: 12px; background: #EDEAF7; display:flex; align-items:center; justify-content:center; color: var(--dark-purple); font-weight: 800; }

.two-col { display: flex; gap: 10px; }
.two-col .field { flex: 1; }

.divider { height: 1px; background: #EEEAF9; margin: 14px 0; }

.footer-note { font-size: 11px; color: var(--muted); text-align: center; margin-top: 6px; }

::-webkit-scrollbar { width: 0; height: 0; }
