/* Smooth theme transitions */
html {
  transition: color-scheme 0.25s ease;
}

body,
.app-sidebar,
.app-topbar,
.card {
  transition: background-color 0.25s ease, color 0.2s ease, border-color 0.25s ease;
}

/* Light (default) + dark (`html.dark`) — CA CloudDesk Library Management theme tokens */
html {
  color-scheme: light;
  --bg: #eef2f7;
  --surface: #ffffff;
  --card-bg: #ffffff;
  --dropdown-bg: #ffffff;
  --dropdown-border: #e5e7eb;
  --surface-2: #e2e8f0;
  --primary: #25b7a7;
  --accent: #0f766e;
  --text: #0f172a;
  --muted: #64748b;
  --success: #059669;
  --error: #dc2626;
  --warning: #d97706;
  --border: rgba(15, 23, 42, 0.1);
  --glass: rgba(255, 255, 255, 0.88);
  --radius: 14px;
  --font-heading: 'Sora', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --link: #0f766e;
  --link-hover: #115e59;
  --error-text: #b91c1c;
  --error-soft-bg: rgba(254, 226, 226, 0.85);
  --success-text: #047857;
  --success-soft-bg: rgba(209, 250, 229, 0.9);
  --chart-grid: rgba(15, 23, 42, 0.08);
  --chart-axis: #64748b;
  --sidebar-footer-bg: rgba(248, 250, 252, 0.95);
  --nav-active-bg: rgba(37, 183, 167, 0.14);
  --nav-active-border: rgba(37, 183, 167, 0.4);
  --book-card-muted-bg: rgba(15, 23, 42, 0.04);
  --book-thumb-bg: rgba(99, 102, 241, 0.14);
  --book-overlay-bg: rgba(248, 250, 252, 0.94);
  --overdue-row-border: rgba(220, 38, 38, 0.28);
  --overdue-row-bg: rgba(254, 226, 226, 0.55);
  --notif-unread-bg: rgba(99, 102, 241, 0.1);
  --toast-bg: #ffffff;
  --toast-fg: #0f172a;
  --toast-border: rgba(15, 23, 42, 0.12);
  --error-boundary-bg: #f8fafc;
  --error-boundary-fg: #0f172a;
  --error-boundary-muted: #64748b;
  --error-boundary-code-bg: #f1f5f9;
  --error-boundary-code-border: rgba(37, 183, 167, 0.25);
  --badge-ok-text: #047857;
  --badge-warn-text: #b45309;
  --badge-bad-text: #b91c1c;
  --auth-root-bg: linear-gradient(135deg, #f8fafc 0%, #e8f4f2 42%, #eef2f7 100%);
  --auth-brand-title: #0f172a;
  --auth-brand-tagline: rgba(15, 23, 42, 0.72);
  --auth-stat-card-bg: rgba(255, 255, 255, 0.85);
  --auth-stat-card-border: rgba(37, 183, 167, 0.28);
  --auth-stat-num: #0f766e;
  --auth-stat-label: rgba(15, 23, 42, 0.65);
  --auth-features: rgba(15, 23, 42, 0.88);
  --auth-panel-card-bg: rgba(255, 255, 255, 0.94);
  --auth-panel-card-border: rgba(37, 183, 167, 0.22);
  --auth-panel-card-shadow: 0 18px 50px rgba(15, 23, 42, 0.08);
  --auth-subtitle: rgba(71, 85, 105, 0.95);
  --auth-footer-note: rgba(71, 85, 105, 0.88);
  --auth-field-label: rgba(71, 85, 105, 0.95);
  --auth-brand-glow-1: rgba(37, 183, 167, 0.18);
  --auth-brand-glow-2: rgba(37, 183, 167, 0.08);
}

html.dark {
  color-scheme: dark;
  --bg: #0a0f1e;
  --surface: #111827;
  --card-bg: #111827;
  --dropdown-bg: #111827;
  --dropdown-border: rgba(148, 163, 184, 0.22);
  --surface-2: #1f2937;
  --primary: #25b7a7;
  --accent: #5eead4;
  --text: #f9fafb;
  --muted: #9ca3af;
  --success: #10b981;
  --error: #ef4444;
  --warning: #fbbf24;
  --border: rgba(148, 163, 184, 0.18);
  --glass: rgba(17, 24, 39, 0.72);
  --link: #5eead4;
  --link-hover: #99f6e4;
  --error-text: #fecaca;
  --error-soft-bg: rgba(239, 68, 68, 0.1);
  --success-text: #bbf7d0;
  --success-soft-bg: rgba(16, 185, 129, 0.12);
  --chart-grid: rgba(148, 163, 184, 0.12);
  --chart-axis: #9ca3af;
  --sidebar-footer-bg: rgba(2, 6, 23, 0.35);
  --nav-active-bg: rgba(37, 183, 167, 0.16);
  --nav-active-border: rgba(37, 183, 167, 0.35);
  --book-card-muted-bg: rgba(2, 6, 23, 0.25);
  --book-thumb-bg: rgba(99, 102, 241, 0.12);
  --book-overlay-bg: rgba(2, 6, 23, 0.65);
  --overdue-row-border: rgba(239, 68, 68, 0.25);
  --overdue-row-bg: rgba(239, 68, 68, 0.08);
  --notif-unread-bg: rgba(99, 102, 241, 0.08);
  --toast-bg: #111827;
  --toast-fg: #f9fafb;
  --toast-border: rgba(148, 163, 184, 0.2);
  --error-boundary-bg: #0a0f1e;
  --error-boundary-fg: #f9fafb;
  --error-boundary-muted: #9ca3af;
  --error-boundary-code-bg: #111827;
  --error-boundary-code-border: rgba(37, 183, 167, 0.22);
  --badge-ok-text: #bbf7d0;
  --badge-warn-text: #fde68a;
  --badge-bad-text: #fecaca;
  --auth-root-bg: linear-gradient(135deg, #061a1f 0%, #0c2a32 40%, #0a1620 100%);
  --auth-brand-title: #f0fdf9;
  --auth-brand-tagline: rgba(240, 253, 249, 0.72);
  --auth-stat-card-bg: rgba(255, 255, 255, 0.06);
  --auth-stat-card-border: rgba(37, 183, 167, 0.25);
  --auth-stat-num: #5eead4;
  --auth-stat-label: rgba(226, 232, 240, 0.7);
  --auth-features: rgba(226, 232, 240, 0.88);
  --auth-panel-card-bg: rgba(15, 23, 42, 0.72);
  --auth-panel-card-border: rgba(37, 183, 167, 0.22);
  --auth-panel-card-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --auth-subtitle: rgba(148, 163, 184, 0.95);
  --auth-footer-note: rgba(148, 163, 184, 0.85);
  --auth-field-label: rgba(148, 163, 184, 0.95);
  --auth-brand-glow-1: rgba(37, 183, 167, 0.35);
  --auth-brand-glow-2: rgba(37, 183, 167, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
#root {
  min-height: 100%;
  height: auto;
}

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 10% -10%, rgba(37, 183, 167, 0.12), transparent),
    radial-gradient(900px 500px at 100% 0%, rgba(94, 234, 212, 0.06), transparent), var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  transition:
    background 0.32s ease,
    color 0.25s ease;
}

html.dark body {
  background: radial-gradient(1200px 600px at 10% -10%, rgba(37, 183, 167, 0.16), transparent),
    radial-gradient(900px 500px at 100% 0%, rgba(94, 234, 212, 0.1), transparent), var(--bg);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  padding: 10px 16px;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(37, 183, 167, 0.22), rgba(37, 183, 167, 0.08));
  color: var(--text);
  transition:
    transform 0.12s ease,
    border-color 0.12s ease,
    opacity 0.12s ease,
    background 0.22s ease,
    color 0.2s ease;
}
.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 183, 167, 0.45);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.btn-ghost {
  background: rgba(15, 23, 42, 0.04);
  transition: background 0.22s ease, border-color 0.2s ease, color 0.2s ease;
}
html.dark .btn-ghost {
  background: rgba(255, 255, 255, 0.04);
}
.btn-accent {
  background: linear-gradient(180deg, rgba(94, 234, 212, 0.28), rgba(37, 183, 167, 0.12));
  border-color: rgba(94, 234, 212, 0.35);
}

