/* ===================================================================
   WEALTH APP - MINIMALIST & BOLD MOBILE DESIGN SYSTEM
   Apple Bento UI - Fixed Light & Dark Mode
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,600,0,0');

/* ===================================================================
/* ===================================================================
   1. LIGHT THEME (SOLID CRISP MODERN CLEAN)
   =================================================================== */
:root {
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;

  /* App & Card Colors - 100% Solid, No Opacity */
  --bg-app: #F0F7FF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-card-subtle: #F1F5F9;
  --bg-card-minibox: #F8FAFC;
  --border-card: #E2E8F0;
  --border-card-minibox: #E2E8F0;
  --bg-card-icon: #F1F5F9;
  --bg-card-progress: #E2E8F0;
  --border-card-row: #E2E8F0;

  /* Text Colors */
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-light: #FFFFFF;
  --text-card-title: #0F172A;
  --text-card-primary: #0F172A;
  --text-card-sub: #64748B;

  /* Card Action Button */
  --btn-card-bg: #F1F5F9;
  --btn-card-color: #0F172A;
  --btn-card-border: #E2E8F0;
  --btn-card-bg-active: #E2E8F0;

  /* Financial Accents */
  --accent-green: #10B981;
  --accent-green-bg: #ECFDF5;
  --accent-red: #F43F5E;
  --accent-red-bg: #FFF1F2;
  --accent-blue: #2563EB;
  --accent-blue-bg: #EFF6FF;
  --accent-purple: #8B5CF6;
  --accent-purple-bg: #F5F3FF;
  --accent-amber: #F59E0B;
  --accent-amber-bg: #FEF3C7;
  --accent-cyan: #06B6D4;

  /* Form & Nav */
  --nav-bg: #FFFFFF;
  --nav-border: #E2E8F0;
  --sheet-bg: #FFFFFF;
  --input-bg: #F1F5F9;
  --input-color: #0F172A;
  --btn-primary-bg: #0F172A;
  --btn-primary-color: #FFFFFF;

  --radius-card: 28px;
  --radius-card-sm: 20px;
  --radius-pill: 9999px;

  --shadow-sm: none;
  --shadow-md: none;
  --shadow-sheet: 0 -10px 40px rgba(0, 0, 0, 0.14);

  --nav-height: 82px;
}

/* ===================================================================
   2. DARK THEME (SOLID OBSIDIAN LUXURY - NO OPACITY BLEED)
   =================================================================== */
html.dark-theme,
body.dark-theme {
  /* App & Card Colors - 100% Solid, No Opacity */
  --bg-app: #09090B;
  --bg-card: #18181B;
  --bg-card-hover: #27272A;
  --bg-card-subtle: #27272A;
  --bg-card-minibox: #27272A;
  --border-card: #27272A;
  --border-card-minibox: #27272A;
  --bg-card-icon: #27272A;
  --bg-card-progress: #3F3F46;
  --border-card-row: #27272A;

  /* Text Colors */
  --text-primary: #FFFFFF;
  --text-secondary: #E4E4E7;
  --text-muted: #A1A1AA;
  --text-light: #FFFFFF;
  --text-card-title: #FFFFFF;
  --text-card-primary: #FFFFFF;
  --text-card-sub: #A1A1AA;

  /* Card Action Button */
  --btn-card-bg: #27272A;
  --btn-card-color: #FFFFFF;
  --btn-card-border: #3F3F46;
  --btn-card-bg-active: #3F3F46;

  /* Luminous High-Contrast Accents */
  --accent-green: #10B981;
  --accent-green-bg: #064E3B;
  --accent-red: #F43F5E;
  --accent-red-bg: #4C0519;
  --accent-blue: #3B82F6;
  --accent-blue-bg: #1E3A8A;
  --accent-purple: #A855F7;
  --accent-purple-bg: #3B0764;
  --accent-amber: #F59E0B;
  --accent-amber-bg: #451A03;
  --accent-cyan: #06B6D4;

  /* Form & Nav */
  --nav-bg: #18181B;
  --nav-border: #27272A;
  --sheet-bg: #18181B;
  --input-bg: #27272A;
  --input-color: #FFFFFF;
  --btn-primary-bg: #FFFFFF;
  --btn-primary-color: #09090B;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

html,
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
}

