/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --max-width: 760px;
  /* Branding colors — set via JS from js/config/branding.js; defaults match EIU */
  --primary-color:   #003087;
  --secondary-color: #A7A9AC;
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --purple-50: #faf5ff;
  --purple-100: #f3e8ff;
  --purple-200: #e9d5ff;
  --purple-500: #a855f7;
  --purple-600: #9333ea;
  --purple-700: #7e22ce;
  --teal-100: #ccfbf1;
  --teal-600: #0d9488;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --radius: 6px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.5;
  font-size: 14px;
}

#app {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 12px 24px;
}

/* === Top Bar === */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 12px;
  gap: 8px;
  flex-wrap: wrap;
}

.app-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-900);
  white-space: nowrap;
}

.top-actions {
  display: flex;
  gap: 6px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: white;
  color: var(--gray-700);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-primary {
  background: var(--blue-600);
  color: white;
  border-color: var(--blue-600);
}

.btn-primary:hover {
  background: var(--blue-700);
  border-color: var(--blue-700);
}

.btn-secondary {
  background: white;
  color: var(--gray-700);
}

.btn-danger {
  color: var(--red-600);
  border-color: var(--red-500);
}

.btn-danger:hover {
  background: #fef2f2;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
}

/* === Clinician Tabs === */
.clinician-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 0;
  overflow-x: auto;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 8px;
}

.clinician-tab {
  padding: 6px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  background: white;
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.clinician-tab:hover {
  background: var(--gray-100);
}

.clinician-tab.active {
  background: var(--blue-600);
  color: white;
  border-color: var(--blue-600);
}

.clinician-tab.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.clinician-tab.drag-over {
  border-color: var(--blue-500);
  background: var(--blue-50);
  color: var(--blue-700);
}

/* === View Tabs === */
.view-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 12px;
}

.view-tab {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  background: white;
  color: var(--gray-500);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.view-tab:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}

.view-tab:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.view-tab:not(:first-child) {
  border-left: none;
}

.view-tab.active {
  background: var(--blue-600);
  color: white;
  border-color: var(--blue-600);
}

.view-tab.active + .view-tab {
  border-left-color: var(--blue-600);
}

/* === Views === */
.view {
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-500);
}

.empty-state h2 {
  font-size: 18px;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.empty-state p {
  margin-bottom: 16px;
}

/* === Forms === */
.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-800);
  background: white;
  transition: border-color 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--blue-500);
  box-shadow: 0 0 0 2px var(--blue-100);
}

.form-group textarea {
  resize: vertical;
  min-height: 120px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* === Cards === */
.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
}

/* === Metric Cards === */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.metric {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}

.metric-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--blue-600);
}

.metric-label {
  font-size: 11px;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* === Competency Tags === */
.tag-group {
  margin-bottom: 8px;
}

.tag-group-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  user-select: none;
}

.tag-cs {
  background: var(--blue-50);
  color: var(--blue-700);
  border-color: var(--blue-200);
}

.tag-cs.active, .tag-cs:hover {
  background: var(--blue-600);
  color: white;
  border-color: var(--blue-600);
}

.tag-cf {
  background: var(--purple-50);
  color: var(--purple-700);
  border-color: var(--purple-200);
}

.tag-cf.active, .tag-cf:hover {
  background: var(--purple-600);
  color: white;
  border-color: var(--purple-600);
}

/* Read-only tags (in history view) */
.tag-readonly {
  cursor: default;
}

.tag-readonly.tag-cs {
  background: var(--blue-100);
  color: var(--blue-700);
}

.tag-readonly.tag-cf {
  background: var(--purple-100);
  color: var(--purple-700);
}

