/* ============================================================
   ROOT VARIABLES
   ============================================================ */

:root {
  --bg: #f5f6f7;
  --app-bg: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f7f8f9;
  --ink: #17191c;
  --ink-soft: #6b7178;
  --ink-faint: #9aa1a8;
  --line: #e7e9ec;
  --brand: #16a34a;
  --brand-dark: #12833d;
  --brand-soft: #eaf7ef;
  --gold: #e6a72e;
  --gold-dark: #c9901e;
  --gold-soft: #fff7e6;
  --pos: #16a34a;
  --pos-dark: #0f7a33;
  --pos-soft: #eaf7ef;
  --neg: #e05252;
  --neg-dark: #b33a3a;
  --neg-soft: #fceded;
  --shadow: 0 2px 10px rgba(18, 24, 31, 0.045);
}

html[data-theme="light"] {
  --bg: #f5f6f7;
  --app-bg: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f7f8f9;
  --ink: #17191c;
  --ink-soft: #6b7178;
  --ink-faint: #9aa1a8;
  --line: #e7e9ec;
  --brand: #16a34a;
  --brand-dark: #12833d;
  --brand-soft: #eaf7ef;
  --gold: #e6a72e;
  --gold-dark: #c9901e;
  --gold-soft: #fff7e6;
  --pos: #16a34a;
  --pos-dark: #0f7a33;
  --pos-soft: #eaf7ef;
  --neg: #e05252;
  --neg-dark: #b33a3a;
  --neg-soft: #fceded;
  --shadow: 0 2px 10px rgba(18, 24, 31, 0.045);
}

html[data-theme="dark"] {
  --bg: #0f1114;
  --app-bg: #15171a;
  --surface: #191c20;
  --surface-alt: #20242a;
  --ink: #f1f3f5;
  --ink-soft: #9aa1aa;
  --ink-faint: #69717b;
  --line: #2a2e34;
  --brand: #28c76f;
  --brand-dark: #20a85c;
  --brand-soft: #162b20;
  --gold: #e9ad38;
  --gold-dark: #c9901e;
  --gold-soft: #302612;
  --pos: #28c76f;
  --pos-dark: #1a8a4a;
  --pos-soft: #162b20;
  --neg: #ff6666;
  --neg-dark: #cc4444;
  --neg-soft: #321b1d;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.16);
}

/* ============================================================
   BASE STYLES
   ============================================================ */

html,
body {
  background: var(--bg);
  font-family:
    "Plus Jakarta Sans",
    system-ui,
    -apple-system,
    sans-serif;
  color: var(--ink);
  letter-spacing: -0.012em;
  font-size: 14px;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;
}

* {
  min-width: 0;
  box-sizing: border-box;
}

.font-display {
  font-family:
    "Plus Jakarta Sans",
    system-ui,
    -apple-system,
    sans-serif;
  letter-spacing: -0.02em;
}

.mono {
  font-family:
    "Plus Jakarta Sans",
    system-ui,
    -apple-system,
    sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.no-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}

body,
#shell,
.card,
.stat-chip,
.month-chip,
.hero-card,
.tx-card,
.sheet,
#bottomnav,
#topbar,
.icon-btn,
.field-input {
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

/* ============================================================
   AUTH SCREEN
   ============================================================ */

#authScreen {
  display: none !important;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--bg);
}

#authScreen:not(.hidden) {
  display: flex !important;
}

#shell {
  display: none !important;
}

#shell:not(.hidden) {
  display: flex !important;
}

html.auth-locked #shell {
  display: none !important;
}

html.auth-locked #authScreen:not(.hidden) {
  display: flex !important;
}

html.authenticated #authScreen {
  display: none !important;
}

html.authenticated #shell:not(.hidden) {
  display: flex !important;
}

/* Loading screen */
#appLoader {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 999999;
  transition: opacity 0.3s ease;
}

#appLoader.hidden {
  opacity: 0;
  pointer-events: none;
}

#appLoader .loader-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}

