@layer legacy {
/* ═══════════════════════════════════════════════════════════════
   Styles.html — Daily App Design System
   Converted from Stitch Tailwind UI to Vanilla CSS
   Source of Truth: design.md + Stitch DESIGN.md
   ═══════════════════════════════════════════════════════════════ */


/* ═══════════════════════════
   1. DESIGN TOKENS
   ═══════════════════════════ */
:root {
  /* ── Colors (from Stitch DESIGN.md) ── */
  --background:              #F7F9FB;
  --surface:                 #F7F9FB;
  --surface-dim:             #D8DADC;
  --surface-bright:          #F7F9FB;
  --surface-container-lowest:#FFFFFF;
  --surface-container-low:   #F2F4F6;
  --surface-container:       #ECEEF0;
  --surface-container-high:  #E6E8EA;
  --surface-container-highest:#E0E3E5;

  --card-bg:                 #FFFFFF;
  --surface-soft:            #F1F5F9;
  --surface-variant:         #E0E3E5;

  --on-surface:              #191C1E;
  --on-surface-variant:      #45464D;
  --on-background:           #191C1E;

  --foreground:              #000000;
  --primary:                 #2563EB;
  --primary-hover:           #1D4ED8;
  --primary-light:           #60A5FA;
  --on-primary:              #FFFFFF;
  --primary-container:       #2563EB;
  --on-primary-container:    #FFFFFF;

  --muted-foreground:        #475569;
  --border:                  #E2E8F0;
  --outline:                 #76777D;
  --outline-variant:         #C6C6CD;

  --secondary:               #121212;
  --on-secondary:            #FFFFFF;
  --secondary-container:     #2A2A2A;
  --on-secondary-container:  #F1F5F9;

  --inverse-surface:         #2D3133;
  --inverse-on-surface:      #EFF1F3;
  --inverse-primary:         #BEC6E0;

  --danger:                  #EF4444;
  --error:                   #BA1A1A;
  --on-error:                #FFFFFF;
  --favorit-bg:              #FEF2F2;
  --favorit-stroke:          #FCA5A5;

  --surface-tint:            #565E74;

  /* ── Semantic Colors ── */
  --color-income:            #059669;
  --color-income-bg:         #F0FDF4;
  --color-income-border:     #BBF7D0;
  --color-expense:           #DC2626;
  --color-expense-bg:        #FEF2F2;
  --color-expense-border:    #FECACA;

  /* ── Spacing (8px Grid Rule) ── */
  --space-4:   4px;
  --space-8:   8px;
  --space-12:  12px;
  --space-16:  16px;
  --space-20:  20px;
  --space-24:  24px;
  --space-32:  32px;
  --space-48:  48px;

  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  32px;
  --space-2xl: 48px;

  --container-mobile:  20px;
  --container-desktop: 48px;
  --gutter:      16px;

  /* ── Typography (Stitch Aura Glass: Sora Display + Plus Jakarta Sans Body) ── */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Sora', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  --text-headline-lg:        26px;
  --lh-headline-lg:          32px;
  --fw-headline-lg:          800;

  --text-headline-lg-mobile: 22px;
  --lh-headline-lg-mobile:   28px;
  --fw-headline-lg-mobile:   700;

  --text-section-heading:    16px;
  --lh-section-heading:      22px;
  --fw-section-heading:      700;

  --text-body-md:            14px;
  --lh-body-md:              20px;
  --fw-body-md:              400;

  --text-body-sm:            12.5px;
  --lh-body-sm:              18px;
  --fw-body-sm:              500;

  --text-label-badge:        11px;
  --lh-label-badge:          11px;
  --fw-label-badge:          700;

  /* ── Border Radius (Stitch Aura Glass Squircle Curvature) ── */
  --radius-xs:    6px;
  --radius-sm:    10px;
  --radius-md:    14px;
  --radius-lg:    20px;
  --radius-xl:    24px;
  --radius-card:  24px;
  --radius-card-sm: 16px;
  --radius-btn:   14px;
  --radius-modal: 28px;
  --radius-full:  9999px;

  /* ── Emil Kowalski & Apple Custom Motion Curves (craft-design.md) ── */
  --ease-out-expo:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quint:    cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out-smooth: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer-apple: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-button-press: cubic-bezier(0.2, 0, 0, 1);


  /* ── Shadows ── */
  --shadow-sm:    0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:    0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg:    0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
  --shadow-xl:    0 20px 50px rgba(0, 0, 0, 0.2);
  --shadow-btn:   0 2px 6px rgba(15, 23, 42, 0.12);
  --shadow-btn-hover: 0 4px 12px rgba(15, 23, 42, 0.2);
  --shadow-fab:   0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -2px rgba(15, 23, 42, 0.05);
  --shadow-nav:   0 -4px 16px rgba(0, 0, 0, 0.06);

  /* ── Transitions ── */
  --transition-fast:   150ms ease;
  --transition-normal: 200ms ease;
  --transition-smooth: 300ms ease;

  /* ── Z-Index ── */
  --z-page:     1;
  --z-fab:      30;
  --z-nav:      40;
  --z-header:   40;
  --z-modal:    9999;
  --z-toast:    10000;
}


/* ═══════════════════════════
   2. RESET & BASE
   ═══════════════════════════ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  font-size: var(--text-body-md);
  line-height: var(--lh-body-md);
  font-weight: var(--fw-body-md);
  color: var(--on-surface);
  background-color: var(--background);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }


/* ═══════════════════════════
   3. TYPOGRAPHY
   ═══════════════════════════ */
.text-headline-lg {
  font-family: var(--font-display);
  font-size: var(--text-headline-lg);
  line-height: var(--lh-headline-lg);
  font-weight: var(--fw-headline-lg);
  color: var(--foreground);
  letter-spacing: -0.025em;
}

.text-headline-lg-mobile {
  font-family: var(--font-display);
  font-size: var(--text-headline-lg-mobile);
  line-height: var(--lh-headline-lg-mobile);
  font-weight: var(--fw-headline-lg-mobile);
  color: var(--foreground);
  letter-spacing: -0.02em;
}

.text-section-heading {
  font-family: var(--font-display);
  font-size: var(--text-section-heading);
  line-height: var(--lh-section-heading);
  font-weight: var(--fw-section-heading);
  color: var(--foreground);
  letter-spacing: -0.01em;
}

.text-body-md {
  font-size: var(--text-body-md);
  line-height: var(--lh-body-md);
  font-weight: var(--fw-body-md);
}

.text-body-sm {
  font-size: var(--text-body-sm);
  line-height: var(--lh-body-sm);
  font-weight: var(--fw-body-sm);
}

.text-label-badge {
  font-size: var(--text-label-badge);
  line-height: var(--lh-label-badge);
  font-weight: var(--fw-label-badge);
}

.text-muted { color: var(--muted-foreground); }
.text-primary { color: var(--foreground); }
.text-secondary { color: var(--secondary); }
.text-danger { color: var(--danger); }
.text-on-surface-variant { color: var(--on-surface-variant); }
.text-income { color: var(--color-income); }
.text-expense { color: var(--color-expense); }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.line-through { text-decoration: line-through; }
.italic { font-style: italic; }
.line-clamp-1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ═══════════════════════════
   4. LAYOUT
   ═══════════════════════════ */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  background: var(--background);
}

.page-section {
  padding: 0 var(--container-mobile);
  padding-bottom: 120px;
}

.page-section.hidden {
  display: none;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) var(--container-mobile);
  position: sticky;
  top: 0;
  background: var(--background);
  z-index: var(--z-header);
  backdrop-filter: blur(12px);
  background-color: rgba(247, 249, 251, 0.85);
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--secondary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  user-select: none;
}

.material-symbols-outlined {
  font-family: 'Material Symbols Outlined', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

.page-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: var(--space-sm);
  min-height: calc(100dvh - 180px);
}

.page-content > * {
  margin-top: 0;
  margin-bottom: 0;
}


/* ═══════════════════════════
   5. CARD & CONTAINERS
   ═══════════════════════════ */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: transform 140ms var(--ease-button-press), background var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 140ms var(--ease-button-press), background var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}


/* ═══════════════════════════
   6. AVATAR
   ═══════════════════════════ */
.avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.avatar-sm {
  width: 36px;
  height: 36px;
}


/* ═══════════════════════════
   7. BUTTONS (Min 44px Touch Target)
   ═══════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  border-radius: var(--radius-btn);
  font-weight: 600;
  font-size: var(--text-body-md);
  line-height: var(--lh-body-md);
  transition: all var(--transition-normal);
  white-space: nowrap;
  user-select: none;
  min-height: 44px;
  padding: 12px 20px;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  min-height: 46px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 50%, #3B82F6 100%);
  color: #FFFFFF;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  border-radius: var(--radius-btn);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1E40AF 0%, #1D4ED8 100%);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.55);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-primary-dark {
  min-height: 46px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 50%, #3B82F6 100%);
  color: #FFFFFF;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  border-radius: var(--radius-btn);
}
.btn-primary-dark:hover {
  background: linear-gradient(135deg, #1E40AF 0%, #1D4ED8 100%);
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.55);
}

.btn-secondary {
  min-height: 48px;
  padding: 12px 20px;
  background: var(--secondary, #0F172A);
  color: var(--on-secondary, #FFFFFF);
  font-weight: 700;
  border-radius: 14px;
  border: 1px solid transparent;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15);
  transition: all 180ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -0.01em;
}
.btn-secondary:hover {
  background: #1E293B;
  color: #FFFFFF;
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.22);
}
.btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

.btn-ghost {
  min-height: 44px;
  padding: 10px 16px;
  color: var(--muted-foreground);
}
.btn-ghost:hover {
  background: var(--surface-soft);
}

.btn-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-soft);
  color: var(--on-surface);
  transition: all var(--transition-normal);
}
.btn-icon:hover {
  background: var(--surface-variant);
}

.btn-icon-lg {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-lg);
}

.btn-full {
  width: 100%;
}



/* ═══════════════════════════
   8. FAB (Floating Action Button)
   ═══════════════════════════ */
.fab {
  position: fixed;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  right: max(20px, calc(50% - 240px + 20px));
  width: 52px;
  height: 52px;
  min-width: 52px;
  min-height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25), 0 2px 6px rgba(15, 23, 42, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  z-index: var(--z-fab);
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.2s ease;
}
.fab:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.35), 0 4px 10px rgba(15, 23, 42, 0.15);
}
.fab:active {
  transform: scale(0.95);
}
.fab .material-symbols-outlined {
  font-size: 26px;
  font-variation-settings: 'wght' 600;
}

@media (max-width: 480px) {
  .fab {
    right: 20px;
  }
}


/* ═══════════════════════════
   9. BOTTOM NAVIGATION
   ═══════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 440px;
  height: 64px;
  z-index: var(--z-nav);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.09), 0 2px 8px rgba(0, 0, 0, 0.04);
  border-radius: 16px;
  overflow: hidden;
  transition: transform var(--transition-fast);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  border-radius: 12px;
  position: relative;
  color: #475569;
  transition: transform 140ms var(--ease-button-press), background 180ms ease, color 180ms ease;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  user-select: none;
}

.nav-item:active {
  transform: scale(0.96);
}

.nav-item .material-symbols-outlined {
  font-size: 22px;
  color: #475569;
  transition: color 180ms ease, transform 180ms ease;
  font-variation-settings: 'FILL' 0;
}

.nav-item-label {
  font-size: 11px;
  line-height: 14px;
  font-weight: 500;
  margin-top: 2px;
  color: #475569;
  transition: color 180ms ease;
}

/* Light mode active tab (Matches Image 1: soft rounded squircle with solid dark text & icon) */
.nav-item.active {
  background: #E2E8F0;
  color: #0F172A;
}

.nav-item.active::before {
  display: none;
}

.nav-item.active .material-symbols-outlined {
  color: #0F172A;
  font-variation-settings: 'FILL' 1;
}

.nav-item.active .nav-item-label {
  color: #0F172A;
  font-weight: 700;
}

.nav-item:not(.active):hover {
  background: rgba(0, 0, 0, 0.04);
  color: #0F172A;
}


/* ═══════════════════════════
   10. MATERIAL SYMBOLS
   ═══════════════════════════ */
.material-symbols-outlined {
  font-size: 24px;
  font-variation-settings: 'FILL' 0, 'wght' 400;
}

.icon-sm {
  font-size: 16px;
}

.icon-md {
  font-size: 18px;
}

.icon-filled {
  font-variation-settings: 'FILL' 1;
}

.icon-circle {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon-circle-sm {
  width: 28px;
  height: 28px;
}

.icon-circle-lg {
  width: 40px;
  height: 40px;
}

.icon-circle-secondary {
  background: rgba(18, 18, 18, 0.08);
  color: var(--secondary);
}

.icon-circle-orange {
  background: #FFF7ED;
  color: #EA580C;
}

.icon-circle-blue {
  background: #EFF6FF;
  color: #2563EB;
}

.icon-circle-surface {
  background: var(--surface-variant);
  color: var(--on-surface-variant);
}


/* ═══════════════════════════
   11. MODAL / DIALOG
   ═══════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-smooth), visibility var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--card-bg);
  border-radius: var(--radius-modal) var(--radius-modal) 0 0;
  box-shadow: var(--shadow-xl);
  padding: 16px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--outline-variant) transparent;
  transform: translateY(100%);
  transition: transform var(--transition-smooth);
  position: relative;
}

.modal-content::-webkit-scrollbar {
  width: 6px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--outline-variant);
  border-radius: 6px;
}

.modal-sticky-footer {
  position: sticky;
  bottom: calc(-16px - env(safe-area-inset-bottom, 0px));
  margin-left: -18px;
  margin-right: -18px;
  margin-bottom: calc(-16px - env(safe-area-inset-bottom, 0px));
  margin-top: 10px;
  padding: 10px 18px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--card-bg, #FFFFFF);
  border-top: 1px solid var(--border, #E2E8F0);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
  z-index: 20;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.dark-mode .modal-sticky-footer {
  background: rgba(14, 20, 38, 0.96);
  border-top-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.4);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-center .modal-content {
  align-self: center;
  border-radius: var(--radius-modal);
  max-width: min(100% - 32px, 400px);
  transform: scale(0.95) translateY(10px);
  opacity: 0;
}

.modal-center.active .modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--outline-variant);
  border-radius: var(--radius-full);
  margin: 0 auto var(--space-md);
}

.modal-title {
  font-size: var(--text-section-heading);
  font-weight: var(--fw-section-heading);
  color: var(--foreground);
  margin-bottom: var(--space-md);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
}


/* ═══════════════════════════
   12. TOAST
   ═══════════════════════════ */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: calc(100% - 32px);
  max-width: 448px;
  pointer-events: none;
}

.toast {
  background: var(--inverse-surface);
  color: var(--inverse-on-surface);
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: var(--text-body-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  animation: toastIn 0.3s ease forwards;
  pointer-events: auto;
}

.toast.toast-out {
  animation: toastOut 0.3s ease forwards;
}

.toast-success { border-left: 3px solid #10B981; }
.toast-error   { border-left: 3px solid var(--danger); }
.toast-info    { border-left: 3px solid var(--secondary); }

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

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


/* ═══════════════════════════
   13. LOADING
   ═══════════════════════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast);
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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


/* ═══════════════════════════
   14. FORM ELEMENTS
   ═══════════════════════════ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.form-label {
  font-size: var(--text-body-sm);
  font-weight: 600;
  color: var(--foreground);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-body-md);
  color: var(--on-surface);
  transition: border-color var(--transition-fast);
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-input::placeholder {
  color: var(--muted-foreground);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}


/* ═══════════════════════════
   15. CHIPS / PILLS
   ═══════════════════════════ */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-label-badge);
  font-weight: var(--fw-label-badge);
  background: var(--surface-soft);
  color: var(--on-surface-variant);
}

.pill-secondary {
  background: rgba(18, 18, 18, 0.08);
  color: var(--secondary);
}

.pill-active {
  background: var(--secondary);
  color: var(--on-secondary);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: var(--text-label-badge);
  font-weight: var(--fw-label-badge);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--on-surface-variant);
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.chip:hover {
  background: var(--surface-variant);
}

.chip.selected {
  background: rgba(18, 18, 18, 0.08);
  border-color: var(--secondary);
  color: var(--secondary);
}

.chip-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #D97706;
}

.chip-warning:hover {
  background: rgba(245, 158, 11, 0.25);
}

body.dark-mode .chip-warning {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.4);
  color: #FBBF24;
}


/* ═══════════════════════════
   16. PROGRESS BAR
   ═══════════════════════════ */
.progress-bar {
  width: 100%;
  height: 12px;
  background: var(--surface-soft);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--secondary);
  border-radius: var(--radius-full);
  transition: width 0.5s ease-out;
}


/* ═══════════════════════════
   17. CIRCULAR PROGRESS
   ═══════════════════════════ */
.circular-progress {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}

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

.circular-progress-bg {
  fill: none;
  stroke: var(--surface-soft);
  stroke-width: 4;
}

.circular-progress-fill {
  fill: none;
  stroke: var(--secondary);
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dasharray 1s ease-out;
}

.circular-progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: var(--text-headline-lg-mobile);
  font-weight: var(--fw-headline-lg-mobile);
  color: var(--foreground);
}


/* ═══════════════════════════
   18. CHECKLIST
   ═══════════════════════════ */
.checklist-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  min-height: 48px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  margin-bottom: 8px;
}

.checklist-item:last-child {
  margin-bottom: 0;
}

.checklist-item:hover {
  background: var(--surface-soft);
}

