/* ═══════════════════════════════════════════════════════
   AWARE — Personal Expense Tracker
   Off-White Premium Theme — Vanilla CSS Design System
   ═══════════════════════════════════════════════════════ */

/* ── CSS Custom Properties (Design Tokens) ── */
:root {
  /* Backgrounds */
  --bg-primary: #F8F3F0;
  --bg-surface: #FFFFFF;
  --bg-surface-alt: #F1ECE6;
  --bg-surface-dim: #E8E1D9;
  --bg-hover: #EFE8E1;
  --bg-active: #E4DCD3;

  /* Text */
  --text-primary: #0A192F;
  --text-secondary: #33445C;
  --text-muted: #728299;
  --text-inverse: #FFFFFF;

  /* Accent — Sage Green */
  --accent: #014BAA;
  --accent-hover: #013A85;
  --accent-light: #EBF2FD;
  --accent-dark: #002A66;

  /* Secondary — Warm Terracotta */
  --expense: #C4725E;
  --expense-light: #FCEAE5;
  --expense-dark: #A05A48;

  /* Warning / Info */
  --warning: #D4A853;
  --warning-light: #FFF8E7;
  --info: #5B8DB8;
  --info-light: #E8F1F8;

  /* Borders & Dividers */
  --border: #E8E1D9;
  --border-light: #F3ECE5;
  --border-focus: #014BAA;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.10);

  /* Typography */
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Layout */
  --sidebar-width: 300px;
  --topbar-height: 60px;
  --bottombar-height: 0px;
  --max-content: 780px;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button {
  font-family: var(--font-body);
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
  color: inherit;
}

input, textarea, select {
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
}

img { max-width: 100%; display: block; }

/* ── Typography ── */
.font-display {
  font-family: var(--font-heading);
  font-size: 48px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.font-h1 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.font-h2 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
}

.font-h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
}

.font-body { font-size: 16px; line-height: 1.5; }
.font-body-sm { font-size: 14px; line-height: 1.5; }
.font-caption { font-size: 12px; line-height: 1.4; font-weight: 500; }
.font-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── Utility ── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-accent { color: var(--accent); }
.text-expense { color: var(--expense); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-warning { color: var(--warning); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Scrollbar ── */
.custom-scrollbar::-webkit-scrollbar { width: 5px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.18);
}

/* ══════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ══════════════════════════════════════════════════ */
.toast-container {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  transform: translateX(120%);
  opacity: 0;
  transition: all var(--duration-normal) var(--ease-out);
  font-size: 14px;
  font-weight: 500;
}

.toast.visible {
  transform: translateX(0);
  opacity: 1;
}

.toast-success {
  border-left: 4px solid var(--accent);
}

.toast-success .toast-icon { color: var(--accent); }

.toast-error {
  border-left: 4px solid var(--expense);
}

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

.toast-info {
  border-left: 4px solid var(--info);
}

.toast-info .toast-icon { color: var(--info); }

/* ══════════════════════════════════════════════════
   AUTH VIEW
   ══════════════════════════════════════════════════ */
.auth-view {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg-primary);
}

/* Decorative background orbs */
.auth-bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.35;
}

.auth-bg-orb-1 {
  width: 300px;
  height: 300px;
  top: -80px;
  left: -80px;
  background: var(--accent-light);
}

.auth-bg-orb-2 {
  width: 400px;
  height: 400px;
  top: 50%;
  right: -120px;
  background: var(--bg-surface-dim);
}

.auth-bg-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image: radial-gradient(circle at 1px 1px, rgba(1, 75, 170, 0.08) 1px, transparent 0);
  background-size: 28px 28px;
}

.auth-main {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
  padding: var(--space-xl) var(--space-md) var(--space-md);
  z-index: 10;
}

/* Character / Logo Section */
.auth-character-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.character-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  overflow: hidden;
  animation: logo-float 4s ease-in-out infinite;
  box-shadow: 0 8px 32px rgba(0,107,95,0.22), 0 2px 8px rgba(0,0,0,0.10);
}

/* New logo image - auth screen */
.aware-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
  animation: logo-pulse-glow 3s ease-in-out infinite;
}

/* Glow ring behind logo */
.logo-glow-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,200,150,0.18) 0%, transparent 70%);
  animation: logo-ring-breathe 3s ease-in-out infinite;
  pointer-events: none;
}

/* Topbar logo image */
.topbar-logo-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,107,95,0.25));
  transition: transform 0.25s ease, filter 0.25s;
}
.topbar-brand:hover .topbar-logo-img {
  transform: rotate(-6deg) scale(1.12);
  filter: drop-shadow(0 4px 12px rgba(0,180,130,0.45));
}

/* Sidebar logo image */
.sidebar-logo-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,107,95,0.25));
  transition: transform 0.3s ease;
}
.sidebar-brand:hover .sidebar-logo-img {
  transform: scale(1.15) rotate(5deg);
}

.welcome-bubble {
  position: absolute;
  top: -8px;
  right: -40px;
  background: var(--accent);
  color: var(--text-inverse);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  opacity: 0;
  transform: scale(0.9);
  transition: all var(--duration-normal) var(--ease-out);
  pointer-events: none;
  white-space: nowrap;
}

.welcome-bubble.visible {
  opacity: 1;
  transform: scale(1);
}

@keyframes logo-float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  25%       { transform: translateY(-8px) rotate(-1deg); }
  75%       { transform: translateY(-4px) rotate(1deg); }
}

@keyframes logo-pulse-glow {
  0%, 100% { filter: drop-shadow(0 8px 24px rgba(0,107,95,0.28)); }
  50%       { filter: drop-shadow(0 12px 36px rgba(0,190,140,0.52)) brightness(1.06); }
}

@keyframes logo-ring-breathe {
  0%, 100% { transform: scale(1);    opacity: 0.6; }
  50%       { transform: scale(1.18); opacity: 1;   }
}

@keyframes character-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes character-bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.character-bounce { animation: character-bounce 0.5s ease-in-out; }

.auth-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Auth Card */
.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.5s var(--ease-out);
  overflow: hidden;
}

/* Auth Tabs */
.auth-tabs {
  display: flex;
  position: relative;
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.auth-tab-btn {
  flex: 1;
  padding: var(--space-sm) 0;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: color var(--duration-fast);
}

.auth-tab-btn.active {
  color: var(--text-primary);
}

.tab-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: transform var(--duration-normal) var(--ease-in-out);
}

/* Form Content Area */
.auth-form-area {
  position: relative;
  min-height: 260px;
}

/* State Transitions */
.state-transition {
  transition: opacity var(--duration-normal) ease, transform var(--duration-normal) ease;
}

.hidden-state {
  display: none !important;
  opacity: 0;
  transform: translateY(8px);
}

.active-state {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Form Elements */
.form-group {
  margin-bottom: var(--space-md);
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.input-with-icon {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 20px;
}

.form-input {
  width: 100%;
  padding: 12px 16px 12px 46px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(1, 75, 170, 0.15);
}

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

.form-input-plain {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.form-input-plain:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(1, 75, 170, 0.15);
}

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

.form-input-dollar {
  padding-left: 32px;
}

.dollar-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 700;
  color: var(--text-muted);
}

/* OTP Boxes */
.otp-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  margin-top: var(--space-md);
}

.otp-box {
  flex: 1 1 0;
  width: 100%;
  max-width: 44px;
  min-width: 28px;
  height: 50px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-primary);
  padding: 0;
  box-sizing: border-box;
  transition: border-color var(--duration-fast), box-shadow var(--duration-fast);
}

.otp-box:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(1, 75, 170, 0.15);
  outline: none;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
  border: none;
  line-height: 1;
}

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

