/* ============================================================
   CuidaPeques — Design System
   "La salud de tus peques en un solo lugar"
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@700;800&family=Inter:wght@400;500;600&family=Nunito:wght@400;600;700;800&display=swap');

/* --- CSS Custom Properties (Design Tokens) --- */
:root {
  /* Colors */
  --primary: #8A5CF5; /* Vibrant Purple */
  --primary-light: #B598F7;
  --primary-dark: #6830ED;
  --secondary: #FF8FAB; /* Keep pink */
  --secondary-light: #FFB6C8;
  --accent-mint: #4ECDC4;
  --accent-mint-light: #A8E6E0;
  --accent-orange: #FFB347;
  --accent-orange-light: #FFD699;
  --accent-purple: #B39DDB;
  --accent-purple-light: #D1C4E9;
  --accent-red: #FF6B6B;
  --accent-red-light: #FFA8A8;
  --accent-green: #68D391;
  --accent-green-light: #A8E6C3;

  /* Backgrounds */
  --bg-main: #F5F7FF; /* Slightly purple/blue tinted very light background */
  --bg-card: #FFFFFF;
  --bg-input: #F7F8FC;
  --bg-overlay: rgba(0, 0, 0, 0.4);
  --bg-phone-frame: #2D1B69;

  /* Text */
  --text-primary: #2D3748;
  --text-secondary: #718096;
  --text-tertiary: #A0AEC0;
  --text-white: #FFFFFF;
  --text-danger: #E53E3E;

  /* Borders */
  --border-light: #EDF2F7;
  --border-default: #E2E8F0;
  --border-focus: var(--primary);

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-full: 50%;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(107, 157, 252, 0.06);
  --shadow-md: 0 4px 12px rgba(107, 157, 252, 0.10);
  --shadow-lg: 0 8px 30px rgba(107, 157, 252, 0.15);
  --shadow-xl: 0 12px 40px rgba(107, 157, 252, 0.20);
  --shadow-button: 0 4px 15px rgba(255, 143, 171, 0.35);
  --shadow-mint: 0 4px 15px rgba(78, 205, 196, 0.35);
  --shadow-card-hover: 0 8px 25px rgba(107, 157, 252, 0.18);

  /* Spacing */
  --space-2xs: 4px;
  --space-xs: 6px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-base: 16px;
  --space-lg: 20px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 40px;
  --space-4xl: 48px;

  /* Typography */
  --font-logo: 'Baloo 2', cursive;
  --font-heading: 'Nunito', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Font sizes */
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 22px;
  --text-3xl: 28px;
  --text-4xl: 36px;
  --text-5xl: 48px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --app-max-width: 430px;
  --header-height: 56px;
  --nav-height: 64px;
  --safe-bottom: max(20px, env(safe-area-inset-bottom, 0px));
}

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

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

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: linear-gradient(135deg, #E8EEFF 0%, #F5F0FF 50%, #FFF0F5 100%);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: var(--space-lg);
  overflow-x: hidden;
}

/* --- Phone Frame Container --- */
.phone-frame {
  width: 100%;
  max-width: var(--app-max-width);
  min-height: 85vh;
  min-height: 85dvh;
  background: var(--bg-main);
  border-radius: 40px;
  border: 4px solid var(--bg-phone-frame);
  box-shadow: var(--shadow-xl),
              inset 0 0 0 2px rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 20px);
}

/* Notch */
.phone-frame::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 130px;
  height: 28px;
  background: var(--bg-phone-frame);
  border-radius: 0 0 18px 18px;
  z-index: 100;
}

/* Status bar space */
.phone-frame::after {
  content: '';
  display: block;
  height: 44px;
  flex-shrink: 0;
}

/* --- App Content Area --- */
.app-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 var(--space-lg) var(--space-lg);
  padding-bottom: calc(var(--nav-height) + var(--space-lg));
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

.app-content::-webkit-scrollbar {
  width: 3px;
}
.app-content::-webkit-scrollbar-track {
  background: transparent;
}
.app-content::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 10px;
}

/* --- Header --- */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px var(--space-lg) var(--space-sm) var(--space-lg);
  min-height: calc(var(--header-height) + 5px);
  flex-shrink: 0;
  position: relative;
  z-index: 50;
}

