/* ===== VULLT 2026 - Glassmorphism + Mesh Gradient + Bento ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== Design Tokens ===== */
:root {
  --bg-void: #06060c;
  --bg-base: #0a0a14;
  --bg-surface: rgba(16, 16, 30, 0.7);
  --bg-glass: rgba(20, 20, 40, 0.45);
  --bg-glass-hover: rgba(30, 30, 55, 0.55);
  --bg-input: rgba(12, 12, 24, 0.6);
  --accent: #7c6aef;
  --accent-bright: #9d8fff;
  --accent-glow: rgba(124, 106, 239, 0.35);
  --accent2: #38bdf8;
  --accent3: #f472b6;
  --accent4: #34d399;
  --text-primary: #eeeef4;
  --text-secondary: #9494b8;
  --text-muted: #55557a;
  --border-glass: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(124, 106, 239, 0.25);
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-glow: 0 0 60px -12px var(--accent-glow);
  --shadow-card: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-elevated: 0 24px 64px rgba(0,0,0,0.5);
  --blur: 20px;
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-void);
  color: var(--text-primary);
  min-height: 100dvh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ===== Animated Mesh Gradient Background ===== */
.mesh-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.mesh-bg::before,
.mesh-bg::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  animation: meshFloat 20s ease-in-out infinite alternate;
}

.mesh-bg::before {
  width: 600px; height: 600px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -20%; left: -10%;
}

.mesh-bg::after {
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--accent3) 0%, transparent 70%);
  bottom: -20%; right: -10%;
  animation-delay: -10s;
}

.mesh-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.2;
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--accent2) 0%, transparent 70%);
  top: 40%; left: 50%;
  transform: translate(-50%, -50%);
  animation: meshFloat 25s ease-in-out infinite alternate-reverse;
}

@keyframes meshFloat {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(30px, -40px) scale(1.1); }
  66%  { transform: translate(-20px, 30px) scale(0.95); }
  100% { transform: translate(10px, -20px) scale(1.05); }
}

/* ===== Glass Card ===== */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.glass-hover {
  transition: all var(--transition-spring);
}

.glass-hover:hover {
  background: var(--bg-glass-hover);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow), var(--shadow-card);
  transform: translateY(-4px) scale(1.01);
}

/* ===== Fluid Typography ===== */
.text-display {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.text-title {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.text-body {
  font-size: clamp(0.875rem, 2vw, 1rem);
  color: var(--text-secondary);
  line-height: 1.7;
}

.text-caption {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ===== Gradient Text ===== */
.gradient-text {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent2), var(--accent3));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 20px;
  position: relative;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-control {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: all var(--transition-fast);
  outline: none;
  backdrop-filter: blur(8px);
}

.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

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

select.form-control {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239494b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-spring);
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover::after { opacity: 1; }

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #5b4cd4);
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  box-shadow: 0 8px 32px var(--accent-glow);
  transform: translateY(-2px);
}

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

.btn-full { width: 100%; }

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  border-color: var(--border-glow);
  background: var(--bg-glass-hover);
}

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

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

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.btn-sm { padding: 10px 20px; font-size: 0.8125rem; }
.btn-xs { padding: 6px 12px; font-size: 0.75rem; border-radius: var(--radius-sm); }

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--bg-glass);
  color: var(--text-secondary);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(8px);
}