#appLoader .loader-text {
  text-align: center;
  color: var(--ink-soft);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 13px;
  font-weight: 500;
}

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

[data-theme="dark"] #appLoader {
  background: var(--bg);
}

[data-theme="dark"] #appLoader .loader-spinner {
  border-color: var(--line);
  border-top-color: var(--brand);
}

[data-theme="dark"] #appLoader .loader-text {
  color: var(--ink-soft);
}

#authScreen.hidden {
  display: none !important;
}

#authCard {
  width: 100%;
  max-width: 350px;
  background: var(--app-bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: none;
  padding: 24px 20px;
}

.nav-btn.active {
  color: var(--brand) !important;
}

.nav-btn.active .nav-pill {
  background: var(--brand-soft) !important;
}

.nav-btn.active .nav-pill svg {
  stroke: var(--brand) !important;
}

/* Animasi transisi screen */
.screen {
  display: none;
  animation: fadeIn 0.25s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   SHELL / MAIN CONTAINER
   ============================================================ */

#shell {
  width: 100% !important;
  max-width: 480px !important;
  min-height: 100dvh !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
  background: var(--app-bg) !important;
  position: relative !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box !important;
}

#shell.hidden {
  display: none !important;
}

#shell:not(.hidden) {
  display: flex;
}

html.auth-locked #shell {
  display: none !important;
}

html.authenticated #authScreen {
  display: none !important;
}

html.authenticated #shell {
  display: flex !important;
}

@media (min-width: 500px) {
  body {
    padding: 0 !important;
  }
  #shell {
    min-height: 100dvh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }
}

/* ============================================================
   TOPBAR
   ============================================================ */

#topbar {
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
  width: 100% !important;
  max-width: 480px !important;
  min-height: 56px !important;
  z-index: 40 !important;
  background: color-mix(in srgb, var(--app-bg) 92%, transparent) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid var(--line) !important;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

.app-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--brand-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-icon-badge svg {
  stroke: var(--brand) !important;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-soft);
  transition: transform 0.12s ease;
  flex-shrink: 0;
  box-shadow: none;
}

.icon-btn:hover {
  background: var(--surface-alt);
  border-color: var(--line);
}

.icon-btn:active {
  transform: scale(0.93);
}

.icon-btn.spin svg {
  animation: spin 0.7s linear;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

#shell main {
  position: relative !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
  width: 100% !important;
  max-width: 480px !important;
  flex: 1 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
  padding: 16px !important;
  padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
  -webkit-overflow-scrolling: touch !important;
  margin: 0 !important;
  background: var(--bg) !important;
}

#shell:has(.sheet-overlay:not(.hidden)) main {
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
}

.sheet-overlay:not(.hidden) .sheet {
  touch-action: pan-y;
}

.screen {
  display: none;
  gap: 16px;
}

.screen.active {
  display: block;
}

/* ============================================================
   HERO CARD
   ============================================================ */

.hero-card {
  border-radius: 10px;
  padding: 18px !important;
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

.hero-card::before,
.receipt-edge {
  display: none;
}

html[data-theme="dark"] .hero-card {
  color: #ffffff;
}

html[data-theme="dark"] .hero-card .white-text {
  color: #ffffff;
}

.hero-card .eyebrow {
  color: rgba(255, 255, 255, 0.72) !important;
}

.hero-card .mono {
  font-size: 26px !important;
  letter-spacing: -0.035em;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
  padding: 16px !important;
}

.card:has(.filter-group) {
  overflow: visible !important;
}

.stat-chip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
  padding: 13px !important;
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.045em;
  color: var(--ink-faint);
}

h1,
h2,
h3 {
  letter-spacing: -0.025em;
}

.month-chip {
  white-space: nowrap;
  padding: 7px 12px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-family: "Plus Jakarta Sans", sans-serif;
  transition:
    background-color 0.12s ease,
    color 0.12s ease,
    border-color 0.12s ease;
}

.month-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.month-chip:active {
  transform: scale(0.97);
}

.tx-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
}

.tx-card:last-child {
  border-bottom: none;
}