.header-back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  font-size: 20px;
  color: var(--text-primary);
  cursor: pointer;
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}
.header-back:hover {
  background: var(--bg-input);
}

.header-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-2xl);
  color: var(--primary);
  text-align: center;
  flex: 1;
}

.header-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 2px solid var(--primary-light);
  flex-shrink: 0;
  cursor: pointer;
}

.header-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* --- Bottom Navigation --- */
.bottom-nav {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: var(--nav-height);
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  padding-bottom: var(--safe-bottom);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-xs) var(--space-sm);
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-tertiary);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
  min-width: 52px;
}

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

.nav-item .nav-icon {
  font-size: 22px;
  height: 26px;
  display: flex;
  align-items: center;
}

/* FAB center button */
.nav-fab {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
  border: none;
  color: white;
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-button);
  margin-top: -20px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  position: relative;
  z-index: 5;
}
.nav-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(255, 143, 171, 0.45);
}
.nav-fab:active {
  transform: scale(0.95);
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-base);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}
.card:hover {
  box-shadow: var(--shadow-md);
}
.card-elevated {
  box-shadow: var(--shadow-md);
}
.card-interactive {
  cursor: pointer;
}
.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}
.card-interactive:active {
  transform: translateY(0);
}

.card-highlighted {
  background: linear-gradient(135deg, rgba(78, 205, 196, 0.08) 0%, rgba(104, 211, 145, 0.05) 100%);
  border-color: var(--accent-mint-light);
}
.card-warning {
  background: linear-gradient(135deg, rgba(255, 179, 71, 0.08) 0%, rgba(255, 143, 171, 0.05) 100%);
  border-color: var(--accent-orange-light);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-xl);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-md);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--secondary) 0%, #FF6B8A 100%);
  color: var(--text-white);
  box-shadow: var(--shadow-button);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(255, 143, 171, 0.5);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(255, 143, 171, 0.3);
}

.btn-mint {
  background: linear-gradient(135deg, var(--accent-mint) 0%, #3CBEB6 100%);
  color: var(--text-white);
  box-shadow: var(--shadow-mint);
}
.btn-mint:hover {
  box-shadow: 0 6px 20px rgba(78, 205, 196, 0.5);
  transform: translateY(-1px);
}

.btn-outlined {
  background: transparent;
  color: var(--accent-mint);
  border: 2px solid var(--accent-mint);
}
.btn-outlined:hover {
  background: rgba(78, 205, 196, 0.08);
}

.btn-orange {
  background: linear-gradient(135deg, var(--accent-orange) 0%, #FFA030 100%);
  color: var(--text-white);
  box-shadow: 0 4px 15px rgba(255, 179, 71, 0.35);
}

.btn-purple {
  background: linear-gradient(135deg, var(--accent-purple) 0%, #9575CD 100%);
  color: var(--text-white);
  box-shadow: 0 4px 15px rgba(179, 157, 219, 0.35);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: var(--space-sm) var(--space-base);
  font-size: var(--text-sm);
  border-radius: var(--radius-lg);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
  font-size: 18px;
}

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

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

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: var(--space-md) var(--space-base);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--text-primary);
  background: var(--bg-input);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(107, 157, 252, 0.12);
  background: var(--bg-card);
}

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

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

.form-row {
  display: flex;
  gap: var(--space-sm);
}
.form-row > * {
  flex: 1;
}

.form-select {
  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 d='M6 8L1 3h10z' fill='%23718096'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

/* --- Toggle Switch --- */
.toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
}

.toggle-label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--text-primary);
}

.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--border-default);
  border-radius: 14px;
  cursor: pointer;
  transition: background var(--transition-fast);
  border: none;
  outline: none;
  flex-shrink: 0;
}

.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: var(--radius-full);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform var(--transition-fast);
}

.toggle:checked {
  background: var(--accent-mint);
}

.toggle:checked::after {
  transform: translateX(20px);
}

/* --- Pills & Chips --- */
.pill-group {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-xl);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  border: 1.5px solid var(--border-default);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.pill.active, .pill:hover {
  background: var(--primary);
  color: var(--text-white);
  border-color: var(--primary);
}

.pill-mint.active {
  background: var(--accent-mint);
  border-color: var(--accent-mint);
}

.pill-orange.active {
  background: var(--accent-orange);
  border-color: var(--accent-orange);
}

