* { box-sizing: border-box; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { margin: 0; background: #f3f4f6; color: #111827; }
#app { max-width: 1200px; margin: 0 auto; padding: 8px; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; }
.topbar h1 { font-size: 18px; margin: 0; }
#user-info { font-size: 13px; color: #4b5563; }

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

.card {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  margin: 8px 0;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.card-login {
  max-width: 320px;
  margin: 40px auto;
}

label { display: block; margin-bottom: 8px; font-size: 14px; }
input, select, textarea {
  width: 100%;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  font-size: 14px;
}
button {
  border: none;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 14px;
  cursor: pointer;
  background: #2563eb;
  color: #fff;
}
button.small { font-size: 12px; padding: 4px 6px; }
button.secondary { background: #6b7280; }
button.danger { background: #b91c1c; }

.error { color: #b91c1c; font-size: 13px; margin-top: 4px; }
.hint { font-size: 12px; color: #6b7280; }

.tabs { display: flex; gap: 4px; margin: 8px 0; }
.tab-btn {
  flex: 1;
  background: #e5e7eb;
  color: #111827;
}
.tab-btn.active {
  background: #2563eb;
  color: #fff;
}

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

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }

#pelanggan-container, #paket-container, #laporan-detail {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Pelanggan card */
.pelanggan-card {
  background: #fff;
  border-radius: 8px;
  padding: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.pelanggan-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 4px;
}
.pelanggan-body {
  font-size: 12px;
  color: #374151;
  margin-bottom: 4px;
}
.pelanggan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Status badge */
.badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 11px;
}
.badge-belum { background: #fee2e2; color: #b91c1c; }
.badge-jt { background: #ffedd5; color: #c2410c; }
.badge-p1, .badge-p2 { background: #fef9c3; color: #a16207; }
.badge-isolir { background: #fee2e2; color: #b91c1c; }
.badge-lunas { background: #dcfce7; color: #166534; }

/* Modal */
#modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 40;
}
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.hidden { display: none; }
.modal-content {
  background: #fff;
  border-radius: 8px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 10px 25px rgba(0,0,0,.2);
}
.modal-header, .modal-footer {
  padding: 8px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-footer {
  border-top: 1px solid #e5e7eb;
  border-bottom: none;
  justify-content: flex-end;
  gap: 6px;
}
.modal-body { padding: 8px; }

@media (min-width: 900px) {
  #pelanggan-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 8px;
  }
}