:root {
  --hb-ink: #15233a;
  --hb-ink-soft: #243652;
  --hb-paper: #f7f4ee;
  --hb-panel: rgba(255, 252, 247, 0.94);
  --hb-brass: #c4893a;
  --hb-brass-deep: #a36f2a;
  --hb-mist: #d7e0ea;
  --hb-text: #1f2933;
  --hb-muted: #5b6b7c;
  --hb-line: rgba(21, 35, 58, 0.12);
  --hb-font-display: "Instrument Serif", Georgia, serif;
  --hb-font-body: "DM Sans", system-ui, sans-serif;
}

html {
  font-size: 15px;
  height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  font-family: var(--hb-font-body);
  color: var(--hb-text);
  margin: 0;
  min-height: 100%;
}

/* ----- Login atmosphere ----- */
.hb-login-page {
  background-color: var(--hb-ink);
  background-image:
    radial-gradient(ellipse 90% 70% at 15% 10%, rgba(196, 137, 58, 0.18), transparent 55%),
    radial-gradient(ellipse 80% 60% at 90% 85%, rgba(215, 224, 234, 0.12), transparent 50%),
    linear-gradient(105deg,
      #101a2c 0%,
      #15233a 18%,
      #1b2f4a 19%,
      #15233a 20%,
      #182840 38%,
      #203552 39%,
      #15233a 40%,
      #122033 62%,
      #2a3f5c 63%,
      #15233a 64%,
      #101a2c 100%);
  background-attachment: fixed;
  color: var(--hb-paper);
}

.hb-login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 46px,
      rgba(255, 255, 255, 0.015) 46px,
      rgba(255, 255, 255, 0.015) 48px
    );
  opacity: 0.7;
  z-index: 0;
}

.hb-login-page > * {
  position: relative;
  z-index: 1;
}

.hb-topbar {
  border-bottom: 1px solid rgba(247, 244, 238, 0.08);
  background: rgba(16, 26, 44, 0.35);
  backdrop-filter: blur(8px);
}

.hb-topbar .navbar {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}

.hb-brand-mark {
  font-family: var(--hb-font-display);
  font-size: 1.55rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--hb-paper) !important;
  text-decoration: none;
}

.hb-brand-mark:hover {
  color: #fff !important;
}

.hb-topbar-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--hb-brass);
}

.hb-footer {
  border-top: 1px solid rgba(247, 244, 238, 0.08);
  color: rgba(247, 244, 238, 0.55);
  background: transparent;
}

.hb-kicker {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hb-brass);
}

.hb-login-title {
  font-family: var(--hb-font-display);
  font-size: clamp(2.6rem, 6vw, 3.4rem);
  font-weight: 400;
  line-height: 1;
  color: #fff;
  letter-spacing: -0.01em;
}

.hb-login-sub {
  color: rgba(247, 244, 238, 0.72);
  font-size: 0.98rem;
  line-height: 1.5;
  max-width: 22rem;
  margin-inline: auto;
}

.hb-login-panel {
  background: var(--hb-panel);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 1rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 18px 40px rgba(8, 14, 28, 0.35);
  color: var(--hb-text);
}

.hb-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hb-ink-soft);
}

.hb-input {
  border: 1px solid var(--hb-line);
  background: #fff;
  color: var(--hb-text);
  border-radius: 0.65rem;
}

.hb-input::placeholder {
  color: #8a97a6;
}

.hb-input:focus {
  border-color: var(--hb-brass);
  box-shadow: 0 0 0 0.2rem rgba(196, 137, 58, 0.22);
}

.hb-btn-signin {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--hb-brass);
  --bs-btn-border-color: var(--hb-brass);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--hb-brass-deep);
  --bs-btn-hover-border-color: var(--hb-brass-deep);
  --bs-btn-focus-shadow-rgb: 196, 137, 58;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--hb-brass-deep);
  --bs-btn-active-border-color: var(--hb-brass-deep);
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 0.65rem;
  transition: transform 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.hb-btn-signin:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(163, 111, 42, 0.28);
}

.hb-login-enter {
  animation: hbRise 0.7s ease both;
}

.hb-login-enter .hb-login-panel {
  animation: hbRise 0.75s ease 0.08s both;
}

@keyframes hbRise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hb-login-enter,
  .hb-login-enter .hb-login-panel,
  .hb-btn-signin {
    animation: none;
    transition: none;
  }
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
  box-shadow: 0 0 0 0.2rem rgba(196, 137, 58, 0.22);
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* ----- Admin dashboard ----- */
.hb-dash {
  background: #eef2f6;
  color: var(--hb-text);
}

