
:root {
  color-scheme: light;
  --bg: #F5F7FB;
  --surface: #FFFFFF;
  --text: #17243B;
  --muted: #8290A6;
  --border: #E8EDF4;
  --accent: #5755D9;
  --accent-soft: #EEEDFF;
  --shadow: 0 10px 35px rgba(25, 38, 68, .04);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0D1422;
  --surface: #172132;
  --text: #F3F6FC;
  --muted: #A0AEC1;
  --border: #2B3749;
  --accent: #A29BFF;
  --accent-soft: #302D50;
  --shadow: 0 10px 35px rgba(0, 0, 0, .12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.5;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, h3, h4, p {
  margin-top: 0;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* LAYOUT */

.app-shell {
  display: grid;
  grid-template-columns: 255px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 29px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 3px 9px 49px;
}

.brand img {
  width: 43px;
  height: 43px;
}

.brand strong {
  display: block;
  font-size: 16px;
  letter-spacing: -.5px;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.nav-caption {
  margin: 0 14px 15px;
  font-size: 10px;
  font-weight: 750;
  color: var(--muted);
  letter-spacing: 1.3px;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 32px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 13px 15px;
  border-radius: 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  transition: background .2s, color .2s;
}

.nav-item:hover,
.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.sidebar-footer {
  margin-top: auto;
  font-size: 11px;
  color: var(--muted);
  padding: 15px;
  border-top: 1px solid var(--border);
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #27C59A;
  border-radius: 50%;
  margin-right: 6px;
}

.main-area {
  width: 100%;
  max-width: 1600px;
  min-width: 0;
  margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 54px) 60px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 83px;
  border-bottom: 1px solid var(--border);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-left small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 1.3px;
  font-weight: 700;
}

.topbar-left strong {
  font-size: 17px;
}

.mobile-logo {
  display: none;
}

.icon-button {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  color: var(--text);
}

main {
  padding-top: 32px;
}

.view[hidden] {
  display: none !important;
}

/* BERANDA */

.page-intro {
  margin-bottom: 30px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 9px;
}

.page-intro h1 {
  font-size: clamp(26px, 3.4vw, 38px);
  letter-spacing: -1.3px;
  margin-bottom: 9px;
}

.page-intro > p:last-child,
.section-heading p {
  color: var(--muted);
  font-size: 14px;
}

.balance-card {
  min-height: 220px;
  background: linear-gradient(125deg, #242D79, #6458DC);
  border-radius: 23px;
  padding: 32px;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  overflow: hidden;
  position: relative;
}

.balance-card::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  border: 60px solid rgba(255,255,255,.045);
  top: -160px;
  right: -110px;
  pointer-events: none;
}

.balance-label {
  opacity: .8;
  font-size: 13px;
}

.balance-card h2 {
  font-size: clamp(32px, 4vw, 46px);
  margin: 10px 0;
  letter-spacing: -1.5px;
  overflow-wrap: anywhere;
}

.balance-card p {
  font-size: 12px;
  opacity: .75;
  margin-bottom: 0;
}

.hero-button,
.primary-button {
  border: none;
  background: white;
  color: #34328F;
  padding: 13px 19px;
  border-radius: 11px;
  font-weight: 750;
  font-size: 12px;
  white-space: nowrap;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 17px;
  margin: 20px 0;
}

.summary-card,
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 17px;
}

.summary-card {
  padding: 22px;
  min-width: 0;
}

.summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 17px;
}

.money-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 18px;
}

.income {
  background: #E5F9F0;
  color: #139D6C;
}

.expense {
  background: #FFF0F0;
  color: #DF6363;
}

.investment {
  background: #EBEEFF;
  color: #6360E8;
}

.summary-card strong {
  display: block;
  font-size: clamp(18px, 2vw, 24px);
  letter-spacing: -.7px;
  overflow-wrap: anywhere;
}

.summary-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 5px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 20px;
}

