/* Driver case clarity: student identification and two-step parent contact workflow. */
.driver-student-summary{display:grid;grid-template-columns:112px minmax(0,1fr);gap:18px;align-items:start;}
.driver-student-summary dl{margin:0;}
.driver-student-photo-frame{width:112px;aspect-ratio:4/5;border:1px solid #d6dee9;border-radius:12px;background:#eef3f8;overflow:hidden;display:grid;place-items:center;box-shadow:0 1px 2px rgba(15,23,42,.05);}
.driver-student-photo-frame img{width:100%;height:100%;object-fit:cover;display:block;}
.driver-student-photo-fallback{width:100%;height:100%;display:grid;place-items:center;font-size:2.1rem;font-weight:800;color:#52657c;background:linear-gradient(145deg,#eef3f8,#e3eaf2);}
.driver-student-photo-fallback[hidden]{display:none!important;}
.driver-student-photo-caption{display:block;margin-top:6px;text-align:center;font-size:.68rem;font-weight:700;letter-spacing:.03em;color:#687b91;}

.driver-contact-sequence{display:grid;gap:12px;margin-top:14px;}
.driver-contact-step{display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:12px;align-items:center;padding:14px 15px;border:1px solid #d9e1ea;border-radius:11px;background:#f8fafc;}
.driver-contact-step.is-complete{background:#f5faf7;border-color:#cfe5d7;}
.driver-contact-step.is-required{background:#fffaf0;border-color:#ecd8a4;}
.driver-contact-step-number{width:30px;height:30px;border-radius:999px;display:grid;place-items:center;background:#e5ebf2;color:#42566d;font-weight:800;font-size:.82rem;}
.driver-contact-step.is-complete .driver-contact-step-number{background:#dcefe4;color:#276744;}
.driver-contact-step.is-required .driver-contact-step-number{background:#f5e7bd;color:#72510b;}
.driver-contact-step-copy{display:grid;gap:3px;min-width:0;}
.driver-contact-step-copy strong{font-size:.92rem;color:#253449;}
.driver-contact-step-copy span,.driver-contact-step-copy small{color:#62748a;line-height:1.35;}
.driver-contact-step-status{display:inline-flex;width:max-content;margin-top:3px;border-radius:999px;padding:3px 8px;font-size:.68rem;font-weight:800;letter-spacing:.03em;text-transform:uppercase;background:#e8eef5;color:#506176;}
.driver-contact-step.is-complete .driver-contact-step-status{background:#e0f0e6;color:#2b6847;}
.driver-contact-step.is-required .driver-contact-step-status{background:#f7e9bf;color:#76540c;}
.driver-contact-step .button-link{white-space:nowrap;}

@media(max-width:720px){
  .driver-student-summary{grid-template-columns:88px minmax(0,1fr);gap:14px;}
  .driver-student-photo-frame{width:88px;}
  .driver-contact-step{grid-template-columns:32px minmax(0,1fr);}
  .driver-contact-step .button-link{grid-column:1/-1;width:100%;justify-content:center;text-align:center;}
}


/* Linked multi-student incident cases */
.linked-student-cases {
  margin-bottom: 18px;
}

.linked-student-cases-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 14px;
}

.linked-student-cases-head h2 {
  margin-top: 0;
  margin-bottom: 4px;
}

.linked-incident-group-number {
  display: inline-block;
  margin-left: 6px;
  color: #173b6d;
  font-weight: 800;
}

.linked-case-count {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid #cbd8e6;
  border-radius: 999px;
  background: #f5f8fc;
  color: #173b6d;
  font-size: .72rem;
  font-weight: 800;
}

.linked-student-case-list {
  display: grid;
  gap: 9px;
}

.linked-student-case {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 12px;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  background: #fff;
}

.linked-student-case.is-current {
  border-color: #9db7d4;
  background: #f7faff;
  box-shadow: inset 4px 0 0 #173b6d;
}

.linked-student-photo {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #d6e0ea;
  border-radius: 9px;
  background: #edf3fa;
  color: #173b6d;
  font-weight: 900;
}

.linked-student-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

.linked-student-photo span {
  width: 100%;
  height: 100%;
  place-items: center;
}

.linked-student-photo span:not([hidden]) {
  display: grid;
}

.linked-student-case-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.linked-student-case-copy > span {
  color: #687a8e;
  font-size: .76rem;
}

.linked-student-case-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.linked-student-case-name strong {
  color: #233a54;
}

.linked-current-badge {
  padding: 3px 7px;
  border-radius: 999px;
  background: #e7f0fa;
  color: #173b6d;
  font-size: .64rem;
  font-weight: 850;
}

.linked-student-case-status {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
}

.linked-contact-badge {
  padding: 5px 8px;
  border: 1px solid;
  border-radius: 999px;
  white-space: nowrap;
  font-size: .68rem;
  font-weight: 800;
}

.linked-contact-badge.complete {
  border-color: #bbd8c5;
  background: #f0f8f3;
  color: #27623d;
}

.linked-contact-badge.required {
  border-color: #e1c7a4;
  background: #fff8ed;
  color: #80541e;
}

@media (max-width: 720px) {
  .linked-student-cases-head {
    flex-direction: column;
  }

  .linked-student-case {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .linked-student-case-status {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .linked-student-case-status .button-link {
    width: auto;
  }
}


.linked-student-photo-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #173b6d;
  font-weight: 900;
}


/* Reliable linked-student roster photo fallback */
.linked-student-photo {
  position: relative;
}

.linked-student-photo-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #173b6d;
  font-weight: 900;
}

.linked-student-photo img[data-linked-roster-photo] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  opacity: 0;
}

.linked-student-photo img[data-linked-roster-photo].is-loaded {
  opacity: 1;
}


/* Reliable linked-student roster photo fallback */
.linked-student-photo {
  position: relative;
}

.linked-student-photo-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #173b6d;
  font-weight: 900;
}

.linked-student-photo img[data-linked-roster-photo] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  opacity: 0;
}

.linked-student-photo img[data-linked-roster-photo].is-loaded {
  opacity: 1;
}


/* Reliable Report Summary photo fallback */
.driver-student-photo-frame {
  position: relative;
  overflow: hidden;
}

.driver-student-photo-frame .driver-student-photo-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  background: #edf3fa;
  color: #173b6d;
  font-size: 1.4rem;
  font-weight: 900;
}

.driver-student-photo-frame img[data-linked-roster-photo] {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  opacity: 0;
}

.driver-student-photo-frame img[data-linked-roster-photo].is-loaded {
  opacity: 1;
}


/* Collapsible linked-student layout */
.linked-student-cases {
  margin-top: 18px;
  margin-bottom: 18px;
  padding: 0;
  overflow: hidden;
}

.linked-student-cases-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.linked-student-cases-summary::-webkit-details-marker {
  display: none;
}

.linked-student-cases-summary::marker {
  display: none;
  content: "";
}

.linked-student-cases-summary h2 {
  margin: 2px 0 3px;
}

.linked-student-cases-summary > div:first-child > span {
  color: #687a8e;
  font-size: .78rem;
}

.linked-student-summary-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.linked-student-chevron {
  color: #173b6d;
  font-size: 1.25rem;
  font-weight: 900;
  transition: transform .18s ease;
}

.linked-student-cases[open] .linked-student-chevron {
  transform: rotate(180deg);
}

.linked-student-cases-body {
  padding: 0 18px 18px;
  border-top: 1px solid #e0e7ef;
}

.linked-student-cases-body > .section-copy {
  margin: 14px 0;
}

/* Larger student identification photos */
.linked-student-case {
  grid-template-columns: 82px minmax(0, 1fr) auto;
  min-height: 96px;
  padding: 12px 14px;
}

.linked-student-photo {
  width: 76px;
  height: 76px;
  border-radius: 10px;
}

.linked-student-photo-fallback {
  font-size: 1.35rem;
}

.linked-student-case-name strong {
  font-size: 1rem;
}

.linked-student-case-copy > span {
  font-size: .8rem;
}

@media (max-width: 720px) {
  .linked-student-cases-summary {
    padding: 14px;
  }

  .linked-student-cases-body {
    padding: 0 14px 14px;
  }

  .linked-student-case {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .linked-student-photo {
    width: 64px;
    height: 64px;
  }

  .linked-student-case-status {
    grid-column: 1 / -1;
  }
}


/* Coordinator linked-case status */
.coordinator-linked-students {
  margin-top: 18px;
}

.coordinator-linked-status {
  flex-wrap: wrap;
}

.linked-decision-badge {
  padding: 5px 8px;
  border: 1px solid;
  border-radius: 999px;
  white-space: nowrap;
  font-size: .68rem;
  font-weight: 800;
}

.linked-decision-badge.complete {
  border-color: #b8d5c2;
  background: #f0f8f3;
  color: #28603d;
}

.linked-decision-badge.draft {
  border-color: #c9d6e6;
  background: #f4f7fb;
  color: #365673;
}

.linked-decision-badge.pending {
  border-color: #ddd3c4;
  background: #faf8f4;
  color: #705d43;
}

@media (max-width: 720px) {
  .coordinator-linked-status {
    align-items: stretch;
  }

  .coordinator-linked-status .linked-contact-badge,
  .coordinator-linked-status .linked-decision-badge {
    width: fit-content;
  }
}