.hb-dash-shell {
  min-height: 100vh;
}

.hb-dash-sidebar {
  --hb-sidebar-width: 16.5rem;
  width: var(--hb-sidebar-width);
  flex: 0 0 var(--hb-sidebar-width);
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(196, 137, 58, 0.12), transparent 28%),
    linear-gradient(165deg, #101a2c 0%, #15233a 55%, #1a2d48 100%);
  color: var(--hb-paper);
  border-right: 1px solid rgba(247, 244, 238, 0.06);
  transition: width 0.22s ease, flex-basis 0.22s ease;
}

.hb-dash-brand {
  flex-shrink: 0;
}

.hb-dash-nav {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.hb-dash-shell.is-collapsed .hb-dash-sidebar {
  --hb-sidebar-width: 4.75rem;
}

.hb-dash-brand-link {
  font-family: var(--hb-font-display);
  font-size: 1.7rem;
  line-height: 1;
  color: #fff;
}

.hb-dash-brand-link:hover {
  color: #fff;
}

.hb-dash-brand-short {
  display: none;
  font-family: var(--hb-font-display);
  font-size: 1.35rem;
  color: #fff;
}

.hb-dash-collapse-btn {
  color: rgba(247, 244, 238, 0.75);
  border: 1px solid rgba(247, 244, 238, 0.14);
  background: rgba(255, 255, 255, 0.04);
  line-height: 1;
  padding: 0.3rem 0.45rem;
}

.hb-dash-collapse-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.hb-dash-nav-section {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(247, 244, 238, 0.45);
  padding: 0.55rem 0.85rem 0.35rem;
  white-space: nowrap;
}

.hb-dash-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.85rem;
  margin-bottom: 0.15rem;
  border-radius: 0.55rem;
  color: rgba(247, 244, 238, 0.78);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hb-dash-nav-icon {
  font-size: 1.15rem;
  width: 1.25rem;
  text-align: center;
  flex: 0 0 auto;
  line-height: 1;
}

.hb-dash-nav-text {
  min-width: 0;
  white-space: nowrap;
}

.hb-dash-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.hb-dash-nav-link.active {
  color: #fff;
  background: rgba(196, 137, 58, 0.18);
  border-color: rgba(196, 137, 58, 0.35);
}

.hb-dash-sidebar-foot {
  border-top: 1px solid rgba(247, 244, 238, 0.08);
  padding-top: 1rem;
  margin-top: auto;
  flex-shrink: 0;
}

.hb-dash-shell.is-collapsed .hb-dash-brand {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}

.hb-dash-shell.is-collapsed .hb-dash-brand-full,
.hb-dash-shell.is-collapsed .hb-dash-brand-meta,
.hb-dash-shell.is-collapsed .hb-dash-nav-section,
.hb-dash-shell.is-collapsed .hb-dash-nav-text {
  display: none;
}

.hb-dash-shell.is-collapsed .hb-dash-brand-short {
  display: inline;
}

.hb-dash-shell.is-collapsed .hb-dash-collapse-btn {
  margin-top: 0.55rem;
}

.hb-dash-shell.is-collapsed .hb-dash-nav,
.hb-dash-shell.is-collapsed .hb-dash-sidebar-foot {
  padding-left: 0.55rem;
  padding-right: 0.55rem;
}

.hb-dash-shell.is-collapsed .hb-dash-nav-link {
  justify-content: center;
  padding: 0.7rem 0.4rem;
  gap: 0;
}

.hb-dash-shell.is-collapsed .hb-dash-nav-section.mt-3 {
  margin-top: 0.35rem !important;
}

.hb-dash-main {
  min-width: 0;
}

.hb-dash-topbar {
  min-height: 4.25rem;
  background: rgba(255, 252, 247, 0.92);
  border-bottom: 1px solid rgba(21, 35, 58, 0.08);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.hb-dash-page-title {
  font-family: var(--hb-font-display);
  font-size: clamp(1.55rem, 2.4vw, 1.9rem);
  font-weight: 400;
  color: var(--hb-ink);
  line-height: 1.1;
}

.hb-dash-user {
  max-width: 11rem;
}

.hb-dash-user-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--hb-ink);
}

.hb-dash-user-role {
  font-size: 0.75rem;
  color: var(--hb-muted);
  text-transform: capitalize;
}

