/* ═══════════════════════════════════════════════════════
   HealthTracker — Premium Dark Clinical UI  v3.0
   Enhanced to match login page aesthetic
   ═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Core Palette */
  --bg-base:      #080c14;
  --bg-surface:   #0d1421;
  --bg-card:      #111827;
  --bg-card-hover:#141e2e;
  --bg-elevated:  #192233;
  --border:       rgba(99,174,255,0.10);
  --border-bright:rgba(99,174,255,0.22);

  /* Accent Colors */
  --teal:         #00d4aa;
  --teal-dim:     rgba(0,212,170,0.12);
  --teal-glow:    rgba(0,212,170,0.25);
  --blue:         #4fa8ff;
  --blue-dim:     rgba(79,168,255,0.12);
  --red:          #ff5b5b;
  --red-dim:      rgba(255,91,91,0.12);
  --orange:       #ff9a3c;
  --orange-dim:   rgba(255,154,60,0.12);
  --purple:       #a78bfa;
  --purple-dim:   rgba(167,139,250,0.12);
  --green:        #34d399;
  --green-dim:    rgba(52,211,153,0.12);
  --yellow:       #fbbf24;

  /* Text */
  --text-primary:  #e8f0fe;
  --text-secondary:#8ba3c7;
  --text-muted:    #4a6080;

  /* Sidebar */
  --sidebar-w: 240px;
  --sidebar-bg: #070b12;

  /* Misc */
  --radius:    12px;
  --radius-lg: 18px;
  --radius-sm: 8px;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.6);
  --transition: 0.2s ease;
}

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

html { font-size: 17px; }

