:root {
  --bg: #f5f4f0;
  --bg2: #eeeee9;
  --surface: #ffffff;
  --card: #ffffff;
  --card-hover: #fafaf9;
  --border: #e4e4e7;
  --border-hover: #d4d4d8;
  --accent: #e54e09;
  --accent-soft: rgba(229, 78, 9, 0.08);
  --green: #16a34a;
  --green-soft: rgba(22, 163, 74, 0.08);
  --blue: #2563eb;
  --blue-soft: rgba(37, 99, 235, 0.08);
  --yellow: #ca8a04;
  --yellow-soft: rgba(202, 138, 4, 0.08);
  --purple: #7c3aed;
  --purple-soft: rgba(124, 58, 237, 0.08);
  --ink: #18181b;
  --sub: #71717a;
  --sub2: #a1a1aa;
  --mono: "IBM Plex Mono", monospace;
  --disp: "Space Grotesk", sans-serif;
  --body: "Inter", sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --sidebar-w: 240px;
}

[data-theme="dark"] {
  --bg: #0f0f0f;
  --bg2: #1a1a1a;
  --surface: #1e1e1e;
  --card: #1e1e1e;
  --card-hover: #252525;
  --border: #2e2e2e;
  --border-hover: #3e3e3e;
  --accent: #e54e09;
  --accent-soft: rgba(229, 78, 9, 0.12);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.12);
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.12);
  --yellow: #eab308;
  --yellow-soft: rgba(234, 179, 8, 0.12);
  --purple: #a78bfa;
  --purple-soft: rgba(167, 139, 250, 0.12);
  --ink: #f0f0f0;
  --sub: #a1a1aa;
  --sub2: #71717a;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ---- AUTH PAGE ---- */
.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 24px;
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}

.auth-brand {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 20px;
  text-align: center;
  margin-bottom: 4px;
}

.auth-brand .accent {
  color: var(--accent);
}

.auth-sub {
  text-align: center;
  font-size: 13px;
  color: var(--sub);
  margin-bottom: 28px;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: var(--surface);
  color: var(--sub);
  transition: all 0.2s;
}

.auth-tab.active {
  background: var(--accent);
  color: #fff;
}

.auth-error {
  background: var(--accent-soft);
  border: 1px solid rgba(229, 78, 9, 0.2);
  color: var(--accent);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-bottom: 16px;
  display: none;
}

/* ---- LAYOUT ---- */
.app-layout {
  display: flex;
  min-height: 100dvh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  font-family: var(--disp);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0 20px;
  margin-bottom: 4px;
}

.sidebar-brand .accent {
  color: var(--accent);
}

.sidebar-sub {
  font-size: 11px;
  color: var(--sub2);
  padding: 0 20px;
  margin-bottom: 24px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sub2);
  padding: 16px 20px 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--sub);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--body);
}

.nav-item:hover {
  background: var(--bg);
  color: var(--ink);
}

.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
}

.sidebar-user {
  font-size: 12px;
  color: var(--sub);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-logout {
  width: 100%;
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--body);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--sub);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 0 32px 60px;
  max-width: 1200px;
}

.mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}

.mobile-header .hamburger {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--ink);
  font-size: 18px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
}

/* ---- PAGE HEADER ---- */
.page-header {
  padding-top: 28px;
  margin-bottom: 28px;
}

.page-title {
  font-family: var(--disp);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.page-title .accent {
  color: var(--accent);
}

.page-sub {
  font-size: 13px;
  color: var(--sub);
}

/* ---- CONNECTION STATUS ---- */
.conn-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--sub);
  margin-bottom: 20px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ccc;
}

.status-dot.live {
  background: #4caf50;
}

/* ---- DASHBOARD CARDS ---- */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.dash-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  transition: box-shadow 0.2s;
}

.dash-card:hover {
  box-shadow: var(--shadow-sm);
}

.dash-card.green .dash-label::before {
  background: var(--green);
}
.dash-card.blue .dash-label::before {
  background: var(--blue);
}
.dash-card.accent .dash-label::before {
  background: var(--accent);
}
.dash-card.yellow .dash-label::before {
  background: var(--yellow);
}
.dash-card.purple .dash-label::before {
  background: var(--purple);
}

.dash-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sub);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.dash-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dash-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.dash-sub {
  font-size: 11px;
  color: var(--sub2);
  margin-top: 4px;
}