.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.08);
  transition:
    background 0.28s ease,
    border-color 0.22s ease,
    box-shadow 0.28s ease;
}
html.dark .card {
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

.input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.65);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.25s ease,
    color 0.2s ease;
}
html.dark .input {
  background: rgba(2, 6, 23, 0.35);
}
.input:focus {
  border-color: rgba(37, 183, 167, 0.55);
  box-shadow: 0 0 0 3px rgba(37, 183, 167, 0.18);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.table th,
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  line-height: 1.45;
  transition: border-color 0.2s ease;
}
.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.badge.ok {
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--badge-ok-text);
}
.badge.warn {
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--badge-warn-text);
}
.badge.bad {
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--badge-bad-text);
}

.skeleton {
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.06), rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.06));
  background-size: 400% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: 10px;
}
html.dark .skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  background-size: 400% 100%;
}
@keyframes shimmer {
  0% {
    background-position: 0% 0;
  }
  100% {
    background-position: 100% 0;
  }
}

/* Full-app boot / session loader */
.app-boot-root {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(900px 500px at 50% -20%, rgba(37, 183, 167, 0.14), transparent 60%),
    radial-gradient(700px 400px at 100% 100%, rgba(94, 234, 212, 0.06), transparent 55%), var(--bg);
  transition: background 0.32s ease;
}
html.dark .app-boot-root {
  background: radial-gradient(900px 500px at 50% -20%, rgba(37, 183, 167, 0.2), transparent 60%),
    radial-gradient(700px 400px at 100% 100%, rgba(94, 234, 212, 0.08), transparent 55%), var(--bg);
}
.app-boot-glow {
  position: absolute;
  width: min(520px, 90vw);
  height: min(520px, 90vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 183, 167, 0.14), transparent 68%);
  filter: blur(40px);
  animation: app-boot-pulse 2.4s ease-in-out infinite;
  pointer-events: none;
}
html.dark .app-boot-glow {
  background: radial-gradient(circle, rgba(37, 183, 167, 0.18), transparent 68%);
}
@keyframes app-boot-pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}
.app-boot-card {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 380px;
}
.app-boot-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  color: #041014;
  background: linear-gradient(145deg, #25b7a7, #1a8f82);
  box-shadow: 0 16px 48px rgba(37, 183, 167, 0.35);
  animation: app-boot-float 2.8s ease-in-out infinite;
}
@keyframes app-boot-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}
.app-boot-title {
  margin: 0 0 8px;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.app-boot-msg {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.95rem;
}
.app-boot-hint {
  margin: 16px 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
  opacity: 0.9;
}
.app-boot-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  overflow: hidden;
}
.app-boot-bar-fill {
  height: 100%;
  width: 38%;
  border-radius: 999px;
  background: linear-gradient(90deg, #25b7a7, #5eead4);
  animation: app-boot-slide 1.35s ease-in-out infinite;
}
@keyframes app-boot-slide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(320%);
  }
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 1100px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 720px) {
  .grid-2,
  .grid-4 {
    grid-template-columns: 1fr;
  }
}