.btn-icon:hover {
  color: var(--accent-bright);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

/* ===== LOGIN PAGE ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 20px;
}

.login-card {
  padding: clamp(32px, 6vw, 56px) clamp(24px, 5vw, 48px);
  width: 100%;
  max-width: 440px;
  position: relative;
}

.login-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-xl);
  padding: 1px;
  background: linear-gradient(135deg, var(--border-glow), transparent 50%, var(--border-glow));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.login-brand {
  text-align: center;
  margin-bottom: 40px;
}

.login-brand .vault-icon {
  width: 72px;
  height: 72px;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 20px var(--accent-glow));
  animation: iconPulse 3s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { filter: drop-shadow(0 0 20px var(--accent-glow)); }
  50% { filter: drop-shadow(0 0 40px var(--accent-glow)); }
}

.login-brand h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: 6px;
  text-transform: uppercase;
}

.login-brand p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 6px;
}

.error-msg {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-bottom: 20px;
  display: none;
  backdrop-filter: blur(8px);
}

.error-msg.visible { display: block; animation: slideDown 0.3s var(--transition-spring); }

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

.auth-toggle {
  text-align: center;
  margin-top: 28px;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.auth-toggle a {
  color: var(--accent-bright);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.auth-toggle a:hover { color: var(--accent2); }

/* ===== APP LAYOUT ===== */
.app-container {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-glass);
  padding: 0 clamp(16px, 3vw, 32px);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.header-left .vault-icon {
  width: 32px; height: 32px;
  filter: drop-shadow(0 0 8px var(--accent-glow));
}

.header-left h1 {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: 4px;
  text-transform: uppercase;
}

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

.header-user {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.btn-logout {
  background: none;
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
}

.btn-logout:hover {
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--danger);
}

/* Main */
.app-main {
  flex: 1;
  padding: clamp(16px, 3vw, 32px);
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

/* ===== TOOLBAR ===== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.search-box {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 12px 18px 12px 46px;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: 100px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition-fast);
  backdrop-filter: blur(8px);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

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

.search-box svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px; height: 18px;
  pointer-events: none;
}

/* ===== BENTO GRID - Person Cards ===== */
.persons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.person-card {
  padding: 24px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.person-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.person-card:hover::before { opacity: 1; }

/* Self card featured */
.person-card.card-self {
  grid-column: span 1;
  background: linear-gradient(135deg, var(--bg-glass), rgba(124, 106, 239, 0.08));
}

.card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
}

.card-avatar::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  z-index: -1;
  opacity: 0.5;
}

.avatar-self  { background: rgba(124, 106, 239, 0.2); color: var(--accent-bright); }
.avatar-spouse { background: rgba(244, 114, 182, 0.2); color: var(--accent3); }
.avatar-child { background: rgba(34, 197, 94, 0.2); color: var(--accent4); }
.avatar-parent { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.avatar-sibling { background: rgba(56, 189, 248, 0.2); color: var(--accent2); }
.avatar-other { background: rgba(148, 148, 184, 0.2); color: var(--text-secondary); }

.card-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.card-info h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.3;
}

.card-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.badge-self   { background: rgba(124,106,239,0.15); color: var(--accent-bright); }
.badge-spouse { background: rgba(244,114,182,0.15); color: var(--accent3); }
.badge-child  { background: rgba(34,197,94,0.15);   color: var(--accent4); }
.badge-parent { background: rgba(245,158,11,0.15);  color: var(--warning); }
.badge-sibling{ background: rgba(56,189,248,0.15);  color: var(--accent2); }
.badge-other  { background: rgba(148,148,184,0.15); color: var(--text-secondary); }

.card-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card-detail {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.card-detail svg {
  width: 15px; height: 15px;
  flex-shrink: 0;
  color: var(--text-muted);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: clamp(40px, 8vw, 100px) 20px;
  color: var(--text-secondary);
}

.empty-illustration {
  width: 120px; height: 120px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--bg-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-glass);
  animation: floatSoft 4s ease-in-out infinite;
}

@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.empty-illustration svg {
  width: 48px; height: 48px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 600;
}

.empty-state p {
  font-size: 0.9375rem;
  margin-bottom: 28px;
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== WIZARD ONBOARDING ===== */
.wizard-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.wizard-overlay .mesh-bg::before { opacity: 0.5; }

.wizard-card {
  width: 100%;
  max-width: 520px;
  max-height: 92dvh;
  overflow-y: auto;
  position: relative;
  padding: 0;
}

.wizard-card::-webkit-scrollbar { width: 4px; }
.wizard-card::-webkit-scrollbar-thumb { background: var(--border-glass); border-radius: 2px; }

/* Progress bar */
.wizard-progress {
  display: flex;
  gap: 8px;
  padding: 24px 32px 0;
}

.wizard-progress-step {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  transition: all var(--transition-smooth);
}

.wizard-progress-step.active,
.wizard-progress-step.done {
  background: var(--accent);
}

.wizard-progress-step.active {
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Step content */
.wizard-step {
  display: none;
  padding: 32px;
  animation: wizardFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.wizard-step.active { display: block; }

@keyframes wizardFadeIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.wizard-step-icon {
  width: 80px; height: 80px;
  border-radius: 50%;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(124,106,239,0.15), rgba(56,189,248,0.1));
  border: 1px solid var(--border-glow);
  animation: floatSoft 4s ease-in-out infinite;
}

.wizard-step-icon svg {
  width: 36px; height: 36px;
  color: var(--accent-bright);
}

.wizard-step h2 {
  font-size: clamp(1.25rem, 4vw, 1.5rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
}

.wizard-step .step-desc {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 32px;
  line-height: 1.6;
}

/* Feature list in welcome */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-glass);
  transition: all var(--transition-fast);
}

.feature-item:hover {
  border-color: var(--border-glow);
  background: rgba(124,106,239,0.04);
}

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

.feature-icon svg {
  width: 22px; height: 22px;
}

.feature-icon.fi-1 { background: rgba(124,106,239,0.12); color: var(--accent-bright); }
.feature-icon.fi-2 { background: rgba(56,189,248,0.12); color: var(--accent2); }
.feature-icon.fi-3 { background: rgba(34,197,94,0.12); color: var(--accent4); }

.feature-item h4 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.feature-item p {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Wizard navigation */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 32px 32px;
  gap: 12px;
}

.wizard-nav .btn { min-width: 140px; }

.wizard-skip {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8125rem;
  cursor: pointer;
  font-family: inherit;
  padding: 8px;
  transition: color var(--transition-fast);
}

.wizard-skip:hover { color: var(--text-secondary); }

.wizard-skip-container {
  text-align: center;
  padding: 0 32px 24px;
}

/* Step counter */
.wizard-step-counter {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
}

/* Family member mini-cards in step 3 */
.family-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.family-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: all var(--transition-spring);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
}

.family-type-btn:hover,
.family-type-btn.selected {
  border-color: var(--border-glow);
  background: rgba(124,106,239,0.06);
  color: var(--text-primary);
}

.family-type-btn.selected {
  box-shadow: 0 0 0 2px var(--accent);
}

.family-type-btn .type-icon {
  font-size: 1.5rem;
}

/* Completion animation */
.completion-check {
  width: 100px; height: 100px;
  border-radius: 50%;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(34,197,94,0.15), rgba(34,197,94,0.05));
  border: 2px solid var(--success);
  animation: scaleIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.completion-check svg {
  width: 48px; height: 48px;
  color: var(--success);
  animation: checkDraw 0.8s ease 0.3s both;
}

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

@keyframes checkDraw {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

.completion-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 24px 0 32px;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent-bright);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: 0;
}

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