.panel {
  padding: 24px;
  min-width: 0;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-heading h3,
.settings-panel h3 {
  font-size: 15px;
  margin: 0;
}

.text-button {
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.empty-state,
.empty-page {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.empty-state {
  min-height: 240px;
}

.empty-page {
  min-height: 330px;
}

.empty-symbol {
  width: 58px;
  height: 58px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-size: 28px;
  margin-bottom: 18px;
}

.empty-state h4,
.empty-page h3 {
  font-size: 15px;
  margin-bottom: 7px;
}

.empty-state p,
.empty-page p {
  max-width: 330px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.quick-links {
  display: flex;
  flex-direction: column;
  margin-top: 15px;
}

.quick-links button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 17px 5px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}

.quick-links button:last-child {
  border-bottom: 0;
}

.quick-links button:hover {
  color: var(--accent);
}

/* HALAMAN & SETTINGS */

.section-heading {
  margin-bottom: 28px;
}

.section-heading h1 {
  font-size: 30px;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.secondary-button {
  background: var(--accent-soft);
  color: var(--accent);
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 700;
  margin-top: 10px;
}


.settings-stack {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

/* Database & Backup memenuhi lebar layar */
.settings-stack > .settings-panel:last-child {
  grid-column: 1 / -1;
}

/* Tablet dan smartphone */
@media (max-width: 1100px) {
  .settings-stack {
    grid-template-columns: minmax(0, 1fr);
  }

  .settings-stack > .settings-panel:last-child {
    grid-column: auto;
  }
}


.settings-panel {
  padding: 26px;
}

.settings-panel > p {
  color: var(--muted);
  font-size: 13px;
  margin: 9px 0 20px;
  line-height: 1.7;
}

#profileForm {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

#profileForm label {
  font-size: 12px;
  font-weight: 700;
}

#displayName {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 11px;
  outline-offset: 2px;
}

.primary-button {
  background: var(--accent);
  color: white;
  margin-top: 5px;
}

.form-status {
  min-height: 16px;
  font-size: 12px;
  color: var(--accent);
}

.theme-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.theme-selector button {
  padding: 14px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.theme-selector button.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.bottom-nav {
  display: none;
}

/* TABLET */

@media (max-width: 1050px) {
  .app-shell {
    grid-template-columns: 210px minmax(0,1fr);
  }

  .brand strong {
    font-size: 13px;
  }

  .summary-card {
    padding: 17px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }
}

/* MOBILE */

@media (max-width: 800px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main-area {
    padding: 0 20px 110px;
  }

  .mobile-logo {
    display: block;
    width: 36px;
    height: 36px;
  }

  .topbar {
    height: 73px;
  }

  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 8px 5px calc(8px + env(safe-area-inset-bottom));
  }

  .bottom-nav .nav-item {
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 9px 2px;
    border-radius: 10px;
    font-size: 9px;
    text-align: center;
    min-width: 0;
  }

  .bottom-nav .icon {
    width: 20px;
    height: 20px;
  }

  .balance-card {
    padding: 26px;
  }

  .summary-grid {
    gap: 11px;
  }
}

@media (max-width: 560px) {
  main {
    padding-top: 25px;
  }

  .page-intro {
    margin-bottom: 24px;
  }

  .balance-card {
    flex-direction: column;
    align-items: flex-start;
    min-height: 240px;
    gap: 30px;
  }

  .balance-card h2 {
    font-size: 37px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .summary-card {
    padding: 19px;
  }

  .summary-top {
    margin-bottom: 9px;
  }

  .summary-card strong {
    font-size: 24px;
  }

  .panel {
    padding: 20px;
  }
}

@media (max-width: 360px) {
  .main-area {
    padding-left: 14px;
    padding-right: 14px;
  }

  .bottom-nav .nav-item {
    font-size: 8px;
  }

  .balance-card h2 {
    font-size: 31px;
  }
}

/* PWA INSTALL BUTTON */

.install-button {
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 11px;
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 750;
  margin-left: auto;
  margin-right: 12px;
  white-space: nowrap;
  transition: background .2s, transform .2s;
}

.install-button:hover {
  transform: translateY(-1px);
}

.install-button[hidden] {
  display: none !important;
}

@media (max-width: 400px) {
  .install-button {
    font-size: 10px;
    padding: 10px;
    margin-right: 9px;
  }
}

/* DATABASE & BACKUP */

.db-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 25px;
}

.db-stats > div {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  min-width: 0;
}

.db-stats span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 7px;
}

.db-stats strong {
  display: block;
  font-size: 23px;
  color: var(--text);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.backup-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 20px 0;
}

.backup-button {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 12px;
  font-size: 12px;
  font-weight: 750;
  transition: transform .2s;
}

.backup-button:hover {
  transform: translateY(-2px);
}

.backup-button.export {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.backup-button.import {
  background: var(--accent-soft);
  color: var(--accent);
}

.danger-zone {
  margin-top: 27px;
  padding: 19px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.danger-zone h4 {
  font-size: 13px;
  margin: 0 0 6px;
  color: var(--text);
}

.danger-zone p {
  font-size: 11px;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

.delete-button {
  border: 1px solid #E96A6A;
  color: #E96A6A;
  background: transparent;
  padding: 11px 14px;
  border-radius: 10px;
  white-space: nowrap;
  font-weight: 700;
  font-size: 11px;
}

.delete-button:hover {
  background: rgba(233,106,106,.1);
}

.backup-button:disabled,
.delete-button:disabled {
  opacity: .5;
  cursor: wait;
}

.data-message {
  color: #16A085;
  font-size: 12px;
  line-height: 1.6;
  margin: 14px 0 0;
  min-height: 18px;
}

.data-message.is-error {
  color: #E96A6A;
}

@media (max-width: 560px) {
  .db-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .db-stats > div {
    padding: 14px;
  }

  .backup-actions {
    gap: 9px;
  }

  .backup-button {
    font-size: 11px;
    padding: 13px 8px;
  }

  .danger-zone {
    flex-direction: column;
    align-items: stretch;
  }

  .delete-button {
    width: 100%;
  }
}


/* =====================================
   PERSONAL FINANCE - CATEGORY MODULE
===================================== */

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
}

.category-header h1 {
  font-size: clamp(25px, 3vw, 32px);
  letter-spacing: -1px;
  margin: 0 0 7px;
}

.category-header p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.category-add-button {
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  transition: transform .2s, opacity .2s;
}

.category-add-button:hover {
  transform: translateY(-2px);
  opacity: .9;
}

/* FILTER & SEARCH */

.category-toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 22px;
}

.category-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.category-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.category-tab span {
  margin-left: 5px;
  opacity: .75;
}

.category-tab:hover,
.category-tab.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.category-search {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.category-search input {
  width: 220px;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 11px 13px;
  border-radius: 10px;
  outline-offset: 2px;
}

/* CATEGORY CARDS */

.category-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(min(100%, 255px), 1fr)
  );
  gap: 17px;
}

.category-card {
  min-width: 0;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 17px;
  box-shadow: var(--shadow);
  transition: transform .2s, border-color .2s;
}

.category-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
}

.category-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
}

