:root {
  --forest: #aa1919;
  --forest-dark: #861414;
  --ink: #252525;
  --muted: #717171;
  --line: #e5e5e5;
  --paper: #f7f7f7;
  --white: #fff;
  --sage: #f6eaea;
  --serif: "Klee One", cursive;
  --sans: "Nunito Sans", Arial, sans-serif;
}

[hidden] {
  display: none !important;
}

h1,
h2,
h3,
.brand strong,
.stat-card > strong {
  color: #575757;
}

.brand-mark {
  background: var(--forest);
}

.brand-logo {
  width: 190px;
  max-width: 100%;
  max-height: 120px;
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.sidebar {
  background: var(--white);
}

.nav-link.active {
  background: var(--sage);
  color: var(--forest);
}

.open-dot {
  background: var(--forest);
  box-shadow: 0 0 0 4px var(--sage);
}

.open-card {
  background: #f7f7f7;
  border-color: var(--line);
}

.stat-green {
  background: #f6eaea;
}

.stat-sand {
  background: #f2f2f2;
}

.stat-rose {
  background: #ededed;
}

.stat-icon,
.stat-sand .stat-icon,
.stat-rose .stat-icon {
  color: var(--forest);
}

.stat-line,
.stat-sand .stat-line,
.stat-rose .stat-line {
  background: var(--forest);
}

.welcome-decoration:before,
.welcome-decoration:after {
  border-color: #e5e5e5;
}

.welcome-decoration span {
  color: var(--forest);
}

.welcome-decoration i {
  background: var(--forest);
}

.book-cover {
  background: #f6eaea;
  color: var(--forest);
}

.book-cover:nth-child(2n) {
  background: #ededed;
  color: #575757;
}

.quick-icon,
.quick-icon.amber,
.quick-icon.lilac {
  background: #f6eaea;
  color: var(--forest);
}

.avatar {
  background: var(--sage);
  color: var(--forest);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px var(--sage);
}

.camera-scanner {
  grid-column: 1 / -1;
  display: grid;
  gap: 9px;
}

.camera-scanner video {
  width: 100%;
  max-height: 48vh;
  background: #222;
  border-radius: 8px;
  object-fit: cover;
}

.camera-scanner p {
  margin: 0;
}

.button-primary {
  background: var(--forest);
}

.button-primary:hover {
  background: var(--forest-dark);
}

.text-button,
.row-action:hover {
  color: var(--forest);
}

.book-cover {
  overflow: hidden;
}

.book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover-preview {
  display: none;
  justify-content: center;
  padding: 8px;
}

.cover-preview.visible {
  display: flex;
}

.cover-preview img {
  max-width: 140px;
  max-height: 190px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.book-title-link {
  display: block;
  padding: 0;
  border: 0;
  background: none;
  color: #252525;
  font: inherit;
  font-weight: 700;
  text-align: left;
}

.book-title-link:hover {
  color: var(--forest);
  text-decoration: underline;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 12px 4px;
  color: #717171;
  font-size: 11px;
}

.pagination .button {
  min-height: 32px;
  padding: 7px 11px;
}

.pagination .button:disabled {
  cursor: default;
  opacity: .5;
}

.book-detail-layout {
  display: grid;
  grid-template-columns: minmax(110px, 160px) 1fr;
  gap: 20px;
  grid-column: 1 / -1;
}

.book-detail-cover {
  min-height: 175px;
  display: grid;
  align-content: start;
  justify-content: center;
}

.book-detail-cover img {
  max-width: 150px;
  max-height: 220px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.detail-cover-placeholder {
  width: 130px;
  min-height: 160px;
  display: grid;
  place-items: center;
  padding: 15px;
  background: #f6eaea;
  color: #717171;
  text-align: center;
  border-radius: 6px;
  font-size: 11px;
}

.book-detail-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 12px;
  margin: 0;
}

.book-detail-fields dt {
  color: #717171;
  font-size: 10px;
  font-weight: 700;
}

.book-detail-fields dd {
  margin: 3px 0 0;
  color: #252525;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
}

@media (max-width: 720px) {
  .mobile-menu {
    color: var(--forest);
  }

  .book-detail-layout {
    grid-template-columns: 1fr;
  }

  .book-detail-cover {
    justify-content: start;
    min-height: 0;
  }

  .book-detail-fields {
    grid-template-columns: 1fr 1fr;
  }

  .pagination {
    justify-content: center;
  }
}

body {
  color: #252525;
  font-size: 17px;
  line-height: 1.55;
}

.nav-caption,
.eyebrow {
  color: #555;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.brand strong {
  font-size: 20px;
}

.brand small,
.open-card small {
  color: #505050;
  font-size: 14px;
}

.open-card strong {
  font-size: 15px;
}

.nav-link {
  min-height: 52px;
  font-size: 17px;
}

.topbar {
  min-height: 78px;
}

.breadcrumb,
.profile-button,
.today {
  color: #454545;
  font-size: 15px;
}

.avatar {
  width: 40px;
  height: 40px;
  font-size: 18px;
}

.welcome-row h1,
.section-heading h1 {
  font-size: 38px;
  letter-spacing: 0;
  line-height: 1.25;
}

.intro {
  color: #4f4f4f;
  font-size: 17px;
}

.stat-top {
  color: #333;
  font-size: 16px;
}

.stat-card {
  min-height: 165px;
}

.stat-card > strong {
  font-size: 42px;
}

.stat-card > small {
  color: #444;
  font-size: 15px;
}

.panel h2,
.modal h2 {
  font-size: 24px;
}

.recent-details strong,
.quick-link strong {
  font-size: 16px;
}

.recent-details small,
.quick-link small,
.recent-date {
  color: #4f4f4f;
  font-size: 14px;
}

.text-button,
.button {
  font-size: 16px;
}

.button {
  min-height: 48px;
  padding: 10px 18px;
}

.heading-actions {
  flex-wrap: wrap;
}

.search-box,
.select-filter {
  min-height: 48px;
  height: auto;
  font-size: 16px;
}

.search-box input {
  min-height: 44px;
  font-size: 16px;
}

.result-count {
  color: #4f4f4f;
  font-size: 14px;
}

th {
  height: 50px;
  color: #3d3d3d;
  font-size: 13px;
  letter-spacing: 0.04em;
}

td {
  color: #333;
  font-size: 16px;
}

.row-action {
  min-height: 44px;
  padding: 8px;
  font-size: 15px;
}

.status {
  padding: 6px 10px;
  font-size: 14px;
}

.status.positive {
  background: #e5f2e7;
  color: #174d24;
}

.status.negative {
  background: #fbe9e6;
  color: #70231a;
}

.status.muted,
.status.neutral {
  background: #ededed;
  color: #575757;
}

.numeric-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.field label,
.field-hint {
  color: #333;
  font-size: 16px;
}

.field input,
.field select,
.field textarea,
.inline-field input,
.inline-field select {
  min-height: 48px;
  font-size: 17px;
}

.icon-button {
  min-width: 48px;
  min-height: 48px;
  font-size: 28px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.file-button:focus-within {
  outline: 3px solid #252525;
  outline-offset: 3px;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.search-box input:focus-visible {
  outline: 3px solid #252525;
  outline-offset: 1px;
}

@media (max-width: 720px) {
  .topbar {
    padding: 0 18px;
  }

  .content {
    padding: 28px 18px 48px;
  }

  .welcome-row h1,
  .section-heading h1 {
    font-size: 32px;
  }

  .section-heading {
    align-items: flex-start;
    gap: 18px;
  }

  .heading-actions {
    width: 100%;
  }

  .heading-actions .button {
    flex: 1 1 100%;
  }

  .table-toolbar {
    flex-wrap: wrap;
  }

  .search-box {
    flex: 1 1 100%;
    max-width: none;
  }

  .select-filter {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
