/* ============================================================
   TremorTrack Doctor Portal — Main CSS
   Design: Dark medical precision, steel-blue palette
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=Syne:wght@600;700;800&display=swap');

/* ── Design tokens ── */
:root {
  --navy:      #111214;
  --navy-mid:  #161819;
  --slate:     #1e2126;
  --slate-2:   #252a30;
  --slate-3:   #2d333b;
  --border:    rgba(255,255,255,0.07);
  --border-2:  rgba(255,255,255,0.12);

  --teal:      #6e98c8;
  --teal-dim:  rgba(110,152,200,0.12);
  --teal-glow: rgba(110,152,200,0.25);

  --text-1:    #e4e8f0;
  --text-2:    #8b96a8;
  --text-3:    #5a6475;

  --severe:   #ef4444;
  --medium:   #f97316;
  --small:    #eab308;
  --none-c:   #22c55e;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;

  --font-body: 'DM Sans', sans-serif;
  --font-head: 'Syne', sans-serif;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-modal: 0 20px 80px rgba(0,0,0,0.7);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  background: var(--navy);
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); cursor: pointer; border: none; background: none; }
input, select { font-family: var(--font-body); }
img, svg { display: block; }

/* ── Brand shared ── */
.brand-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  background: var(--teal-dim);
  border: 1px solid rgba(110,152,200,0.2);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  color: var(--text-1);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 0.93rem; font-weight: 500;
  border-radius: var(--radius-md);
  padding: 0.7rem 1.4rem;
  transition: all 0.2s ease;
  cursor: pointer;
}
.btn--primary {
  background: var(--teal);
  color: #0d1520;
  font-weight: 600;
  border: none;
  letter-spacing: 0.01em;
}
.btn--primary:hover { background: #82abda; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(110,152,200,0.35); }
.btn--primary:active { transform: translateY(0); }
.btn--ghost {
  background: var(--slate);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn--ghost:hover { background: var(--slate-2); color: var(--text-1); }

.btn-icon {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  transition: background 0.15s, color 0.15s;
}
.btn-icon:hover { background: var(--slate-2); color: var(--text-1); }

/* ── Alerts ── */
.alert {
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.alert--error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: #fca5a5;
}

/* ── Spinner ── */
.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}
.spin { animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-3);
  font-size: 0.9rem;
}

/* ── Grade badge ── */
.grade-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.75rem; font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
  text-transform: capitalize;
}
.grade-badge--severe  { background: rgba(239,68,68,0.12);   color: #f87171; }
.grade-badge--medium  { background: rgba(249,115,22,0.12);  color: #fb923c; }
.grade-badge--small   { background: rgba(234,179,8,0.12);   color: #facc15; }
.grade-badge--none    { background: rgba(34,197,94,0.10);   color: #4ade80; }

.grade-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
}
.grade-dot--severe  { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
.grade-dot--medium  { background: #f97316; }
.grade-dot--small   { background: #eab308; }
.grade-dot--none    { background: #22c55e; }

/* ── Card ── */
.card {
  background: var(--slate);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-3);
}
.empty-state svg { margin: 0 auto 12px; opacity: 0.3; }
.empty-state p { font-size: 0.9rem; }