/* --- Tabs --- */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: var(--space-base);
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab {
  padding: var(--space-sm) var(--space-base);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  border: none;
  background: none;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color var(--transition-fast);
}

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

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2.5px;
  background: var(--primary);
  border-radius: 2px;
}

/* --- Avatar System --- */
.avatar-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.avatar-circle {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  position: relative;
  overflow: hidden;
  border: 3px solid var(--primary-light);
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.avatar-circle:hover {
  transform: scale(1.05);
}

.avatar-circle.sm {
  width: 40px;
  height: 40px;
  font-size: 20px;
  border-width: 2px;
}

.avatar-circle.lg {
  width: 100px;
  height: 100px;
  font-size: 50px;
  border-width: 3px;
}

.avatar-circle.xl {
  width: 120px;
  height: 120px;
  font-size: 60px;
  border-width: 4px;
}

/* Avatar SVG Inline Styles */
.avatar-svg {
  width: 100%;
  height: 100%;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-md);
  padding: var(--space-base);
}

.avatar-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2xs);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  transition: all var(--transition-fast);
}

.avatar-option:hover {
  background: var(--bg-input);
}

.avatar-option.selected {
  border-color: var(--primary);
  background: rgba(107, 157, 252, 0.08);
}

/* Symptom state avatars */
.avatar-symptom {
  position: relative;
}

.avatar-symptom .symptom-indicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--accent-red);
  color: white;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

/* --- Symptom Cards --- */
.symptom-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.symptom-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-base);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-light);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
}

.symptom-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.symptom-card.active {
  border-color: var(--primary);
  background: rgba(107, 157, 252, 0.05);
}

.symptom-card .symptom-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  transition: transform var(--transition-base);
}

.symptom-card.active .symptom-avatar {
  animation: symptomBounce 0.5s ease;
}

.symptom-card .symptom-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-xs);
  border: 2px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: transparent;
  transition: all var(--transition-fast);
}

.symptom-card.active .symptom-check {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.symptom-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-md);
  color: var(--text-primary);
}

/* --- Counter --- */
.counter {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.counter-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 2px solid var(--primary);
  background: var(--bg-card);
  color: var(--primary);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.counter-btn:hover {
  background: var(--primary);
  color: white;
}

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

.counter-value {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-3xl);
  color: var(--primary);
  min-width: 40px;
  text-align: center;
}

/* --- Temperature Display --- */
.temp-display {
  text-align: center;
  padding: var(--space-lg);
}

.temp-value {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-4xl);
  line-height: 1;
}

.temp-value.normal { color: var(--accent-green); }
.temp-value.elevated { color: var(--accent-orange); }
.temp-value.fever { color: var(--accent-red); }
.temp-value.high-fever { color: #C53030; }

.temp-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: var(--space-2xs);
}

.temp-unit-toggle {
  display: inline-flex;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 2px solid var(--primary);
}

.temp-unit-btn {
  padding: var(--space-xs) var(--space-lg);
  border: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-card);
  color: var(--primary);
}

.temp-unit-btn.active {
  background: var(--primary);
  color: white;
}

/* --- Chart Container --- */
.chart-container {
  position: relative;
  width: 100%;
  padding: var(--space-base);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
}

.chart-container canvas {
  max-height: 220px;
}

