/* ===================================================================
 * FinansialKu PWA - Modern Clean & Futuristic FinTech Mobile Styling
 * =================================================================== */

:root {
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Primary & Accent Palettes */
  --color-primary: #4f46e5;       /* Indigo Vibrant */
  --color-primary-hover: #4338ca;
  --color-accent-cyan: #06b6d4;   /* Neon Teal / Cyan */
  --color-accent-purple: #8b5cf6;
  
  /* Financial Indicators */
  --color-income: #10b981;        /* Emerald Green */
  --color-income-light: #ecfdf5;
  --color-expense: #ef4444;       /* Rose Red */
  --color-expense-light: #fef2f2;
  
  /* Backgrounds & Glass Surface */
  --bg-app: #f8fafc;              /* Slate 50 Clean */
  --bg-card: rgba(255, 255, 255, 0.90);
  --bg-glass: rgba(255, 255, 255, 0.82);
  --border-glass: rgba(226, 232, 240, 0.85);
  
  /* Typography */
  --text-main: #0f172a;           /* Slate 900 */
  --text-secondary: #475569;      /* Slate 600 */
  --text-muted: #94a3b8;          /* Slate 400 */
  --text-inverse: #ffffff;
  
  /* Elevation Shadows */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 30px -4px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 10px 25px -5px rgba(79, 70, 229, 0.35);

  /* Dimensions & Safe Areas */
  --nav-height: 64px;
  --header-height: 58px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 50%);
  background-attachment: fixed;
}

/* App Wrapper: Centered container on large screens, 100% on mobile */
.app-container {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: transparent;
}

/* Glassmorphism Helper */
.glass-panel {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
}

/* Top Header */
.top-header {
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-logo-glow {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent-cyan));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.brand-avatar-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.18);
  border: 1.5px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  flex-shrink: 0;
}

.brand-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pin-avatar-wrap {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.2);
  border: 3px solid #ffffff;
  margin: 0 auto 0.85rem;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(79, 70, 229, 0.1);
  color: var(--color-primary);
  margin-left: 4px;
  text-transform: uppercase;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sync-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 9px;
  background: rgba(241, 245, 249, 0.9);
  border-radius: 20px;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.sync-badge.syncing .sync-dot {
  background: #f59e0b;
  animation: pulse 1s infinite;
}

.sync-badge.error .sync-dot {
  background: #ef4444;
}

.icon-action-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.icon-action-btn:active {
  transform: rotate(180deg) scale(0.92);
}

/* Main Content Views */
.main-content {
  flex: 1;
  padding: 1rem 1.25rem calc(var(--nav-height) + var(--safe-bottom) + 1.5rem);
}

.view-section {
  display: none;
  opacity: 0;
  will-change: transform, opacity;
}

.view-section.active {
  display: block;
  opacity: 1;
  animation: fadeIn 0.2s ease-out;
}

