:root {
  --ink: #18212f;
  --muted: #647084;
  --line: #d9e0ea;
  --brand: #1f6f8b;
  --brand-dark: #154b60;
  --accent: #b58a2a;
  --paper: #f6f8fb;
  --surface: #ffffff;
}

html {
  font-size: 14px;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

@media (max-width: 680px) {
  .teacher-detail-head,
  .teacher-qualification > div {
    grid-template-columns: 1fr;
  }

  .teacher-detail-head img {
    max-width: 180px;
  }

  .teacher-document-row {
    grid-template-columns: 1fr;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #1f6f8b;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  display: flex;
  flex-direction: column;
}

body.lightbox-open {
  overflow: hidden;
}

main {
  flex: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand-mark {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-weight: 800;
  color: var(--brand-dark);
  max-width: 340px;
}

.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.brand-mark small {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  white-space: normal;
}

.navbar {
  padding: .9rem 1.25rem;
}

.navbar .nav-link {
  color: var(--ink);
  font-weight: 700;
}

.admin-link {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding-inline: .9rem !important;
}

.hero-section,
.content-section,
.inner-hero {
  width: 100%;
}

.hero-image {
  min-height: clamp(500px, 75vh, 760px);
  display: flex;
  align-items: flex-start;
  padding: clamp(2rem, 5vw, 5rem);
  color: #fff;
  background:
    linear-gradient(90deg, rgba(9, 25, 41, .86), rgba(9, 25, 41, .28)),
    url("/uploads/photos/college-main.jpg"),
    linear-gradient(135deg, #23516a 0%, #88a6ad 54%, #d6c28a 100%);
  background-size: cover;
  background-position: center;
}

.hero-content {
  max-width: 920px;
}

.hero-content p,
.section-heading p,
.inner-hero p,
.chair-card p {
  margin: 0 0 .6rem;
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

.hero-content h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4.2vw, 4.2rem);
  line-height: 1.06;
  letter-spacing: 0;
}

.hero-content span {
  display: block;
  margin-top: 1rem;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  font-weight: 700;
}

.content-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 5rem) 1rem;
}

.college-carousel {
  overflow: hidden;
  border-radius: 8px;
  background: #0b1b29;
}

.carousel-photo {
  min-height: clamp(260px, 46vw, 560px);
  background-size: cover;
  background-position: center;
}

.carousel-photo-img {
  display: block;
  width: 100%;
  height: clamp(260px, 46vw, 560px);
  object-fit: cover;
}

.photo-campus {
  background:
    linear-gradient(0deg, rgba(11, 27, 41, .35), rgba(11, 27, 41, .05)),
    url("/uploads/photos/carousel-1.jpg"),
    linear-gradient(135deg, #2b6d77, #b8c4b2);
}

.photo-lab {
  background:
    linear-gradient(0deg, rgba(11, 27, 41, .35), rgba(11, 27, 41, .05)),
    url("/uploads/photos/carousel-2.jpg"),
    linear-gradient(135deg, #576d7a, #c9b36d);
}

.photo-students {
  background:
    linear-gradient(0deg, rgba(11, 27, 41, .35), rgba(11, 27, 41, .05)),
    url("/uploads/photos/carousel-3.jpg"),
    linear-gradient(135deg, #345f84, #91b0a2);
}

.carousel-caption {
  text-shadow: 0 2px 10px rgba(0, 0, 0, .5);
}

.gallery-marquee {
  overflow: hidden;
  margin-inline: -1.5rem;
  padding: .25rem 0 1rem;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.gallery-marquee-track {
  display: flex;
  width: max-content;
  gap: 1rem;
  animation: galleryMarquee 48s linear infinite;
  will-change: transform;
}

.gallery-marquee:hover .gallery-marquee-track {
  animation-play-state: paused;
}

@keyframes galleryMarquee {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-50%);
  }
}

.gallery-card {
  flex: 0 0 clamp(240px, 28vw, 340px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.gallery-card:hover,
.gallery-card:focus-visible {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--accent), var(--line) 40%);
  box-shadow: 0 16px 38px rgba(9, 25, 41, .12);
  outline: none;
}

.gallery-cover,
.gallery-cover-empty {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  object-fit: cover;
  background: var(--paper);
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.gallery-card-body {
  display: grid;
  gap: .45rem;
  padding: 1rem;
}

.gallery-card-body h3 {
  margin: 0;
  font-size: 1.15rem;
}

.gallery-card-body p,
.gallery-card-body span {
  margin: 0;
  color: var(--muted);
}

.gallery-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.gallery-detail-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.gallery-detail-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
}

.gallery-lightbox-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: .75rem;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(7, 16, 27, .88);
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox img {
  max-width: min(1100px, 100%);
  max-height: 82vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 70px rgba(0, 0, 0, .45);
}

.gallery-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  font-size: 2rem;
  line-height: 1;
}

.gallery-lightbox-title {
  max-width: min(900px, 100%);
  color: #fff;
  font-weight: 800;
  text-align: center;
}

.gallery-detail-card div {
  display: grid;
  gap: .4rem;
  padding: 1rem;
}

.gallery-detail-card h2 {
  margin: 0;
  font-size: 1.05rem;
}

.gallery-detail-card p {
  margin: 0;
  color: var(--muted);
}

.gallery-page {
  padding: 1rem 1.5rem 0;
}

.gallery-topbar {
  display: grid;
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto 1.25rem;
}

.back-link {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: .55rem .9rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--brand-dark);
  font-weight: 800;
  text-decoration: none;
}

.back-link:hover,
.back-link:focus-visible {
  border-color: var(--brand);
  color: var(--brand);
}

.gallery-switcher {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 98px;
  gap: .75rem;
  overflow-x: auto;
  padding: .15rem .15rem .75rem;
  overscroll-behavior-inline: contain;
}

.gallery-switcher-item {
  position: relative;
  display: grid;
  place-items: center;
  width: 98px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.gallery-switcher-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-switcher-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(181, 138, 42, .18);
}

.gallery-switcher-item:hover,
.gallery-switcher-item:focus-visible {
  border-color: var(--brand);
  outline: none;
}

.gallery-cover-panel {
  display: grid;
  grid-template-columns: minmax(240px, .82fr) minmax(280px, 1fr);
  align-items: stretch;
  max-width: 1040px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.gallery-cover-panel img,
.gallery-cover-large-empty {
  width: 100%;
  min-height: 270px;
  height: 100%;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.gallery-cover-panel > div:last-child {
  display: grid;
  align-content: center;
  gap: .85rem;
  padding: clamp(1.1rem, 3vw, 2.25rem);
}

.gallery-cover-panel p,
.gallery-cover-panel h1,
.gallery-cover-panel span {
  margin: 0;
}

.gallery-cover-panel p {
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.gallery-cover-panel h1 {
  font-size: clamp(1.65rem, 2.7vw, 2.55rem);
  line-height: 1.12;
}

.gallery-cover-panel span {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.section-heading {
  max-width: 760px;
  margin: 0 auto 2rem;
  text-align: center;
}

.section-heading h2,
.inner-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.8rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.chair-card {
  max-width: 430px;
  margin: 0 auto 2.5rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}

.person-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
}

.person-photo-img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  object-fit: cover;
  margin-bottom: .9rem;
}

.chair-photo-img {
  margin-bottom: 1rem;
}

.person-photo-empty {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 5;
  margin-bottom: 1rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--paper);
  font-weight: 700;
  text-align: center;
  padding: 1rem;
}

.chair-photo {
  margin-bottom: 1rem;
  background:
    url("/uploads/photos/chair.jpg"),
    linear-gradient(135deg, #d7dee7, #7c9ead);
}

.teacher-photo {
  margin-bottom: .9rem;
  background:
    url("/uploads/photos/teacher-placeholder.jpg"),
    linear-gradient(135deg, #d8e2e3, #8ea0a4);
}

.chair-card h3,
.teacher-card h3,
.document-card h2,
.info-block h2,
.admin-panel h2 {
  margin: 0 0 .4rem;
  font-size: 1.2rem;
  letter-spacing: 0;
}

.chair-card span,
.teacher-card p,
.document-body,
.info-block p {
  color: var(--muted);
}

.teachers-grid,
.documents-grid,
.admissions-grid {
  display: grid;
  gap: 1rem;
}

.teachers-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 230px));
  justify-content: center;
}

.teacher-card,
.document-card,
.info-block,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.teacher-card {
  padding: 1rem;
  text-align: center;
}

.person-link-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.person-link-card:hover,
.person-link-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--brand);
  box-shadow: 0 14px 34px rgba(9, 25, 41, .12);
  outline: none;
}

