/* =======================
   DASHBOARD — Clinician Overview
   Matches LinguaCare sage/cream brand
   ======================= */

.dash-nav {
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--divider);
  background: var(--bg);
}
.dash-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.02em;
  text-decoration: none;
}
.dash-nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}
.dash-nav-link {
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.dash-nav-link:hover { color: var(--fg); }
.dash-nav-current {
  font-size: 0.875rem;
  color: var(--accent);
  font-weight: 600;
}

/* =======================
   MAIN CONTENT
   ======================= */
.dash-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}

.dash-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--divider);
}
.dash-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.dash-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.dash-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}
.dash-date {
  font-size: 0.875rem;
  color: var(--muted);
}
.dash-count {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--accent);
}

/* =======================
   PATIENT GRID
   ======================= */
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

/* =======================
   PATIENT CARD
   ======================= */
.patient-card {
  background: white;
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  transition: box-shadow 0.2s;
}
.patient-card:hover {
  box-shadow: 0 4px 16px rgba(26, 24, 20, 0.07);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.card-patient-info {
  flex: 1;
}
.card-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--fg);
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}
.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.card-aphasia-type {
  color: var(--stone);
  font-weight: 500;
}
.card-sep { color: var(--divider); }
.card-weeks { color: var(--muted); }

.trend-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.trend-improving {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid #c5d9c9;
}
.trend-plateau {
  background: #FFF8EC;
  color: var(--stone);
  border: 1px solid var(--stone-light);
}

/* =======================
   SCORES
   ======================= */
.card-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.score-block {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.score-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 500;
}
.score-value {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1;
}
.score-bar {
  height: 4px;
  background: var(--stone-light);
  border-radius: 2px;
  overflow: hidden;
}
.score-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* =======================
   TIMELINE CHART
   ======================= */
.card-timeline {
  border-top: 1px solid var(--divider);
  padding-top: 1.25rem;
}
.timeline-header {
  margin-bottom: 0.75rem;
}
.timeline-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-weight: 500;
}
.timeline-chart {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.chart-svg {
  width: 100%;
  height: auto;
  display: block;
}
.chart-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--muted);
  padding: 0 0.5rem;
}
.chart-legend {
  display: flex;
  gap: 1rem;
  padding: 0 0.5rem;
}
.legend-item {
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.legend-item::before {
  content: '';
  display: inline-block;
  width: 12px;
  height: 2px;
  border-radius: 1px;
}
.legend-syntax::before { background: #4A7C59; }
.legend-semantics::before { background: #C4A882; }

/* =======================
   FOOTER
   ======================= */
.dash-footer {
  padding: 2rem;
  border-top: 1px solid var(--divider);
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

/* =======================
   RESPONSIVE
   ======================= */
@media (max-width: 768px) {
  .dash-header { flex-direction: column; gap: 1rem; }
  .dash-header-right { align-items: flex-start; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-main { padding: 2rem 1.5rem 4rem; }
}

@media (max-width: 480px) {
  .patient-card { padding: 1.25rem; }
  .dash-nav { padding: 1rem 1.5rem; }
}

/* =======================
   INVITE A COLLEAGUE BUTTON
   ======================= */
.dash-invite-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  margin-top: 0.5rem;
}
.dash-invite-btn:hover {
  background: var(--accent-light);
  box-shadow: 0 2px 8px rgba(74,124,89,0.25);
}

/* =======================
   INVITE MODAL
   ======================= */
.invite-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.invite-modal.is-open {
  display: flex;
}
.invite-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26,24,20,0.45);
  backdrop-filter: blur(2px);
}
.invite-panel {
  position: relative;
  background: white;
  border: 1px solid var(--divider);
  border-radius: 8px;
  padding: 2rem;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 8px 40px rgba(26,24,20,0.18);
  animation: panelSlideIn 0.2s ease-out;
}
@keyframes panelSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.invite-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.invite-panel-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg);
}
.invite-close-btn {
  background: none;
  border: none;
  padding: 0.25rem;
  color: var(--muted);
  cursor: pointer;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
}
.invite-close-btn:hover { color: var(--fg); background: var(--stone-light); }
.invite-panel-sub {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 1.75rem;
}
.invite-form { display: flex; flex-direction: column; gap: 1.25rem; }
.invite-field { display: flex; flex-direction: column; gap: 0.4rem; }
.invite-label { font-size: 0.8rem; font-weight: 500; color: var(--fg); }
.invite-input,
.invite-select {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--fg);
  background: var(--bg);
  transition: border-color 0.15s;
}
.invite-input:focus,
.invite-select:focus {
  outline: none;
  border-color: var(--accent);
}
.invite-error {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #DC2626;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
}
.invite-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}
.invite-btn-cancel {
  background: none;
  border: 1px solid var(--divider);
  border-radius: var(--radius);
  padding: 0.6rem 1.1rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.invite-btn-cancel:hover { border-color: var(--stone); color: var(--fg); }
.invite-btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius);
  padding: 0.6rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.invite-btn-submit:hover:not(:disabled) { background: var(--accent-light); }
.invite-btn-submit:disabled { opacity: 0.65; cursor: not-allowed; }
.invite-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.invite-success {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  background: var(--accent-dim);
  border: 1px solid #c5d9c9;
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.invite-success-icon { flex-shrink: 0; margin-top: 2px; }
.invite-success-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.25rem;
}
.invite-success-msg { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }

@media (max-width: 480px) {
  .invite-panel { padding: 1.5rem; }
  .invite-actions { flex-direction: column-reverse; }
  .invite-btn-cancel, .invite-btn-submit { width: 100%; justify-content: center; }
}