/* --- Dashboard Grid --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.dashboard-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl) var(--space-base);
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all var(--transition-base);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  text-decoration: none;
}

.dashboard-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.dashboard-card:active {
  transform: translateY(0);
}

.dashboard-card .card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.dashboard-card .card-label {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 19px;
  text-align: center;
}

/* Dashboard card color variants - Soft Pastel */
.dashboard-card[data-color="red"] { background: #FFE8EC; color: #2C3E50; }
.dashboard-card[data-color="orange"] { background: #FFF4D4; color: #2C3E50; }
.dashboard-card[data-color="mint"] { background: #E0F8EE; color: #2C3E50; }
.dashboard-card[data-color="purple"] { background: #F0E6FA; color: #2C3E50; }
.dashboard-card[data-color="blue"] { background: #E6F0FA; color: #2C3E50; }
.dashboard-card[data-color="peach"] { background: #FCE1CC; color: #2C3E50; }
.dashboard-card[data-color="lightgreen"] { background: #E8F8E6; color: #2C3E50; }
.dashboard-card[data-color="pink"] { background: #FAE6F0; color: #2C3E50; }
.dashboard-card[data-color="teal"] { background: #E6F8F8; color: #2C3E50; }

/* --- Record/List Items --- */
.record-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.record-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-base);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.record-item:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.record-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

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

.record-value {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-lg);
}

.record-meta {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.record-chevron {
  color: var(--text-tertiary);
  font-size: 16px;
  flex-shrink: 0;
}

/* --- Appointment Card --- */
.appointment-next {
  display: flex;
  gap: var(--space-base);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(78, 205, 196, 0.08), rgba(104, 211, 145, 0.05));
  border: 1.5px solid var(--accent-mint-light);
}

.appointment-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  background: var(--accent-mint);
  color: white;
}

.appointment-date-badge .month {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.appointment-date-badge .day {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-2xl);
  line-height: 1;
}

.appointment-date-badge .weekday {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  opacity: 0.85;
}

.appointment-info {
  flex: 1;
}

.appointment-info h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text-primary);
}

.appointment-info p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: 2px;
}

/* --- Alert Badge --- */
.alert-badge {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  margin-top: var(--space-sm);
}

.alert-badge-warning {
  background: rgba(255, 179, 71, 0.12);
  color: #B7791F;
}

.alert-badge-info {
  background: rgba(107, 157, 252, 0.12);
  color: var(--primary-dark);
}

.alert-badge-success {
  background: rgba(104, 211, 145, 0.12);
  color: #276749;
}

/* --- Dose Schedule --- */
.dose-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.dose-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-xl);
  font-size: var(--text-sm);
  font-weight: 600;
  background: rgba(255, 107, 107, 0.08);
  color: var(--accent-red);
  border: 1px solid rgba(255, 107, 107, 0.15);
}

.dose-chip.taken {
  background: rgba(104, 211, 145, 0.1);
  color: var(--accent-green);
  border-color: rgba(104, 211, 145, 0.2);
  text-decoration: line-through;
}

/* --- Calendar --- */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-base);
}

.calendar-nav-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--bg-input);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.calendar-nav-btn:hover {
  background: var(--border-default);
}

.calendar-month {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text-primary);
}

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

.calendar-weekday {
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  padding: var(--space-sm) 0;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.calendar-day:hover {
  background: var(--bg-input);
}

.calendar-day.today {
  background: var(--primary);
  color: white;
  font-weight: 700;
}

.calendar-day.selected {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.calendar-day.has-records::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--secondary);
}

.calendar-day.other-month {
  color: var(--text-tertiary);
  opacity: 0.4;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-base);
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  width: 100%;
  max-width: var(--app-max-width);
  max-height: 85vh;
  overflow-y: auto;
  padding: var(--space-xl);
  animation: slideUp 0.3s ease;
}

.modal-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-default);
  margin: 0 auto var(--space-lg);
}

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

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
  width: calc(var(--app-max-width) - 40px);
  max-width: 90vw;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--accent-green);
  pointer-events: auto;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
}

.toast-error { border-left-color: var(--accent-red); }
.toast-warning { border-left-color: var(--accent-orange); }
.toast-info { border-left-color: var(--primary); }

.toast-icon { font-size: 20px; flex-shrink: 0; }
.toast-message { font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); }

/* --- Nutrition Day Tabs --- */
.day-tabs {
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  -webkit-overflow-scrolling: touch;
}

.day-tab {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-xl);
  border: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  background: var(--bg-input);
  color: var(--text-secondary);
}

.day-tab.active {
  background: var(--accent-mint);
  color: white;
}

/* --- Meal Card --- */
.meal-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  margin-bottom: var(--space-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.meal-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--primary-light);
}

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

.meal-info {
  flex: 1;
}

.meal-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-md);
  color: var(--text-primary);
}

.meal-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: 1px;
}

/* --- Document Upload Cards --- */
.upload-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.upload-option {
  display: flex;
  align-items: center;
  gap: var(--space-base);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  border: 2px dashed var(--border-default);
  cursor: pointer;
  transition: all var(--transition-base);
  background: var(--bg-card);
}

.upload-option:hover {
  border-color: var(--primary);
  background: rgba(107, 157, 252, 0.03);
  box-shadow: var(--shadow-sm);
}

.upload-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.upload-info h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-md);
  color: var(--text-primary);
}