/* Izinkan seleksi teks hanya pada kolom input/textarea */
input,
textarea,
[contenteditable="true"],
[contenteditable="true"] * {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default !important;
}

select {
  -webkit-user-select: auto;
  user-select: auto;
}

body {
  font-family: var(--font-main);
  background: var(--bg-app);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: calc(var(--nav-height) + 40px);
  min-height: 100vh;
  transition: background 0.25s ease, color 0.25s ease;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.35;
  letter-spacing: -0.015em;
}

p {
  line-height: 1.6;
}

/* App Container (Mobile-first wrapper) */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: transparent;
  padding: 24px 20px;
  position: relative;
}

/* Material Symbols Vertically Aligned */
.material-symbols-rounded {
  font-variation-settings: 'FILL' 0, 'wght' 600, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Common Page Title Header */
.page-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* Global Link & Chevron Reset (No Underlines) */
a,
a:hover,
a:focus,
a:active,
a:visited,
.wealth-card,
.wealth-card *,
.card-header,
.card-header *,
.card-chevron,
.card-chevron *,
.material-symbols-rounded,
.item-row,
.item-row * {
  text-decoration: none !important;
  text-decoration-line: none !important;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  padding: 6px 0;
}

.back-link:active {
  opacity: 0.7;
}

.page-title {
  font-size: clamp(24px, 5.5vw, 30px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin-bottom: 20px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Accent Icon Classes */
.title-icon-green {
  color: var(--accent-green) !important;
}

.title-icon-blue {
  color: var(--accent-blue) !important;
}

.title-icon-purple {
  color: var(--accent-purple) !important;
}

.title-icon-red {
  color: var(--accent-red) !important;
}

.title-icon-amber {
  color: var(--accent-amber) !important;
}

.title-icon-cyan {
  color: var(--accent-cyan) !important;
}

/* Header: Your Wealth (Hero Section) */
.wealth-header {
  padding: 16px 0 28px 0;
}

.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.wealth-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
}

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

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
}

.icon-btn:active {
  background: var(--bg-card-subtle);
  transform: scale(0.95);
}

.btn-delete-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-delete-icon:hover {
  color: var(--accent-red);
  background: var(--accent-red-bg);
}

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

.wealth-amount-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 16px 0;
}

.wealth-amount {
  font-size: clamp(34px, 8.5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1.1;
  word-break: break-word;
}

.icon-btn-inline {
  background: var(--bg-card-subtle);
  border: 1px solid var(--border-card-minibox);
  cursor: pointer;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.icon-btn-inline .material-symbols-rounded {
  font-size: 20px;
}

.icon-btn-inline:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

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

.wealth-delta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
}

.badge-green {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

.badge-red {
  background: var(--accent-red-bg);
  color: var(--accent-red);
}

.badge-blue {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
}

.badge-purple {
  background: var(--accent-purple-bg);
  color: var(--accent-purple);
}

.badge-amber {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
}

.badge-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
}

.badge-dark {
  background: var(--bg-card-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-card-minibox);
}

/* ===================================================================
   UNIFIED CARD SPACING ARCHITECTURE (Strict 16px Grid System)
   =================================================================== */
.card-stack,
.card-list-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

/* Eliminate margin conflicts for children of flex stacks */
.card-stack>*,
.card-list-stack>*,
.card-content>* {
  margin-bottom: 0 !important;
}

/* The Core Card */
.wealth-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 24px;
  box-shadow: none;
  border: 1px solid var(--border-card);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease, border-color 0.25s ease;
  position: relative;
  text-decoration: none;
  color: var(--text-card-primary);
  display: block;
  cursor: pointer;
  user-select: none;
  margin-bottom: 16px;
}

.card-stack>.wealth-card,
.card-stack>.card-box,
.card-stack>.grid-2,
.grid-2>.card-box,
.grid-2>.wealth-card,
.grid-2>*,
.card-list-stack>.swipe-item-wrapper,
.card-list-stack>.card-box,
.card-group-list>.swipe-item-wrapper {
  margin-bottom: 0 !important;
}