.btn-primary {
  background: linear-gradient(135deg, #014BAA 0%, #013A85 100%) !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(1, 75, 170, 0.28);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: var(--shadow-sm);
}

.btn-dark {
  background: linear-gradient(135deg, #014BAA 0%, #013A85 100%) !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(1, 75, 170, 0.28) !important;
}

.btn-dark:hover {
  background: #1a1a1a;
}

.btn-outline {
  background: #FFFFFF !important;
  border: 1.5px solid var(--border) !important;
  color: #014BAA !important;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.btn-danger {
  background: var(--expense);
  color: var(--text-inverse);
}

.btn-danger:hover {
  background: var(--expense-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}

.btn-ghost:hover {
  background: var(--bg-hover);
}

.btn-full { width: 100%; }

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.btn-icon:hover {
  background: var(--bg-hover);
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--duration-fast);
}

.link-btn:hover { color: var(--accent-hover); text-decoration: underline; }

/* Auth Footer */
.auth-footer {
  margin-top: var(--space-xl);
  text-align: center;
}

.auth-footer-icons {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  opacity: 0.2;
  margin-bottom: var(--space-sm);
}

.auth-footer-text {
  font-size: 11px;
  color: var(--text-muted);
}

/* ══════════════════════════════════════════════════
   WORKSPACE VIEW
   ══════════════════════════════════════════════════ */
.workspace-view {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  position: relative;
}

/* ── Top Navigation Bar ── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  z-index: 40;
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}

.brand-badge-icon {
  color: var(--accent);
  font-size: 26px;
}

.topbar-logo {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  transition: all var(--duration-fast);
}

.search-bar:focus-within {
  border-color: var(--accent);
  background: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(1, 75, 170, 0.15);
}

.search-bar input {
  background: transparent;
  border: none;
  font-size: 13px;
  width: 140px;
  color: var(--text-primary);
}

@media (min-width: 640px) {
  .search-bar input {
    width: 220px;
  }
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-clear-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
}

.search-clear-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-surface-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  overflow: hidden;
}

.avatar-circle .material-symbols-outlined {
  color: var(--text-muted);
  font-size: 22px;
}

/* ── Layout Container ── */
.workspace-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Sidebar ── */
.sidebar {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
  transition: transform var(--duration-normal) var(--ease-out);
}

.sidebar.open {
  transform: translateX(0);
}

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.sidebar-brand-icon {
  color: var(--accent);
  font-size: 28px;
}

.sidebar-brand-text {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-body {
  padding: var(--space-md);
  flex: 1;
  overflow-y: auto;
}

.sidebar-new-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px var(--space-lg);
  background: var(--text-primary);
  color: var(--text-inverse);
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: var(--space-lg);
  transition: all var(--duration-fast);
  border: none;
  cursor: pointer;
}

.sidebar-new-btn:hover {
  background: #1a1a1a;
  box-shadow: var(--shadow-sm);
}

/* Sidebar Folder Tree */
.folder-tree {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.folder-tree-empty {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  padding: var(--space-sm);
}

.scope-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--duration-fast);
  color: var(--text-secondary);
}

.scope-item:hover {
  background: var(--bg-hover);
}

.scope-item.active {
  background: var(--accent-light) !important;
  color: var(--accent-dark) !important;
  border-left: 3px solid var(--accent);
  font-weight: 600;
}

.scope-item-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.scope-item-name {
  font-size: 14px;
  font-weight: 600;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-item-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0;
  transition: opacity var(--duration-fast);
}

.scope-item:hover .scope-item-actions {
  opacity: 1;
}

@media (hover: none), (max-width: 1024px) {
  .scope-item-actions {
    opacity: 0.9;
  }
}

.scope-action-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--duration-fast), opacity var(--duration-fast);
  border: none;
  background: none;
  touch-action: manipulation;
}

.scope-action-btn:hover {
  background: var(--bg-active);
}

.scope-action-btn .material-symbols-outlined {
  font-size: 16px;
}

.scope-action-delete:hover {
  background: var(--expense-light);
  color: var(--expense);
}

.folder-children {
  padding-left: var(--space-lg);
  margin-left: var(--space-md);
  border-left: 2px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.new-file-btn {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 6px 10px;
  font-size: 13px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--duration-fast);
  border: none;
  background: none;
  width: 100%;
}

.new-file-btn:hover {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.new-file-btn .material-symbols-outlined { font-size: 16px; }

.root-files-divider {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  margin-top: var(--space-md);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: var(--space-md);
  background: var(--bg-primary);
  border-top: 1px solid var(--border);
}

.profile-footer {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.profile-info {
  flex: 1;
  overflow: hidden;
}

.profile-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-email {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.logout-btn {
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--duration-fast);
  background: none;
  border: none;
  display: flex;
  align-items: center;
}

.logout-btn:hover { color: var(--expense); }

/* Sidebar overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 49;
}

.sidebar-overlay.visible { display: block; }

/* ── Main Content Canvas ── */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}

/* Content Header */
.content-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg) var(--space-md) var(--space-md);
  flex-shrink: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.breadcrumb-link {
  cursor: pointer;
  transition: color var(--duration-fast);
}

.breadcrumb-link:hover { color: var(--accent); }

.breadcrumb-active {
  color: var(--text-primary);
  font-weight: 700;
}

.breadcrumb .material-symbols-outlined {
  font-size: 14px;
  margin: 0 4px;
}

.content-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.workspace-main-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

/* ── Wallet Banner ── */
.wallet-banner {
  padding: 0 var(--space-md);
  flex-shrink: 0;
}

.wallet-banner-inner {
  max-width: var(--max-content);
  margin: 0 auto;
}

.wallet-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.wallet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.wallet-scope-name {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}

.wallet-amounts {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.wallet-amounts .limit {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 400;
}

.wallet-badge {
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.wallet-badge-safe {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.wallet-badge-warning {
  background: var(--warning-light);
  color: var(--warning);
}

.wallet-badge-danger {
  background: var(--expense-light);
  color: var(--expense);
}

.progress-bar {
  position: relative;
  width: 100%;
  height: 6px;
  background: var(--bg-surface-dim);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.7s var(--ease-out);
}

.progress-fill-safe { background: var(--accent); }
.progress-fill-warning { background: var(--warning); }
.progress-fill-danger { background: var(--expense); }

.wallet-footer {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-sm);
  font-size: 12px;
  font-weight: 500;
}

.wallet-remaining { color: var(--accent); font-weight: 700; }
.wallet-remaining-warning { color: var(--warning); font-weight: 700; }
.wallet-remaining-danger { color: var(--expense); font-weight: 700; }

/* ── Category Filter Pills ── */
.file-category-filters {
  max-width: var(--max-content);
  margin: var(--space-sm) auto 0;
  padding: 0 var(--space-md);
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.file-category-filters::-webkit-scrollbar { display: none; }

.filter-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.filter-pill:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.filter-pill.active {
  background: var(--text-primary);
  color: var(--text-inverse);
  border-color: var(--text-primary);
}

/* ── Scrollable Content Area ── */
.workspace-canvas {
  flex: 1;
  overflow-y: auto;
  position: relative;
}

.dynamic-content {
  max-width: var(--max-content);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) 160px;
}

/* ── Placeholder / Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-md);
  text-align: center;
  color: var(--text-muted);
}

.empty-state .material-symbols-outlined {
  font-size: 56px;
  color: var(--accent);
  margin-bottom: var(--space-md);
  opacity: 0.6;
}

.empty-state h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.empty-state p {
  font-size: 14px;
  max-width: 320px;
  margin-bottom: var(--space-lg);
}

/* ── Folder Overview (Bento Grid) ── */
.bento-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.bento-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.bento-card-dark {
  background: linear-gradient(135deg, #014BAA 0%, #08224E 100%) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 14px 32px rgba(1, 75, 170, 0.28) !important;
}

.bento-card-dark .btn-primary {
  background: #FFFFFF !important;
  color: #014BAA !important;
  font-weight: 700 !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15) !important;
}

.bento-card-dark .btn-primary:hover {
  background: #F8F3F0 !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22) !important;
}

.bento-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.bento-card-dark .bento-label {
  color: rgba(255, 255, 255, 0.5);
}

.bento-value {
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.bento-card-dark .bento-value {
  color: var(--text-inverse);
}

.bento-value .sub {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 400;
}

.bento-card-dark .bento-value .sub {
  color: rgba(255, 255, 255, 0.4);
}

.bento-limit-text {
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 400;
}

.bento-stat-lg {
  font-family: var(--font-heading);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
}

.bento-stat-lg .unit {
  font-size: 16px;
  opacity: 0.5;
}

.bento-progress {
  margin-top: var(--space-lg);
}

.bento-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 6px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-lg);
}

/* File Row Card */
.file-row-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
  margin-bottom: var(--space-sm);
}