.category-letter {
  width: 47px;
  height: 47px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--category-soft);
  color: var(--category-color);
  font-weight: 800;
  font-size: 20px;
  flex-shrink: 0;
}

.category-kind {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 6px 11px;
  font-size: 10px;
  font-weight: 650;
  color: var(--muted);
}

.category-card h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.category-card-actions {
  display: flex;
  gap: 9px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.category-card-actions button {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 11px;
  font-weight: 700;
  flex: 1;
}

.category-card-actions button:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.category-card-actions .category-delete:hover {
  color: #E66B6B;
  border-color: #E66B6B;
}

.category-status {
  font-size: 12px;
  color: #16A085;
  margin: 0 0 12px;
}

.category-status:empty {
  display: none;
}

.category-status.is-error {
  color: #E66B6B;
}

/* EMPTY STATE */

.category-empty {
  min-height: 330px;
  border: 1px dashed var(--border);
  background: var(--surface);
  border-radius: 19px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px;
}

.category-empty[hidden] {
  display: none !important;
}

.category-empty-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 30px;
  border-radius: 19px;
  margin-bottom: 18px;
}

.category-empty h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.category-empty p {
  max-width: 310px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

/* MODAL CATEGORY */

.category-dialog {
  width: min(440px, calc(100% - 28px));
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 25px 90px rgba(0, 0, 0, .25);
}

.category-dialog::backdrop {
  background: rgba(4, 9, 22, .65);
  backdrop-filter: blur(4px);
}

.category-dialog-head {
  padding: 24px 25px 17px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.category-dialog-head h2 {
  font-size: 19px;
  margin: 0 0 6px;
}

.category-dialog-head p {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.category-close {
  border: 0;
  background: var(--bg);
  color: var(--muted);
  border-radius: 9px;
  width: 31px;
  height: 31px;
  font-size: 21px;
}

.category-form-body {
  padding: 23px 25px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.category-form-body > label {
  font-size: 12px;
  font-weight: 700;
  margin-top: 6px;
}

.category-form-body > input,
.category-form-body > select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline-offset: 2px;
}

.category-color-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.category-color-field input {
  width: 48px;
  height: 42px;
  padding: 3px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}

.category-color-field span {
  color: var(--muted);
  font-size: 12px;
}

.category-form-error {
  color: #E66B6B;
  font-size: 12px;
  padding: 0 25px;
  margin: 0;
}

.category-form-error:empty {
  display: none;
}

.category-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 18px 25px 24px;
}

.category-dialog-actions button {
  border-radius: 11px;
  padding: 13px;
  font-size: 12px;
  font-weight: 750;
}

.category-cancel {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.category-save {
  background: var(--accent);
  color: white;
  border: 0;
}

.category-save:disabled {
  opacity: .5;
  cursor: wait;
}

/* RESPONSIVE CATEGORY */

@media (max-width: 800px) {
  .category-header {
    align-items: flex-start;
  }

  .category-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .category-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: thin;
  }

  .category-tab {
    flex-shrink: 0;
  }

  .category-search input {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .category-header {
    flex-direction: column;
    gap: 17px;
  }

  .category-add-button {
    width: 100%;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    padding: 18px;
  }

  .category-dialog-head {
    padding: 20px;
  }

  .category-form-body {
    padding: 20px 20px 12px;
  }

  .category-dialog-actions {
    padding: 15px 20px 22px;
  }
}

/* PERSONAL FINANCE - TRANSAKSI & REKENING */

.tx-page-header,
.tx-section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.tx-page-header {
  margin-bottom: 30px;
}

.tx-page-header h1 {
  font-size: clamp(25px, 3vw, 32px);
  letter-spacing: -1px;
  margin: 0 0 7px;
}

.tx-page-header p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.tx-header-actions,
.tx-account-actions,
.tx-row-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.tx-button-primary,
.tx-button-outline {
  padding: 12px 16px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.tx-button-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.tx-button-outline {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
}

.tx-section-title {
  margin: 25px 0 15px;
}

.tx-section-title h2 {
  font-size: 15px;
  margin: 0;
}

.tx-section-title span,
.tx-muted {
  font-size: 11px;
  color: var(--muted);
}

.tx-account-list {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(min(100%, 225px), 1fr)
  );
  gap: 14px;
}

.tx-account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 18px;
  min-width: 0;
}

.tx-account-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}

.tx-account-name {
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.tx-account-balance {
  display: block;
  font-size: 22px;
  letter-spacing: -.5px;
  margin-bottom: 5px;
  overflow-wrap: anywhere;
}

.tx-account-actions button,
.tx-row-actions button {
  background: transparent;
  border: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 4px;
}

.tx-account-actions button:last-child,
.tx-row-actions button:last-child {
  color: #E46D6D;
}

.tx-account-hint {
  grid-column: 1 / -1;
  border: 1px dashed var(--border);
  background: var(--surface);
  padding: 28px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  margin: 0;
}

/* FILTER */

.tx-toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 17px;
  padding: 20px;
  margin-top: 25px;
}

.tx-type-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.tx-type-tabs button {
  background: transparent;
  border: 0;
  color: var(--muted);
  border-radius: 10px;
  padding: 10px 15px;
  font-size: 12px;
  font-weight: 700;
}

.tx-type-tabs button.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.tx-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.tx-filter-grid label,
.tx-date-range label,
.tx-form-fields {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.tx-filter-grid label,
.tx-date-range label,
.tx-form-fields > label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.tx-filter-grid input,
.tx-filter-grid select,
.tx-date-range input,
.tx-form-fields input,
.tx-form-fields select,
.tx-form-fields textarea {
  width: 100%;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
  outline-offset: 2px;
}

.tx-date-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.tx-date-range[hidden],
.tx-empty[hidden] {
  display: none !important;
}

/* DAFTAR TRANSAKSI */

.tx-list {
  display: grid;
  gap: 10px;
}

.tx-row,
.tx-home-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 17px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.tx-row-main,
.tx-row-side,
.tx-home-row-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.tx-row-side {
  align-items: flex-end;
  text-align: right;
}

.tx-row-title,
.tx-home-row-info strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.tx-row-note {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.tx-money {
  font-size: 15px;
  white-space: nowrap;
  font-weight: 750;
}

.tx-money.income {
  background: transparent;
  color: #16A085;
}

.tx-money.expense {
  background: transparent;
  color: #E46D6D;
}

.tx-home-row {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 17px 0;
}

.tx-home-row:last-child {
  border-bottom: 0;
}

.tx-empty {
  min-height: 250px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 15px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.tx-empty-icon {
  color: var(--accent);
  font-size: 33px;
  margin-bottom: 12px;
}

.tx-empty h3 {
  font-size: 15px;
  margin: 0 0 8px;
}

.tx-empty p {
  color: var(--muted);
  font-size: 12px;
}

.tx-feedback {
  font-size: 12px;
  color: #16A085;
  margin-top: 15px;
}

.tx-feedback.is-error,
.tx-form-error {
  color: #E46D6D;
}

/* MODAL TRANSAKSI */

.tx-dialog {
  width: min(460px, calc(100% - 24px));
  max-height: calc(100dvh - 30px);
  overflow-y: auto;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 19px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 25px 90px rgba(0,0,0,.25);
}

.tx-dialog::backdrop {
  background: rgba(4,9,22,.68);
  backdrop-filter: blur(4px);
}

.tx-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
}

.tx-dialog-header h2 {
  margin: 0;
  font-size: 19px;
}

.tx-dialog-header button {
  background: var(--bg);
  color: var(--muted);
  border: 0;
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 22px;
}

.tx-form-fields {
  padding: 21px 24px 12px;
}

.tx-form-fields > label:not(:first-child) {
  margin-top: 5px;
}

.tx-form-fields textarea {
  resize: vertical;
}

.tx-form-error {
  font-size: 12px;
  margin: 0;
  padding: 0 24px;
}

.tx-dialog-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 20px 24px 24px;
}

.tx-dialog-footer button:disabled {
  opacity: .5;
  cursor: wait;
}

@media (max-width: 1050px) {
  .tx-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .tx-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .tx-header-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .tx-header-actions button {
    padding: 12px 8px;
    font-size: 11px;
  }

  .tx-filter-grid {
    grid-template-columns: 1fr;
  }

  .tx-row {
    align-items: flex-start;
  }

  .tx-money {
    font-size: 12px;
  }

  .tx-dialog-header,
  .tx-form-fields,
  .tx-dialog-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* =====================================
   PERSONAL FINANCE - INVESTMENT MODULE
===================================== */

.inv-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 25px;
}

.inv-page-header h1 {
  font-size: clamp(25px, 3vw, 32px);
  letter-spacing: -1px;
  margin: 0 0 7px;
}

.inv-page-header p {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
}

.inv-primary,
.inv-secondary {
  padding: 12px 18px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.inv-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.inv-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

/* SUMMARY */

.inv-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.inv-stat,
.inv-panel,
.inv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.inv-stat {
  padding: 21px;
}

.inv-stat > span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 17px;
}

.inv-stat strong {
  display: block;
  font-size: clamp(17px, 1.9vw, 25px);
  overflow-wrap: anywhere;
  letter-spacing: -.5px;
}

.inv-stat small {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 11px;
}

.inv-stat .inv-positive,
.inv-positive {
  color: #16A085;
}

.inv-stat .inv-negative,
.inv-negative {
  color: #E46D6D;
}

/* PANELS */

.inv-panel {
  padding: 22px;
  margin-bottom: 19px;
}

.inv-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.inv-panel-heading h2 {
  font-size: 15px;
  margin: 0;
}

.inv-panel-heading span,
.inv-muted {
  font-size: 11px;
  color: var(--muted);
}

.inv-allocation {
  display: grid;
  gap: 14px;
}

.inv-allocation-empty {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.inv-allocation-item {
  display: grid;
  gap: 7px;
}

.inv-allocation-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.inv-allocation-label span:first-child {
  overflow-wrap: anywhere;
}

.inv-allocation-track {
  background: var(--bg);
  height: 9px;
  border-radius: 20px;
  overflow: hidden;
}

.inv-allocation-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--inv-color, var(--accent));
}

/* FILTER */

.inv-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.inv-filters label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  min-width: 0;
}

