:root {
  /* Colors - Dark Mode Default */
  --bg-body: #09090b;
  --bg-card: #18181b;
  --bg-card-hover: #27272a;
  --bg-input: #27272a;
  
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  
  --border-subtle: #27272a;
  --border-active: #3f3f46;
  
  --accent-primary: #14b8a6; /* Teal for health/calm */
  --accent-secondary: #8b5cf6; /* Violet for secondary actions */
  --accent-alert: #f43f5e; /* Rose for alerts */
  --accent-success: #10b981; /* Emerald */
  
  --gradient-primary: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  --gradient-glow: linear-gradient(135deg, rgba(20, 184, 166, 0.2) 0%, rgba(13, 148, 136, 0.1) 100%);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-xxl: 48px;
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(20, 184, 166, 0.15);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: --bg-body;
  background: var(--bg-body);
  color: var(--text-primary);
  margin: 0;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

* {
  box-sizing: border-box;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  text-decoration: none;
  color: inherit;
}

/* Layout Utilities */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  width: 100%;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.w-full { width: 100%; }
.grid { display: grid; }

.mt-lg { margin-top: var(--space-lg); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-md { margin-bottom: var(--space-md); }

/* Navigation */
.navbar {
  background: rgba(9, 9, 11, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: var(--space-md) 0;
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
}

.nav-item {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-input);
}

.nav-item.active {
  color: var(--text-primary);
  background: var(--bg-input);
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.card:hover {
  border-color: var(--border-active);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

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

/* Profile Switcher */
.profile-switcher {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 4px;
  display: inline-flex;
}

.profile-option {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.profile-option.active {
  background: var(--bg-input);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Timeline & Routine */
.timeline-section {
  position: relative;
  padding-left: 24px;
  border-left: 2px solid var(--border-subtle);
  margin-left: 12px;
  padding-bottom: var(--space-xl);
}

.timeline-section:last-child {
  border-left: 2px solid transparent;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  background: var(--accent-primary);
  border-radius: 50%;
  position: absolute;
  left: -7px;
  top: 6px;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.2);
}

.timeline-dot.pending {
  background: var(--bg-card);
  border: 2px solid var(--text-muted);
  box-shadow: none;
}

.timeline-time {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
  display: block;
}

/* Medication Item */
.med-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--bg-input);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  border: 1px solid transparent;
  transition: all 0.2s;
}

.med-item:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
}

.med-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(20, 184, 166, 0.1);
  color: var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkbox-custom {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.checkbox-custom.checked {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* Placeholders */
.placeholder-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.placeholder-avatar.lg {
  width: 64px;
  height: 64px;
}

.placeholder-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
}

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

.form-label {
  display: block;
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}

.form-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
}

.form-row {
  display: flex;
  gap: var(--space-md);
}

.form-row > * {
  flex: 1;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(20, 184, 166, 0.4);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

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

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

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.05);
}

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

@media (max-width: 768px) {
  .grid-dashboard { grid-template-columns: 1fr; }
  .grid-cols-3 { grid-template-columns: 1fr; }
  .grid-cols-2 { grid-template-columns: 1fr; }
  .nav-links { display: none; } /* Simplified for mobile wireframe */
  
  /* Stack header elements on mobile */
  header.flex {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .profile-switcher {
    width: 100%;
    justify-content: center;
    margin-top: var(--space-sm);
  }
  
  .profile-option {
    flex: 1;
    text-align: center;
  }
}

/* Typography Utilities */
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent-primary); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }

/* Status Badges */
.badge {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.badge-warning { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.badge-alert { background: rgba(244, 63, 94, 0.2); color: #fb7185; }

/* Auth Layout */
.auth-layout {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-body);
  padding: var(--space-md);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-lg);
}

.auth-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.auth-logo {
  font-weight: 800;
  font-size: 1.75rem;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin-bottom: var(--space-sm);
}

/* Fab Button */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(20, 184, 166, 0.4);
  color: white;
  font-size: 24px;
  z-index: 50;
  cursor: pointer;
}