/* Auth layout uses variables from app.css */
.auth-root {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  background: var(--auth-root-bg);
  transition: background 0.32s ease;
}
@media (max-width: 960px) {
  .auth-root {
    grid-template-columns: 1fr;
  }
  .auth-brand {
    min-height: auto;
    padding: 28px 20px 12px;
  }
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  position: relative;
  overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 30% 30%, var(--auth-brand-glow-1), transparent 55%),
    radial-gradient(circle at 80% 20%, var(--auth-brand-glow-2), transparent 45%);
  pointer-events: none;
}

.auth-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 420px;
}

.auth-logo-mark {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.04em;
  background: linear-gradient(145deg, #25b7a7, #1a8f82);
  color: #041014;
  box-shadow: 0 16px 40px rgba(37, 183, 167, 0.35);
}

.auth-brand-title {
  margin: 18px 0 0;
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--auth-brand-title);
  transition: color 0.25s ease;
}

.auth-brand-tagline {
  margin: 10px 0 0;
  color: var(--auth-brand-tagline);
  font-size: 1rem;
  line-height: 1.5;
  transition: color 0.25s ease;
}

.auth-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
}
@media (max-width: 520px) {
  .auth-stats {
    grid-template-columns: 1fr;
  }
}

.auth-stat-card {
  background: var(--auth-stat-card-bg);
  border: 1px solid var(--auth-stat-card-border);
  border-radius: 14px;
  padding: 12px 14px;
  backdrop-filter: blur(10px);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    background 0.28s ease;
}
.auth-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 183, 167, 0.45);
}

.auth-stat-num {
  display: block;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--auth-stat-num);
  transition: color 0.22s ease;
}
.auth-stat-label {
  font-size: 0.75rem;
  color: var(--auth-stat-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-features {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--auth-features);
  font-size: 0.95rem;
}
.auth-features li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 48px;
}

.auth-panel-card {
  width: min(440px, 100%);
  background: var(--auth-panel-card-bg);
  border: 1px solid var(--auth-panel-card-border);
  border-radius: 22px;
  padding: 28px 26px 20px;
  box-shadow: var(--auth-panel-card-shadow);
  backdrop-filter: blur(16px);
  transition:
    background 0.28s ease,
    border-color 0.22s ease,
    box-shadow 0.28s ease;
}

.auth-subtitle {
  margin: 0 0 18px;
  color: var(--auth-subtitle);
  font-size: 0.95rem;
}

.auth-footer-note {
  margin: 20px 0 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--auth-footer-note);
}
.auth-footer-note a {
  color: var(--link);
  font-weight: 600;
}
.auth-footer-note a:hover {
  color: var(--link-hover);
}

.auth-badge-secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #25b7a7;
  border: 1px solid rgba(37, 183, 167, 0.4);
  padding: 6px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.auth-field {
  margin-bottom: 14px;
}
.auth-field label span {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--auth-field-label);
  margin-bottom: 6px;
}

.btn-primary {
  width: 100%;
  margin-top: 6px;
  padding: 12px 16px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
  color: #041014;
  background: linear-gradient(135deg, #25b7a7, #1d9488);
  box-shadow: 0 10px 28px rgba(37, 183, 167, 0.35);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease;
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 36px rgba(37, 183, 167, 0.45);
}
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.auth-link-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 0.88rem;
}
.auth-link-row a {
  color: var(--link);
  font-weight: 600;
}

.auth-theme-corner {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 50;
}

/* Scrollable modal body — book details / edit */
.modal-scroll {
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

.modal-scroll::-webkit-scrollbar {
  width: 8px;
}

.modal-scroll::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}

.modal-scroll::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.45);
  border-radius: 999px;
}

.modal-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.65);
}

html.dark .modal-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
}

html.dark .modal-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.55);
}

/* ——— Enterprise dashboard ——— */
.dash-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: none;
}

@keyframes dash-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dash-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.dash-hero__eyebrow {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
}

