:root {
  --navy: #123b63;
  --navy-dark: #092744;
  --navy-soft: #285b86;
  --blue-tint: #e8f2fb;
  --blue-tint-strong: #a9c7e4;
  --page: #f3f7fb;
  --surface: #ffffff;
  --surface-soft: #edf4fa;
  --line: #d5e1ec;
  --text: #1b3044;
  --muted: #64788a;
  --danger: #b44c4c;
  --coral: #d87861;
  --amber: #c89445;
  --font: "Poppins", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 92% 4%, rgba(40, 91, 134, 0.1), transparent 26rem),
    linear-gradient(180deg, #fafdff 0%, var(--page) 46%, #e7f0f8 100%);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.94rem;
  line-height: 1.5;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
}
.app-shell {
  display: none;
}
.app-shell.is-visible {
  display: block;
}

.login-screen {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  min-height: 100vh;
  background: var(--page);
}
.login-screen.is-hidden {
  display: none;
}
.login-art {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--navy);
}
.login-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0.78;
}
.login-art-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(9, 39, 68, 0.82), rgba(40, 91, 134, 0.46));
}
.login-art-copy {
  position: absolute;
  left: clamp(28px, 7vw, 100px);
  bottom: clamp(28px, 8vw, 100px);
  display: grid;
  gap: 8px;
  color: var(--page);
}
.login-art-copy span,
.login-kicker,
.brand-tag,
.college-tag,
.admin-tag,
.section-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.login-art-copy strong {
  max-width: 500px;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  font-weight: 700;
  line-height: 1.05;
}
.login-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100%, 500px);
  padding: 48px clamp(28px, 7vw, 92px);
}
.login-logo {
  width: 82px;
  height: 82px;
  object-fit: contain;
  margin-bottom: 28px;
}
.login-kicker {
  margin-bottom: 10px;
  color: var(--navy-soft);
}
.login-panel h1 {
  color: var(--navy);
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  font-weight: 700;
  line-height: 1.08;
}
.login-intro {
  max-width: 360px;
  margin-top: 14px;
  color: var(--muted);
}
.login-form {
  display: grid;
  gap: 17px;
  margin-top: 32px;
}
.login-field,
.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.login-field label,
.form-field label,
.search-label {
  color: var(--navy);
  font-size: 0.82rem;
  font-weight: 600;
}
.login-field input,
.form-field input,
.form-field select,
.search-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.login-field input:focus,
.form-field input:focus,
.form-field select:focus,
.search-input:focus {
  border-color: var(--navy-soft);
  box-shadow: 0 0 0 3px var(--blue-tint);
}
.login-status {
  min-height: 20px;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 600;
}
.login-button,
.submit-btn {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: var(--page);
  font-weight: 700;
  transition:
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.login-button:hover,
.submit-btn:hover {
  background: var(--navy-dark);
  box-shadow: 0 10px 20px rgba(23, 50, 77, 0.18);
  transform: translateY(-1px);
}
.login-button:disabled,
.submit-btn:disabled,
.reset-btn:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}
.login-note {
  margin-top: 26px;
  color: var(--muted);
  font-size: 0.75rem;
}