.inv-filters select,
.inv-filters input {
  width: 100%;
  min-width: 0;
  padding: 12px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
}

.inv-search {
  grid-column: 1 / -1;
}

.inv-status {
  font-size: 12px;
  color: #16A085;
  margin: 0 0 13px;
}

.inv-status:empty,
.inv-form-error:empty {
  display: none;
}

.inv-status.is-error,
.inv-form-error {
  color: #E46D6D;
}

/* INVESTMENT CARDS */

.inv-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    minmax(min(100%, 280px), 1fr)
  );
  gap: 16px;
}

.inv-card {
  padding: 21px;
}

.inv-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.inv-asset-letter {
  width: 45px;
  height: 45px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--inv-soft);
  color: var(--inv-color);
  font-size: 19px;
  font-weight: 800;
}

.inv-asset-category {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 6px 9px;
  border-radius: 20px;
  font-size: 10px;
  max-width: 65%;
  overflow-wrap: anywhere;
}

.inv-card h3 {
  font-size: 16px;
  margin: 17px 0 4px;
  overflow-wrap: anywhere;
}

.inv-card-symbol,
.inv-card-date {
  color: var(--muted);
  font-size: 11px;
}

.inv-card-metrics {
  display: grid;
  gap: 13px;
  padding: 17px 0;
  margin-top: 16px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.inv-metric {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.inv-metric span {
  color: var(--muted);
  font-size: 11px;
}

.inv-metric strong {
  font-size: 13px;
  text-align: right;
  overflow-wrap: anywhere;
}

.inv-card-note {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
  margin: 14px 0 0;
}

.inv-card-actions {
  display: flex;
  gap: 9px;
  margin-top: 17px;
}

.inv-card-actions button {
  flex: 1;
  background: var(--bg);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px;
  font-size: 11px;
  font-weight: 700;
}

.inv-card-actions button:last-child {
  color: #E46D6D;
}

.inv-empty {
  min-height: 290px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 25px;
}

.inv-empty[hidden] {
  display: none !important;
}

.inv-empty-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 30px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.inv-empty h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.inv-empty p {
  color: var(--muted);
  font-size: 12px;
}

/* MODAL */

.inv-dialog {
  width: min(470px, calc(100% - 24px));
  max-height: calc(100dvh - 30px);
  overflow-y: auto;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 25px 90px rgba(0,0,0,.25);
}

.inv-dialog::backdrop {
  background: rgba(4,9,22,.68);
  backdrop-filter: blur(4px);
}

.inv-dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 23px;
  border-bottom: 1px solid var(--border);
}

.inv-dialog-heading h2 {
  font-size: 19px;
  margin: 0;
}

.inv-dialog-heading button {
  width: 32px;
  height: 32px;
  border: 0;
  background: var(--bg);
  color: var(--muted);
  border-radius: 9px;
  font-size: 22px;
}

.inv-form-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 23px 12px;
}