.modal {
  background: var(--bg-base);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 92dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-elevated);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* Modal drag handle (mobile) */
.modal-handle {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: var(--border-glass);
  margin: 12px auto 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px 16px;
}

.modal-header h2 {
  font-size: 1.125rem;
  font-weight: 700;
}

.modal-close {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 50%;
  transition: all var(--transition-fast);
  font-size: 18px;
}

.modal-close:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

.modal-body { padding: 0 24px 24px; }

.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border-glass);
}

.modal-footer-right {
  display: flex;
  gap: 12px;
}

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  left: 20px;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 14px 22px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  animation: toastIn 0.4s var(--transition-spring), toastOut 0.3s ease 2.7s forwards;
  box-shadow: var(--shadow-elevated);
  backdrop-filter: blur(16px);
  pointer-events: auto;
  max-width: 400px;
}

.toast-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.toast-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

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

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

/* ===== CONFIRM DIALOG ===== */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

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

.confirm-box {
  background: var(--bg-base);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-elevated);
  animation: scaleIn 0.3s var(--transition-spring);
}

.confirm-box h3 { margin-bottom: 8px; font-size: 1.125rem; }

.confirm-box p {
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-size: 0.875rem;
}

.confirm-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

/* Desktop modal centered */
@media (min-width: 769px) {
  .modal-overlay {
    align-items: center;
    padding: 20px;
  }

  .modal {
    border-radius: var(--radius-xl);
    max-height: 90vh;
  }

  .modal-handle { display: none; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-glass); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== Google Sign-In Button ===== */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-spring);
  position: relative;
  overflow: hidden;
}

.btn-google::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(66,133,244,0.06), rgba(234,67,53,0.06));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn-google:hover {
  border-color: rgba(66, 133, 244, 0.3);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(66, 133, 244, 0.15);
}

.btn-google:hover::after { opacity: 1; }

.btn-google:active {
  transform: translateY(0) scale(0.98);
}

.btn-google svg {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.btn-google:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Auth Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
  gap: 16px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-glass);
}

.auth-divider span {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
}

/* ===== Google Security Badge ===== */
.google-security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  font-size: 0.6875rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.google-security-badge svg {
  color: var(--accent4);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Hide reCAPTCHA badge (we show our own) */
.grecaptcha-badge { visibility: hidden !important; }

/* ===== HOME DASHBOARD ===== */

/* Ticket Upload Zone */
.home-ticket-zone {
  padding: 4px;
  border-radius: var(--radius-xl);
  margin-bottom: 28px;
}

.home-ticket-drop {
  border: 2px dashed var(--border-glass);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 5vw, 48px) 24px;
  text-align: center;
  transition: all var(--transition-spring);
  cursor: pointer;
  position: relative;
}

.home-ticket-drop.drag-over {
  border-color: var(--accent);
  background: rgba(124, 106, 239, 0.06);
  transform: scale(1.01);
}

.home-ticket-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(124,106,239,0.12), rgba(56,189,248,0.08));
  border: 1px solid var(--border-glow);
  animation: floatSoft 4s ease-in-out infinite;
}

.home-ticket-icon svg {
  width: 28px; height: 28px;
  color: var(--accent-bright);
}

.home-ticket-drop h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.home-ticket-drop p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.home-ticket-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.home-upload-label {
  cursor: pointer;
  position: relative;
  z-index: 2;
}

/* Pending tickets */
.home-ticket-pending {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.home-pending-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-md);
  position: relative;
}

.home-pending-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-glass);
}

.home-pending-pdf {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: rgba(255,255,255,0.03);
  font-size: 0.625rem;
  color: var(--text-muted);
  font-weight: 700;
}

.home-pending-pdf svg {
  width: 24px; height: 24px;
  color: var(--accent2);
}

.home-pending-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-pending-input {
  padding: 10px 14px !important;
  font-size: 0.8125rem !important;
}

.home-pending-row {
  display: flex;
  gap: 8px;
}

.home-pending-amount {
  width: 100px;
  flex-shrink: 0;
}

.home-pending-cat {
  flex: 1;
  min-width: 0;
}

.home-pending-remove {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border: none;
  background: rgba(239,68,68,0.1);
  color: var(--danger);
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.home-pending-remove:hover {
  background: var(--danger);
  color: white;
}

.home-save-all {
  margin-top: 8px;
  align-self: flex-end;
}

/* AI analysis status */
.home-pending-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 4px 0;
  letter-spacing: 0.02em;
}

.home-pending-status.analyzing {
  color: var(--accent2);
}

.home-pending-status.done {
  color: var(--accent4);
}