.tx-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tx-title {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
}

.tx-sub {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 1px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tx-meta {
  font-size: 10px;
  color: var(--ink-faint);
  margin-top: 3px;
}

.tx-amount {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* ============================================================
   BOTTOM NAVIGATION
   ============================================================ */

#bottomnav {
  position: sticky !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  transform: none !important;
  width: 100% !important;
  max-width: 480px !important;
  z-index: 50 !important;
  background: var(--surface) !important;
  border-top: 1px solid var(--line) !important;
  padding-bottom: env(safe-area-inset-bottom) !important;
  flex-shrink: 0 !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 7px;
  font-size: 10px;
  color: var(--ink-faint);
}

.nav-btn .nav-pill {
  width: 32px;
  height: 24px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-btn.active {
  color: var(--brand);
}

.nav-btn.active .nav-pill {
  background: transparent;
}

.nav-btn span:last-child {
  font-size: 9.5px;
  font-weight: 600;
}

/* ============================================================
   SHEET OVERLAY
   ============================================================ */

.sheet-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(4, 8, 7, 0.55);
  overscroll-behavior: contain;
  touch-action: none;
}

body > .sheet-overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  display: flex !important;
  align-items: flex-end !important;
  justify-content: center !important;
  padding: 0 !important;
  margin: 0 !important;
  z-index: 10000 !important;
  box-sizing: border-box !important;
  background: rgba(4, 8, 7, 0.55) !important;
  overscroll-behavior: contain !important;
  touch-action: none !important;
}

body > .sheet-overlay.hidden {
  display: none !important;
}

body > .sheet-overlay:not(.hidden) > .sheet {
  position: relative !important;
  z-index: 10001 !important;
  width: min(100vw, 480px) !important;
  max-width: 480px !important;
  max-height: 92dvh !important;
  margin: 0 !important;
  border-radius: 18px 18px 0 0 !important;
  box-sizing: border-box !important;
  padding-bottom: calc(14px + env(safe-area-inset-bottom)) !important;
}

