:root {
  /* Font Families */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Light Theme Variables */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-glass: rgba(255, 255, 255, 0.85);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  
  --border-light: #e2e8f0;
  --border-ultra-light: #f1f5f9;
  
  --color-primary: #0f172a;
  --color-primary-hover: #1e293b;
  
  --color-indigo: #6366f1;
  --color-indigo-light: #e0e7ff;
  --color-indigo-text: #4338ca;

  --color-blue: #3b82f6;
  --color-blue-light: #eff6ff;
  --color-blue-text: #1d4ed8;

  --color-purple: #a855f7;
  --color-purple-light: #f3e8ff;
  --color-purple-text: #7e22ce;

  --color-emerald: #10b981;
  --color-emerald-light: #ecfdf5;
  --color-emerald-text: #047857;

  --color-amber: #f59e0b;
  --color-amber-light: #fffbeb;
  --color-amber-text: #b45309;

  --color-red: #ef4444;
  --color-red-light: #fef2f2;
  --color-red-text: #b91c1c;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.08);
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  
  color-scheme: light dark;
}

/* Dark Theme Variables Override (System setting fallback) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-app: #0b0f19;
    --bg-card: #151d30;
    --bg-card-glass: rgba(21, 29, 48, 0.85);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-inverse: #0f172a;
    
    --border-light: #1e293b;
    --border-ultra-light: #1a2337;
    
    --color-primary: #f1f5f9;
    --color-primary-hover: #e2e8f0;
    
    --color-indigo-light: rgba(99, 102, 241, 0.15);
    --color-indigo-text: #818cf8;

    --color-blue-light: rgba(59, 130, 246, 0.15);
    --color-blue-text: #60a5fa;

    --color-purple-light: rgba(168, 85, 247, 0.15);
    --color-purple-text: #c084fc;

    --color-emerald-light: rgba(16, 185, 129, 0.15);
    --color-emerald-text: #34d399;

    --color-amber-light: rgba(245, 158, 11, 0.15);
    --color-amber-text: #fbbf24;

    --color-red-light: rgba(239, 68, 68, 0.15);
    --color-red-text: #f87171;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
  }
}

/* Explicit Light Theme Selection via documentElement attribute */
html[data-theme="light"] {
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-glass: rgba(255, 255, 255, 0.85);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-inverse: #ffffff;
  --border-light: #e2e8f0;
  --border-ultra-light: #f1f5f9;
  --color-primary: #0f172a;
  --color-primary-hover: #1e293b;
  
  --color-indigo-light: #e0e7ff;
  --color-indigo-text: #4338ca;
  --color-blue-light: #eff6ff;
  --color-blue-text: #1d4ed8;
  --color-purple-light: #f3e8ff;
  --color-purple-text: #7e22ce;
  --color-emerald-light: #ecfdf5;
  --color-emerald-text: #047857;
  --color-amber-light: #fffbeb;
  --color-amber-text: #b45309;
  --color-red-light: #fef2f2;
  --color-red-text: #b91c1c;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.08);
}