.checklist-checkbox {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid var(--outline-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: var(--space-12);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.checklist-item.done .checklist-checkbox {
  background: var(--secondary);
  border-color: var(--secondary);
  color: white;
}

.checklist-item.done .checklist-checkbox .material-symbols-outlined {
  font-size: 16px;
  font-variation-settings: 'FILL' 1;
}

.checklist-label {
  flex: 1;
  font-size: var(--text-body-md);
  font-weight: 600;
  color: var(--foreground);
}

.checklist-item.done .checklist-label {
  color: var(--on-surface-variant);
  text-decoration: line-through;
}

.checklist-chevron {
  color: var(--outline-variant);
  opacity: 0.7;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.checklist-item:hover .checklist-chevron {
  opacity: 1;
  color: var(--secondary);
  transform: translateX(2px);
}


/* ═══════════════════════════
   19. HEATMAP
   ═══════════════════════════ */
/* ═══════════════════════════
   20. DATE TRACKER GRID (Habit & Learn)
   ═══════════════════════════ */
.tracker-view-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: var(--surface-soft, #F1F5F9);
  color: var(--foreground);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tracker-view-all-btn:hover {
  background: var(--surface-variant, #E2E8F0);
  transform: translateY(-1px);
}

.tracker-date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.tracker-date-cell {
  position: relative;
  aspect-ratio: 1;
  min-height: 38px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  user-select: none;
  transition: all 0.2s ease;
  background: var(--surface-soft, #F1F5F9);
  color: var(--muted-foreground, #94A3B8);
  border: 1px solid transparent;
}

/* Missed / Not checked past date */
.tracker-date-cell.missed {
  background: rgba(0, 0, 0, 0.04);
  color: var(--muted-foreground, #94A3B8);
}

body.dark-mode .tracker-date-cell.missed {
  background: rgba(255, 255, 255, 0.05);
  color: #64748B;
}

.tracker-date-cell.missed .date-missed-icon {
  position: absolute;
  font-size: 20px;
  color: var(--muted-foreground, #94A3B8);
  opacity: 0.28;
  pointer-events: none;
}

/* Checked in date */
.tracker-date-cell.checked {
  background: #121212;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(18, 18, 18, 0.25);
}

.tracker-date-cell.checked .date-num {
  color: #FFFFFF;
  font-weight: 800;
}

body.dark-mode .tracker-date-cell.checked {
  background: #F8FAFC;
  color: #0B0F19;
  box-shadow: 0 4px 12px rgba(248, 250, 252, 0.2);
}

body.dark-mode .tracker-date-cell.checked .date-num {
  color: #0B0F19;
}

/* Today highlight */
.tracker-date-cell.is-today {
  border-color: #121212;
  box-shadow: 0 0 0 1.5px #121212;
}

body.dark-mode .tracker-date-cell.is-today {
  border-color: #F8FAFC;
  box-shadow: 0 0 0 1.5px #F8FAFC;
}

/* Future dates */
.tracker-date-cell.is-future {
  opacity: 0.35;
  background: transparent;
  border: 1px dashed var(--border);
}


/* ═══════════════════════════
   20. TRANSACTION ITEM & HISTORY
   ═══════════════════════════ */
.transaction-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

#tx-type-filter-chips {
  margin-bottom: 12px;
}

#transaction-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.transaction-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  min-height: 56px;
  margin-bottom: 0;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.transaction-item:hover {
  transform: translateY(-1px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.transaction-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.transaction-left > div:last-child {
  min-width: 0;
  flex: 1;
}

.transaction-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.transaction-icon.jajan    { background: #FFF7ED; color: #EA580C; }
.transaction-icon.belanja  { background: #FDF2F8; color: #DB2777; }
.transaction-icon.transport { background: #EFF6FF; color: #2563EB; }
.transaction-icon.kesehatan { background: #F0FDF4; color: #16A34A; }
.transaction-icon.gaji     { background: #ECFDF5; color: #059669; }
.transaction-icon.bonus    { background: #FFFBEB; color: #D97706; }
.transaction-icon.default  { background: var(--surface-soft); color: var(--on-surface-variant); }

.transaction-title {
  font-size: var(--text-body-md);
  font-weight: 600;
  color: var(--on-surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-detail {
  font-size: var(--text-body-sm);
  color: var(--muted-foreground);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.transaction-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 8px;
}

.transaction-amount {
  font-size: var(--text-body-md);
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: -0.01em;
}

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


/* ═══════════════════════════
   21. ACTIVITY ITEM
   ═══════════════════════════ */
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-16);
  padding: 14px 0;
  border-bottom: 1px dashed var(--border);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-label {
  font-size: var(--text-body-md);
  font-weight: 600;
  color: var(--foreground);
}

.activity-detail {
  font-size: var(--text-body-sm);
  color: var(--on-surface-variant);
  margin-top: 2px;
}


/* ═══════════════════════════
   22. REFLECTION CARD
   ═══════════════════════════ */
.reflection-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  min-height: 170px;
}

.reflection-card-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--secondary) 0%, var(--primary-container) 100%);
  opacity: 0.95;
}

.reflection-card-content {
  position: relative;
  z-index: 1;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--on-primary);
  min-height: 125px;
}

.reflection-label {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.85;
  margin-bottom: 8px;
}

.reflection-text {
  font-size: var(--text-body-md);
  font-style: italic;
  line-height: 1.5;
  flex: 1;
  margin-bottom: var(--space-12);
}

.reflection-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.reflection-category {
  font-size: var(--text-label-badge);
  font-weight: var(--fw-label-badge);
  opacity: 0.8;
}

.reflection-share {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background var(--transition-fast);
  color: inherit;
}

.reflection-share:hover {
  background: rgba(255, 255, 255, 0.35);
}


/* ═══════════════════════════
   23. QUICK OVERVIEW CARDS (Image Reference Glassmorphic Style)
   ═══════════════════════════ */
.overview-section {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

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

.overview-card {
  background: var(--card-bg);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
  cursor: pointer;
  transition: transform 140ms var(--ease-button-press), box-shadow 200ms ease, border-color 200ms ease;
  user-select: none;
}

.overview-card:hover {
  transform: translateY(-2px);
}

.overview-card:active {
  transform: scale(0.97);
}

.overview-card-full {
  grid-column: span 2;
}

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

.overview-card-icon {
  font-size: 19px;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.overview-card-icon.icon-orange {
  color: #F97316;
}

.overview-card-icon.icon-blue {
  color: #3B82F6;
}

.overview-card-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface-variant);
  letter-spacing: -0.01em;
}

.overview-metric-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}

/* Neon Capsule Indicator from Reference Image */
.metric-indicator {
  width: 5px;
  height: 22px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  display: inline-block;
}

.indicator-green {
  background: #10B981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.indicator-blue {
  background: #3B82F6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
}

.indicator-indigo {
  background: #6366F1;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
}

.indicator-red {
  background: #EF4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.indicator-cyan {
  background: #06B6D4;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.6);
}

.overview-card-value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--foreground);
}

.overview-card-delta {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted-foreground);
}

/* ── Filter / Category Pills (Reference Image Style) ── */
.quick-filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 2px 4px 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.quick-filter-chips::-webkit-scrollbar {
  display: none;
}

.chip-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--on-surface);
  background: var(--surface-container);
  border: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: transform 140ms var(--ease-button-press), background 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.chip-pill:hover {
  background: var(--surface-container-high);
}

.chip-pill:active {
  transform: scale(0.96);
}

.chip-pill.active {
  background: var(--secondary);
  color: #FFFFFF;
  font-weight: 600;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.chip-pill-ai {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12) 0%, rgba(99, 102, 241, 0.18) 100%);
  border-color: rgba(99, 102, 241, 0.3);
  color: #4F46E5;
}


/* ═══════════════════════════
   24. SCORE SECTION
   ═══════════════════════════ */
.score-section {
  display: flex;
  gap: var(--space-md);
  align-items: center;
}

.score-info {
  flex: 1;
}

.score-pills {
  display: flex;
  gap: 8px;
  margin-top: var(--space-md);
  flex-wrap: wrap;
}

.score-pill {
  padding: 4px 8px;
  border-radius: var(--radius-full);
  background: var(--surface-soft);
  color: var(--on-surface-variant);
  font-size: var(--text-label-badge);
  font-weight: var(--fw-label-badge);
}

.score-pill.inactive {
  opacity: 0.5;
}

/* ═══════════════════════════
   HOME QUICK TO-DO SECTION
   ═══════════════════════════ */
.home-todo-form {
  margin-top: var(--space-sm);
}

.home-todo-input-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--surface-soft);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 4px 6px 4px 14px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.home-todo-input-wrap:focus-within {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(18, 18, 18, 0.12);
  background: var(--card-bg);
}

.home-todo-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 0;
  font-size: var(--text-body-md);
  color: var(--foreground);
  outline: none;
}

.home-todo-input::placeholder {
  color: var(--muted-foreground);
  font-size: 13.5px;
}

.home-todo-add-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: var(--secondary);
  color: var(--on-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.home-todo-add-btn:hover {
  transform: scale(1.05);
  background: #2A2A2A;
}

.home-todo-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.home-todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.home-todo-item.done {
  opacity: 0.65;
  background: rgba(18, 18, 18, 0.04);
}

.home-todo-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid var(--outline-variant);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--on-secondary);
  transition: all var(--transition-fast);
}

.home-todo-checkbox:hover {
  border-color: var(--secondary);
}

.home-todo-item.done .home-todo-checkbox {
  background: var(--secondary);
  border-color: var(--secondary);
}

.home-todo-checkbox .material-symbols-outlined {
  font-size: 15px;
}

.home-todo-text {
  flex: 1;
  font-size: var(--text-body-sm);
  color: var(--foreground);
  word-break: break-word;
}

.home-todo-item.done .home-todo-text {
  text-decoration: line-through;
  color: var(--muted-foreground);
}

.home-todo-empty {
  text-align: center;
  padding: 8px 0 2px;
  color: var(--muted-foreground);
  font-size: 12.5px;
}

/* To-Do List */
/* To-Do List Hero Card */
.todo-hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  overflow: hidden;
  position: relative;
}

.todo-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  position: relative;
  z-index: 1;
}

.todo-eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 2px;
  color: var(--secondary);
  font-size: var(--text-label-badge);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.todo-hero-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-soft);
  color: var(--secondary);
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.todo-hero-icon .material-symbols-outlined {
  font-size: 24px;
}

.todo-progress-wrap {
  position: relative;
  z-index: 1;
}

.todo-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
  color: var(--on-surface-variant);
  font-size: var(--text-label-badge);
  font-weight: 800;
}

.todo-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.todo-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
}

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

.todo-stat-icon.pending {
  background: rgba(245, 158, 11, 0.14);
  color: #F59E0B;
}

.todo-stat-icon.done {
  background: rgba(16, 185, 129, 0.14);
  color: #10B981;
}

.todo-stat-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.todo-stat-value {
  color: var(--foreground);
  font-size: 18px;
  line-height: 1.1;
  font-weight: 800;
}

.todo-stat-label {
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.todo-input {
  min-height: 116px;
  line-height: 1.5;
}

.todo-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.todo-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 64px;
  padding: 12px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), opacity var(--transition-fast);
}

.todo-item:hover {
  transform: translateY(-1px);
  border-color: rgba(18, 18, 18, 0.35);
}

.todo-item.done {
  background: rgba(18, 18, 18, 0.04);
}

.todo-check {
  width: 34px;
  height: 34px;
  min-width: 34px;
  border-radius: 10px;
  border: 2px solid var(--outline-variant);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--on-secondary);
  background: var(--card-bg);
  transition: all var(--transition-fast);
}

.todo-check:hover {
  border-color: var(--secondary);
}

.todo-item.done .todo-check {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--on-secondary);
}

.todo-copy {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.todo-title {
  color: var(--foreground);
  font-size: var(--text-body-md);
  line-height: 1.35;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.todo-item.done .todo-title {
  color: var(--on-surface-variant);
  text-decoration: line-through;
}

.todo-meta {
  display: inline-flex;
  margin-top: 3px;
  color: var(--muted-foreground);
  font-size: var(--text-label-badge);
  font-weight: 700;
}

.todo-action {
  width: 40px;
  height: 40px;
  min-width: 40px;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  transition: background var(--transition-fast), color var(--transition-fast);
}

.todo-action .material-symbols-outlined {
  font-size: 20px;
}

.todo-action:hover {
  background: var(--favorit-bg);
  color: var(--danger);
}

.todo-skeleton {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--card-bg);
}

.todo-empty {
  border: 1px dashed var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface-soft);
  padding: 32px 20px;
  text-align: center;
  color: var(--muted-foreground);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.todo-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-foreground);
  margin-bottom: 2px;
}

.todo-empty-text {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--foreground);
}

.todo-empty-subtext {
  font-size: 12px;
  color: var(--muted-foreground);
}

@media (max-width: 360px) {
  .todo-hero-top {
    align-items: stretch;
  }

  .todo-hero-icon {
    width: 42px;
    height: 42px;
  }

  .todo-stats {
    gap: 8px;
  }

  .todo-stat {
    padding: 8px 10px;
    gap: 8px;
  }

  .todo-item {
    padding: 10px;
  }

  .todo-action {
    width: 36px;
    min-width: 36px;
  }
}

/* ═══════════════════════════
   25. CHAT (AI Floating Widget)
   ═══════════════════════════ */

/* --- Floating AI Bubble (FAB) - Deprecated in favor of Header Action to eliminate screen stacking --- */
.ai-fab-btn {
  display: none;
}

/* --- Header AI Trigger Button --- */
.header-icon-btn.ai-header-trigger {
  color: #8B5CF6;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.header-icon-btn.ai-header-trigger:hover {
  background: rgba(139, 92, 246, 0.22);
  transform: translateY(-1px);
}

.header-icon-btn.ai-header-trigger:active {
  transform: scale(0.92);
}

body.dark-mode .header-icon-btn.ai-header-trigger {
  color: #C084FC;
  background: rgba(168, 85, 247, 0.16);
  border: 1px solid rgba(168, 85, 247, 0.35);
}

body.dark-mode .header-icon-btn.ai-header-trigger:hover {
  background: rgba(168, 85, 247, 0.26);
}

/* --- AI Chat Drawer Backdrop Overlay --- */
.ai-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1050;
  transition: opacity 0.25s ease;
}

.ai-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

/* --- AI Chat iOS Bottom Sheet Drawer --- */
.ai-chat-window {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  height: 82vh;
  max-height: 720px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1060;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease;
}

.ai-chat-window.hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

body.dark-mode .ai-chat-window {
  background: #0D111D;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.85);
}

@media (min-width: 640px) {
  .ai-chat-window {
    bottom: 24px;
    right: 24px;
    left: auto;
    width: 420px;
    height: 640px;
    border-radius: 20px;
    border-bottom: 1px solid var(--border);
  }
  .ai-chat-window.hidden {
    transform: translateY(20px) scale(0.96);
  }
}

.ai-chat-window.hidden {
  display: none;
}

@keyframes popUpSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Ambient Animated Glowing Blob Gradient Background */
.ai-blob-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
  border-radius: 28px;
}

.ai-blob {
  position: absolute;
  filter: blur(40px);
  opacity: 0.28;
  border-radius: 50%;
  animation: blobFloat 9s ease-in-out infinite alternate;
}

.ai-blob-1 {
  width: 220px;
  height: 220px;
  top: -40px;
  right: -40px;
  background: radial-gradient(circle, #6366F1 0%, #3B82F6 70%);
  animation-duration: 9s;
}

.ai-blob-2 {
  width: 200px;
  height: 200px;
  bottom: 80px;
  left: -40px;
  background: radial-gradient(circle, #EC4899 0%, #8B5CF6 70%);
  animation-duration: 11s;
  animation-delay: -3s;
}

.ai-blob-3 {
  width: 160px;
  height: 160px;
  top: 45%;
  right: 10%;
  background: radial-gradient(circle, #10B981 0%, #06B6D4 70%);
  animation-duration: 13s;
  animation-delay: -6s;
}

@keyframes blobFloat {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(22px, -24px) scale(1.12); }
  100% { transform: translate(-18px, 18px) scale(0.92); }
}

/* Header inside Chat Pop-up */
.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

body.dark-mode .ai-chat-header {
  background: rgba(17, 24, 39, 0.7);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.ai-chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-chat-avatar-status {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #121212 0%, #2A2A2A 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(18, 18, 18, 0.25);
}

.ai-chat-avatar-status .material-symbols-outlined {
  font-size: 20px;
}

.online-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10B981;
  border: 2px solid var(--card-bg);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.ai-chat-title {
  font-size: var(--text-body-md);
  font-weight: 700;
  line-height: 1.2;
  margin: 0;
}

.ai-model-badge {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 1.5px 6px;
  border-radius: 6px;
  background: rgba(18, 18, 18, 0.08);
  color: #121212;
  border: 1px solid rgba(18, 18, 18, 0.12);
}

body.dark-mode .ai-model-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #F8FAFC;
  border-color: rgba(255, 255, 255, 0.15);
}

.ai-chat-subtitle {
  font-size: 11px;
  color: var(--muted-foreground);
  margin: 2px 0 0;
}

.ai-chat-close-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(0, 0, 0, 0.04);
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-chat-close-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--foreground);
  transform: scale(1.05);
}

body.dark-mode .ai-chat-close-btn {
  background: rgba(255, 255, 255, 0.06);
}
body.dark-mode .ai-chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Chat area inside Pop-up */
.ai-chat-window .chat-area {
  flex: 1;
  padding: 14px 16px;
  gap: 12px;
  position: relative;
  z-index: 2;
}

/* Composer inside Pop-up */
.ai-chat-window .chat-composer {
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  z-index: 2;
}

body.dark-mode .ai-chat-window .chat-composer {
  background: rgba(17, 24, 39, 0.7);
  border-top-color: rgba(255, 255, 255, 0.08);
}

.chat-area {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-sm) var(--container-mobile) var(--space-md);
  -ms-overflow-style: none;
  scrollbar-width: none;
  overscroll-behavior: contain;
}

.chat-area::-webkit-scrollbar {
  display: none;
}

/* ═══════════════════════════
   AI TAB SWITCHER (Chat | Speak)
   ═══════════════════════════ */
.ai-tab-switcher {
  display: flex;
  margin: 8px 14px 0;
  padding: 3px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  position: relative;
  z-index: 2;
}

body.dark-mode .ai-tab-switcher {
  background: rgba(10, 15, 36, 0.7);
  border-color: rgba(255, 255, 255, 0.08);
}

.ai-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 11px;
  border: none;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-tab-btn .material-symbols-outlined {
  font-size: 16px;
}

.ai-tab-btn.active {
  background: #FFFFFF;
  color: #121212;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.dark-mode .ai-tab-btn.active {
  background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.4);
}

.ai-tab-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.ai-tab-content.hidden {
  display: none;
}

/* ═══════════════════════════
   SPEAK (VOICE AI) STYLES
   ═══════════════════════════ */
.voice-record-container {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  gap: 14px;
}

.voice-hero-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 10px;
}

.voice-mic-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.voice-pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #3B82F6;
  opacity: 0;
  pointer-events: none;
}

.voice-mic-wrapper.listening .voice-pulse-1 {
  animation: voicePulse 2s infinite ease-out;
}

.voice-mic-wrapper.listening .voice-pulse-2 {
  animation: voicePulse 2s infinite ease-out 1s;
}

