:root {
  --gtc-blue: #1f5fa8;
  --gtc-blue-dark: #184a85;
  --gtc-green: #4c9a2a;
  --gtc-green-dark: #3f8221;
  --gtc-dark: #1b2530;
  --gtc-bg: #f4f6f9;
  --gtc-border: #dde3ea;
  --gtc-text: #29323c;
  --gtc-muted: #8a94a3;
  --gtc-danger: #c0392b;
  --gtc-card-shadow: 0 2px 6px rgba(20, 40, 70, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--gtc-text);
  background: var(--gtc-bg);
}

/* ---------- Login page ---------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #eaf1fb 0%, #f4f6f9 55%), linear-gradient(135deg, #eef3f9 0%, #f4f6f9 100%);
}

.login-card {
  background: #fff;
  border: 1px solid var(--gtc-border);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(20, 40, 70, 0.1);
  padding: 40px 44px;
  width: 380px;
  text-align: center;
}

.login-card img.logo {
  max-width: 220px;
  margin-bottom: 8px;
}

.login-card h1 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gtc-muted);
  margin: 0 0 28px;
}

.field {
  text-align: left;
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gtc-dark);
  margin-bottom: 6px;
}

.field input,
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gtc-border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--gtc-blue);
  box-shadow: 0 0 0 3px rgba(31, 95, 168, 0.15);
}

.field input[type="file"] {
  padding: 8px 10px;
}

.btn-primary {
  width: 100%;
  padding: 11px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--gtc-blue), #2f7bd6);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn-primary:hover { background: var(--gtc-blue-dark); }

.error-text {
  color: var(--gtc-danger);
  font-size: 13px;
  min-height: 18px;
  margin-top: 4px;
}

/* ---------- Dashboard shell ---------- */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 290px;
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--gtc-border);
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--gtc-border);
  text-align: center;
  background: linear-gradient(180deg, #f7fafd 0%, #ffffff 100%);
}

.sidebar-header img {
  max-width: 170px;
}

.sidebar-actions {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gtc-border);
}

.sidebar-actions-row {
  display: flex;
  gap: 8px;
}

.btn-add {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--gtc-green), #66b545);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-add:hover { background: var(--gtc-green-dark); }

.btn-add-trial {
  background: linear-gradient(135deg, var(--gtc-blue), #2f7bd6);
}

.btn-add-trial:hover { background: var(--gtc-blue-dark); }

.disease-list-heading {
  padding: 14px 16px 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gtc-muted);
}

.disease-list {
  flex: 1;
  overflow-y: auto;
  padding: 2px 8px 10px;
}

.registry-nav {
  padding: 2px 8px 6px;
  border-bottom: 1px solid var(--gtc-border);
}

.disease-row {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 10px;
  font-size: 13.5px;
  color: var(--gtc-dark);
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}

.disease-row:hover { background: #f0f3f7; }

.disease-row.active {
  background: #eaf1fb;
  box-shadow: inset 3px 0 0 var(--gtc-blue);
}

.disease-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.disease-row .disease-name {
  flex: 1;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.disease-row .count {
  font-weight: 600;
  font-size: 11px;
  color: var(--gtc-muted);
  background: #eef1f5;
  border-radius: 999px;
  padding: 2px 7px;
}

.disease-row .chevron {
  color: var(--gtc-muted);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.disease-row:hover .chevron { transform: translateX(2px); }

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--gtc-border);
  font-size: 12.5px;
  color: var(--gtc-muted);
}

.sidebar-footer button {
  background: none;
  border: none;
  color: var(--gtc-blue);
  cursor: pointer;
  font-size: 12.5px;
  padding: 0;
}

/* ---------- Main content ---------- */
.main {
  flex: 1;
  padding: 34px 44px;
  max-width: 900px;
}

.welcome-view {
  text-align: center;
}

.welcome-logo {
  max-width: 380px;
  width: 100%;
  margin: 10px 0 6px;
}

.welcome-hint {
  color: var(--gtc-muted);
  margin-bottom: 34px;
}

.trials-heading {
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--gtc-muted);
  margin-bottom: 14px;
}