html.dark-theme .wealth-card,
body.dark-theme .wealth-card {
  box-shadow: none;
  border: 1px solid var(--border-card);
}

.card-box {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 22px;
  box-shadow: none;
  border: 1px solid var(--border-card);
  transition: background-color 0.25s ease, border-color 0.25s ease;
  color: var(--text-card-primary);
  margin-bottom: 16px;
}

html.dark-theme .card-box,
body.dark-theme .card-box {
  box-shadow: none;
  border: 1px solid var(--border-card);
}

.wealth-card:active {
  transform: scale(0.985);
  background: var(--bg-card-hover);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.card-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-card-title);
  line-height: 1.2;
}

.card-chevron {
  color: var(--text-card-sub);
  display: flex;
  align-items: center;
  padding-top: 3px;
}

/* Card Content Blocks */
.card-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.metric-big {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-card-primary);
}

.metric-sub {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-card-sub);
}

/* Progress Bars */
.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg-card-progress);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fill-green {
  background: var(--accent-green);
}

.fill-blue {
  background: var(--accent-blue);
}

.fill-purple {
  background: var(--accent-purple);
}

.fill-amber {
  background: var(--accent-amber);
}

.fill-red {
  background: var(--accent-red);
}

.fill-cyan {
  background: var(--accent-cyan);
}

.fill-dark {
  background: var(--text-card-primary);
}

/* Quick Metric Grid inside Cards & Standalone */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

/* When .grid-2 is inside a card content or minibox, suppress extra bottom spacing */
.card-content>.grid-2,
.mini-box .grid-2 {
  margin-bottom: 0 !important;
}

.mini-box {
  background: var(--bg-card-minibox);
  border: 1px solid var(--border-card-minibox);
  padding: 18px 20px;
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--text-card-primary);
  min-height: 72px;
  justify-content: center;
  margin-bottom: 16px;
}

.mini-box.dark {
  background: #18181B;
  color: #FFFFFF;
}

/* Item Row Component (Apple Fintech Style) */
.item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-card-row);
  line-height: 1.45;
}

.account-clickable-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.account-clickable-row:active {
  background-color: var(--bg-card-subtle) !important;
}

.allocation-bar-track {
  display: flex;
  height: 10px;
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--bg-card-progress);
  margin: 12px 0 16px 0;
  width: 100%;
}

.allocation-bar-fill-goals {
  background: var(--accent-blue);
  height: 100%;
  transition: width 0.3s ease;
}

.allocation-bar-fill-reserve {
  background: var(--accent-green);
  height: 100%;
  transition: width 0.3s ease;
}

.item-row:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.item-row:first-child {
  padding-top: 2px;
}

.item-left {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
  flex: 1;
  margin-right: 12px;
}

.item-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--bg-card-icon);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-card-primary);
  flex-shrink: 0;
}

.item-icon-circle .material-symbols-rounded {
  font-size: 22px;
}

.item-icon-circle.icon-green {
  background: var(--accent-green-bg);
  color: var(--accent-green);
}

.item-icon-circle.icon-red {
  background: var(--accent-red-bg);
  color: var(--accent-red);
}

.item-icon-circle.icon-blue {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
}

.item-icon-circle.icon-purple {
  background: var(--accent-purple-bg);
  color: var(--accent-purple);
}

.item-icon-circle.icon-cyan {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
}

.item-icon-circle.icon-amber {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
}

.item-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-card-primary);
  line-height: 1.45;
  margin-bottom: 3px;
  word-break: break-word;
}

.item-sub {
  font-size: 12px;
  color: var(--text-card-sub);
  font-weight: 500;
  line-height: 1.5;
  display: flex;
  align-items: center;
  gap: 4px;
}

.item-right {
  text-align: right;
  flex-shrink: 0;
  white-space: nowrap;
}

.item-val {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  letter-spacing: -0.01em;
  line-height: 1.4;
}

/* ===================================================================
   iOS SWIPE-TO-REVEAL DELETE ACTION
   =================================================================== */