/* === Clinician Header === */
.clinician-header {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.clinician-header-name {
  font-size: 15px;
  font-weight: 600;
}

.clinician-header-details {
  font-size: 12px;
  color: var(--gray-500);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* === Schedule Badges === */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.badge-mw {
  background: var(--teal-100);
  color: var(--teal-600);
}

.badge-tr {
  background: var(--purple-100);
  color: var(--purple-600);
}

/* === Schedule List === */
.schedule-list {
  list-style: none;
}

.schedule-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}

.schedule-item:last-child {
  border-bottom: none;
}

.schedule-item.skipped {
  color: var(--gray-400);
  text-decoration: line-through;
}

.schedule-item.logged {
  color: var(--gray-800);
}

.schedule-status {
  font-size: 14px;
  width: 20px;
  text-align: center;
}

.schedule-status-logged {
  color: var(--blue-600);
}

.schedule-status-upcoming {
  color: var(--gray-300);
}

/* === Observation Note Card === */
.obs-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
}

.obs-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.obs-card-date {
  font-weight: 600;
  font-size: 13px;
}

.obs-card-meta {
  font-size: 12px;
  color: var(--gray-500);
}

.obs-card-notes {
  font-size: 13px;
  line-height: 1.6;
  color: var(--gray-700);
  white-space: pre-wrap;
  margin-bottom: 8px;
}

.obs-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* === Roster List === */
.roster-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.roster-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.roster-item-name {
  font-weight: 600;
  font-size: 14px;
}

.roster-item-details {
  font-size: 12px;
  color: var(--gray-500);
}

.roster-item-actions {
  display: flex;
  gap: 4px;
}

.drag-handle {
  cursor: grab;
  color: var(--gray-400);
  font-size: 16px;
  padding: 0 8px 0 0;
  user-select: none;
  flex-shrink: 0;
}

.drag-handle:active {
  cursor: grabbing;
}

.roster-item.dragging {
  opacity: 0.4;
}

.roster-item.drag-over {
  border-color: var(--blue-500);
  border-style: dashed;
  background: var(--blue-50);
}

/* === Section Headers === */
.section-header {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gray-200);
}

/* === Minute Tracking === */
.minute-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.minute-input {
  width: 70px;
  text-align: center;
}

.minute-label {
  font-size: 12px;
  color: var(--gray-500);
}

.pct-display {
  font-size: 14px;
  font-weight: 600;
  color: var(--blue-600);
}

/* === Modal Overlay (for roster setup) === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 60px;
  z-index: 100;
}

.modal {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0,0,0,0.15);
  width: 100%;
  max-width: var(--max-width);
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h2 {
  font-size: 16px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--gray-400);
  padding: 4px;
}

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

/* === Utility === */
.text-muted { color: var(--gray-500); }
.text-sm { font-size: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.hidden, [hidden] { display: none !important; }

/* === Quill Rich Text Editor === */
.ql-toolbar.ql-snow {
  border-radius: var(--radius) var(--radius) 0 0;
  border-color: var(--gray-300);
  background: var(--gray-50);
  flex-wrap: wrap;
}

.ql-container.ql-snow {
  border-radius: 0 0 var(--radius) var(--radius);
  border-color: var(--gray-300);
  font-family: inherit;
  font-size: 14px;
}

.ql-editor {
  min-height: 180px;
  line-height: 1.6;
  color: var(--gray-800);
}

.ql-editor.ql-blank::before {
  color: var(--gray-400);
  font-style: normal;
}

/* Tighten Quill toolbar button spacing */
.ql-toolbar .ql-formats {
  margin-right: 8px;
}

/* History view — render rich text notes */
.obs-card-notes {
  font-size: 13px;
  line-height: 1.6;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.obs-card-notes p { margin: 0 0 4px; }
.obs-card-notes strong { font-weight: 600; }
.obs-card-notes em { font-style: italic; }
.obs-card-notes u { text-decoration: underline; }
.obs-card-notes ul, .obs-card-notes ol { padding-left: 20px; margin: 4px 0; }

/* === Module Navigation === */
.module-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 10px;
}

.module-tab {
  padding: 10px 20px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--gray-500);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: -2px;
  white-space: nowrap;
}

.module-tab:hover {
  color: var(--gray-700);
  background: var(--gray-50);
}

.module-tab.active {
  color: var(--blue-600);
  border-bottom-color: var(--blue-600);
}

/* === Evaluation Form === */

.rating-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 14px;
  font-size: 12px;
}