.teacher-card .person-photo-img {
  max-width: 165px;
  margin-inline: auto;
}

.teacher-card h3 {
  font-size: 1.08rem;
  line-height: 1.25;
}

.teacher-badge {
  display: inline-flex;
  width: fit-content;
  margin: .25rem 0 .5rem;
  padding: .25rem .5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent), white 84%);
  color: var(--brand-dark);
  font-size: .8rem;
  font-weight: 800;
}

.teacher-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-top: .7rem;
}

.teacher-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: .25rem .65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--brand-dark);
  font-size: .88rem;
  font-weight: 800;
  line-height: 1.2;
}

.teacher-detail-head .teacher-tags span {
  background: var(--paper);
}

.teacher-tags .commission-tag {
  border-color: color-mix(in srgb, var(--accent), #000 12%);
  background: color-mix(in srgb, var(--accent), white 80%);
  color: #5f4410;
}

.teacher-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem 1rem clamp(3rem, 6vw, 5rem);
}

.teacher-detail-card {
  display: grid;
  gap: 1rem;
}

.teacher-detail-head {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  padding: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.teacher-detail-head img {
  width: 100%;
  max-width: 220px;
  aspect-ratio: 4 / 5;
  border-radius: 8px;
  object-fit: cover;
}

.teacher-detail-head p {
  margin: 0 0 .45rem;
  color: var(--accent);
  font-weight: 900;
  text-transform: uppercase;
}

.teacher-detail-head h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3.2vw, 3rem);
  line-height: 1.08;
}