/* ---- PERIOD BAR ---- */
.period-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.period-bar label {
  font-size: 11px;
  font-weight: 600;
  color: var(--sub);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.period-bar select,
select.form-select {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 8px 12px;
  font-family: var(--body);
  font-size: 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.period-bar select:focus,
select.form-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---- CHARTS ---- */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.chart-card.full {
  grid-column: 1 / -1;
}

.chart-title {
  font-family: var(--disp);
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--ink);
}

.chart-card canvas {
  width: 100% !important;
  max-height: 280px;
}

/* ---- SECTION ---- */
.section-header {
  border-top: 1px solid var(--border);
  margin-bottom: 20px;
  padding-top: 20px;
}

.section-title {
  font-family: var(--disp);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

/* ---- FORMS ---- */
.input-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.form-title {
  font-family: var(--disp);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 18px;
}

.form-title.green-text {
  color: var(--green);
}
.form-title.red-text {
  color: var(--accent);
}
.form-title.blue-text {
  color: var(--blue);
}
.form-title.purple-text {
  color: var(--purple);
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--sub);
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 9px 12px;
  font-family: var(--body);
  font-size: 13px;
  border-radius: var(--radius-sm);
  transition: border-color 0.2s;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
}

.field textarea {
  resize: vertical;
  min-height: 48px;
}

.field .file-input-wrap {
  position: relative;
}

.field .file-input-wrap input[type="file"] {
  padding: 8px;
  font-size: 12px;
}

.field .file-input-wrap input[type="file"]::file-selector-button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--sub);
  padding: 5px 12px;
  font-family: var(--body);
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 8px;
  transition: all 0.2s;
}

.field .file-input-wrap input[type="file"]::file-selector-button:hover {
  border-color: var(--accent);
  color: var(--ink);
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.field-check input[type="checkbox"] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.field-check label {
  font-size: 12px;
  color: var(--sub);
  margin: 0;
}

.bukti-preview {
  margin-top: 6px;
  max-width: 180px;
  max-height: 100px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: none;
}

.btn-submit {
  width: 100%;
  padding: 11px;
  font-family: var(--body);
  font-size: 13px;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  color: #fff;
  margin-top: 4px;
}

.btn-submit.green {
  background: var(--green);
}
.btn-submit.red {
  background: var(--accent);
}
.btn-submit.blue {
  background: var(--blue);
}
.btn-submit.purple {
  background: var(--purple);
}
.btn-submit:hover {
  opacity: 0.88;
}
.btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  padding: 8px 16px;
  font-family: var(--body);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--sub);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--sub2);
  padding: 5px 8px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--accent-soft);
  border-color: rgba(229, 78, 9, 0.3);
  color: var(--accent);
}

.btn-icon.green:hover {
  background: var(--green-soft);
  border-color: rgba(22, 163, 74, 0.3);
  color: var(--green);
}

.btn-icon.blue:hover {
  background: var(--blue-soft);
  border-color: rgba(37, 99, 235, 0.3);
  color: var(--blue);
}

/* ---- TABLE ---- */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 32px;
}

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

.table-title {
  font-family: var(--disp);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.table-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 7px 12px;
  font-family: var(--body);
  font-size: 12px;
  border-radius: 100px;
  width: 180px;
  transition: border-color 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-filter {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--sub);
  padding: 6px 14px;
  font-family: var(--body);
  font-size: 11px;
  font-weight: 600;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-filter:hover,
.btn-filter.active {
  background: var(--accent-soft);
  border-color: rgba(229, 78, 9, 0.3);
  color: var(--accent);
}

.tx-table {
  width: 100%;
  border-collapse: collapse;
}

.tx-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sub2);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

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

.tx-table tr:last-child td {
  border-bottom: none;
}
.tx-table tr:hover td {
  background: rgba(128, 128, 128, 0.03);
}

.tx-type {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
  display: inline-block;
}

.tx-type.pemasukan {
  background: var(--green-soft);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.tx-type.pengeluaran {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(229, 78, 9, 0.25);
}

.tx-type.transfer {
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.tx-amount {
  font-family: var(--mono);
  font-weight: 600;
}
.tx-amount.positive {
  color: var(--green);
}
.tx-amount.negative {
  color: var(--accent);
}

.tx-date {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--sub);
}

.tx-bukti {
  color: var(--blue);
  font-size: 11px;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
}

.tx-bukti:hover {
  text-decoration: underline;
}

.tx-actions {
  display: flex;
  gap: 6px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--sub2);
  font-size: 13px;
}