@keyframes voicePulse {
  0%   { transform: scale(0.85); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.voice-mic-main-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #121212;
  color: #FFFFFF;
  border: 3px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 24px rgba(18, 18, 18, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 2;
}

body.dark-mode .voice-mic-main-btn {
  background: linear-gradient(135deg, #1E40AF 0%, #3B82F6 100%);
  box-shadow: 0 8px 28px rgba(37, 99, 235, 0.5), 0 0 20px rgba(59, 130, 246, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
}

.voice-mic-main-btn .material-symbols-outlined {
  font-size: 32px;
  transition: transform 0.2s ease;
}

.voice-mic-wrapper.listening .voice-mic-main-btn {
  background: #EF4444;
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.6);
  transform: scale(1.06);
}

.voice-status-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--foreground);
}

.voice-status-desc {
  font-size: 12px;
  line-height: 1.4;
  margin: 0;
  max-width: 260px;
}

.voice-transcript-wrapper {
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid #CBD5E1;
  border-radius: 16px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.dark-mode .voice-transcript-wrapper {
  background: rgba(10, 16, 38, 0.8);
  border-color: rgba(255, 255, 255, 0.12);
}

.voice-transcript-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.voice-transcript-input {
  width: 100%;
  border: none;
  background: transparent;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--foreground);
  resize: none;
  outline: none;
  font-family: inherit;
}

.voice-transcript-input::placeholder {
  color: #94A3B8;
  font-style: italic;
}

.voice-submit-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 16px;
  font-weight: 700;
}

/* ═══════════════════════════
   SMART CONFIRMATION CARD
   ═══════════════════════════ */
.voice-confirm-container {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

.voice-confirm-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #CBD5E1;
  border-radius: 18px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

body.dark-mode .voice-confirm-card {
  background: rgba(13, 19, 44, 0.8);
  border-color: rgba(255, 255, 255, 0.12);
  border-top-color: rgba(96, 165, 250, 0.4);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.voice-confirm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.voice-confirm-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(37, 99, 235, 0.12);
  color: #2563EB;
}

body.dark-mode .voice-confirm-badge {
  background: rgba(37, 99, 235, 0.25);
  color: #93C5FD;
}

.voice-field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.voice-field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-foreground);
  text-transform: uppercase;
}

.voice-field-input {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--foreground);
  font-size: 13px;
  outline: none;
  font-family: inherit;
}

.voice-field-input:focus {
  border-color: var(--primary);
}

/* --- Message Bubbles --- */
.chat-message {
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: chatSlideIn 0.25s ease-out;
}

.chat-message-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: #121212;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
  font-size: 16px;
  box-shadow: 0 2px 8px rgba(18, 18, 18, 0.2);
}

.chat-avatar .material-symbols-outlined {
  font-size: 18px;
}

.chat-bubble {
  background: rgba(255, 255, 255, 0.95);
  color: #191C1E;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 20px;
  border-top-left-radius: 4px;
  padding: 12px 16px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

body.dark-mode .chat-bubble {
  background: rgba(18, 26, 60, 0.75);
  border-color: rgba(255, 255, 255, 0.1);
  color: #F8FAFC;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.chat-bubble p {
  margin: 0;
}

.chat-bubble p + p {
  margin-top: 8px;
}

.chat-bubble-user {
  background: #121212;
  color: #FFFFFF;
  border: none;
  border-radius: 20px;
  border-top-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(18, 18, 18, 0.25);
}

body.dark-mode .chat-bubble-user {
  background: #1E293B;
  border: 1px solid #334155;
  color: #F8FAFC;
}

.chat-bubble ul {
  list-style: disc;
  padding-left: 18px;
  margin: 6px 0;
}

.chat-bubble ol {
  list-style: decimal;
  padding-left: 18px;
  margin: 6px 0;
}

.chat-bubble li {
  margin-bottom: 3px;
}

.chat-bubble strong {
  font-weight: 700;
}

.chat-bubble code {
  background: rgba(0,0,0,0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* --- Typing Dots Indicator --- */
.typing-dots {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 4px 0;
}

.typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted-foreground);
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

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

/* --- Chat Error Bubble --- */
.chat-bubble-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--foreground);
}

/* --- Sticky Composer --- */
.chat-composer {
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  padding: 10px var(--container-mobile) calc(74px + 14px);
  background: var(--background);
  border-top: 1px solid var(--border);
}

.chat-quick-prompts {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding-bottom: 10px;
  margin: 0 calc(-1 * var(--container-mobile));
  padding-left: var(--container-mobile);
  padding-right: var(--container-mobile);
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.chat-quick-prompts::-webkit-scrollbar {
  display: none;
}

.chat-quick-prompts.hidden-prompts {
  display: none;
}

.chat-input-wrapper,
body.dark-mode .chat-input-wrapper {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: 9999px;
  padding: 4px 6px 4px 16px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  min-height: 48px;
}

.chat-input-wrapper:focus-within,
body.dark-mode .chat-input-wrapper:focus-within {
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.chat-input,
body.dark-mode .chat-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px 8px 8px 0;
  font-size: 14.5px;
  font-family: inherit;
  color: #0F172A; /* Teks hitam tegas */
  outline: none;
  box-shadow: none;
  border-radius: 0;
  resize: none;
  max-height: 100px;
  line-height: 1.4;
  overflow-y: hidden;
  scrollbar-width: none;
}

.chat-input::-webkit-scrollbar,
body.dark-mode .chat-input::-webkit-scrollbar {
  display: none;
}

.chat-input::placeholder,
body.dark-mode .chat-input::placeholder {
  color: #64748B;
  font-weight: 400;
}

.chat-send-btn,
body.dark-mode .chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #3B82F6;
  color: #FFFFFF;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
  transition: transform 0.15s ease, background 0.15s ease;
}

.chat-send-btn:hover {
  background: #2563EB;
  transform: scale(1.05);
  opacity: 0.95;
}

.chat-send-btn .material-symbols-outlined {
  font-size: 20px;
  color: #FFFFFF;
}

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

.chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}


/* ═══════════════════════════
   26. LINK LIBRARY
   ═══════════════════════════ */
.link-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

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

.link-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background var(--transition-fast), transform 0.15s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.link-card:hover {
  background: var(--surface-soft);
}

.link-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.link-card-more-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.link-card-more-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--foreground);
}

.link-card-dropdown {
  position: absolute;
  top: 48px;
  right: 12px;
  background: #1E293B;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  z-index: 60;
  min-width: 135px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(16px);
}

.link-card-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #F8FAFC;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s ease;
}

.link-card-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.link-card-dropdown-item.danger {
  color: #EF4444;
}

.link-card-dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

body:not(.dark-mode) .link-card-dropdown {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

body:not(.dark-mode) .link-card-dropdown-item {
  color: #0F172A;
}

body:not(.dark-mode) .link-card-dropdown-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

body:not(.dark-mode) .link-card-dropdown-item.danger {
  color: #DC2626;
}

body:not(.dark-mode) .link-card-dropdown-item.danger:hover {
  background: rgba(220, 38, 38, 0.08);
}

.link-card-title {
  font-size: var(--text-body-md);
  font-weight: 700;
}

.link-card-add {
  border: 1.5px dashed var(--border);
  background: var(--surface-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 110px;
  gap: 8px;
  color: var(--muted-foreground);
}

.link-card-add:hover {
  border-color: var(--primary);
  background: var(--card-bg);
  transform: translateY(-2px);
}

.link-card-add .icon-circle {
  background: var(--card-bg);
  color: var(--foreground);
  border: 1px solid var(--border);
}

/* ── Unified Add Modal Segmented Tabs (Checklist | Link Library) ── */
.modal-tab-nav {
  display: flex;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 18px;
}

.modal-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted-foreground);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-tab-btn:hover {
  color: var(--foreground);
}

.modal-tab-btn.active {
  background: var(--card-bg);
  color: var(--foreground);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body.dark-mode .modal-tab-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.modal-tab-panel {
  display: flex;
  flex-direction: column;
}

.modal-tab-panel.hidden {
  display: none;
}


/* ═══════════════════════════
   27. FINANCE DASHBOARD
   ═══════════════════════════ */
.finance-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.finance-card-full {
  grid-column: span 2;
}

.finance-card-income {
  background: rgba(240, 253, 244, 0.5);
  border-color: rgba(187, 247, 208, 0.5);
}

.finance-card-expense {
  background: rgba(254, 242, 242, 0.5);
  border-color: rgba(254, 202, 202, 0.5);
}


/* ═══════════════════════════
   28. ALOKASI BULAN INI & PERIODE (Reference Image Style)
   ═══════════════════════════ */
.period-selector-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 0 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

body.dark-mode .period-selector-bar {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.period-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: transparent;
  border: none;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--foreground);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 160ms ease;
  user-select: none;
}

.period-dropdown-btn:hover {
  background: var(--surface-soft);
}

body.dark-mode .period-dropdown-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.period-date-display {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted-foreground);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: all 160ms ease;
  user-select: none;
}

.period-date-display:hover {
  background: var(--surface-soft);
  color: var(--foreground);
}

body.dark-mode .period-date-display:hover {
  background: rgba(255, 255, 255, 0.06);
}

.allocation-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.allocation-total-badge {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--foreground);
  background: var(--surface-soft);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  white-space: nowrap;
}

body.dark-mode .allocation-total-badge {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #F8FAFC;
}

/* "Pilih Periode" Bottom Sheet Modal (Image Reference Style) */
.period-picker-modal {
  padding: 4px 4px 14px 4px;
}

.period-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}

body.dark-mode .period-picker-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.period-picker-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--foreground);
  margin: 0;
}

.period-picker-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--surface-soft);
  color: var(--muted-foreground);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 160ms ease;
}

.period-picker-close-btn:hover {
  background: var(--border);
  color: var(--foreground);
}

body.dark-mode .period-picker-close-btn {
  background: rgba(255, 255, 255, 0.06);
  color: #CBD5E1;
}

.period-options-list {
  display: flex;
  flex-direction: column;
}

.period-option-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: background 140ms ease;
  border-radius: 8px;
}

body.dark-mode .period-option-item {
  border-bottom-color: rgba(255, 255, 255, 0.04);
}

.period-option-item:hover {
  background: var(--surface-soft);
}

body.dark-mode .period-option-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.period-option-label {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--foreground);
}

.period-option-item.selected .period-option-label {
  font-weight: 700;
  color: #0D9488;
}

body.dark-mode .period-option-item.selected .period-option-label {
  color: #38BDF8;
}

.period-check-icon {
  font-size: 22px;
  color: #CBD5E1;
  transition: all 160ms ease;
}

.period-check-icon.active {
  color: #0D9488;
  font-variation-settings: 'FILL' 1;
}

body.dark-mode .period-check-icon.active {
  color: #38BDF8;
}

.allocation-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 4px;
  gap: 6px;
}

body.dark-mode .allocation-tabs {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

.allocation-tab {
  flex: 1;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: all 180ms ease;
  color: var(--muted-foreground);
  background: transparent;
  border: none;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.allocation-tab:hover {
  color: var(--foreground);
}

.allocation-tab.active {
  background: linear-gradient(135deg, #0D9488 0%, #14B8A6 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(20, 184, 166, 0.35);
}

body.dark-mode .allocation-tab.active {
  background: linear-gradient(135deg, #1D4ED8 0%, #3B82F6 100%);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.45);
}

/* Donut Chart Container */
.donut-chart-box {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 8px auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.donut-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.donut-slice {
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease, filter 0.2s ease;
  transform-origin: 160px 135px;
}

.donut-slice:hover {
  transform: scale(1.04);
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.18));
}

.donut-slice.highlighted {
  transform: scale(1.06);
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.25));
  opacity: 1;
}

.donut-slice.dimmed {
  opacity: 0.3;
  transform: scale(0.98);
}

.donut-center-label {
  fill: #64748B;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

body.dark-mode .donut-center-label {
  fill: #94A3B8;
}

.donut-center-val {
  fill: #0F172A;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

body.dark-mode .donut-center-val {
  fill: #F8FAFC;
}

.donut-center-action {
  fill: #0D9488;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

body.dark-mode .donut-center-action {
  fill: #38BDF8;
}

/* Horizontal Category Quick Legend Row (Image 3 Style) */
.allocation-quick-legend-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 6px 2px 14px 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  justify-content: flex-start;
}

.allocation-quick-legend-row::-webkit-scrollbar {
  display: none;
}

.quick-legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--foreground);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 160ms ease;
  user-select: none;
}

.quick-legend-pill:hover {
  background: var(--card-bg);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.quick-legend-pill.active {
  background: var(--card-bg);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

body.dark-mode .quick-legend-pill {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #E2E8F0;
}

body.dark-mode .quick-legend-pill.active {
  background: rgba(37, 99, 235, 0.2);
  border-color: #3B82F6;
  color: #FFFFFF;
}

.quick-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Detailed Category Breakdown Cards */
.allocation-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.allocation-breakdown-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 180ms ease;
}

.allocation-breakdown-card:hover {
  background: var(--card-bg);
  border-color: rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.allocation-breakdown-card.highlighted {
  border-color: var(--primary);
  background: var(--card-bg);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.18);
}

body.dark-mode .allocation-breakdown-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .allocation-breakdown-card:hover,
body.dark-mode .allocation-breakdown-card.highlighted {
  background: rgba(255, 255, 255, 0.07);
  border-color: #3B82F6;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
}

.allocation-card-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.allocation-icon-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.allocation-icon-badge .material-symbols-outlined {
  font-size: 20px;
}

.allocation-card-info {
  flex: 1;
  min-width: 0;
  padding-right: 12px;
}

.allocation-cat-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 5px;
}

.allocation-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  overflow: hidden;
}

body.dark-mode .allocation-progress-track {
  background: rgba(255, 255, 255, 0.08);
}

.allocation-progress-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.4s ease;
}

.allocation-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.allocation-cat-amount {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--foreground);
}

.allocation-cat-pct-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.02em;
}

/* ── Limit Budget Card ── */
.budget-item {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}

.budget-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.budget-progress-track {
  width: 100%;
  height: 8px;
  background: var(--surface-soft);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 4px 0;
}

.budget-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.4s ease-out;
}

.progress-bar-normal {
  background: var(--secondary);
}

.progress-bar-warning {
  background: #F59E0B;
}

.progress-bar-danger {
  background: var(--danger);
}


/* ═══════════════════════════
   29. EMPTY STATE
   ═══════════════════════════ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--space-md);
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  color: var(--outline-variant);
  margin-bottom: var(--space-md);
}

.empty-state-title {
  font-size: var(--text-section-heading);
  font-weight: var(--fw-section-heading);
  color: var(--foreground);
  margin-bottom: var(--space-xs);
}

.empty-state-desc {
  font-size: var(--text-body-sm);
  color: var(--muted-foreground);
}


/* ═══════════════════════════
   30. CONFIRM DIALOG
   ═══════════════════════════ */
.confirm-dialog {
  text-align: center;
}

.confirm-dialog-icon {
  font-size: 48px;
  color: var(--secondary);
  margin-bottom: var(--space-md);
}

.confirm-dialog-title {
  font-size: var(--text-section-heading);
  font-weight: var(--fw-section-heading);
  margin-bottom: var(--space-sm);
}

.confirm-dialog-message {
  font-size: var(--text-body-sm);
  color: var(--muted-foreground);
  margin-bottom: var(--space-lg);
}

.confirm-dialog-actions {
  display: flex;
  gap: var(--space-sm);
}

.confirm-dialog-actions .btn {
  flex: 1;
}


/* ═══════════════════════════
   31. SELECTION GRID
   ═══════════════════════════ */
/* ═══════════════════════════
   31. SELECTION GRID & CATEGORY BUTTONS
   ═══════════════════════════ */
.modal-form-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.modal-form-header .type-toggle {
  flex: 1;
}

.bulk-mode-btn {
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1.5px solid #CBD5E1;
  background: #FFFFFF;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 160ms ease;
  white-space: nowrap;
  outline: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.bulk-mode-btn:hover {
  border-color: #93C5FD;
  color: #2563EB;
  background: #EFF6FF;
}

body.dark-mode .bulk-mode-btn {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.12);
  color: #94A3B8;
}

body.dark-mode .bulk-mode-btn:hover {
  border-color: rgba(96, 165, 250, 0.5);
  color: #93C5FD;
  background: rgba(37, 99, 235, 0.15);
}

.modal-form-compact .form-group {
  margin-bottom: 7px;
}

.modal-form-compact .form-label {
  display: block;
  margin-bottom: 3px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--foreground);
}

.selection-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.selection-item {
  padding: 6px 9px;
  min-height: 38px;
  border: 1.5px solid #CBD5E1;
  border-radius: 10px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 160ms cubic-bezier(0.4, 0, 0.2, 1);
  color: #334155;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 7px;
  user-select: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  outline: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.selection-item .selection-icon-wrap {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  background: #F1F5F9;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 160ms ease;
}

.selection-item .material-symbols-outlined {
  font-size: 16px;
  color: #64748B;
  transition: all 160ms ease;
}

.selection-item .selection-label {
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
  color: inherit;
}

/* Hover State — Soft blue tint, NO BLACK BORDER */
.selection-item:hover {
  border-color: #93C5FD;
  background: #F8FAFC;
  color: #1D4ED8;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.08);
  transform: translateY(-1px);
}

.selection-item:hover .selection-icon-wrap {
  background: #EFF6FF;
}

.selection-item:hover .material-symbols-outlined {
  color: #2563EB;
}

.selection-item:focus {
  outline: none;
}

.selection-item:focus-visible {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
  outline: none;
}

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

/* Selected State */
.selection-item.selected {
  border-color: #2563EB;
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 50%, #3B82F6 100%);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transform: none;
}

.selection-item.selected .selection-icon-wrap {
  background: rgba(255, 255, 255, 0.22);
}

.selection-item.selected .material-symbols-outlined {
  color: #FFFFFF;
}

.selection-item.selected .selection-label {
  color: #FFFFFF;
}

/* Dark Mode Selection Items */
body.dark-mode .selection-item {
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background: rgba(30, 41, 59, 0.7);
  color: #F1F5F9;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

body.dark-mode .selection-item .selection-icon-wrap {
  background: rgba(255, 255, 255, 0.08);
}

body.dark-mode .selection-item .material-symbols-outlined {
  color: #94A3B8;
}

body.dark-mode .selection-item:hover {
  border-color: rgba(96, 165, 250, 0.6);
  background: rgba(37, 99, 235, 0.16);
  color: #93C5FD;
}

body.dark-mode .selection-item:hover .selection-icon-wrap {
  background: rgba(59, 130, 246, 0.25);
}

body.dark-mode .selection-item:hover .material-symbols-outlined {
  color: #60A5FA;
}

body.dark-mode .selection-item.selected {
  border-color: #3B82F6;
  background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.5);
}

body.dark-mode .selection-item.selected .selection-icon-wrap {
  background: rgba(255, 255, 255, 0.2);
}


/* ═══════════════════════════
   32. CONFETTI (Gamification)
   ═══════════════════════════ */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-toast);
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  opacity: 0;
  animation: confettiFall 2s ease-out forwards;
}

@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}