.hb-dash-menu-btn {
  border: 1px solid var(--hb-line);
  background: #fff;
  color: var(--hb-ink);
  font-weight: 600;
}

.hb-dash-content {
  /* no "both"/"forwards" — leftover transform traps Bootstrap modals behind the backdrop */
  animation: hbRise 0.45s ease;
}

.hb-dash-panel {
  background: #fff;
  border: 1px solid rgba(21, 35, 58, 0.08);
  border-radius: 1rem;
  padding: 1.25rem 1.25rem 1rem;
  box-shadow: 0 10px 28px rgba(21, 35, 58, 0.05);
}

.hb-dash-table thead th {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hb-muted);
  font-weight: 700;
  border-bottom-width: 1px;
  white-space: nowrap;
}

.hb-dash-table tbody td {
  border-color: rgba(21, 35, 58, 0.06);
}

.hb-dash-offcanvas {
  background: #15233a;
  color: var(--hb-paper);
  width: min(18rem, 86vw);
}

.hb-dash-offcanvas .hb-dash-nav-link {
  color: rgba(247, 244, 238, 0.78);
}

/* ----- Toasts ----- */
#hbToastContainer {
  z-index: 1100;
  width: min(26rem, calc(100vw - 1.5rem));
}

.hb-toast {
  width: 100%;
  background: #fffefb;
  border-radius: 0.9rem;
  box-shadow: 0 14px 36px rgba(21, 35, 58, 0.16);
  overflow: hidden;
  border-left: 4px solid var(--hb-brass) !important;
}

.hb-toast-success {
  border-left-color: #2f9d6a !important;
}

.hb-toast-error {
  border-left-color: #c44b4b !important;
}

.hb-toast-icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.hb-toast-success .hb-toast-icon {
  color: #1f7a52;
  background: rgba(47, 157, 106, 0.14);
}

.hb-toast-error .hb-toast-icon {
  color: #a53535;
  background: rgba(196, 75, 75, 0.14);
}

.hb-toast-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--hb-ink);
  line-height: 1.2;
  margin-bottom: 0.2rem;
}

.hb-toast-msg {
  font-size: 0.9rem;
  color: var(--hb-muted);
  line-height: 1.4;
}

.hb-toast .btn-close {
  font-size: 0.7rem;
}

/* ----- Books page / modal ----- */
.hb-book-summary {
  background: #fff;
  border: 1px solid rgba(21, 35, 58, 0.1);
  border-radius: 0.85rem;
  padding: 0.9rem 1rem;
  height: 100%;
  box-shadow: 0 8px 20px rgba(21, 35, 58, 0.04);
}

.hb-book-summary-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hb-muted);
  margin-bottom: 0.25rem;
}

.hb-book-summary-value {
  font-family: var(--hb-font-display);
  font-size: 1.55rem;
  line-height: 1.1;
  color: var(--hb-ink);
}

.hb-book-panel {
  border-radius: 1rem;
  overflow: hidden;
  background: #fff;
}

.hb-book-table thead th {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--hb-muted);
  font-weight: 700;
  background: #f7f9fc;
  border-bottom: 1px solid rgba(21, 35, 58, 0.08);
  padding: 0.9rem 1rem;
  white-space: nowrap;
}

.hb-book-table tbody td {
  padding: 0.95rem 1rem;
  border-color: rgba(21, 35, 58, 0.06);
}

.hb-book-empty {
  max-width: 18rem;
  padding: 1rem 0;
}

.hb-book-empty-icon {
  width: 3.25rem;
  height: 3.25rem;
  margin-inline: auto;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--hb-brass-deep);
  background: rgba(196, 137, 58, 0.14);
}

#bookFormModal .modal-dialog {
  height: calc(100vh - 1rem);
  max-height: calc(100vh - 1rem);
}

#bookFormModal .modal-content {
  height: 100%;
  max-height: calc(100vh - 1rem);
  overflow: hidden;
  border: 0;
  border-radius: 1rem;
}

.hb-book-modal-header {
  background:
    linear-gradient(180deg, rgba(196, 137, 58, 0.16), transparent 70%),
    linear-gradient(135deg, #101a2c 0%, #15233a 55%, #1a2d48 100%);
  color: #fff;
  padding: 1.15rem 1.35rem;
}

.hb-book-modal-header .modal-title {
  font-family: var(--hb-font-display);
  font-weight: 400;
  color: #fff;
}

#bookFormModal #frm_books {
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow: hidden;
}

