:root {
  --blue-dark: #0d2a8c;
  --blue: #1a56e8;
  --blue-light: #3d7bff;
  --blue-soft: #eaf0ff;
  --navy: #0f1a3d;
  --gray-text: #7a86a8;
  --bg: #f2f4fa;
  --card: #ffffff;
  --green: #16a34a;
  --red: #dc2626;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(15, 26, 61, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--navy);
}

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

/* ---------- App shell (mimics phone frame, centers on desktop) ---------- */
.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 90px;
}

/* ---------- Header ---------- */
.header {
  background: linear-gradient(160deg, var(--blue-dark) 0%, var(--blue) 55%, var(--blue-light) 100%);
  color: #fff;
  padding: 22px 20px 70px;
  border-radius: 0 0 28px 28px;
  position: relative;
}
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.menu-btn {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.date-pill {
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.greeting h1 {
  font-size: 22px;
  margin: 0 0 4px;
  font-weight: 800;
}
.greeting p {
  margin: 0;
  font-size: 14px;
  opacity: 0.85;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 58px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0,0,0,0.2);
  overflow: hidden;
  z-index: 30;
  min-width: 170px;
}
.dropdown-menu.open { display: block; }
.dropdown-menu-left { left: 20px; }
.dropdown-menu-right { right: 20px; }
.dropdown-menu a {
  display: block;
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}
.dropdown-menu a:not(:last-child) { border-bottom: 1px solid #f0f2f9; }
.dropdown-menu a.danger { color: var(--red); font-weight: 700; }
.dropdown-menu a.is-active { background: var(--blue-soft); color: var(--blue); }

/* ---------- Saldo card (overlaps header) ---------- */
.saldo-card {
  margin: -55px 20px 0;
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  border-radius: var(--radius-lg);
  padding: 22px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(26, 86, 232, 0.28);
}
.saldo-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  opacity: 0.85;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.saldo-amount {
  font-size: 30px;
  font-weight: 800;
  margin: 0 0 6px;
  word-break: break-all;
}
.saldo-sub {
  font-size: 13px;
  opacity: 0.85;
}
.saldo-icon {
  position: absolute;
  right: 16px;
  bottom: 14px;
  font-size: 54px;
  opacity: 0.9;
}

/* ---------- Content sections ---------- */
.content { padding: 20px; }

.stat-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}
.stat-body { flex: 1; min-width: 0; }
.stat-label {
  font-size: 11px;
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.stat-amount {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 4px;
}
.stat-change {
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
}
.stat-change.down { color: var(--red); }
.stat-chart { width: 90px; height: 44px; flex-shrink: 0; }

.section-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--navy);
  margin: 0 0 12px;
  text-transform: uppercase;
}

.list-card {
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
  transition: transform .15s ease;
}
.list-card:active { transform: scale(0.98); }