/* ═══════════════════════════
   33. TYPE TOGGLE (Pemasukan/Pengeluaran)
   ═══════════════════════════ */
.type-toggle {
  display: flex;
  background: #F1F5F9;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  padding: 3px;
  gap: 4px;
}

.type-toggle-item {
  flex: 1;
  height: 38px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  transition: all 160ms ease;
  color: #64748B;
  background: transparent;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.type-toggle-item:hover {
  color: #1E293B;
  background: rgba(255, 255, 255, 0.6);
}

.type-toggle-item.active {
  color: #FFFFFF;
  background: #2563EB;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.type-toggle-item.active[data-type="Pengeluaran"] {
  background: #EF4444;
  color: #FFFFFF;
  box-shadow: 0 3px 12px rgba(239, 68, 68, 0.35);
}

.type-toggle-item.active[data-type="Pemasukan"] {
  background: #10B981;
  color: #FFFFFF;
  box-shadow: 0 3px 12px rgba(16, 185, 129, 0.35);
}

body.dark-mode .type-toggle {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .type-toggle-item {
  color: #94A3B8;
}

body.dark-mode .type-toggle-item:hover {
  color: #F1F5F9;
  background: rgba(255, 255, 255, 0.05);
}

/* Form Input with Currency Prefix */
.input-with-prefix {
  display: flex;
  align-items: center;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 180ms ease, box-shadow 180ms ease;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.input-with-prefix:focus-within {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.input-prefix {
  padding: 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: #2563EB;
  background: #EFF6FF;
  border-right: 1px solid #DBEAFE;
  height: 44px;
  display: flex;
  align-items: center;
  user-select: none;
  flex-shrink: 0;
}

.form-input-lg,
.input-with-prefix .form-input-lg,
.input-with-prefix input {
  border: none;
  background: transparent;
  font-size: 18px;
  font-weight: 700;
  height: 44px;
  padding: 0 14px;
  color: var(--foreground);
  width: 100%;
  outline: none;
  box-shadow: none;
}

.input-with-prefix input:focus,
.input-with-prefix input:focus-visible {
  outline: none;
  border: none;
  box-shadow: none;
}

body.dark-mode .input-with-prefix {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

body.dark-mode .input-prefix {
  color: #93C5FD;
  background: rgba(37, 99, 235, 0.15);
  border-right-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .input-with-prefix:focus-within {
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.form-input-compact {
  height: 40px;
  padding: 8px 12px;
  font-size: 13px;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: var(--radius-md);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  outline: none;
}

.form-input-compact:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

body.dark-mode .form-input-compact {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.12);
  color: #F1F5F9;
}

.submit-tx-btn {
  height: 46px;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-btn, 12px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  border: none;
}

/* ═══════════════════════════
   33B. MONTH FILTER PILLS & CHIPS
   ═══════════════════════════ */
.month-filter-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 6px 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.month-filter-scroll::-webkit-scrollbar {
  display: none;
}

.month-pill {
  white-space: nowrap;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  color: #94A3B8;
  border: 1px solid rgba(255, 255, 255, 0.09);
  cursor: pointer;
  transition: all 180ms ease;
  user-select: none;
  flex-shrink: 0;
}

.month-pill:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #FFFFFF;
}

.month-pill.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  font-weight: 600;
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.45);
}

.chip-filter {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  color: #94A3B8;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: all 160ms ease;
  user-select: none;
}

.chip-filter:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #FFFFFF;
}

.chip-filter.active {
  background: rgba(37, 99, 235, 0.22);
  color: #60A5FA;
  border-color: rgba(59, 130, 246, 0.5);
  font-weight: 600;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
}


/* ═══════════════════════════
   34. UTILITY CLASSES
   ═══════════════════════════ */
.flex         { display: flex; }
.flex-col     { flex-direction: column; }
.flex-1       { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-start  { align-items: flex-start; }
.items-end    { align-items: flex-end; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-xs       { gap: var(--space-xs); }
.gap-sm       { gap: var(--space-sm); }
.gap-md       { gap: var(--space-md); }
.gap-lg       { gap: var(--space-lg); }
.mt-xs        { margin-top: var(--space-xs); }
.mt-sm        { margin-top: var(--space-sm); }
.mt-md        { margin-top: var(--space-md); }
.mt-lg        { margin-top: var(--space-lg); }
.mb-sm        { margin-bottom: var(--space-sm); }
.mb-md        { margin-bottom: var(--space-md); }
.mb-lg        { margin-bottom: var(--space-lg); }
.w-full       { width: 100%; }
.hidden       { display: none; }
.opacity-50   { opacity: 0.5; }
.opacity-60   { opacity: 0.6; }
.text-center  { text-align: center; }
.truncate     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }





/* ═══════════════════════════
   36. ANIMATIONS
   ═══════════════════════════ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

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

.animate-fade-in {
  animation: fadeIn 0.3s ease forwards;
}

.animate-slide-up {
  animation: slideUp 0.3s ease forwards;
}


/* ═══════════════════════════
   37. DARK MODE (Stitch Aura Glass Cosmic Theme)
   ═══════════════════════════ */
body.dark-mode,
html[data-theme="dark"] body {
  --background:              #07090E;
  --surface:                 #0B0E17;
  --surface-dim:             #07090E;
  --surface-bright:          #141A2E;
  --surface-container-lowest:#05070B;
  --surface-container-low:   #0B0E17;
  --surface-container:       #0F1320;
  --surface-container-high:  #141A2E;
  --surface-container-highest:#1B223C;

  --card-bg:                 linear-gradient(135deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.02) 100%);
  --surface-soft:            rgba(255, 255, 255, 0.05);
  --surface-variant:         rgba(255, 255, 255, 0.08);

  --on-surface:              #F8FAFC;
  --on-surface-variant:      #94A3B8;
  --on-background:           #F8FAFC;

  --foreground:              #FFFFFF;
  --on-primary:              #FFFFFF;
  --primary:                 #6366F1;
  --primary-hover:           #4F46E5;
  --primary-light:           #818CF8;
  --primary-container:       #4F46E5;
  --on-primary-container:    #FFFFFF;

  --muted-foreground:        #94A3B8;
  --border:                  rgba(255, 255, 255, 0.08);
  --outline:                 rgba(255, 255, 255, 0.16);
  --outline-variant:         rgba(255, 255, 255, 0.1);

  --secondary:               #3B82F6;
  --on-secondary:            #FFFFFF;
  --secondary-container:     rgba(59, 130, 246, 0.22);
  --on-secondary-container:  #BFDBFE;

  --inverse-surface:         #F8FAFC;
  --inverse-on-surface:      #07090E;
  --inverse-primary:         #4F46E5;

  --danger:                  #F43F5E;
  --error:                   #EF4444;
  --on-error:                #FFFFFF;
  --favorit-bg:              rgba(239, 68, 68, 0.15);
  --favorit-stroke:          rgba(239, 68, 68, 0.4);

  --surface-tint:            #6366F1;

  /* ── Semantic Colors ── */
  --color-income:            #10B981;
  --color-income-bg:         rgba(16, 185, 129, 0.12);
  --color-income-border:     rgba(16, 185, 129, 0.3);
  --color-expense:           #F43F5E;
  --color-expense-bg:        rgba(244, 63, 94, 0.12);
  --color-expense-border:    rgba(244, 63, 94, 0.3);

  /* ── Shadows ── */
  --shadow-sm:    0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md:    0 8px 24px -4px rgba(0, 0, 0, 0.65);
  --shadow-lg:    0 16px 36px -4px rgba(0, 0, 0, 0.75);
  --shadow-nav:   0 -8px 32px rgba(0, 0, 0, 0.7);

  /* ── Canvas Obsidian Background ── */
  background-color: #07090E;
  background-image: none;
  color: #F8FAFC;
}

/* ── Ambient Background Glows (Calmed for clean contrast) ── */
.ambient-glow {
  position: fixed;
  pointer-events: none;
  border-radius: 9999px;
  filter: blur(100px);
  z-index: 0;
  opacity: 0.15;
}

.ambient-glow-1 {
  top: -60px;
  right: -80px;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.22) 0%, transparent 70%);
}

.ambient-glow-2 {
  top: 380px;
  left: -90px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, transparent 70%);
}

.ambient-glow-3 {
  bottom: 100px;
  right: -70px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 70%);
}

/* ── Dark Mode Component Overrides ── */
body.dark-mode .page-header {
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.avatar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

body.dark-mode .avatar,
body.dark-mode #header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #3B82F6 0%, #6366F1 50%, #06B6D4 100%);
  padding: 2px;
  box-shadow: 0 0 20px -3px rgba(59, 130, 246, 0.5);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #60A5FA;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 16px;
  position: relative;
}

body.dark-mode .avatar-status-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background: #10B981;
  border: 2px solid #07090E;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
  z-index: 2;
}

/* Floating Glass Navigation Dock */
.page-section {
  padding-bottom: calc(130px + env(safe-area-inset-bottom, 0px));
}

.bottom-nav {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 430px;
  height: auto;
  z-index: var(--z-nav);
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  border-radius: 9999px;
}

.nav-dock-pill {
  width: 100%;
  border-radius: 9999px;
  background: rgba(16, 19, 28, 0.88);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.75), inset 0 1px 1px 0 rgba(255, 255, 255, 0.15);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  position: relative;
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  cursor: pointer;
  color: #94A3B8;
  flex: 1;
  border-radius: 9999px;
  border: none;
  background: none;
  box-shadow: none;
  transition: color 180ms ease, transform 140ms ease;
}

.nav-item:hover {
  color: #E2E8F0;
}

.nav-item.active {
  color: #60A5FA;
  background: none;
  box-shadow: none;
}

.nav-active-bar {
  display: none;
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  border-radius: 9999px;
  background: linear-gradient(90deg, #3B82F6 0%, #6366F1 100%);
  box-shadow: 0 0 12px #3B82F6, 0 0 20px rgba(59, 130, 246, 0.8);
}

.nav-item.active .nav-active-bar {
  display: block;
}

.nav-item .material-symbols-outlined {
  font-size: 22px;
  margin-bottom: 2px;
  transition: transform 180ms ease;
}

.nav-item.active .material-symbols-outlined {
  color: #60A5FA;
  transform: translateY(-1px);
}

.nav-item-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav-item.active .nav-item-label {
  color: #FFFFFF;
  font-weight: 700;
}

body.dark-mode .fab,
body.dark-mode .fab-finance-add,
body.dark-mode #fab-add-transaction,
body.dark-mode #fab-add-todo {
  background: linear-gradient(135deg, #2563EB 0%, #4F46E5 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.5), 0 0 18px rgba(79, 70, 229, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
}

body.dark-mode .fab:hover,
body.dark-mode #fab-add-transaction:hover,
body.dark-mode #fab-add-todo:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.65), 0 0 24px rgba(79, 70, 229, 0.45);
}

body.dark-mode .ai-fab-btn {
  background: linear-gradient(135deg, #1D4ED8 0%, #4F46E5 50%, #7C3AED 100%);
  color: #FFFFFF;
  box-shadow: 0 8px 28px rgba(59, 130, 246, 0.55), 0 0 24px rgba(99, 102, 241, 0.4);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 9999px;
}

/* Solid, High-Contrast Obsidian Surfaces (Anti-Slop Craft) */
body.dark-mode .card,
body.dark-mode .glass-card,
body.dark-mode .overview-card,
body.dark-mode .todo-hero,
body.dark-mode .link-card,
body.dark-mode .stat-card {
  background: #0E131F;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  border-radius: 18px;
  transition: transform 160ms var(--ease-button-press), box-shadow 220ms ease, border-color 220ms ease;
}

body.dark-mode .todo-stat,
body.dark-mode .todo-item,
body.dark-mode .todo-skeleton,
body.dark-mode .todo-empty {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
}

body.dark-mode .card:hover,
body.dark-mode .glass-card:hover,
body.dark-mode .overview-card:hover,
body.dark-mode .link-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.35);
  border-top-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.7), 0 0 25px -4px rgba(99, 102, 241, 0.25), inset 0 1px 1px 0 rgba(255, 255, 255, 0.2);
}

/* Tactile :active Press Feedback */
.btn:active,
.card:active,
.overview-card:active,
.clickable-card:active,
.nav-item:active,
.chip:active,
.chip-pill:active,
.fab:active,
.ai-fab-btn:active {
  transform: scale(0.97);
}

body.dark-mode .overview-card {
  padding: 18px 20px;
  border-radius: var(--radius-card);
  min-height: 124px;
  justify-content: space-between;
}

body.dark-mode .overview-card-header .overview-card-icon {
  color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .overview-card-label {
  color: #94A3B8;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

body.dark-mode .overview-card-value {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: #FFFFFF;
}

body.dark-mode .overview-card-delta {
  font-size: 11px;
  font-weight: 600;
  color: #818CF8;
}

.badge-emerald {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34D399;
}

.badge-pulsing-target {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  color: #60A5FA;
}

.pulsing-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #3B82F6;
  box-shadow: 0 0 8px #3B82F6;
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Refleksi Hari Ini - Cosmic Sapphire Aura */
.reflection-card-bg {
  display: none;
}

.reflection-card {
  position: relative;
  border-radius: 24px;
  padding: 20px 22px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(30, 58, 138, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-top: 1px solid rgba(147, 197, 253, 0.4);
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.15);
}

.reflection-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 140px;
  height: 140px;
  border-radius: 9999px;
  background: rgba(59, 130, 246, 0.25);
  filter: blur(30px);
  pointer-events: none;
}

.reflection-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.reflection-quote-mark {
  font-size: 14px;
  font-weight: 900;
  color: #BFDBFE;
}

.reflection-text {
  font-family: var(--font-body);
  font-size: 13px;
  font-style: italic;
  font-weight: 500;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 12px;
}

.reflection-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.reflection-category {
  font-size: 11px;
  font-weight: 600;
  color: #BFDBFE;
}

.reflection-share {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 150ms ease, transform 120ms ease;
}

.reflection-share:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.05);
}

/* Skor Hari Ini Circular Gauge */
.circular-progress {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.circular-progress-bg {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 3.5;
  fill: none;
}

.circular-progress-fill,
#score-circle {
  fill: none;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke: url(#score-progress-gradient);
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.7));
  transition: stroke-dasharray 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.circular-progress-label {
  position: absolute;
  inset: 10px;
  border-radius: 9999px;
  background: #0E1428;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-orb-dot {
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: #3B82F6;
  box-shadow: 0 0 8px #3B82F6;
  margin-bottom: 2px;
}

.circular-progress-label #score-percentage {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

body.dark-mode .chip-pill,
body.dark-mode .chip-filter {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94A3B8;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 180ms ease;
}

body.dark-mode .chip-pill:hover,
body.dark-mode .chip-filter:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

body.dark-mode .chip-pill.active,
body.dark-mode .chip-filter.active {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.35) 0%, rgba(37, 99, 235, 0.2) 100%);
  border: 1px solid rgba(96, 165, 250, 0.45);
  color: #FFFFFF;
  box-shadow: 0 0 16px -2px rgba(59, 130, 246, 0.4);
}

/* Dark Mode Section Segmented Filter Chips (Checklist & Riwayat Transaksi) */
body.dark-mode .section-chip-filter,
body.dark-mode .todo-chip-filter,
html[data-theme="dark"] .section-chip-filter,
html[data-theme="dark"] .todo-chip-filter {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94A3B8;
  box-shadow: none;
}

body.dark-mode .section-chip-filter:hover,
body.dark-mode .todo-chip-filter:hover,
html[data-theme="dark"] .section-chip-filter:hover,
html[data-theme="dark"] .todo-chip-filter:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
}

body.dark-mode .section-chip-filter.active,
body.dark-mode .todo-chip-filter.active,
html[data-theme="dark"] .section-chip-filter.active,
html[data-theme="dark"] .todo-chip-filter.active {
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 50%, #4F46E5 100%);
  border: 1px solid rgba(96, 165, 250, 0.45);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

/* Dark Mode Action Buttons */
body.dark-mode .btn-tool {
  background: rgba(255, 255, 255, 0.05);
  color: #E2E8F0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 6px 12px;
  min-height: 36px;
  font-size: 12px;
  font-weight: 600;
}

body.dark-mode .btn-tool:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(96, 165, 250, 0.45);
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* Buttons */
body.dark-mode .btn-secondary,
body.dark-mode .btn-primary {
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 50%, #4F46E5 100%);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.5), inset 0 1px 1px 0 rgba(255, 255, 255, 0.35);
  font-weight: 700;
  border-radius: 14px;
}

body.dark-mode .btn-secondary:hover,
body.dark-mode .btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 12px 30px -4px rgba(59, 130, 246, 0.65);
}

body.dark-mode .btn-icon {
  background: rgba(255, 255, 255, 0.06);
  color: #F8FAFC;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}

body.dark-mode .icon-circle-secondary {
  background: rgba(99, 102, 241, 0.15);
  color: #818CF8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

body.dark-mode .loading-overlay {
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(20px);
}

body.dark-mode .modal-content {
  background: rgba(14, 20, 38, 0.95);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  color: #F8FAFC;
  border-radius: 28px;
}

/* Form Controls */
body.dark-mode .form-input,
body.dark-mode .form-select,
body.dark-mode .form-textarea,
body.dark-mode .home-todo-input {
  background: rgba(11, 15, 28, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.09);
  backdrop-filter: blur(12px);
  color: #FFFFFF;
  border-radius: 16px;
}

body.dark-mode .form-input:focus,
body.dark-mode .form-select:focus,
body.dark-mode .form-textarea:focus,
body.dark-mode .home-todo-input:focus {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 0 18px rgba(99, 102, 241, 0.25);
}

body.dark-mode .home-todo-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 8px;
}

body.dark-mode .home-todo-add-btn {
  position: absolute;
  right: 6px;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, #3B82F6 0%, #6366F1 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px -3px rgba(59, 130, 246, 0.5);
}

body.dark-mode .home-todo-checkbox {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 9999px;
}

body.dark-mode .home-todo-item.done .home-todo-checkbox,
body.dark-mode .todo-item.done .todo-check {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  border-color: #10B981;
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}

body.dark-mode .todo-check {
  background: rgba(255, 255, 255, 0.05);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
}

/* Date Tracker Cells in Dark Mode */
body.dark-mode .tracker-date-cell.checked {
  background: linear-gradient(135deg, #3B82F6 0%, #6366F1 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.5);
  border: 1px solid rgba(96, 165, 250, 0.4);
}

body.dark-mode .tracker-date-cell.checked .date-num {
  color: #FFFFFF;
}

body.dark-mode .tracker-date-cell.missed {
  background: rgba(255, 255, 255, 0.03);
  color: #64748B;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

body.dark-mode .tracker-date-cell.missed .date-missed-icon {
  color: #EF4444;
  opacity: 0.6;
}

body.dark-mode .tracker-date-cell.is-today {
  border-color: #3B82F6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.6), 0 0 16px rgba(59, 130, 246, 0.5);
}

body.dark-mode .tracker-view-all-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  color: #F8FAFC;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  transition: all 150ms ease;
}

body.dark-mode .tracker-view-all-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.4);
}