.file-row-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.file-row-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.file-row-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.file-row-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: #EBF2FD !important;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #014BAA !important;
}

.file-row-name {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.file-row-sub {
  font-size: 13px;
  color: var(--text-muted);
}

.file-row-right {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.file-row-amount {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
}

.file-row-amount-label {
  font-size: 10px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.file-row-delete {
  opacity: 0;
  transition: opacity var(--duration-fast);
  color: var(--text-muted);
  cursor: pointer;
  background: none;
  border: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.file-row-card:hover .file-row-delete { opacity: 1; }

@media (hover: none), (max-width: 1024px) {
  .file-row-delete {
    opacity: 0.85;
  }
}

.file-row-delete:hover {
  background: var(--expense-light);
  color: var(--expense);
}

.file-row-chevron {
  color: var(--text-muted);
  transition: transform var(--duration-fast);
}

.file-row-card:hover .file-row-chevron {
  transform: translateX(3px);
}

/* Mini progress for file rows */
.file-mini-progress {
  flex: 1;
  max-width: 200px;
  padding: 0 var(--space-md);
}

.file-mini-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 4px;
}

.file-mini-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-surface-dim);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.file-mini-fill {
  height: 100%;
  border-radius: var(--radius-full);
}

/* ── Expense Feed ── */
.date-divider {
  display: flex;
  justify-content: center;
  margin: var(--space-lg) 0;
}

.date-divider-badge {
  padding: 4px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

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

.expense-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.expense-card-delete-bg {
  position: absolute;
  inset: 0;
  right: 0;
  width: 72px;
  left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--expense);
  color: var(--text-inverse);
  border-radius: var(--radius-lg);
}

.expense-card-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.expense-card-inner:hover {
  border-color: var(--accent);
}

.expense-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.expense-cat-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.expense-cat-icon.cat-food { background: #FFF0E6; color: #D4834F; }
.expense-cat-icon.cat-shopping { background: #EBF2FD; color: #014BAA; }
.expense-cat-icon.cat-transport { background: #E8F1F8; color: #5B8DB8; }
.expense-cat-icon.cat-utilities { background: #F0ECE8; color: #8B7B6B; }
.expense-cat-icon.cat-health { background: #FCEAE5; color: #C4725E; }
.expense-cat-icon.cat-other { background: var(--bg-surface-dim); color: var(--text-muted); }

.expense-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.expense-info p {
  font-size: 12px;
  color: var(--text-muted);
}

.expense-amount {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--expense);
  white-space: nowrap;
}

/* ── Quick Entry Bar ── */
.quick-entry-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-md);
  padding-bottom: max(var(--space-md), env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg-primary) 70%, transparent);
  z-index: 40;
}

.quick-entry-inner {
  max-width: var(--max-content);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: var(--space-xs) var(--space-xs) var(--space-xs) var(--space-lg);
  box-shadow: var(--shadow-lg);
}

.quick-entry-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-primary);
  min-width: 0;
}

.quick-entry-input::placeholder { color: var(--text-muted); }

.quick-entry-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--text-primary);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition: transform var(--duration-fast);
  flex-shrink: 0;
}

.quick-entry-send:hover { transform: scale(1.05); }

.quick-entry-hint {
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ── FAB ── */
.fab {
  position: fixed;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  right: var(--space-lg);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #0156C2 0%, #014BAA 100%) !important;
  color: #FFFFFF !important;
  box-shadow: 0 10px 28px rgba(1, 75, 170, 0.4) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  z-index: 40;
  transition: all var(--duration-fast);
  touch-action: manipulation;
}

.fab:hover {
  transform: scale(1.08);
  box-shadow: var(--shadow-xl);
}

.fab:active { transform: scale(0.95); }

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

/* ── Bottom Navigation (Mobile) ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: 50;
  background: var(--bg-surface);
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: var(--bottombar-height);
  padding: 0 var(--space-md);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--border);
}

.bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 4px 16px;
  border-radius: var(--radius-full);
  transition: all var(--duration-fast);
  color: var(--text-muted);
  gap: 2px;
}

.bnav-item.active {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.bnav-item span:last-child {
  font-size: 11px;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════
   EXPENSE MODAL (Full-page on mobile)
   ══════════════════════════════════════════════════ */
.modal-expense {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
}

.modal-expense-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-md);
  height: var(--topbar-height);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-expense-header-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.modal-expense-body {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  overflow-y: auto;
}

/* Numpad Section */
.numpad-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: var(--space-lg);
  border-radius: var(--radius-xl);
}

.numpad-amount-display {
  display: flex;
  align-items: baseline;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.numpad-amount-display .currency {
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 700;
  color: var(--text-primary);
}

.numpad-amount-input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-heading);
  font-size: 40px;
  font-weight: 700;
  color: var(--text-primary);
  padding: 0;
}

.numpad-amount-input::placeholder { color: var(--bg-surface-dim); }

.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: var(--space-lg);
}

.numpad-key {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 20px;
  border: none;
  cursor: pointer;
}

.numpad-key:hover { background: var(--bg-hover); }

.numpad-key:active {
  transform: scale(0.95);
  background: var(--accent-light);
  color: var(--accent-dark);
}

/* Category Chips */
.category-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: var(--space-lg);
  border-radius: var(--radius-xl);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.category-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 8px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all var(--duration-fast);
  gap: 4px;
}

.category-chip:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

.category-chip.active {
  border-color: var(--accent) !important;
  background: var(--accent-light) !important;
  color: var(--accent-dark) !important;
}

.category-chip .material-symbols-outlined { font-size: 22px; }
.category-chip span:last-child { font-size: 12px; font-weight: 600; }

/* Fixed Category Display */
.fixed-cat-badge {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px var(--space-md);
  background: var(--accent-light);
  color: var(--accent-dark);
  border: 1px solid rgba(1, 75, 170, 0.35);
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 15px;
}

.fixed-cat-badge .material-symbols-outlined {
  font-size: 24px;
}

