/* ========================================================
   BabyPlan 2030 - Design System & Modern Responsive Styles
   Aesthetic: Warm Rose Gold & Soft Terracotta + Sage Emerald
   ======================================================== */

:root {
  /* Color Palette */
  --primary: #e07a5f;
  --primary-hover: #c9654b;
  --primary-light: #fef4f0;
  --primary-border: #f8cfc3;
  --primary-gradient: linear-gradient(135deg, #e07a5f 0%, #f48c71 100%);

  --emerald: #2a8664;
  --emerald-hover: #226c50;
  --emerald-light: #ecfdf5;
  --emerald-border: #a7f3d0;
  --emerald-gradient: linear-gradient(135deg, #2a8664 0%, #34d399 100%);

  --amber: #d97706;
  --amber-light: #fffbeb;
  --amber-border: #fde68a;
  --amber-gradient: linear-gradient(135deg, #d97706 0%, #fbbf24 100%);

  --indigo: #4f46e5;
  --indigo-light: #eef2ff;
  --indigo-border: #c7d2fe;
  --indigo-gradient: linear-gradient(135deg, #4f46e5 0%, #818cf8 100%);

  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;

  /* Surfaces & Backgrounds */
  --bg-body: #f8f6f2;
  --surface: #ffffff;
  --surface-alt: #f3efe6;
  --surface-hover: #fbf9f6;

  /* Text Colors */
  --text-main: #242220;
  --text-secondary: #595551;
  --text-muted: #8c8680;
  --text-inverse: #ffffff;

  /* Borders & Dividers */
  --border-light: #e8e2d8;
  --border-focus: #e07a5f;

  /* Typography */
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  /* Elevations / Shadows */
  --shadow-sm: 0 1px 3px rgba(36, 34, 32, 0.05), 0 1px 2px rgba(36, 34, 32, 0.03);
  --shadow-md: 0 4px 12px -1px rgba(36, 34, 32, 0.07), 0 2px 6px -1px rgba(36, 34, 32, 0.04);
  --shadow-lg: 0 10px 25px -3px rgba(36, 34, 32, 0.09), 0 4px 10px -2px rgba(36, 34, 32, 0.05);
  --shadow-xl: 0 20px 35px -5px rgba(36, 34, 32, 0.12);

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Base App Layout */
.app-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top Navigation Bar */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

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

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 10px rgba(224, 122, 95, 0.35);
  flex-shrink: 0;
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-year {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  font-size: 0.75rem;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-weight: 700;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: -2px;
}

/* Desktop Navigation Tabs */
.desktop-nav-tabs {
  display: flex;
  align-items: center;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: var(--radius-full);
  gap: 4px;
}

.nav-tab {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.nav-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.6);
}

.nav-tab.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Nav Actions & User Profile */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  background: var(--surface-alt);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f48c71, #e07a5f);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.user-role {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Action Dropdown */
.action-dropdown-wrapper {
  position: relative;
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 250px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 200;
  animation: fadeInDown 0.15s ease-out;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-item {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--surface-alt);
}

.dropdown-item.text-danger {
  color: var(--danger);
}

.dropdown-item.text-danger:hover {
  background: var(--danger-light);
}

.dropdown-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 4px 0;
}

/* Main Content Wrapper */
.main-content {
  flex: 1;
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 80px 20px;
}

/* Tab Panels */
.tab-panel {
  display: none;
  animation: fadeIn 0.25s ease-in-out;
}

.tab-panel.active {
  display: block;
}

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

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

/* ========================================================
   COMMON UI ELEMENTS: Cards, Headings, Badges, Buttons
   ======================================================== */

.section-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
  transition: box-shadow var(--transition-normal);
}

.content-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 24px;
}

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

.box-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.box-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.section-heading {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-top: 4px;
}

.section-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Badges */
.badge-accent {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.badge-mini {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--emerald-light);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

/* Buttons */
.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(224, 122, 95, 0.28);
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(224, 122, 95, 0.35);
}

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

.btn-primary-sm {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(224, 122, 95, 0.25);
  transition: all var(--transition-fast);
}

.btn-secondary {
  background: var(--surface-alt);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.btn-secondary-sm {
  background: var(--surface-alt);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-outline {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border-light);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger-border);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-outline-danger:hover {
  background: var(--danger-light);
}

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

.btn-danger-outline:hover {
  background: var(--danger-light);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--primary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
}

.btn-text:hover {
  text-decoration: underline;
}

.btn-text-danger {
  background: transparent;
  border: none;
  color: var(--danger);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-text-danger:hover {
  text-decoration: underline;
}

.btn-block {
  width: 100%;
}

.btn-tag {
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 4px 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-tag:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* ========================================================
   TAB 1: HERO & PILLAR CARDS
   ======================================================== */

.hero-card {
  background: linear-gradient(135deg, #fff7f4 0%, #fdf8f4 45%, #f4fbf7 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--primary-border);
  padding: 28px 32px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: 0 4px 20px -2px rgba(224, 122, 95, 0.12);
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -60px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(224, 122, 95, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content {
  max-width: 680px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--primary-border);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary);
  border-radius: 50%;
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(224, 122, 95, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(224, 122, 95, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(224, 122, 95, 0); }
}

.hero-heading {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 8px;
}

.hero-desc {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.hero-countdown {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.countdown-item strong {
  color: var(--primary);
  font-weight: 800;
}

.countdown-sep {
  color: var(--border-light);
}

/* Circular Chart */
.hero-stat-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex-shrink: 0;
}

.hero-stat-circle {
  width: 100px;
  height: 100px;
}

.circular-chart {
  display: block;
  margin: 0 auto;
  max-width: 100%;
}

.circle-bg {
  fill: none;
  stroke: var(--surface-alt);
  stroke-width: 3.2;
}

.circle {
  fill: none;
  stroke-width: 3.2;
  stroke-linecap: round;
  stroke: var(--primary);
  transition: stroke-dasharray 1s ease-out;
}

.percentage {
  fill: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.55rem;
  font-weight: 800;
  text-anchor: middle;
}

.hero-stat-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* 3 Pillars Grid */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.pillar-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  flex-direction: column;
}

.pillar-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(224, 122, 95, 0.4);
}

.pillar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.pillar-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.bg-amber { background: var(--amber-light); border: 1px solid var(--amber-border); }
.bg-emerald { background: var(--emerald-light); border: 1px solid var(--emerald-border); }
.bg-indigo { background: var(--indigo-light); border: 1px solid var(--indigo-border); }

.bg-amber-gradient { background: var(--amber-gradient); }
.bg-emerald-gradient { background: var(--emerald-gradient); }
.bg-indigo-gradient { background: var(--indigo-gradient); }

.pillar-meta {
  flex: 1;
  min-width: 0;
}

.pillar-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}

.pillar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-goto {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--surface-alt);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.pillar-card:hover .btn-goto {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pillar-metric-highlight {
  margin-bottom: 14px;
}

.metric-val {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.metric-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.progress-container {
  margin-bottom: 16px;
}

.progress-bar-wrapper {
  height: 8px;
  background: var(--surface-alt);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 6px;
}

.progress-bar {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease-in-out;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.pillar-footer-tip {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.pillar-footer-tip strong {
  color: var(--text-main);
}

/* Health Badge in Card */
.health-status-badge-container {
  margin-bottom: 12px;
}

.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--surface-alt);
  color: var(--text-main);
  border: 1px solid var(--border-light);
}

.health-badge.safe {
  background: var(--emerald-light);
  color: var(--emerald);
  border-color: var(--emerald-border);
}

.health-badge.waiting {
  background: var(--amber-light);
  color: var(--amber);
  border-color: var(--amber-border);
}

.health-summary-dates {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  margin-bottom: 14px;
}

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

.info-row .label {
  color: var(--text-secondary);
}

/* Split Row */
.dashboard-split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Quick Savings List */
.quick-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}

.qh-info {
  display: flex;
  flex-direction: column;
}

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

.qh-note {
  font-weight: 600;
  color: var(--text-main);
}

.qh-amount {
  font-weight: 800;
  color: var(--emerald);
}

/* Daily Checklist Widget */
.daily-checklist-widget {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.supp-check-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.supp-check-item:hover {
  background: var(--primary-light);
  border-color: var(--primary-border);
}

.supp-check-item.done {
  background: var(--emerald-light);
  border-color: var(--emerald-border);
}

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

.supp-text-block {
  flex: 1;
}

.supp-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.supp-dose {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* ========================================================
   TAB 2: QUỸ TÍCH LŨY (FINANCE)
   ======================================================== */

.header-target-card {
  position: relative;
}

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

.target-form-drawer {
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 24px;
  animation: fadeInDown 0.2s ease-out;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.req {
  color: var(--danger);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--surface);
  color: var(--text-main);
  transition: all var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(224, 122, 95, 0.18);
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.form-actions-right {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* KPI Banner */
.kpi-banner-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  background: var(--surface-alt);
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.kpi-item {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.kpi-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.kpi-note {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.text-accent { color: var(--primary); }
.text-emerald { color: var(--emerald); }
.text-danger-soft { color: #dc2626; }
.font-bold { font-weight: 700; }

/* Large Progress Bar with Markers */
.large-progress-wrapper {
  margin-top: 8px;
}

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

.progress-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.progress-percent-badge {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  padding: 3px 12px;
  border-radius: var(--radius-full);
}

.progress-track {
  height: 16px;
  background: var(--surface-alt);
  border-radius: var(--radius-full);
  position: relative;
  overflow: visible;
  border: 1px solid var(--border-light);
}

.progress-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.milestone-marker {
  position: absolute;
  top: -24px;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border-light);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* Two Columns Layout */
.finance-two-cols {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}

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

.currency-addon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

.quick-amount-tags {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.savings-history-wrapper {
  margin-top: 24px;
  border-top: 1px solid var(--border-light);
  padding-top: 18px;
}

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

.savings-table-scroll {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.data-table th {
  background: var(--surface-alt);
  padding: 10px 14px;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 10;
}

.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-main);
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tr:hover {
  background: var(--surface-hover);
}

.btn-del-sm {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.btn-del-sm:hover {
  color: var(--danger);
  background: var(--danger-light);
}

/* Expense Items List */
.expense-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.expense-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.expense-item-row:hover {
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.expense-meta {
  display: flex;
  flex-direction: column;
}

.expense-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.expense-note {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.expense-amount-side {
  display: flex;
  align-items: center;
  gap: 12px;
}

.expense-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
}

.expense-comparison-box {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-light);
}

.comp-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.comp-note {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-light);
  font-size: 0.78rem;
  color: var(--emerald);
  font-weight: 600;
}

/* ========================================================
   TAB 3: SỨC KHỎE TIỀN SẢN (HEALTH)
   ======================================================== */

.health-master-banner {
  display: flex;
  gap: 24px;
  align-items: center;
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 50%, #fefcfb 100%);
  border: 1px solid var(--emerald-border);
  padding: 26px 30px;
}

.health-hero-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--emerald-light);
  border: 2px solid var(--emerald-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  flex-shrink: 0;
}

.health-banner-content {
  flex: 1;
}

.health-badge-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  background: var(--surface-alt);
  color: var(--text-main);
}

.health-badge-label.safe {
  background: var(--emerald);
  color: #fff;
}

.health-badge-label.waiting {
  background: var(--amber);
  color: #fff;
}

.badge-status-dot {
  width: 8px;
  height: 8px;
  background-color: currentColor;
  border-radius: 50%;
}

.health-main-heading {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.health-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.health-timeline-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.ht-stat {
  display: flex;
  flex-direction: column;
}

.ht-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
}

.ht-val {
  font-size: 1.15rem;
  font-weight: 800;
}

/* Vaccine Grid */
.vaccine-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.vaccine-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  position: relative;
}

.vaccine-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(42, 134, 100, 0.4);
}

.vaccine-card.injected {
  border-left: 4px solid var(--emerald);
  background: #fdfdfd;
}

.vaccine-card.not-injected {
  border-left: 4px solid var(--border-light);
}

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

.v-name {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.v-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.v-badge.injected {
  background: var(--emerald-light);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

.v-badge.pending {
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

.v-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  flex: 1;
}

.v-details {
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.78rem;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.v-detail-row {
  display: flex;
  justify-content: space-between;
}

.v-card-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: auto;
}

/* Micronutrient Checklist Grid */
.supplement-checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

/* ========================================================
   TAB 4: BÀN GIAO & THAI SẢN (WORK)
   ======================================================== */

.handover-progress-box {
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
}

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

.hp-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.hp-percent {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--indigo);
}

.hp-meta-stats {
  display: flex;
  gap: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 12px;
  flex-wrap: wrap;
}

.text-amber { color: var(--amber); }

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
}

.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill {
  border: 1px solid var(--border-light);
  background: var(--surface);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  background: var(--surface-alt);
  color: var(--text-main);
}

.filter-pill.active {
  background: var(--indigo);
  color: #fff;
  border-color: var(--indigo);
}

/* Tasks List */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-item-card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: all var(--transition-fast);
}

.task-item-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: rgba(79, 70, 229, 0.3);
}

.task-main-col {
  flex: 1;
  min-width: 0;
}

.task-client-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  margin-bottom: 6px;
}

.task-desc {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.4;
}

.task-meta-line {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.task-actions-col {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.status-badge.PENDING {
  background: var(--surface-alt);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.status-badge.IN_PROGRESS {
  background: var(--amber-light);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}

.status-badge.COMPLETED {
  background: var(--emerald-light);
  color: var(--emerald);
  border: 1px solid var(--emerald-border);
}

/* Maternity Checklist Grid */
.maternity-checklist-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mat-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-alt);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mat-item:hover {
  background: var(--surface);
  border-color: var(--indigo-border);
}

.mat-item.checked {
  background: var(--emerald-light);
  border-color: var(--emerald-border);
}

.mat-item input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--emerald);
  margin-top: 3px;
  cursor: pointer;
}

.mat-content {
  flex: 1;
}

.mat-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.mat-item.checked .mat-title {
  text-decoration: line-through;
  color: var(--text-secondary);
}

.mat-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.mat-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--indigo);
  background: var(--indigo-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-top: 6px;
  display: inline-block;
}

/* ========================================================
   TAB 5: BẢO MẬT & PRD (PRD & COMPLIANCE)
   ======================================================== */

.compliance-card {
  background: linear-gradient(135deg, #fdfbfa 0%, #fff 100%);
}

.compliance-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.compliance-shield {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.compliance-rules-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.rule-box {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.rule-icon {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}

.rule-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
}

.rule-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.two-cols-equal {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.scope-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.85rem;
}

.scope-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.check-icon {
  color: var(--emerald);
  font-weight: 800;
  font-size: 1rem;
}

.data-manage-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

/* ========================================================
   MODALS & OVERLAYS
   ======================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(30, 25, 20, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  animation: fadeIn 0.15s ease-out;
}

.modal-dialog {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  animation: modalSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
}

.btn-modal-close {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.btn-modal-close:hover {
  color: var(--text-main);
  background: var(--surface-alt);
}

.modal-body {
  padding: 22px;
}

.safe-date-preview {
  background: var(--emerald-light);
  border: 1px solid var(--emerald-border);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  margin-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.safe-date-preview strong {
  color: var(--emerald);
  font-size: 1rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

/* ========================================================
   TOAST NOTIFICATIONS
   ======================================================== */

.toast-container {
  position: fixed;
  bottom: 84px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--text-main);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.25s ease-out forwards;
}

.toast.success {
  background: #1e3a2f;
  border-left: 4px solid var(--emerald);
}

.toast.error {
  background: #451a1a;
  border-left: 4px solid var(--danger);
}

.toast.info {
  background: #232a3b;
  border-left: 4px solid var(--indigo);
}

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

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

/* ========================================================
   MOBILE BOTTOM NAVIGATION
   ======================================================== */

.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-light);
  z-index: 999;
  justify-content: space-around;
  align-items: center;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.m-nav-item {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  flex: 1;
  height: 100%;
  transition: all var(--transition-fast);
}

.m-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.m-label {
  font-size: 0.68rem;
  font-weight: 700;
}

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

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

/* ========================================================
   RESPONSIVE BREAKPOINTS (LAPTOP & MOBILE OPTIMIZATION)
   ======================================================== */

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

  .finance-two-cols,
  .dashboard-split-row,
  .two-cols-equal {
    grid-template-columns: 1fr;
  }

  .kpi-banner-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .compliance-rules-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .desktop-nav-tabs {
    display: none;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .main-content {
    padding: 16px 14px 90px 14px;
  }

  .top-nav {
    padding: 0 16px;
    height: 60px;
  }

  .hero-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 18px;
  }

  .hero-stat-box {
    align-self: center;
    margin-top: 10px;
  }

  .form-grid-3,
  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 10px;
  }

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

  .task-item-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .task-actions-col {
    width: 100%;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
  }

  .vaccine-grid {
    grid-template-columns: 1fr;
  }

  .health-master-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 18px;
  }

  .card-top-action {
    flex-direction: column;
    align-items: stretch;
  }

  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 74px;
  }
}