.home-ai-spinner {
  width: 12px; height: 12px;
  border: 2px solid rgba(56,189,248,0.2);
  border-top-color: var(--accent2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.home-pending-vendor {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
  padding-bottom: 2px;
}

/* Home Sections */
.home-section {
  margin-bottom: 28px;
}

.home-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.home-section-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

/* Finance summary cards */
.home-finance-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.home-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
}

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

.home-stat-icon svg {
  width: 20px; height: 20px;
}

.hsi-income { background: rgba(34,197,94,0.12); color: var(--accent4); }
.hsi-expense { background: rgba(239,68,68,0.1); color: var(--danger); }
.hsi-balance { background: rgba(124,106,239,0.12); color: var(--accent-bright); }

.home-stat-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.home-stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hv-income { color: var(--accent4); }
.hv-expense { color: var(--danger); }
.hv-balance { color: var(--accent-bright); }

/* Recent transactions */
.home-recent-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-tx-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.home-tx-row:hover {
  background: rgba(255,255,255,0.03);
}

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

.htd-income { background: var(--accent4); }
.htd-expense { background: var(--danger); }

.home-tx-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.home-tx-desc {
  font-size: 0.875rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-tx-date {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.home-tx-amount {
  font-size: 0.9375rem;
  font-weight: 700;
  flex-shrink: 0;
}

.home-empty-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
  padding: 24px 16px;
}

/* Quick actions */
.home-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.home-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px;
  border-radius: var(--radius-lg);
  border: none;
  background: var(--bg-glass);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  transition: all var(--transition-spring);
}

.home-action:hover {
  color: var(--text-primary);
}

.home-action-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-action-icon svg {
  width: 20px; height: 20px;
}

.ha-purple { background: rgba(124,106,239,0.12); color: var(--accent-bright); }
.ha-blue { background: rgba(56,189,248,0.12); color: var(--accent2); }
.ha-green { background: rgba(34,197,94,0.12); color: var(--accent4); }

/* (Home mobile rules consolidated into main mobile block below) */

/* ===== FINANCES ===== */

/* Summary Cards */
.fin-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.fin-summary-card {
  padding: 20px;
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.fin-summary-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.fin-card-income::before { background: linear-gradient(90deg, var(--accent4), #6ee7b7); }
.fin-card-expense::before { background: linear-gradient(90deg, var(--danger), #f87171); }
.fin-card-balance::before { background: linear-gradient(90deg, var(--accent), var(--accent2)); }

.fin-summary-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.fin-summary-value {
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.fin-card-income .fin-summary-value { color: var(--accent4); }
.fin-card-expense .fin-summary-value { color: var(--danger); }
.fin-card-balance.positive .fin-summary-value { color: var(--accent4); }
.fin-card-balance.negative .fin-summary-value { color: var(--danger); }

/* Category Breakdown */
.fin-breakdown-section {
  padding: 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.fin-breakdown-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.fin-breakdown-row {
  display: grid;
  grid-template-columns: 140px 1fr 90px;
  gap: 12px;
  align-items: center;
  padding: 6px 0;
}

.fin-breakdown-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  min-width: 0;
}

.fin-breakdown-label span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fin-cat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.fin-breakdown-count {
  font-size: 0.6875rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.fin-breakdown-bar-wrap {
  height: 6px;
  background: rgba(255,255,255,0.04);
  border-radius: 3px;
  overflow: hidden;
}

.fin-breakdown-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fin-breakdown-amount {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

.fin-empty-breakdown {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8125rem;
  padding: 16px 0;
}

/* Toolbar */
.fin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.fin-month-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fin-month-label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 140px;
  text-align: center;
}

.fin-toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Transaction list */
.fin-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fin-date-header {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 16px 0 6px;
}

.fin-date-header:first-child {
  padding-top: 0;
}

.fin-tx-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.fin-tx-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fin-tx-icon svg {
  width: 18px; height: 18px;
}

.fin-icon-income {
  background: rgba(34, 197, 94, 0.12);
  color: var(--accent4);
}

.fin-icon-expense {
  background: rgba(239, 68, 68, 0.08);
  color: var(--text-secondary);
}

.fin-tx-info {
  flex: 1;
  min-width: 0;
}

.fin-tx-desc {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fin-tx-cat {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.fin-receipt-badge {
  font-size: 0.75rem;
}

.fin-tx-amount {
  font-size: 0.9375rem;
  font-weight: 700;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.fin-amount-income { color: var(--accent4); }
.fin-amount-expense { color: var(--text-primary); }

/* Receipt in modal */
.fin-current-receipt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.fin-current-receipt svg { color: var(--accent2); flex-shrink: 0; }

.fin-receipt-actions {
  display: flex;
  gap: 8px;
}

.fin-upload-label {
  cursor: pointer;
}

.fin-receipt-preview {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  margin-top: 10px;
  border: 1px solid var(--border-glass);
}

/* ===== APP TABS - Desktop: horizontal pills, Mobile: bottom nav ===== */
.app-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--bg-glass);
  border-radius: var(--radius-lg);
  padding: 4px;
  border: 1px solid var(--border-glass);
  overflow-x: auto;
}

.app-tabs::-webkit-scrollbar { display: none; }

.app-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
}

.app-tab svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
}

.app-tab .tab-label {
  pointer-events: none;
}

.app-tab:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}

.app-tab.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 12px var(--accent-glow);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: tabFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* ===== MOBILE BOTTOM NAV BAR ===== */
@media (max-width: 768px) {
  /* Move tabs to bottom as fixed nav */
  .app-tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    margin: 0;
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--border-glass);
    background: rgba(10, 10, 20, 0.85);
    backdrop-filter: blur(24px);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    gap: 0;
    justify-content: space-around;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .app-tab {
    flex-direction: column;
    gap: 3px;
    padding: 6px 6px 4px;
    font-size: 0.5625rem;
    letter-spacing: 0.02em;
    border-radius: var(--radius-sm);
    min-width: 0;
    flex: 1;
    max-width: 72px;
    text-align: center;
    justify-content: center;
  }

  .app-tab svg {
    width: 20px; height: 20px;
  }

  .app-tab.active {
    background: transparent;
    color: var(--accent-bright);
    box-shadow: none;
  }

  .app-tab.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    border-radius: 0 0 2px 2px;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
  }

  .app-tab:hover {
    background: transparent;
  }

  /* Main content padding for bottom nav */
  .app-main {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }

  .app-header .header-user { display: none; }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box { max-width: 100%; }

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

  .person-card { padding: 20px; }

  .form-row { grid-template-columns: 1fr; gap: 12px; }

  /* Bottom sheet modal */
  .modal {
    max-width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  /* Wizard */
  .wizard-card {
    max-width: 100%;
    max-height: 100dvh;
    border-radius: var(--radius-xl);
    margin: 8px;
  }

  .wizard-step { padding: 24px 20px; }
  .wizard-nav { padding: 16px 20px 24px; }
  .wizard-progress { padding: 20px 20px 0; }

  .family-type-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  .toast-container {
    top: auto;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    align-items: center;
  }

  /* Finance mobile */
  .fin-summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .fin-summary-card {
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .fin-summary-label { margin-bottom: 0; }

  .fin-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .fin-toolbar-right {
    flex-direction: column;
  }

  .fin-toolbar-right .search-box { max-width: 100%; }

  .fin-month-nav { justify-content: center; }

  .fin-breakdown-row {
    grid-template-columns: 100px 1fr 80px;
    gap: 8px;
  }

  .fin-tx-row { padding: 12px 14px; }

  /* Header compact */
  .app-header { height: 56px; }
  .header-left .vault-icon { width: 28px; height: 28px; }
  .header-left h1 { font-size: 1rem; letter-spacing: 3px; }
  .btn-logout { padding: 6px 12px; font-size: 0.75rem; }

  /* Home mobile */
  .home-finance-cards { grid-template-columns: 1fr; gap: 8px; }
  .home-stat-card { padding: 14px; }
  .home-quick-actions { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .home-action { padding: 16px 8px; font-size: 0.6875rem; }
  .home-action-icon { width: 38px; height: 38px; }
  .home-pending-row { flex-direction: column; }
  .home-pending-amount { width: 100%; }

  /* Calendar mobile */
  .cal-cell { min-height: 44px; padding: 4px 2px; aspect-ratio: auto; }
  .cal-day-num { font-size: 0.75rem; }
  .cal-day-today { width: 22px; height: 22px; font-size: 0.6875rem; }
  .cal-event-dot { width: 5px; height: 5px; }

  /* Tasks & Routines mobile */
  .task-card { padding: 14px 16px; }
  .routine-week-day { padding: 8px 2px; }
  .rwd-label { font-size: 0.5625rem; }
  .rwd-num { font-size: 0.8125rem; }

  /* Health mobile */
  .health-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .health-stat-card { padding: 12px; }
  .health-stat-icon { font-size: 1.25rem; }
  .health-stat-value { font-size: 1rem; }
  .health-card { padding: 12px 14px; gap: 10px; }

  /* Chat mobile */
  .chat-fab { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); right: 14px; }

  .chat-panel {
    width: 100%;
    height: 100%;
    bottom: 0;
    right: 0;
    border-radius: 0;
    max-height: 100dvh;
  }
}

@media (max-width: 380px) {
  .family-type-grid { grid-template-columns: 1fr; }
  .wizard-nav .btn { min-width: auto; flex: 1; }

  .app-tab {
    font-size: 0.5rem;
    padding: 5px 4px 3px;
  }

  .app-tab svg { width: 18px; height: 18px; }
}

/* ===== FAMILY CHAT ===== */
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 300;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 20px var(--accent-glow), var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-spring);
}

.chat-fab svg { width: 24px; height: 24px; }

.chat-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px var(--accent-glow), var(--shadow-elevated);
}

.chat-fab-active {
  transform: scale(0.9);
  opacity: 0.5;
}

.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: white;
  font-size: 0.6875rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  font-family: var(--font);
  box-shadow: 0 2px 8px rgba(239,68,68,0.4);
}

.chat-panel {
  position: fixed;
  bottom: 90px;
  right: 20px;
  z-index: 350;
  width: 380px;
  max-height: 520px;
  background: var(--bg-base);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-elevated);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-panel.chat-open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-glass);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
}