/* Chat Pop-up in Dark Mode */
body.dark-mode .ai-chat-window {
  background: rgba(11, 16, 36, 0.92);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75);
  border-radius: 28px;
}

body.dark-mode .chat-bubble {
  background: rgba(18, 26, 60, 0.75);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #F8FAFC;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  border-radius: 18px;
}

body.dark-mode .chat-bubble-user {
  background: linear-gradient(135deg, #2563EB 0%, #4F46E5 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
  border: none;
}

body.dark-mode .chat-composer {
  background: rgba(11, 16, 36, 0.85);
  border-top-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .chat-send-btn {
  background: linear-gradient(135deg, #3B82F6 0%, #6366F1 100%);
  color: #FFFFFF;
}

body.dark-mode .allocation-tab.active {
  background: linear-gradient(135deg, #3B82F6 0%, #6366F1 100%);
  color: #FFFFFF;
}

body.dark-mode .chart-legend-item:hover,
body.dark-mode .chart-legend-item.active {
  background: rgba(59, 130, 246, 0.15);
}

body.dark-mode .pill-secondary {
  background: rgba(59, 130, 246, 0.15);
  color: #93C5FD;
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 9999px;
}

body.dark-mode .progress-bar {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
}

body.dark-mode .progress-bar-fill {
  background: linear-gradient(90deg, #3B82F6 0%, #6366F1 100%);
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.6);
  border-radius: 9999px;
}

/* ═══════════════════════════
   Pop-up Riwayat 30 Hari (Stitch Aura Glass Modal)
   ═══════════════════════════ */
.riwayat-modal-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px;
}

.riwayat-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.riwayat-stat-box {
  border-radius: 16px;
  padding: 12px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.riwayat-stat-box.box-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34D399;
}

.riwayat-stat-box.box-missed {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: #FB7185;
}

.riwayat-stat-box.box-streak {
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #93C5FD;
}

.riwayat-stat-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.riwayat-stat-val {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 4px;
}

.riwayat-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.riwayat-weekday-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748B;
  text-align: center;
  padding-bottom: 4px;
}

.riwayat-day-cell {
  aspect-ratio: 1;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  position: relative;
  transition: transform 120ms ease;
  user-select: none;
}

.riwayat-day-cell.checked {
  background: linear-gradient(135deg, #3B82F6 0%, #6366F1 100%);
  border: 1px solid rgba(96, 165, 250, 0.45);
  box-shadow: 0 0 16px -2px rgba(59, 130, 246, 0.45);
  color: #FFFFFF;
}

.riwayat-day-cell.checked .day-emoji {
  font-size: 9px;
  margin-top: 1px;
}

.riwayat-day-cell.missed {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #64748B;
}

.riwayat-day-cell.missed .day-cross {
  font-size: 9px;
  font-weight: 800;
  color: #EF4444;
  margin-top: 1px;
}

.riwayat-day-cell.future {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: #475569;
  background: transparent;
}

.riwayat-day-cell.today {
  box-shadow: 0 0 0 2px #3B82F6, 0 0 12px rgba(59, 130, 246, 0.5);
}

/* ═══════════════════════════
   LIGHT MODE (Pearl Glass Spec from Stitch)
   ═══════════════════════════ */
body.light-mode,
html[data-theme="light"] body {
  --background:              #F4F6F9;
  --surface:                 #FFFFFF;
  --surface-dim:             #E2E8F0;
  --surface-bright:          #FFFFFF;
  --surface-container-lowest:#FFFFFF;
  --surface-container-low:   #F8FAFC;
  --surface-container:       #F1F5F9;
  --surface-container-high:  #E2E8F0;
  --surface-container-highest:#CBD5E1;

  --card-bg:                 rgba(255, 255, 255, 0.85);
  --surface-soft:            #F8FAFC;
  --surface-variant:         #E2E8F0;

  --on-surface:              #0F172A;
  --on-surface-variant:      #475569;
  --on-background:           #0F172A;

  --foreground:              #0F172A;
  --primary:                 #2563EB;
  --primary-hover:           #1D4ED8;
  --primary-light:           #3B82F6;
  --on-primary:              #FFFFFF;
  --primary-container:       #2563EB;
  --on-primary-container:    #FFFFFF;

  --muted-foreground:        #64748B;
  --border:                  rgba(0, 0, 0, 0.08);
  --outline:                 rgba(0, 0, 0, 0.15);
  --outline-variant:         rgba(0, 0, 0, 0.06);

  --secondary:               #0F172A;
  --on-secondary:            #FFFFFF;
  --secondary-container:     #F1F5F9;
  --on-secondary-container:  #1E293B;

  --danger:                  #EF4444;
  --error:                   #DC2626;

  --color-income:            #059669;
  --color-income-bg:         rgba(5, 150, 105, 0.1);
  --color-income-border:     rgba(5, 150, 105, 0.25);
  --color-expense:           #DC2626;
  --color-expense-bg:        rgba(220, 38, 38, 0.1);
  --color-expense-border:    rgba(220, 38, 38, 0.25);

  --shadow-sm:    0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md:    0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg:    0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -2px rgba(15, 23, 42, 0.05);

  background-color: #F4F6F9;
  background-image: none;
  color: #0F172A;
}

body.light-mode .card,
body.light-mode .glass-card,
body.light-mode .overview-card,
body.light-mode .todo-hero,
body.light-mode .stat-card,
body.light-mode .link-card,
body.light-mode .todo-item {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.05);
  color: #0F172A;
}

body.light-mode .page-header {
  background: rgba(244, 246, 249, 0.88);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

body.light-mode #header-greeting {
  color: #0F172A;
}

body.light-mode .avatar-inner {
  background: #FFFFFF;
  color: #2563EB;
}

body.light-mode .avatar-status-dot {
  border-color: #F4F6F9;
}

body.light-mode .overview-card-value {
  color: #0F172A;
}

body.light-mode .circular-progress-label {
  background: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .circular-progress-label #score-percentage {
  color: #0F172A;
}

body.light-mode .nav-dock-pill {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 32px -4px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.06);
}

body.light-mode .nav-item {
  color: #64748B;
}

body.light-mode .nav-item.active {
  color: #2563EB;
}

body.light-mode .nav-item.active .material-symbols-outlined {
  color: #2563EB;
}

body.light-mode .nav-item.active .nav-item-label {
  color: #2563EB;
}

/* ═══════════════════════════
   Light Mode Button System (High-Contrast & Aesthetic - Matches Image Reference)
   ═══════════════════════════ */
body.light-mode .btn-secondary,
html[data-theme="light"] .btn-secondary,
body.light-mode #btn-subuh,
body.light-mode #btn-learn,
html[data-theme="light"] #btn-subuh,
html[data-theme="light"] #btn-learn,
body.light-mode #pomodoro-toggle-btn,
html[data-theme="light"] #pomodoro-toggle-btn {
  background: #0F172A;
  color: #FFFFFF;
  border: 1px solid #0F172A;
  font-weight: 700;
  font-size: 14.5px;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.16);
  min-height: 48px;
  letter-spacing: -0.01em;
  transition: all 180ms ease;
}

body.light-mode .btn-secondary:hover,
html[data-theme="light"] .btn-secondary:hover,
body.light-mode #btn-subuh:hover,
body.light-mode #btn-learn:hover,
html[data-theme="light"] #btn-subuh:hover,
html[data-theme="light"] #btn-learn:hover,
body.light-mode #pomodoro-toggle-btn:hover,
html[data-theme="light"] #pomodoro-toggle-btn:hover {
  background: #1E293B;
  color: #FFFFFF;
  border-color: #1E293B;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.24);
  transform: translateY(-1px);
}

body.light-mode .btn-secondary:active,
html[data-theme="light"] .btn-secondary:active,
body.light-mode #btn-subuh:active,
body.light-mode #btn-learn:active,
html[data-theme="light"] #btn-subuh:active,
html[data-theme="light"] #btn-learn:active,
body.light-mode #pomodoro-toggle-btn:active,
html[data-theme="light"] #pomodoro-toggle-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.15);
}

/* Secondary Cancel/Batal inside Modals in Light Mode */
body.light-mode .modal-content .btn-secondary,
html[data-theme="light"] .modal-content .btn-secondary {
  background: #F1F5F9;
  color: #334155;
  border: 1px solid #CBD5E1;
  font-weight: 600;
  box-shadow: none;
}

body.light-mode .modal-content .btn-secondary:hover,
html[data-theme="light"] .modal-content .btn-secondary:hover {
  background: #E2E8F0;
  color: #0F172A;
  border-color: #94A3B8;
}

/* Light Mode Section Segmented Filter Chips (Checklist & Riwayat Transaksi) */
body.light-mode .section-chip-filter,
body.light-mode .todo-chip-filter,
html[data-theme="light"] .section-chip-filter,
html[data-theme="light"] .todo-chip-filter {
  background: #FFFFFF;
  border: 1px solid #CBD5E1;
  color: #334155;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

body.light-mode .section-chip-filter:hover,
body.light-mode .todo-chip-filter:hover,
html[data-theme="light"] .section-chip-filter:hover,
html[data-theme="light"] .todo-chip-filter:hover {
  border-color: #2563EB;
  color: #0F172A;
  background: #F8FAFC;
}

body.light-mode .section-chip-filter.active,
body.light-mode .todo-chip-filter.active,
html[data-theme="light"] .section-chip-filter.active,
html[data-theme="light"] .todo-chip-filter.active {
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 50%, #4F46E5 100%);
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

body.light-mode .section-chip-filter.active .material-symbols-outlined,
body.light-mode .todo-chip-filter.active .material-symbols-outlined,
html[data-theme="light"] .section-chip-filter.active .material-symbols-outlined,
html[data-theme="light"] .todo-chip-filter.active .material-symbols-outlined {
  color: #FFFFFF;
}

body.light-mode .section-chip-filter:not(.active) .filter-count-badge,
body.light-mode .todo-chip-filter:not(.active) .filter-count-badge,
html[data-theme="light"] .section-chip-filter:not(.active) .filter-count-badge,
html[data-theme="light"] .todo-chip-filter:not(.active) .filter-count-badge {
  background: #F1F5F9;
  color: #64748B;
}

/* Light Mode Tools & Action Buttons */
body.light-mode .btn-tool {
  background: #FFFFFF;
  color: #334155;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  padding: 6px 12px;
  min-height: 36px;
  font-size: 12px;
  font-weight: 600;
}

body.light-mode .btn-tool:hover {
  background: #F8FAFC;
  border-color: #2563EB;
  color: #2563EB;
  transform: translateY(-1px);
}

body.light-mode .btn-tool-primary {
  background: rgba(37, 99, 235, 0.1);
  color: #1D4ED8;
  border: 1px solid rgba(37, 99, 235, 0.3);
}

body.light-mode .btn-tool-primary:hover {
  background: rgba(37, 99, 235, 0.18);
  color: #1E40AF;
}

body.light-mode .tracker-view-all-btn {
  background: #FFFFFF;
  color: #334155;
  border: 1px solid #CBD5E1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body.light-mode .tracker-view-all-btn:hover {
  background: #F1F5F9;
  color: #0F172A;
  border-color: #94A3B8;
}

body.light-mode .month-pill {
  background: #FFFFFF;
  color: #64748B;
  border: 1px solid #E2E8F0;
}

body.light-mode .month-pill:hover {
  background: #F1F5F9;
  color: #0F172A;
  border-color: #CBD5E1;
}

body.light-mode .month-pill.active {
  background: #0F172A;
  color: #FFFFFF;
  border-color: #0F172A;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

body.light-mode .pomodoro-mode-btn {
  color: #64748B;
}

body.light-mode .pomodoro-mode-btn.active {
  background: #0F172A;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

body.light-mode .pomodoro-circle-bg {
  stroke: #E2E8F0;
}

body.light-mode .pomodoro-subject-bar {
  background: #F8FAFC;
  border-color: #E2E8F0;
}


/* ═══════════════════════════
   Skeleton Loading Animation
   ═══════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--surface-variant) 25%, var(--surface-soft) 50%, var(--surface-variant) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite ease-in-out;
  border-radius: var(--radius-sm);
  display: inline-block;
}

body.dark-mode .skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
}

@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  width: 100%;
  border-radius: 4px;
}

.skeleton-pill {
  height: 24px;
  width: 60px;
  border-radius: var(--radius-full);
}

.skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}

.skeleton-card {
  height: 80px;
  width: 100%;
  border-radius: var(--radius-md);
}

.bg-revalidate-indicator {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 11.5px;
  color: #E2E8F0;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.bg-revalidate-indicator.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════
   SaaS Segmented Theme Switcher
   ═══════════════════════════ */
.saas-theme-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--surface-soft);
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  user-select: none;
}

body.dark-mode .saas-theme-switcher {
  background: #1E293B;
  border-color: #334155;
}

.saas-theme-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.saas-theme-option {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  border-radius: var(--radius-full);
  cursor: pointer;
  color: var(--muted-foreground);
  transition: color 0.2s ease, transform 0.15s ease;
}

.saas-theme-option:hover {
  color: var(--foreground);
}

.saas-theme-option:active {
  transform: scale(0.92);
}

.saas-theme-option .theme-icon {
  font-size: 18px;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s ease;
}

/* Sliding Pill Background Indicator */
.saas-theme-pill {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 1;
  width: 36px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--card-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, box-shadow 0.2s ease;
}

body.dark-mode .saas-theme-pill {
  background: #0B0F19;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

/* Active State Positions & Color Animations */
.saas-theme-switcher[data-selected-theme="light"] .saas-theme-pill {
  transform: translateX(0);
}

.saas-theme-switcher[data-selected-theme="dark"] .saas-theme-pill {
  transform: translateX(36px);
}

.saas-theme-switcher[data-selected-theme="light"] label[for="theme-radio-light"] {
  color: #D97706;
}

.saas-theme-switcher[data-selected-theme="light"] label[for="theme-radio-light"] .theme-icon {
  transform: scale(1.15) rotate(15deg);
}

.saas-theme-switcher[data-selected-theme="dark"] label[for="theme-radio-dark"] {
  color: #38BDF8;
}

.saas-theme-switcher[data-selected-theme="dark"] label[for="theme-radio-dark"] .theme-icon {
  transform: scale(1.15) rotate(-15deg);
}

/* ═══════════════════════════
   LIVE SPEAK & VOICE FAB
   ═══════════════════════════ */
.finance-fabs {
  position: fixed;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  right: max(20px, calc(50% - 240px + 20px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  z-index: var(--z-fab, 30);
}

@media (max-width: 480px) {
  .finance-fabs {
    right: 20px;
  }
}

.finance-fabs .fab {
  position: static;
  bottom: auto;
  right: auto;
}

.fab-voice {
  background: var(--secondary);
  color: var(--on-secondary);
  box-shadow: 0 4px 14px rgba(18, 18, 18, 0.35);
}

.fab-voice:hover {
  background: #2A2A2A;
}

/* Live Voice Recording Dialog */
.voice-record-sheet {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-md) var(--space-sm);
  gap: var(--space-sm);
}

.voice-pulsing-circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #E11D48;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.6);
  animation: pulseVoiceModal 1.3s infinite;
  margin: 10px 0;
}

.voice-pulsing-circle .material-symbols-outlined {
  font-size: 34px;
}

@keyframes pulseVoiceModal {
  0% { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.6); }
  70% { transform: scale(1.06); box-shadow: 0 0 0 18px rgba(225, 29, 72, 0); }
  100% { transform: scale(0.96); box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}

.voice-live-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--foreground);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  line-height: 1.4;
}

.voice-hint {
  font-size: 12px;
  color: var(--muted-foreground);
  background: var(--surface-soft);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}

/* ═══════════════════════════════════════════════════════════════
   29. PHASED ENHANCEMENTS: MONTH PILLS, OCR, POMODORO, REMINDER, AI MEMORY
   ═══════════════════════════════════════════════════════════════ */

/* Header Reminder Action */
.header-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--foreground);
  cursor: pointer;
  transition: all 180ms ease;
}

.header-icon-btn:hover {
  background: var(--surface);
  transform: translateY(-1px);
}

.reminder-active-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 6px #10B981;
}

/* Finance Period Bar & Tools */
.finance-period-bar {
  padding: 12px 14px;
}

.finance-month-pills-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px 2px 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.finance-month-pills-scroll::-webkit-scrollbar {
  display: none;
}

.btn-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-soft);
  color: var(--foreground);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 180ms ease;
  min-height: 36px;
  white-space: nowrap;
  user-select: none;
}

.btn-tool:hover {
  background: var(--surface);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-tool-primary {
  background: rgba(37, 99, 235, 0.15);
  color: #3B82F6;
  border-color: rgba(37, 99, 235, 0.35);
}

.btn-tool-primary:hover {
  background: rgba(37, 99, 235, 0.25);
  color: #60A5FA;
}

/* FAB Secondary (Scan Struk) */
.fab-secondary {
  position: static;
  bottom: auto;
  right: auto;
  background: linear-gradient(135deg, #4F46E5, #06B6D4);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.fab-secondary .material-symbols-outlined {
  font-size: 20px;
}

/* ── Pomodoro Focus Timer ── */
.pomodoro-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  gap: 16px;
  width: 100%;
}

.pomodoro-modes {
  display: flex;
  gap: 6px;
  background: var(--surface-soft);
  padding: 4px;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  width: 100%;
}

.pomodoro-mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  padding: 8px 12px;
  min-height: 38px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 180ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.pomodoro-mode-btn:hover {
  color: var(--foreground);
}

.pomodoro-mode-btn.active {
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 50%, #4F46E5 100%);
  color: #FFFFFF;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.pomodoro-timer-display {
  position: relative;
  width: 170px;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0 16px 0;
}

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

.pomodoro-circle-bg {
  fill: none;
  stroke: var(--surface-soft);
  stroke-width: 8;
}

.pomodoro-circle-progress {
  fill: none;
  stroke: #3B82F6;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 440;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.8s ease, stroke 0.3s ease;
}

.pomodoro-time-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.pomodoro-time-text {
  font-family: 'Sora', system-ui, sans-serif;
  font-size: 36px;
  font-weight: 800;
  color: var(--foreground);
  letter-spacing: -0.5px;
  line-height: 1;
}

.pomodoro-label-text {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-top: 4px;
  font-weight: 500;
}

.pomodoro-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 240px;
}

.pomodoro-main-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
}

.pomodoro-reset-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 180ms ease;
}