.aishcell-item { margin-bottom: 12px; }
.aishcell-item .list-card { margin-bottom: 0; }
.aishcell-item .list-card:has(+ .note-marquee) {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.note-marquee {
  background: linear-gradient(90deg, #fff4d6, #ffe9b3);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
  padding: 7px 0;
  box-shadow: var(--shadow);
  position: relative;
}
.note-marquee-track {
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  font-size: 12px;
  font-weight: 700;
  color: #92620a;
  animation: marquee-scroll 14s linear infinite;
}
@keyframes marquee-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
@media (prefers-reduced-motion: reduce) {
  .note-marquee-track {
    animation: none;
    padding-left: 12px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
.list-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}
.list-icon.muted {
  background: #e6ebf7;
  color: var(--gray-text);
}
.list-body { flex: 1; min-width: 0; }
.list-body h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}
.list-body .amount {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 800;
  color: var(--blue);
}
.progress-track {
  background: #e9edf7;
  height: 5px;
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  height: 100%;
  border-radius: 4px;
}
.pct-pill {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 10px;
  white-space: nowrap;
}
.chevron { color: #b7c0dc; font-size: 18px; }

.action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: #eef1f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn-edit { background: var(--blue-soft); }
.icon-btn-delete { background: #fdecec; }
.icon-btn-delete:hover { background: #fbd7d7; }
.icon-btn-edit:hover { background: #dbe6ff; }

.note-box {
  background: var(--blue-soft);
  color: var(--blue);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 6px;
  line-height: 1.5;
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: #fff;
  display: flex;
  justify-content: space-around;
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  box-shadow: 0 -6px 20px rgba(15,26,61,0.06);
  border-radius: 22px 22px 0 0;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-text);
  padding: 4px 10px;
}
.nav-item .icon { font-size: 19px; }
.nav-item.active { color: var(--blue); }

/* ---------- Generic page header (non-dashboard pages) ---------- */
.page-header {
  background: linear-gradient(160deg, var(--blue-dark) 0%, var(--blue) 55%, var(--blue-light) 100%);
  color: #fff;
  padding: 20px 20px 28px;
  border-radius: 0 0 28px 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.page-header a.back {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(255,255,255,0.14);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.page-header h1 { margin: 0; font-size: 18px; font-weight: 800; }

/* ---------- Forms ---------- */
.form-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
}
.form-card label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  margin: 14px 0 6px;
}
.form-card label:first-child { margin-top: 0; }
.form-card input,
.form-card select,
.form-card textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid #dde3f2;
  background: #f8f9fd;
  font-size: 14px;
  color: var(--navy);
}
.form-card input:focus,
.form-card select:focus,
.form-card textarea:focus {
  outline: 2px solid var(--blue-light);
  background: #fff;
}
.field-hint {
  font-size: 11.5px;
  color: var(--gray-text);
  margin: 6px 2px 0;
  line-height: 1.5;
}
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  margin-top: 20px;
  box-shadow: 0 10px 20px rgba(26,86,232,0.25);
}
.btn-primary:active { transform: translateY(1px); }
.btn-secondary {
  width: 100%;
  background: #fff;
  color: var(--blue);
  border: 1.5px solid var(--blue-light);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  margin-top: 10px;
}

.alert-error {
  background: #fdecec;
  color: var(--red);
  border: 1px solid #f6c7c7;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-success {
  background: #e9f9ef;
  color: var(--green);
  border: 1px solid #bfe9cd;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}

/* ---------- Login page ---------- */
.login-body {
  background:
    radial-gradient(120% 60% at 50% 0%, #2f66f5 0%, #0d2a8c 48%, #060f38 100%);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Dot-grid texture across whole screen, gives depth without noise */
.login-body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.09) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

/* Signal rings — the signature element: concentric arcs radiating like
   a cellular signal / pulsa top-up, echoing the Aishcell phone-credit identity */
.signal-rings {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 640px;
  height: 640px;
  pointer-events: none;
}
.signal-rings svg { width: 100%; height: 100%; }
.signal-rings circle {
  fill: none;
  stroke: rgba(255,255,255,0.16);
  stroke-width: 1.5;
}
.signal-rings .ring-pulse {
  transform-origin: center;
  animation: ringPulse 3.6s ease-out infinite;
}
.signal-rings .ring-pulse:nth-child(2) { animation-delay: 1.2s; }
.signal-rings .ring-pulse:nth-child(3) { animation-delay: 2.4s; }
@keyframes ringPulse {
  0%   { opacity: 0.55; transform: scale(0.7); }
  70%  { opacity: 0; }
  100% { opacity: 0; transform: scale(1.15); }
}
@media (prefers-reduced-motion: reduce) {
  .signal-rings .ring-pulse { animation: none; opacity: 0.35; }
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}

.brand-mark {
  text-align: center;
  margin-bottom: 26px;
}
.brand-mark .logo-badge {
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  border-radius: 22px;
  background: linear-gradient(145deg, #4f86ff 0%, #1a56e8 60%, #0d2a8c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 16px 32px rgba(13, 42, 140, 0.45),
    inset 0 1px 1px rgba(255,255,255,0.4);
}
.brand-mark .logo-badge svg { width: 34px; height: 34px; }
.brand-mark h1 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  margin: 0;
  letter-spacing: -0.01em;
}
.brand-mark p {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
}

.login-card {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(6px);
  border-radius: 26px;
  padding: 30px 26px 26px;
  width: 100%;
  max-width: 380px;
  box-shadow:
    0 24px 60px rgba(3, 10, 41, 0.35),
    0 2px 0 rgba(255,255,255,0.6) inset;
}

.field-group { margin-bottom: 16px; }
.field-group label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon-wrap svg {
  position: absolute;
  left: 13px;
  width: 17px;
  height: 17px;
  color: #9aa5c7;
  pointer-events: none;
}
.input-icon-wrap input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border-radius: 13px;
  border: 1.5px solid #e2e7f5;
  background: #f8f9fd;
  font-size: 14.5px;
  color: var(--navy);
  font-family: 'Inter', sans-serif;
}
.input-icon-wrap input:focus {
  outline: none;
  border-color: var(--blue-light);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(61, 123, 255, 0.12);
}
.toggle-pass {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  padding: 4px;
  display: flex;
  color: #9aa5c7;
}
.toggle-pass svg { position: static; width: 18px; height: 18px; }

.btn-login {
  width: 100%;
  background: linear-gradient(135deg, #2f66f5, #1a56e8);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 13px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Plus Jakarta Sans', sans-serif;
  margin-top: 6px;
  box-shadow: 0 12px 24px rgba(26,86,232,0.32);
  transition: transform .12s ease, box-shadow .12s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-login:hover { box-shadow: 0 14px 28px rgba(26,86,232,0.4); }
.btn-login:active { transform: translateY(1px) scale(0.99); }

.login-hint {
  text-align: center;
  font-size: 12px;
  color: var(--gray-text);
  margin-top: 20px;
}
.login-footer-note {
  text-align: center;
  font-size: 11.5px;
  color: rgba(255,255,255,0.45);
  margin-top: 22px;
  letter-spacing: 0.02em;
}

/* ---------- Table (riwayat / laporan) ---------- */
.table-wrap {
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  overflow-x: auto;
  margin-bottom: 16px;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 480px; }
th, td { text-align: left; padding: 12px 14px; }
thead th {
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tbody tr:not(:last-child) td { border-bottom: 1px solid #eef1f9; }
.badge-outlet {
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  white-space: nowrap;
}
.btn-del {
  background: #fdecec;
  color: var(--red);
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
}
.btn-edit {
  background: var(--blue-soft);
  color: var(--blue);
  border: none;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.daily-chart-wrap {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 16px 12px 12px;
  margin-bottom: 8px;
  overflow-x: auto;
}
.daily-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  min-height: 150px;
  width: max-content;
  min-width: 100%;
}
.daily-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 30px;
  flex-shrink: 0;
}
.daily-value {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 4px;
  white-space: nowrap;
}
.daily-bar {
  width: 14px;
  background: linear-gradient(180deg, #3d7bff, #1a56e8);
  border-radius: 3px 3px 0 0;
}
.daily-bar.empty {
  background: #e9edf7;
}
.daily-day {
  font-size: 9.5px;
  color: var(--gray-text);
  margin-top: 6px;
  font-weight: 600;
}

.filter-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.filter-select {
  width: 100%;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #dde3f2;
  background: #fff;
  font-size: 13px;
  color: var(--navy);
}
.filter-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.filter-date-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-text);
  margin-bottom: 4px;
}
.filter-date-field input {
  width: 100%;
  padding: 11px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #dde3f2;
  background: #fff;
  font-size: 13px;
  color: var(--navy);
}

.filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.filter-bar select, .filter-bar input {
  flex: 1;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #dde3f2;
  background: #fff;
  font-size: 13px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--gray-text);
}
.empty-state .icon { font-size: 40px; margin-bottom: 10px; }

@media (min-width: 481px) {
  .app { box-shadow: 0 0 60px rgba(0,0,0,0.08); }
}