.swipe-item-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card-sm);
  background: var(--bg-card);
  margin-bottom: 0;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

/* Grouped List Style (iOS Inset Grouped Table View) */
.card-group-list {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: none;
  border: 1px solid var(--border-card);
}

.card-group-list .swipe-item-wrapper {
  border-radius: 0;
  background: var(--bg-card);
  margin-bottom: 0;
  border: none;
}

.card-group-list .swipe-item-wrapper .item-row {
  border-bottom: 1px solid var(--border-card-row);
}

.card-group-list .swipe-item-wrapper:last-child .item-row {
  border-bottom: none;
}

.swipe-item-content {
  position: relative;
  background: var(--bg-card);
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 2;
  width: 100%;
  touch-action: pan-y;
  will-change: transform;
}

.swipe-item-wrapper.card-box-swipe {
  border-radius: var(--radius-card);
  margin-bottom: 0;
  background: var(--bg-card);
}

.swipe-item-wrapper.card-box-swipe .swipe-item-content {
  padding: 16px 20px;
  border-radius: var(--radius-card);
  box-shadow: none;
  border: 1px solid var(--border-card);
}

.swipe-action-revealed {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 84px;
  background: #EF4444;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1;
  border-top-right-radius: inherit;
  border-bottom-right-radius: inherit;
}

.swipe-item-wrapper.is-swiping .swipe-action-revealed,
.swipe-item-wrapper[data-is-open="true"] .swipe-action-revealed {
  display: flex;
}

.btn-swipe-delete {
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
}


.btn-swipe-delete .material-symbols-rounded {
  font-size: 22px;
  color: #FFFFFF !important;
}

.btn-swipe-delete:active {
  background: rgba(0, 0, 0, 0.15);
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--nav-border);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  transition: background-color 0.25s ease;
}

.bottom-nav-inner {
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 10px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  padding: 6px 12px 12px 12px;
  border-radius: 16px;
  transition: all 0.2s ease;
}

.nav-item .material-symbols-rounded {
  font-size: 24px;
}

.nav-item.active {
  color: var(--text-primary);
}

/* Floating Action Button for Quick Add */
.fab-btn {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-pill);
  background: #10B981;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.4);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fab-btn .material-symbols-rounded {
  color: #FFFFFF !important;
  font-size: 28px;
}

.fab-btn:active {
  transform: scale(0.92);
}

/* Modal Bottom Sheet */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-overlay.show {
  display: block;
  opacity: 1;
}

.modal-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 480px;
  background: var(--sheet-bg);
  border-radius: 32px 32px 0 0;
  padding: 12px 24px 34px 24px;
  z-index: 201;
  box-shadow: var(--shadow-sheet);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
  color: var(--text-primary);
  touch-action: pan-y;
  user-select: none;
}

.modal-overlay.show .modal-sheet {
  transform: translateX(-50%) translateY(0);
}

.sheet-handle-area {
  width: 100%;
  padding: 8px 0 16px 0;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: grab;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}

.sheet-handle-area:active {
  cursor: grabbing;
}

.sheet-handle {
  width: 44px;
  height: 5px;
  background: rgba(142, 142, 147, 0.45);
  border-radius: var(--radius-pill);
  pointer-events: none;
  transition: background-color 0.2s ease, width 0.2s ease;
}

.sheet-handle-area:active .sheet-handle {
  background: rgba(142, 142, 147, 0.8);
  width: 50px;
}

.sheet-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 20px;
}

.sheet-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* Tabs inside Modal */
.tab-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  background: var(--input-bg);
  padding: 4px;
  border-radius: var(--radius-card-sm);
  margin-bottom: 20px;
}