.inv-form-fields label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
}

.inv-form-fields > label:not(:first-child) {
  margin-top: 6px;
}

.inv-form-fields input,
.inv-form-fields select,
.inv-form-fields textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 10px;
  padding: 13px;
  font-size: 12px;
}

.inv-form-fields textarea {
  resize: vertical;
}

.inv-form-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 7px;
}

.inv-form-pair > div {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.inv-form-error {
  font-size: 12px;
  margin: 0;
  padding: 0 23px;
}

.inv-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 20px 23px 24px;
}

.inv-dialog-actions button:disabled {
  opacity: .5;
  cursor: wait;
}

@media (max-width: 1150px) {
  .inv-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inv-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .inv-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  .inv-page-header .inv-primary {
    width: 100%;
  }

  .inv-summary {
    gap: 10px;
  }

  .inv-stat {
    padding: 15px;
  }

  .inv-stat strong {
    font-size: 18px;
  }

  .inv-panel {
    padding: 17px;
  }

  .inv-filters {
    grid-template-columns: 1fr;
  }

  .inv-search {
    grid-column: auto;
  }

  .inv-form-pair {
    grid-template-columns: 1fr;
  }
}

/* PERSONAL FINANCE - REPORT MODULE */

.rpt-header,
.rpt-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.rpt-header {
  margin-bottom: 25px;
}