.fixed-cat-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* Expense Details Aside */
.expense-details-aside {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.expense-details-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: var(--space-lg);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.expense-ref-box {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.expense-ref-box .material-symbols-outlined { color: var(--accent); }

.expense-ref-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.expense-ref-parent {
  font-size: 13px;
  color: var(--text-muted);
}

.form-textarea {
  width: 100%;
  height: 96px;
  padding: 12px 16px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  resize: none;
  transition: border-color var(--duration-fast);
}

.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(1, 75, 170, 0.15);
}

.form-textarea::placeholder { color: var(--text-muted); }

.expense-save-btn {
  width: 100%;
  height: 48px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-top: var(--space-xs);
}

/* Mobile Bottom Save Bar */
.expense-mobile-footer {
  position: sticky;
  bottom: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: var(--space-md);
  display: flex;
  gap: var(--space-md);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════
   DIALOG MODALS (Folder, File, Wallet)
   ══════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(44, 44, 44, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: var(--space-md);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-card {
  background: var(--bg-surface);
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  box-sizing: border-box;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: var(--space-lg);
}

.modal-subtitle {
  color: var(--text-muted);
  text-align: center;
  font-size: 14px;
  margin-bottom: var(--space-lg);
}

.modal-actions {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.modal-actions .btn { flex: 1; }

/* ══════════════════════════════════════════════════
   RESPONSIVE — Desktop (768px+)
   ══════════════════════════════════════════════════ */
@media (min-width: 768px) {
  .sidebar {
    position: static;
    transform: none;
    width: var(--sidebar-width);
    flex-shrink: 0;
  }

  .sidebar-header { display: none; }
  .sidebar-close-btn { display: none; }
  .sidebar-overlay { display: none !important; }
  .menu-toggle-btn { display: none; }

  .bottom-nav { display: none; }

  .fab {
    bottom: var(--space-lg);
  }

  .quick-entry-bar {
    bottom: 0;
  }

  .search-bar { display: flex; }

  .content-header {
    padding: var(--space-lg) var(--space-xl) var(--space-md);
  }

  .dynamic-content {
    padding-left: var(--space-xl);
    padding-right: var(--space-xl);
  }

  .wallet-banner {
    padding: 0 var(--space-xl);
  }

  .bento-grid {
    grid-template-columns: 2fr 1fr;
  }

  .modal-expense-body {
    flex-direction: row;
    padding: var(--space-xl);
  }

  .expense-modal-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
  }

  .expense-modal-right {
    width: 360px;
  }

  .expense-mobile-footer { display: none; }

  .category-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 767px) {
  .modal-expense-header .btn-primary { display: none; }
  .expense-details-aside .expense-save-btn { display: none; }
  .topbar { padding: 0 12px; }
  .topbar-left { gap: 8px; flex-shrink: 0; }
  .topbar-logo { font-size: 18px; }
  .topbar-right { gap: 8px; flex: 1; justify-content: flex-end; min-width: 0; }
  .search-bar { flex: 0 1 140px; min-width: 0; padding: 6px 10px; }
  .search-bar input { width: 100%; min-width: 50px; font-size: 13px; }
  .search-bar:focus-within { flex: 1 1 auto; max-width: 240px; }
  
  /* Prevent iOS Safari 16px input zoom */
  .form-input,
  .form-input-plain,
  .form-textarea,
  .ws-input,
  select.form-input-plain,
  .quick-entry-input {
    font-size: 16px !important;
  }

  .dynamic-content {
    padding: var(--space-md) var(--space-sm) 120px;
  }
}

@media (max-width: 480px) {
  .topbar { padding: 0 8px; }
  .topbar-logo { font-size: 17px; }
  .search-bar { flex: 0 1 110px; padding: 5px 8px; }
  .search-bar input { min-width: 40px; font-size: 12px; }
  .theme-toggle-3d { padding: 2px; }
  .theme-toggle-track { width: 48px; height: 26px; padding: 0 4px; }
  .theme-toggle-thumb { width: 20px; height: 20px; }
  .thumb-icon { font-size: 14px; }

  .content-header { padding: var(--space-md) var(--space-sm) var(--space-xs); }
  .content-header-row { flex-wrap: wrap; gap: 8px; }
  .workspace-main-title { font-size: 21px; word-break: break-word; }

  .wallet-banner { padding: 0 var(--space-sm); }
  .wallet-card { padding: 14px 16px; border-radius: var(--radius-lg); }
  .wallet-amounts { font-size: 20px; }

  .bento-card { padding: var(--space-md); border-radius: var(--radius-lg); }
  .bento-value { font-size: 28px; }

  .file-row-content { gap: var(--space-sm); }
  .file-mini-progress {
    width: 100%;
    max-width: 100%;
    order: 3;
    padding: 6px 0 0;
  }
  .file-row-right { gap: var(--space-sm); }

  .fab {
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    right: 14px;
    width: 50px;
    height: 50px;
  }
  .fab .material-symbols-outlined { font-size: 24px; }

  .quick-entry-bar {
    padding: var(--space-sm) 10px;
    padding-bottom: max(var(--space-sm), env(safe-area-inset-bottom, 0px));
  }
  .quick-entry-inner { padding: 3px 3px 3px 14px; }

  .modal-overlay { padding: 8px; }
  .modal-card {
    padding: 18px 14px;
    border-radius: var(--radius-lg);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
  }
  .modal-title { font-size: 19px; margin-bottom: var(--space-md); }
  .modal-actions { margin-top: var(--space-lg); gap: var(--space-sm); }
  .modal-actions .btn { min-height: 44px; }

  .toast-container {
    top: var(--space-sm);
    left: var(--space-sm);
    right: var(--space-sm);
  }
  .toast {
    font-size: 13px;
    padding: 10px 14px;
  }
}

@media (max-width: 360px) {
  .topbar-brand .topbar-logo { display: none; }
  .search-bar { flex: 0 1 85px; padding: 4px 6px; }
  .theme-toggle-track { width: 44px; height: 24px; }
  .theme-toggle-thumb { width: 18px; height: 18px; }
  .theme-icon-sun, .theme-icon-moon { font-size: 13px; }
  .category-chip { padding: 8px 3px; }
  .category-chip span:last-child { font-size: 11px; }
  .numpad-key { font-size: 18px; padding: 12px 0; }
  .numpad-amount-display .currency { font-size: 30px; }
  .numpad-amount-input { font-size: 30px; }
}

/* ══════════════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.animate-fade-in-up {
  animation: fadeInUp 0.4s var(--ease-out) forwards;
}

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

/* Swipe support for expense cards */
.swipe-action {
  transition: transform 0.2s ease;
}


/* ══════════════════════════════════════════════════
   WEBSPIRIT AUTH VIEW & MASCOT ENHANCEMENTS
   ══════════════════════════════════════════════════ */
.auth-view {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(145deg, #01285E 0%, #014BAA 55%, #025CD1 100%) !important;
  color: #1F2937;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
}

.auth-view.hidden {
  display: none !important;
}

/* Subtle dot texture background with light cream specks */
.ws-dot-pattern {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(248, 243, 240, 0.16) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
  z-index: 0;
}

/* Layout */
.ws-auth-layout {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 100vh;
  padding: 32px 20px;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Master Outer Box Container in Light Cream (#F8F3F0) */
.ws-outer-box {
  width: 100%;
  max-width: 1120px;
  background: #F8F3F0;
  border-radius: 40px;
  box-shadow: 0 35px 80px -15px rgba(1, 30, 75, 0.55), 0 0 1px 1px rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  gap: 28px;
  box-sizing: border-box;
  position: relative;
  overflow: visible;
  transition: box-shadow 0.3s ease;
}

/* Mascot Panel (Stage inside light cream box) */
.ws-mascot-panel {
  flex: 1.15;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 520px;
  background: #FFFFFF;
  border: 1px solid rgba(232, 225, 217, 0.9);
  border-radius: 30px;
  padding: 20px 16px;
  user-select: none;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: inset 0 2px 8px rgba(1, 75, 170, 0.03);
}

.ws-mascot-svg {
  width: 100%;
  max-width: 580px;
  height: auto;
  max-height: 560px;
  overflow: visible;
  filter: drop-shadow(0 15px 30px rgba(0, 0, 0, 0.25));
  transition: transform 0.3s ease;
}

/* Auth Card Panel */
.ws-auth-panel {
  flex: 0.95;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 440px;
}

/* Animated Outline Wrapper around the White Login Card */
.ws-card-outline-wrapper {
  position: relative;
  width: 100%;
  max-width: 440px;
  border-radius: 32px;
  padding: 3.5px; /* Animated outline border thickness */
  box-sizing: border-box;
  display: flex;
  overflow: hidden;
  box-shadow: 0 18px 45px -12px rgba(0, 0, 0, 0.14), 0 0 25px rgba(43, 131, 246, 0.2);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.ws-card-outline-wrapper:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 50px -12px rgba(0, 0, 0, 0.18), 0 0 35px rgba(43, 131, 246, 0.3);
}

/* Rotating colorful gradient that creates the animated border line */
.ws-card-outline-wrapper::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    #014BAA,
    #38BDF8,
    #F8F3F0,
    #014BAA,
    #60A5FA,
    #F8F3F0,
    #014BAA
  );
  animation: ws-rotate-outline 3.5s linear infinite;
  z-index: 0;
}

/* Ambient glow around the outline */
.ws-card-outline-wrapper::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 36px;
  background: conic-gradient(
    from 0deg,
    #014BAA,
    #38BDF8,
    #014BAA,
    #60A5FA,
    #014BAA
  );
  filter: blur(14px);
  opacity: 0.45;
  z-index: -1;
  animation: ws-rotate-outline 3.5s linear infinite, ws-pulse-glow 2.5s ease-in-out infinite;
}

@keyframes ws-rotate-outline {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes ws-pulse-glow {
  0%, 100% { opacity: 0.35; filter: blur(12px); }
  50% { opacity: 0.6; filter: blur(18px); }
}

/* Current White Box (Inner Card) */
.ws-auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  background: #FFFFFF;
  border-radius: 28.5px;
  padding: 36px 30px 28px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Card Header & Crown */
.ws-card-header {
  text-align: center;
  margin-bottom: 22px;
}

/* Round Logo Badge above Welcome back! */
.ws-logo-round-wrap,
.ws-crown {
  width: 58px;
  height: 58px;
  margin: 0 auto 12px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #FFFFFF;
  padding: 2.5px;
  border: 2px solid rgba(43, 131, 246, 0.28);
  box-shadow: 0 8px 20px rgba(0, 107, 95, 0.22), 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.ws-logo-round-wrap:hover,
.ws-crown:hover {
  transform: scale(1.12) rotate(4deg);
  border-color: #2B83F6;
  box-shadow: 0 12px 28px rgba(0, 107, 95, 0.35), 0 0 16px rgba(43, 131, 246, 0.4);
}

.ws-logo-round-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.ws-crown-svg {
  width: 32px;
  height: 24px;
  fill: #111827;
}

.ws-card-title {
  font-family: var(--font-heading), 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}

.ws-card-subtitle {
  font-size: 13px;
  color: #6B7280;
  font-weight: 500;
  margin: 0;
}

/* Auth Tabs */
.ws-auth-tabs {
  position: relative;
  display: flex;
  background: #F3F4F6;
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 22px;
}

.ws-tab-btn {
  flex: 1;
  position: relative;
  z-index: 2;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #6B7280;
  border: none;
  background: none;
  cursor: pointer;
  transition: color 0.2s ease;
  text-align: center;
  font-family: var(--font-heading), 'Outfit', sans-serif;
}

.ws-tab-btn.active {
  color: #111827;
}

.ws-tab-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  bottom: 4px;
  width: calc(50% - 4px);
  background: #FFFFFF;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 1;
}

/* Forms */
.ws-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ws-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ws-label {
  font-size: 12px;
  font-weight: 600;
  color: #111827;
  letter-spacing: 0.01em;
}

.ws-input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid #E5E7EB;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 500;
  color: #1F2937;
  transition: border-color 0.2s ease;
  border-radius: 0;
  box-sizing: border-box;
}

.ws-input::placeholder {
  color: #9CA3AF;
  font-weight: 400;
}

.ws-input:focus {
  outline: none;
  border-bottom-color: #111827;
}

.ws-input-row {
  position: relative;
  display: flex;
  align-items: center;
}

.ws-pw-input {
  padding-right: 36px;
  letter-spacing: 0.1em;
}

.ws-pw-input::placeholder {
  letter-spacing: normal;
}

.ws-eye-btn {
  position: absolute;
  right: 0;
  bottom: 6px;
  background: none;
  border: none;
  color: #6B7280;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.ws-eye-btn:hover {
  color: #111827;
}

/* Options Row & Remember Me */
.ws-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 2px;
}

.ws-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.ws-checkbox {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  border: 1.5px solid #9CA3AF;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.ws-checkbox.checked {
  background: #111827;
  border-color: #111827;
}

.ws-remember-text {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

.ws-forgot-link {
  font-size: 13px;
  font-weight: 500;
  color: #6B7280;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s ease;
  padding: 0;
}

.ws-forgot-link:hover {
  color: #111827;
  text-decoration: underline;
}

/* Actions & Primary Button */
.ws-actions {
  margin-top: 6px;
}

.ws-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #014BAA 0%, #013A85 100%);
  color: #FFFFFF;
  font-family: var(--font-heading), 'Outfit', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 13.5px 20px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(1, 75, 170, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.ws-btn-primary:hover {
  background: linear-gradient(135deg, #0156C2 0%, #014BAA 100%);
  transform: translateY(-1.5px);
  box-shadow: 0 8px 22px rgba(1, 75, 170, 0.4);
}

.ws-btn-primary:active {
  transform: translateY(0);
}

.ws-btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

/* Error Message */
.ws-error-msg {
  font-size: 12px;
  font-weight: 600;
  color: #DC2626;
  background: #FEE2E2;
  border: 1px solid #FECACA;
  padding: 8px 12px;
  border-radius: 8px;
}

/* Footer */
.ws-card-footer {
  text-align: center;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #F3F4F6;
  font-size: 13px;
  color: #6B7280;
}

.ws-signup-link {
  font-weight: 700;
  color: #111827;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 2px;
  transition: text-decoration 0.15s ease;
}

.ws-signup-link:hover {
  text-decoration: underline;
}

.ws-forgot-info {
  font-size: 13px;
  color: #6B7280;
}

/* Loading Spinner */
.ws-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: wsSpin 0.7s linear infinite;
  display: inline-block;
}

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

/* ── Creature Animations ── */

/* Drop In */
@keyframes wsDropIn {
  0% {
    transform: translateY(-440px) scaleY(1.3) scaleX(0.8);
    opacity: 0;
  }
  65% {
    transform: translateY(14px) scaleY(0.92) scaleX(1.08);
    opacity: 1;
  }
  82% {
    transform: translateY(-7px) scaleY(1.04) scaleX(0.98);
  }
  100% {
    transform: translateY(0) scaleY(1) scaleX(1);
    opacity: 1;
  }
}

.ws-drop-in {
  animation: wsDropIn 0.85s cubic-bezier(0.25, 1, 0.35, 1) var(--drop-delay, 0s) both;
}

.ws-creature {
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#creature-pink { transform-origin: 150px 420px; }
#creature-arch { transform-origin: 270px 420px; }
#creature-teal { transform-origin: 135px 420px; }
#creature-blue { transform-origin: 246px 420px; }

/* Idle Float */
#creature-pink.ws-idle-animated {
  animation: ws-float-pink 4.2s ease-in-out infinite alternate;
}
#creature-arch.ws-idle-animated {
  animation: ws-float-arch 4.8s ease-in-out infinite alternate;
}
#creature-teal.ws-idle-animated {
  animation: ws-float-teal 4.5s ease-in-out infinite alternate;
}
#creature-blue.ws-idle-animated {
  animation: ws-float-blue 3.8s ease-in-out infinite alternate;
}

@keyframes ws-float-pink {
  0% { transform: translateY(0); }
  100% { transform: translateY(-7px); }
}
@keyframes ws-float-arch {
  0% { transform: scaleY(1); }
  100% { transform: scaleY(1.025); }
}
@keyframes ws-float-teal {
  0% { transform: rotate(-1.5deg) translateY(0); }
  100% { transform: rotate(1.5deg) translateY(-5px); }
}
@keyframes ws-float-blue {
  0% { transform: translateY(0) scaleY(1); }
  100% { transform: translateY(-8px) scaleY(1.03); }
}

/* Hover */
#creature-pink:hover { transform: scale(1.03) translateY(-10px); }
#creature-arch:hover { transform: scale(1.03); }
#creature-teal:hover { transform: scale(1.05) rotate(3deg); }
#creature-blue:hover { transform: scale(1.06) translateY(-12px); }

/* Mood Overrides */
[data-mood="shy-password"] .ws-creature,
[data-mood="celebrating"] .ws-creature,
[data-mood="confused"] .ws-creature {
  animation: none !important;
}

[data-mood="shy-password"] #creature-pink {
  transform: translateX(-12px) rotate(-7deg) !important;
}
[data-mood="shy-password"] #creature-arch {
  transform: translateX(-10px) rotate(-4deg) !important;
}
[data-mood="shy-password"] #creature-teal {
  transform: translateX(-12px) rotate(-8deg) !important;
}
[data-mood="shy-password"] #creature-blue {
  transform: translateX(-14px) rotate(-7deg) !important;
}