.teacher-detail-head span,
.teacher-detail-head strong {
  display: block;
  margin-top: .7rem;
}

.teacher-detail-head span {
  color: var(--muted);
}

.teacher-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.teacher-info-card,
.teacher-qualification {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.teacher-info-card h2,
.teacher-qualification h2 {
  margin: 0 0 .75rem;
  font-size: 1.15rem;
}

.teacher-info-card p {
  margin: 0;
  color: var(--muted);
  white-space: pre-line;
}

.teacher-long-label {
  margin-bottom: .75rem !important;
  color: var(--ink) !important;
  font-weight: 800;
}

.teacher-documents {
  display: grid;
  gap: .75rem;
  margin-top: 1rem;
}

.teacher-qualification summary {
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 900;
}

.teacher-qualification > div {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.teacher-qualification img {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.teacher-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  align-items: center;
}

.teacher-contacts h2 {
  flex-basis: 100%;
}

.teacher-contacts a {
  color: var(--brand-dark);
  font-weight: 800;
}

.empty-state {
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 .5rem;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

.hero-empty .hero-content strong {
  display: inline-block;
  margin-top: 1.5rem;
  padding: .65rem .9rem;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 6px;
  background: rgba(255, 255, 255, .12);
}

.inner-hero {
  padding: clamp(3rem, 7vw, 6rem) 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  text-align: center;
}

.documents-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.pdf-preview {
  height: 320px;
  background: #e8edf4;
  border-bottom: 1px solid var(--line);
}

.pdf-preview iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.document-simple-list {
  display: grid;
  gap: .75rem;
  max-width: 980px;
  margin: 0 auto;
}

.document-list-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.document-list-item summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  cursor: pointer;
  list-style: none;
}

.document-list-item summary::-webkit-details-marker {
  display: none;
}

.document-list-title {
  font-weight: 800;
}

.document-list-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .5rem;
}

.document-inline-preview {
  padding: 0 1rem 1rem;
}

.document-inline-preview iframe {
  width: 100%;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.document-body,
.info-block,
.admin-panel {
  padding: 1.25rem;
}

.admissions-grid {
  grid-template-columns: 1fr;
  max-width: 900px;
}

.admin-page {
  display: grid;
  gap: 1.25rem;
}

.admin-hero {
  padding-block: clamp(2rem, 5vw, 4rem);
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.admin-tab {
  border: 0;
  border-radius: 6px;
  padding: .75rem 1rem;
  color: var(--ink);
  background: transparent;
  font-weight: 800;
}

.admin-tab.active,
.admin-tab:hover {
  color: #fff;
  background: var(--brand);
}

.admin-tab-panel {
  display: none;
  gap: 1rem;
}

.admin-tab-panel.active {
  display: grid;
}

.admin-panel-head {
  display: grid;
  gap: .25rem;
  margin-bottom: 1rem;
}

.admin-panel-head p {
  margin: 0;
  color: var(--muted);
}

.editor-form {
  display: grid;
  gap: .75rem;
}

.editor-form .btn {
  justify-self: start;
}

.compact-editor {
  margin-bottom: 1rem;
}

.role-form {
  display: grid;
  grid-template-columns: minmax(120px, 180px) auto;
  gap: .5rem;
}

.teacher-profile-editors {
  display: grid;
  gap: .75rem;
  margin-top: 1rem;
}

.teacher-admin-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.teacher-admin-card[open] {
  border-color: var(--brand);
  box-shadow: 0 18px 42px rgba(9, 25, 41, .12);
}

.teacher-admin-card > summary {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: .85rem;
  align-items: center;
  padding: .75rem;
  cursor: pointer;
  list-style: none;
}

.teacher-admin-card > summary::-webkit-details-marker {
  display: none;
}

.teacher-admin-card > summary img {
  width: 74px;
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  object-fit: cover;
}

.teacher-admin-card > summary span {
  display: grid;
  gap: .15rem;
}

.teacher-admin-card > summary small {
  color: var(--muted);
  font-weight: 700;
}

.teacher-admin-card > summary em {
  padding: .45rem .7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--brand-dark);
  font-style: normal;
  font-weight: 800;
}

.teacher-admin-editor-shell {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.teacher-profile-form {
  display: grid;
  gap: .75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.teacher-admin-files {
  display: grid;
  gap: 1rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .75rem;
  align-items: end;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 38px;
  font-weight: 800;
}

.teacher-document-editor {
  display: grid;
  gap: .5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.teacher-document-editor h3,
.teacher-document-add-form h3 {
  margin: 0;
  font-size: 1rem;
}

.teacher-document-list {
  display: grid;
  gap: .5rem;
}

.teacher-document-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: .5rem;
  align-items: center;
  padding: .5rem;
  border-radius: 6px;
  background: var(--surface);
}

.teacher-document-add-form {
  display: grid;
  gap: .55rem;
  padding-top: .75rem;
  border-top: 1px solid var(--line);
}

.compact-empty-inline {
  padding: .75rem;
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--paper);
  font-weight: 700;
}

.teacher-document-preview-image {
  display: block;
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.qualification-admin-thumb {
  width: min(220px, 100%);
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  object-fit: cover;
}

.single-photo-grid .photo-card-form,
.chair-admin-card .teacher-profile-form > label:first-of-type,
.chair-admin-card .teacher-profile-form > input.form-control:first-of-type {
  display: none;
}

@media (max-width: 680px) {
  .teacher-detail-head,
  .teacher-qualification > div {
    grid-template-columns: 1fr;
  }

  .teacher-detail-head img {
    max-width: 180px;
  }

  .teacher-document-row {
    grid-template-columns: 1fr;
  }
}

.admin-list {
  display: grid;
  gap: .5rem;
  margin-top: 1rem;
}

.admin-list-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.admin-list-row span {
  color: var(--muted);
}

.documents-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1rem;
}

.document-admin-section {
  display: grid;
  gap: 1rem;
  align-content: start;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.document-admin-section h3 {
  margin: 0;
  font-size: 1.1rem;
}

.document-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.document-upload-form {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.document-upload-form h4 {
  margin: 0;
  font-size: 1rem;
}

.document-list-row {
  grid-template-columns: 130px 110px minmax(0, 1fr) auto;
}

.photo-upload-form {
  margin-bottom: 1rem;
}

.photo-upload-tile {
  width: min(100%, 260px);
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  gap: .35rem;
  padding: 1rem;
  border: 2px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--paper);
  text-align: center;
  cursor: pointer;
  font-weight: 800;
}

.photo-upload-tile:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: #eef6f8;
}

.replace-image-form {
  margin: 0;
}

.replace-image-frame {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 6px;
  cursor: pointer;
}

.replace-image-frame img {
  display: block;
}

.replace-image-frame span {
  position: absolute;
  right: .65rem;
  bottom: .65rem;
  padding: .4rem .65rem;
  border-radius: 6px;
  color: #fff;
  background: rgba(18, 26, 36, .82);
  font-weight: 800;
  font-size: .85rem;
}

.replace-image-frame:hover span {
  background: var(--brand);
}

.upload-plus {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 2rem;
  line-height: 1;
}

.compact-empty {
  padding: 1.5rem;
  margin-top: .5rem;
}

.admin-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}

.single-photo-grid {
  grid-template-columns: minmax(210px, 320px);
}

.admin-photo-card {
  display: grid;
  gap: .75rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transform: translateZ(0);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.admin-photo-card.dragging {
  opacity: .94;
  border-color: var(--brand);
  box-shadow: 0 14px 34px rgba(24, 33, 47, .18);
  transform: rotate(1deg) scale(1.02);
}

.photo-drop-placeholder {
  border: 2px dashed var(--brand);
  border-radius: 8px;
  background: rgba(31, 111, 139, .08);
  transition: transform 180ms ease;
}

.admin-photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  object-fit: cover;
  background: var(--paper);
}

.drag-handle {
  display: inline-flex;
  justify-content: center;
  border: 0;
  padding: .35rem .5rem;
  border-radius: 6px;
  color: var(--muted);
  background: var(--paper);
  font-size: .85rem;
  font-weight: 800;
  cursor: grab;
  user-select: none;
  transition: color 160ms ease, background 160ms ease;
}

.drag-handle:hover,
.is-dragging .drag-handle {
  color: #fff;
  background: var(--brand);
}

.drag-handle:active {
  cursor: grabbing;
}

.photo-card-form,
.delete-photo-form {
  display: grid;
  gap: .5rem;
}

.save-order-button {
  margin-top: 1rem;
}

.gallery-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.gallery-admin-card {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.gallery-admin-card.open {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, var(--brand), var(--line) 45%);
  box-shadow: 0 16px 38px rgba(24, 33, 47, .08);
}

.gallery-admin-card.hidden-by-open-gallery {
  display: none;
}

.gallery-admin-summary {
  display: grid;
  grid-template-rows: auto auto minmax(72px, auto) auto;
  gap: .75rem;
  min-height: 100%;
}

.gallery-admin-card.open .gallery-admin-summary {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto;
  align-items: start;
}

.gallery-admin-card.open .gallery-admin-summary .gallery-admin-cover {
  display: none;
}

.gallery-admin-meta {
  display: grid;
  gap: .35rem;
}

.gallery-admin-meta h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.25;
}

.gallery-admin-meta p {
  margin: 0;
  color: var(--muted);
}

.gallery-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-self: end;
}