.dash-hero--solo {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.dash-hero--solo .dash-hero__title {
  margin: 8px 0 0;
  font-family: var(--font-heading);
  font-size: clamp(1.65rem, 2.8vw, 2rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}

.dash-hero__title {
  margin: 4px 0 0;
  font-size: clamp(1.5rem, 2.5vw, 1.85rem);
}

.dash-hero__sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.dash-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.dash-stats-grid--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dash-stat-card {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(12px);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.dash-stat-card:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 183, 167, 0.35);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

html.dark .dash-stat-card:hover {
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.dash-stat-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dash-stat-card__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.dash-stat-card__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(37, 183, 167, 0.14);
  color: var(--primary);
}

.dash-stat-card__value {
  margin-top: 10px;
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 800;
  line-height: 1.1;
}

.dash-stat-card__trend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
}

.dash-stat-card__trend.up {
  color: var(--success-text);
}

.dash-stat-card__trend.down {
  color: var(--error-text);
}

.dash-panel {
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(12px);
}

.dash-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.dash-panel__title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 800;
}

.dash-panel__head .dash-panel__title {
  margin-bottom: 0;
}

.dash-muted {
  color: var(--muted);
  font-size: 13px;
}

.dash-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--link);
}

.dash-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dash-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.dash-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dash-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dash-chart {
  min-height: 340px;
}

.dash-search {
  position: relative;
  flex: 1 1 320px;
  max-width: 480px;
}

.dash-search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.dash-search__input {
  padding-left: 40px !important;
  width: 100%;
}

.dash-search__panel {
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow: auto;
}

.dash-search__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.dash-search__item:hover {
  background: var(--nav-active-bg);
}

.dash-search__title {
  font-weight: 700;
  font-size: 14px;
}

.dash-search__sub {
  font-size: 12px;
  color: var(--muted);
}

.dash-search__empty {
  padding: 14px;
  color: var(--muted);
  font-size: 13px;
}

.dash-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dash-quick-actions__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(37, 183, 167, 0.08);
  font-size: 13px;
  font-weight: 600;
  transition:
    transform 0.12s ease,
    border-color 0.12s ease;
}

.dash-quick-actions__btn:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 183, 167, 0.4);
}

.dash-activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-activity-item {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.dash-activity-item__icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(37, 183, 167, 0.12);
  color: var(--primary);
  flex-shrink: 0;
}

.dash-activity-item__label {
  font-weight: 700;
  font-size: 14px;
}

.dash-activity-item__meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.dash-notif-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.dash-notif-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  font-weight: 800;
  font-size: 18px;
}

.dash-notif-chip small {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.dash-notif-chip.bad {
  background: var(--overdue-row-bg);
  border-color: var(--overdue-row-border);
}

.dash-notif-chip.warn {
  background: rgba(245, 158, 11, 0.1);
}

.dash-notif-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dash-notif-row {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.dash-notif-row.unread {
  background: var(--notif-unread-bg);
}

.dash-notif-row__title {
  font-weight: 700;
  font-size: 13px;
}

.dash-health-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dash-health-list li {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.dash-health-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.dash-health-dot.ok {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25);
}

.dash-health-dot.bad {
  background: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}

.dash-recent-books {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dash-book-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  transition:
    transform 0.12s ease,
    border-color 0.12s ease;
}

.dash-book-card:hover {
  transform: translateX(2px);
  border-color: rgba(37, 183, 167, 0.35);
}

.dash-book-card__cover {
  width: 52px;
  height: 68px;
  border-radius: 10px;
  background: var(--book-thumb-bg);
  display: grid;
  place-items: center;
  color: var(--muted);
  overflow: hidden;
  flex-shrink: 0;
}

.dash-book-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dash-book-card__title {
  font-weight: 800;
  font-size: 14px;
  line-height: 1.3;
}

.dash-book-card__foot {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.dash-issue-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.dash-issue-row.overdue {
  border-color: var(--overdue-row-border);
  background: var(--overdue-row-bg);
}

.dash-issue-row__title {
  font-weight: 700;
}

@media (max-width: 1200px) {
  .dash-stats-grid,
  .dash-stats-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-row-3 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .dash-stats-grid,
  .dash-stats-grid--compact,
  .dash-row-2,
  .dash-charts-grid {
    grid-template-columns: 1fr;
  }
  .dash-hero {
    flex-direction: column;
    align-items: stretch;
  }
  .dash-search {
    max-width: none;
  }
}

.books-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  flex-wrap: wrap;
}

.books-toolbar__search {
  position: relative;
  flex: 1 1 280px;
  min-width: 200px;
}

.books-toolbar__search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.books-toolbar__search-input {
  width: 100%;
  padding-left: 40px;
}

.books-toolbar__action {
  flex-shrink: 0;
  white-space: nowrap;
}

.books-toolbar__add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

@media (max-width: 900px) {
  .books-toolbar {
    flex-wrap: wrap;
  }
  .books-toolbar__search {
    flex: 1 1 100%;
  }
}

.dash-panel--clickable {
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dash-panel--clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 183, 167, 0.12);
}

.dash-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.dash-section-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 700;
}

.dash-revenue-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.revenue-table__scroll {
  overflow: auto;
  max-height: 220px;
}

/* Fine management — enterprise table */
.fines-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  position: relative;
  z-index: 30;
  overflow: visible;
}

.fines-page-header__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fines-view-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.fines-view-label__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

.fines-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.fines-filters__search {
  min-width: 160px;
  flex: 1 1 160px;
  max-width: 220px;
}

.fines-filters__search .input {
  padding-left: 36px;
  font-size: 0.85rem;
}

.fines-filters__select {
  min-width: 130px;
  width: auto;
  font-size: 0.85rem;
}