[data-mood="celebrating"] #creature-pink {
  animation: wsJumpPink 0.6s ease-in-out infinite !important;
}
[data-mood="celebrating"] #creature-arch {
  animation: wsJumpArch 0.5s ease-in-out infinite !important;
}
[data-mood="celebrating"] #creature-teal {
  animation: wsJumpTeal 0.55s ease-in-out infinite !important;
}
[data-mood="celebrating"] #creature-blue {
  animation: wsJumpBlue 0.5s ease-in-out infinite !important;
}

[data-mood="confused"] #creature-pink {
  animation: wsConfused 0.35s ease-in-out infinite !important;
}
[data-mood="confused"] #creature-arch {
  animation: wsConfused 0.35s ease-in-out infinite 0.08s !important;
}
[data-mood="confused"] #creature-teal {
  animation: wsConfused 0.35s ease-in-out infinite 0.16s !important;
}
[data-mood="confused"] #creature-blue {
  animation: wsConfused 0.35s ease-in-out infinite 0.04s !important;
}

@keyframes wsJumpPink {
  0%, 100% { transform: translateY(-8px); }
  50% { transform: translateY(-26px); }
}
@keyframes wsJumpArch {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(1.06); }
}
@keyframes wsJumpTeal {
  0%, 100% { transform: translateY(-5px) rotate(-4deg); }
  50% { transform: translateY(-22px) rotate(4deg); }
}
@keyframes wsJumpBlue {
  0%, 100% { transform: translateY(-10px) scaleY(1); }
  50% { transform: translateY(-30px) scaleY(1.12); }
}