.rpt-header h1 {
  font-size: clamp(25px, 3vw, 32px);
  letter-spacing: -1px;
  margin: 0 0 7px;
}

.rpt-header p,
.rpt-panel-head p,
.rpt-muted {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

.rpt-primary {
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 11px;
  padding: 13px 19px;
  font-weight: 750;
  font-size: 12px;
  white-space: nowrap;
}

.rpt-panel,
.rpt-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 17px;
  box-shadow: var(--shadow);
  min-width: 0;
}

.rpt-panel {
  padding: 22px;
  margin-bottom: 19px;
}

.rpt-panel-head {
  margin-bottom: 19px;
  align-items: flex-start;
}

.rpt-panel-head h2 {
  font-size: 15px;
  margin: 0 0 7px;
}

/* FILTER */

.rpt-period-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 19px;
}

.rpt-period-tabs button,
.rpt-mini-tabs button {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  padding: 11px 16px;
  font-size: 12px;
  font-weight: 700;
}

.rpt-period-tabs button.is-active,
.rpt-mini-tabs button.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}

.rpt-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.rpt-filter-grid label {
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  min-width: 0;
}

.rpt-filter-grid select,
.rpt-filter-grid input {
  width: 100%;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 12px;
}

.rpt-range-label {
  color: var(--muted);
  font-size: 11px;
  margin: 15px 0 0;
}

/* SUMMARY */

.rpt-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.rpt-stat {
  padding: 20px;
}

.rpt-stat > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 15px;
}

.rpt-stat strong {
  display: block;
  font-size: clamp(17px, 1.8vw, 25px);
  letter-spacing: -.6px;
  overflow-wrap: anywhere;
}

.rpt-stat small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 9px;
}

.rpt-positive {
  color: #16A085 !important;
}

.rpt-negative {
  color: #E46D6D !important;
}

/* GRAFIK */

.rpt-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.rpt-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.rpt-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.rpt-dot.income {
  background: #16A085;
}

.rpt-dot.expense {
  background: #E46D6D;
}

.rpt-chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding: 12px 2px;
  scrollbar-width: thin;
}

.rpt-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 225px;
  width: max-content;
  min-width: 100%;
}

.rpt-chart-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1 0 56px;
  min-width: 56px;
  padding: 8px 3px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
}

.rpt-chart-column:hover,
.rpt-chart-column.is-active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.rpt-chart-bars {
  height: 175px;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.rpt-bar {
  display: block;
  width: 17px;
  border-radius: 5px 5px 2px 2px;
  transition: height .2s ease;
}

.rpt-bar-income {
  background: #16A085;
}

.rpt-bar-expense {
  background: #E46D6D;
}

.rpt-chart-label {
  font-size: 10px;
  white-space: nowrap;
  font-weight: 600;
}

.rpt-chart-hint,
.rpt-chart-empty {
  font-size: 11px;
  color: var(--muted);
  margin: 10px 0 0;
}

.rpt-chart-empty {
  width: 100%;
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
}

/* CATEGORY ANALYTICS */

.rpt-content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 19px;
}

.rpt-mini-tabs {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.rpt-breakdown {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.rpt-breakdown-item {
  display: grid;
  gap: 8px;
}

.rpt-breakdown-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.rpt-breakdown-heading span {
  overflow-wrap: anywhere;
}

.rpt-breakdown-heading strong {
  white-space: nowrap;
  text-align: right;
}

.rpt-breakdown-track {
  width: 100%;
  height: 9px;
  background: var(--bg);
  border-radius: 20px;
  overflow: hidden;
}

.rpt-breakdown-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--report-color, var(--accent));
}