#bookFormModal .modal-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  background: #fbfcfe;
  padding: 1.25rem 1.35rem;
}

.hb-book-tabs {
  flex-shrink: 0;
}

.hb-book-tabs .nav-link {
  border-radius: 999px;
  color: var(--hb-ink-soft);
  background: #fff;
  border: 1px solid rgba(21, 35, 58, 0.1);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 0.9rem;
}

.hb-book-tabs .nav-link i {
  margin-right: 0.25rem;
}

.hb-book-tabs .nav-link.active {
  color: #fff;
  background: var(--hb-ink);
  border-color: var(--hb-ink);
}

.hb-book-lang-bar .hb-book-lang-chip.active {
  background: var(--bs-primary);
  border-color: var(--bs-primary);
  color: #fff;
}

.hb-book-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hb-ink-soft);
}

.hb-book-status-box {
  display: flex;
  align-items: center;
  min-height: calc(1.5em + 0.75rem + 2px);
  background: #fff;
  border: 1px solid rgba(21, 35, 58, 0.1);
  border-radius: 0.65rem;
  padding: 0.55rem 0.9rem;
}

.hb-book-status-box .form-check {
  min-height: auto;
  padding-left: 0;
  margin-bottom: 0;
}

.hb-book-status-box .form-check-input {
  width: 2.5rem;
  height: 1.25rem;
  margin-left: 0;
  float: none;
}

.hb-book-receipt {
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.98), #fff 40%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 27px,
      rgba(21, 35, 58, 0.035) 28px
    );
  border: 1px solid rgba(21, 35, 58, 0.12);
  border-radius: 0.35rem;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8) inset,
    0 18px 40px rgba(21, 35, 58, 0.08);
  padding: 1.35rem 1.4rem 1.25rem;
  position: relative;
}

.hb-book-receipt::before,
.hb-book-receipt::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  height: 2px;
  background-image: radial-gradient(circle, rgba(21, 35, 58, 0.22) 1.1px, transparent 1.2px);
  background-size: 8px 2px;
  background-repeat: repeat-x;
  pointer-events: none;
}

.hb-book-receipt::before {
  top: 0.35rem;
}

.hb-book-receipt::after {
  bottom: 0.35rem;
}

.hb-book-receipt-head {
  text-align: center;
  margin-bottom: 1.15rem;
}

.hb-book-receipt-title {
  font-family: var(--hb-font-display);
  font-size: 1.65rem;
  line-height: 1.1;
  color: var(--hb-ink);
}

.hb-book-receipt-edit {
  padding: 0.15rem 0 0.35rem;
}

.hb-book-receipt-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--hb-ink-soft);
}

.hb-book-receipt-input {
  max-width: 14.5rem;
}

.hb-book-receipt-input .btn {
  min-width: 2.25rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  font-weight: 600;
  line-height: 1;
}

.hb-book-receipt-input .form-control,
.hb-book-receipt-input .input-group-text {
  border-color: rgba(21, 35, 58, 0.16);
  background: #fff;
}

.hb-book-receipt-input .form-control:focus {
  border-color: rgba(196, 137, 58, 0.55);
  box-shadow: 0 0 0 0.2rem rgba(196, 137, 58, 0.15);
}

.hb-book-receipt-rule {
  border-top: 1px dashed rgba(21, 35, 58, 0.28);
  margin: 1rem 0 0.85rem;
}

.hb-book-receipt-lines {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  color: var(--hb-ink-soft);
  font-size: 0.95rem;
}

.hb-book-receipt-amt {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--hb-ink);
  letter-spacing: 0.01em;
}

.hb-book-receipt-total {
  margin-top: 0.95rem;
  padding-top: 0.85rem;
  border-top: 2px solid var(--hb-ink);
}

.hb-book-receipt-total > div > span:first-child {
  font-family: var(--hb-font-display);
  font-size: 1.25rem;
  color: var(--hb-ink);
}

.hb-book-receipt-net {
  font-family: var(--hb-font-display);
  font-size: 1.85rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--hb-brass-deep);
  letter-spacing: 0.01em;
}