@keyframes wsConfused {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-3.5deg); }
  75% { transform: rotate(3.5deg); }
}

/* Eyes & Blinking */
.eye-sclera {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.1s ease-in-out;
}

.eye-pupil-wrap {
  transition: opacity 0.1s ease-in-out;
}

@keyframes ws-eye-blink {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.08); }
}

.ws-mascot-svg.ws-blinking .eye-sclera {
  transform: scaleY(0.08);
}
.ws-mascot-svg.ws-blinking .eye-pupil-wrap {
  opacity: 0;
}

/* Mood Badges */
.ws-mood-badge {
  position: absolute;
  top: 20px;
  left: 24px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(8px);
  animation: wsBadgePop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: all 0.25s ease;
}

@keyframes wsBadgePop {
  0% { transform: scale(0.8) translateY(-6px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.ws-mood-badge.ws-mood-watching {
  background: rgba(255, 255, 255, 0.94);
  color: #374151;
  border: 1px solid #E5E7EB;
}

.ws-mood-badge.ws-mood-shy {
  background: rgba(254, 226, 226, 0.95);
  color: #BE123C;
  border: 1px solid #FECDD3;
}

.ws-mood-badge.ws-mood-celebrating {
  background: rgba(209, 250, 229, 0.95);
  color: #065F46;
  border: 1px solid #A7F3D0;
}

.ws-mood-badge.ws-mood-confused {
  background: rgba(254, 243, 199, 0.95);
  color: #92400E;
  border: 1px solid #FDE68A;
}

.ws-mood-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3B82F6;
  animation: wsPulse 1.2s infinite;
}

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

/* Responsive Layout */
@media (max-width: 960px) {
  .ws-outer-box {
    flex-direction: column;
    max-width: 520px;
    padding: 20px;
    gap: 20px;
  }
  .ws-mascot-panel {
    min-height: 380px;
    width: 100%;
  }
}

@media (max-width: 767px) {
  .ws-auth-layout {
    flex-direction: column;
    padding: 16px 10px;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
  }
  .ws-outer-box {
    padding: 14px 10px;
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
    max-width: 100%;
  }
  .ws-mascot-panel {
    display: none !important;
  }
  .ws-auth-panel {
    width: 100%;
    max-width: 100%;
    padding: 0;
  }
  .ws-card-outline-wrapper {
    max-width: 100%;
    border-radius: 22px;
    padding: 3px;
  }
  .ws-auth-card {
    max-width: 100%;
    padding: 24px 16px 20px;
    border-radius: 19px;
  }
  .ws-card-title {
    font-size: 23px;
  }
  .ws-card-subtitle {
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .ws-auth-layout {
    padding: 8px 6px;
  }
  .ws-outer-box {
    padding: 10px 6px;
    border-radius: 18px;
  }
  .ws-card-outline-wrapper {
    padding: 2px;
    border-radius: 16px;
  }
  .ws-auth-card {
    padding: 20px 12px 16px;
    border-radius: 14px;
  }
  .ws-card-title {
    font-size: 20px;
  }
  .ws-card-subtitle {
    font-size: 12px;
  }
  .otp-wrapper {
    gap: 4px;
  }
  .otp-box {
    min-width: 26px;
    height: 44px;
    font-size: 17px;
  }
}


/* ═══════════════════════════════════════════════════════
   THEME SWITCHER UI COMPONENTS (3D Tactile Design)
   ═══════════════════════════════════════════════════════ */

/* Topbar 3D Switch Button */
.theme-toggle-3d {
  position: relative;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  outline: none;
  transition: transform 0.2s var(--ease-out), border-color 0.25s, box-shadow 0.25s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  user-select: none;
  flex-shrink: 0;
}

.theme-toggle-3d:hover {
  transform: translateY(-1px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.theme-toggle-3d:active {
  transform: translateY(1px) scale(0.98);
}

.theme-toggle-track {
  width: 54px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--bg-surface-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: background 0.3s var(--ease-out);
}

.theme-icon-sun,
.theme-icon-moon {
  font-size: 15px !important;
  color: var(--text-muted);
  user-select: none;
  transition: color 0.3s;
}

.theme-toggle-thumb {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFFFFF 0%, #E8E1D9 100%);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2), inset 0 1px 1px #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s, box-shadow 0.3s;
  z-index: 2;
}

.theme-toggle-thumb .thumb-icon {
  font-size: 14px !important;
  color: #014BAA;
  transition: transform 0.3s, color 0.3s;
}

.theme-toggle-thumb.dark {
  transform: translateX(26px);
  background: linear-gradient(135deg, #373839 0%, #1F1F20 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.8), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.theme-toggle-thumb.dark .thumb-icon {
  color: #DBDBDB;
  transform: rotate(360deg);
}

/* Sidebar Theme Switch Row */
.sidebar-theme-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-light);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.sidebar-theme-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.theme-switch-pill-3d {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-surface-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 2px;
  cursor: pointer;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

.theme-pill-option {
  position: relative;
  z-index: 2;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  transition: color 0.25s;
  user-select: none;
}

.theme-pill-option.active {
  color: var(--text-primary);
}

.theme-pill-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 50%;
  height: calc(100% - 4px);
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s;
  z-index: 1;
}

.theme-pill-slider.dark {
  transform: translateX(100%);
  background: #373839;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}


/* ═══════════════════════════════════════════════════════
   MATTE 3D DARK THEME (Based on "Matte Black Coke" Aesthetic)
   Palette:
   #0A0A0A (Existential Angst - deepest matte obsidian)
   #1F1F20 (Inkwell Inception - velvety charcoal card)
   #373839 (Dark Summoning - elevated elements & active borders)
   #5F6062 (Kettleman - secondary borders & subtle text)
   #999999 (Million Grey - secondary metadata & subheadings)
   #DBDBDB (Pixel White - crisp headers & high-contrast accents)
   ═══════════════════════════════════════════════════════ */

body.theme-dark {
  /* Color Tokens */
  --bg-primary: #0A0A0A;
  --bg-surface: #1F1F20;
  --bg-surface-alt: #28282A;
  --bg-surface-dim: #141415;
  --bg-hover: #2E2F32;
  --bg-active: #373839;

  --text-primary: #DBDBDB;
  --text-secondary: #999999;
  --text-muted: #5F6062;
  --text-inverse: #0A0A0A;

  --accent: #DBDBDB;
  --accent-hover: #FFFFFF;
  --accent-light: rgba(255, 255, 255, 0.10);
  --accent-dark: #1F1F20;

  --border: #373839;
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: #FFFFFF;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.6);
  --shadow-md: 0 10px 28px -4px rgba(0, 0, 0, 0.8);
  --shadow-lg: 0 20px 48px -6px rgba(0, 0, 0, 0.92);
  --shadow-xl: 0 32px 72px -8px rgba(0, 0, 0, 0.98);

  background-color: #0A0A0A;
  color: #DBDBDB;
}

/* Auth view must remain completely insulated and ignore theme-dark */
body.theme-dark #view-auth {
  background-color: #38393F !important;
}

/* 3D Topbar in Dark Theme */
body.theme-dark .topbar {
  background: rgba(20, 20, 21, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid #373839;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7), inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

body.theme-dark .topbar-logo {
  color: #FFFFFF;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.25);
}

body.theme-dark .topbar .search-bar {
  background: #141415;
  border: 1px solid #373839;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.theme-dark .topbar .search-bar:focus-within {
  border-color: #DBDBDB;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.7), 0 0 14px rgba(255, 255, 255, 0.15);
}

body.theme-dark .topbar .search-bar input {
  color: #DBDBDB;
}

/* 3D Sidebar in Dark Theme */
body.theme-dark .sidebar {
  background: #141415;
  border-right: 1px solid #373839;
  box-shadow: 6px 0 30px rgba(0, 0, 0, 0.65);
}

body.theme-dark .sidebar-header {
  border-bottom: 1px solid #28282A;
}

body.theme-dark .sidebar-brand-text {
  color: #FFFFFF;
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.2);
}

body.theme-dark .tree-item {
  color: #999999;
}

body.theme-dark .tree-item:hover {
  background: #1F1F20;
  color: #DBDBDB;
  border-color: #373839;
}

body.theme-dark .tree-item.active {
  background: linear-gradient(135deg, #28282A 0%, #1F1F20 100%);
  color: #FFFFFF;
  border: 1px solid #5F6062;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 4px 12px rgba(0, 0, 0, 0.5);
}

body.theme-dark .profile-footer {
  background: #1F1F20;
  border: 1px solid #373839;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* 3D Main Canvas & Content Header */
body.theme-dark .main-content {
  background: #0A0A0A;
}

body.theme-dark .content-header {
  border-bottom: 1px solid #28282A;
}

body.theme-dark .workspace-main-title {
  color: #FFFFFF;
  letter-spacing: -0.5px;
}

body.theme-dark .breadcrumb-link {
  color: #999999;
}

body.theme-dark .breadcrumb-active {
  color: #DBDBDB;
}

/* 3D Hero Wallet Card (Direct Homage to Matte Black Coke) */
body.theme-dark .wallet-card {
  position: relative;
  background: radial-gradient(circle at 85% 15%, #2B2C2E 0%, #1F1F20 55%, #141415 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.22), 0 20px 48px -10px rgba(0, 0, 0, 0.95);
  overflow: hidden;
}

/* 3D Torus / Halo Ring in Wallet Card (Hero ring from uploaded design) */
body.theme-dark .wallet-card::before {
  content: '';
  position: absolute;
  top: -45px;
  right: -25px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  border: 10px solid rgba(219, 219, 219, 0.18);
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.08), inset 0 0 25px rgba(255, 255, 255, 0.06);
  pointer-events: none;
  filter: blur(0.5px);
  z-index: 0;
}

body.theme-dark .wallet-card > * {
  position: relative;
  z-index: 1;
}

body.theme-dark .wallet-scope-name {
  color: #FFFFFF;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

body.theme-dark #wallet-spent-val {
  color: #FFFFFF;
  font-weight: 800;
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.2);
}

body.theme-dark .wallet-amounts .limit {
  color: #999999;
}

body.theme-dark .wallet-badge-safe {
  background: #28282A;
  color: #DBDBDB;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 6px rgba(0, 0, 0, 0.5);
}

body.theme-dark .progress-bar {
  background: #0A0A0A;
  border: 1px solid #373839;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.8);
}

body.theme-dark .progress-fill-safe {
  background: linear-gradient(90deg, #5F6062 0%, #999999 50%, #FFFFFF 100%);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
}

/* 3D Filter Pills */
body.theme-dark .filter-pill {
  background: #1F1F20;
  color: #999999;
  border: 1px solid #373839;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.2s var(--ease-out), background 0.2s, box-shadow 0.2s;
}

body.theme-dark .filter-pill:hover {
  background: #28282A;
  color: #DBDBDB;
  border-color: #5F6062;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body.theme-dark .filter-pill.active {
  background: linear-gradient(180deg, #FFFFFF 0%, #DBDBDB 100%);
  color: #0A0A0A !important;
  font-weight: 700;
  border: 1px solid #FFFFFF;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.25), inset 0 1px 0 #FFFFFF;
  transform: translateY(-2px) scale(1.03);
}

/* 3D Cards (Folder & File Cards) */
body.theme-dark .grid-card,
body.theme-dark .folder-card,
body.theme-dark .file-card {
  background: linear-gradient(155deg, #242527 0%, #1F1F20 60%, #161617 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.15), 0 12px 28px -6px rgba(0, 0, 0, 0.85);
  transition: transform 0.25s var(--ease-out), border-color 0.25s, box-shadow 0.25s;
}

body.theme-dark .grid-card:hover,
body.theme-dark .folder-card:hover,
body.theme-dark .file-card:hover {
  transform: translateY(-5px) scale(1.012);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.3), 0 22px 48px -8px rgba(0, 0, 0, 0.95), 0 0 25px rgba(255, 255, 255, 0.05);
}

body.theme-dark .card-title {
  color: #FFFFFF;
}

body.theme-dark .card-meta {
  color: #999999;
}

body.theme-dark .file-badge {
  background: #28282A;
  color: #DBDBDB;
  border: 1px solid #373839;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* 3D Expense List Items */
body.theme-dark .expense-item {
  background: #1F1F20;
  border: 1px solid #373839;
  border-radius: var(--radius-md);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.2s var(--ease-out), background 0.2s, box-shadow 0.2s, border-color 0.2s;
}

body.theme-dark .expense-item:hover {
  background: #28282A;
  border-color: #5F6062;
  transform: translateY(-2px);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.16), 0 10px 24px rgba(0, 0, 0, 0.7);
}

body.theme-dark .expense-name {
  color: #FFFFFF;
}

body.theme-dark .expense-date {
  color: #999999;
}

body.theme-dark .expense-amount {
  color: #FFFFFF;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

body.theme-dark .expense-category-tag {
  background: #28282A;
  color: #DBDBDB;
  border: 1px solid #373839;
}

/* 3D Buttons in Dark Theme */
body.theme-dark .btn-primary {
  background: linear-gradient(180deg, #FFFFFF 0%, #DBDBDB 100%) !important;
  color: #0A0A0A !important;
  font-weight: 700;
  border: 1px solid #FFFFFF;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7), inset 0 1px 0 #FFFFFF;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}

body.theme-dark .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255, 255, 255, 0.2), 0 6px 18px rgba(0, 0, 0, 0.85);
}

body.theme-dark .btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

body.theme-dark .btn-dark {
  background: #28282A !important;
  color: #FFFFFF !important;
  border: 1px solid #373839;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body.theme-dark .btn-dark:hover {
  background: #373839 !important;
  border-color: #5F6062;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

body.theme-dark .btn-outline {
  border-color: #373839;
  color: #DBDBDB;
  background: #141415;
}

body.theme-dark .btn-outline:hover {
  border-color: #5F6062;
  background: #1F1F20;
  color: #FFFFFF;
}

/* 3D Floating Action Button (FAB) */
body.theme-dark .fab {
  background: linear-gradient(145deg, #2E2F32, #161617) !important;
  color: #FFFFFF !important;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85), inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 0 20px rgba(255, 255, 255, 0.08);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s;
}

body.theme-dark .fab:hover {
  transform: scale(1.08) translateY(-3px);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.95), inset 0 1px 2px rgba(255, 255, 255, 0.6), 0 0 30px rgba(255, 255, 255, 0.2);
}

body.theme-dark .fab:active {
  transform: scale(0.96) translateY(1px);
}

/* 3D Quick Entry Bar */
body.theme-dark .quick-entry-bar {
  background: rgba(20, 20, 21, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid #373839;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.7);
}

body.theme-dark .quick-entry-inner {
  background: #141415;
  border: 1px solid #373839;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.7), 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.theme-dark .quick-entry-input {
  color: #DBDBDB;
}

body.theme-dark .quick-entry-send {
  background: #DBDBDB;
  color: #0A0A0A;
}

/* 3D Modals in Dark Theme */
body.theme-dark .modal-backdrop {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.theme-dark .modal-dialog,
body.theme-dark .modal-expense {
  background: #1F1F20;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.22), 0 30px 70px rgba(0, 0, 0, 0.96);
  color: #DBDBDB;
}

body.theme-dark .modal-expense-header {
  border-bottom: 1px solid #28282A;
}

body.theme-dark .modal-dialog input,
body.theme-dark .modal-dialog select,
body.theme-dark .modal-expense input,
body.theme-dark .modal-expense select {
  background: #141415;
  border: 1px solid #373839;
  color: #DBDBDB;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

body.theme-dark .modal-dialog input:focus,
body.theme-dark .modal-dialog select:focus,
body.theme-dark .modal-expense input:focus,
body.theme-dark .modal-expense select:focus {
  border-color: #DBDBDB;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 0 12px rgba(255, 255, 255, 0.15);
}

/* 3D Numpad Keys (Mechanical Matte Keyboard Design) */
body.theme-dark .numpad-key {
  background: linear-gradient(180deg, #2A2B2D 0%, #1F1F20 100%) !important;
  color: #DBDBDB !important;
  border: 1px solid #373839 !important;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s;
}

body.theme-dark .numpad-key:hover {
  background: linear-gradient(180deg, #373839 0%, #28282A 100%) !important;
  border-color: #5F6062 !important;
  color: #FFFFFF !important;
}

body.theme-dark .numpad-key:active {
  transform: translateY(2px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

body.theme-dark .quick-amount-chip {
  background: #28282A;
  color: #DBDBDB;
  border: 1px solid #373839;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

body.theme-dark .quick-amount-chip:hover {
  background: #373839;
  color: #FFFFFF;
  border-color: #5F6062;
}

/* Placeholder and Empty State in Dark Theme */
body.theme-dark .placeholder-card,
body.theme-dark .empty-state {
  background: #141415;
  border: 2px dashed #373839;
  color: #999999;
}


/* ═══════════════════════════════════════════════════════
   Remove Spin Buttons / Up-Down Increment Arrows
   ═══════════════════════════════════════════════════════ */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button,
.numpad-amount-input::-webkit-outer-spin-button,
.numpad-amount-input::-webkit-inner-spin-button,
.form-input-dollar::-webkit-outer-spin-button,
.form-input-dollar::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  margin: 0 !important;
  display: none !important;
}

input[type="number"],
.numpad-amount-input,
.form-input-dollar {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

.numpad-amount-input {
  outline: none !important;
}


/* ═══════════════════════════════════════════════════════
   Dark Mode File Name Visibility
   Ensures file names are crisp, bright & clearly visible
   ═══════════════════════════════════════════════════════ */
body.theme-dark .scope-file-name,
body.theme-dark .scope-item-file .scope-item-name,
body.theme-dark .folder-children .scope-item .scope-item-name,
body.theme-dark .file-row-name {
  color: #E2E8F0 !important;
}

body.theme-dark .scope-item-file.active .scope-file-name,
body.theme-dark .scope-item-file.active .scope-item-name,
body.theme-dark .folder-children .scope-item.active .scope-item-name,
body.theme-dark .folder-children .scope-item.active .scope-file-name {
  color: #FFFFFF !important;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

body.theme-dark .scope-item-file.active,
body.theme-dark .folder-children .scope-item.active {
  color: #FFFFFF !important;
}

body.theme-dark .scope-item-file:hover .scope-file-name,
body.theme-dark .scope-item-file:hover .scope-item-name,
body.theme-dark .folder-children .scope-item:hover .scope-item-name {
  color: #FFFFFF !important;
}


/* ═══════════════════════════════════════════════════════
   PWA Installation Buttons & Guidance Modal
   ═══════════════════════════════════════════════════════ */
.pwa-install-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(1, 75, 170, 0.08);
  color: var(--accent);
  border: 1px solid rgba(1, 75, 170, 0.22);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  min-height: 38px;
  user-select: none;
  flex-shrink: 0;
}

.pwa-install-btn:hover {
  background: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(1, 75, 170, 0.2);
}

.pwa-install-btn:active {
  transform: scale(0.97);
}

.pwa-install-icon {
  font-size: 18px;
  line-height: 1;
}

.auth-pwa-install-wrap {
  margin-top: var(--space-md);
  padding-top: var(--space-sm);
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: center;
}

.auth-pwa-install-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(1, 75, 170, 0.25);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast);
  min-height: 44px;
}

.auth-pwa-install-btn:hover {
  background: rgba(1, 75, 170, 0.08);
  border-color: var(--accent);
}

.auth-pwa-install-btn:active {
  transform: scale(0.97);
}

/* Modal styling for PWA guide */
.pwa-guide-card {
  max-width: 480px;
}

.pwa-guide-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

.pwa-guide-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pwa-guide-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.pwa-modal-title {
  text-align: left !important;
  margin-bottom: 2px !important;
  font-size: 18px !important;
}

.pwa-modal-subtitle {
  text-align: left;
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.pwa-guide-close-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
}

.pwa-instruction-step {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  align-items: flex-start;
}

.step-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-content {
  flex: 1;
}

.step-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.step-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.step-desc .inline-icon {
  font-size: 16px;
  vertical-align: text-bottom;
  color: var(--accent);
}

.pwa-note-box {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  background: rgba(1, 75, 170, 0.06);
  border: 1px solid rgba(1, 75, 170, 0.15);
  border-radius: var(--radius-md);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin-top: var(--space-md);
}

/* 3D Dark Theme styling */
body.theme-dark .pwa-install-btn {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.3);
}

body.theme-dark .pwa-install-btn:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

body.theme-dark .auth-pwa-install-btn {
  color: #60a5fa;
  border-color: rgba(59, 130, 246, 0.35);
}

body.theme-dark .auth-pwa-install-btn:hover {
  background: rgba(59, 130, 246, 0.12);
}

body.theme-dark .step-desc .inline-icon {
  color: #60a5fa;
}

body.theme-dark .pwa-note-box {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.25);
  color: var(--text-secondary);
}

/* Responsive Topbar adjustments */
@media (max-width: 640px) {
  .pwa-install-label {
    display: none;
  }
  .pwa-install-btn {
    padding: 0;
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 50%;
  }
}

@media (max-width: 380px) {
  .pwa-install-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
  }
  .pwa-install-icon {
    font-size: 16px;
  }
}


/* ═══════════════════════════════════════════════════════
   Render Cold-Start Server Wakeup Indicator
   ═══════════════════════════════════════════════════════ */
.server-wakeup-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--accent);
  box-shadow: 0 10px 30px rgba(1, 75, 170, 0.25);
  border-radius: var(--radius-full);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 90vw;
}

.server-wakeup-toast.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.wakeup-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(1, 75, 170, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.wakeup-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.wakeup-sub {
  font-size: 11px;
  color: var(--text-muted);
}

body.theme-dark .server-wakeup-toast {
  background: #1e293b;
  border-color: #3b82f6;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

body.theme-dark .wakeup-title {
  color: #60a5fa;
}

body.theme-dark .wakeup-spinner {
  border-color: rgba(96, 165, 250, 0.2);
  border-top-color: #60a5fa;
}

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