.student-form-shell {
  display: grid;
  gap: 12px;
  padding-bottom: 82px;
}

.student-form-top,
.student-section,
.student-photo-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-solid) 88%, transparent);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.student-form-top {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
}

.breadcrumb-line {
  color: var(--muted);
  font-size: 13px;
}

.student-age-strip {
  display: flex;
  gap: 14px;
  align-items: center;
  color: #0ea5e9;
  font-weight: 700;
}

.student-age-strip span {
  color: #ef4444;
  min-width: 72px;
}

.student-flags {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.check-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 13px;
}

.student-section {
  padding: 14px;
}

.student-section.compact {
  min-height: 100%;
}

.student-section-title {
  position: relative;
  margin-bottom: 14px;
  border-bottom: 2px solid rgba(14, 165, 233, .75);
  color: #0ea5e9;
  font-weight: 800;
  text-align: end;
}

.student-section-title span {
  display: inline-block;
  padding: 0 12px 8px;
  background: var(--panel-solid);
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 12px;
}

.student-grid.three {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

.student-grid.two {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.field {
  display: grid;
  gap: 5px;
  margin: 0;
}

.field.wide {
  grid-column: span 2;
}

.field span {
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.field .form-control,
.field .form-select,
.mini-edit-table .form-control,
.mini-edit-table .form-select {
  border-radius: 4px;
  border-color: rgba(15, 23, 42, .14);
  background: color-mix(in srgb, var(--panel-solid) 94%, transparent);
}

.student-form-main {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  align-items: stretch;
}

.student-form-stack {
  display: grid;
  gap: 12px;
}

.student-photo-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px;
}

.student-photo-drop {
  display: grid;
  place-items: center;
  min-height: 190px;
  border: 1px dashed rgba(14, 165, 233, .7);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(14, 165, 233, .05);
}

.student-photo-drop.dragging,
.documents-drop.dragging {
  background: rgba(14, 165, 233, .12);
}

.student-photo-drop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-empty {
  display: grid;
  place-items: center;
  gap: 6px;
  color: var(--muted);
  text-align: center;
}

.photo-icon {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 8px;
  color: #0f766e;
  background: linear-gradient(135deg, #fde68a, #67e8f9);
  font-weight: 900;
}

.photo-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.section-row-title {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
}

.add-row-btn {
  width: 32px;
  height: 28px;
  border: 0;
  border-radius: 4px;
  color: #fff;
  background: #38bdf8;
  font-weight: 800;
}

.mini-table-wrap {
  overflow-x: auto;
}

.mini-edit-table {
  min-width: 920px;
  margin: 0;
}

.compact-edit-table {
  min-width: 520px;
}

.mini-edit-table thead th {
  color: var(--muted);
  border-bottom: 1px solid #38bdf8;
  font-size: 12px;
}

.bus-supervisors-field {
  align-self: start;
}

.bus-supervisors-preview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  min-height: 38px;
  padding: 8px;
  border: 1px solid rgba(15, 23, 42, .1);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-solid) 96%, #f8fafc);
}

.bus-supervisor-chip {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid rgba(14, 165, 233, .18);
  border-radius: 6px;
  background: rgba(14, 165, 233, .06);
}

.bus-supervisor-chip strong,
.bus-supervisor-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bus-supervisor-chip strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.bus-supervisor-chip span {
  color: #0f766e;
  direction: ltr;
  font-size: 12px;
  font-weight: 800;
  text-align: left;
}

.bus-supervisors-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.health-section {
  padding-bottom: 16px;
}

.health-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 12px;
  align-items: start;
}

.health-panel {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-solid) 94%, #f8fafc);
}

.health-panel.wide {
  grid-column: 1 / -1;
}

.health-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(14, 165, 233, .22);
}

.health-panel-title {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.health-panel-title strong {
  color: #0f766e;
  font-size: 14px;
  font-weight: 800;
}

.health-panel-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.health-panel-control .field {
  gap: 6px;
}

.health-panel-control .field span {
  font-size: 12px;
}

.health-list {
  display: grid;
  gap: 8px;
}

.health-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.health-row.two {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
}

.health-row.tall {
  align-items: start;
}

.health-row .form-control,
.health-panel .form-select {
  min-width: 0;
  min-height: 38px;
}

.health-row textarea.form-control {
  min-height: 74px;
  resize: vertical;
}

.health-remove {
  min-width: 54px;
}

.health-section .mini-table-wrap {
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-solid) 96%, transparent);
}

.documents-drop {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px;
  border: 1px dashed rgba(14, 165, 233, .7);
  border-radius: 8px;
}

.documents-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.doc-chip,
.code-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #075985;
  background: rgba(14, 165, 233, .12);
  font-size: 12px;
  font-weight: 700;
}

.sticky-save-bar {
  position: sticky;
  bottom: 16px;
  z-index: 15;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-solid) 92%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.sticky-save-bar span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.success-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
}

@media (max-width: 1200px) {
  .student-grid,
  .student-grid.three,
  .student-grid.two {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }
}

@media (max-width: 860px) {
  .student-form-top,
  .student-form-main {
    grid-template-columns: 1fr;
  }
  .student-grid,
  .student-grid.three,
  .student-grid.two,
  .health-board {
    grid-template-columns: 1fr;
  }
  .health-panel.wide {
    grid-column: auto;
  }
  .health-row.two {
    grid-template-columns: 1fr;
  }
  .health-row.two .health-remove {
    justify-self: start;
  }
  .field.wide {
    grid-column: auto;
  }
  .sticky-save-bar {
    align-items: stretch;
    flex-direction: column;
  }
}