body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-decoration: none; transition: color var(--transition); }
a:hover { color: #1fffc6; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 10px; }

/* ════════════════════════════════════════
   AUTH PAGES  (login / register)
════════════════════════════════════════ */
.auth-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
@media (max-width: 800px) {
  .auth-wrapper { grid-template-columns: 1fr; }
  .auth-left { display: none; }
}

/* LEFT PANEL — branding / illustration */
.auth-left {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 30% 40%, rgba(0,212,170,0.10) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 70% 70%, rgba(79,168,255,0.08) 0%, transparent 60%),
    #070b12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 32px;
}
.auth-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle 1px at 20% 30%, rgba(0,212,170,0.5) 0%, transparent 0%),
    radial-gradient(circle 1px at 60% 70%, rgba(79,168,255,0.4) 0%, transparent 0%),
    radial-gradient(circle 1px at 80% 20%, rgba(167,139,250,0.4) 0%, transparent 0%);
  opacity: 0.6;
}
.auth-illustration {
  position: relative;
  z-index: 1;
  width: 200px;
  height: 200px;
}
.auth-illustration svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 30px rgba(0,212,170,0.25));
}
.auth-brand-text {
  position: relative;
  z-index: 1;
  text-align: center;
}
.auth-brand-text h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}
.auth-brand-text p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 300px;
  line-height: 1.7;
}
.auth-feature-pills {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.auth-pill {
  padding: 8px 18px;
  border-radius: 20px;
  border: 1px solid var(--border-bright);
  background: rgba(13,20,33,0.7);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  backdrop-filter: blur(8px);
}
.auth-pill.teal { border-color: rgba(0,212,170,0.3); color: var(--teal); background: var(--teal-dim); }
.auth-pill.blue { border-color: rgba(79,168,255,0.3); color: var(--blue); background: var(--blue-dim); }
.auth-pill.purple { border-color: rgba(167,139,250,0.3); color: var(--purple); background: var(--purple-dim); }

/* RIGHT PANEL — form */
.auth-right {
  background:
    radial-gradient(ellipse 80% 60% at 80% 20%, rgba(79,168,255,0.04) 0%, transparent 60%),
    var(--bg-surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}
.auth-right-inner {
  width: 100%;
  max-width: 400px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}
.auth-logo-icon { font-size: 28px; }
.auth-logo-text {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.auth-logo-text span { color: var(--teal); }

.auth-welcome {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 6px;
}
.auth-title {
  font-size: 34px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.8px;
  line-height: 1.2;
}
.auth-subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 32px;
}

.auth-error {
  background: rgba(255,91,91,0.1);
  border: 1px solid rgba(255,91,91,0.3);
  color: #fca5a5;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}
.auth-success {
  background: rgba(52,211,153,0.1);
  border: 1px solid rgba(52,211,153,0.3);
  color: #6ee7b7;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
}

/* Legacy auth-card support */
.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(0,212,170,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 60%, rgba(79,168,255,0.05) 0%, transparent 60%),
    var(--bg-base);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg), 0 0 80px rgba(0,212,170,0.04);
}

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute;
  left: 14px;
  font-size: 16px;
  pointer-events: none;
  z-index: 1;
  opacity: 0.6;
}
.auth-input {
  width: 100%;
  padding: 13px 14px 13px 42px;
  background: rgba(25,34,51,0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.auth-input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}
.auth-input::placeholder { color: var(--text-muted); }

.auth-forgot {
  text-align: right;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: -6px;
}
.auth-forgot a { color: var(--text-secondary); }
.auth-forgot a:hover { color: var(--teal); }

.btn-auth {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--teal), #00b894);
  color: #070b12;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.2px;
  margin-top: 4px;
}
.btn-auth:hover {
  background: linear-gradient(135deg, #1fffc6, #00d4aa);
  box-shadow: 0 6px 24px rgba(0,212,170,0.35);
  transform: translateY(-1px);
}

.auth-demo {
  margin-top: 16px;
  padding: 14px 18px;
  background: rgba(13,20,33,0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.auth-demo-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.auth-demo-cred {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.auth-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-muted);
}
.auth-footer a { color: var(--teal); font-weight: 600; }

/* ════════════════════════════════════════
   APP LAYOUT
════════════════════════════════════════ */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow-y: auto;
  /* Glow line on the right edge */
  box-shadow: 1px 0 0 rgba(0,212,170,0.05), 4px 0 20px rgba(0,0,0,0.4);
}

/* Subtle top accent line */
.sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--teal), var(--blue), transparent);
  opacity: 0.6;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
}
.sidebar-logo-icon { font-size: 24px; }
.sidebar-logo-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}
.sidebar-logo-text span { color: var(--teal); }

.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 20px 6px;
}

.sidebar-nav { padding: 8px 12px 20px; flex: 1; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
  transition: all var(--transition);
  margin-bottom: 2px;
  cursor: pointer;
  position: relative;
}
.nav-item:hover {
  background: rgba(99,174,255,0.07);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--teal-dim);
  color: var(--teal);
  border: 1px solid rgba(0,212,170,0.18);
}
/* Glow dot on active item */
.nav-item.active::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--teal);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px var(--teal);
}
.nav-icon { font-size: 17px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; }

.sidebar-divider { height: 1px; background: var(--border); margin: 10px 0; }

.nav-item.danger:hover { color: var(--red); background: var(--red-dim); }

/* ── MAIN CONTENT ── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  /* subtle ambient background */
  background:
    radial-gradient(ellipse 50% 30% at 80% 10%, rgba(79,168,255,0.03) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 10% 80%, rgba(0,212,170,0.02) 0%, transparent 60%),
    var(--bg-base);
}

/* ── TOP HEADER ── */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: rgba(7,11,18,0.90);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-shrink: 0;
  /* subtle glow under the header */
  box-shadow: 0 1px 0 var(--border), 0 4px 20px rgba(0,0,0,0.3);
}
.top-header h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text-primary);
}
.top-header p {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 1px;
}
.header-actions { display: flex; align-items: center; gap: 12px; }
.btn-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 16px;
  transition: all var(--transition);
}
.btn-icon:hover { border-color: var(--teal); background: var(--teal-dim); box-shadow: 0 0 12px var(--teal-glow); }
.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--bg-base);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(0,212,170,0.2);
  transition: box-shadow var(--transition);
}
.avatar:hover { box-shadow: 0 0 0 3px rgba(0,212,170,0.4); }

