:root {
  --bg: #161a26;
  --surface-1: #1f2433;
  --surface-2: #262c3f;
  --border: #333a4f;
  --border-strong: #454d66;
  --text-primary: #f2efe9;
  --text-secondary: #a9afc3;
  --text-muted: #767e96;
  --gold: #e8a33d;
  --gold-text: #4a3111;
  --teal: #4fb3a9;
  --teal-text: #0c2b28;
  --danger: #e2574c;
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  padding-bottom: 2rem;
}

.topbar {
  padding: 28px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--gold-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
}

.brand-tag {
  margin: 6px 0 0 46px;
  color: var(--text-secondary);
  font-size: 14px;
}

.tabnav {
  display: flex;
  gap: 6px;
  padding: 16px 20px 0;
  max-width: 480px;
  margin: 0 auto;
}

.tabbtn {
  flex: 1;
  padding: 10px 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.tabbtn.active {
  border-color: var(--gold);
  color: var(--text-primary);
}

main {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 20px;
}

.panel { display: none; }
.panel.active { display: block; }

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 14px;
}

.card h2 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 12px;
}

.label {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 8px;
}

.field-row {
  display: flex;
  gap: 10px;
}

.field { flex: 1; }

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

input[type="text"], input[type="number"] {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 10px 12px;
}

input:focus {
  outline: none;
  border-color: var(--gold);
}

.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-text {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
}

.btn {
  border-radius: var(--radius);
  padding: 10px 16px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--border-strong);
}

.btn-primary {
  background: var(--gold);
  color: var(--gold-text);
  border-color: var(--gold);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
}

.leaflet-holder {
  width: 100%;
  height: 220px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-2);
}

.leaflet-holder-lg { height: 260px; }

.loc-note {
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 0 0;
}

.marker-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--teal);
  border: 2px solid var(--surface-1);
}

.marker-dot.off {
  background: var(--border-strong);
}

.marker-pulse {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  position: relative;
}

.marker-pulse::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: var(--teal);
  opacity: 0.3;
  animation: pulse 1.6s ease-out infinite;
}

@keyframes pulse {
  0% { transform: scale(0.4); opacity: 0.5; }
  100% { transform: scale(1.6); opacity: 0; }
}

.list-plain p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 6px;
}

.error-text {
  font-size: 13px;
  color: var(--danger);
  margin: 8px 0 0;
}

.hidden { display: none; }

.total-text {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  margin: 10px 0 8px;
}

.report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}

.month-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 10px;
}

.month-select:focus { outline: none; border-color: var(--gold); }

.row-amount {
  font-family: var(--font-mono);
  font-size: 14px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.stat-card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.stat-number {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  margin: 0;
}

.list-rows {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.row:last-child { border-bottom: none; }

.row-name { font-size: 14px; }

.row-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-active {
  background: rgba(79, 179, 169, 0.18);
  color: var(--teal);
}

.badge-off {
  background: rgba(169, 175, 195, 0.12);
  color: var(--text-muted);
}

.cari-list .card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cari-empty {
  color: var(--text-secondary);
  font-size: 14px;
  padding: 8px 0;
}

.foot {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 12px;
}