.trial-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}

.trial-card {
  background: #fff;
  border: 1px solid var(--gtc-border);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: var(--gtc-card-shadow);
  border-left: 5px solid var(--gtc-blue);
}

.trial-card .trial-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--gtc-dark);
  margin-bottom: 4px;
}

.trial-card .trial-disease {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gtc-blue);
  background: #eaf1fb;
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 10px;
}

.trial-card .trial-description {
  font-size: 13.5px;
  color: var(--gtc-text);
  line-height: 1.5;
}

.trials-empty {
  text-align: left;
  color: var(--gtc-muted);
  font-size: 14px;
}

.disease-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gtc-border);
}

.disease-page-header .title-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.disease-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.disease-page-header h2 {
  margin: 0;
  font-size: 22px;
}

.disease-page-header .subtitle {
  color: var(--gtc-muted);
  font-size: 13px;
  margin-top: 2px;
}

.back-link {
  background: none;
  border: none;
  color: var(--gtc-blue);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.patient-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.patient-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid var(--gtc-border);
  border-radius: 10px;
  padding: 14px 18px;
  cursor: pointer;
  box-shadow: var(--gtc-card-shadow);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.patient-card:hover {
  box-shadow: 0 6px 16px rgba(20, 40, 70, 0.1);
  transform: translateY(-1px);
}

.patient-card .patient-name {
  font-weight: 600;
  font-size: 14.5px;
}

.patient-card .patient-weight {
  color: var(--gtc-muted);
  font-size: 12.5px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.patient-card .patient-meta {
  font-weight: 400;
  color: var(--gtc-muted);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-trash {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--gtc-danger);
  font-size: 17px;
  line-height: 1;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-trash:hover {
  background: #fbe9e7;
}

.patient-card .chevron {
  color: var(--gtc-muted);
}

.empty-state {
  color: var(--gtc-muted);
  margin-top: 60px;
  text-align: center;
  font-size: 15px;
}

/* ---------- Trial detail page ---------- */
.trial-page-description {
  color: var(--gtc-text);
  font-size: 14px;
  margin: -10px 0 0;
}

.trial-section {
  margin-top: 30px;
}

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

.trial-section-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gtc-muted);
}

.btn-small {
  padding: 6px 12px;
  font-size: 12.5px;
  border-radius: 6px;
  border: none;
  background: var(--gtc-blue);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.btn-small:hover { background: var(--gtc-blue-dark); }

.contact-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--gtc-border);
  border-radius: 999px;
  padding: 7px 14px 7px 8px;
  box-shadow: var(--gtc-card-shadow);
}

.contact-chip .contact-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--gtc-blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-chip .contact-name {
  font-size: 13px;
  font-weight: 600;
}

.contact-chip .contact-org {
  font-size: 11.5px;
  color: var(--gtc-muted);
}

.enrollment-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid var(--gtc-border);
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: var(--gtc-card-shadow);
  margin-bottom: 10px;
}

.enrollment-card .patient-name {
  font-weight: 600;
  font-size: 14.5px;
}

.enrollment-card .patient-weight {
  color: var(--gtc-muted);
  font-size: 12.5px;
  margin-top: 2px;
}

.enrollment-card .enrollment-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 11px;
}

.status-badge.status-enrolled { background: #eef1f5; color: var(--gtc-muted); }
.status-badge.status-screening { background: #fdf0dc; color: #a9670c; }
.status-badge.status-completed { background: #e6f4ea; color: var(--gtc-green-dark); }

/* ---------- Registry pages (Master Registry / Sponsor Matching / Call Queues) ---------- */
.main.main-wide { max-width: 1200px; }

.registry-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.registry-count {
  color: var(--gtc-muted);
  font-size: 13px;
}

.table-scroll {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--gtc-border);
  border-radius: 10px;
  box-shadow: var(--gtc-card-shadow);
}

.registry-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

.registry-table th {
  text-align: left;
  padding: 10px 14px;
  background: #f7f9fc;
  border-bottom: 1px solid var(--gtc-border);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gtc-muted);
  position: sticky;
  top: 0;
}

.registry-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--gtc-border);
  vertical-align: top;
}

