/* Dashboard — scoped styles that extend theme.css tokens */

/* NAV */
.dash-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 100;
}

.dash-brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--fg);
  text-decoration: none;
}

/* SUMMARY BAR */
.dash-summary {
  display: flex;
  gap: 0;
  background: var(--bg-card);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 0 2rem;
}

.summary-stat {
  padding: 1.2rem 2rem;
  border-right: 1px solid rgba(255,255,255,0.05);
  min-width: 120px;
}

.summary-stat:last-child { border-right: none; }

.summary-value {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
}

.summary-label {
  font-size: 0.75rem;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.2rem;
}

/* MAIN */
.dash-main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
}

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 6rem 2rem;
}

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

.empty-state h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: var(--fg-muted);
  margin-bottom: 2rem;
}

/* TABLE */
.table-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.05);
  overflow: hidden;
}

.pa-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.pa-table th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.pa-table td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
}

.pa-table tr:last-child td { border-bottom: none; }

.pa-table tr:hover td { background: rgba(255,255,255,0.02); }

.patient-name { font-weight: 500; }
.patient-meta { font-size: 0.78rem; color: var(--fg-muted); margin-top: 0.15rem; }

.cell-date { color: var(--fg-muted); white-space: nowrap; }

.cell-actions { white-space: nowrap; }

.code-chip {
  font-family: 'Space Grotesk', monospace;
  font-size: 0.82rem;
  background: rgba(255,255,255,0.06);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  color: var(--accent);
}

/* STATUS BADGES */
.status-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge.status-approved { background: rgba(34, 211, 107, 0.12); color: #22d36b; border: 1px solid rgba(34, 211, 107, 0.3); }
.status-badge.status-denied   { background: rgba(239, 68, 68, 0.12);  color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3);  }
.status-badge.status-pending  { background: rgba(245, 158, 11, 0.12); color: var(--warn); border: 1px solid rgba(245, 158, 11, 0.3); }
.status-badge.status-submitting { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(34, 211, 167, 0.3); }
.status-badge.status-draft    { background: rgba(255,255,255,0.06); color: var(--fg-muted); border: 1px solid rgba(255,255,255,0.1); }

/* Summary bar color overrides */
.status-approved { color: #22d36b; }
.status-pending  { color: var(--warn); }
.status-denied   { color: #ef4444; }
.status-draft    { color: var(--fg-muted); }

/* BUTTONS */
.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: none;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-sm);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-action {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(34, 211, 167, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: 0.4rem;
  transition: background 0.15s;
}

.btn-action:hover { background: rgba(34, 211, 167, 0.2); }

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s;
}

.btn-ghost:hover { border-color: rgba(255,255,255,0.25); color: var(--fg); }

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.modal {
  background: var(--bg-elevated);
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.08);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-wide { max-width: 820px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.modal-header h2 { font-size: 1.2rem; }

.modal-close {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.modal-close:hover { color: var(--fg); }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1.5rem 2rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}

/* FORM */
.form-section {
  padding: 1.5rem 2rem 0;
}

.form-section h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field.full { margin-bottom: 1rem; }

.field label {
  font-size: 0.8rem;
  color: var(--fg-muted);
  font-weight: 500;
}

.field input,
.field textarea {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--accent);
}

.field textarea { resize: vertical; }

/* DETAILS */
.details-body { padding: 1.5rem 2rem; }

.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.detail-section {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  border: 1px solid rgba(255,255,255,0.05);
}

.detail-section.full { grid-column: 1 / -1; }

.detail-section h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.9rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.detail-row:last-child { border-bottom: none; }

.detail-row span:first-child { color: var(--fg-muted); flex-shrink: 0; }
.detail-row span:last-child { text-align: right; word-break: break-word; }

/* EVENT LOG */
.event-log { display: flex; flex-direction: column; gap: 0.4rem; }

.event-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.82rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.event-type { font-weight: 600; min-width: 180px; }
.event-meta { color: var(--fg-muted); flex: 1; }
.event-transition { color: var(--accent); font-family: 'Space Grotesk', sans-serif; font-size: 0.78rem; }

.loading, .error-msg { padding: 2rem; text-align: center; color: var(--fg-muted); }
.error-msg { color: #ef4444; }

/* TOAST */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}

.toast-success { background: #22d36b; color: #0a0f1a; }
.toast-error   { background: #ef4444; color: #fff; }
.toast-info    { background: var(--bg-card); color: var(--fg); border: 1px solid rgba(255,255,255,0.1); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* RESPONSIVE */
@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .details-grid { grid-template-columns: 1fr; }
  .dash-summary { flex-wrap: wrap; padding: 0 1rem; }
  .summary-stat { padding: 0.8rem 1rem; border-right: none; border-bottom: 1px solid rgba(255,255,255,0.05); }
  .pa-table { font-size: 0.82rem; }
  .dash-main { padding: 0 1rem; }
}