/* ---- PAGINATION ---- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.pagination button {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--sub);
  padding: 6px 12px;
  font-family: var(--body);
  font-size: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination .page-info {
  font-size: 12px;
  color: var(--sub);
  font-family: var(--mono);
}

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.modal h3 {
  font-family: var(--disp);
  font-size: 16px;
  margin-bottom: 16px;
}

.modal img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
}

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

.modal-close {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--body);
}

.modal-close:hover {
  border-color: var(--accent);
}

/* ---- TOAST ---- */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 13px;
  color: var(--ink);
  box-shadow: var(--shadow-md);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  max-width: 340px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success {
  border-left: 3px solid var(--green);
}
.toast.error {
  border-left: 3px solid var(--accent);
}

/* ---- BUDGET ---- */
.budget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.budget-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.budget-category {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}

.budget-bar-wrap {
  background: var(--bg2);
  border-radius: 100px;
  height: 8px;
  overflow: hidden;
  margin-bottom: 8px;
}

.budget-bar {
  height: 100%;
  border-radius: 100px;
  background: var(--green);
  transition: width 0.4s ease;
}

.budget-bar.warning {
  background: var(--yellow);
}
.budget-bar.danger {
  background: var(--accent);
}

.budget-info {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--sub);
  font-family: var(--mono);
}

/* ---- GOALS ---- */
.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.goal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.goal-name {
  font-family: var(--disp);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
}

.goal-ring {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 12px;
}

.goal-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.goal-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}

.goal-ring-fill {
  fill: none;
  stroke: var(--green);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.goal-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
}

.goal-detail {
  font-size: 11px;
  color: var(--sub);
  margin-bottom: 4px;
  font-family: var(--mono);
}

.goal-deadline {
  font-size: 11px;
  color: var(--sub2);
}

.goal-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 12px;
}

/* ---- ACCOUNTS ---- */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 32px;
}

.account-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: default;
}

.account-name {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}

.account-type {
  font-size: 10px;
  color: var(--sub2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}

.account-balance {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
}

.account-balance.positive {
  color: var(--green);
}
.account-balance.negative {
  color: var(--accent);
}

.account-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

/* ---- REPORTS ---- */
.report-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.report-title {
  font-family: var(--disp);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
}

.report-table th,
.report-table td {
  padding: 8px 12px;
  font-size: 13px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.report-table th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sub2);
  background: var(--surface);
}

.report-table tr.subtotal td {
  font-weight: 600;
  border-top: 2px solid var(--border);
}

.report-table tr.grand-total td {
  font-weight: 700;
  font-size: 14px;
  border-top: 2px solid var(--ink);
}

.report-table .mono {
  font-family: var(--mono);
}

.yoy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.yoy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.yoy-label {
  font-size: 11px;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.yoy-value {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
}

.yoy-change {
  font-size: 12px;
  font-family: var(--mono);
  margin-top: 4px;
}

.yoy-change.up {
  color: var(--green);
}
.yoy-change.down {
  color: var(--accent);
}

/* ---- SETTINGS ---- */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.settings-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.settings-card-title {
  font-family: var(--disp);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
}

.toggle-label {
  font-size: 13px;
}

.toggle {
  position: relative;
  width: 44px;
  height: 24px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 100px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* ---- CATEGORY TAGS ---- */
.cat-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.cat-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 5px 12px;
  font-size: 12px;
}

.cat-tag .remove {
  cursor: pointer;
  color: var(--sub2);
  font-weight: 700;
  transition: color 0.2s;
}

.cat-tag .remove:hover {
  color: var(--accent);
}

.cat-add-row {
  display: flex;
  gap: 8px;
}

.cat-add-row input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 8px 12px;
  font-family: var(--body);
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.cat-add-row input:focus {
  outline: none;
  border-color: var(--accent);
}

/* ---- EXPORT BTNS ---- */
.export-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

/* ---- RECURRING BADGE ---- */
.recurring-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--purple-soft);
  color: var(--purple);
  border: 1px solid rgba(124, 58, 237, 0.25);
  margin-left: 6px;
}

/* ---- PAGE SECTIONS ---- */
.page-section {
  display: none;
}
.page-section.active {
  display: block;
}

/* ---- HIDDEN ---- */
.hidden {
  display: none !important;
}

/* ---- LOADING ---- */
.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.open {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 0 20px 40px;
  }

  .mobile-header {
    display: flex;
  }

  .charts-grid,
  .settings-grid,
  .yoy-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .input-section {
    grid-template-columns: 1fr;
  }

  .dash-grid {
    grid-template-columns: 1fr 1fr;
  }

  .tx-table th:nth-child(4),
  .tx-table td:nth-child(4) {
    display: none;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .dash-grid {
    grid-template-columns: 1fr;
  }

  .main-content {
    padding: 0 16px 40px;
  }

  .search-input {
    width: 100%;
  }
}
