:root {
  --blue: #2563EB;
  --blue-dark: #1D4ED8;
  --green: #16A34A;
  --red: #DC2626;
  --purple: #9333EA;
  --orange: #EA580C;
  --ink: #1E293B;
  --muted: #64748B;
  --border: #E2E8F0;
  --bg: #F8FAFC;
  --white: #FFFFFF;
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

.screen {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  padding-bottom: 40px;
}

/* Colored page headers (Emergency=red, Hospital=purple, Drug=orange, Symptom=blue, Voice=green) */
.page-header {
  padding: 28px 24px 32px;
  color: var(--white);
}
.page-header.blue { background: var(--blue); }
.page-header.green { background: var(--green); }
.page-header.red { background: var(--red); }
.page-header.purple { background: var(--purple); }
.page-header.orange { background: var(--orange); }

.back-link {
  color: var(--white);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin-bottom: 18px;
}

.page-header h1 { margin: 0 0 6px; font-size: 1.7rem; }
.page-header p { margin: 0; opacity: 0.9; font-size: 0.95rem; }

main { padding: 20px; }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.card h2 { margin: 0 0 12px; font-size: 1.05rem; }

/* Dashboard feature tiles */
.tile {
  border-radius: var(--radius);
  padding: 32px 20px;
  text-align: center;
  color: var(--white);
  text-decoration: none;
  display: block;
  margin-bottom: 18px;
}
.tile .icon { font-size: 2rem; margin-bottom: 10px; }
.tile h3 { margin: 0 0 6px; font-size: 1.2rem; }
.tile p { margin: 0; opacity: 0.9; font-size: 0.9rem; }
.tile.blue { background: linear-gradient(135deg, var(--blue), #3B82F6); }
.tile.green { background: linear-gradient(135deg, var(--green), #22C55E); }
.tile.red { background: linear-gradient(135deg, var(--red), #EF4444); }
.tile.purple { background: linear-gradient(135deg, var(--purple), #A855F7); }
.tile.orange { background: linear-gradient(135deg, var(--orange), #F97316); }

/* Chips (symptom selector) */
.chip-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chip {
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  font-weight: 600;
  cursor: pointer;
  background: var(--white);
  color: var(--ink);
}
.chip.selected { border-color: var(--blue); background: #EFF6FF; color: var(--blue); }

button.primary {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--white);
  cursor: pointer;
  margin-top: 8px;
}
button.primary.blue { background: var(--blue); }
button.primary.green { background: var(--green); }
button.primary.red { background: var(--red); }
button.primary.purple { background: var(--purple); }
button.primary.orange { background: var(--orange); }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="time"], input[type="date"], select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px;
  font-size: 0.95rem;
  font-family: inherit;
  margin-bottom: 12px;
}

label { font-weight: 600; font-size: 0.9rem; display: block; margin-bottom: 6px; }

.disclaimer {
  background: #FEF3C7;
  color: #92400E;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.8rem;
  margin-top: 14px;
}

.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }

.badge { font-size: 0.7rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.badge.purple { background: #F3E8FF; color: var(--purple); }
.badge.green { background: #DCFCE7; color: var(--green); }

a.link { color: var(--purple); font-weight: 700; text-decoration: none; }

.delete-btn { color: var(--red); background: none; border: none; font-size: 1.2rem; cursor: pointer; }

.center-logo {
  text-align: center;
  padding: 60px 24px 30px;
}
.center-logo h1 { font-size: 2rem; margin: 0 0 8px; }
.center-logo p { color: var(--muted); margin: 0 0 30px; }

.hamburger {
  position: fixed;
  top: 16px;
  left: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
}

.side-menu {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 260px;
  background: var(--white);
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  z-index: 30;
  padding: 20px;
  box-shadow: 2px 0 12px rgba(0,0,0,0.1);
}
.side-menu.open { transform: translateX(0); }
.side-menu h2 { color: var(--purple); }
.side-menu .logout-btn {
  width: 100%; background: var(--purple); color: var(--white); border: none;
  border-radius: 10px; padding: 14px; font-weight: 700; margin-top: 20px; cursor: pointer;
}

.offline-pill {
  position: fixed;
  top: 16px; right: 16px;
  font-size: 0.7rem;
  padding: 5px 12px;
  border-radius: 999px;
  z-index: 20;
  font-weight: 600;
}
.offline-pill.online { background: #DCFCE7; color: var(--green); }
.offline-pill.offline { background: #FEE2E2; color: var(--red); }
