.student-profile-shell {
  display: grid;
  gap: 16px;
}

.student-search-card,
.student-header-card,
.student-tabs-wrapper,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}


.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(260px,1fr));
    gap: 14px;
    margin-top: 14px;
}

.result-card {
    background: var(--panel-solid);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 90px;
    box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

    .result-card small {
        display: block;
        color: var(--muted);
        font-size: 13px;
        font-weight: 700;
        margin-bottom: 4px;
    }

    .result-card strong {
        display: block;
        color: var(--text);
        font-size: 15px;
        line-height: 1.9;
        word-break: break-word;
        overflow-wrap: anywhere;
    }



.student-search-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 14px;
  position: relative;
  z-index: 6;
}

.smart-search-box {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: min(260px, 100%);
  max-width: 100%;
  min-height: 46px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.smart-search-box:focus-within {
  border-color: rgba(37,99,235,.42);
  background: #fff;
  box-shadow: 0 0 0 .2rem rgba(37,99,235,.10);
}

[data-theme="dark"] .smart-search-box:focus-within {
  background: var(--panel-solid);
}

.smart-search-box .form-control {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 30px;
  padding: 3px 2px;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
  background: transparent !important;
}

.search-icon {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #0f766e);
}

.search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.student-search-results {
  position: absolute;
  top: calc(100% - 10px);
  right: 14px;
  left: 210px;
  display: grid;
  gap: 6px;
  max-height: 360px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
  box-shadow: var(--shadow);
}

.search-result {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  text-align: start;
}

.search-result:hover,
.search-result.active {
  background: rgba(37, 99, 235, .10);
}

.search-result img,
.mini-avatar {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: cover;
}

.mini-avatar {
  display: grid;
  place-items: center;
  color: #fff;
  background: #0f766e;
  font-weight: 800;
}

.search-result small,
.search-result em,
.search-empty,
.search-loading,
.empty-state span {
  color: var(--muted);
}

.search-result mark {
  padding: 0 2px;
  border-radius: 4px;
  color: #7c2d12;
  background: #fde68a;
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 28px;
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  font-size: 22px;
}

.student-header-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 190px;
  gap: 16px;
  padding: 16px;
}

.student-photo-drop {
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(37,99,235,.55);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel-solid);
  cursor: pointer;
}

.student-photo-drop.dragging {
  background: rgba(15, 118, 110, .10);
}

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

.upload-progress {
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, .24);
}

.upload-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #0f766e, #2563eb);
}

.identity-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.identity-top h3 {
  margin: 0;
  font-size: 28px;
}

.identity-top p {
  margin: 6px 0 0;
  color: var(--muted);
}

.header-badges,
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.header-badges {
  justify-content: flex-end;
}

.student-meta-grid,
.overview-grid,
.finance-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.meta-box,
.meta-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
}

.meta-box span,
.meta-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.meta-box strong,
.meta-card strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.quick-actions {
  margin-top: 14px;
}

.barcode-preview {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
  text-align: center;
}

.barcode-preview img,
.barcode-large img {
  width: 132px;
  height: 132px;
  object-fit: contain;
}

.danger-pill,
.success-pill,
.warning-pill {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

.danger-pill {
  color: #be123c;
  background: rgba(225, 29, 72, .12);
}

.success-pill {
  color: #047857;
  background: rgba(4, 120, 87, .12);
}

.warning-pill {
  color: #92400e;
  background: rgba(217, 119, 6, .16);
}

.student-tabs-wrapper {
  padding: 12px;
}

.student-tabs {
  gap: 6px;
  margin-bottom: 12px;
}

.student-tabs .nav-link {
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-solid);
}

.student-tabs .nav-link.active {
  background: linear-gradient(135deg, #2563eb, #0f766e);
}

.student-tab-content {
  min-height: 360px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel-solid) 84%, transparent);
}

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

.enterprise-form .form-wide,
.sticky-save-bar {
  grid-column: 1 / -1;
}

.enterprise-form textarea.form-control {
  min-height: 105px;
}

.switch-row {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
}

.switch-row input {
  width: 18px;
  height: 18px;
}

.sticky-save-bar {
  position: sticky;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

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

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

.info-card,
.document-card,
.data-row,
.timeline-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-solid);
}

.info-card h6 {
  margin: 10px 0 4px;
  font-size: 17px;
}

.info-card p,
.timeline-item p {
  margin: 0 0 8px;
  color: var(--muted);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.muted-card {
  opacity: .72;
}

.data-list,
.timeline-list {
  display: grid;
  gap: 10px;
}

.data-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.1fr) repeat(3, minmax(120px, .8fr));
  gap: 10px;
  align-items: center;
}

.data-row em {
  justify-self: end;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--teal);
  background: rgba(15, 118, 110, .12);
  font-style: normal;
  font-size: 12px;
}

.document-card {
  display: grid;
  gap: 6px;
}

.document-drop {
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(15, 118, 110, .55);
  border-radius: 8px;
  color: var(--muted);
  background: var(--panel-solid);
  cursor: pointer;
}

.timeline-item {
  position: relative;
  padding-inline-start: 36px;
}

.timeline-item::before {
  content: "";
  position: absolute;
  top: 18px;
  right: 14px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #2563eb;
}

.timeline-item.note::before {
  background: #d97706;
}

.barcode-card-panel {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  align-items: center;
}

.barcode-large {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #111827;
}

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

.empty-inline {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

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

@media (max-width: 1180px) {
  .student-header-card,
  .student-search-card,
  .barcode-card-panel {
    grid-template-columns: 1fr;
  }

  .student-search-results {
    left: 14px;
  }

  .student-meta-grid,
  .overview-grid,
  .finance-summary,
  .enterprise-form,
  .responsive-grid,
  .document-grid,
  .barcode-actions {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 700px) {
  .student-meta-grid,
  .overview-grid,
  .finance-summary,
  .enterprise-form,
  .responsive-grid,
  .document-grid,
  .barcode-actions,
  .success-actions,
  .data-row {
    grid-template-columns: 1fr;
  }

  .identity-top,
  .sticky-save-bar,
  .section-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
}