.view-section.active.slide-in-left {
  animation: slideFromRight 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.view-section.active.slide-in-right {
  animation: slideFromLeft 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideFromRight {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideFromLeft {
  from {
    transform: translateX(-40px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.page-headline {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}

.page-subline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

/* Period Filter Bar */
.period-filter-bar {
  display: flex;
  background: rgba(241, 245, 249, 0.95);
  border-radius: 14px;
  padding: 4px;
  margin-bottom: 1rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.period-pill {
  flex: 1;
  border: none;
  background: transparent;
  padding: 7px 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.period-pill.active {
  background: #ffffff;
  color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Custom Date Range Box */
.custom-range-picker {
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.range-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.range-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.range-field input {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
  background: #fff;
  font-family: inherit;
  font-size: 0.9rem;
}

/* Hero Net Balance Card */
.balance-card-hero {
  border-radius: 24px;
  padding: 1.5rem 1.4rem;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 40%, #0e7490 100%);
  color: #ffffff;
  box-shadow: 0 16px 36px -8px rgba(30, 27, 75, 0.4);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.balance-card-hero::after {
  content: '';
  position: absolute;
  top: -40%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.balance-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.meta-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.meta-period {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
}

.balance-value {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
  line-height: 1.15;
}

.balance-stats-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 0.85rem 1rem;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
}

.stat-icon-wrapper {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-item.income .stat-icon-wrapper {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
}

.stat-item.expense .stat-icon-wrapper {
  background: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.stat-label {
  display: block;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.75);
}

.stat-val {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.stat-divider {
  width: 1px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  margin: 0 0.5rem;
}

/* Sections */
.section-block {
  margin-bottom: 1.5rem;
}

.section-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.75rem;
}

.section-header-flex .section-title {
  margin-bottom: 0;
}

.btn-text-link {
  border: none;
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
}

/* Smart Insights Grid */
.insights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.insight-card {
  padding: 0.85rem 0.65rem;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.insight-badge {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.insight-highlight {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insight-desc {
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.25;
}

/* ===================================================================
 * Apple Wallet / Revolut Style Visual Charts & Cards
 * =================================================================== */
.revolut-donut-card {
  padding: 1.25rem 1rem;
  border-radius: 24px;
}

.revolut-chart-flex {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.15rem;
}

.revolut-donut-wrapper {
  position: relative;
  width: 210px;
  height: 210px;
  margin: 0 auto;
}

.donut-center-info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  padding: 0 10px;
}

.donut-center-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.donut-center-val {
  font-size: 1.22rem;
  font-weight: 800;
  color: #0f172a;
  margin-top: 3px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.category-legend-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(226, 232, 240, 0.9);
}

.cat-pill-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 5px 10px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  font-size: 0.74rem;
  font-weight: 700;
  color: #334155;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.pill-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pill-pct {
  font-size: 0.66rem;
  font-weight: 800;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 6px;
}

.chart-card {
  padding: 1.35rem 1.15rem;
  border-radius: 24px;
  margin-bottom: 1.25rem;
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.chart-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.01em;
}

.chart-card-sub {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 2px;
}

.legend-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-chip-income {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  font-size: 0.68rem;
  font-weight: 700;
}

.legend-chip-expense {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(244, 63, 94, 0.12);
  color: #e11d48;
  font-size: 0.68rem;
  font-weight: 700;
}

.dot-income {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
}

.dot-expense {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f43f5e;
}

.chart-wrapper-line {
  height: 220px;
  width: 100%;
}

.chart-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem 0;
}

/* Revolut Style Category Breakdown Cards */
.revolut-cat-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.revolut-cat-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 18px;
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
  transition: transform 0.15s, box-shadow 0.15s;
}

.revolut-cat-card:active {
  transform: scale(0.98);
}

.revolut-cat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.revolut-cat-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.revolut-cat-squircle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.revolut-cat-meta {
  display: flex;
  flex-direction: column;
}

.revolut-cat-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #0f172a;
}

.revolut-cat-count {
  font-size: 0.7rem;
  color: #94a3b8;
  font-weight: 600;
}

.revolut-cat-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-align: right;
}

.revolut-cat-amount {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
}

.revolut-cat-badge {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
}

.revolut-track {
  width: 100%;
  height: 7px;
  background: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}

.revolut-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Transaction List Items */
.transaction-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.trx-item-card {
  padding: 0.9rem 1rem;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.75);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.trx-item-card:active {
  transform: scale(0.98);
}

.trx-left {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.trx-icon-bubble {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.trx-icon-bubble.income {
  background: var(--color-income-light);
  color: var(--color-income);
}

.trx-icon-bubble.expense {
  background: var(--color-expense-light);
  color: var(--color-expense);
}

.trx-details {
  display: flex;
  flex-direction: column;
}

.trx-category {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.trx-note {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.trx-date {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.trx-right {
  text-align: right;
}

.trx-amount {
  font-size: 0.95rem;
  font-weight: 800;
}

.trx-amount.income {
  color: var(--color-income);
}

.trx-amount.expense {
  color: var(--color-expense);
}

/* Search & Filter Controls */
.search-filter-box {
  padding: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff;
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 8px 12px;
}

.search-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 0.85rem;
}

.clear-search-btn {
  border: none;
  background: #f1f5f9;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.65rem;
  cursor: pointer;
}

.filter-type-tabs {
  display: flex;
  gap: 0.4rem;
}

.filter-tab {
  flex: 1;
  padding: 6px 0;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border-glass);
  background: #ffffff;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
}

.filter-tab.active {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

.category-filter-select-wrap select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
  background: #ffffff;
  font-family: inherit;
  font-size: 0.82rem;
  color: var(--text-main);
  outline: none;
}

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(226, 232, 240, 0.7);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
}

.nav-item {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
  width: 60px;
  transition: all 0.2s;
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.24s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.nav-item.active .nav-icon {
  transform: translateY(-2px) scale(1.12);
}

.nav-item.active .nav-icon svg {
  stroke-width: 2.5;
}

.nav-fab-holder {
  position: relative;
  width: 60px;
  display: flex;
  justify-content: center;
}

.fab-btn {
  position: absolute;
  top: -24px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid #ffffff;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent-cyan) 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px -2px rgba(79, 70, 229, 0.45);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

/* Modals & Bottom Sheets */
.bottom-sheet-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}

.bottom-sheet-content {
  position: relative;
  background: #ffffff;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  padding: 1.25rem 1.4rem calc(1.5rem + var(--safe-bottom));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.sheet-handle-bar {
  width: 40px;
  height: 5px;
  border-radius: 10px;
  background: #cbd5e1;
  margin: 0 auto 1rem;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.sheet-title {
  font-size: 1.2rem;
  font-weight: 800;
}

.sheet-close-btn {
  border: none;
  background: #f1f5f9;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
}

/* Type Toggle Buttons */
.type-toggle-container {
  display: flex;
  background: #f1f5f9;
  border-radius: 16px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 1.25rem;
}

.type-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 0;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.type-btn.active.expense {
  background: var(--color-expense);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.type-btn.active.income {
  background: var(--color-income);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Nominal Input */
.nominal-input-container {
  background: #f8fafc;
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  text-align: center;
}

.input-label-sm {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.nominal-display-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}

.currency-prefix {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-primary);
}

.big-nominal-field {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  outline: none;
  width: 220px;
  text-align: left;
}

.quick-chips-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.chip-btn {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.chip-btn:active {
  background: #e2e8f0;
  transform: scale(0.95);
}

.chip-btn.clear {
  color: var(--color-expense);
  font-weight: 800;
}

/* Category Grid Chips */
.category-chips-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cat-chip {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  border-radius: 12px;
  padding: 0.65rem 0.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
  transition: all 0.15s;
}

.cat-chip:active {
  transform: scale(0.95);
}

.cat-chip.selected {
  border-color: var(--color-primary);
  background: rgba(79, 70, 229, 0.08);
}

.cat-chip-icon {
  font-size: 1.25rem;
}

.cat-chip-name {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.cat-chip.selected .cat-chip-name {
  color: var(--color-primary);
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.styled-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-family: inherit;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}

.styled-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.field-help {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

/* Buttons */
.btn-submit-main {
  width: 100%;
  border: none;
  padding: 14px 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--color-primary) 0%, #3b82f6 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: transform 0.15s, opacity 0.15s;
}

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

.btn-primary-sm {
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.btn-primary {
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
}

.btn-secondary {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
}

.btn-danger {
  border: none;
  background: var(--color-expense);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
}

.btn-danger-outline {
  border: 1px solid var(--color-expense);
  background: transparent;
  color: var(--color-expense);
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
}

.modal-split-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-delete-action {
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: var(--color-expense-light);
  color: var(--color-expense);
  padding: 0 1.25rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.flex-1 {
  flex: 1;
}

/* Spinner */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* Alert Modal */
.alert-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.alert-modal-box {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: #ffffff;
  border-radius: 24px;
  padding: 1.75rem 1.5rem;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.alert-icon-wrap {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-expense-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.alert-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.alert-msg {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.alert-actions {
  display: flex;
  gap: 0.75rem;
}

.alert-actions button {
  flex: 1;
}

/* PIN Lock Screen */
.pin-lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.pin-card {
  width: 100%;
  max-width: 340px;
  background: #ffffff;
  border-radius: 28px;
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.pin-icon-wrap {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent-cyan));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
}

.pin-title {
  font-size: 1.35rem;
  font-weight: 800;
}

.pin-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.pin-dots {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  transition: all 0.2s;
}

.dot.filled {
  background: var(--color-primary);
  border-color: var(--color-primary);
  transform: scale(1.15);
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.key-btn {
  width: 65px;
  height: 65px;
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid #f1f5f9;
  background: #f8fafc;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}

.key-btn:active {
  background: #e2e8f0;
  transform: scale(0.92);
}

.key-btn.clear, .key-btn.del {
  font-size: 1rem;
  color: var(--text-secondary);
}

.pin-error {
  font-size: 0.8rem;
  color: var(--color-expense);
  font-weight: 600;
  margin-top: 1rem;
}

/* Settings View Specifics */
.settings-card {
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.card-icon-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.icon-wrap-green {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--color-income-light);
  color: var(--color-income);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-wrap-indigo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(79, 70, 229, 0.12);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.settings-actions {
  display: flex;
  gap: 0.75rem;
}

.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--color-primary);
}

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

.pin-change-group {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.test-result-msg {
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 0.75rem;
}

.test-result-msg.success {
  color: var(--color-income);
}

.test-result-msg.error {
  color: var(--color-expense);
}

.app-info-footer {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 1.5rem 0 0.5rem;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 400px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-left: 5px solid var(--color-primary);
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success {
  border-left-color: var(--color-income);
}

.toast.error {
  border-left-color: var(--color-expense);
}

/* Setup Welcome Box */
.setup-welcome-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(79, 70, 229, 0.08);
  border-radius: 14px;
  padding: 0.85rem;
  margin-bottom: 1.25rem;
}

.setup-step-pill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* Utilities & Animations */
.hidden {
  display: none !important;
}

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mt-3 { margin-top: 0.75rem; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideDown {
  from { transform: translateY(-50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleUp {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===================================================================
 * Paksa Sembunyikan Toolbar / Badge / Drawer Bawaan Netlify
 * =================================================================== */
a[href*="netlify"],
[class*="netlify"],
[id*="netlify"],
#netlify-drawer,
netlify-drawer,
netlify-cdp,
[id*="netlify-cdp"],
[class*="netlify-cdp"],
iframe[src*="netlify"],
iframe[id*="netlify"],
div[data-netlify-drawer],
[class*="feedback-drawer"],
.netlify-badge {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  width: 0 !important;
  position: absolute !important;
  bottom: -9999px !important;
  z-index: -9999 !important;
}
  height: 0 !important;
  width: 0 !important;
  position: absolute !important;
  bottom: -9999px !important;
}