.fines-filters__check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.input--sm {
  padding: 8px 12px;
  font-size: 0.85rem;
  border-radius: 10px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.82rem;
}

.fines-menu {
  position: relative;
  flex-shrink: 0;
  z-index: 1;
}

.fines-menu.is-open {
  z-index: 10000;
}

.fines-menu__trigger {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 12px;
}

.fines-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 9999;
  min-width: 200px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  opacity: 1;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  animation: fines-menu-in 0.18s ease;
  isolation: isolate;
}

html.dark .fines-menu__panel {
  background: #111827;
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.fines-menu__panel[hidden] {
  display: none !important;
}

@keyframes fines-menu-in {
  from {
    transform: translateY(-6px) scale(0.98);
  }
  to {
    transform: translateY(0) scale(1);
  }
}

.fines-menu__heading {
  padding: 6px 10px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.fines-menu__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease;
}

.fines-menu__item:hover,
.fines-menu__item.is-active {
  background: rgba(37, 183, 167, 0.12);
  color: var(--primary);
}

.fines-menu__item--btn {
  font-family: inherit;
}

.fines-menu__item--danger:hover {
  background: var(--error-soft-bg);
  color: var(--error-text);
}

.fines-menu__badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: #dc2626;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fines-menu__divider {
  height: 1px;
  margin: 6px 8px;
  background: var(--border);
}

.fines-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.fines-summary__card {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fines-summary__label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.fines-summary__value {
  font-size: 1.15rem;
  font-weight: 700;
}

.fines-bulk-bar {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 14px;
  border-radius: 12px;
  border: 1px solid rgba(37, 183, 167, 0.35);
  background: var(--nav-active-bg);
  animation: modal-fade-in 0.2s ease;
}

.fines-bulk-bar.is-visible {
  display: flex;
}

.fines-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  max-height: none;
}

.fines-table {
  font-size: 0.88rem;
}

.fines-table thead th {
  position: static;
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 10px 12px;
  white-space: nowrap;
}

.fines-table tbody td {
  padding: 10px 12px;
  vertical-align: middle;
}

.fines-table__row {
  transition: background 0.12s ease;
}

.fines-table__row:hover {
  background: var(--nav-active-bg);
}

.fines-table__check {
  width: 44px;
}

.fines-table__actions {
  width: 140px;
}

.fines-table__member {
  display: block;
  font-weight: 600;
}

.fines-table__sub {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

.fines-table__book {
  max-width: 200px;
  font-weight: 500;
}

.fines-table__amount {
  font-weight: 700;
  white-space: nowrap;
}

.fines-table__date {
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.fines-table__empty {
  text-align: center;
  padding: 32px !important;
  color: var(--muted);
  vertical-align: middle;
}

.fines-row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fines-row-actions .icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.icon-btn--danger {
  background: var(--error-soft-bg);
  border-color: rgba(220, 38, 38, 0.2);
  color: var(--error-text);
}

.icon-btn--danger:hover {
  border-color: rgba(220, 38, 38, 0.45);
}

.badge.neutral {
  background: rgba(100, 116, 139, 0.12);
  color: var(--muted);
}

.fines-pagination {
  margin-top: 14px;
}

.modal--sm {
  width: min(420px, calc(100vw - 32px));
}

.fines-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sidebar-icon-btn--notify {
  position: relative;
  text-decoration: none;
}

.sidebar-notify-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  background: #dc2626;
  color: #fff;
  border: 2px solid var(--card-bg);
}

.sidebar-icon-btn--notify.is-active {
  background: var(--nav-active-bg);
  color: var(--primary);
}



@media (max-width: 1100px) {
  .dash-revenue-grid {
    grid-template-columns: 1fr;
  }
}

/* Centered scrollable modal system (global) */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: modal-fade-in 0.22s ease;
  overflow: hidden;
  overscroll-behavior: contain;
}
html.dark .modal-backdrop {
  background: rgba(2, 6, 23, 0.82);
}
.modal {
  position: relative;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  animation: modal-slide-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18);
  margin: auto;
  min-height: 0;
  flex-shrink: 0;
}
html.dark .modal {
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}
.modal--lg,
.modal--form,
.modal--form-wide,
.modal--xl,
.modal--add-book {
  width: 90%;
  max-width: 900px;
}
.modal--add-book {
  max-width: 1000px;
}
.modal--sm {
  width: min(420px, calc(100vw - 32px));
  max-width: 420px;
}
/* Form fills modal between header and edges */
.modal > form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  margin: 0;
}
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  flex: 0 0 auto;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 3;
}
.modal__header h2 {
  margin: 0;
  font-size: 1.15rem;
}
.modal__body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 80vh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding: 0;
}
.modal__body-pad {
  padding: 20px 22px 24px;
}
.modal__footer {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  flex: 0 0 auto;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 3;
}

/* Temporary password prompt — compact enterprise dialog */
.password-prompt-modal {
  width: min(440px, calc(100vw - 32px));
  max-width: 440px;
  max-height: min(92vh, 640px);
}

.password-prompt-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  margin: 0;
}

.password-prompt-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.password-prompt-lead {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--muted);
}

.password-prompt-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.password-prompt-fields .form-field {
  gap: 8px;
}

.password-prompt-fields .form-field label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
}