.navbar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 28px 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(20, 33, 61, 0.07);
}
.navbar-left,
.nav-menu,
.nav-links,
.nav-meta,
.college-brand,
.navbar-right,
.brand-copy,
.college-copy,
.admin-copy {
  display: flex;
  align-items: center;
}
.navbar-left {
  gap: 11px;
  color: inherit;
  text-decoration: none;
}
.brand-badge {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 10px;
  background: var(--navy);
}
.profile1 {
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.brand-copy,
.college-copy,
.admin-copy {
  flex-direction: column;
  align-items: flex-start;
}
.brand-tag,
.college-tag {
  color: var(--muted);
}
.navbar-title {
  color: var(--navy);
  font-size: 1.2rem;
  font-weight: 700;
}
.nav-menu {
  flex: 1;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}
.nav-links,
.nav-meta {
  gap: 8px;
}
.nav-links {
  margin: 0 auto;
}
.nav-link {
  padding: 9px 13px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}
.nav-link:hover,
.nav-link:focus-visible {
  color: var(--navy);
  background: var(--blue-tint);
}
.nav-link.is-active {
  background: var(--navy);
  color: var(--page);
}
.college-brand,
.navbar-right {
  gap: 9px;
  padding: 7px 10px;
  border-radius: 8px;
}
.college-brand {
  border: 1px solid var(--line);
  background: var(--surface-soft);
}
.college-logo {
  width: 34px;
  height: 34px;
  padding: 3px;
  border-radius: 7px;
  background: var(--page);
  object-fit: contain;
}
.name {
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 600;
}
.navbar-right {
  background: var(--navy);
  color: var(--page);
  font-size: 0.82rem;
  font-weight: 600;
}
.admin-tag {
  color: var(--blue-tint-strong);
}
.profile2 {
  width: 34px;
  height: 34px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: var(--navy-soft);
  object-fit: contain;
}
.logout-button,
.corner-logout {
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 6px;
  background: transparent;
  color: var(--page);
  font-size: 0.75rem;
  font-weight: 600;
}
.logout-button {
  padding: 7px 9px;
}
.logout-button:hover,
.corner-logout:hover {
  background: var(--navy-soft);
}
.corner-logout {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 20;
  min-height: 42px;
  padding: 0 16px;
  background: var(--navy);
  box-shadow: 0 8px 20px rgba(20, 33, 61, 0.18);
}

.page-shell {
  padding-bottom: 24px;
}
.hero-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 28px 28px 0;
  padding: 30px 34px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--blue-tint);
}
.hero-copy {
  max-width: 670px;
}
.hero-panel h1 {
  margin-top: 8px;
  color: var(--navy);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  line-height: 1.08;
}
.hero-text,
.section-copy {
  margin-top: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.hero-badges span {
  padding: 9px 12px;
  border: 1px solid var(--blue-tint-strong);
  border-radius: 7px;
  background: var(--page);
  color: var(--navy);
  font-size: 0.76rem;
  font-weight: 600;
}
.college-visual {
  position: relative;
  flex: 0 1 270px;
  min-width: 210px;
  margin: 0;
  overflow: hidden;
  border: 4px solid var(--page);
  border-radius: 9px;
  background: var(--navy);
  box-shadow: 0 8px 20px rgba(20, 33, 61, 0.16);
}
.college-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 0.7;
  object-fit: cover;
}
.college-visual figcaption {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border-radius: 4px;
  background: var(--navy);
  color: var(--page);
  font-size: 0.68rem;
  font-weight: 600;
}

