/* CaseFlow Staff Dashboard Styles */

/* ===== LAYOUT ===== */
.dash-body-page { background: var(--cream); }

.dash-nav {
  background: var(--teal-dark);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.12);
}

.dash-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.dash-brand { display: flex; align-items: center; gap: 0.5rem; }
.brand-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--amber-light);
  text-decoration: none;
}
.dash-practice-name { color: var(--teal-xlight); font-size: 0.875rem; }

.dash-nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.nav-link {
  color: var(--teal-xlight);
  text-decoration: none;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover, .nav-link.active {
  background: rgba(255,255,255,0.1);
  color: var(--white);
}
.nav-home { opacity: 0.7; margin-left: 0.5rem; }

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

/* ===== STATS ===== */
.dash-wrap { display: flex; flex-direction: column; gap: 1.5rem; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.stat-card {
  background: var(--white);
  border-radius: 16px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.stat-num {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--charcoal);
  line-height: 1;
}
.stat-label {
  font-size: 0.8rem;
  color: var(--gray-400);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-teal { border-top: 3px solid var(--teal-light); }
.stat-amber { border-top: 3px solid var(--amber); }
.stat-inbound { border-top: 3px solid #5B8DEF; }

/* ===== PANELS ===== */
.panel {
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  border: 1px solid var(--gray-200);
  overflow: hidden;
}

.panel-header {
  padding: 1rem 1.25rem 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--gray-200);
}
.panel-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--teal-dark);
}
.panel-actions { display: flex; align-items: center; gap: 0.75rem; }
.panel-full { width: 100%; }

.dash-body { display: flex; flex-direction: column; gap: 1.5rem; }

/* ===== TABLES ===== */
.patient-table, .msg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.patient-table th, .msg-table th {
  padding: 0.6rem 1.25rem;
  text-align: left;
  font-weight: 600;
  color: var(--gray-600);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--cream-mid);
  border-bottom: 1px solid var(--gray-200);
}
.patient-table td, .msg-table td {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
}
.patient-table tr:last-child td, .msg-table tr:last-child td { border-bottom: none; }
.patient-table tr:hover td { background: var(--cream); }

.pt-name { font-weight: 600; }
.pt-phone { color: var(--gray-600); font-size: 0.8125rem; }
.pt-date { color: var(--gray-600); }
.pt-type { font-size: 0.8125rem; }
.muted { color: var(--gray-400); }
.small { font-size: 0.75rem; }

.msg-body { max-width: 400px; color: var(--gray-600); }

.empty-state {
  text-align: center;
  padding: 2.5rem;
  color: var(--gray-400);
  font-size: 0.9rem;
}
.empty-state a { color: var(--teal-light); }

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-pre-op { background: var(--teal-xlight); color: var(--teal-dark); }
.badge-post-op { background: var(--amber-xlight); color: var(--amber); }
.badge-completed { background: #E8F5E9; color: #2E7D32; }
.badge-inbound { background: #EEF2FF; color: #4338CA; }
.badge-outbound { background: var(--cream-mid); color: var(--gray-600); }
.badge-dir { background: #EEF2FF; color: #4338CA; }
.badge-inbound.badge-inbound { background: #EEF2FF; color: #4338CA; }
.badge-outbound.badge-inbound { background: var(--cream-mid); color: var(--gray-600); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.15s;
  font-family: var(--font-body);
}
.btn-primary {
  background: var(--teal-light);
  color: var(--white);
}
.btn-primary:hover { background: var(--teal-mid); }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; border-radius: 8px; }
.btn-outline {
  background: transparent;
  color: var(--teal-light);
  border: 1.5px solid var(--teal-light);
}
.btn-outline:hover { background: var(--teal-xlight); }
.btn-danger { background: #FEE2E2; color: #B91C1C; }

/* ===== SEARCH ===== */
.search-input {
  padding: 0.4rem 0.8rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--charcoal);
  outline: none;
  transition: border-color 0.15s;
}
.search-input:focus { border-color: var(--teal-light); }

/* ===== FORMS ===== */
.form-wrap {
  max-width: 640px;
  margin: 0 auto;
}
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--teal-dark);
  margin-bottom: 0.4rem;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: var(--font-body);
  background: var(--white);
  color: var(--charcoal);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--teal-light);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 0.8rem; color: var(--gray-400); margin-top: 0.3rem; }
.form-section {
  background: var(--cream);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.form-section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--teal-dark);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--gray-200);
}

/* ===== INBOX ===== */
.thread-list { display: flex; flex-direction: column; }
.thread-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  cursor: pointer;
  transition: background 0.12s;
  text-decoration: none;
  color: inherit;
}
.thread-item:hover { background: var(--cream); }
.thread-item.unread { border-left: 3px solid var(--teal-light); }
.thread-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--teal-xlight);
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-display);
}
.thread-content { flex: 1; min-width: 0; }
.thread-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.2rem; }
.thread-name { font-weight: 600; font-size: 0.9rem; color: var(--charcoal); }
.thread-time { font-size: 0.75rem; color: var(--gray-400); }
.thread-preview { font-size: 0.825rem; color: var(--gray-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-badge { font-size: 0.7rem; }

/* ===== MESSAGE THREAD ===== */
.msg-thread { display: flex; flex-direction: column; gap: 0.75rem; padding: 1.5rem; }
.msg-bubble {
  max-width: 70%;
  padding: 0.65rem 1rem;
  border-radius: 16px;
  font-size: 0.875rem;
  line-height: 1.5;
}
.msg-bubble.inbound {
  background: var(--teal-xlight);
  color: var(--teal-dark);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.msg-bubble.outbound {
  background: var(--amber-xlight);
  color: var(--charcoal);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.msg-meta { font-size: 0.7rem; color: var(--gray-400); margin-top: 0.2rem; }
.msg-meta.inbound { text-align: left; }
.msg-meta.outbound { text-align: right; }

/* ===== CHECKLIST PROGRESS ===== */
.checklist-progress {
  background: var(--cream);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 0.75rem;
}
.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0;
  font-size: 0.875rem;
}
.check-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
}
.check-circle.done { background: var(--teal-light); border-color: var(--teal-light); color: white; }

/* ===== SETUP PAGE ===== */
.setup-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 960px;
  margin: 0 auto;
}
@media (max-width: 640px) { .setup-grid { grid-template-columns: 1fr; } }

.section-card {
  background: var(--white);
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid var(--gray-200);
}
.section-card h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--teal-dark);
  margin-bottom: 1rem;
}

/* ===== ALERTS ===== */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}
.alert-success { background: #D1FAE5; color: #065F46; }
.alert-error { background: #FEE2E2; color: #991B1B; }
.alert-info { background: #DBEAFE; color: #1E40AF; }