.chat-header-left h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chat-header-right {
  display: flex;
  gap: 4px;
}

.chat-header-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
}

.chat-header-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
}

/* Chat list view */
.chat-list-view {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.chat-list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.chat-list-row:hover {
  background: rgba(255,255,255,0.04);
}

.chat-list-row:active {
  background: rgba(255,255,255,0.07);
}

.chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.875rem;
  font-weight: 700;
  color: white;
}

.chat-avatar-family {
  background: linear-gradient(135deg, var(--accent), var(--accent3));
}

.chat-avatar-private {
  background: linear-gradient(135deg, var(--accent2), var(--accent4));
}

.chat-list-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-list-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-list-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-list-time {
  font-size: 0.6875rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.chat-list-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chat-list-preview {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.chat-list-badge {
  font-size: 0.625rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 2px 8px;
  border-radius: 100px;
  flex-shrink: 0;
}

.chat-list-divider {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 12px 16px 6px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 300px;
}

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  flex: 1;
}

.chat-empty p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 12px;
}

.chat-empty-sub {
  font-size: 0.75rem !important;
  margin-top: 4px !important;
}

.chat-date-sep {
  text-align: center;
  font-size: 0.6875rem;
  color: var(--text-muted);
  padding: 8px 0 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chat-msg {
  display: flex;
  max-width: 82%;
}

.chat-msg-mine {
  align-self: flex-end;
}

.chat-msg-other {
  align-self: flex-start;
}

.chat-bubble {
  padding: 8px 12px;
  border-radius: 16px;
  font-size: 0.875rem;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  gap: 2px;
  word-break: break-word;
}

.chat-msg-mine .chat-bubble {
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-msg-other .chat-bubble {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.chat-sender {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--accent-bright);
  margin-bottom: 1px;
}

.chat-text {
  display: block;
}

.chat-time {
  font-size: 0.5625rem;
  opacity: 0.6;
  align-self: flex-end;
  margin-top: 2px;
}

.chat-msg-system {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 4px 12px;
  font-style: italic;
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border-glass);
  background: var(--bg-glass);
}

.chat-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 0.875rem;
  color: var(--text-primary);
  font-family: var(--font);
  outline: none;
  transition: border-color var(--transition-fast);
}

