:root {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #0b1f3a;
  background-color: #f4f6fb;
  line-height: 1.4;
  font-size: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f4f6fb;
  min-height: 100vh;
}

.is-hidden {
  display: none !important;
}

/* Login Screen */
.login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #102a71 0%, #0d1d4d 100%);
  padding: 24px;
}

.login-container {
  background: #fff;
  border-radius: 24px;
  padding: 48px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(15, 23, 56, 0.3);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header h1 {
  margin: 16px 0 8px;
  font-size: 28px;
  font-weight: 700;
  color: #1c2640;
}

.login-header p {
  margin: 0;
  color: #5e6787;
  font-size: 14px;
}

.avatar--large {
  width: 80px;
  height: 80px;
  font-size: 32px;
  margin: 0 auto;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.login-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-form label {
  font-weight: 600;
  color: #1c2640;
  font-size: 14px;
}

.login-form input {
  padding: 12px 16px;
  border: 1px solid #eef1ff;
  border-radius: 12px;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.login-form input:focus {
  outline: none;
  border-color: #5B7CFF;
  box-shadow: 0 0 0 3px rgba(91, 124, 255, 0.1);
}

.btn--block {
  width: 100%;
}

.login-error {
  color: #F37070;
  font-size: 14px;
  text-align: center;
  margin-top: -8px;
  min-height: 20px;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: linear-gradient(180deg, #102a71 0%, #0d1d4d 100%);
  color: #fff;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 48px;
  height: 48px;
  background: #4266ff;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
}

.brand__title {
  font-weight: 600;
  margin: 0;
}

.brand__subtitle {
  margin: 4px 0 0;
  font-size: 0.875rem;
  opacity: 0.7;
}

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav__group-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  opacity: 0.6;
  margin: 16px 0 4px;
}

.nav__item {
  border: none;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.nav__item.is-active,
.nav__item:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.nav__item:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.sidebar__footer {
  margin-top: auto;
}

.workspace {
  background: #f4f6fb;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.workspace__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.workspace__header h1 {
  margin: 8px 0 0;
  font-size: 1.75rem;
}

.breadcrumb {
  margin: 0;
  color: #6b7da6;
  font-size: 0.9rem;
}

.header__actions {
  display: flex;
  gap: 12px;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.95rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: #3f6bff;
  color: #fff;
  box-shadow: 0 10px 20px rgba(63, 107, 255, 0.25);
}

.btn--outline {
  border: 1px solid #b8c2e1;
  background: transparent;
  color: #1e2b4b;
}

.btn--small {
  padding: 6px 12px;
  font-size: 13px;
}

.btn--danger {
  background: #F37070;
  color: #fff;
}

.btn--danger:hover {
  background: #e55a5a;
}

.btn--ghost {
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 100%;
}

.panels {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel {
  background: #fff;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 30px 80px rgba(15, 23, 56, 0.08);
}

.panel__content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.panel__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid #eef2ff;
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.panel__eyebrow {
  margin: 0;
  font-size: 0.85rem;
  color: #5f6b92;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.panel__header h2 {
  margin: 8px 0 0;
}

.panel__actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.panel__actions input,
.panel__actions select {
  border: 1px solid #d9e0f2;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: #fff;
}

.panel__actions--inline {
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.panel__actions--inline input {
  flex: 1 1 260px;
}

.panel__actions--inline select {
  min-width: 200px;
}

.panel__content.columns {
  display: grid;
  grid-template-columns: minmax(320px, 360px) 1fr;
  gap: 24px;
}

.card {
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  border: 1px solid #eef2ff;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-card h3,
.table-card h3 {
  margin: 0;
}

.subtabs {
  display: inline-flex;
  border: 1px solid #e2e6fb;
  border-radius: 999px;
  padding: 4px;
  gap: 6px;
  background: #f6f7ff;
  margin-bottom: 16px;
}

.subtab {
  border: none;
  border-radius: 999px;
  padding: 8px 18px;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
  color: #5a6382;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.subtab.is-active {
  background: #fff;
  color: #101d43;
  box-shadow: 0 8px 18px rgba(16, 29, 67, 0.08);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.form-grid--loan {
  grid-template-columns: repeat(6, minmax(180px, 1fr));
}

.form-grid--textbook {
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 1024px) {
  .form-grid--loan {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
  
  .form-grid--textbook {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .form-grid--textbook {
    grid-template-columns: 1fr;
  }
  
  .form-grid--textbook label[style*="grid-column: span 2"] {
    grid-column: 1 !important;
  }
}

label {
  font-weight: 500;
  font-size: 0.9rem;
  color: #27314f;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

input,
select,
textarea {
  border: 1px solid #cfd7ef;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #f9fbff;
  color: #1e2b4b;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(63, 107, 255, 0.3);
  border-color: transparent;
}

textarea {
  resize: vertical;
  min-height: 110px;
}

.table-wrapper {
  border: 1px solid #eef2ff;
  border-radius: 14px;
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid #eef2ff;
  text-align: left;
}

th {
  background: #f5f7ff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #5a6382;
}

td .table-subtitle {
  margin: 4px 0 0;
  color: #6b7da6;
  font-size: 0.8rem;
}

.status-alert {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 116, 122, 0.15);
  color: #a92a2f;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

tbody tr:hover {
  background: #f8faff;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge--success {
  background: rgba(80, 209, 124, 0.15);
  color: #1d8a45;
}

.badge--warning {
  background: rgba(255, 186, 73, 0.2);
  color: #9b6400;
}

.badge--danger {
  background: rgba(255, 72, 88, 0.2);
  color: #b00020;
}

.table-card__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.table-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid #eef2ff;
  margin-top: 0;
}

.table-pagination__info {
  color: #5e6787;
  font-size: 0.9rem;
}

.table-pagination__controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-pagination__button {
  padding: 6px 12px;
  border: 1px solid #eef2ff;
  background: #fff;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #27314f;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 36px;
  text-align: center;
}

.table-pagination__button:hover:not(:disabled) {
  background: #f8faff;
  border-color: #5B7CFF;
  color: #5B7CFF;
}

.table-pagination__button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.table-pagination__button--active {
  background: #5B7CFF;
  border-color: #5B7CFF;
  color: #fff;
  font-weight: 600;
}

.table-pagination__button--active:hover {
  background: #4a6ce8;
  border-color: #4a6ce8;
}

.reports__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.report-card strong {
  font-size: 2rem;
  color: #0b1f3a;
}

.charts-card {
  padding: 12px;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  align-items: stretch;
}

@media (max-width: 1200px) {
  .charts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-title {
  margin: 0 0 6px;
  font-weight: 600;
  color: #1c2640;
  font-size: 13px;
}

.chart-box {
  border: 1px solid #eef1ff;
  border-radius: 10px;
  padding: 10px;
  background: #fdfdff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chart-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(15, 23, 56, 0.08);
}

.chart-box canvas {
  width: 100%;
}

.chart-modal {
  position: fixed;
  inset: 0;
  background: rgba(13, 23, 58, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.chart-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.chart-modal__content {
  background: #fff;
  padding: 24px;
  border-radius: 24px;
  width: min(700px, 90%);
  box-shadow: 0 20px 60px rgba(15, 23, 56, 0.2);
  position: relative;
}

.chart-modal__content canvas {
  max-width: 100%;
  max-height: 500px;
}

.chart-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: #eef1ff;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-weight: 600;
  color: #1c2640;
  cursor: pointer;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.dashboard-card {
  border: 1px solid #eef2ff;
  border-radius: 20px;
  padding: 20px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(16, 29, 67, 0.08);
}

.dashboard-card__icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85) 0%, #f1f2fb 100%);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 25px rgba(22, 36, 90, 0.08), inset 0 1px 2px rgba(15, 23, 56, 0.08);
  transition: transform 0.2s ease;
}

.dashboard-card__icon img {
  width: 32px;
  height: 32px;
}

.dashboard-card__title {
  margin: 0;
  font-weight: 600;
  color: #1c2640;
}

.dashboard-card__description {
  margin: 6px 0 0;
  color: #6b7da6;
  font-size: 0.9rem;
  line-height: 1.3;
}

.dashboard-card strong {
  font-size: 2rem;
  color: #0b1f3a;
}

.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  background: #101d43;
  color: #fff;
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(3, 10, 38, 0.25);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.is-hidden {
  display: none;
}

@media (max-width: 1024px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .sidebar__nav {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }

  .workspace {
    padding: 24px;
  }

  .panel__content.columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .workspace__header {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel__actions {
    flex-direction: column;
    width: 100%;
  }

  .panel__actions input,
  .panel__actions select {
    width: 100%;
  }
}

.card-title {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 600;
  color: #1c2640;
}

.form-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.form-actions--center {
  justify-content: center;
}

.btn--primary--small {
  padding: 10px 24px;
  font-size: 14px;
  min-width: auto;
}

/* Tutorial Styles */
.tutorial-content {
  padding: 32px;
  max-width: 800px;
  margin: 0 auto;
}

.tutorial-section {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid #e8ebf5;
}

.tutorial-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.tutorial-section h3 {
  font-size: 20px;
  font-weight: 600;
  color: #1c2640;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.tutorial-step {
  margin-bottom: 0;
  padding: 0;
  background: transparent;
  border: none;
}

.tutorial-step p {
  margin-bottom: 16px;
  line-height: 1.7;
  color: #5e6787;
  font-size: 15px;
}

.tutorial-step p:last-child {
  margin-bottom: 0;
}

.tutorial-step strong {
  color: #1c2640;
  font-weight: 600;
}

@media (max-width: 768px) {
  .tutorial-content {
    padding: 24px 16px;
  }
  
  .tutorial-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
  }
  
  .tutorial-section h3 {
    font-size: 18px;
  }
  
  .tutorial-step p {
    font-size: 14px;
  }
}

/* Book View Sidebar */
.book-view-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: none;
  pointer-events: none;
}

.book-view-sidebar.is-open {
  display: block;
  pointer-events: all;
}

.book-view-sidebar__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 31, 58, 0.5);
  backdrop-filter: blur(4px);
}

.book-view-sidebar__content {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 500px;
  height: 100%;
  background: #fff;
  box-shadow: -4px 0 24px rgba(11, 31, 58, 0.15);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}

.book-view-sidebar.is-open .book-view-sidebar__content {
  transform: translateX(0);
}

.book-view-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid #eef1ff;
}

.book-view-sidebar__header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #1c2640;
}

.book-view-sidebar__close {
  background: none;
  border: none;
  font-size: 32px;
  color: #5e6787;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
}

.book-view-sidebar__close:hover {
  background: #f4f6fb;
  color: #1c2640;
}

.book-view-sidebar__body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.book-view-detail {
  margin-bottom: 24px;
}

.book-view-detail__label {
  font-size: 12px;
  font-weight: 600;
  color: #5e6787;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: block;
}

.book-view-detail__value {
  font-size: 16px;
  color: #1c2640;
  line-height: 1.6;
}

.book-view-detail__value--empty {
  color: #9ca3b8;
  font-style: italic;
}

.book-view-copies {
  margin-top: 8px;
}

.book-view-copies__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.book-view-copy-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: #f4f6fb;
  border: 1px solid #eef1ff;
  border-radius: 6px;
  font-size: 14px;
  color: #1c2640;
  font-weight: 500;
}

.book-view-copy-badge--available {
  background: #e8f5e9;
  border-color: #c8e6c9;
  color: #2e7d32;
}

.book-view-copy-badge--unavailable {
  background: #ffebee;
  border-color: #ffcdd2;
  color: #c62828;
}

@media (max-width: 768px) {
  .book-view-sidebar__content {
    max-width: 100%;
  }
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #eef2ff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(15, 23, 56, 0.15);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1000;
  margin-top: 4px;
}

.autocomplete-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f4f6fb;
  transition: background-color 0.2s ease;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background-color: #f8faff;
}

.autocomplete-item--selected {
  background-color: #eef2ff;
}

.autocomplete-item__name {
  font-weight: 600;
  color: #27314f;
  margin-bottom: 4px;
}

.autocomplete-item__details {
  font-size: 0.85rem;
  color: #5e6787;
}

.autocomplete-item__details span {
  margin-right: 12px;
}