.pomodoro-reset-btn:hover {
  background: var(--surface);
  color: var(--foreground);
}

/* ── Modern Pomodoro Subject Pill Dropdown ── */
.pomodoro-subject-bar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px 6px 12px;
  width: auto;
  max-width: 280px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pomodoro-subject-bar:hover {
  border-color: var(--primary, #3B82F6);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.12);
}

.pomodoro-subject-bar:focus-within {
  border-color: var(--primary, #3B82F6);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.pomodoro-subject-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: transparent;
  border: none;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--foreground);
  outline: none;
  cursor: pointer;
  padding-right: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 12px 12px;
  transition: color 0.2s ease;
}

/* Option styling for light & dark mode */
body.light-mode .pomodoro-subject-bar,
:root:not(.dark-mode) .pomodoro-subject-bar {
  background: #F8FAFC;
  border-color: #E2E8F0;
}

body.light-mode .pomodoro-subject-select,
:root:not(.dark-mode) .pomodoro-subject-select {
  color: #0F172A;
}

body.light-mode .pomodoro-subject-select option,
:root:not(.dark-mode) .pomodoro-subject-select option {
  background-color: #FFFFFF;
  color: #0F172A;
  padding: 8px 12px;
}

body.dark-mode .pomodoro-subject-bar {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

body.dark-mode .pomodoro-subject-bar:hover {
  border-color: #60A5FA;
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.25);
}

body.dark-mode .pomodoro-subject-select {
  color: #F8FAFC;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

body.dark-mode .pomodoro-subject-select option {
  background-color: #1E293B;
  color: #F8FAFC;
  padding: 8px 12px;
}

/* AI Header Icon Button */
.ai-header-icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--foreground);
  cursor: pointer;
  transition: all 160ms ease;
}

.ai-header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.05);
}

/* Reminder Settings List */
.reminder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
}

.reminder-time-input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--foreground);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  font-weight: 700;
  outline: none;
}

/* Memory Cards */
.memory-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
}

.memory-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.15);
  color: #3B82F6;
  margin-bottom: 4px;
  display: inline-block;
}

/* ═══════════════════════════════════════════════════════════════
   FEATURE ENHANCEMENTS SUITE — Aura Glass UI Extensions
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Home Dashboard Bento Quick Action Buttons ── */
.overview-action-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
}

.overview-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  background: linear-gradient(135deg, #0284C7, #2563EB);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.overview-quick-btn:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.45);
}

.overview-quick-btn:active {
  transform: scale(0.97);
}

.overview-quick-btn.done {
  background: rgba(16, 185, 129, 0.14);
  color: #10B981;
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}

body.dark-mode .overview-quick-btn.done {
  background: rgba(16, 185, 129, 0.18);
  color: #34D399;
  border-color: rgba(16, 185, 129, 0.4);
}

/* ── 2. Smart Budget Health Visual Indicators & Warning Banner ── */
.budget-item {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  transition: all 0.2s ease;
}

.budget-item:hover {
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.budget-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 8px 0;
  position: relative;
}

body.light-mode .budget-progress-track,
:root:not(.dark-mode) .budget-progress-track {
  background: rgba(0, 0, 0, 0.07);
}

.budget-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-bar-normal {
  background: linear-gradient(90deg, #10B981, #06B6D4);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}

.progress-bar-warning {
  background: linear-gradient(90deg, #F59E0B, #FBBF24);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.progress-bar-danger {
  background: linear-gradient(90deg, #EF4444, #F43F5E);
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.55);
  animation: pulseDangerBar 2s infinite ease-in-out;
}

@keyframes pulseDangerBar {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.82; }
}

.budget-alert-banner {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #F87171;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  backdrop-filter: blur(8px);
  animation: fadeInAlert 0.3s ease-out;
}

body.light-mode .budget-alert-banner,
:root:not(.dark-mode) .budget-alert-banner {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  color: #DC2626;
}

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

/* ── 3. Unified Segmented Filter Chips (Checklist & Riwayat Transaksi) ── */
.section-filter-chips,
.todo-filter-chips {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  width: 100%;
  margin-bottom: 12px;
}

.section-chip-filter,
.todo-chip-filter {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 6px;
  min-height: 38px;
  border-radius: var(--radius-sm, 12px);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  outline: none;
  user-select: none;
}

.section-chip-filter .material-symbols-outlined,
.todo-chip-filter .material-symbols-outlined {
  font-size: 15px;
}

.section-chip-filter:hover,
.todo-chip-filter:hover {
  border-color: var(--primary);
  color: var(--foreground);
  transform: translateY(-1px);
}

.section-chip-filter.active,
.todo-chip-filter.active {
  background: linear-gradient(135deg, #2563EB 0%, #3B82F6 50%, #4F46E5 100%);
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

.section-chip-filter.active .material-symbols-outlined,
.todo-chip-filter.active .material-symbols-outlined {
  color: #FFFFFF;
}

.filter-count-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  background: rgba(125, 125, 125, 0.16);
  color: var(--muted-foreground);
  line-height: 1.2;
  transition: background 0.2s ease, color 0.2s ease;
}

.section-chip-filter.active .filter-count-badge,
.todo-chip-filter.active .filter-count-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.section-chip-filter:not(.active) .filter-count-badge,
.todo-chip-filter:not(.active) .filter-count-badge {
  background: rgba(125, 125, 125, 0.16);
  color: var(--muted-foreground);
}

/* ── 4. Milestone & Achievement Badges Grid ── */
.progress-badges-section {
  width: 100%;
}

.achievement-badges-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 640px) {
  .achievement-badges-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.achievement-badge-card {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.achievement-badge-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  border-color: var(--border-hover);
}

.achievement-badge-card.unlocked {
  border-color: rgba(245, 158, 11, 0.45);
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.09), rgba(255, 255, 255, 0.02));
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.14);
}

body.light-mode .achievement-badge-card.unlocked,
:root:not(.dark-mode) .achievement-badge-card.unlocked {
  border-color: rgba(217, 119, 6, 0.35);
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.08), rgba(255, 255, 255, 0.8));
}

.achievement-badge-card.locked {
  opacity: 0.65;
}

.badge-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.badge-card-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: rgba(255, 255, 255, 0.06);
}

.achievement-badge-card.unlocked .badge-card-icon-wrap {
  background: rgba(245, 158, 11, 0.18);
}

.badge-card-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--foreground);
  margin: 0 0 2px 0;
  letter-spacing: -0.01em;
}

.badge-card-desc {
  font-size: 11px;
  color: var(--muted-foreground);
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.badge-card-footer {
  margin-top: auto;
}

.badge-card-status {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-card-status.unlocked-text {
  color: #F59E0B;
}

.badge-card-status.locked-text {
  color: var(--muted-foreground);
}

.badge-mini-progress {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 6px;
}

body.light-mode .badge-mini-progress,
:root:not(.dark-mode) .badge-mini-progress {
  background: rgba(0, 0, 0, 0.06);
}

.badge-mini-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #F59E0B, #EAB308);
  border-radius: 999px;
}

/* ═══════════════════════════
   SUPABASE PAUSED RECOVERY BANNER
   ═══════════════════════════ */
.supabase-paused-banner {
  margin: 12px 20px 20px;
  padding: 16px 20px;
  border-radius: var(--radius-md, 14px);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.16) 0%, rgba(185, 28, 28, 0.12) 100%);
  border: 1px solid rgba(239, 68, 68, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.15);
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
  position: relative;
}

.supabase-paused-content {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
}

.supabase-paused-icon {
  font-size: 28px;
  color: #F87171;
  background: rgba(239, 68, 68, 0.2);
  padding: 8px;
  border-radius: 12px;
  flex-shrink: 0;
}

.supabase-paused-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.supabase-paused-title {
  font-size: 14px;
  font-weight: 700;
  color: #FCA5A5;
}

.supabase-paused-desc {
  font-size: 12.5px;
  color: #E2E8F0;
  line-height: 1.45;
}

.supabase-paused-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.supabase-paused-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  background: #EF4444;
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.supabase-paused-btn:hover {
  background: #DC2626;
  transform: translateY(-1px);
}

.supabase-paused-dismiss {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: #CBD5E1;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.supabase-paused-dismiss:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #FFF;
}

@media (max-width: 640px) {
  .supabase-paused-banner {
    flex-direction: column;
    align-items: flex-start;
    margin: 8px 12px 16px;
    padding: 14px 16px;
  }
  .supabase-paused-actions {
    width: 100%;
    justify-content: space-between;
    margin-top: 6px;
  }
  .supabase-paused-btn {
    flex: 1;
    justify-content: center;
  }
}