/* ── PAGE CONTENT ── */
.page-content {
  padding: 28px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* ════════════════════════════════════════
   CARDS
════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.card:hover { border-color: var(--border-bright); box-shadow: 0 4px 24px rgba(0,0,0,0.3); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}
.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
}
.card-icon {
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--teal-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(0,212,170,0.1);
}
.card-icon.red    { background: var(--red-dim);    box-shadow: 0 0 12px rgba(255,91,91,0.1); }
.card-icon.blue   { background: var(--blue-dim);   box-shadow: 0 0 12px rgba(79,168,255,0.1); }
.card-icon.orange { background: var(--orange-dim); box-shadow: 0 0 12px rgba(255,154,60,0.1); }
.card-icon.purple { background: var(--purple-dim); box-shadow: 0 0 12px rgba(167,139,250,0.1); }

/* ════════════════════════════════════════
   STAT CARDS (Dashboard)
════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .stats-grid { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
/* Glass shimmer strip at the top of each stat card */
.stat-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  opacity: 0.5;
  transition: opacity var(--transition);
}
.stat-card.bp::after { background: linear-gradient(90deg, transparent, var(--blue), transparent); }
.stat-card.hr::after { background: linear-gradient(90deg, transparent, var(--red), transparent); }
.stat-card.wt::after { background: linear-gradient(90deg, transparent, var(--orange), transparent); }
.stat-card.bs::after { background: linear-gradient(90deg, transparent, var(--teal), transparent); }

.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity var(--transition);
}
.stat-card:hover {
  border-color: var(--border-bright);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.stat-card:hover::before { opacity: 1; }
.stat-card:hover::after { opacity: 1; }

.stat-card.bp::before  { background: linear-gradient(135deg, rgba(79,168,255,0.05), transparent); }
.stat-card.hr::before  { background: linear-gradient(135deg, rgba(255,91,91,0.05), transparent); }
.stat-card.wt::before  { background: linear-gradient(135deg, rgba(255,154,60,0.05), transparent); }
.stat-card.bs::before  { background: linear-gradient(135deg, rgba(0,212,170,0.05), transparent); }

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.stat-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.stat-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
}
.bp .stat-icon  { background: var(--blue-dim);   box-shadow: 0 0 16px rgba(79,168,255,0.15); }
.hr .stat-icon  { background: var(--red-dim);    box-shadow: 0 0 16px rgba(255,91,91,0.15); }
.wt .stat-icon  { background: var(--orange-dim); box-shadow: 0 0 16px rgba(255,154,60,0.15); }
.bs .stat-icon  { background: var(--teal-dim);   box-shadow: 0 0 16px rgba(0,212,170,0.15); }

.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin-bottom: 10px;
  font-family: 'JetBrains Mono', monospace;
}
.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-normal  { background: rgba(52,211,153,0.12); color: var(--green); border: 1px solid rgba(52,211,153,0.2); }
.badge-stable  { background: rgba(79,168,255,0.12); color: var(--blue);  border: 1px solid rgba(79,168,255,0.2); }
.badge-warning { background: rgba(251,191,36,0.12); color: var(--yellow);border: 1px solid rgba(251,191,36,0.2); }
.badge-danger  { background: rgba(255,91,91,0.12);  color: var(--red);   border: 1px solid rgba(255,91,91,0.2); }
.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* ════════════════════════════════════════
   BUTTONS