.registry-table tbody tr:hover { background: #f7f9fc; cursor: pointer; }
.registry-table tbody tr:last-child td { border-bottom: none; }

.registry-table td.wrap { white-space: normal; min-width: 220px; }

.priority-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.priority-pill.priority-platinum { background: #ece7fb; color: #5b3aa8; }
.priority-pill.priority-gold { background: #fdf0dc; color: #a9670c; }
.priority-pill.priority-silver { background: #eef1f5; color: #55606e; }
.priority-pill.priority-medium { background: #e6f0fb; color: var(--gtc-blue); }
.priority-pill.priority-low { background: #f3f3f3; color: var(--gtc-muted); }
.priority-pill.priority-excluded { background: #fbe9e7; color: var(--gtc-danger); }

.score-pill {
  display: inline-block;
  font-weight: 700;
  font-size: 13px;
}

.sponsor-grid-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.sponsor-tile {
  border: 1px solid var(--gtc-border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}

.sponsor-tile .sponsor-name { font-weight: 700; margin-bottom: 3px; }
.sponsor-tile .sponsor-status { color: var(--gtc-muted); }
.sponsor-tile.status-review { border-color: #c9def0; background: #f3f8fd; }

.rubric-legend {
  background: #fff;
  border: 1px solid var(--gtc-border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 22px;
  font-size: 12.5px;
}

.rubric-legend .rubric-row {
  display: flex;
  gap: 10px;
  padding: 4px 0;
}

.rubric-legend .rubric-band {
  font-weight: 700;
  min-width: 130px;
  flex-shrink: 0;
}

.queue-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.queue-tab {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--gtc-border);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.queue-tab.active {
  background: var(--gtc-blue);
  border-color: var(--gtc-blue);
  color: #fff;
}

/* Wider variant of the shared modal, for the richer patient/candidate detail view */
.modal-wide {
  width: 620px;
  max-height: 82vh;
  overflow-y: auto;
}

.document-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.document-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid var(--gtc-border);
  border-radius: 10px;
  padding: 12px 18px;
  box-shadow: var(--gtc-card-shadow);
}

.document-card .document-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.document-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #fdeceb;
  color: var(--gtc-danger);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.document-card .document-name {
  font-weight: 600;
  font-size: 14px;
}

.document-card .document-meta {
  color: var(--gtc-muted);
  font-size: 12px;
  margin-top: 2px;
}

.document-card .document-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 30, 45, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  border-radius: 12px;
  width: 420px;
  max-width: 92vw;
  padding: 26px 28px;
  box-shadow: 0 20px 50px rgba(20, 40, 70, 0.25);
}

.modal h3 { margin-top: 0; }

.modal .field { margin-bottom: 14px; }

.field-row {
  display: flex;
  gap: 12px;
}

.field-row .field {
  flex: 1;
  min-width: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.btn-secondary {
  padding: 10px 16px;
  border-radius: 6px;
  border: 1px solid var(--gtc-border);
  background: #fff;
  cursor: pointer;
  font-weight: 600;
}

/* Patient detail modal */
.detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.detail-header .disease-icon {
  width: 48px;
  height: 48px;
  font-size: 19px;
}

.detail-header h3 {
  margin: 0;
  font-size: 18px;
}

.detail-header .detail-disease {
  color: var(--gtc-muted);
  font-size: 13px;
  margin-top: 2px;
}

.detail-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 6px;
}

.detail-row .detail-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gtc-muted);
  margin-bottom: 3px;
}

.detail-row .detail-value {
  font-size: 14px;
  color: var(--gtc-text);
}