.rpt-empty-message {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

/* DETAILS */

.rpt-details {
  display: grid;
}

.rpt-detail-row {
  padding: 14px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  border-bottom: 1px solid var(--border);
}

.rpt-detail-row:last-child {
  border-bottom: 0;
}

.rpt-detail-main,
.rpt-detail-side {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.rpt-detail-main strong {
  font-size: 12px;
  overflow-wrap: anywhere;
}

.rpt-detail-main span,
.rpt-detail-main p,
.rpt-detail-side small {
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
  margin: 0;
}

.rpt-detail-side {
  align-items: flex-end;
  text-align: right;
}

.rpt-detail-side strong {
  font-size: 13px;
  white-space: nowrap;
}

.rpt-text-button {
  border: 0;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  padding: 9px;
  border-radius: 9px;
}

.rpt-text-button[hidden],
.rpt-load-more[hidden] {
  display: none !important;
}

.rpt-load-more {
  display: block;
  width: 100%;
  margin-top: 17px;
  padding: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 0;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 750;
}

.rpt-status {
  font-size: 12px;
  color: #16A085;
}

.rpt-status:empty {
  display: none;
}

.rpt-status.is-error {
  color: #E46D6D;
}

/* RESPONSIVE */

@media (max-width: 1150px) {
  .rpt-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rpt-content-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 850px) {
  .rpt-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .rpt-header {
    flex-direction: column;
    align-items: stretch;
  }

  .rpt-primary {
    width: 100%;
  }

  .rpt-summary {
    gap: 10px;
  }

  .rpt-stat {
    padding: 15px;
  }

  .rpt-stat strong {
    font-size: 17px;
  }

  .rpt-panel {
    padding: 17px;
  }

  .rpt-filter-grid {
    grid-template-columns: 1fr;
  }

  .rpt-period-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .rpt-period-tabs button {
    font-size: 11px;
    padding: 11px 6px;
  }

  .rpt-panel-head {
    flex-wrap: wrap;
  }

  .rpt-detail-side strong {
    font-size: 12px;
  }
}

/* PERSONAL FINANCE - SECURITY PIN */

#pinPanel {
  grid-column: 1 / -1;
}

#pinPanel [hidden],
.pf-lock-screen[hidden] {
  display: none !important;
}

.pin-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 17px;
  font-size: 12px;
  font-weight: 750;
  margin-bottom: 20px;
}

.pin-state-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #A8B0BF;
}

.pin-state.is-enabled .pin-state-dot {
  background: #16A085;
}

.pin-form {
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 11px;
  margin-top: 15px;
}

.pin-form label,
#pinUnlockForm label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.pin-form input,
#pinUnlockForm input {
  width: 100%;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 14px;
  border-radius: 11px;
  font-size: 16px;
  letter-spacing: 5px;
  outline-offset: 2px;
}

.pin-form button {
  align-self: flex-start;
  margin-top: 7px;
}

.pin-primary,
.pin-secondary,
.pin-danger {
  border-radius: 11px;
  padding: 12px 17px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.pin-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}

.pin-secondary {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border);
}

.pin-danger {
  background: transparent;
  color: #E46D6D;
  border: 1px solid #E46D6D;
}

.pin-action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.pin-message {
  font-size: 12px;
  color: #16A085;
  margin: 13px 0 0;
  line-height: 1.6;
  min-height: 18px;
}

.pin-message.is-error {
  color: #E46D6D;
}

.pin-footnote {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
  margin-top: 20px;
}

.pin-primary:disabled,
.pin-secondary:disabled,
.pin-danger:disabled {
  opacity: .5;
  cursor: wait;
}

/* LOCK SCREEN */

html.pf-locked body {
  overflow: hidden;
}

html.pf-locked .app-shell,
html.pf-locked .bottom-nav {
  visibility: hidden;
}

.pf-lock-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg);
  overflow-y: auto;
  padding: 24px;
  padding-top: calc(24px + env(safe-area-inset-top));
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.pf-lock-card {
  width: min(400px, 100%);
  padding: 35px 28px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 22px;
  box-shadow: var(--shadow);
  text-align: center;
}

.pf-lock-logo {
  width: 76px;
  height: 76px;
  display: block;
  margin: 0 auto 18px;
}

.pf-lock-card h1 {
  font-size: 23px;
  letter-spacing: -.6px;
  margin: 0 0 7px;
}

.pf-lock-card > p:first-of-type {
  font-size: 13px;
  color: var(--muted);
}

.pf-lock-symbol {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  border-radius: 20px;
  font-size: 27px;
  margin: 24px auto;
}

#pinUnlockForm {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

#pinUnlockForm input {
  text-align: center;
  font-size: 23px;
  letter-spacing: 10px;
  padding: 15px;
}

#pinUnlockForm button {
  width: 100%;
  padding: 15px;
}

.pf-lock-card > small {
  display: block;
  color: var(--muted);
  margin-top: 21px;
  font-size: 11px;
}

@media (max-width: 560px) {
  .pin-action-grid {
    flex-direction: column;
  }

  .pin-action-grid button {
    width: 100%;
  }

  .pin-form button {
    width: 100%;
  }

  .pf-lock-screen {
    padding: 15px;
  }

  .pf-lock-card {
    padding: 28px 20px;
  }
}

/* Navigasi enam menu pada layar mobile */
@media (max-width: 800px) {
  .bottom-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 400px) {
  .bottom-nav .nav-item {
    gap: 4px;
    padding: 8px 1px;
    font-size: 8px;
  }
}

/* PERSONAL FINANCE - FINANCIAL PLANNING */

.plan-heading {
  margin-bottom: 24px;
}

