:root {
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --secondary: #64748B;
  --bg-main: #0F172A;
  --bg-card: #1E293B;
  --bg-input: #334155;
  --text-main: #F8FAFC;
  --text-muted: #94A3B8;
  --border: #334155;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --radius: 10px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
}

.navbar {
  background: var(--bg-card);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

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

.logo-icon {
  font-size: 1.75rem;
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.badge {
  background: rgba(37, 99, 235, 0.2);
  color: #60A5FA;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-weight: 600;
}

.badge-accent {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
}

.view-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 2rem;
}

.auth-card {
  max-width: 480px;
  margin: 5rem auto;
  background: var(--bg-card);
  padding: 2.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
}

.auth-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.sso-actions {
  margin-top: 2rem;
}

.dev-token-box {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  text-align: left;
}

.input-group {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

input[type="text"], input[type="email"] {
  width: 100%;
  padding: 0.65rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: 6px;
  font-size: 0.95rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.95rem;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary { background: var(--secondary); color: white; }
.btn-warning { background: var(--warning); color: #0F172A; }
.btn-success { background: var(--success); color: #0F172A; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-block { width: 100%; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }

.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 1.25rem 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

.quick-buttons {
  display: flex;
  gap: 1rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr 0.8fr;
  gap: 1.5rem;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-body {
  padding: 1.5rem;
  flex: 1;
  overflow-y: auto;
  max-height: 680px;
}

.timeline-item {
  position: relative;
  padding-left: 2rem;
  padding-bottom: 1.5rem;
  border-left: 2px solid var(--border);
}

.timeline-item:last-child {
  padding-bottom: 0;
  border-left: 2px solid transparent;
}

.timeline-badge {
  position: absolute;
  left: -0.75rem;
  top: 0;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.timeline-badge.meal { background: var(--primary); }
.timeline-badge.symptom { background: var(--warning); color: black; }

.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chip {
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #334155;
  color: white;
}

.chip-tag {
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.bristol-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.bristol-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.75rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  text-align: center;
}

.bristol-btn.active {
  background: var(--primary);
  border-color: #60A5FA;
}

.gas-levels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.gas-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 0.75rem 0.25rem;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  font-size: 0.85rem;
}

.gas-btn.active {
  background: var(--warning);
  color: black;
  font-weight: 700;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  width: 90%;
  max-width: 540px;
  padding: 1.5rem;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.provider-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--bg-input);
  border-radius: 6px;
  margin-bottom: 0.75rem;
}

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