.password-prompt-fields .input {
  min-height: 42px;
  background: var(--surface, #fff);
  border: 1px solid var(--border);
}

.password-prompt-fields .input:focus {
  border-color: color-mix(in srgb, var(--accent, #14b8a6) 55%, var(--border));
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #14b8a6) 18%, transparent);
}

.password-prompt-hint {
  margin: 2px 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
}

.password-prompt-footer {
  gap: 10px;
}

.password-prompt-footer .btn {
  min-width: 0;
}

@media (max-width: 480px) {
  .password-prompt-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .password-prompt-footer .btn {
    width: 100%;
    justify-content: center;
  }
}

.modal__body::-webkit-scrollbar {
  width: 8px;
}
.modal__body::-webkit-scrollbar-track {
  background: transparent;
}
.modal__body::-webkit-scrollbar-thumb {
  background: rgba(37, 183, 167, 0.35);
  border-radius: 999px;
}
.modal__body::-webkit-scrollbar-thumb:hover {
  background: rgba(37, 183, 167, 0.55);
}
html.dark .modal__body::-webkit-scrollbar-thumb {
  background: rgba(37, 183, 167, 0.4);
}
.modal__split {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  align-items: start;
  gap: 0;
  min-height: 0;
}
.modal__panel-left {
  padding: 22px;
  border-right: 1px solid var(--border);
  background: rgba(37, 183, 167, 0.04);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
html.dark .modal__panel-left {
  background: rgba(37, 183, 167, 0.06);
}
.modal__panel-right {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal__cover {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 3/4;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--book-thumb-bg);
  margin: 0 auto;
  display: block;
}
.modal__cover-placeholder {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 3/4;
  border-radius: 12px;
  border: 1px dashed var(--border);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 auto;
}
.modal__cover-placeholder--compact {
  max-width: 160px;
  min-height: 120px;
}
.modal__cover-edit {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
  margin: 0 auto;
}
.modal__footer--split {
  justify-content: space-between;
}
.modal-form-grid,
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.form-field--full,
.modal-form-grid .form-field--full {
  grid-column: 1 / -1;
}
.form-field--checkbox {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding-top: 4px;
}
.form-field--checkbox label {
  margin: 0;
  font-weight: 600;
  color: var(--text);
}
.add-book-textarea,
.modal-form-textarea {
  resize: vertical;
  min-height: 72px;
  max-height: 120px;
  line-height: 1.45;
}
.add-book-layout {
  display: grid;
  grid-template-columns: minmax(200px, 260px) 1fr;
  gap: 22px;
  align-items: start;
}
.add-book-upload {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(37, 183, 167, 0.04);
}
html.dark .add-book-upload {
  background: rgba(37, 183, 167, 0.06);
}
.add-book-upload__label {
  font-size: 0.875rem;
}
.add-book-fields {
  min-width: 0;
}
.upload-dropzone {
  position: relative;
  min-height: 220px;
  border: 2px dashed rgba(37, 183, 167, 0.45);
  border-radius: 14px;
  display: grid;
  place-items: center;
  padding: 16px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
  background: rgba(255, 255, 255, 0.4);
}
html.dark .upload-dropzone {
  background: rgba(2, 6, 23, 0.35);
}
.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  border-color: var(--primary);
  background: var(--nav-active-bg);
  transform: translateY(-1px);
}
.upload-dropzone__empty {
  text-align: center;
  display: grid;
  place-items: center;
  gap: 4px;
}
.upload-dropzone__preview {
  max-width: 100%;
  max-height: 200px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
}
.upload-dropzone__preview:not(.hidden) + .upload-dropzone__empty,
.upload-dropzone__pdf:not(.hidden) ~ .upload-dropzone__empty {
  display: none;
}
.upload-dropzone__pdf {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.75rem;
  word-break: break-word;
  color: var(--text, #e2e8f0);
}
.upload-dropzone__pdf.hidden {
  display: none !important;
}
.dash-cover__pdf {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: var(--primary, #14b8a6);
  font-size: 0.7rem;
  font-weight: 700;
}
.modal__cover-pdf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 1rem;
  border: 1px dashed color-mix(in srgb, var(--primary, #14b8a6) 45%, var(--border));
  border-radius: 12px;
  color: var(--primary, #14b8a6);
  font-weight: 600;
  text-decoration: none;
}
.input--error {
  border-color: rgba(220, 38, 38, 0.55) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}
.modal--hidden,
.hidden {
  display: none !important;
}
html.modal-open,
body.modal-open {
  overflow: hidden !important;
  height: 100%;
}
body.modal-open {
  position: fixed;
  width: 100%;
  left: 0;
  right: 0;
  touch-action: none;
}
@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modal-slide-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dash-stat-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dash-stat-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(37, 183, 167, 0.14);
}

.dash-footer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px 0 8px;
}
.dash-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.2s ease;
}
.dash-action-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(37, 183, 167, 0.45);
}
.dash-action-btn--danger:hover {
  border-color: rgba(220, 38, 38, 0.45);
  color: var(--error);
}
.dash-action-btn--warn:hover {
  border-color: rgba(217, 119, 6, 0.45);
  color: var(--warning);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-logo--lg,
.brand-logo--xl {
  flex-direction: column;
  text-align: center;
  gap: 12px;
}
.brand-logo__img {
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
  display: block;
  background: transparent;
}
.brand-logo--sm .brand-logo__img {
  width: auto;
  height: 36px;
  max-height: 40px;
  max-width: min(160px, 42vw);
}
.brand-logo--md .brand-logo__img {
  width: auto;
  height: 48px;
  max-height: 52px;
  max-width: min(220px, 70vw);
}
.brand-logo--lg .brand-logo__img {
  width: auto;
  height: auto;
  max-height: 120px;
  max-width: min(280px, 92vw);
}
.brand-logo--xl .brand-logo__img {
  width: auto;
  height: auto;
  max-height: 160px;
  max-width: min(320px, 90vw);
}
.brand-logo--lg .brand-logo__text,
.brand-logo--xl .brand-logo__text {
  display: none;
}

.sidebar-footer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding-top: 12px;
  margin-top: auto;
  border-top: 1px solid var(--border);
}
.sidebar-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.2s ease;
}
.sidebar-icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 183, 167, 0.45);
  background: var(--nav-active-bg);
}
.sidebar-icon-btn--logout:hover {
  border-color: rgba(220, 38, 38, 0.35);
  color: var(--error);
}
.theme-toggle-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.theme-toggle-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.theme-toggle-option.active {
  border-color: rgba(37, 183, 167, 0.5);
  background: var(--nav-active-bg);
}
.theme-switch {
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.25s;
}
.theme-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  transition: transform 0.25s ease;
}
.theme-switch.is-dark::after {
  transform: translateX(22px);
}
.books-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 420px;
}
.search-input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
.search-input-wrap .input {
  padding-left: 40px;
}
/* Books page — see css/books.css */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s, background 0.2s;
}
.action-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 183, 167, 0.45);
}
.action-btn--issue {
  background: rgba(37, 183, 167, 0.12);
  color: var(--accent);
  font-weight: 700;
}
.action-btn--return:hover {
  border-color: rgba(217, 119, 6, 0.45);
  color: var(--warning);
}
.action-btn--edit:hover {
  border-color: rgba(99, 102, 241, 0.4);
}
.btn-pill {
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.88rem;
}
.form-field {
  display: grid;
  gap: 6px;
}
.form-field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.form-field .field-error {
  font-size: 0.78rem;
  color: var(--error-text);
}
.img-preview {
  max-width: 120px;
  max-height: 160px;
  border-radius: 10px;
  border: 1px solid var(--border);
  object-fit: cover;
}
@media (max-width: 768px) {
  .modal-backdrop {
    padding: 12px;
    align-items: center;
  }
  .modal,
  .modal--lg,
  .modal--xl,
  .modal--form,
  .modal--form-wide,
  .modal--add-book {
    width: calc(100vw - 24px);
    max-width: none;
    max-height: 90vh;
  }
  .modal-form-grid,
  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .add-book-layout {
    grid-template-columns: 1fr;
  }
  .upload-dropzone {
    min-height: 180px;
  }
  .modal__body-pad {
    padding: 16px 18px 20px;
  }
  .modal__header,
  .modal__footer {
    padding-left: 18px;
    padding-right: 18px;
  }
  .modal__split {
    grid-template-columns: 1fr;
  }
  .modal__panel-left {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

.app-shell {
  display: grid;
  width: 100%;
  min-height: 100vh;
  overflow: visible;
}

/* .app-sidebar — see sidebar-layout.css */

.app-main {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: none;
  display: block;
  overflow: visible;
  padding: 0;
  box-sizing: border-box;
}
.app-nav-link {
  /* Base + states defined in sidebar-layout.css */
}
.app-nav-link.active,
.app-nav-link.is-active,
.app-nav-link:hover {
  /* States defined in sidebar-layout.css */
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(37, 183, 167, 0.1);
  cursor: pointer;
  color: var(--text);
}
.icon-btn:hover {
  border-color: rgba(37, 183, 167, 0.45);
}
.alert {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 0.92rem;
}
.alert-success {
  background: var(--success-soft-bg);
  color: var(--success-text);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.alert-error {
  background: var(--error-soft-bg);
  color: var(--error-text);
  border: 1px solid rgba(220, 38, 38, 0.28);
}
@media (max-width: 900px) {
  .app-main {
    padding: 0 12px 24px;
  }
}
/* UI restore patch — layout shell, dashboard tiles, utilities (no Tailwind required) */

/* Sidebar shell — sidebar-layout.css, sidebar-brand.css */

.app-nav {
  /* Flex/gap defined in sidebar-layout.css */
}

/* .app-main padding — see topbar.css (app-frame layout) */

.app-main__header {
  flex-shrink: 0;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  position: sticky;
  top: 0;
  z-index: 30;
}

.app-main__header-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
}

.app-main__header-title {
  margin: 8px 0 0;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

/* Dashboard stat tiles */
.dash-stats-grid--home {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.dash-stat-link.card,
.dash-stat-card.card {
  padding: 10px 12px;
  min-height: 0;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  box-shadow: none;
  backdrop-filter: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dash-stat-link.card:hover,
.dash-stat-card.card:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--accent, #0f766e) 40%, var(--border));
  box-shadow: none;
  background: color-mix(in srgb, var(--surface, #fff) 92%, var(--accent, #0f766e));
}

.dash-stat-tile__label,
.dash-stat-card__label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.dash-stat-tile__value,
.dash-stat-card__value {
  margin: 4px 0 0;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text);
}

.dash-stat-tile__meta,
.dash-stat-card__meta {
  margin: 3px 0 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-recent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dash-recent-card {
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: none;
}

.dash-section-title {
  margin: 0 0 10px;
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
}

.dash-recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.dash-recent-list li {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.dash-recent-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* ——— Spacing & typography utilities used in Blade ——— */
.m-0 { margin: 0; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.p-2 { padding: 8px; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.leading-tight { line-height: 1.25; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.min-w-0 { min-width: 0; }
.flex-1 { flex: 1; }
.overflow-hidden { overflow: hidden; }
.sticky { position: sticky; }
.top-0 { top: 0; }
.z-30 { z-index: 30; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.grid { display: grid; }
.place-items-center { place-items: center; }
.rounded-xl { border-radius: 14px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }

.page-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.page-toolbar__search {
  flex: 1;
  min-width: 200px;
  max-width: 480px;
}

.table-card {
  padding: 0;
  overflow: hidden;
}

.app-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.dash-page {
  width: 100%;
  max-width: none;
}

@media (max-width: 1100px) {
  .dash-stats-grid--home {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dash-recent-grid {
    grid-template-columns: 1fr;
  }
  .dash-stats-grid--home {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .dash-stats-grid--home {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}

@media (max-width: 640px) {
  .app-main {
    padding: 0 16px 32px;
  }
}

/* Sidebar theme toggle icons */
.sidebar-theme-icon {
  display: block;
}
html:not(.dark) .sidebar-theme-icon--moon {
  display: none;
}
html.dark .sidebar-theme-icon--sun {
  display: none;
}

/* ——— UI polish: live-search navigation hint, shared table empty cells ——— */
[data-live-search].is-live-search-loading [data-live-search-input],
[data-live-search][aria-busy='true'] [data-live-search-input],
form[data-live-search-form].is-live-search-loading input[type='search'],
form[data-live-search-form].is-live-search-loading input[type='text'],
form[data-live-search-form][aria-busy='true'] input[type='search'],
form[data-live-search-form][aria-busy='true'] input[type='text'] {
  opacity: 0.78;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.ccd-table-empty {
  text-align: center;
  padding: 28px 20px !important;
  color: var(--muted);
  line-height: 1.5;
}

.ccd-table-empty__title {
  margin: 0 0 8px;
  font-weight: 600;
  color: var(--text);
}

.ccd-table-empty__hint {
  margin: 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.dash-page__intro {
  margin: 0 0 2px;
  font-size: 0.875rem;
  line-height: 1.4;
  color: var(--muted);
}

/* ——— Dashboard analytics (CSS-only charts, theme colors) ——— */
.dash-analytics-caption {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: var(--muted);
}

.dash-analytics-charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.dash-analytics-chart-card {
  padding: 12px 14px 14px;
  min-width: 0;
  border-radius: 10px;
  box-shadow: none;
}

.dash-bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  height: 140px;
  margin-top: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.dash-bar-chart--single .dash-bar-chart__col {
  flex: 1;
}

.dash-bar-chart__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.dash-bar-chart__bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 120px;
  width: 100%;
}

.dash-bar-chart__bars--single {
  justify-content: center;
}

.dash-bar-chart__bar {
  flex: 1;
  max-width: 14px;
  min-height: 0;
  border-radius: 4px 4px 2px 2px;
  align-self: flex-end;
  transition: height 0.2s ease;
}

.dash-bar-chart__bar--issues {
  background: linear-gradient(180deg, #14b8a6, #0d9488);
}

.dash-bar-chart__bar--returns {
  background: linear-gradient(180deg, #64748b, #475569);
}

.dash-bar-chart__bar--fines {
  background: linear-gradient(180deg, #84cc16, #65a30d);
}

.dash-bar-chart__label {
  margin-top: 8px;
  font-size: 0.68rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.dash-bar-chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--muted);
}

.dash-bar-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dash-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.dash-legend-dot--issues {
  background: #0d9488;
}

.dash-legend-dot--returns {
  background: #475569;
}

.dash-analytics-widgets,
.dash-activity-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.dash-widget-card {
  padding: 12px 14px;
  min-width: 0;
  border-radius: 10px;
  box-shadow: none;
}

.dash-widget-hint {
  margin: 0 0 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

.dash-widget-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-widget-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.dash-widget-list li:last-child {
  border-bottom: none;
}

.dash-widget-list__title {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text);
  line-height: 1.35;
}

.dash-widget-list__meta {
  font-size: 0.78rem;
  color: var(--muted);
}

.dash-widget-list__empty {
  color: var(--muted);
  font-size: 0.875rem;
  padding: 8px 0 !important;
  border: none !important;
}

.dash-activity-feed {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dash-activity-feed__item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}

.dash-activity-feed__item:last-child {
  border-bottom: none;
}

.dash-activity-feed__label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--text);
}

.dash-activity-feed__meta {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
}

@media (max-width: 639px) {
  .dash-bar-chart {
    height: 120px;
  }

  .dash-bar-chart__bars {
    height: 100px;
  }
}