/* Explicit Dark Theme Selection via documentElement attribute */
html[data-theme="dark"] {
  --bg-app: #0b0f19;
  --bg-card: #151d30;
  --bg-card-glass: rgba(21, 29, 48, 0.85);
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;
  --border-light: #1e293b;
  --border-ultra-light: #1a2337;
  --color-primary: #f1f5f9;
  --color-primary-hover: #e2e8f0;
  
  --color-indigo-light: rgba(99, 102, 241, 0.15);
  --color-indigo-text: #818cf8;
  --color-blue-light: rgba(59, 130, 246, 0.15);
  --color-blue-text: #60a5fa;
  --color-purple-light: rgba(168, 85, 247, 0.15);
  --color-purple-text: #c084fc;
  --color-emerald-light: rgba(16, 185, 129, 0.15);
  --color-emerald-text: #34d399;
  --color-amber-light: rgba(245, 158, 11, 0.15);
  --color-amber-text: #fbbf24;
  --color-red-light: rgba(239, 68, 68, 0.15);
  --color-red-text: #f87171;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  padding: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Helper Utilities */
.hidden {
  display: none !important;
}

.text-indigo { color: var(--color-indigo); }
.text-purple { color: var(--color-purple); }
.text-blue { color: var(--color-blue); }
.text-emerald { color: var(--color-emerald); }
.text-amber { color: var(--color-amber); }
.text-red { color: var(--color-red); }

.bg-emerald { background-color: var(--color-emerald); }
.bg-amber { background-color: var(--color-amber); }
.bg-red { background-color: var(--color-red); }

.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.mt-4 { margin-top: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }

/* Grid Layout */
.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.app-header {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem 2rem;
  box-shadow: var(--shadow-sm);
}

.header-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon-wrapper {
  background: var(--color-indigo-light);
  color: var(--color-indigo);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon {
  width: 1.5rem;
  height: 1.5rem;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

.logo-subtext {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.target-badge {
  background: var(--color-blue-light);
  border: 1px solid var(--border-light);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  display: flex;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.target-label {
  color: var(--text-muted);
}

.target-value {
  color: var(--color-blue-text);
}

/* Theme Toggle Button */
.icon-button {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  transition: background-color 0.2s, border-color 0.2s;
}

.icon-button:hover {
  background: var(--border-ultra-light);
}

/* Toggle Sun/Moon icon visibility based on data-theme */
html[data-theme="dark"] .sun-icon { display: block; }
html[data-theme="dark"] .moon-icon { display: none; }
html:not([data-theme="dark"]) .sun-icon { display: none; }
html:not([data-theme="dark"]) .moon-icon { display: block; }

.sun-icon, .moon-icon {
  width: 1.2rem;
  height: 1.2rem;
}

/* Card Component */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  border-color: rgba(99, 102, 241, 0.2);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.card-title-small {
  font-size: 1rem;
  font-weight: 700;
}

.title-icon {
  width: 1.5rem;
  height: 1.5rem;
}

/* Layout Grid */
.app-grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 2rem;
}

.grid-col {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Log Form Styling */
.log-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
}

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

.form-input {
  width: 100%;
  padding: 0.85rem 1.25rem;
  padding-right: 3rem;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-light);
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus {
  border-color: var(--color-indigo);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.input-suffix {
  position: absolute;
  right: 1.25rem;
  font-weight: 700;
  color: var(--text-muted);
  pointer-events: none;
}

/* Habit Toggle Buttons */
.habit-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.habit-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-main);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
}

.habit-toggle-btn:hover {
  border-color: var(--text-muted);
  transform: translateX(2px);
}

.btn-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.habit-icon {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

.status-circle {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--border-light);
  transition: color 0.2s;
}

.status-check {
  width: 1.25rem;
  height: 1.25rem;
  display: none;
}

.habit-toggle-btn.active[data-habit="cardio"] {
  background-color: var(--color-emerald-light);
  border-color: var(--color-emerald);
  color: var(--color-emerald-text);
}
.habit-toggle-btn.active[data-habit="strength"] {
  background-color: var(--color-amber-light);
  border-color: var(--color-amber);
  color: var(--color-amber-text);
}
.habit-toggle-btn.active[data-habit="deficit"] {
  background-color: var(--color-red-light);
  border-color: var(--color-red);
  color: var(--color-red-text);
}
.habit-toggle-btn.active[data-habit="protein"] {
  background-color: var(--color-purple-light);
  border-color: var(--color-purple);
  color: var(--color-purple-text);
}

.habit-toggle-btn.active .habit-icon {
  color: inherit;
}

.habit-toggle-btn.active .status-circle {
  display: none;
}

.habit-toggle-btn.active .status-check {
  display: block;
  color: inherit;
}

/* Button UI */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.95rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  outline: none;
  border: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.btn-primary {
  background-color: var(--color-primary);
  color: var(--bg-card);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.btn-primary:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-secondary {
  background-color: var(--color-indigo-light);
  color: var(--color-indigo-text);
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
}

.btn-secondary:hover {
  background-color: var(--color-indigo);
  color: #ffffff;
}

.btn-icon {
  width: 1rem;
  height: 1rem;
}

.btn-text-danger {
  background: transparent;
  color: var(--color-red);
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
}

.btn-text-danger:hover {
  background: var(--color-red-light);
  text-decoration: underline;
}

/* Recent Logs History List */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

/* Custom Scrollbar for list container */
.history-list::-webkit-scrollbar {
  width: 6px;
}
.history-list::-webkit-scrollbar-track {
  background: var(--border-ultra-light);
  border-radius: 4px;
}
.history-list::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}
.history-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1.25rem;
  background-color: var(--border-ultra-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.history-item:hover {
  border-color: var(--text-muted);
  transform: translateX(1px);
}

.history-item-date {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.history-item-weight {
  font-size: 1.125rem;
  font-weight: 900;
  color: var(--text-main);
}

.history-item-meta {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.history-item-dots {
  display: flex;
  gap: 0.25rem;
}

.history-item-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.history-item-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background-color 0.2s;
}

.history-item-delete:hover {
  color: var(--color-red);
  background-color: var(--color-red-light);
}

.history-item-delete svg {
  width: 1.1rem;
  height: 1.1rem;
}

/* Card Header Utility */
.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

/* Empty States */
.results-empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-md);
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.empty-state-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Experiment Results Dashboard */
.dashboard-intro {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.highlight-text {
  font-weight: 700;
  color: var(--text-main);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.metric-card {
  background: var(--border-ultra-light);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.metric-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}

.metric-value {
  font-size: 1.35rem;
  font-weight: 900;
}

.metric-confidence {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

/* Highlighted Combined Card */
.metric-card.highlight {
  background-color: var(--color-indigo-light);
  border-color: rgba(99, 102, 241, 0.2);
}

.metric-card.highlight .metric-label {
  color: var(--color-indigo);
}

.metric-card.highlight .metric-value {
  color: var(--color-indigo-text);
}

.metric-card.highlight.full-width {
  grid-column: span 2;
}


/* Weight chart styling */
.chart-container {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  margin-top: 1rem;
}

.chart-svg {
  display: block;
  width: 100%;
  min-width: 600px;
  overflow: visible;
}

.chart-line {
  fill: none;
  stroke: var(--color-blue);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-point {
  fill: var(--color-blue);
  stroke: var(--bg-card);
  stroke-width: 2.5;
  transition: r 0.2s ease, fill 0.2s ease;
  cursor: pointer;
}

.chart-point:hover {
  r: 7.5;
  fill: var(--color-indigo);
}

.chart-grid-line {
  stroke: var(--border-light);
  stroke-width: 1;
  stroke-dasharray: 4, 4;
}

.chart-text {
  fill: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
}

.chart-text-y {
  text-anchor: end;
}

.chart-text-x {
  text-anchor: middle;
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.legend-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

/* Footer Styling */
.app-footer {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2rem;
  border-top: 1px solid var(--border-light);
  padding-top: 1.5rem;
}

/* Settings Styles */
.settings-interventions-inputs {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.sub-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.form-label-sub {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.form-input-sub {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input-sub:focus {
  border-color: var(--color-indigo);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.divider {
  height: 1px;
  background-color: var(--border-light);
  margin: 1.75rem 0;
}

.share-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.card-title-sub {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.share-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.share-buttons .btn {
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
}

.import-group {
  display: flex;
  width: 100%;
}

.import-group .btn {
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
}

.hidden-file-input {
  display: none !important;
}

.file-input-label {
  cursor: pointer;
  width: 100%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

/* Tab panes layout (shown by default on desktop) */
@media (min-width: 769px) {
  .tab-pane {
    display: flex !important;
    flex-direction: column;
    gap: 2rem;
  }
  
  .mobile-nav {
    display: none !important;
  }
}

/* Responsive and Mobile Navigation adjustments */
@media (max-width: 900px) {
  .app-grid {
    grid-template-columns: 1fr;
  }
  
  .app-container {
    padding: 1rem;
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  /* Mobile Safe Area App Container Padding */
  .app-container {
    padding-top: 0; /* Let the sticky header handle safe-area padding */
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: calc(85px + env(safe-area-inset-bottom)); /* Clear bottom navbar */
  }

  /* Mobile Sticky Header below status bar / notch */
  .app-header {
    position: sticky;
    top: 0;
    z-index: 999;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    background: var(--bg-card-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    margin: 0 -1rem 1rem -1rem;
    padding: calc(1rem + env(safe-area-inset-top)) 1.25rem 1rem 1.25rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
  }

  .logo-text {
    font-size: 1.35rem;
  }

  .logo-subtext {
    font-size: 0.75rem;
  }

  /* Tab switching layout on mobile */
  .tab-pane {
    display: none;
    width: 100%;
  }

  .tab-pane.active {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  /* Glassmorphic Mobile Bottom Navbar */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(65px + env(safe-area-inset-bottom));
    background: var(--bg-card-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-light);
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 1000;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
  }

  .mobile-nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    cursor: pointer;
    flex: 1;
    height: 100%;
    padding: 0.5rem 0;
    transition: color 0.2s, transform 0.15s ease;
    font-family: var(--font-sans);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .mobile-nav-btn svg {
    width: 1.35rem;
    height: 1.35rem;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  .mobile-nav-btn:active svg {
    transform: scale(0.85);
  }

  .mobile-nav-btn.active {
    color: var(--color-indigo);
  }

  .mobile-nav-btn.active svg {
    transform: translateY(-2px) scale(1.1);
    color: var(--color-indigo);
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }
  
  .metric-card.highlight.full-width {
    grid-column: span 1;
  }
}

@media (max-width: 600px) {
  .header-main {
    flex-direction: row; /* Keep horizontal alignment on mobile */
    align-items: center;
  }
  
  .header-actions {
    gap: 0.5rem;
  }

  .target-badge {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
  }
}