.upload-info p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* --- Profile Cards --- */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-xl) var(--space-base);
  border-radius: var(--radius-xl);
  border: 2px solid var(--border-light);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
}

.profile-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.profile-card.active {
  border-color: var(--primary);
  background: rgba(107, 157, 252, 0.04);
}

.profile-card .profile-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-md);
  color: var(--primary);
}

.profile-card .profile-age {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

.profile-add {
  border-style: dashed;
  border-color: var(--text-tertiary);
  color: var(--text-tertiary);
  justify-content: center;
}

.profile-add:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.profile-add-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: background var(--transition-fast);
}

.profile-add:hover .profile-add-icon {
  background: rgba(107, 157, 252, 0.1);
}

/* --- Ingredients Input (AI Fridge) --- */
.ingredient-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: var(--space-md);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  min-height: 48px;
  background: var(--bg-input);
  cursor: text;
}

.ingredient-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--accent-purple-light);
  color: #4A148C;
  font-size: var(--text-sm);
  font-weight: 600;
}

.ingredient-tag button {
  background: none;
  border: none;
  color: #7B1FA2;
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
}

.ingredient-input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: var(--text-base);
  flex: 1;
  min-width: 80px;
}

/* --- Section Title --- */
.section-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.section-subtitle {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* --- Divider --- */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-lg) 0;
}

/* --- Empty State --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-base);
  padding: var(--space-3xl) var(--space-xl);
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 64px;
  opacity: 0.6;
}

.empty-state .empty-text {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-md);
  color: var(--text-secondary);
}

/* --- Splash / Onboarding --- */
.splash-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 0 20px;
  text-align: center;
  gap: var(--space-xl);
}

.splash-logo {
  font-family: var(--font-logo);
  font-weight: 800;
  font-size: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent-mint), var(--accent-orange), var(--secondary));
  background-size: 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
}

.splash-tagline {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-lg);
  color: var(--text-secondary);
}

.language-selector {
  display: flex;
  gap: var(--space-md);
}

.language-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background: white;
  color: var(--text-primary);
  font-weight: 600;
  transition: all var(--transition-fast);
  width: 85px;
  height: 85px;
  font-family: var(--font-heading);
  font-size: var(--text-md);
}

.language-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.language-btn.selected {
  border-color: var(--primary);
  background: rgba(107, 157, 252, 0.06);
  box-shadow: var(--shadow-md);
}

.language-btn .flag {
  font-size: 36px;
}