.rating-legend strong {
  color: var(--gray-700);
}

.legend-divider {
  width: 1px;
  height: 14px;
  background: var(--gray-300);
  margin: 0 4px;
}

.rating-pill {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

.rating-pill.rating-emerging {
  background: #fef3c7;
  color: #92400e;
}

.rating-pill.rating-developing {
  background: var(--gray-100);
  color: var(--gray-700);
}

.rating-pill.rating-established {
  background: #d1fae5;
  color: #065f46;
}

.eval-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.eval-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 8px;
  border-bottom: 2px solid var(--gray-200);
  background: var(--gray-50);
}

.eval-col-num    { width: 54px; }
.eval-col-rating { width: 100px; text-align: center; }
.eval-col-desc   { /* flex remaining */ }

.eval-row td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

.eval-row:hover {
  background: var(--gray-50);
}

.eval-num {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 600;
}

.eval-desc {
  font-size: 13px;
  color: var(--gray-700);
  cursor: pointer;
}

.eval-desc:hover .eval-label {
  color: var(--blue-600);
  text-decoration: underline;
}

.eval-label {
  font-weight: 600;
  font-size: 13px;
}

.eval-full-desc {
  font-size: 11px;
  color: var(--gray-400);
  margin-top: 2px;
  line-height: 1.4;
}

.eval-rating {
  text-align: center;
}

.eval-avg-row td {
  padding: 8px 8px;
  border-top: 2px solid var(--gray-200);
  background: var(--gray-50);
  font-size: 13px;
}

.eval-avg-cell {
  text-align: center;
  font-weight: 700;
  color: var(--blue-700);
}

/* Rating select color coding */
.rating-select {
  padding: 4px 6px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 12px;
  width: 90px;
  background: white;
  cursor: pointer;
}

.rating-select.rating-emerging {
  background-color: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
}

.rating-select.rating-developing {
  background-color: var(--gray-50);
  border-color: var(--gray-300);
}

.rating-select.rating-established {
  background-color: #d1fae5;
  border-color: #10b981;
  color: #065f46;
}

.rating-select.rating-na {
  background-color: var(--gray-100);
  border-color: var(--gray-300);
  color: var(--gray-400);
  font-style: italic;
}

/* Overall grade card */
.eval-overall-card {
  padding: 16px 20px;
}

.eval-overall-grid {
  display: grid;
  grid-template-columns: 1fr 130px 130px;
  gap: 6px 12px;
  align-items: center;
}

.eval-overall-header {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.eval-overall-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.eval-total-val {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--blue-700);
}

.eval-grade {
  text-align: center;
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  padding: 6px 0;
}

.eval-grade.grade-a { color: #065f46; }
.eval-grade.grade-b { color: var(--blue-700); }
.eval-grade.grade-c { color: #92400e; }

/* Evaluation status badge */
.eval-status-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
}

.eval-status-badge.eval-status-draft            { background: var(--gray-100); color: var(--gray-500); }
.eval-status-badge.eval-status-midterm_complete { background: var(--blue-100); color: var(--blue-700); }
.eval-status-badge.eval-status-final_complete   { background: #d1fae5; color: #065f46; }

/* Collapsible headers (EF grid, obs ref panel) */
.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding-bottom: 2px;
}

.collapsible-header:hover .collapsible-chevron {
  color: var(--gray-700);
}

.collapsible-chevron {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 600;
}

/* Essential Functions grid */
.ef-grid-container {
  overflow-x: auto;
  margin-top: 10px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
}

.ef-table {
  border-collapse: collapse;
  font-size: 11px;
  min-width: 100%;
}

.ef-table th,
.ef-table td {
  border: 1px solid var(--gray-200);
  padding: 3px 4px;
  text-align: center;
  white-space: nowrap;
}

.ef-date-col {
  min-width: 80px;
  text-align: left;
}

.ef-domain-header {
  background: var(--blue-50);
  color: var(--blue-700);
  font-size: 10px;
  font-weight: 600;
}

.ef-item-header {
  background: var(--gray-50);
  color: var(--gray-600);
  font-size: 10px;
  min-width: 30px;
}

.ef-date-cell {
  text-align: left;
  font-size: 11px;
  color: var(--gray-600);
  white-space: nowrap;
  padding: 3px 6px;
}

.ef-check-cell {
  padding: 2px;
}

.ef-checkbox {
  cursor: pointer;
  width: 14px;
  height: 14px;
}

.ef-total-cell {
  font-weight: 700;
  background: var(--gray-50);
  color: var(--blue-600);
  font-size: 11px;
}

/* Observation notes reference panel (within evaluations) */
.obs-ref-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--gray-50);
}