.sheet {
  background: var(--app-bg);
  border-radius: 18px 18px 0 0;
  border-top: 1px solid var(--line);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 12px 22px 0;
  display: flex;
  flex-direction: column;
  animation: sheetUp 0.24s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

@keyframes sheetUp {
  from {
    transform: translateY(24px);
    opacity: 0.4;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.sheet-header {
  flex: 0 0 auto;
  padding-top: 4px;
  padding-bottom: 14px;
  background: var(--app-bg);
  position: relative;
  z-index: 2;
}

body > .sheet-overlay .sheet-header {
  flex: 0 0 auto !important;
  padding: 4px 0 14px !important;
  margin: 0 !important;
  background: var(--app-bg) !important;
  position: relative !important;
  z-index: 2 !important;
}

.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  margin: 6px auto 14px;
}

body > .sheet-overlay .sheet-header .sheet-handle,
body > .sheet-overlay > .sheet > .sheet-handle {
  width: 38px !important;
  height: 4px !important;
  margin: 6px auto 14px !important;
  border-radius: 999px !important;
  background: var(--line) !important;
}

.sheet-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-y: contain;
  overscroll-behavior-x: none;
  -webkit-overflow-scrolling: touch;
  padding-top: 8px;
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
  scrollbar-width: thin;
}

body > .sheet-overlay .sheet-scroll {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  padding-top: 8px !important;
  padding-bottom: calc(28px + env(safe-area-inset-bottom)) !important;
}

body > .sheet-overlay .sheet-title {
  margin: 0 !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 16px !important;
  line-height: 1.25 !important;
  font-weight: 800 !important;
  color: var(--ink) !important;
  letter-spacing: -0.025em !important;
  text-align: left !important;
}

body > .sheet-overlay .sheet-subtitle {
  margin: 5px 0 0 !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  color: var(--ink-soft) !important;
  text-align: left !important;
}

/* ============================================================
   SHEET ACTION
   ============================================================ */

body > .sheet-overlay.sheet-action > .sheet {
  max-height: 58vh !important;
  height: auto !important;
  padding: 6px 16px 10px !important;
  overflow: hidden !important;
  border-radius: 18px 18px 0 0 !important;
}

body > .sheet-overlay.sheet-action .sheet-header {
  padding-top: 2px !important;
  padding-bottom: 6px !important;
  flex-shrink: 0 !important;
}

body > .sheet-overlay.sheet-action .sheet-handle {
  width: 32px !important;
  height: 3px !important;
  margin: 2px auto 8px !important;
  border-radius: 999px !important;
  background: var(--line) !important;
}

body > .sheet-overlay.sheet-action .sheet-title {
  font-size: 15px !important;
  font-weight: 800 !important;
  text-align: center !important;
  letter-spacing: -0.02em !important;
  color: var(--ink) !important;
  margin: 0 !important;
}

body > .sheet-overlay.sheet-action .sheet-subtitle {
  font-size: 11px !important;
  text-align: center !important;
  color: var(--ink-soft) !important;
  margin-top: 2px !important;
  margin-bottom: 0 !important;
}

body > .sheet-overlay.sheet-action .sheet-scroll {
  padding-top: 2px !important;
  padding-bottom: 4px !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

body > .sheet-overlay.sheet-action .action-list {
  border-radius: 10px !important;
  padding: 4px !important;
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  overflow: hidden !important;
}

body > .sheet-overlay.sheet-action .action-item {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
  padding: 10px 14px !important;
  min-height: 42px !important;
  border: none !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: var(--ink) !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-align: left !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

body > .sheet-overlay.sheet-action .action-item:not(:last-child) {
  border-bottom: 1px solid var(--line) !important;
}

body > .sheet-overlay.sheet-action .action-item:hover {
  background: var(--surface-alt) !important;
}

body > .sheet-overlay.sheet-action .action-item:active {
  transform: scale(0.98) !important;
}

body > .sheet-overlay.sheet-action .action-item .action-icon {
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  flex-shrink: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--surface-alt) !important;
  border: none !important;
  color: var(--ink-soft) !important;
}

body > .sheet-overlay.sheet-action .action-item .action-icon svg {
  width: 14px !important;
  height: 14px !important;
  display: block !important;
}

body > .sheet-overlay.sheet-action .action-item .action-label {
  flex: 1 !important;
  font-size: 13px !important;
  font-weight: 700 !important;
}

body > .sheet-overlay.sheet-action .action-item .action-chevron {
  color: var(--ink-faint) !important;
  flex-shrink: 0 !important;
  width: 14px !important;
  height: 14px !important;
}

body > .sheet-overlay.sheet-action .action-item.danger {
  color: var(--neg) !important;
}

body > .sheet-overlay.sheet-action .action-item.danger .action-icon {
  background: var(--neg-soft) !important;
  color: var(--neg) !important;
}

body > .sheet-overlay.sheet-action .action-item.danger .action-chevron {
  color: var(--neg) !important;
}

body > .sheet-overlay.sheet-action .action-item.danger:hover {
  background: var(--neg-soft) !important;
}

body > .sheet-overlay.sheet-action .btn-cancel {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  padding: 11px 0 !important;
  margin-top: 6px !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  background: var(--surface-alt) !important;
  color: var(--ink-soft) !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  min-height: 42px !important;
}

body > .sheet-overlay.sheet-action .btn-cancel:hover {
  background: var(--surface) !important;
  border-color: color-mix(in srgb, var(--brand) 25%, var(--line)) !important;
  color: var(--ink) !important;
}

body > .sheet-overlay.sheet-action .btn-cancel:active {
  transform: scale(0.98) !important;
}

/* ============================================================
   SHEET PAYMENT
   ============================================================ */

body > .sheet-overlay .sheet-header-payment {
  display: block !important;
  text-align: center !important;
  padding: 4px 0 14px !important;
  margin: 0 !important;
}

body > .sheet-overlay .sheet-header-payment .sheet-handle {
  width: 38px !important;
  height: 4px !important;
  margin: 6px auto 12px !important;
  border-radius: 999px !important;
}

body > .sheet-overlay .sheet-header-payment .sheet-header-icon {
  width: 40px !important;
  height: 40px !important;
  margin: 0 auto 8px !important;
  border-radius: 12px !important;
  background: var(--brand-soft) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--brand) !important;
}

body > .sheet-overlay .sheet-header-payment .sheet-title {
  margin: 0 !important;
  text-align: center !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 16px !important;
  line-height: 1.25 !important;
  font-weight: 800 !important;
  letter-spacing: -0.025em !important;
  color: var(--ink) !important;
}

body > .sheet-overlay .sheet-header-payment .sheet-subtitle {
  margin: 5px 0 0 !important;
  text-align: center !important;
  font-family: "Plus Jakarta Sans", sans-serif !important;
  font-size: 12px !important;
  line-height: 1.45 !important;
  color: var(--ink-soft) !important;
}

/* ============================================================
   BOTTOMNAV Z-INDEX
   ============================================================ */

#bottomnav {
  z-index: 50 !important;
}