.hb-book-img-slot {
  position: relative;
  display: block;
  background: #fff;
  border: 1px dashed rgba(21, 35, 58, 0.22);
  border-radius: 0.9rem;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hb-book-img-file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hb-book-img-slot:hover,
.hb-book-img-slot:focus {
  border-color: rgba(196, 137, 58, 0.65);
  box-shadow: 0 10px 24px rgba(21, 35, 58, 0.08);
  outline: none;
}

.hb-book-img-slot.has-image {
  border-style: solid;
  border-color: rgba(21, 35, 58, 0.14);
}

.hb-book-img-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  text-align: center;
  background: linear-gradient(180deg, rgba(247, 244, 238, 0.65), #fff);
}

.hb-book-img-slot-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hb-brass-deep);
  background: rgba(196, 137, 58, 0.12);
  margin-bottom: 0.65rem;
}

.hb-book-img-ph-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--hb-ink-soft);
}

.hb-book-img-ph-sub {
  font-size: 0.75rem;
  color: var(--hb-muted);
  margin-top: 0.15rem;
}

.hb-book-img-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  display: block;
  padding: 0.5rem;
}

.hb-book-img-clear {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  line-height: 1;
  border-radius: 50%;
  border: 0;
  background: rgba(21, 35, 58, 0.82);
  color: #fff;
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(21, 35, 58, 0.25);
}

.hb-book-img-clear:hover,
.hb-book-img-clear:focus {
  background: #b42318;
  color: #fff;
}

.hb-cat-icon-slot {
  position: relative;
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  background: #fff;
  border: 1px dashed rgba(21, 35, 58, 0.22);
  border-radius: 0.9rem;
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 0;
  color: var(--hb-ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hb-cat-icon-slot:hover,
.hb-cat-icon-slot:focus {
  border-color: rgba(196, 137, 58, 0.65);
  box-shadow: 0 10px 24px rgba(21, 35, 58, 0.08);
  outline: none;
}

.hb-cat-icon-slot.has-image {
  border-style: solid;
  border-color: rgba(21, 35, 58, 0.14);
}

.hb-cat-icon-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(247, 244, 238, 0.65), #fff);
}

.hb-cat-icon-preview {
  position: absolute;
  inset: 0;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0.85rem;
  background: #fff;
  color: var(--hb-ink);
}

.hb-cat-icon-preview.d-none {
  display: none !important;
}

.hb-cat-icon-preview svg,
.hb-cat-icon-cell svg {
  width: 2.75rem;
  height: 2.75rem;
  max-width: 100%;
  max-height: 100%;
  display: block;
}

.hb-cat-icon-cell {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--hb-ink);
}

.hb-cat-icon-cell svg {
  width: 1.75rem;
  height: 1.75rem;
}

.hb-book-html-badge {
  background: rgba(21, 35, 58, 0.08);
  color: var(--hb-ink);
  font-weight: 600;
}

/* TinyMCE dropdowns / dialogs above Bootstrap modal */
.tox-tinymce-aux,
.tox-dialog-wrap {
  z-index: 1100 !important;
}

.hb-book-content-editor {
  border-radius: 0.75rem;
  border: 1px solid rgba(21, 35, 58, 0.12);
  background: #fff;
  min-height: 18rem;
}

.hb-book-html-source {
  border-radius: 0.75rem;
  border: 1px solid rgba(21, 35, 58, 0.12);
  background: #fff;
  min-height: 18rem;
  resize: vertical;
  font-size: 0.82rem;
  line-height: 1.45;
}

.hb-book-html-frame {
  display: block;
  width: 100%;
  min-height: 18rem;
  border: 1px solid rgba(21, 35, 58, 0.12);
  border-radius: 0.75rem;
  background: #fff;
}

#tab-content.active,
#tab-preview.active {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
}

#tab-content .hb-book-html-source,
#tab-preview .hb-book-html-source,
#tab-content .hb-book-html-frame,
#tab-preview .hb-book-html-frame {
  flex: 1 1 auto;
  width: 100%;
}

.hb-book-modal-footer {
  background: #fff;
  border-top: 1px solid rgba(21, 35, 58, 0.08);
  flex-shrink: 0;
}

#bookFormModal .hb-book-tabcontent {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#bookFormModal .hb-book-tabcontent > .tab-pane {
  min-height: 0;
}

#bookFormModal .hb-book-tabcontent > .tab-pane.active {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

@media (max-width: 575.98px) {
  #bookFormModal .modal-dialog {
    margin: 0.5rem;
    max-height: calc(100vh - 1rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hb-dash-content {
    animation: none;
  }

  .hb-dash-sidebar {
    transition: none;
  }
}
