:root {
  --brand: #0b5ed7;
  --surface: #f6f8fb;
}

body {
  background: var(--surface);
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.treb-body {
  background: #f3f7fb;
  color: #1e293b;
}

.app-shell {
  width: 100%;
}

.fade-in {
  animation: fadeIn .28s ease-out both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-bg {
  min-height: 100vh;
  background: linear-gradient(135deg, #eef4ff, #ffffff);
}

.card {
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 8px;
}

.student-photo {
  width: 100%;
  max-width: 140px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #dbe3ef;
}

.site-logo-preview {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
}

.metric {
  background: #f8fafc;
  border-radius: 8px;
  padding: .75rem;
}

.metric span,
.dashboard-card strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
}

.dashboard-card .card-body {
  min-height: 94px;
}

.dashboard-card span {
  overflow-wrap: anywhere;
}

.qr-box {
  min-height: 96px;
  border: 1px dashed #94a3b8;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #475569;
  font-size: .9rem;
}

.responsive-table {
  min-width: 720px;
}

.table-responsive {
  -webkit-overflow-scrolling: touch;
}

.result-row {
  min-width: 0;
}

.result-card {
  width: 100%;
}

.result-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}

.result-value {
  max-width: 48%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.result-meta-card {
  min-width: 9.5rem;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  align-items: center;
}

.student-search-card {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
  padding: 1rem;
}

.student-search-form {
  font-family: Nyala, Ebrima, Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: .875rem;
  line-height: 1.425;
}

.student-search-row {
  display: flex;
  flex-wrap: wrap;
  margin: -12px;
}

.student-search-row + .student-search-row {
  margin-top: 12px;
}

.student-search-controls {
  row-gap: 0;
}

.student-search-controls {
  justify-content: center;
}

.student-search-col {
  padding: 12px;
  width: 100%;
}

.student-search-col-full {
  flex: 0 0 100%;
  max-width: 100%;
}

.student-search-col-input {
  flex: 0 1 28rem;
  max-width: 28rem;
}

.student-search-col-actions {
  flex: 0 0 100%;
  max-width: 100%;
  padding-top: 0;
}

.student-search-alert {
  color: #2196f3;
  display: grid;
  grid-template-areas: "prepend content";
  grid-template-columns: max-content auto;
  overflow: hidden;
  padding: 24px 16px 16px;
  position: relative;
  border-radius: 4px;
}

.student-search-alert-underlay {
  background: currentColor;
  border-radius: 0 0 4px 4px;
  inset: 0;
  opacity: .12;
  pointer-events: none;
  position: absolute;
}

.student-search-alert-border {
  border-top: 8px solid currentColor;
  inset: 0;
  opacity: .38;
  pointer-events: none;
  position: absolute;
}

.student-search-alert-icon {
  align-items: flex-start;
  display: flex;
  font-size: 28px;
  grid-area: prepend;
  margin-right: 16px;
  position: relative;
}

.student-search-alert-content {
  grid-area: content;
  min-width: 0;
  position: relative;
}

.student-search-alert-title {
  color: rgba(0, 0, 0, .87);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.75rem;
  overflow-wrap: anywhere;
}

.student-search-alert-content p {
  color: rgba(0, 0, 0, .72);
  margin: 0;
}

.student-search-error {
  align-items: center;
  background: #fef2f2;
  border-radius: 8px;
  color: #b91c1c;
  display: flex;
  font-size: .9rem;
  font-weight: 700;
  gap: .6rem;
  margin-bottom: 1rem;
  padding: .85rem 1rem;
}

.student-code-field {
  align-items: center;
  border: 1px solid rgba(0, 0, 0, .38);
  border-radius: 4px;
  display: grid;
  grid-template-areas: "prepend field clear";
  grid-template-columns: min-content minmax(0, 1fr) min-content;
  min-height: 56px;
  padding: 0 12px;
  position: relative;
}

.student-code-field:hover {
  border-color: rgba(0, 0, 0, .87);
}

.student-code-field:focus-within {
  border-color: #1565c0;
  border-width: 2px;
}

.student-code-prepend {
  color: rgba(0, 0, 0, .6);
  font-size: 1.25rem;
  grid-area: prepend;
  padding-right: 6px;
  position: relative;
  z-index: 1;
}

.student-code-input-wrap {
  grid-area: field;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.student-code-label {
  color: rgba(0, 0, 0, .6);
  display: block;
  font-size: 1rem;
  left: 6px;
  max-width: calc(100% - 12px);
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  text-overflow: ellipsis;
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
}

.student-code-field:focus-within .student-code-label {
  background: #fff;
  color: #1565c0;
  font-size: .75rem;
  padding: 0 4px;
  top: 0;
  transform: translateY(-50%);
}

.student-code-field.has-value .student-code-label {
  background: #fff;
  font-size: .75rem;
  padding: 0 4px;
  top: 0;
  transform: translateY(-50%);
}

.student-code-input {
  background: transparent;
  border: 0;
  color: rgba(0, 0, 0, .87);
  font: inherit;
  min-height: 56px;
  outline: 0;
  padding: 24px 6px 16px;
  width: 100%;
}

.student-code-input::placeholder {
  color: rgba(0, 0, 0, .45);
  opacity: 0;
}

.student-code-field:focus-within .student-code-input::placeholder,
.student-code-field.has-value .student-code-input::placeholder {
  opacity: 1;
}

.student-code-clear {
  background: transparent;
  border: 0;
  color: rgba(0, 0, 0, .6);
  cursor: pointer;
  grid-area: clear;
  padding: 0 4px;
  position: relative;
  z-index: 1;
}

.student-search-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding-top: 0;
}

.student-search-submit,
.student-search-reset {
  align-items: center;
  border-radius: 4px;
  display: inline-flex;
  font-size: .875rem;
  font-weight: 500;
  gap: .55rem;
  height: 36px;
  justify-content: center;
  letter-spacing: .0892857143em;
  line-height: normal;
  min-width: 64px;
  padding: 0 16px;
  text-transform: uppercase;
  transition: background .2s ease, box-shadow .2s ease, color .2s ease, opacity .2s ease;
}

.student-search-submit {
  background: #1565c0;
  border: 1px solid #1565c0;
  box-shadow: 0 3px 1px -2px rgba(0, 0, 0, .2), 0 2px 2px rgba(0, 0, 0, .14), 0 1px 5px rgba(0, 0, 0, .12);
  color: #fff;
}

.student-search-submit:not(:disabled):hover {
  background: #0d47a1;
}

.student-search-submit:disabled {
  background: #fff;
  border-color: transparent;
  box-shadow: none;
  color: rgba(0, 0, 0, .26);
  cursor: default;
}

.student-search-reset {
  background: transparent;
  border: 1px solid currentColor;
  color: #b00020;
}

.student-search-reset:hover {
  background: rgba(176, 0, 32, .04);
}

@media (min-width: 960px) {
  .student-search-col-input {
    flex: 0 1 28rem;
    max-width: 28rem;
  }

  .student-search-col-actions {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (min-width: 576px) {
  .w-sm-auto {
    width: auto !important;
  }
}

@media (min-width: 768px) {
  .result-card {
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 575.98px) {
  h1,
  .h1 {
    font-size: 1.5rem;
  }

  .h3 {
    font-size: 1.35rem;
  }

  .card-body {
    padding: 1rem;
  }

  .dashboard-card .card-body {
    min-height: 86px;
    padding: .85rem;
  }

  .metric span,
  .dashboard-card strong {
    font-size: 1.25rem;
  }

  .list-group-item {
    padding: .9rem 1rem;
  }

  .result-row {
    display: flex !important;
    align-items: center !important;
    flex-wrap: nowrap;
    gap: .4rem !important;
    padding: .35rem .75rem !important;
  }

  .result-content,
  .result-row .min-w-0 {
    flex: 1 1 auto;
    min-width: 0;
  }

  .result-value {
    flex: 0 0 auto;
    max-width: none;
    padding-left: 0;
    text-align: right !important;
  }

  .result-row .grid.h-10.w-10 {
    height: 1.75rem;
    width: 1.75rem;
    font-size: .8rem;
  }

  .result-meta-strip {
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .result-meta-card {
    flex: 0 0 9.5rem;
    scroll-snap-align: start;
  }

  .student-photo {
    max-width: 112px;
  }
}

@media print {
  nav,
  .btn {
    display: none !important;
  }
  body {
    background: #fff;
  }
}