════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--teal), #00b894);
  color: var(--bg-base);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  letter-spacing: 0.2px;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1fffc6, #00d4aa);
  box-shadow: 0 4px 20px rgba(0,212,170,0.35);
  color: var(--bg-base);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-bright);
  color: var(--text-primary);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--red-dim);
  color: var(--red);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(255,91,91,0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-danger:hover { background: rgba(255,91,91,0.2); border-color: rgba(255,91,91,0.4); color: #fca5a5; }

.btn-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--blue-dim);
  color: var(--blue);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(79,168,255,0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-edit:hover { background: rgba(79,168,255,0.2); border-color: rgba(79,168,255,0.4); color: #93c5fd; }

.btn-view {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: rgba(167,139,250,0.1);
  color: var(--purple);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(167,139,250,0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-view:hover { background: rgba(167,139,250,0.18); color: #c4b5fd; }

.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ════════════════════════════════════════
   FORMS
════════════════════════════════════════ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }

.form-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  text-transform: uppercase;
}
.form-label .req { color: var(--red); margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  padding: 12px 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  width: 100%;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}
.form-input::placeholder { color: var(--text-muted); }
.form-select {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a6080' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
.form-select option { background: var(--bg-card); color: var(--text-primary); }
.form-textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  grid-column: 1 / -1;
  padding-top: 6px;
}

/* ════════════════════════════════════════
   ALERTS / FLASH
════════════════════════════════════════ */
.alert {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-success { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.25); color: #6ee7b7; }
.alert-error   { background: rgba(255,91,91,0.1);  border: 1px solid rgba(255,91,91,0.25);  color: #fca5a5; }
.alert-info    { background: var(--blue-dim); border: 1px solid rgba(79,168,255,0.25); color: #93c5fd; }

.errors-box {
  background: rgba(255,91,91,0.08);
  border: 1px solid rgba(255,91,91,0.2);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
  grid-column: 1 / -1;
}
.errors-box ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.errors-box li { color: #fca5a5; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.errors-box li::before { content: '✕'; font-size: 11px; }

/* ════════════════════════════════════════
   TABLE
════════════════════════════════════════ */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}
thead th:first-child { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
thead th:last-child  { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-card-hover); }
tbody td {
  padding: 15px 16px;
  color: var(--text-primary);
  vertical-align: middle;
}
.td-mono  { font-family: 'JetBrains Mono', monospace; font-size: 14px; color: var(--teal); }
.td-muted { color: var(--text-secondary); font-size: 14px; }
.td-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ════════════════════════════════════════
   BADGES / STATUS
════════════════════════════════════════ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.status-active    { background: rgba(52,211,153,0.12); color: var(--green); border: 1px solid rgba(52,211,153,0.2); }
.status-inactive  { background: rgba(74,96,128,0.2);   color: var(--text-muted); border: 1px solid rgba(74,96,128,0.3); }
.status-scheduled { background: rgba(79,168,255,0.12); color: var(--blue); border: 1px solid rgba(79,168,255,0.2); }
.status-completed { background: rgba(52,211,153,0.12); color: var(--green); border: 1px solid rgba(52,211,153,0.2); }
.status-cancelled { background: rgba(255,91,91,0.12);  color: var(--red); border: 1px solid rgba(255,91,91,0.2); }

/* ════════════════════════════════════════
   CHARTS
════════════════════════════════════════ */
.chart-wrapper { position: relative; height: 220px; }
.chart-legend {
  display: flex;
  gap: 18px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-secondary); }
.legend-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.legend-line { width: 20px; height: 3px; border-radius: 2px; flex-shrink: 0; }

/* ════════════════════════════════════════
   DASHBOARD SPECIFICS
════════════════════════════════════════ */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }

.diagnosis-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-group label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.field-input, .field-select {
  padding: 11px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field-input:focus, .field-select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}
.field-select option { background: var(--bg-card); }

.btn-analyze {
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--blue), #2563eb);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  transition: all var(--transition);
}
.btn-analyze:hover {
  box-shadow: 0 4px 20px rgba(79,168,255,0.35);
  transform: translateY(-1px);
}

/* ════════════════════════════════════════
   HEALTH RECORDS TABLE
════════════════════════════════════════ */
.page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.record-count { font-size: 14px; color: var(--text-muted); }
.record-count span { color: var(--teal); font-weight: 600; }

/* ════════════════════════════════════════
   MEDICATION CARDS
════════════════════════════════════════ */
.med-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.med-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.med-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,212,170,0.4), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.med-card:hover { border-color: var(--border-bright); transform: translateY(-2px); box-shadow: var(--shadow); }
.med-card:hover::before { opacity: 1; }

.med-icon-wrap {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--teal-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(0,212,170,0.1);
}
.med-info { flex: 1; min-width: 0; }
.med-name    { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.med-dosage  { font-size: 13px; color: var(--teal); font-family: 'JetBrains Mono', monospace; margin-bottom: 5px; }
.med-schedule{ font-size: 13px; color: var(--text-muted); }
.med-actions { display: flex; gap: 6px; margin-top: 12px; }
.med-status  { position: absolute; top: 14px; right: 14px; }

.refill-bar {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.refill-info { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 15px; }
.refill-info strong { color: var(--text-primary); }

/* ════════════════════════════════════════
   APPOINTMENTS
════════════════════════════════════════ */
.appt-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all var(--transition);
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}
.appt-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--blue), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.appt-card:hover { border-color: var(--border-bright); background: var(--bg-card-hover); }
.appt-card:hover::before { opacity: 1; }

.appt-date-badge {
  flex-shrink: 0;
  background: var(--blue-dim);
  border: 1px solid rgba(79,168,255,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: center;
  min-width: 64px;
  box-shadow: 0 0 16px rgba(79,168,255,0.1);
}
.appt-date-badge .month { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--blue); letter-spacing: 0.8px; }
.appt-date-badge .day   { font-size: 26px; font-weight: 700; color: var(--text-primary); line-height: 1.1; font-family: 'JetBrains Mono', monospace; }

.appt-info { flex: 1; min-width: 0; }
.appt-doctor   { font-size: 17px; font-weight: 700; color: var(--text-primary); margin-bottom: 3px; }
.appt-specialty{ font-size: 14px; color: var(--teal); margin-bottom: 6px; }
.appt-meta     { display: flex; gap: 14px; flex-wrap: wrap; }
.appt-meta span{ font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.appt-actions  { display: flex; gap: 8px; flex-shrink: 0; }

/* ════════════════════════════════════════
   PROGRESS / REPORTS
════════════════════════════════════════ */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 4px;
}
@media (max-width: 700px) { .summary-grid { grid-template-columns: 1fr; } }

.summary-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.summary-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
  opacity: 0;
  transition: opacity var(--transition);
}
.summary-card:hover { border-color: var(--border-bright); }
.summary-card:hover::after { opacity: 0.6; }

.summary-label { font-size: 11px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.summary-value { font-size: 32px; font-weight: 700; margin-bottom: 5px; font-family: 'JetBrains Mono', monospace; }
.summary-sub   { font-size: 13px; color: var(--text-muted); }

/* ════════════════════════════════════════
   REMINDERS
════════════════════════════════════════ */
.reminder-list { display: flex; flex-direction: column; gap: 10px; }
.reminder-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}
.reminder-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--teal);
  opacity: 0;
  transition: opacity var(--transition);
}
.reminder-item:hover { border-color: var(--border-bright); background: var(--bg-card-hover); }
.reminder-item:hover::before { opacity: 1; }