.chat-input:focus {
  border-color: var(--accent);
}

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

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.chat-send-btn:hover {
  background: var(--accent-bright);
  transform: scale(1.05);
}

/* ===== TRIPS ===== */
.trips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.trip-card {
  padding: 20px;
  cursor: pointer;
}

.trip-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.trip-card-info { display: flex; flex-direction: column; gap: 3px; }
.trip-card-name { font-size: 1.0625rem; font-weight: 700; }
.trip-card-dest { font-size: 0.8125rem; color: var(--text-secondary); }
.trip-card-dates { font-size: 0.75rem; color: var(--text-muted); }

.trip-status {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 100px;
  flex-shrink: 0;
}

.trip-status-upcoming { background: rgba(56,189,248,0.15); color: var(--accent2); }
.trip-status-active { background: rgba(34,197,94,0.15); color: var(--success); }
.trip-status-past { background: rgba(148,148,184,0.1); color: var(--text-muted); }

.trip-budget-bar { margin-top: 4px; }
.trip-budget-track {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.trip-budget-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.trip-budget-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Trip Detail */
.trip-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.trip-detail-header .section-title { flex: 1; margin: 0; }

.trip-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.trip-sum-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trip-sum-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.trip-sum-value { font-size: 1.25rem; font-weight: 800; }

/* Trip subtabs */
.trip-subtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--bg-glass);
  border-radius: var(--radius-md);
  padding: 3px;
  border: 1px solid var(--border-glass);
}

.trip-subtab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-align: center;
}

.trip-subtab:hover { color: var(--text-primary); }
.trip-subtab.active { background: var(--accent); color: white; }

.trip-subcontent { display: none; }
.trip-subcontent.active { display: block; animation: tabFadeIn 0.3s ease; }

/* Expenses */
.trip-exp-section { margin-bottom: 16px; }
.trip-exp-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.trip-exp-cat-total { font-weight: 700; color: var(--text-primary); }

.trip-exp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-glass);
  transition: background var(--transition-fast);
}

.trip-exp-row:hover { background: rgba(255,255,255,0.02); }
.trip-exp-row:last-child { border-bottom: none; }

.trip-exp-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.trip-exp-desc { font-size: 0.875rem; font-weight: 500; }
.trip-exp-date { font-size: 0.6875rem; color: var(--text-muted); }
.trip-exp-amount { font-size: 0.9375rem; font-weight: 700; flex-shrink: 0; }

.btn-icon-sm {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  line-height: 1;
}

.btn-danger-text { color: var(--text-muted); }
.btn-danger-text:hover { color: var(--danger); }

/* Trip expense scan */
.trip-exp-scan-zone {
  margin-bottom: 16px;
  padding: 14px;
  background: rgba(124,106,239,0.06);
  border: 1px dashed var(--border-glow);
  border-radius: var(--radius-md);
}

.trip-exp-scan-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.trip-exp-scan-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.trip-exp-scan-status .spinner {
  width: 20px;
  height: 20px;
  margin: 0;
}

.trip-exp-finance-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin-top: 8px;
}

.trip-exp-finance-check input {
  accent-color: var(--accent);
}

/* Wallet passes */
.trip-passes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trip-pass-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--radius-lg) !important;
}

.trip-pass-left { flex-shrink: 0; }
.trip-pass-icon { font-size: 1.75rem; }

.trip-pass-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.trip-pass-name { font-size: 0.9375rem; font-weight: 600; }
.trip-pass-detail { font-size: 0.75rem; color: var(--text-muted); }
.trip-pass-notes { font-style: italic; }