/* ── WCAG 2.2 Accessibility: Reduced Motion Support ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
  }
  .ambient-glow,
  .confetti-piece,
  .spin {
    animation: none;
  }
}

}

/* Shared UI contract: navy actions, dark neutral surfaces, readable semantic states. */
@font-face {
  font-family: 'Plus Jakarta Sans';
  src: url('/assets/jakarta-latin.153fc85b7029.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

:root, html body, html[data-theme="light"] body {
  --navy: #0F172A;
  --primary: #172B4D;
  --primary-hover: #243D60;
  --primary-light: #172B4D;
  --primary-container: var(--primary);
  --on-primary-container: #FFFFFF;
  --inverse-primary: var(--primary-light);
  --surface-tint: var(--primary);
  --progress-color: #354F70;
  --warning-text: #92400E;
  --warning-bg: #FEF3C7;
  --ai-action: #6D28D9;
  --ai-accent: #8B5CF6;
  --background: #F8FAFC;
  --surface: #F8FAFC;
  --card-bg: #FFFFFF;
  --surface-soft: #F1F5F9;
  --surface-variant: #E2E8F0;
  --surface-container: #F1F5F9;
  --surface-container-high: #E2E8F0;
  --surface-container-low: #F8FAFC;
  --foreground: #0F172A;
  --on-surface: #0F172A;
  --on-background: #0F172A;
  --muted-foreground: #58697F;
  --on-surface-variant: #58697F;
  --secondary: #0F172A;
  --secondary-container: #E2E8F0;
  --on-secondary-container: #0F172A;
  --border: #E2E8F0;
  --outline-variant: #CBD5E1;
  --color-income: #16A34A;
  --color-expense: #EF4444;
  --income-text: #15803D;
  --expense-text: #DC2626;
  --danger: #EF4444;
  --color-income-bg: #F0FDF4;
  --color-expense-bg: #FEF2F2;
  --action-soft: #E9EEF5;
  --font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: var(--font-family);
  --font-display: var(--font-family);
  --radius-card: 24px;
  --radius-card-sm: 20px;
  --radius-btn: 16px;
  --radius-modal: 24px;
  --radius-md: 16px;
  --page-padding: 20px;
  --card-padding: 20px;
  --section-gap: 24px;
  --component-gap: 12px;
  --touch-target: 44px;
  --text-body-md: 0.875rem;
  --text-body-sm: 0.8125rem;
  --text-section-heading: 1rem;
  --text-headline-lg-mobile: 1.375rem;
  --text-headline-lg: 1.625rem;
  --shadow-sm: none;
  --shadow-md: 0 4px 12px rgba(15,23,42,.08);
  --shadow-nav: 0 8px 24px rgba(15,23,42,.12);
  --shadow-fab: 0 6px 16px rgba(15,23,42,.18);
}

html[data-theme="dark"], html body.dark-mode {
  color-scheme: dark;
  --primary: #263D5B;
  --primary-hover: #354F70;
  --background: #090D14;
  --surface: #090D14;
  --card-bg: #121923;
  --surface-soft: #1B2431;
  --surface-variant: #2A3544;
  --surface-container: #1B2431;
  --surface-container-high: #2A3544;
  --surface-container-low: #121923;
  --foreground: #F8FAFC;
  --on-surface: #F8FAFC;
  --on-background: #F8FAFC;
  --secondary: #263D5B;
  --secondary-container: #2A3544;
  --on-secondary-container: #F8FAFC;
  --muted-foreground: #BAC5D3;
  --on-surface-variant: #BAC5D3;
  --border: #2F3B4B;
  --outline-variant: #61738A;
  --primary-light: #CDD8E6;
  --progress-color: #9DACC0;
  --warning-text: #FCD34D;
  --warning-bg: #3B2E17;
  --income-text: #86EFAC;
  --expense-text: #FCA5A5;
  --color-income-bg: #14352C;
  --color-expense-bg: #422B38;
  --action-soft: #23334A;
}
html[data-theme="light"] { color-scheme: light; }
body { background: var(--background) !important; color: var(--foreground); font-family: var(--font-body); line-height: 1.5; }
#app { max-width: 880px; background: var(--background); }
button, input, select, textarea { font: inherit; }
::selection { background: var(--primary); color: white; }
input, textarea { caret-color: var(--primary-light); }
:focus-visible { outline: 2px solid var(--primary-light) !important; outline-offset: 3px; }
.text-muted, .text-on-surface-variant { color: var(--muted-foreground) !important; }
.text-income { color: var(--income-text) !important; }
.text-expense { color: var(--expense-text) !important; }
.text-danger { color: var(--expense-text) !important; }
.text-primary { color: var(--primary-light) !important; }
.ambient-glow, .avatar-status-dot, .score-orb-dot, .reflection-card-bg, .todo-hero-icon, .todo-eyebrow { display: none; }
.page-header { position: static; max-width: 880px; margin: 0 auto; padding: 24px var(--page-padding) 16px !important; gap: var(--component-gap); background: var(--background) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; flex-wrap: wrap; }
.page-header[hidden] { display: none; }
body:not(.home-page) .page-content { padding-top: 24px; }
.page-header-left, .page-header-left > div, .page-header-actions { min-width: 0; }
#header-greeting { color: var(--foreground) !important; font-family: var(--font-body) !important; font-size: 1.375rem !important; line-height: 1.4; letter-spacing: -.025em; }
.avatar { width: 44px; height: 44px; border-radius: 16px; background: var(--surface-variant) !important; color: var(--foreground) !important; box-shadow: none !important; border: 0 !important; }
html body #header-avatar { background: var(--surface-variant) !important; color: var(--foreground) !important; border-radius: 16px !important; box-shadow: none !important; }
.page-section { width: 100%; max-width: 880px; margin: 0 auto; padding: 0 var(--page-padding) calc(176px + env(safe-area-inset-bottom)) !important; }
.page-content { gap: var(--section-gap); min-height: calc(100dvh - 180px); padding-top: 8px; }
.page-content > *, .card > *, .glass-card > *, .overview-card > * { min-width: 0; }
.card, .glass-card, .overview-card, .reflection-card, .todo-hero,
body.dark-mode .card, body.dark-mode .glass-card, body.dark-mode .overview-card {
  padding: var(--card-padding) !important;
  background: var(--card-bg) !important;
  color: var(--foreground) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-card) !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  transform: none !important;
}
.overview-grid { gap: var(--component-gap); grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); }
.overview-card-full { grid-column: 1 / -1; }
.overview-card-header { gap: 8px; }
.overview-card-label { color: var(--muted-foreground) !important; font-size: .8125rem; white-space: normal; }
.overview-card-value { font-family: var(--font-body) !important; font-size: 1.5rem !important; color: var(--foreground) !important; overflow-wrap: anywhere; line-height: 1.35; }
.overview-card-full .overview-card-value { font-size: 2rem !important; }
.overview-card-delta { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; color: var(--primary-light) !important; font-size: .75rem; margin-top: 8px; }
.overview-card-icon, body.dark-mode .overview-card-icon { color: var(--muted-foreground) !important; }
.score-section { gap: 16px; }
.score-info { min-width: 0; }
.circular-progress { flex-shrink: 0; width: 72px; height: 72px; }
.circular-progress-fill { stroke: var(--primary) !important; filter: none !important; }
.progress-bar-fill { background: var(--primary) !important; box-shadow: none !important; }
.progress-bar-fill { background: var(--progress-color) !important; }
html body #score-circle { stroke: var(--progress-color) !important; filter: none !important; }
html body .circular-progress-label { background: var(--card-bg) !important; border: 0 !important; box-shadow: none !important; }
html body .circular-progress-label #score-percentage { color: var(--foreground) !important; }
.reflection-label { color: var(--muted-foreground) !important; }
.reflection-text { font-family: var(--font-body); color: var(--foreground) !important; font-size: 1rem; line-height: 1.65; }
.reflection-footer, .reflection-footer * { color: var(--muted-foreground) !important; }
.reflection-label, .reflection-category, .reflection-footer { opacity: 1 !important; }
html body .reflection-card { background: var(--card-bg) !important; color: var(--foreground) !important; }
.reflection-card::before, .reflection-card::after { display: none !important; }
.icon-circle, .icon-circle-secondary, .icon-circle-orange, .icon-circle-blue, .todo-stat-icon,
.transaction-icon, .allocation-icon-badge { color: var(--muted-foreground) !important; background: var(--surface-soft) !important; border-radius: 14px; box-shadow: none; flex-shrink: 0; }
.btn, .btn-tool, .bulk-mode-btn, .tracker-view-all-btn, .chip, .header-icon-btn,
.btn-icon, .home-todo-add-btn, .todo-check, .todo-action, .link-card-more-btn,
.period-dropdown-btn, .period-check-icon, .ai-header-icon-btn, .ai-chat-close-btn { min-height: var(--touch-target) !important; min-width: var(--touch-target) !important; border-radius: var(--radius-btn) !important; }
.btn, .btn-tool, .bulk-mode-btn, .tracker-view-all-btn { padding: 10px 16px; font-size: .875rem; gap: 8px; }
.btn-primary, .btn-secondary, .btn-primary-dark, body.light-mode .modal-content .btn-secondary,
body.dark-mode .btn-secondary, .home-todo-add-btn, .pomodoro-main-btn {
  background: var(--primary) !important; color: white !important; border: 0 !important; box-shadow: none !important;
}
.btn-primary:hover, .btn-secondary:hover, .btn-primary-dark:hover { background: var(--primary-hover) !important; }
.btn-neutral { background: white !important; color: #0F172A !important; border: 1px solid var(--border) !important; box-shadow: none !important; }
.btn-neutral:hover { background: #F1F5F9 !important; }
.btn-icon, .btn-tool, .bulk-mode-btn, .tracker-view-all-btn, .chip, .header-icon-btn { background: var(--surface-soft) !important; color: var(--foreground) !important; border: 0 !important; box-shadow: none !important; }
.header-icon-btn.ai-header-trigger { color: var(--ai-accent) !important; }
button:disabled { cursor: default; opacity: .65; transform: none !important; }
.form-input, .home-todo-input, .todo-composer-input, .chat-input, .voice-transcript-input {
  min-height: 48px; border: 1px solid var(--border) !important; border-radius: var(--radius-btn) !important;
  background: var(--surface-soft) !important; color: var(--foreground) !important; box-shadow: none !important; font-size: 1rem !important; padding: 12px 14px;
}
input::placeholder, textarea::placeholder { color: var(--muted-foreground) !important; opacity: 1; }
.form-input:focus { border-color: var(--primary-light) !important; }
.form-group, .modal-form-compact .form-group { margin-bottom: 16px !important; }
.form-label, .modal-form-compact .form-label { color: var(--foreground) !important; font-size: .8125rem; line-height: 1.5; margin-bottom: 8px; }
.input-with-prefix, .chat-input-wrapper {
  display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px 8px 4px 14px;
  background: var(--surface-soft) !important; border: 1px solid var(--border) !important;
  border-radius: var(--radius-btn); box-shadow: none !important;
}
.input-with-prefix:focus-within, .chat-input-wrapper:focus-within {
  border-color: var(--primary-light) !important; outline: 2px solid var(--primary-light); outline-offset: 2px;
}
.input-with-prefix .form-input, .chat-input-wrapper .chat-input {
  min-width: 0; flex: 1; width: 100%; min-height: 44px; padding: 8px 0;
  border: 0 !important; border-radius: 0 !important; background: transparent !important;
  box-shadow: none !important; outline: none !important; text-align: left;
}
.input-prefix { height: auto; padding: 0; background: transparent !important; border: 0; color: var(--muted-foreground) !important; }
.chat-send-btn { flex-shrink: 0; width: 44px; height: 44px; min-width: 44px; }
.chat-input-wrapper .chat-input { max-height: 120px; overflow-y: auto; }
.home-todo-input-wrap { gap: 8px; background: transparent !important; border: 0 !important; padding: 0 !important; box-shadow: none !important; }
.home-todo-input { min-width: 0; width: 100%; }
.home-empty-note { padding: 8px 0; }
.home-todo-item, .todo-item { background: var(--card-bg) !important; border-color: var(--border) !important; gap: 8px; border-radius: 16px; }
.todo-title, .home-todo-text, .transaction-title, .link-card-title { color: var(--foreground) !important; overflow-wrap: anywhere; }
.home-todo-checkbox { min-width: 44px; min-height: 44px; }
.todo-copy, .transaction-copy, .transaction-info { min-width: 0; }
.todo-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.todo-stat { min-width: 0; background: var(--surface-soft) !important; border: 0 !important; border-radius: 16px; padding: 12px; gap: 8px; }
.todo-stat-value { color: var(--foreground) !important; }
.todo-stat-label, .todo-meta, .todo-progress-meta { color: var(--muted-foreground) !important; }
.todo-check { border: 1px solid var(--border) !important; }
.todo-item.done .todo-check { background: var(--primary) !important; color: white !important; }
.home-todo-checkbox, .todo-check,
.home-todo-item.done .home-todo-checkbox, .todo-item.done .todo-check {
  position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px;
  width: 44px; height: 44px; padding: 0; border: 0 !important; border-radius: 50% !important;
  background: transparent !important; color: white !important; box-shadow: none !important;
}
.home-todo-checkbox::before, .todo-check::before { content: ''; position: absolute; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--muted-foreground); background: var(--card-bg); }
.home-todo-item.done .home-todo-checkbox::before, .todo-item.done .todo-check::before { background: var(--primary); border-color: var(--primary-light); }
.home-todo-checkbox .material-symbols-outlined, .todo-check .material-symbols-outlined { position: relative; width: 18px; height: 18px; min-width: 18px; }
.home-todo-checkbox .material-symbols-outlined svg, .todo-check .material-symbols-outlined svg { width: 16px; height: 16px; }
.transaction-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: var(--radius-btn); padding: 0 10px; background: var(--surface-soft); color: var(--muted-foreground); }
.transaction-search .form-input { flex: 1; width: 100%; min-width: 0; border: 0 !important; background: transparent !important; box-shadow: none !important; outline: none !important; padding-left: 0; padding-right: 0; }
.transaction-search:focus-within { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.transaction-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.section-filter-chips, .todo-filter-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; background: transparent; }
.section-chip-filter, .todo-chip-filter, .allocation-tab, .pomodoro-mode-btn, .type-toggle-item {
  min-height: 44px !important; border-radius: 14px !important; padding: 10px 12px !important;
  background: var(--surface-soft) !important; color: var(--muted-foreground) !important;
  border: 0 !important; box-shadow: none !important; font-size: .8125rem !important; line-height: 1.4; gap: 8px; white-space: normal;
}
.section-chip-filter.active, .todo-chip-filter.active, .allocation-tab.active, .pomodoro-mode-btn.active, .type-toggle-item.active,
body.light-mode .section-chip-filter.active, body.light-mode .todo-chip-filter.active {
  background: var(--primary) !important; color: white !important;
}
.section-chip-filter.active *, .todo-chip-filter.active * { color: white !important; }
.filter-count-badge { background: var(--surface-variant) !important; color: var(--foreground) !important; }
.section-chip-filter.active .filter-count-badge, .todo-chip-filter.active .filter-count-badge { background: rgba(255,255,255,.2) !important; }
.finance-summary-grid, .finance-stats-grid { gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.finance-cards { gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.finance-cards > * { min-width: 0; }
.finance-cards .text-body-sm.flex { flex-wrap: wrap; overflow-wrap: anywhere; }
.finance-card-full { grid-column: 1 / -1; }
.finance-card-saldo { grid-column: 1 / -1; }
#finance-saldo, #finance-income, #finance-expense { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.period-selector-bar, .allocation-header-row, .transaction-header-row { gap: 12px; flex-wrap: wrap; }
.period-date-display { font-size: .75rem; color: var(--muted-foreground); }
.allocation-total-badge { background: var(--surface-soft) !important; color: var(--foreground) !important; box-shadow: none !important; overflow-wrap: anywhere; }
.allocation-tabs, .pomodoro-modes, .type-toggle { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); background: var(--surface-soft) !important; border: 0 !important; border-radius: 16px; padding: 4px; gap: 4px; width: 100%; }
.allocation-tab, .type-toggle-item { min-width: 0; width: 100%; justify-content: center; }
.allocation-chart-wrapper { min-width: 0; }
.allocation-quick-legend-row { min-width: 0; max-width: 100%; flex-wrap: wrap; overflow-x: visible; }
.quick-legend-pill { min-width: 0; max-width: 100%; white-space: normal; min-height: 44px; }
.budget-item > .flex, .budget-item-header { flex-wrap: wrap; gap: 8px; }
.budget-item .flex > * { min-width: 0; }
.budget-item-heading, .budget-item-summary { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.budget-item { display: flex; flex-direction: column; gap: 8px; }
.budget-item { padding: 14px !important; gap: 6px; }
#budget-limit-list { gap: 12px; }
[hidden] { display: none !important; }
.settings-card { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
#notification-modal-form { margin-bottom: 0; }
#page-saya { padding-top: 24px !important; }
.settings-card .form-label { margin-bottom: 0; }
.settings-card .form-input { width: 100%; min-width: 0; }
.settings-card input[type=file] { font-size: .8125rem !important; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-actions > button { flex: 1; }
.settings-budget-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 12px 0; }
.settings-budget-row label, .settings-reminder label { display: flex; align-items: center; gap: 8px; min-height: 44px; overflow-wrap: anywhere; }
.settings-budget-row input[type=checkbox], .settings-reminder input[type=checkbox] { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--primary); }
.settings-reminder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(120px, 1fr); gap: 8px; align-items: center; }
.settings-result:empty { display: none; }
.profile-preview { display: flex; justify-content: center; align-items: center; width: 72px; height: 72px; background: var(--surface-soft); border-radius: 20px; color: var(--foreground); font-weight: 700; }
.profile-preview img { width: 72px; height: 72px; border-radius: 20px; object-fit: cover; }
.profile-nav-photo { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.settings-menu { display: grid; gap: 20px; }
.settings-profile-menu { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer; }
.settings-profile-menu .profile-preview { flex-shrink: 0; width: 56px; height: 56px; }
.settings-profile-menu .profile-preview img { width: 56px; height: 56px; }
.settings-menu-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 4px; color: var(--foreground); overflow-wrap: anywhere; }
.settings-menu-list { padding: 8px 16px !important; }
.settings-menu-row { display: flex; align-items: center; gap: 12px; min-height: 64px; width: 100%; padding: 10px 0; background: transparent; color: var(--foreground); border: 0; text-align: left; font-size: .9375rem; }
.settings-menu-row + .settings-menu-row { border-top: 1px solid var(--border); }
.settings-menu-row > span:not(.material-symbols-outlined) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.settings-menu-row .material-symbols-outlined { color: var(--muted-foreground); }
.settings-detail-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
[data-settings-panel] > h2:first-child { display: none; }
.settings-card .settings-budget-row, .settings-card .settings-reminder { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.settings-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-switch-row label { min-width: 0; flex: 1; }
.settings-switch { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 52px; min-width: 52px; height: 44px; padding: 0; border: 0; background: transparent; border-radius: 14px; cursor: pointer; }
.switch-track { position: relative; display: block; width: 44px; height: 26px; border: 1px solid var(--outline-variant); border-radius: 999px; background: var(--surface-variant); }
.switch-track::after { content: ''; position: absolute; width: 20px; height: 20px; top: 2px; left: 2px; border-radius: 50%; background: var(--foreground); transition: transform .15s; }
.settings-switch[aria-checked=true] .switch-track { background: var(--primary); border-color: var(--primary-light); }
.settings-switch[aria-checked=false] .switch-track { border-color: var(--muted-foreground); }
.settings-switch[aria-checked=true] .switch-track::after { background: white; transform: translateX(18px); }
@media (min-width: 540px) { .settings-budget-row { grid-template-columns: minmax(0, 1fr) minmax(120px, 1fr); align-items: center; } }
.budget-item-heading > *, .budget-item-summary > * { min-width: 0; overflow-wrap: anywhere; }
.budget-item-status { line-height: 1; }
#tx-type-filter-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
#tx-type-filter-chips .section-chip-filter { padding: 10px 4px !important; font-size: .75rem; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
#tx-type-filter-chips .material-symbols-outlined { display: none; }
.transaction-amount { color: var(--foreground); white-space: normal; overflow-wrap: anywhere; }
.transaction-amount.income { color: var(--income-text) !important; }
.transaction-amount.expense { color: var(--expense-text) !important; }
.transaction-item { flex-wrap: wrap; gap: 12px; }
.transaction-left { flex: 1 1 140px; min-width: 0; }
.transaction-left > div:last-child { min-width: 0; }
.transaction-right { min-width: 0; margin-left: auto; }
.transaction-title, .transaction-detail { white-space: normal; overflow: visible; overflow-wrap: anywhere; text-overflow: clip; }
.export-menu { position: relative; }
.export-menu > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; }
.export-menu > summary::-webkit-details-marker { display: none; }
.export-menu-list { position: absolute; top: calc(100% + 8px); right: 0; width: 168px; padding: 8px; border-radius: 16px; background: var(--card-bg); border: 1px solid var(--border); box-shadow: var(--shadow-nav); z-index: 40; display: grid; gap: 4px; }
.export-menu-list .btn-tool { justify-content: flex-start; }
.export-menu-list { width: min(220px, calc(100vw - 40px)); }
.export-menu:not([open]) .export-menu-list { display: none; }
.tracker-date-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 0; }
.tracker-date-cell, body.dark-mode .tracker-date-cell { min-width: 0; min-height: 68px; aspect-ratio: auto; padding: 8px 0; gap: 2px; border-radius: 14px; background: var(--surface-soft) !important; color: var(--muted-foreground) !important; border: 1px solid transparent !important; box-shadow: none !important; }
.tracker-date-cell.checked, body.dark-mode .tracker-date-cell.checked { background: var(--primary) !important; color: white !important; }
.tracker-date-cell.is-today { border: 2px solid var(--primary-light) !important; }
.tracker-date-cell.is-future { background: transparent !important; border: 1px dashed var(--border) !important; }
.date-month { font-size: .625rem; line-height: 1.4; font-weight: 500; }
.date-num { font-size: .875rem; line-height: 1.4; }
.date-status-icon { width: 20px !important; height: 20px !important; }
.date-status-icon svg { width: 16px !important; height: 16px !important; }
.tracker-date-cell.is-today::after, .tracker-date-cell.checked::after { display: none !important; }
.pomodoro-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.pomodoro-mode-btn { min-width: 0; font-size: .75rem !important; padding: 10px 6px !important; }
.pomodoro-card { padding: 20px !important; gap: 20px; }
.pomodoro-time-text { font-family: var(--font-body); color: var(--foreground) !important; font-size: 2.5rem; font-variant-numeric: tabular-nums; }
.pomodoro-label-text, .pomodoro-label { color: var(--muted-foreground) !important; }
.pomodoro-circle-progress { stroke: var(--progress-color) !important; filter: none !important; }
.achievement-badge-card { background: var(--card-bg) !important; border: 1px solid var(--border) !important; box-shadow: none !important; }
.achievement-badge-card.unlocked .badge-card-icon-wrap { background: var(--action-soft) !important; color: var(--primary-light) !important; }
.achievement-badge-card .badge-card-icon-wrap { background: var(--surface-soft); color: var(--muted-foreground); }
.achievement-badge-card.locked { opacity: 1; }
.achievement-badges-grid { display: block; }
.milestone-companion { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.progress-streak-card .milestone-companion { margin: 12px 0 0; }
.milestone-cheer .mascot-streak-value { font-size: 2rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.mascot-streak-value > span { font-size: 1rem; font-weight: 500; }
#btn-subuh:disabled { background: var(--surface-soft) !important; color: var(--muted-foreground) !important; border: 1px solid var(--border) !important; opacity: 1 !important; cursor: not-allowed; transition: none !important; transform: none !important; box-shadow: none !important; }
.streak-mascot { width: 120px; height: 120px; flex: 0 0 120px; overflow: visible; }
.milestone-cheer { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.milestone-cheer strong { color: var(--foreground); font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.milestone-path { margin: 0; padding: 0; list-style: none; }
.milestone-step { display: grid; position: relative; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 20px; padding-bottom: 28px; min-height: 112px; }
.milestone-step:last-child { padding-bottom: 0; min-height: 84px; }
.milestone-step:not(:last-child)::after { content: ''; position: absolute; left: 30px; top: 64px; bottom: 0; width: 4px; background: var(--border); border-radius: 4px; }
.milestone-step.unlocked:not(:last-child)::after { background: var(--income-text); }
.milestone-medal { display: flex; align-items: center; justify-content: center; position: relative; width: 64px; height: 64px; align-self: start; border: 2px solid var(--outline-variant); border-radius: 50%; background: var(--surface-soft); color: var(--muted-foreground); box-shadow: 0 4px 0 var(--surface-variant); cursor: pointer; }
.milestone-medal > .material-symbols-outlined { width: 28px; height: 28px; }
.milestone-medal > .material-symbols-outlined svg { width: 24px; height: 24px; }
.milestone-step.unlocked .milestone-medal { background: var(--primary); color: white; border-color: var(--primary-light); }
.milestone-step.current .milestone-medal { border-color: var(--ai-accent); color: var(--ai-action); box-shadow: 0 0 0 5px var(--surface-soft), 0 5px 0 var(--border); }
.milestone-lock { position: absolute; bottom: -4px; right: -4px; background: var(--surface-variant); border-radius: 50%; width: 24px; height: 24px; padding: 3px; color: var(--foreground); }
.milestone-lock svg { width: 16px; height: 16px; }
.milestone-step-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.milestone-step-copy h3 { margin: 0; color: var(--foreground); font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }
.milestone-level, .milestone-status { color: var(--muted-foreground); overflow-wrap: anywhere; }
.milestone-step.current .milestone-status { color: var(--primary-light); font-weight: 600; }
.mascot-hand { transform-origin: 101px 83px; animation: mascot-wave .75s ease-in-out 3; }
.mascot-eyes { transform-box: fill-box; transform-origin: center; animation: mascot-blink 3s 2; }
.mascot-spark { animation: mascot-sparkle 1s ease-in-out 3; transform-origin: center; }
.milestone-companion.celebrating .streak-mascot, .milestone-step.level-up .milestone-medal { animation: milestone-pop .65s ease-out 1; }
@keyframes mascot-wave { 50% { transform: rotate(-18deg); } }
@keyframes mascot-blink { 90%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }
@keyframes mascot-sparkle { 50% { opacity: .3; } }
@keyframes milestone-pop { 35% { transform: translateY(-8px) rotate(-5deg); } 70% { transform: translateY(0) rotate(3deg); } }
.badge-card-desc, .badge-card-status.locked-text { color: var(--muted-foreground) !important; }
.link-library-section { margin-top: 8px; }
.link-library-section > .flex { flex-wrap: wrap; gap: 12px; }
.link-library-section > .flex > div { flex: 1 1 160px; min-width: 0; }
.chip { flex-shrink: 0; }
.donut-chart-box, .donut-svg { width: 100%; max-width: 100%; }
.donut-svg { overflow: hidden; }
.connection-status { margin: 0 20px 12px; padding: 12px 16px; border-radius: 16px; background: var(--surface-soft); color: var(--muted-foreground); font-size: .8125rem; }
.link-card { background: var(--card-bg) !important; border-color: var(--border) !important; box-shadow: none !important; border-radius: 20px; }
.empty-state { color: var(--muted-foreground); padding: 28px 20px; min-height: 144px; }
.empty-state-title { color: var(--foreground) !important; font-size: .875rem; }
.empty-state-desc { color: var(--muted-foreground) !important; font-size: .8125rem; line-height: 1.6; }
.bottom-nav { width: calc(100% - 40px) !important; max-width: 430px !important; bottom: calc(12px + env(safe-area-inset-bottom)) !important; border-radius: 24px !important; }
.nav-dock-pill, body.light-mode .nav-dock-pill { padding: 6px !important; border-radius: 24px !important; background: var(--card-bg) !important; border: 1px solid var(--border) !important; box-shadow: var(--shadow-nav) !important; backdrop-filter: none !important; gap: 4px; }
.nav-item { min-width: 0; min-height: 56px; padding: 6px 4px !important; border-radius: 18px !important; gap: 2px; color: var(--muted-foreground) !important; }
.nav-item.active, body.light-mode .nav-item.active { color: var(--primary-light) !important; background: var(--action-soft) !important; }
.nav-item.active .material-symbols-outlined, body.light-mode .nav-item.active .material-symbols-outlined { color: inherit !important; transform: none !important; }
.nav-item .material-symbols-outlined { color: inherit !important; }
.nav-item-label { font-size: .6875rem; letter-spacing: 0; color: inherit !important; }
.nav-item-label { font-size: .625rem; overflow-wrap: anywhere; }
.nav-active-bar, .nav-item.active .nav-active-bar { display: none !important; }
.nav-menu-btn { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; min-width: 44px; min-height: 56px; padding: 6px 4px; gap: 2px; border: 0; border-radius: 18px; color: var(--muted-foreground); background: transparent; }
.quick-actions { display: grid; gap: 12px; }
.quick-actions .btn { justify-content: flex-start; text-align: left; }
.fab { width: 52px; height: 52px; min-height: 52px; background: var(--primary) !important; border: 0 !important; border-radius: 18px !important; box-shadow: var(--shadow-fab) !important; }
.finance-fabs, #fab-add-todo { bottom: calc(100px + env(safe-area-inset-bottom)) !important; right: max(20px, calc((100vw - 840px) / 2)) !important; }
.modal-overlay { top: var(--visual-top, 0px) !important; bottom: auto !important; height: var(--visual-height, 100dvh); padding-top: 12px; background: var(--overlay-backdrop) !important; backdrop-filter: blur(var(--overlay-blur)) !important; -webkit-backdrop-filter: blur(var(--overlay-blur)) !important; }
.modal-content, body.dark-mode .modal-content { max-width: 520px; max-height: 92%; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); background: var(--card-bg) !important; border: 0 !important; border-radius: 24px 24px 0 0; scrollbar-color: var(--outline-variant) transparent; }
.modal-center .modal-content { border-radius: 24px; }
.modal-heading-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-title { font-family: var(--font-body); font-size: 1.125rem; color: var(--foreground); }
.modal-form-header { display: block; margin-bottom: 12px; }
.transaction-mode-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 20px; }
.selection-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.selection-item, body.dark-mode .selection-item { min-width: 0; min-height: 60px; padding: 12px; gap: 8px; border: 1px solid var(--border) !important; border-radius: 16px; background: var(--surface-soft) !important; color: var(--foreground) !important; box-shadow: none !important; }
.selection-item .selection-icon-wrap { min-width: 20px; width: 20px; height: 24px; background: none !important; }
.selection-item .material-symbols-outlined { color: var(--muted-foreground) !important; }
.selection-label { font-size: .75rem; line-height: 1.5; overflow-wrap: anywhere; color: inherit !important; white-space: normal; }
.selection-item.selected, body.dark-mode .selection-item.selected { border-color: var(--primary-light) !important; color: var(--primary-light) !important; background: var(--action-soft) !important; }
.selection-item.selected .material-symbols-outlined { color: var(--primary-light) !important; }
html body .selection-item.selected .selection-label { color: var(--primary-light) !important; }
html body .type-toggle-item.active[data-type="Pengeluaran"] { background: var(--primary) !important; color: white !important; }
html body .type-toggle-item.active[data-type="Pemasukan"] { background: var(--primary) !important; color: white !important; }
html body .section-chip-filter, html body .todo-chip-filter { border: 0 !important; background: var(--surface-soft) !important; color: var(--muted-foreground) !important; box-shadow: none !important; }
html body .section-chip-filter.active, html body .todo-chip-filter.active { background: var(--primary) !important; color: white !important; }
html body .card, html body .glass-card, html body .overview-card, html body .todo-item, html body .link-card { box-shadow: none !important; }
html body .home-todo-add-btn { background: var(--primary) !important; box-shadow: none !important; }
html body .tracker-date-cell.checked { background: var(--primary) !important; box-shadow: none !important; }
html body .tracker-date-cell.is-today { box-shadow: none !important; border-color: var(--primary-light) !important; }
html body .tracker-view-all-btn { background: var(--surface-soft) !important; border: 0 !important; box-shadow: none !important; color: var(--foreground) !important; }
html body .riwayat-day-cell { min-width: 0; background: var(--surface-soft) !important; color: var(--muted-foreground) !important; box-shadow: none !important; border: 1px solid transparent !important; }
html body .riwayat-day-cell.checked { background: var(--primary) !important; color: white !important; }
html body .riwayat-day-cell.is-today { border-color: var(--primary-light) !important; }
html body .riwayat-day-cell.future { background: transparent !important; border: 1px dashed var(--border) !important; }
.riwayat-calendar-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.badge-mini-progress-bar { background: var(--primary) !important; box-shadow: none !important; }
.badge-mini-progress-bar { background: var(--progress-color) !important; }
.pill-primary, .pill-secondary { color: var(--primary-light) !important; background: var(--action-soft) !important; border-color: var(--border) !important; }
.badge-card-status.unlocked-text { color: var(--primary-light) !important; }
.saas-theme-input:focus-visible + .saas-theme-option { outline: 2px solid var(--primary-light); outline-offset: 2px; }
.reflection-share, .link-card-dropdown-item, .modal-tab-btn, .month-pill, .supabase-paused-dismiss, .period-date-display { min-height: 44px; min-width: 44px; }
.riwayat-title, .riwayat-stat-val { color: var(--foreground) !important; }
.riwayat-stat-label, .riwayat-weekday-header { color: var(--muted-foreground) !important; }
.progress-bar-normal { background: var(--color-income) !important; box-shadow: none !important; }
.progress-bar-warning { background: #B45309 !important; box-shadow: none !important; }
.progress-bar-danger { background: var(--color-expense) !important; box-shadow: none !important; }
.todo-stat { flex-wrap: wrap; }
.todo-stat-info { flex: 1 1 54px; }
.todo-stat-label { overflow-wrap: anywhere; white-space: normal; }
.modal-sticky-footer, body.dark-mode .modal-sticky-footer { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom)); margin: 20px -20px calc(-20px - env(safe-area-inset-bottom)); padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); background: var(--card-bg) !important; border-top: 1px solid var(--border); box-shadow: none !important; backdrop-filter: none !important; }
.saas-theme-switcher { background: var(--surface-soft) !important; height: 44px; border: 0 !important; border-radius: 16px; padding: 0; box-shadow: none !important; }
.saas-theme-option { width: 44px; min-height: 44px; color: var(--muted-foreground); }
.saas-theme-pill { height: 36px; top: 4px; background: var(--card-bg) !important; box-shadow: none !important; }
.saas-theme-option .theme-icon { color: inherit !important; }
.saas-theme-switcher[data-selected-theme="light"] label[for="theme-radio-light"],
.saas-theme-switcher[data-selected-theme="dark"] label[for="theme-radio-dark"] { color: var(--primary-light) !important; }
.ai-chat-window { background: var(--card-bg) !important; color: var(--foreground); border-color: var(--border) !important; box-shadow: var(--shadow-nav); width: min(420px, calc(100vw - 40px)); }
.ai-open { overflow: hidden; }
.ai-open .bottom-nav, .ai-open .finance-fabs, .ai-open #fab-add-todo { visibility: hidden; }
.ai-tab-content, .ai-chat-window .chat-area { min-height: 0; }
.ai-chat-header, .ai-tab-switcher, .chat-composer { flex-shrink: 0; }
.ai-tab-btn { min-height: 44px; padding: 8px; }
.ai-chat-window .chat-composer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.ai-chat-header, .chat-composer, .voice-hero-card, .ai-tab-switcher { background: var(--card-bg) !important; color: var(--foreground); border-color: var(--border) !important; }
.header-icon-btn.ai-header-trigger { border-radius: 50% !important; }
.ai-chat-avatar-status, .chat-message:not(.user) .chat-avatar { border-radius: 50% !important; background: var(--primary) !important; color: white !important; box-shadow: none !important; }
.ai-chat-header .ai-chat-avatar-status *, .chat-message:not(.user) .chat-avatar * { color: white !important; }
.ai-chat-title, .voice-status-title, .ai-chat-header * { color: var(--foreground) !important; }
.chat-bubble { background: var(--surface-soft) !important; color: var(--foreground) !important; border-color: var(--border) !important; }
.chat-message.user .chat-bubble { background: var(--primary) !important; color: white !important; }
.ai-fab, .chat-send-btn { background: var(--ai-action) !important; box-shadow: none !important; }
.budget-status { font-size: .6875rem; padding: 2px 8px; border-radius: 8px; font-weight: 700; }
.budget-status.status-safe { color: var(--income-text); background: var(--color-income-bg); }
.budget-status.status-danger { color: var(--expense-text); background: var(--color-expense-bg); }
.budget-status.status-warning { color: var(--warning-text); background: var(--warning-bg); }
.donut-center-detail, .donut-center-label { fill: var(--muted-foreground) !important; }
.donut-center-action { fill: var(--primary-light) !important; }
.donut-svg text:not(.donut-center-label):not(.donut-center-action) { fill: var(--foreground) !important; }
.text-secondary { color: var(--foreground) !important; }
.riwayat-stat-title { color: var(--muted-foreground) !important; opacity: 1; }
.riwayat-today-badge { position: absolute; top: -6px; right: -6px; padding: 2px 5px; border-radius: 8px; background: var(--primary); color: white; font-size: .625rem; font-weight: 700; line-height: 1.2; }
.allocation-cat-pct-badge { color: var(--foreground) !important; background: var(--surface-variant) !important; }
html[data-theme="dark"] .tracker-date-cell.checked { border-color: var(--outline-variant) !important; }
.keyboard-open .bottom-nav, .keyboard-open .finance-fabs, .keyboard-open #fab-add-todo { visibility: hidden; }
.data-loading [data-loading-value] { color: transparent !important; background: var(--surface-variant); border-radius: 8px; }
.skeleton-row { height: 52px; margin: 8px 0; border-radius: 14px; background: var(--surface-variant); animation: skeleton-pulse 1.2s ease-in-out infinite alternate; }
.data-loading .skeleton-row:nth-child(2) { width: 85%; }
@keyframes skeleton-pulse { to { opacity: .5; } }