.reminder-icon-wrap {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: var(--teal-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.reminder-text { flex: 1; font-size: 15px; color: var(--text-primary); font-weight: 500; }
.reminder-time { font-size: 13px; color: var(--teal); font-family: 'JetBrains Mono', monospace; white-space: nowrap; }

.btn-add-reminder {
  margin-top: 16px;
  padding: 12px 20px;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-bright);
  border-radius: var(--radius-sm);
  color: var(--teal);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all var(--transition);
}
.btn-add-reminder:hover { background: var(--teal-dim); border-style: solid; box-shadow: 0 0 16px rgba(0,212,170,0.1); }

/* ════════════════════════════════════════
   PROFILE
════════════════════════════════════════ */
.profile-header {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}
.profile-avatar {
  width: 72px; height: 72px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 800;
  color: var(--bg-base);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(0,212,170,0.15), 0 8px 24px rgba(0,212,170,0.2);
}
.profile-name { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.profile-meta { display: flex; flex-direction: column; gap: 3px; }
.profile-meta span { font-size: 14px; color: var(--text-muted); }
.profile-divider { height: 1px; background: var(--border); margin: 20px 0; }
.profile-info-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.profile-info-row:last-child { border-bottom: none; }
.profile-info-icon { font-size: 18px; width: 24px; text-align: center; flex-shrink: 0; }
.profile-info-text { font-size: 15px; color: var(--text-primary); }

/* ════════════════════════════════════════
   SETTINGS
════════════════════════════════════════ */
.settings-section { margin-bottom: 26px; padding-bottom: 26px; border-bottom: 1px solid var(--border); }
.settings-section:last-of-type { border-bottom: none; }
.settings-section-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.checkbox-group { display: flex; flex-direction: column; gap: 10px; }
.checkbox-item { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; color: var(--text-secondary); }
.checkbox-item input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--teal); cursor: pointer; }
.checkbox-item:hover { color: var(--text-primary); }