.trip-pass-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state p:first-child {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.text-muted { color: var(--text-muted); font-size: 0.8125rem; margin-top: 4px; }

@media (max-width: 768px) {
  .trips-grid { grid-template-columns: 1fr; }
  .trip-summary { grid-template-columns: 1fr; }
  .trip-detail-header { flex-wrap: wrap; }
}

/* ===== CHAT INVITE ===== */
.chat-invite-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.chat-invite-loading {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.chat-invite-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  transition: all var(--transition-fast);
}

.chat-invite-row:hover {
  border-color: var(--border-glow);
  background: rgba(255,255,255,0.02);
}

.chat-invite-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chat-invite-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-invite-detail {
  font-size: 0.6875rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-invite-add-btn {
  flex-shrink: 0;
}

.btn-success {
  background: var(--success) !important;
  color: white !important;
  border-color: var(--success) !important;
}

.chat-invite-manual {
  padding-top: 16px;
  border-top: 1px solid var(--border-glass);
}

/* ===== Utility classes for inline style removal ===== */
.toolbar-end { margin-bottom: 16px; justify-content: flex-end; }
.health-icon-blue { color: var(--accent2); }
.health-icon-green { color: var(--success); }
.health-icon-pink { color: var(--accent3); }
.health-icon-purple { color: var(--accent); }
.form-group-inline { display: flex; align-items: flex-end; }
.modal-sm { max-width: 420px; }
.modal-desc { font-size: 0.8125rem; color: var(--text-secondary); margin-bottom: 16px; }
.form-label-inline { font-size: 0.8125rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; display: block; }
.health-unit-label { color: var(--text-muted); font-size: 0.75rem; }
.health-active-wrap { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.health-active-label { margin: 0; cursor: pointer; }

/* ===== Utility: hidden ===== */
.hidden { display: none !important; }

/* ===== Page transition ===== */
.page-enter {
  animation: pageEnter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

/* ===== TASKS ===== */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 16px 0 8px;
}

.task-group-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}

.task-dot-pending { background: var(--warning); }
.task-dot-progress { background: var(--accent2); }
.task-dot-done { background: var(--success); }

.task-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.task-card.task-done { opacity: 0.6; }

.task-check-wrap { padding-top: 2px; }

.task-check {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--border-glass);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-spring);
  color: white;
  padding: 0;
}

.task-check:hover { border-color: var(--accent); }

.task-check.checked {
  background: var(--success);
  border-color: var(--success);
}

.task-body { flex: 1; cursor: pointer; min-width: 0; }

.task-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-title {
  font-size: 0.9375rem;
  font-weight: 500;
}

.task-title-done { text-decoration: line-through; color: var(--text-muted); }

.task-prio-badge {
  padding: 1px 8px;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.task-prio-high { background: rgba(239,68,68,0.15); color: var(--danger); }
.task-prio-medium { background: rgba(245,158,11,0.15); color: var(--warning); }
.task-prio-low { background: rgba(34,197,94,0.15); color: var(--success); }

.task-tx-badge {
  font-size: 0.8125rem;
  cursor: help;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.task-due, .task-time-badge, .task-cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.task-overdue { color: var(--danger); font-weight: 600; }

/* Task Time Section */
.task-time-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-glass);
}

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

.task-time-header h4 { font-size: 0.875rem; font-weight: 600; }

.task-total-time {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent-bright);
}

.task-timer-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.task-timer-display {
  font-size: 1.25rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--accent-bright);
  animation: pulse 1s ease-in-out infinite;
}

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

.timer-active { background: var(--danger) !important; border-color: var(--danger) !important; color: white !important; }

.task-manual-time {
  padding: 12px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  margin-bottom: 12px;
}

.task-time-entries {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.task-time-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.task-te-duration {
  font-weight: 600;
  color: var(--accent-bright);
}

.task-no-entries {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* ===== ROUTINES ===== */
.routines-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.routine-date-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 16px;
}

.routine-date-label {
  font-size: 0.9375rem;
  font-weight: 600;
  text-transform: capitalize;
  min-width: 160px;
  text-align: center;
}

/* Week bar */
.routine-week-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  padding: 4px;
  background: var(--bg-glass);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
}

.routine-week-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.routine-week-day:hover { background: rgba(255,255,255,0.04); }
.routine-week-day.active { background: var(--accent); }
.routine-week-day.today .rwd-num { color: var(--accent-bright); font-weight: 700; }

.rwd-label { font-size: 0.625rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.rwd-num { font-size: 0.875rem; font-weight: 500; }
.rwd-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }

.routine-week-day.active .rwd-label,
.routine-week-day.active .rwd-num { color: white; }

/* Routine cards */
.routine-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
}

.routine-card.routine-done { opacity: 0.65; }

.routine-check-wrap { flex-shrink: 0; }

.routine-check {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--accent);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-spring);
  padding: 0;
}

.routine-check:hover { transform: scale(1.1); }

.routine-body { flex: 1; cursor: pointer; min-width: 0; }

.routine-name {
  font-size: 0.9375rem;
  font-weight: 500;
}

.routine-name-done { text-decoration: line-through; color: var(--text-muted); }