/* ============================================================
   TOAST
   ============================================================ */

#toast {
  position: fixed !important;
  top: calc(56px + 8px);
  left: 12px;
  right: 12px;
  z-index: 999999 !important;
  padding: 12px 20px;
  border-radius: 14px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  animation: toastSlideDown 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: auto;
}

#toast strong {
  font-weight: 700;
  display: inline-block;
}

#toast.hidden {
  display: none !important;
}

#toast svg {
  flex-shrink: 0;
  display: block;
}

#toast.success {
  background: var(--pos);
  color: #fff;
}

#toast.error {
  background: var(--neg);
  color: #fff;
}

#toast.warning {
  background: var(--gold);
  color: #fff;
}

#toast.info {
  background: var(--brand);
  color: #fff;
}

@keyframes toastSlideDown {
  from {
    transform: translateY(-12px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@media (max-width: 480px) {
  #toast {
    top: calc(52px + 6px);
    left: 8px;
    right: 8px;
    padding: 10px 16px;
    font-size: 12px;
    border-radius: 12px;
    gap: 6px;
  }
}

@media (max-width: 380px) {
  #toast {
    top: calc(48px + 4px);
    left: 6px;
    right: 6px;
    padding: 8px 14px;
    font-size: 11px;
    border-radius: 10px;
    gap: 4px;
  }
}

@media (max-height: 600px) {
  #toast {
    top: calc(48px + 4px);
    padding: 8px 14px;
    font-size: 11px;
  }
}

html[data-theme="dark"] #toast {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   STATUS PILL
   ============================================================ */

.status-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.status-positive {
  background: var(--pos-soft);
  color: var(--pos);
}

.status-negative {
  background: var(--neg-soft);
  color: var(--neg);
}

.status-active {
  background: var(--pos-soft);
  color: var(--pos);
}

.status-inactive {
  background: var(--neg-soft);
  color: var(--neg);
}

/* ============================================================
   FIELD INPUT
   ============================================================ */

.field-input {
  width: 100%;
  margin-top: 5px;
  padding: 11px 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  outline: none;
}

.field-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-soft);
}

.field-label {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--ink-soft);
}

/* ============================================================
   TOGGLE BUTTONS
   ============================================================ */

.seg-toggle,
.opt-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 6px;
}

.seg-btn,
.opt-btn {
  flex: 1;
  padding: 9px 0;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  background: var(--surface-alt);
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.seg-btn.active-debet {
  background: var(--pos-soft);
  color: var(--pos);
}

.seg-btn.active-kredit {
  background: var(--neg-soft);
  color: var(--neg);
}

.opt-btn.active {
  background: var(--brand);
  color: #fff;
}

/* ============================================================
   BUTTONS
   ============================================================ */

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 11px 0;
}

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

.btn-ghost {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  border-radius: 8px;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 11px 0;
}

/* ============================================================
   KAS TYPE DROPDOWN
   ============================================================ */