/* ════════════════════════════════════════
   EMPTY STATE
════════════════════════════════════════ */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}
.empty-icon  { font-size: 44px; margin-bottom: 12px; opacity: 0.5; }
.empty-title { font-size: 17px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-sub   { font-size: 14px; margin-bottom: 20px; }

/* ════════════════════════════════════════
   RECORD VIEW DETAIL
════════════════════════════════════════ */
.vitals-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 700px) { .vitals-grid { grid-template-columns: repeat(2, 1fr); } }

.vital-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  transition: all var(--transition);
}
.vital-box:hover { border-color: var(--border-bright); }
.vital-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 8px; }
.vital-value { font-size: 26px; font-weight: 700; font-family: 'JetBrains Mono', monospace; margin-bottom: 4px; }
.vital-unit  { font-size: 12px; color: var(--text-muted); }

/* ════════════════════════════════════════
   UTILITY
════════════════════════════════════════ */
.text-teal   { color: var(--teal); }
.text-blue   { color: var(--blue); }
.text-red    { color: var(--red); }
.text-orange { color: var(--orange); }
.text-purple { color: var(--purple); }
.text-green  { color: var(--green); }
.text-muted  { color: var(--text-muted); }
.text-sm     { font-size: 14px; }
.text-xs     { font-size: 13px; }
.font-mono   { font-family: 'JetBrains Mono', monospace; }
.fw-700      { font-weight: 700; }

.mt-0  { margin-top: 0; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-0  { margin-bottom: 0; }
.mb-4  { margin-bottom: 4px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }

.d-flex          { display: flex; }
.gap-8           { gap: 8px; }
.gap-12          { gap: 12px; }
.gap-16          { gap: 16px; }
.align-center    { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap       { flex-wrap: wrap; }
.flex-1          { flex: 1; }

.divider { height: 1px; background: var(--border); margin: 18px 0; }

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 6px;
  transition: color var(--transition);
}
.page-back:hover { color: var(--teal); }

/* ════════════════════════════════════════
   GLOW ANIMATIONS
════════════════════════════════════════ */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-content > * {
  animation: fadeSlideIn 0.3s ease both;
}
.page-content > *:nth-child(1) { animation-delay: 0.05s; }
.page-content > *:nth-child(2) { animation-delay: 0.10s; }
.page-content > *:nth-child(3) { animation-delay: 0.15s; }
.page-content > *:nth-child(4) { animation-delay: 0.20s; }

/* Teal glow ring for important values */
.glow-teal { text-shadow: 0 0 20px rgba(0,212,170,0.4); }
.glow-blue  { text-shadow: 0 0 20px rgba(79,168,255,0.4); }
.glow-red   { text-shadow: 0 0 20px rgba(255,91,91,0.4); }