.routine-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.routine-time, .routine-freq {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.routine-completed-at { color: var(--success); font-weight: 500; }

.routine-no-items {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Routine form: day buttons */
.routine-days-grid {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.routine-day-btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.routine-day-btn:hover { border-color: var(--border-glow); color: var(--text-primary); }

.routine-day-btn.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.form-control-color {
  padding: 4px;
  height: 46px;
  cursor: pointer;
}

/* ===== CALENDAR ===== */
.cal-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.cal-month-label {
  font-size: 1.125rem;
  font-weight: 600;
  min-width: 180px;
  text-align: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-header-cell {
  text-align: center;
  padding: 8px 0;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.cal-cell {
  aspect-ratio: 1;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-glass);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 60px;
}

.cal-cell:hover { border-color: var(--border-glow); background: var(--bg-glass-hover); }
.cal-cell-empty { background: transparent; cursor: default; }
.cal-cell-empty:hover { border-color: transparent; background: transparent; }

.cal-today { border-color: var(--accent); background: rgba(124,106,239,0.08); }

.cal-day-num {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.cal-day-today {
  background: var(--accent);
  color: white;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.cal-events {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  justify-content: center;
}

.cal-event-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
}

.cal-more {
  font-size: 0.5625rem;
  color: var(--text-muted);
}

/* Calendar day detail modal */
.cal-day-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cal-day-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}

.cal-item-icon { flex-shrink: 0; }

.cal-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cal-item-title { font-size: 0.875rem; font-weight: 500; }

.cal-item-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 100px;
  font-size: 0.6875rem;
  font-weight: 600;
  width: fit-content;
}

.cal-badge-task { background: rgba(56,189,248,0.15); color: var(--accent2); }

.cal-item-time { font-size: 0.75rem; color: var(--text-muted); }

.cal-item-amount { font-size: 0.8125rem; font-weight: 600; }
.cal-amount-income { color: var(--success); }
.cal-amount-expense { color: var(--warning); }

.cal-day-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ===== CHECKLIST (Lista de la compra) ===== */
.task-checklist-section {
  margin: 12px 0;
  padding: 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.checklist-header label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.checklist-scan-btns {
  display: flex;
  gap: 6px;
}

.checklist-scan-btns .btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6875rem;
  padding: 4px 10px;
}

.checklist-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.checklist-add-row input {
  flex: 1;
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.checklist-empty {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.checklist-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.checklist-progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.checklist-progress-fill {
  height: 100%;
  background: var(--success);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.checklist-progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.checklist-item:hover {
  background: rgba(255,255,255,0.03);
}

.checklist-check {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--text-muted);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  color: white;
}

.checklist-check:hover {
  border-color: var(--accent-bright);
}

.checklist-check.checked {
  background: var(--success);
  border-color: var(--success);
}

.checklist-text {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.checklist-text-done {
  text-decoration: line-through;
  color: var(--text-muted);
}

.checklist-remove {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--transition-fast);
}

.checklist-item:hover .checklist-remove {
  opacity: 1;
}

.checklist-remove:hover {
  color: var(--danger);
  background: rgba(239,68,68,0.1);
}

/* Inline checklist on task cards */
.task-inline-checklist {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-inline-cl-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}

.cl-inline-check {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1.5px solid var(--text-muted);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
  color: white;
}

.cl-inline-check:hover {
  border-color: var(--accent-bright);
}

.cl-inline-check.checked {
  background: var(--success);
  border-color: var(--success);
}

.cl-inline-text {
  font-size: 0.8125rem;
  color: var(--text-primary);
}

.cl-item-done .cl-inline-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.task-checklist-badge {
  font-size: 0.625rem;
  padding: 1px 8px;
  border-radius: 100px;
  background: rgba(34,197,94,0.15);
  color: var(--success);
  font-weight: 600;
}

/* ===== SCAN RESULTS ===== */
.scan-results-vendor {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding: 8px 12px;
  background: rgba(124,106,239,0.08);
  border-radius: var(--radius-sm);
}

.scan-results-vendor:empty { display: none; }

.scan-results-loading {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-glass);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

.scan-results-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 50vh;
  overflow-y: auto;
}

.scan-error {
  text-align: center;
  padding: 24px;
  color: var(--danger);
  font-size: 0.875rem;
}

.scan-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  transition: all var(--transition-fast);
}

.scan-item-row:hover { border-color: var(--border-glow); }

.scan-item-deselected {
  opacity: 0.4;
}

.scan-item-check {
  flex-shrink: 0;
  cursor: pointer;
}

.scan-item-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.scan-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scan-item-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
}

.scan-item-cat {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.scan-item-price {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.scan-item-qty {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.scan-results-actions {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-glass);
}

.scan-select-all-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.scan-select-all-wrap input {
  accent-color: var(--accent);
}

.btn-accent {
  background: var(--accent4);
  color: var(--bg-void);
}

.btn-accent:hover {
  background: #2dd488;
}

/* ===== HEALTH SECTION ===== */
.health-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.health-stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
}

.health-stat-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.health-stat-value {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.health-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.health-filters {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.health-filters::-webkit-scrollbar { display: none; }

.health-filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border-glass);
  border-radius: 100px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.health-filter-btn:hover {
  border-color: var(--border-glow);
  color: var(--text-primary);
}

.health-filter-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.health-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.health-date-header {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 12px 0 4px;
  text-transform: capitalize;
}

.health-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.health-card:hover {
  border-color: var(--border-glow);
}

.health-card-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
}

.health-card-body {
  flex: 1;
  min-width: 0;
}

.health-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.health-card-type {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.health-person-badge {
  font-size: 0.625rem;
  padding: 1px 8px;
  border-radius: 100px;
  background: rgba(124,106,239,0.15);
  color: var(--accent-bright);
}

.health-active-badge {
  font-size: 0.625rem;
  padding: 1px 8px;
  border-radius: 100px;
  background: rgba(34,197,94,0.15);
  color: var(--success);
}

.health-card-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-top: 2px;
}

.health-card-notes {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-card-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
  text-align: right;
}