/* Legacy class names stay as hooks; their content is now locally bundled SVG. */
.material-symbols-outlined { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; min-width: 20px; flex-shrink: 0; font-size: 0 !important; line-height: 0; font-family: inherit !important; overflow: hidden; }
.material-symbols-outlined svg { width: 22px; height: 22px; flex-shrink: 0; }
.icon-xs, .icon-sm { width: 20px; height: 20px; }
.icon-xs svg, .icon-sm svg { width: 20px; height: 20px; }
.material-symbols-outlined:empty { visibility: hidden; }
.modal-overlay.active .material-symbols-outlined[data-icon] { visibility: visible; }

@media (max-width: 540px) {
  .page-header { flex-wrap: wrap; align-items: center; }
  .page-header-left { flex: 1 1 140px; width: auto; }
  .page-header-actions { width: auto; justify-content: flex-end; margin-left: auto; }
  .finance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .finance-grid > :first-child { grid-column: 1 / -1; }
  .score-section { align-items: center; }
  .score-info .mb-md { margin-bottom: 12px; }
  .link-card-grid { grid-template-columns: minmax(0, 1fr); }
  .riwayat-day-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
@media (max-width: 639px) {
  .ai-chat-window { top: var(--visual-top, 0px); bottom: auto !important; left: 0; right: 0; width: 100%; max-width: none; height: var(--visual-height, 100dvh); max-height: none; margin: 0; border: 0; border-radius: 0; }
  .ai-chat-header { padding: max(12px, env(safe-area-inset-top)) 16px 12px; gap: 8px; }
  .ai-chat-header-info { min-width: 0; gap: 8px; }
  .ai-chat-title { font-size: 1rem; overflow-wrap: anywhere; }
  .ai-chat-subtitle { display: none; }
}
@media (min-width: 640px) {
  :root, body { --card-padding: 24px; --section-gap: 32px; }
  .page-header { padding-top: 32px !important; }
  .overview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .overview-card-full { grid-column: auto; }
  .finance-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .finance-card-saldo { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

#tx-form-view[hidden], .transaction-voice-screen[hidden], .transaction-record-actions [hidden] { display: none !important; }
.transaction-voice-screen { display: flex; flex-direction: column; gap: 24px; min-height: min(540px, 70dvh); }
.transaction-voice-screen .modal-heading-row { margin: 0; gap: 12px; }
.transaction-recorder { display: flex; flex: 1; flex-direction: column; align-items: center; gap: 24px; padding-top: 20px; }
.transaction-record-mic { display: grid; place-items: center; position: relative; width: 100px; height: 100px; flex-shrink: 0; padding: 0; border: 0; border-radius: 50%; color: white; background: var(--primary); isolation: isolate; }
.transaction-record-mic .material-symbols-outlined, .transaction-record-mic svg { width: 36px; height: 36px; }
.transaction-record-mic:disabled { opacity: 1; }
.transaction-record-mic::before, .transaction-record-mic::after { content: ''; position: absolute; inset: -10px; border: 2px solid var(--primary-light); border-radius: 50%; opacity: 0; z-index: -1; }
[data-state=listening] .transaction-record-mic::before, [data-state=listening] .transaction-record-mic::after { animation: transaction-record-pulse 1.8s ease-out infinite; }
[data-state=listening] .transaction-record-mic::after { animation-delay: .9s; }
[data-state=processing] .transaction-record-mic::before { opacity: 1; border-style: dashed; animation: transaction-process-spin 1.5s linear infinite; }
#tx-voice-status { margin: 0; text-align: center; color: var(--foreground); overflow-wrap: anywhere; }
.transaction-transcript { display: flex; flex-direction: column; align-self: stretch; gap: 8px; min-height: 120px; padding: 16px; background: var(--surface-soft); border-radius: 16px; }
#tx-voice-transcript { display: block; color: var(--foreground); line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
#tx-voice-transcript:empty::before { content: 'Ucapanmu akan tampil di sini…'; color: var(--muted-foreground); }
.transaction-record-actions { display: grid; gap: 8px; }
.chat-transaction-review { margin-top: 12px; width: 100%; }
@keyframes transaction-record-pulse { 0% { transform: scale(.85); opacity: .7; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes transaction-process-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .transaction-record-mic::before, .transaction-record-mic::after { animation: none !important; } [data-state=listening] .transaction-record-mic::before { opacity: .6; } }

/* Two-line card copy. Values, dates, alerts, forms and full-text dialogs stay unrestricted. */
.card-copy-2, .overview-card-label, .overview-card-delta > span:first-child,
.home-todo-text, .todo-title, .transaction-title, .link-card-title,
.milestone-step-copy h3, .milestone-cheer > .text-body-sm,
.settings-menu-copy > strong, .settings-menu-copy > .text-body-sm,
.settings-menu-row > span:nth-child(2), .card h2.text-section-heading {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  overflow: hidden; text-overflow: ellipsis; white-space: normal; overflow-wrap: anywhere; line-height: 1.5;
}
.overview-card:not(.overview-card-full) .overview-card-header { flex-direction: column; align-items: flex-start; }
.overview-card-header .overview-card-label { min-width: 0; }
.overview-card { display: flex; flex-direction: column; }
.overview-card .overview-metric-row { margin-top: auto; padding-top: 12px; }
.overview-card .overview-card-delta { margin-top: 8px; }
.finance-card-income > .text-body-sm, .finance-card-expense > .text-body-sm { flex-direction: column; align-items: flex-start; }
.finance-card-income > .text-body-sm > span:last-child, .finance-card-expense > .text-body-sm > span:last-child { overflow-wrap: anywhere; }
.card-text-trigger { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.home-todo-copy { flex: 1; }
.card-text-trigger:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 3px; border-radius: 4px; }
.card-copy-full { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }

:root { --overlay-backdrop: rgba(2, 6, 23, .72); --overlay-blur: 6px; }
html[data-theme=dark] { --overlay-backdrop: rgba(0, 0, 0, .78); }
.confirm-overlay, .ai-backdrop { background: var(--overlay-backdrop) !important; backdrop-filter: blur(var(--overlay-blur)) !important; -webkit-backdrop-filter: blur(var(--overlay-blur)) !important; }
.btn.btn-neutral, body.dark-mode .btn.btn-neutral, body.light-mode .modal-content .btn.btn-neutral { background: white !important; color: #0F172A !important; border: 1px solid var(--border) !important; }
.transaction-history-tools { display: flex; gap: 8px; align-items: stretch; }
.transaction-history-tools .transaction-search { flex: 1; min-width: 0; }
.history-filter-button { flex-shrink: 0; width: 48px; min-height: 48px !important; }
.history-filter-button.active { background: var(--primary) !important; color: white !important; }
.history-filter-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; font-size: .8125rem; color: var(--muted-foreground); }
.history-filter-status[hidden] { display: none; }
.history-filter-status > span { min-width: 0; overflow-wrap: anywhere; }
.history-filter-status button { flex-shrink: 0; }
.history-date-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 12px; }
.modal-action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.modal-action-row > button { flex: 1 1 120px; }
.form-error { color: var(--expense-text); overflow-wrap: anywhere; margin-bottom: 12px; }
.clickable-tx-item:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 3px; }
.modal-content .btn, .modal-content .btn-tool { white-space: normal; overflow-wrap: anywhere; }
@supports not (backdrop-filter: blur(1px)) { :root { --overlay-backdrop: rgba(2, 6, 23, .84); } }

.training-header, .training-progress-label { display:flex;justify-content:space-between;align-items:center;gap:8px; }
.training-header { flex-wrap:wrap;margin-bottom:16px; }
.training-header p { margin:4px 0 0; }
.training-progress-label { font-size:.8125rem;margin-bottom:8px; }
.training-calendar { display:grid;grid-template-columns:repeat(7,minmax(44px,1fr));gap:2px;margin:16px -12px;overflow-x:auto;overscroll-behavior-inline:contain;padding:3px; }
.training-day { display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:72px;padding:8px 0;border:1px solid transparent;border-radius:12px;background:var(--surface-soft);color:var(--muted-foreground);font:inherit;font-size:.625rem;cursor:pointer; }
.training-day strong { font-size:.8125rem; }
.training-day.today { border-color:var(--primary-light); }
.training-day.complete { background:var(--primary);color:white; }
.training-next { display:flex;align-items:center;flex-wrap:wrap;gap:12px;justify-content:space-between; }
.training-next h3, .training-session h3 { margin:4px 0;font-size:1rem;overflow-wrap:anywhere; }
.training-next > div { min-width:0;flex:1 1 130px;overflow-wrap:anywhere; }
.training-edit-plan { margin-top:12px; }
.training-session-list { display:grid;gap:12px;margin:16px 0; }
.training-session, .training-editor-row { padding:12px 0;border-bottom:1px solid var(--border);overflow-wrap:anywhere; }
.training-session p { margin:8px 0; }
.training-history-row { display:flex;flex-direction:column;gap:8px;min-height:60px;padding:16px;text-align:left;border:1px solid var(--border);border-radius:16px;background:var(--surface-soft);color:var(--foreground);font:inherit;overflow-wrap:anywhere;cursor:pointer; }
.training-edit-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,8rem),1fr));gap:8px; }
.training-editor-row { margin-bottom:16px; }
.training-editor-row > .btn { margin-top:8px; }