.plan-heading h1 {
  font-size: clamp(25px, 3vw, 32px);
  letter-spacing: -1px;
  margin: 0 0 7px;
}

.plan-heading p,
.plan-section-head p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.plan-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 25px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.plan-tabs button {
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  padding: 12px 17px;
  font-size: 12px;
  font-weight: 700;
}

.plan-tabs button.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.plan-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.plan-section-head h2 {
  font-size: 20px;
  margin: 0 0 7px;
}

.plan-primary,
.plan-secondary,
.plan-danger {
  padding: 12px 16px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}

.plan-primary {
  background: var(--accent);
  color: white;
  border: 1px solid var(--accent);
}

.plan-secondary {
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border);
}

.plan-danger {
  background: transparent;
  color: #E46D6D;
  border: 1px solid #E46D6D;
}

.plan-filters,
.plan-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.plan-filters {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 18px;
}

.plan-filters label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  min-width: 0;
}

.plan-filters input,
.plan-filters select {
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
}

.plan-stats article,
.plan-card,
.plan-due-panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 21px;
  box-shadow: var(--shadow);
}

.plan-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 12px;
}

.plan-stats strong {
  font-size: clamp(17px, 2vw, 24px);
  overflow-wrap: anywhere;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fill, minmax(min(100%, 285px), 1fr)
  );
  gap: 16px;
}

.plan-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.plan-card h3 {
  margin: 0;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.plan-card small,
.plan-card p,
.plan-card-detail {
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
  margin: 0;
}

.plan-card-amount {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -.5px;
  overflow-wrap: anywhere;
}

.plan-card-status {
  font-size: 11px;
  font-weight: 700;
}

.plan-positive { color: #16A085; }
.plan-negative { color: #E46D6D; }

.plan-track {
  width: 100%;
  height: 10px;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg);
}

.plan-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.plan-fill.is-over {
  background: #E46D6D;
}

.plan-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.plan-card-actions button {
  flex: 1;
  padding: 10px 8px;
  border-radius: 9px;
  background: var(--bg);
  color: var(--accent);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 700;
}

.plan-card-actions button.is-danger {
  color: #E46D6D;
}

.plan-empty {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 16px;
  min-height: 230px;
  padding: 25px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.plan-empty[hidden],
[data-plan-panel][hidden] {
  display: none !important;
}

.plan-empty h3 {
  font-size: 16px;
  margin-bottom: 7px;
}

.plan-empty p {
  color: var(--muted);
  font-size: 12px;
}

.plan-due-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.plan-due-panel strong {
  font-size: 14px;
}

.plan-due-panel p {
  color: var(--muted);
  font-size: 11px;
  margin: 7px 0 0;
}

.plan-message {
  color: #16A085;
  font-size: 12px;
  margin: 15px 0 0;
}

.plan-message.is-error,
.plan-error {
  color: #E46D6D;
}

/* MODALS */

.plan-dialog {
  width: min(440px, calc(100% - 24px));
  max-height: calc(100dvh - 30px);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  padding: 0;
  box-shadow: 0 25px 90px rgba(0,0,0,.25);
}

.plan-dialog::backdrop {
  background: rgba(4,9,22,.68);
  backdrop-filter: blur(4px);
}

.plan-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 22px;
  border-bottom: 1px solid var(--border);
}

.plan-dialog-head h2 {
  margin: 0;
  font-size: 18px;
}

.plan-dialog-head button {
  background: var(--bg);
  color: var(--muted);
  border: 0;
  border-radius: 9px;
  width: 32px;
  height: 32px;
  font-size: 22px;
}

.plan-fields {
  padding: 20px 22px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.plan-fields label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.plan-fields input,
.plan-fields select {
  width: 100%;
  min-width: 0;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px;
  font-size: 13px;
}

.plan-hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  margin: 4px 0 0;
}

.plan-error {
  font-size: 12px;
  margin: 0;
  padding: 0 22px;
}

.plan-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 18px 22px 23px;
}

.plan-dialog-actions button:disabled,
.plan-due-panel button:disabled {
  opacity: .5;
  cursor: wait;
}

@media (max-width: 1050px) {
  .plan-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .plan-section-head,
  .plan-due-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .plan-section-head .plan-primary,
  .plan-due-panel .plan-primary {
    width: 100%;
  }

  .plan-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .plan-tabs button {
    font-size: 10px;
    padding: 12px 5px;
  }

  .plan-filters,
  .plan-stats {
    grid-template-columns: 1fr;
  }
}

/* PERSONAL FINANCE - CUSTOM USER WATERMARK */

#watermarkPanel {
  grid-column: 1 / -1;
}

.watermark-form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
  max-width: 500px;
}

.watermark-form > label:not(.watermark-toggle) {
  font-size: 12px;
  font-weight: 700;
}

.watermark-form > input {
  width: 100%;
  padding: 14px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 11px;
}

.watermark-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.watermark-toggle input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.pf-custom-brand {
  text-align: center;
  padding: 20px 0 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.pf-custom-brand[hidden] {
  display: none !important;
}