.tab-btn {
  background: none;
  border: none;
  padding: 10px 4px;
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.tab-btn.active {
  background: var(--sheet-bg);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Forms */
.form-group {
  margin-bottom: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 14px 16px;
  background: var(--input-bg);
  border: 1px solid transparent;
  border-radius: 16px;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 600;
  color: var(--input-color);
  outline: none;
  transition: border-color 0.2s ease;
}

/* Date Input Mobile Responsiveness & iOS Safari Optimization */
input[type="date"],
input[type="date"].form-input {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  display: block;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: var(--input-bg);
  color: var(--input-color);
  padding: 13px 16px;
  border-radius: 16px;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  height: 48px;
  cursor: pointer;
}

/* iOS Safari & Chrome WebKit Specific Date Controls */
input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  margin: 0;
  padding: 0;
  min-height: 1.3em;
  height: auto;
}

input[type="date"]::-webkit-datetime-edit {
  display: inline-flex;
  padding: 0;
  margin: 0;
}

input[type="date"]::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}

input[type="date"]::-webkit-inner-spin-button {
  display: none;
  -webkit-appearance: none;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.65;
  padding: 2px;
  margin: 0 0 0 auto;
  transition: opacity 0.2s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

html.dark-theme input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.9) brightness(1.2);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-blue);
  background: var(--bg-card);
}

textarea.form-input,
textarea.form-textarea {
  min-height: 86px;
  resize: none;
  line-height: 1.5;
}

/* Currency Amount Input Component */
.input-currency-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.currency-prefix {
  position: absolute;
  left: 18px;
  font-size: 24px;
  font-weight: 800;
  color: var(--text-muted);
  pointer-events: none;
  line-height: 1;
}

.currency-prefix-sm {
  font-size: 15px;
  font-weight: 700;
  left: 16px;
}

.input-hero {
  font-size: 26px !important;
  font-weight: 800 !important;
  padding: 14px 18px 14px 58px !important;
  color: var(--text-primary) !important;
  letter-spacing: -0.02em;
}

.btn-primary {
  width: 100%;
  padding: 16px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-color);
  border: none;
  border-radius: var(--radius-card-sm);
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.btn-danger {
  width: 100%;
  height: 52px;
  background: var(--accent-red);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.3);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.btn-danger:active {
  transform: scale(0.98);
  box-shadow: 0 2px 10px rgba(244, 63, 94, 0.2);
}

.btn-secondary {
  width: 100%;
  height: 50px;
  background: var(--bg-card-subtle);
  color: var(--text-primary);
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease;
}

.btn-secondary:hover {
  background: var(--border-card-row);
}

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

/* Toast Notification */
.toast-msg {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--text-primary);
  color: var(--text-light);
  padding: 12px 20px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  z-index: 999;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
}

/* 2-Column Prominent Action Buttons */
.btn-action-col {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 12px;
  border-radius: var(--radius-card-sm);
  border: none;
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: none;
}

.btn-action-col .material-symbols-rounded {
  font-size: 20px;
}

.btn-action-col:active {
  transform: scale(0.97);
}

.btn-action-green {
  background: var(--accent-green-bg);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

html.dark-theme .btn-action-green,
body.dark-theme .btn-action-green {
  background: rgba(16, 185, 129, 0.18);
  color: #34D399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.btn-action-red {
  background: var(--accent-red-bg);
  color: #E11D48;
  border: 1px solid rgba(244, 63, 94, 0.2);
}

html.dark-theme .btn-action-red,
body.dark-theme .btn-action-red {
  background: rgba(244, 63, 94, 0.2);
  color: #FB7185;
  border: 1px solid rgba(251, 113, 133, 0.35);
}

.btn-action-blue {
  background: var(--accent-blue-bg);
  color: var(--accent-blue);
  border: 1px solid rgba(37, 99, 235, 0.2);
}

html.dark-theme .btn-action-blue,
body.dark-theme .btn-action-blue {
  background: rgba(37, 99, 235, 0.2);
  color: #60A5FA;
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.btn-action-dark {
  background: var(--bg-card-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-card-minibox);
}

html.dark-theme .btn-action-dark,
body.dark-theme .btn-action-dark {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Card Action Button (e.g. Bayar Pokok, Setor Tabungan) */
.btn-card-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  border-radius: 16px;
  border: 1px solid var(--btn-card-border);
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  background: var(--btn-card-bg);
  color: var(--btn-card-color);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 12px;
}

.btn-card-action:active {
  transform: scale(0.98);
  background: var(--btn-card-bg-active);
}

.btn-card-action .material-symbols-rounded {
  font-size: 18px;
}