.kas-type-dropdown {
  position: relative;
  flex-shrink: 0;
}

.kas-type-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.kas-type-dropdown-trigger:hover {
  background: var(--surface-alt);
  border-color: var(--brand);
}

.kas-type-dropdown-trigger:active {
  transform: scale(0.97);
}

.kas-type-dropdown-trigger[aria-expanded="true"] {
  border-color: var(--brand);
  background: var(--surface-alt);
}

.kas-type-dropdown-value {
  display: flex;
  align-items: center;
  gap: 6px;
}

.kas-type-dropdown-value svg {
  flex-shrink: 0;
}

.kas-type-dropdown-chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
  color: var(--ink-faint);
}

.kas-type-dropdown-trigger[aria-expanded="true"] .kas-type-dropdown-chevron {
  transform: rotate(180deg);
}

.kas-type-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 160px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px) scale(0.96);
  transition: all 0.15s ease;
  z-index: 100;
  transform-origin: top right;
}

.kas-type-dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.kas-type-dropdown-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.kas-type-dropdown-option:hover {
  background: var(--surface-alt);
}

.kas-type-dropdown-option:active {
  transform: scale(0.97);
}

.kas-type-dropdown-option.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.kas-type-dropdown-option.active .kas-type-dropdown-option-check {
  opacity: 1;
}

.kas-type-dropdown-option-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--surface-alt);
  color: var(--ink-soft);
}

.kas-type-dropdown-option.active .kas-type-dropdown-option-icon {
  background: var(--brand-soft);
  color: var(--brand);
}

.kas-type-dropdown-option-label {
  flex: 1;
}

.kas-type-dropdown-option-check {
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s ease;
  color: var(--brand);
}

.kas-type-dropdown-option.active .kas-type-dropdown-option-check {
  opacity: 1;
}

@media (max-width: 480px) {
  .kas-type-dropdown-trigger {
    padding: 3px 8px 3px 6px;
    min-height: 24px;
    font-size: 10px;
    gap: 4px;
    border-radius: 6px;
  }

  .kas-type-dropdown-value svg {
    width: 12px;
    height: 12px;
  }

  .kas-type-dropdown-chevron {
    width: 12px;
    height: 12px;
  }

  .kas-type-dropdown-menu {
    min-width: 140px;
    padding: 3px;
  }

  .kas-type-dropdown-option {
    padding: 6px 8px;
    font-size: 11px;
    gap: 8px;
  }

  .kas-type-dropdown-option-icon {
    width: 24px;
    height: 24px;
  }

  .kas-type-dropdown-option-icon svg {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 380px) {
  .kas-type-dropdown-trigger {
    padding: 2px 6px 2px 5px;
    min-height: 22px;
    font-size: 9px;
    gap: 3px;
    border-radius: 5px;
  }

  .kas-type-dropdown-value svg {
    width: 10px;
    height: 10px;
  }

  .kas-type-dropdown-chevron {
    width: 10px;
    height: 10px;
  }

  .kas-type-dropdown-menu {
    min-width: 120px;
    padding: 3px;
  }

  .kas-type-dropdown-option {
    padding: 5px 6px;
    font-size: 10px;
    gap: 6px;
  }

  .kas-type-dropdown-option-icon {
    width: 20px;
    height: 20px;
  }

  .kas-type-dropdown-option-icon svg {
    width: 12px;
    height: 12px;
  }
}

html[data-theme="dark"] .kas-type-dropdown-trigger {
  background: var(--surface-alt);
  border-color: var(--line);
}

html[data-theme="dark"] .kas-type-dropdown-trigger:hover {
  background: var(--surface);
  border-color: var(--brand);
}

html[data-theme="dark"] .kas-type-dropdown-menu {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .kas-type-dropdown-option:hover {
  background: var(--surface-alt);
}

html[data-theme="dark"] .kas-type-dropdown-option.active {
  background: var(--brand-soft);
}

html[data-theme="dark"] .kas-type-dropdown-option-icon {
  background: var(--surface);
}
