:root {
  --font-main: Arial, Helvetica, sans-serif;
}

/* Mode Malam: Dominan Biru & Ungu Nuansa Hacker Modern, Kontras Tinggi */
html[data-theme="dark"] {
  --bg: #060916;
  --bg-elev: #0c1228;
  --bg-card: #101836;
  --bg-input: #0a1024;
  --border: #2a3b75;
  --border-glow: #6d28d9;
  --text: #f1f5ff;
  --text-muted: #b4c2e6;
  --blue: #3b82f6;
  --purple: #8b5cf6;
  --accent-grad: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --green: #34d399;
  --red: #fb7185;
  --grid-line: rgba(59, 130, 246, 0.08);
  --shadow: 0 10px 30px rgba(4, 8, 24, 0.55);
  --row-hover: rgba(99, 102, 241, 0.12);
}

/* Mode Siang: Bersih, Cerah, Dominan Biru & Ungu, Sangat Mudah Dibaca */
html[data-theme="light"] {
  --bg: #f1f5ff;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #f8faff;
  --border: #cbd5f0;
  --border-glow: #7c3aed;
  --text: #0f172a;
  --text-muted: #475569;
  --blue: #1d4ed8;
  --purple: #6d28d9;
  --accent-grad: linear-gradient(135deg, #1d4ed8 0%, #6d28d9 100%);
  --green: #047857;
  --red: #be123c;
  --grid-line: rgba(37, 99, 235, 0.05);
  --shadow: 0 6px 20px rgba(30, 41, 90, 0.08);
  --row-hover: rgba(59, 130, 246, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.5;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  position: relative;
}

/* Latar grid halus nuansa modern/hacker tanpa mengganggu keterbacaan */
.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 36px 36px;
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 18px;
  position: relative;
  z-index: 1;
}

/* Header */
.topbar {
  background: var(--bg-elev);
  border-bottom: 2px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: var(--shadow);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.brand-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-grad);
  color: #ffffff;
  font-weight: bold;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(124, 58, 237, 0.45);
  flex-shrink: 0;
}

h1 {
  margin: 0;
  font-size: 22px;
  font-weight: bold;
}

h2 {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
}

h3 {
  margin: 0 0 10px 0;
  font-size: 17px;
}

.subtitle {
  margin: 2px 0 0 0;
  font-size: 14px;
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Tombol */
.btn {
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: bold;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.btn:hover {
  opacity: 0.92;
}

.btn:active {
  transform: scale(0.98);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 14px;
}

.btn-primary {
  background: var(--accent-grad);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
}

.btn-ghost {
  background: var(--bg-input);
  color: var(--text);
  border-color: var(--border);
}

.btn-danger {
  background: #be123c;
  color: #ffffff;
}

/* Konten Utama */
.main-content {
  padding-top: 24px;
  padding-bottom: 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow);
}

/* Ringkasan 3 Kartu */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.card-saldo {
  border: 2px solid var(--purple);
  background: linear-gradient(160deg, var(--bg-card) 55%, rgba(124, 58, 237, 0.16) 100%);
}

.card-masuk {
  border-top: 4px solid var(--green);
}

.card-keluar {
  border-top: 4px solid var(--red);
}

.card-label {
  font-size: 15px;
  font-weight: bold;
  color: var(--text-muted);
}

.card-value {
  font-size: 28px;
  font-weight: bold;
  margin: 8px 0 4px 0;
  letter-spacing: 0.2px;
}

.card-note {
  font-size: 13px;
  color: var(--text-muted);
}

.text-green {
  color: var(--green);
}

.text-red {
  color: var(--red);
}

/* Header Panel */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header.wrap {
  flex-wrap: wrap;
}

/* Form & Input */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.form-grid-2 {
  grid-template-columns: 2fr 1fr;
}

@media (max-width: 700px) {
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: bold;
  color: var(--text-muted);
}

input,
select {
  font-family: var(--font-main);
  font-size: 15px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  width: 100%;
}

input:focus,
select:focus {
  outline: 2px solid var(--blue);
  border-color: var(--purple);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.status-msg {
  font-size: 14px;
  font-weight: bold;
  color: var(--green);
}

.settings-box {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}

/* Grafik */
.legend {
  display: flex;
  gap: 16px;
  font-size: 14px;
  font-weight: bold;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

.dot-in {
  background: #3b82f6;
}

.dot-out {
  background: #8b5cf6;
}

.chart-box {
  width: 100%;
  overflow-x: auto;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  min-height: 180px;
  padding: 16px 8px 4px 8px;
  border-bottom: 1px solid var(--border);
}

.chart-group {
  flex: 1;
  min-width: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.chart-pair {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 130px;
}

.bar {
  width: 26px;
  border-radius: 6px 6px 0 0;
  min-height: 4px;
  transition: height 0.25s ease;
}

.bar-in {
  background: linear-gradient(180deg, #60a5fa, #2563eb);
}

.bar-out {
  background: linear-gradient(180deg, #a78bfa, #6d28d9);
}

.chart-label {
  font-size: 13px;
  font-weight: bold;
  color: var(--text-muted);
}

.chart-nums {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* Filter & Tabel */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.filters select,
.filters input {
  width: auto;
  min-width: 155px;
}

.table-wrap {
  overflow-x: auto;
}

.tx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.tx-table th {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 2px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
  white-space: nowrap;
}

.tx-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.tx-table tbody tr:hover {
  background: var(--row-hover);
}

.right {
  text-align: right !important;
  white-space: nowrap;
}

.center {
  text-align: center !important;
  white-space: nowrap;
}

.badge-kat {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: bold;
  background: rgba(59, 130, 246, 0.16);
  color: var(--text);
  border: 1px solid var(--border);
}

.empty {
  text-align: center;
  padding: 28px !important;
  color: var(--text-muted);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 6, 18, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 50;
}

.modal-card {
  background: var(--bg-card);
  border: 2px solid var(--purple);
  border-radius: 14px;
  padding: 22px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow);
}

.modal-wide {
  max-width: 720px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.error-text {
  color: var(--red);
  font-size: 14px;
  font-weight: bold;
  margin-top: 8px;
  min-height: 20px;
}

.proof-content img {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.proof-content iframe {
  width: 100%;
  height: 70vh;
  border: none;
  border-radius: 8px;
}

.footer {
  text-align: center;
  padding: 18px 0 28px 0;
  font-size: 13px;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.hidden {
  display: none !important;
}