.container {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 22px 28px 14px;
}
.card {
  display: flex;
  flex: 1 1 220px;
  align-items: center;
  gap: 14px;
  min-height: 142px;
  padding: 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1f5f99 0%, #6fa9df 100%);
  color: var(--page);
  box-shadow: 0 10px 22px rgba(20, 33, 61, 0.14);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.card:nth-child(2) {
  background: linear-gradient(135deg, #174f88 0%, #5895d1 100%);
}
.card:nth-child(3) {
  background: linear-gradient(135deg, #2d70ad 0%, #80b6e5 100%);
}
.card:nth-child(4) {
  background: linear-gradient(135deg, #225b96 0%, #6a9fd4 100%);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(20, 33, 61, 0.18);
}
.card-icon {
  display: grid;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 9px;
  background: var(--blue-tint-strong);
  color: var(--navy);
  font-size: 0.76rem;
  font-weight: 700;
}
.card-content {
  flex: 1;
}
.card h2 {
  font-size: 1rem;
  font-weight: 600;
}
.card-line {
  height: 1px;
  margin: 9px 0 10px;
  background: rgba(255, 255, 255, 0.32);
}
.quantity {
  color: var(--page);
  font-size: 1.8rem;
  font-weight: 700;
}

.container-1 {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
  width: 100%;
  padding: 20px 28px 42px;
}
.top-row {
  display: flex;
  gap: 18px;
  width: 100%;
}
.status-message {
  width: 100%;
  max-width: 920px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 600;
}
.status-success {
  border: 1px solid #abd8c1;
  background: #f0faf4;
  color: #226443;
}
.status-error {
  border: 1px solid #e4b3ba;
  background: #fff4f5;
  color: var(--danger);
}
.status-message.is-hidden {
  display: none;
}
.form-card,
.search-card,
.table-card {
  width: 100%;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 8px 22px rgba(20, 33, 61, 0.06);
}
.form-card,
.search-card {
  flex: 1 1 0;
}
.section-heading {
  margin-bottom: 18px;
}
.section-tag {
  color: var(--navy-soft);
}
.form-card h3,
.table-card h3,
.search-card h3 {
  margin-top: 5px;
  color: var(--navy);
  font-size: 1.3rem;
  font-weight: 700;
}
.search-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.search-help {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.55;
}
.search-result-card {
  margin-top: 18px;
  padding: 15px;
  border: 1px solid var(--blue-tint-strong);
  border-radius: 8px;
  background: var(--blue-tint);
}
.result-title,
.result-label {
  color: var(--navy);
  font-size: 0.84rem;
  font-weight: 700;
}
.search-result-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.result-row {
  display: grid;
  grid-template-columns: minmax(100px, 38%) minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--blue-tint-strong);
}
.result-value {
  color: var(--muted);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}
.result-empty {
  padding: 6px 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
  text-align: center;
}
.result-delete-btn {
  width: 100%;
  margin-top: 9px;
  padding: 10px 12px;
  border: 0;
  border-radius: 7px;
  background: var(--navy);
  color: var(--page);
  font-size: 0.8rem;
  font-weight: 600;
}
.result-delete-btn:hover {
  background: var(--navy-dark);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}
.form-field-full {
  grid-column: 1 / -1;
}
.books-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.books-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
}
.add-book-btn,
.remove-book-btn {
  padding: 8px 10px;
  border: 1px solid var(--blue-tint-strong);
  border-radius: 6px;
  background: var(--blue-tint);
  color: var(--navy);
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}
.add-book-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.book-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.book-entry {
  display: grid;
  grid-template-columns: 34px repeat(3, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.book-entry-number {
  align-self: center;
  color: var(--navy-soft);
  font-size: 0.78rem;
  font-weight: 700;
}
.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}
.submit-btn,
.reset-btn {
  padding: 11px 17px;
}
.reset-btn {
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--navy);
  font-weight: 600;
}
.reset-btn:hover {
  border-color: var(--blue-tint-strong);
  background: var(--blue-tint);
}

.records-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.records-header,
.record-row {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 1.3fr 0.9fr 1.2fr 1fr 1.1fr 0.9fr;
}
.records-header {
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}
.records-header span {
  padding: 12px 9px;
  border-right: 1px solid var(--line);
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}
.record-row {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.record-row:last-child {
  border-bottom: 0;
}
.record-row:hover {
  background: #ffffff;
}
.record-cell {
  min-width: 0;
  padding: 11px 9px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record-cell:last-child {
  border-right: 0;
}
.empty-row {
  display: flex;
  min-height: 110px;
  align-items: center;
  justify-content: center;
  padding: 22px;
  color: var(--muted);
  font-size: 0.84rem;
  font-style: italic;
  text-align: center;
}
.records-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}
.records-summary {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.pagination,
.pagination-pages {
  display: flex;
  align-items: center;
  gap: 7px;
}
.pagination-nav,
.pagination-page {
  min-width: 38px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--navy);
  font-size: 0.76rem;
  font-weight: 600;
}
.pagination-page.is-active {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--page);
}
.pagination-nav:hover,
.pagination-page:hover {
  border-color: var(--navy-soft);
  background: var(--blue-tint);
}
.pagination-nav:disabled,
.pagination-page:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.site-footer {
  padding: 4px 20px 26px;
  color: var(--muted);
  font-size: 0.72rem;
  text-align: center;
}

@media (max-width: 1100px) {
  .navbar,
  .nav-menu,
  .nav-links,
  .nav-meta {
    flex-wrap: wrap;
  }
  .navbar,
  .nav-menu {
    align-items: stretch;
  }
  .nav-menu {
    width: 100%;
    flex-direction: column;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }
  .nav-links,
  .nav-meta {
    justify-content: flex-start;
    width: 100%;
  }
  .container {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .hero-panel,
  .top-row {
    flex-direction: column;
    align-items: stretch;
  }
  .hero-badges {
    justify-content: flex-start;
  }
  .college-visual {
    max-width: 360px;
  }
  .records-header,
  .record-row {
    grid-template-columns: 1fr 0.75fr 1.1fr 0.9fr 1.15fr 0.8fr;
  }
}

@media (max-width: 640px) {
  .login-screen {
    display: block;
  }
  .login-art {
    display: none;
  }
  .login-panel {
    min-height: 100vh;
    margin: 0 auto;
  }
  .navbar,
  .hero-panel {
    margin-left: 12px;
    margin-right: 12px;
  }
  .navbar {
    padding: 12px;
  }
  .nav-links,
  .nav-meta,
  .college-brand,
  .navbar-right {
    width: 100%;
  }
  .nav-link {
    flex: 1;
    text-align: center;
  }
  .container,
  .container-1 {
    padding-left: 12px;
    padding-right: 12px;
  }
  .container {
    grid-template-columns: 1fr;
  }
  .hero-panel {
    padding: 22px;
  }
  .card {
    min-height: 126px;
  }
  .form-card,
  .search-card,
  .table-card {
    padding: 18px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .form-field-full {
    grid-column: auto;
  }
  .book-entry {
    grid-template-columns: 30px 1fr;
  }
  .book-entry .form-field,
  .book-entry .remove-book-btn {
    grid-column: 2;
  }
  .form-actions,
  .records-footer {
    flex-direction: column;
    align-items: stretch;
  }
  .reset-btn {
    margin-left: 0;
  }
  .pagination {
    justify-content: center;
  }
  .records-header {
    display: none;
  }
  .record-row {
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 13px;
  }
  .record-cell {
    padding: 0;
    border: 0;
    overflow: visible;
    white-space: normal;
  }
  .record-cell::before {
    display: block;
    margin-bottom: 3px;
    color: var(--navy-soft);
    content: attr(data-label);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .corner-logout {
    right: 14px;
    bottom: 14px;
  }
}