.obs-ref-meta {
  font-size: 12px;
  margin-bottom: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.obs-ref-notes {
  font-size: 12px;
  line-height: 1.5;
  color: var(--gray-700);
}

.obs-ref-notes p { margin: 0 0 3px; }

/* ============================================================
   AUTH SCREEN
   ============================================================ */

#view-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  padding: 24px;
}

.auth-screen {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
}

.auth-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-900);
  text-align: center;
  margin: 0 0 4px;
}

.auth-subtitle {
  text-align: center;
  color: var(--gray-500);
  font-size: 14px;
  margin: 0 0 20px;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 20px;
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.auth-tab.active {
  color: var(--blue-600);
  border-bottom-color: var(--blue-600);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
  margin-bottom: 12px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  color: var(--gray-400);
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.btn-full {
  width: 100%;
  justify-content: center;
}

.btn-google {
  background: var(--white);
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-google:hover {
  background: var(--gray-50);
}

.google-icon { flex-shrink: 0; }

.btn-sm {
  font-size: 12px;
  padding: 4px 10px;
}

#btn-signout { margin-left: 8px; }

/* ============================================================
   MIGRATION BANNER
   ============================================================ */

#migration-area {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  padding: 24px;
}

.migration-banner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.migration-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  padding: 36px 32px;
  width: 100%;
  max-width: 480px;
}

.migration-title {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--gray-900);
}

.migration-body {
  color: var(--gray-600);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 20px;
}

.migration-status {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--gray-700);
  margin-bottom: 16px;
}

.migration-status-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.migration-actions { display: flex; gap: 10px; }

/* ============================================================
   STUDENT SHELL
   ============================================================ */

.student-badge {
  background: #dbeafe;
  color: #1d4ed8;
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}