.gallery-admin-actions form {
  margin: 0;
}

.gallery-admin-details {
  display: none;
  gap: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.gallery-admin-card.open .gallery-admin-details {
  display: grid;
}

.gallery-admin-edit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.gallery-admin-edit-block {
  display: grid;
  gap: .75rem;
  align-content: start;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.gallery-admin-edit-block h3 {
  margin: 0;
  font-size: 1rem;
}

.gallery-photos-section {
  display: grid;
  gap: 1rem;
}

.gallery-photos-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.gallery-photos-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.inline-upload-tile {
  width: 190px;
  min-height: 58px;
  aspect-ratio: auto;
  grid-auto-flow: column;
  grid-template-columns: auto 1fr;
  justify-content: start;
  text-align: left;
}

.inline-upload-tile .upload-plus {
  width: 38px;
  height: 38px;
  font-size: 1.45rem;
}

.gallery-admin-card.dragging,
.gallery-photo-card.dragging {
  border-color: var(--brand);
  box-shadow: 0 14px 34px rgba(24, 33, 47, .18);
}

.gallery-admin-cover {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
  color: var(--muted);
  font-weight: 800;
}

.gallery-cover-replace {
  width: min(100%, 360px);
}

.gallery-cover-replace .replace-image-frame {
  aspect-ratio: 4 / 3;
}

.gallery-cover-replace img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-admin-cover img,
.gallery-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compact-upload {
  margin: 0;
}

.small-upload-tile {
  width: min(100%, 220px);
  aspect-ratio: 5 / 3;
}

.gallery-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}

.gallery-photo-card {
  display: grid;
  gap: .75rem;
  padding: .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.gallery-photo-card img {
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  background: var(--surface);
}

.order-form {
  margin-top: 1rem;
}

.logout-form {
  margin: 0;
}

.logout-form .nav-link {
  font-weight: 700;
}

.auth-shell {
  min-height: 70vh;
  display: grid;
  place-items: center;
  padding: 2rem 1rem;
}

.auth-panel {
  width: min(100%, 430px);
  display: grid;
  gap: .7rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.auth-panel h1 {
  margin: 0 0 .5rem;
  font-size: 1.8rem;
}

.site-footer {
  margin-top: auto;
  padding: 2rem 1rem;
  color: #dfe8ef;
  background: #121a24;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 1180px;
  margin: 0 auto;
}

.site-footer h2 {
  margin: 0 0 .8rem;
  color: #fff;
  font-size: 1rem;
}

.site-footer a,
.site-footer p {
  display: block;
  margin: 0 0 .45rem;
  color: #dfe8ef;
  text-decoration: none;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.social-links a {
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 6px;
  padding: .45rem .65rem;
}

@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .gallery-cover-panel {
    grid-template-columns: 1fr;
  }

  .gallery-cover-panel img,
  .gallery-cover-large-empty {
    min-height: 220px;
    aspect-ratio: 16 / 10;
  }

  .admin-list-row,
  .role-form {
    grid-template-columns: 1fr;
  }

  .document-list-item summary {
    grid-template-columns: 1fr;
  }

  .document-list-actions {
    justify-content: flex-start;
  }

  .gallery-admin-card.open .gallery-admin-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .navbar {
    padding-inline: .75rem;
  }

  .brand-mark {
    max-width: 250px;
  }

  .brand-logo {
    width: 38px;
    height: 38px;
  }

  .hero-image {
    min-height: 620px;
    padding: 1.25rem;
  }

  .gallery-page {
    padding-inline: .75rem;
  }

  .gallery-switcher {
    grid-auto-columns: 82px;
  }

  .gallery-switcher-item {
    width: 82px;
  }
}