/* --- PDF Date Range Selector --- */
.date-range {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.date-range .separator {
  font-weight: 700;
  color: var(--text-tertiary);
}

/* --- Spacer Utilities --- */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-base { margin-top: var(--space-base); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-base { margin-bottom: var(--space-base); }
.mb-lg { margin-bottom: var(--space-lg); }
.text-center { text-align: center; }
.text-sm { font-size: var(--text-sm); }
.text-secondary { color: var(--text-secondary); }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.hidden { display: none !important; }
.w-full { width: 100%; }

/* --- Animations --- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

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

@keyframes symptomBounce {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.15); }
  60% { transform: scale(0.95); }
}

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

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

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

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

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

.animate-fadeIn { animation: fadeIn 0.3s ease; }
.animate-slideDown { animation: slideDown 0.3s ease; }
.animate-pulse { animation: pulse 1.5s ease infinite; }

/* --- Loading Spinner --- */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-light);
  border-top-color: var(--primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

/* --- Responsive (larger screens) --- */
@media (min-width: 768px) {
  body {
    padding: var(--space-3xl);
  }

  .phone-frame {
    min-height: 88vh;
    min-height: 88dvh;
    max-height: 900px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 0;
    background: var(--bg-main);
  }

  .phone-frame {
    border-radius: 0;
    border: none;
    min-height: 100vh;
    min-height: 100dvh;
    box-shadow: none;
  }

  .phone-frame::before {
    display: none;
  }

  .phone-frame::after {
    height: 0;
  }
}

/* --- PRINT STYLES --- */
@media print {
  body { background: white !important; margin: 0; padding: 0; }
  .bottom-nav, .header, .header-back, .btn, .btn-icon, .temp-unit-toggle, .no-print { display: none !important; }
  .app-container { padding: 0; max-width: 100%; border: none; box-shadow: none; background: white; overflow: visible !important; min-height: auto; margin:0; width:100%; }
  .phone-frame { border: none !important; padding: 0 !important; background: transparent !important; border-radius: 0 !important; box-shadow: none !important; margin: 0 !important; width: 100% !important; max-width: 100% !important; }
  .phone-frame::before, .phone-frame::after { display: none !important; }
  .main-content { padding: 20px; overflow: visible !important; height: auto; }
  .card { box-shadow: none; border: 1px solid #eee; break-inside: avoid; margin-bottom: 20px; }
  .report-page-break { page-break-before: always; }
  .calendar-day { border: 1px solid #f0f0f0; }
}

/* --- CALENDAR/REPORT STYLES --- */
.report-title { color: var(--primary); font-size: 32px; font-weight: 800; margin-bottom: 20px; }
.report-child-card { display: flex; align-items: center; border: 1px solid #E2E8F0; border-radius: 16px; padding: 15px; margin-bottom: 20px; background:white; }
.report-child-info h3 { margin: 0; color: var(--primary); font-size: 20px; font-weight: 800; }
.report-child-info p { margin: 4px 0 0; color: var(--text-secondary); font-size: 14px; }

.cal-legend { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); padding: 10px 20px; border-top: 1px solid #f0f0f0; margin-top: 10px; }
.cal-legend-item { display: flex; align-items: center; gap: 5px; }
.cal-dot { width: 8px; height: 8px; border-radius: 50%; }

.cal-dots-container { display: flex; justify-content: center; gap: 3px; margin-top: 6px; height: 8px; }
.cal-dot-fever { background-color: #D11141; }
.cal-dot-symp { background-color: #F3CA20; }
.cal-dot-med { background-color: #00B159; }
.cal-dot-apt { background-color: #00AEDB; }

.summary-stats { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; margin-bottom: 20px; background:white; }
.stat-box .stat-num { font-size: 32px; font-weight: 900; margin-bottom: 5px; }
.stat-box .stat-label { font-size: 12px; color: var(--text-secondary); }

.stat-fever .stat-num { color: #D11141; }
.stat-symp .stat-num { color: #F3CA20; }
.stat-med .stat-num { color: #00B159; }
.stat-apt .stat-num { color: #00AEDB; }

.report-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 14px; background:white; }
.report-table th { text-align: left; padding: 10px; color: var(--primary); border-bottom: 1px dashed #ccc; font-weight: 700; }
.report-table td { padding: 15px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: top; }
.report-table td:first-child { color: var(--text-secondary); width: 60px; }

.calendar-day.selected { border: 2px solid var(--primary); box-shadow: 0 0 0 2px rgba(138, 92, 245, 0.2); background: white; font-weight: bold; border-radius: 12px; }
.calendar-day.has-events { font-weight: bold; }

/* --- AI FRIDGE STYLES --- */
.ai-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 15px; margin-top: 25px; }
.ai-back-btn { background: none; border: none; color: var(--primary); font-size: 24px; cursor: pointer; padding: 0; }
.ai-title { color: var(--primary); font-size: 28px; font-weight: 800; margin: 0; flex-grow: 1; text-align: center; }
.ai-subtitle { text-align: center; color: var(--text-secondary); margin-bottom: 25px; line-height: 1.5; font-size: 15px; }

.ai-ing-container { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.ai-ing-pill { background: #FFEDD5; color: #C2410C; border-radius: 20px; padding: 8px 16px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ai-ing-pill button { background: none; border: none; color: #C2410C; cursor: pointer; opacity: 0.6; padding: 0; font-size: 12px; }

.ai-input-wrapper { background: white; border: 1px solid #E2E8F0; border-radius: 16px; padding: 15px 20px; margin-bottom: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.ai-input-wrapper input { width: 100%; border: none; outline: none; font-size: 16px; color: var(--text-primary); }
.ai-input-wrapper input::placeholder { color: #A0AEC0; }
.ai-input-wrapper:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(138, 92, 245, 0.1); }

.btn-orange { background: linear-gradient(135deg, #FB923C, #F97316); color: white; border-radius: 30px; font-size: 18px; padding: 16px; box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3); }

.recipe-card { background: white; border-radius: 16px; padding: 16px; margin-bottom: 15px; display: flex; align-items: center; gap: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.03); border-left: 6px solid #FB923C; cursor: pointer; }
.recipe-icon { width: 50px; height: 50px; background: #F8FAFC; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; flex-shrink: 0; }
.recipe-info { flex-grow: 1; }
.recipe-title { color: #1E1B4B; font-size: 18px; font-weight: 800; margin-bottom: 6px; line-height: 1.2; }
.recipe-meta { display: flex; align-items: center; gap: 10px; color: #64748B; font-size: 13px; }
.recipe-meta span { display: flex; align-items: center; gap: 4px; }


/* --- Toggle Switch (Notifications) --- */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

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

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 28px;
  transition: 0.3s;
}

.toggle-slider:before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

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

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* --- Symptom Grid 3 columns (with mocos) --- */
.symptom-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

/* ============================================================
   CALENDAR / REPORT REDESIGN STYLES
   ============================================================ */

/* Child card at top of reports */
.cal-child-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border-light);
  margin-bottom: 16px;
  box-shadow: 0 2px 12px rgba(107,157,252,0.07);
}

.cal-child-avatar {
  flex-shrink: 0;
}

.cal-child-info {
  flex: 1;
  min-width: 0;
}

.cal-child-name {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: var(--text-lg);
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cal-child-hint {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.3;
}

.cal-pdf-btn {
  flex-shrink: 0;
  padding: 8px 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-xl);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(107,157,252,0.3);
}

.cal-pdf-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.cal-pdf-btn:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

/* New calendar day cells */
.calendar-day-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 2px 4px;
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
  min-height: 44px;
  aspect-ratio: auto;
}

.calendar-day-new:hover {
  background: rgba(107, 157, 252, 0.08);
}

.calendar-day-new.today > span {
  background: var(--primary);
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.calendar-day-new.selected {
  background: rgba(107, 157, 252, 0.15);
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.calendar-day-new.in-range {
  background: rgba(107, 157, 252, 0.08);
  border-radius: 4px;
}

.calendar-day-new.other-month {
  visibility: hidden;
}

/* Calendar legend */
.cal-legend {
  display: flex;
  justify-content: space-around;
  padding: 12px 8px 4px;
  border-top: 1px solid var(--border-light);
  margin-top: 8px;
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.cal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

/* Stats grid */
.cal-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.cal-stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 14px 12px;
  text-align: center;
  border: 1.5px solid var(--border-light);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.cal-stat-num {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 32px;
  color: var(--stat-color, var(--primary));
  line-height: 1;
  margin-bottom: 4px;
}

.cal-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  line-height: 1.3;
}

/* ============================================================
   SYMPTOM CARDS — Large 2-column layout
   ============================================================ */

.symptom-grid-2col {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.symptom-card-lg {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 2px solid var(--border-light);
  cursor: pointer;
  transition: all var(--transition-base);
  min-height: 170px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.symptom-card-lg:hover,
.symptom-card-lg.active {
  border-color: var(--primary);
  background: rgba(107, 157, 252, 0.06);
  box-shadow: 0 4px 20px rgba(107, 157, 252, 0.2);
  transform: translateY(-2px);
}

/* Full-width last card (Otros) */
.symptom-card-full {
  grid-column: 1 / -1;
  flex-direction: row;
  gap: 20px;
  padding: 20px 24px;
  min-height: 110px;
  justify-content: flex-start;
}

.symptom-card-full .symptom-name-lg {
  font-size: 20px;
}

/* Checkbox in top-right corner */
.symptom-check-box {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-default);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.symptom-check-mark {
  color: white;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.symptom-card-lg.active .symptom-check-box {
  background: var(--primary);
  border-color: var(--primary);
}

.symptom-card-lg.active .symptom-check-mark {
  opacity: 1;
}

/* Avatar wrapper with purple circle border */
.symptom-avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  border-radius: 50%;
  border: 3px solid rgba(107, 157, 252, 0.35);
  background: rgba(107, 157, 252, 0.06);
}

.symptom-card-lg.active .symptom-avatar-wrap {
  border-color: var(--primary);
}

/* Symptom name */
.symptom-name-lg {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
  text-align: center;
}

/* ============================================================
   SETTINGS PAGE STYLES
   ============================================================ */

.settings-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--border-light);
  padding: 18px 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}

/* Plan badges */
.settings-plan-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
}

.settings-plan-free {
  background: rgba(0,0,0,0.06);
  color: var(--text-secondary);
}

.settings-plan-premium {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: white;
}

/* Premium gold button */
.settings-btn-premium {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #FFC947, #FF9800);
  color: white;
  border: none;
  border-radius: 50px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255, 152, 0, 0.35);
  transition: all var(--transition-fast);
  display: block;
  text-align: center;
}

.settings-btn-premium:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.45);
}

/* Outline button (default teal) */
.settings-btn-outline {
  width: 100%;
  padding: 13px 20px;
  background: transparent;
  color: var(--accent-mint);
  border: 2px solid var(--accent-mint);
  border-radius: 50px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: block;
  text-align: center;
}

.settings-btn-outline:hover {
  background: rgba(104, 211, 145, 0.08);
}

.settings-btn-teal {
  color: var(--accent-mint);
  border-color: var(--accent-mint);
}

.settings-btn-red {
  color: var(--accent-red);
  border-color: var(--accent-red);
}

.settings-btn-red:hover {
  background: rgba(255, 107, 107, 0.06);
}

/* Pill group for language/unit */
.settings-pill-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.settings-pill {
  padding: 8px 16px;
  border-radius: 50px;
  border: 2px solid var(--border-default);
  background: var(--bg-input);
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.settings-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(107, 157, 252, 0.3);
}

/* Premium active banner */
.settings-premium-active {
  background: linear-gradient(135deg, rgba(255, 201, 71, 0.12), rgba(255, 152, 0, 0.08));
  border: 1.5px solid #FFD700;
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #D4870A;
  margin-bottom: 12px;
  text-align: center;
}

/* Locked banner (free plan restriction) */
.settings-locked-banner {
  background: rgba(0,0,0,0.04);
  border: 1.5px dashed var(--border-default);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  text-align: center;
}

/* Link code display */
.link-code-display {
  background: linear-gradient(135deg, rgba(107, 157, 252, 0.08), rgba(104, 211, 145, 0.06));
  border: 2px solid var(--primary);
  border-radius: var(--radius-xl);
  padding: 20px;
  text-align: center;
  margin-bottom: 12px;
}

.link-code-display.link-code-used {
  border-color: var(--border-default);
  background: var(--bg-input);
  opacity: 0.7;
}

.link-code-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.link-code-value {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 8px;
  color: var(--primary);
  margin-bottom: 6px;
}

.link-code-display.link-code-used .link-code-value {
  color: var(--text-secondary);
  text-decoration: line-through;
}

.link-code-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Linked badge */
.settings-linked-badge {
  background: rgba(104, 211, 145, 0.1);
  border: 1.5px solid var(--accent-mint);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
  font-size: 13px;
  color: var(--accent-mint);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }

/* ==================== DELETE ACCOUNT MODAL ==================== */
.settings-btn-danger {
  background: transparent;
  color: #DC3545;
  border: 2px solid #DC3545;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s ease;
}
.settings-btn-danger:hover {
  background: #DC3545;
  color: white;
}

.delete-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.delete-modal-box {
  background: var(--bg-card, #fff);
  border-radius: 20px;
  padding: 28px 24px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalSlideUp 0.3s ease;
}

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

/* ==================== NUTRITION DISCLAIMER & SOURCES ==================== */
.nutrition-disclaimer {
  background: rgba(255, 193, 7, 0.1);
  border: 1px solid rgba(255, 193, 7, 0.3);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 16px;
  text-align: center;
}
.nutrition-disclaimer p {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}
.nutrition-disclaimer strong {
  color: var(--text-primary, #333);
}

.nutrition-sources {
  background: rgba(107, 157, 252, 0.06);
  border: 1px solid rgba(107, 157, 252, 0.15);
  border-radius: 14px;
  padding: 16px 18px;
  margin-top: 20px;
}
.nutrition-sources-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--primary);
  margin-bottom: 8px;
}
.nutrition-sources p {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 8px 0;
}
.nutrition-sources ul {
  list-style: none;
  padding: 0;
  margin: 0 0 8px 0;
}
.nutrition-sources li {
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid rgba(107, 157, 252, 0.1);
}
.nutrition-sources li:last-child {
  border-bottom: none;
}
.nutrition-sources a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.nutrition-sources a:hover {
  text-decoration: underline;
}