.student-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.student-welcome h2 {
  margin: 0 0 4px;
  font-size: 18px;
  color: var(--gray-900);
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-header-row .section-header { margin-bottom: 0; }

.table-scroll { overflow-x: auto; }

.student-comments {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.student-comment-box {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--gray-700);
  white-space: pre-wrap;
}

.rating-na-text {
  color: var(--gray-400);
  font-style: italic;
}

/* ============================================================
   ROSTER — student email label hint
   ============================================================ */

.label-hint {
  font-size: 11px;
  color: var(--gray-400);
  font-weight: 400;
}

/* === Responsive === */
@media (max-width: 500px) {
  .form-row, .form-row-3 {
    grid-template-columns: 1fr;
  }

  .top-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .clinician-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .metrics {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================================
   SOAP NOTES MODULE
   ============================================================ */

/* ── List view ── */
.soap-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.soap-list-filter { font-size: 13px; color: var(--gray-600); }
.soap-list-empty  { padding: 24px 0; text-align: center; }
.soap-week-group  { margin-bottom: 20px; }
.soap-week-label  {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 4px 0;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 8px;
}
.soap-note-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  margin-bottom: 6px;
  background: var(--white);
}
.soap-note-row:hover { background: var(--gray-50); }
.soap-note-row-info  { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.soap-note-session   { font-weight: 600; font-size: 14px; }
.soap-note-date      { font-size: 12px; color: var(--gray-500); }
.soap-note-row-badges { display: flex; gap: 6px; flex-shrink: 0; }
.soap-note-row-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Status badges */
.soap-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.plan-draft,  .soap-draft     { background: var(--gray-100); color: var(--gray-600); }
.plan-submitted, .soap-submitted { background: #fef9c3; color: #854d0e; }
.plan-reviewed,  .soap-reviewed  { background: #dbeafe; color: #1d4ed8; }
.plan-complete,  .soap-complete  { background: #dcfce7; color: #166534; }

/* ── Editor shell ── */
.soap-editor { display: flex; flex-direction: column; gap: 0; }

.soap-editor-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 10px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 0;
  flex-wrap: wrap;
}
.soap-editor-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
}
.soap-date-label {
  font-weight: 400;
  font-size: 13px;
  color: var(--gray-500);
  margin-left: 6px;
}
.soap-status-pills { display: flex; gap: 6px; flex-shrink: 0; }

/* Editor tabs */
.soap-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 0;
}
.soap-tab {
  background: none;
  border: none;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.soap-tab.active { color: var(--blue-600); border-bottom-color: var(--blue-600); }
.soap-tab:hover:not(.active) { color: var(--gray-700); }

.soap-tab-body {
  padding: 20px 0;
  min-height: 300px;
}

.soap-editor-footer {
  display: flex;
  gap: 10px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--gray-200);
  margin-top: 8px;
}

.soap-flash {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: var(--white);
  padding: 8px 20px;
  border-radius: 99px;
  font-size: 13px;
  z-index: 1000;
}

/* ── Form elements inside editor ── */
.soap-section  { display: flex; flex-direction: column; gap: 14px; }
.soap-label    { font-size: 13px; font-weight: 600; color: var(--gray-700); margin-bottom: 4px; display: block; }
.soap-textarea {
  width: 100%;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  line-height: 1.5;
  color: var(--gray-900);
}
.soap-textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 2px rgba(59,130,246,.15); }
.soap-select {
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  padding: 6px 8px;
  font-size: 13px;
  background: var(--white);
  color: var(--gray-900);
}
.soap-section-divider {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--blue-600);
  border-bottom: 1px solid var(--blue-100, #dbeafe);
  padding-bottom: 4px;
  margin: 4px 0 2px;
}
.soap-add-btn  { align-self: flex-start; }
.soap-readonly-field {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--gray-800);
  min-height: 36px;
  white-space: pre-wrap;
}
.sup-edit-hint {
  font-size: 11px;
  color: var(--blue-600);
  margin-bottom: 4px;
}

/* ── Objectives ── */
.objective-row {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--gray-50);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.objective-row-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.objective-num { font-size: 12px; font-weight: 600; color: var(--gray-600); }

/* ── Data table ── */
.soap-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.soap-data-table th,
.soap-data-table td {
  border: 1px solid var(--gray-200);
  padding: 5px 8px;
  text-align: left;
}
.soap-data-table th { background: var(--gray-100); font-weight: 600; }
.soap-data-table input { border: none; background: transparent; font-size: 12px; width: 100%; }
.soap-data-table input:focus { outline: 1px solid var(--blue-400); border-radius: 2px; }
.soap-data-table select { border: none; background: transparent; font-size: 12px; }

/* ── Track-changes diff view ── */
.soap-feedback-mode .soap-feedback-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 13px;
  color: #1d4ed8;
  display: flex;
  align-items: center;
}
.diff-view {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.8;
  min-height: 36px;
}
.diff-equal  { white-space: pre-wrap; }
.diff-ins    { background: #dcfce7; color: #14532d; text-decoration: underline; border-radius: 2px; padding: 0 1px; }
.diff-del    { background: #fee2e2; color: #7f1d1d; text-decoration: line-through; border-radius: 2px; padding: 0 1px; }

.diff-hunk   { position: relative; display: inline; }
.diff-btns   {
  display: inline-flex;
  gap: 2px;
  margin-left: 3px;
  vertical-align: middle;
}
.diff-btn {
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: 3px;
  padding: 0 4px;
  font-size: 11px;
  cursor: pointer;
  line-height: 1.4;
}
.diff-accept-btn { color: #16a34a; border-color: #86efac; }
.diff-accept-btn:hover, .diff-accept-btn.btn-active { background: #dcfce7; }
.diff-reject-btn { color: #dc2626; border-color: #fca5a5; }
.diff-reject-btn:hover, .diff-reject-btn.btn-active { background: #fee2e2; }

.hunk-accepted { opacity: .5; }
.hunk-rejected { opacity: .5; }

.pending-badge  {
  font-size: 10px; font-weight: 600;
  background: #fef9c3; color: #854d0e;
  border-radius: 99px; padding: 1px 7px;
  margin-left: 6px;
}
.resolved-badge {
  font-size: 10px; font-weight: 600;
  background: #dcfce7; color: #166534;
  border-radius: 99px; padding: 1px 7px;
  margin-left: 6px;
}

/* ── Objective feedback rows ── */
.objectives-feedback-list { display: flex; flex-direction: column; gap: 8px; }
.obj-feedback-row {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--white);
}
.obj-added    { border-color: #86efac; background: #f0fdf4; }
.obj-deleted  { border-color: #fca5a5; background: #fff1f2; }
.obj-modified { border-color: #fde68a; background: #fffbeb; }
.obj-change-accepted { opacity: .6; }
.obj-change-rejected { opacity: .6; }
.obj-change-label { font-size: 11px; font-weight: 600; color: var(--gray-500); margin-bottom: 4px; }
.obj-text     { font-size: 13px; margin-bottom: 4px; }
.obj-change-btns { display: flex; gap: 6px; margin-top: 6px; }
.obj-decision { font-size: 11px; color: var(--gray-500); font-style: italic; }
.cueing-badge {
  background: var(--gray-100);
  color: var(--gray-600);
  border-radius: 99px;
  padding: 1px 7px;
  font-size: 11px;
  margin-left: 4px;
}

/* Row change indicators */
.row-added    { background: #f0fdf4; }
.row-deleted  { background: #fff1f2; }
.row-modified { background: #fffbeb; }
.row-accepted { opacity: .55; }
.row-rejected { opacity: .55; }

/* ── Comment system ── */
.comment-editor-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}
.comment-add-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
}
.comment-list { display: flex; flex-direction: column; gap: 6px; }
.comment-card {
  border-radius: var(--radius);
  padding: 10px 12px;
  border-left: 3px solid var(--gray-300);
  background: var(--white);
  border: 1px solid var(--gray-200);
}
.comment-tag-clinical-judgment   { border-left: 3px solid #6366f1; }
.comment-tag-professional-writing { border-left: 3px solid #f59e0b; }
.comment-tag-general              { border-left: 3px solid #06b6d4; }
.comment-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
}
.comment-tag-label    { font-weight: 700; color: var(--gray-700); }
.comment-section-label { color: var(--gray-500); flex: 1; }
.comment-delete-btn {
  background: none; border: none; cursor: pointer;
  color: var(--gray-400); font-size: 13px; padding: 0 2px;
}
.comment-delete-btn:hover { color: #dc2626; }
.comment-text { font-size: 13px; line-height: 1.5; color: var(--gray-800); white-space: pre-wrap; }
.comment-display-panel { display: flex; flex-direction: column; gap: 8px; }
.comment-unread { border-left-width: 4px; }
.comment-read   { opacity: .7; }
.comment-ack-badge {
  font-size: 11px; font-weight: 600;
  color: #16a34a; margin-left: auto;
}
.comment-ack-btn { margin-left: auto; }

/* ── New-note modal ── */
.soap-new-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
}
.soap-new-modal {
  background: var(--white);
  border-radius: 10px;
  padding: 28px 24px;
  width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
}
.soap-new-modal h3 { margin: 0 0 16px; font-size: 16px; }

/* ── Student module tabs (SOAP / Eval / Obs) ── */
.student-module-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 16px;
  gap: 0;
}
.student-module-tab {
  background: none;
  border: none;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.student-module-tab.active  { color: var(--blue-600); border-bottom-color: var(--blue-600); }
.student-module-tab:hover:not(.active) { color: var(--gray-700); }

/* ═══════════════════════════════════════════════════════════════════════════
   ITP Editor
   ═══════════════════════════════════════════════════════════════════════════ */

.itp-editor { display: flex; flex-direction: column; gap: 0; }

/* Status pill in top bar */
.itp-status-pill {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}
.itp-status-draft    { background: var(--gray-100); color: var(--gray-600); }
.itp-status-complete { background: var(--teal-100);  color: var(--teal-600); }

/* Completed banner */
.itp-completed-banner {
  background: var(--teal-100);
  border: 1px solid var(--teal-600);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--teal-600);
  margin-bottom: 12px;
}

/* Section tabs */
.itp-section-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 16px;
  gap: 0;
}
.itp-tab {
  padding: 10px 20px;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--gray-500);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -2px;
}
.itp-tab.active { color: var(--blue-600); border-bottom-color: var(--blue-600); }
.itp-tab:hover:not(.active) { color: var(--gray-700); }

/* FOG cards */
.itp-fog-card {
  margin-bottom: 16px;
}
.itp-fog-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.itp-fog-num {
  font-weight: 600;
  font-size: 13px;
  color: var(--blue-700);
}

/* Objective rows within a FOG */
.itp-obj-list { margin-bottom: 8px; }
.itp-obj-row {
  border-top: 1px solid var(--gray-100);
  padding: 10px 0 4px;
}
.itp-obj-row:first-child { border-top: none; }
.itp-obj-num-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.itp-obj-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* EBP article cards */
.itp-ebp-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
  background: white;
}
.itp-ebp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.itp-analyze-spinner {
  display: block;
  padding: 8px;
  font-size: 13px;
  color: var(--gray-500);
  font-style: italic;
}

/* ITP complete badge in footer */
.itp-complete-badge {
  font-size: 13px;
  color: var(--teal-600);
  font-weight: 600;
  padding: 0 8px;
}

/* ITP editor footer */
.itp-editor-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 16px 0 8px;
  border-top: 1px solid var(--gray-200);
  margin-top: 8px;
}

/* ── ITP Objectives panel inside SOAP editor ─────────────────────────────── */

.itp-fog-panel {
  border: 1px solid var(--blue-200);
  border-radius: var(--radius);
  background: var(--blue-50);
  padding: 12px 14px;
  margin-bottom: 18px;
}
.itp-fog-panel-header {
  font-weight: 600;
  font-size: 13px;
  color: var(--blue-700);
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.itp-fog-panel-subtitle {
  font-size: 11px;
  font-weight: 400;
  color: var(--gray-500);
}
.itp-fog-panel-fog { margin-bottom: 10px; }
.itp-fog-panel-fog:last-child { margin-bottom: 0; }
.itp-fog-panel-goal {
  font-weight: 500;
  font-size: 13px;
  color: var(--gray-700);
  margin-bottom: 4px;
}
.itp-fog-panel-obj {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0 3px 10px;
  font-size: 12px;
  color: var(--gray-600);
  gap: 8px;
}
.itp-fog-panel-obj-text { flex: 1; }

/* === Branding Header === */
.branding-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  /* Blue accent line separates the university strip from the app top-bar */
  border-bottom: 3px solid var(--primary-color);
  margin-bottom: 0; /* .top-bar already has margin-bottom: 12px */
}

.branding-logo {
  display: block;
  max-height: 52px;
  width: auto;
  /* Prevents a layout shift while the image loads */
  flex-shrink: 0;
}

.branding-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.branding-dept-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.2;
}

.branding-uni-name {
  font-size: 10px;
  font-weight: 500;
  color: var(--secondary-color);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* === Branding Footer === */
.branding-footer {
  margin-top: 32px;
  padding: 12px 0;
  border-top: 1px solid var(--gray-200);
  text-align: center;
  font-size: 11px;
  color: var(--gray-400);
}

.branding-footer-link {
  color: var(--gray-400);
  text-decoration: none;
}

.branding-footer-link:hover {
  color: var(--gray-600);
  text-decoration: underline;
}

/* === Branding — Responsive === */
@media (max-width: 480px) {
  .branding-logo {
    max-height: 38px;
  }

  .branding-dept-name {
    font-size: 13px;
  }

  .branding-uni-name {
    font-size: 9px;
  }
}
