@tailwind base;
@tailwind components;
@tailwind utilities;

/* ==========================================================================
   Unified Blue & White Design System
   Shared CSS variables for both Admin and Borrower dashboards.
   ========================================================================== */
:root {
  /* Core palette */
  --color-light: #ffffff;
  --color-dark: #171717;
  --navy-deep: #1a2a4a;
  --navy: #1e2d4a;
  --navy-hover: #2a3f6a;
  --blue-accent: #2563eb;
  --blue-500: #3b82f6;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;

  /* Blue & White theme - shared across both dashboards */
  --blue-primary: #2563eb;
  --blue-primary-dark: #1d4ed8;
  --blue-primary-light: #3b82f6;
  --blue-50: #eff6ff;
  --blue-100: #dbeafe;
  --blue-200: #bfdbfe;
  --blue-300: #93c5fd;
  --blue-400: #60a5fa;
  --blue-600: #2563eb;
  --blue-700: #1d4ed8;
  --blue-800: #1e40af;
  --blue-900: #1e3a8a;

  --white: #ffffff;
  --white-50: #ffffff;
  --white-100: #f8fafc;
  --white-200: #f1f5f9;
  --white-300: #e2e8f0;
  --white-400: #cbd5e1;
  --white-500: #94a3b8;
  --white-600: #64748b;
  --white-700: #475569;
  --white-800: #334155;
  --white-900: #1e293b;

  --sidebar-bg: var(--blue-primary-dark);
  --sidebar-bg-hover: var(--blue-800);
  --sidebar-text: #ffffff;
  --sidebar-text-muted: #bfdbfe;
  --content-bg: var(--white-100);
  --card-bg: var(--white);
  --card-border: var(--white-300);
  --text-primary: var(--white-900);
  --text-secondary: var(--white-600);
  --hover-bg: var(--blue-50);
  --active-bg: var(--blue-100);
  --active-text: var(--blue-700);
  --border-color: var(--white-300);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.15);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
}

html[data-color-theme] {
  --blue-accent: var(--blue-primary);
  --sidebar-bg: var(--blue-primary-dark);
  --sidebar-bg-hover: var(--blue-800);
  --sidebar-text-muted: var(--blue-200);
  --hover-bg: var(--blue-50);
  --active-bg: var(--blue-100);
  --active-text: var(--blue-700);
  --border-color: var(--blue-200);
}
html[data-color-theme="ocean-blue"] {
  --blue-primary: #1677b8;
  --blue-primary-dark: #125a8d;
  --blue-primary-light: #40a9e0;
  --blue-50: #eaf6fc;
  --blue-100: #d5ebf8;
  --blue-200: #b6dcf1;
  --blue-300: #8bc6e8;
  --blue-400: #5aadde;
  --blue-500: #3293cd;
  --blue-600: #1677b8;
  --blue-700: #125f96;
  --blue-800: #124e78;
  --blue-900: #123f5f;
}
html[data-color-theme="sage-green"] {
  --blue-primary: #57795d;
  --blue-primary-dark: #4d6c53;
  --blue-primary-light: #83a889;
  --blue-50: #f0f5f0;
  --blue-100: #e0ebe1;
  --blue-200: #c8dccb;
  --blue-300: #a9c5ad;
  --blue-400: #8eb397;
  --blue-500: #779e80;
  --blue-600: #57795d;
  --blue-700: #4d6c53;
  --blue-800: #3f5945;
  --blue-900: #344a39;
}
html[data-color-theme="lavender"] {
  --blue-primary: #705990;
  --blue-primary-dark: #69548f;
  --blue-primary-light: #aa96d0;
  --blue-50: #f5f1fa;
  --blue-100: #ebe4f5;
  --blue-200: #d9cbed;
  --blue-300: #c2addf;
  --blue-400: #aa91d0;
  --blue-500: #987fc2;
  --blue-600: #705990;
  --blue-700: #5d4a7c;
  --blue-800: #4e3e68;
  --blue-900: #403354;
}
html[data-color-theme="slate-gray"] {
  --blue-primary: #64748b;
  --blue-primary-dark: #475569;
  --blue-primary-light: #94a3b8;
  --blue-50: #f1f5f9;
  --blue-100: #e2e8f0;
  --blue-200: #cbd5e1;
  --blue-300: #b1bdcb;
  --blue-400: #94a3b8;
  --blue-500: #7c8da3;
  --blue-600: #64748b;
  --blue-700: #526176;
  --blue-800: #455366;
  --blue-900: #394555;
}
html[data-color-theme="teal"] {
  --blue-primary: #0b7375;
  --blue-primary-dark: #0b6668;
  --blue-primary-light: #36aaaa;
  --blue-50: #e9f7f6;
  --blue-100: #d2efed;
  --blue-200: #b1e3e1;
  --blue-300: #83d0ce;
  --blue-400: #55bdbc;
  --blue-500: #2ba4a5;
  --blue-600: #0b7375;
  --blue-700: #0b7072;
  --blue-800: #0a5d5f;
  --blue-900: #084c4e;
}
html[data-color-theme="dusty-rose"] {
  --blue-primary: #99525c;
  --blue-primary-dark: #94515d;
  --blue-primary-light: #cf8b94;
  --blue-50: #fbf1f2;
  --blue-100: #f5e1e4;
  --blue-200: #edcbd0;
  --blue-300: #dfadb4;
  --blue-400: #cf8b94;
  --blue-500: #c17782;
  --blue-600: #99525c;
  --blue-700: #844651;
  --blue-800: #713c46;
  --blue-900: #5f333b;
}
html[data-color-theme="sand-beige"] {
  --blue-primary: #876c40;
  --blue-primary-dark: #806943;
  --blue-primary-light: #c2a878;
  --blue-50: #f8f5ef;
  --blue-100: #f0eadd;
  --blue-200: #e2d6c0;
  --blue-300: #d1bf9f;
  --blue-400: #c2a878;
  --blue-500: #b49468;
  --blue-600: #876c40;
  --blue-700: #715a36;
  --blue-800: #604d2f;
  --blue-900: #514127;
}
html[data-color-theme="charcoal"] {
  --blue-primary: #4b5563;
  --blue-primary-dark: #374151;
  --blue-primary-light: #6b7280;
  --blue-50: #f3f4f6;
  --blue-100: #e5e7eb;
  --blue-200: #d1d5db;
  --blue-300: #b9bec6;
  --blue-400: #9ca3af;
  --blue-500: #6b7280;
  --blue-600: #4b5563;
  --blue-700: #374151;
  --blue-800: #2d3744;
  --blue-900: #252d38;
}
html[data-color-theme="forest-green"] {
  --blue-primary: #3f7654;
  --blue-primary-dark: #2e5b3e;
  --blue-primary-light: #609274;
  --blue-50: #eef5f0;
  --blue-100: #dcebe0;
  --blue-200: #c2dcc9;
  --blue-300: #9fc8aa;
  --blue-400: #7eaf8d;
  --blue-500: #609274;
  --blue-600: #3f7654;
  --blue-700: #356345;
  --blue-800: #2e533b;
  --blue-900: #264532;
}
html[data-color-theme="soft-mint"] {
  --blue-primary: #347661;
  --blue-primary-dark: #387865;
  --blue-primary-light: #77b5a2;
  --blue-50: #eef8f5;
  --blue-100: #dcefe9;
  --blue-200: #c3e3d9;
  --blue-300: #a2d2c4;
  --blue-400: #81c0ad;
  --blue-500: #67ad98;
  --blue-600: #347661;
  --blue-700: #2f6957;
  --blue-800: #285a4b;
  --blue-900: #214b3f;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}
html.admin-document {
  background-color: #1a2a4a;
  overscroll-behavior-y: none;
}
html.admin-document[data-color-theme] {
  background-color: var(--blue-primary-dark);
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body {
  margin: 0;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--text-primary);
  background: var(--content-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
.page-gradient {
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.12), transparent 30%),
    linear-gradient(135deg, #1a2a4a 0%, #2563eb 100%);
  min-height: 100vh;
}
.card-surface {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -2px rgba(0, 0, 0, 0.1);
}
.auth-button {
  display: inline-block;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--blue-primary);
  padding: 0.75rem 1rem;
  color: #fff;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  transition: all 0.15s ease;
}
.auth-button:hover {
  background: var(--blue-primary-dark);
}
.max-w-7xl {
  max-width: 80rem;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}
.min-h-screen {
  min-height: 100vh;
}
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-center {
  justify-content: center;
}
.text-center {
  text-align: center;
}
.text-white {
  color: #fff;
}
.text-gray-600 {
  color: #4b5563;
}
.text-blue-200 {
  color: #bfdbfe;
}
.text-2xl {
  font-size: 1.5rem;
  line-height: 2rem;
}
.text-sm {
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.font-bold {
  font-weight: 700;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-4 {
  margin-top: 1rem;
}
.mt-6 {
  margin-top: 1.5rem;
}
.p-4 {
  padding: 1rem;
}
.p-6 {
  padding: 1.5rem;
}
.p-8 {
  padding: 2rem;
}
.h-20 {
  height: 5rem;
}
.w-auto {
  width: auto;
}

@media (max-width: 640px) {
  .p-6 {
    padding: 1rem;
  }
}

* {
  box-sizing: border-box;
}
button,
input,
select,
textarea {
  font: inherit;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 5%;
  color: #fff;
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}
.brand img {
  width: 2.5rem;
  height: 2.5rem;
  object-fit: cover;
  border-radius: 0.5rem;
}
.brand small {
  display: block;
  color: #bfdbfe;
  font-size: 0.7rem;
  font-weight: 400;
}
.topbar nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.topbar nav a,
.topbar nav button {
  color: #fff;
  border: 0;
  background: transparent;
  padding: 0.55rem 0.8rem;
  text-decoration: none;
  cursor: pointer;
  border-radius: 0.4rem;
}
.topbar nav a:hover,
.topbar nav button:hover {
  background: rgba(255, 255, 255, 0.16);
}
.panel {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.14);
}
label {
  display: block;
  margin: 0.7rem 0;
  color: #374151;
  font-size: 0.85rem;
  font-weight: 600;
}
label input,
label select,
label textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
}
label textarea,
textarea {
  min-height: 6rem;
  resize: vertical;
}
.hidden {
  display: none !important;
}
.form-error {
  color: #b91c1c;
  min-height: 1.2rem;
  font-size: 0.85rem;
}
.text-link {
  display: block;
  margin-top: 1rem;
  text-align: center;
  color: #2563eb;
  font-size: 0.875rem;
}
.primary,
.secondary {
  border: 0;
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
}
.primary {
  width: 100%;
  color: #fff;
  background: var(--blue-primary);
}
.primary:hover {
  background: var(--blue-primary-dark);
}
.secondary {
  color: var(--blue-primary);
  background: var(--blue-50);
  border: 1px solid var(--blue-200);
}
.secondary:hover {
  background: var(--blue-100);
}
.content {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
.content.narrow {
  max-width: 48rem;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.page-heading h1 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--blue-800);
}
.page-heading p {
  margin: 0.3rem 0;
  color: var(--text-secondary);
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.stat {
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.6rem;
  background: #fff;
}
.stat strong {
  display: block;
  font-size: 1.5rem;
  color: #1d4ed8;
}
.stat span {
  color: #6b7280;
  font-size: 0.8rem;
}
.panel {
  padding: 1rem;
  margin-bottom: 1rem;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.search {
  flex: 1;
  min-width: 12rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
}
/* Dashboard search and filter bars dock at the top edge of the viewport while
   the results scroll underneath. The page header and navigation above the bar
   are part of the page flow, so the bar docks at 0 once they have scrolled
   away and never overlaps them. */
.feature-toolbar,
.inventory-toolbar,
.borrower-equipment-filters,
.borrower-inventory-toolbar,
.borrower-toolbar,
.borrower-history-toolbar,
.borrower-requests-toolbar,
.maintenance-toolbar,
.maintenance-history-toolbar,
.maintenance-unified-toolbar,
.donation-toolbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 30;
  background: #fff;
}
/* The borrower filters sit directly on the white equipment panel, so they need
   a little breathing room of their own once they detach from the page. */
.borrower-equipment-filters {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  box-shadow: 0 10px 18px -18px rgba(15, 23, 42, 0.6);
}
/* Keep the docked bar from filling a phone screen. The primary search is the
   first control, so it stays visible; the remaining filters can be scrolled
   inside the bar when they do not fit. */
@media (max-width: 800px) {
  .feature-toolbar,
  .inventory-toolbar,
  .borrower-equipment-filters {
    max-height: 38vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
}
th,
td {
  padding: 0.75rem;
  border-bottom: 1px solid #eef0f3;
  text-align: left;
  font-size: 0.875rem;
}
th {
  color: #4b5563;
  background: #f9fafb;
}
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.75rem;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.2rem 0.8rem;
}
.form-grid textarea,
.form-grid button,
.form-grid p {
  grid-column: 1/-1;
}
.faq-list details {
  padding: 1rem 0;
  border-bottom: 1px solid #e5e7eb;
}
.help-return {
  display: inline-flex;
  align-items: center;
  margin-bottom: 1rem;
  text-decoration: none;
}
.admin-shell > .content.help-page {
  color: #1f2937;
  background: #fff;
}
.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  color: #1e2d4a;
}
.faq-list p {
  color: #4b5563;
  line-height: 1.6;
}
@media (max-width: 700px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
  .topbar nav {
    width: 100%;
    overflow: auto;
  }
  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Sign-in screen: full-bleed campus photo with a branding panel and card. */
.auth-page {
  --auth-ink: #14211a;
  --auth-muted: #5c6a60;
  --auth-border: #d5ded8;
  --auth-soft: #eef2ef;
  --auth-surface: #ffffff;
  --auth-accent: #2f7d3a;
  --auth-accent-dark: #266532;
  --auth-accent-soft: rgba(47, 125, 58, 0.13);
  --auth-link: #2f7d3a;
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 0;
  color: #fff;
  background-color: #0a1410;
  background-image:
    linear-gradient(
      104deg,
      rgba(4, 16, 9, 0.96) 0%,
      rgba(4, 16, 9, 0.91) 34%,
      rgba(4, 16, 9, 0.79) 62%,
      rgba(4, 16, 9, 0.68) 100%
    ),
    url('/assets/campus-day.jpg');
  background-size: cover;
  background-position: center 32%;
  background-repeat: no-repeat;
  overflow-x: hidden;
}
.auth-page::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(2, 10, 6, 0.55), transparent 28%),
    linear-gradient(0deg, rgba(2, 10, 6, 0.82), transparent 20%),
    radial-gradient(120% 90% at 50% 100%, rgba(0, 0, 0, 0.5), transparent 60%);
}
html[data-theme="dark"] .auth-page {
  --auth-ink: #eaf1ec;
  --auth-muted: #9fb0a4;
  --auth-border: #2b3a31;
  --auth-soft: #16211b;
  --auth-surface: #101a14;
  --auth-accent: #45a556;
  --auth-accent-dark: #3a9049;
  --auth-accent-soft: rgba(69, 165, 86, 0.18);
  --auth-link: #7fd08c;
  color-scheme: dark;
  background-color: #040a07;
  background-image:
    linear-gradient(
      104deg,
      rgba(3, 9, 6, 0.82) 0%,
      rgba(3, 9, 6, 0.66) 40%,
      rgba(3, 9, 6, 0.34) 72%,
      rgba(3, 9, 6, 0.22) 100%
    ),
    url('/assets/campus-night.jpg');
  background-position: center 55%;
}

.theme-toggle {
  position: absolute;
  z-index: 3;
  top: clamp(1rem, 3vh, 1.75rem);
  right: clamp(1rem, 3vw, 2rem);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  color: #fff;
  background: rgba(8, 20, 13, 0.42);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.theme-toggle:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(8, 20, 13, 0.66);
}
.theme-toggle:active {
  transform: translateY(1px);
}
.theme-toggle:focus-visible {
  outline: 2px solid #a7f3b5;
  outline-offset: 3px;
}
.theme-toggle .icon {
  width: 1rem;
  height: 1rem;
}
.theme-toggle-icon {
  display: inline-flex;
}

.session-expired-notice {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: min(calc(100% - 2rem), 74rem);
  margin: clamp(4.5rem, 8vh, 5.5rem) auto 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 0.7rem;
  color: #fff;
  background: #b42318;
  box-shadow: 0 12px 30px rgba(54, 7, 3, 0.32);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
}
.session-expired-notice .icon {
  flex: none;
  width: 1.2rem;
  height: 1.2rem;
}

.auth-shell {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 24.5rem);
  align-items: center;
  gap: clamp(2rem, 5vw, 5rem);
  width: min(100%, 74rem);
  margin: 0 auto;
  padding: clamp(5.5rem, 11vh, 8rem) clamp(1.25rem, 4vw, 3rem) clamp(2rem, 5vh, 3.5rem);
}

.auth-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 34rem;
}
.auth-logos {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin-bottom: 1.4rem;
}
.auth-emblem {
  display: block;
  flex: none;
  width: 5.4rem;
  height: 5.4rem;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.4));
}
.auth-emblem img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.auth-college-logo {
  display: block;
  width: 5.4rem;
  height: 5.4rem;
  object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.4));
}
.auth-eyebrow {
  margin: 0 0 0.7rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.auth-headline {
  margin: 0;
  color: #fff;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.035em;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.25);
}
.auth-headline-main {
  display: block;
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
}
.auth-headline-sub {
  display: block;
  margin-top: 0.4rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(1.35rem, 2.5vw, 1.95rem);
  font-weight: 600;
  letter-spacing: -0.02em;
}
.auth-description {
  max-width: 32rem;
  margin: 1.1rem 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.96rem;
  line-height: 1.65;
}
.auth-modes {
  display: inline-flex;
  gap: 0.25rem;
  margin-top: 1.9rem;
  padding: 0.3rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(4, 14, 9, 0.34);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.auth-mode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.5rem;
  padding: 0.45rem 1.1rem;
  border: 0;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.74);
  background: transparent;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.auth-mode:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.auth-mode.active,
.auth-mode.active:hover {
  color: #14251a;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
}
.auth-mode:focus-visible {
  outline: 2px solid #a7f3b5;
  outline-offset: 2px;
}
.auth-mode .icon {
  width: 0.95rem;
  height: 0.95rem;
}

.auth-card {
  width: 100%;
  padding: clamp(1.6rem, 3vw, 2.2rem);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 1rem;
  color: var(--auth-ink);
  background: var(--auth-surface);
  box-shadow:
    0 34px 70px -28px rgba(2, 12, 6, 0.8),
    0 4px 14px rgba(2, 12, 6, 0.22);
}
html[data-theme="dark"] .auth-card {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow:
    0 34px 70px -22px rgba(0, 0, 0, 0.9),
    0 0 0 1px rgba(255, 255, 255, 0.03);
}
.auth-card-head h2 {
  margin: 0;
  color: var(--auth-ink);
  font-size: clamp(1.3rem, 2.4vw, 1.55rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.auth-card-head p {
  margin: 0.4rem 0 0;
  color: var(--auth-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
#auth-form {
  margin-top: 1.5rem;
  padding: 0;
}
.auth-card label {
  margin: 0.85rem 0 0;
  color: var(--auth-ink);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.auth-card label:first-child {
  margin-top: 0;
}
.auth-card label input,
.auth-card label select {
  width: 100%;
  height: 3.1rem;
  margin-top: 0.4rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid var(--auth-border);
  border-radius: 0.6rem;
  color: var(--auth-ink);
  background: var(--auth-surface);
  font-size: 0.9rem;
  text-transform: none;
  letter-spacing: 0;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.auth-card label select {
  cursor: pointer;
}
.auth-card label input::placeholder {
  color: #98a49b;
}
.auth-card label input:focus,
.auth-card label select:focus {
  outline: none;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 3px var(--auth-accent-soft);
}
.input-with-icon {
  position: relative;
}
.input-with-icon > .icon {
  position: absolute;
  z-index: 1;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.05rem;
  height: 1.05rem;
  color: #8b988f;
  pointer-events: none;
}
.input-with-icon input {
  padding-left: 2.9rem !important;
  padding-right: 3.4rem !important;
}
.input-with-icon button {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  color: #8b988f;
  background: transparent;
  cursor: pointer;
}
.input-with-icon button:hover {
  color: var(--auth-ink);
  background: var(--auth-soft);
}
.input-with-icon button .icon {
  width: 1.05rem;
  height: 1.05rem;
}
.auth-card .form-hint {
  margin: 0.5rem 0 0;
  color: var(--auth-muted);
  font-size: 0.72rem;
  line-height: 1.5;
}
.auth-card .form-error {
  min-height: 0;
  font-size: 0.8rem;
}
.auth-card .form-error:not(:empty) {
  margin-bottom: 0.4rem;
}
.auth-card .auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 3.15rem;
  margin-top: 1.35rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 0.6rem;
  color: #fff;
  background: var(--auth-accent);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.16s ease;
}
.auth-card .auth-submit:hover {
  background: var(--auth-accent-dark);
}
.auth-card .auth-submit:active {
  transform: translateY(1px);
}
.auth-card .auth-submit:disabled {
  opacity: 0.72;
  cursor: progress;
  transform: none;
}
.auth-card .auth-submit:focus-visible {
  outline: 2px solid var(--auth-accent);
  outline-offset: 3px;
}
.auth-note {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 1.15rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--auth-border);
  color: var(--auth-muted);
  font-size: 0.72rem;
  line-height: 1.55;
}
.auth-note .icon {
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
  margin-top: 0.12rem;
}
.auth-switch-text {
  margin: 0.95rem 0 0;
  color: var(--auth-muted);
  font-size: 0.78rem;
  text-align: center;
}
.text-link-inline {
  display: inline;
  min-height: 0;
  padding: 0.2rem 0.1rem;
  border: 0;
  color: var(--auth-link);
  background: transparent;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.text-link-inline:hover {
  text-decoration: underline;
}
.register-fields {
  overflow: visible;
}
.register-fields.hidden {
  display: none;
}
.register-email-hint {
  margin-top: 0.45rem !important;
}

.home-brand-footer {
  width: 100%;
  margin: 0;
  padding: 0 clamp(1rem, 4vw, 3rem) clamp(1.1rem, 3vh, 1.75rem);
  display: grid;
  gap: 0.3rem;
  color: rgba(255, 255, 255, 0.62);
  text-align: center;
  font-size: 0.68rem;
  line-height: 1.55;
}
.home-brand-footer > strong {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.76rem;
  letter-spacing: 0.01em;
}
.home-brand-footer em {
  font-style: normal;
}
.home-brand-footer span strong {
  color: rgba(255, 255, 255, 0.8);
}

.auth-footer {
  margin: 1.35rem 0 0;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.donation-callout {
  margin-top: 1.8rem;
  text-align: center;
}
.donation-callout p {
  margin: 0 0 0.75rem;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.85rem;
}
.donation-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1.25rem;
  color: #fff;
  background: #9333ea;
  border-radius: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.donation-button .icon {
  width: 1rem;
  height: 1rem;
}

@media (max-width: 980px) {
  .auth-shell {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: clamp(1.75rem, 4vw, 2.5rem);
    width: min(100%, 34rem);
    padding-top: clamp(4.75rem, 9vh, 6.5rem);
  }
  .auth-intro {
    align-items: center;
    text-align: center;
  }
}
@media (max-width: 600px) {
  .auth-page {
    background-position: center 28%;
  }
  .session-expired-notice {
    width: calc(100% - 2rem);
    margin-top: 4.25rem;
    padding: 0.85rem 0.95rem;
    font-size: 0.82rem;
  }
  .auth-page::after {
    background:
      linear-gradient(180deg, rgba(3, 10, 6, 0.35), rgba(3, 10, 6, 0.5)),
      radial-gradient(120% 90% at 50% 100%, rgba(0, 0, 0, 0.35), transparent 60%);
  }
  .auth-shell {
    gap: 1.5rem;
    padding: 4.25rem 1rem 1.5rem;
  }
  .auth-logos {
    gap: 0.7rem;
    margin-bottom: 1.1rem;
  }
  .auth-emblem {
    width: 4.4rem;
    height: 4.4rem;
  }
  .auth-college-logo {
    width: 4.4rem;
    height: 4.4rem;
  }
  .auth-eyebrow {
    margin-bottom: 0.5rem;
  }
  .auth-headline-main {
    font-size: clamp(1.95rem, 8.5vw, 2.5rem);
  }
  .auth-headline-sub {
    margin-top: 0.3rem;
    font-size: clamp(1.15rem, 4.8vw, 1.45rem);
  }
  .auth-description {
    margin-top: 0.85rem;
    font-size: 0.88rem;
    line-height: 1.55;
  }
  .auth-modes {
    margin-top: 1.4rem;
  }
  .auth-card {
    padding: 1.4rem 1.25rem 1.3rem;
    border-radius: 0.9rem;
  }
  .auth-card label input,
  .auth-card label select {
    font-size: 1rem;
  }
  .theme-toggle {
    padding: 0.45rem 0.75rem;
    font-size: 0.72rem;
  }
}
@media (max-width: 420px) {
  .auth-eyebrow {
    font-size: 0.62rem;
    letter-spacing: 0.16em;
  }
  .auth-mode {
    padding: 0.4rem 0.85rem;
  }
  .home-brand-footer {
    font-size: 0.62rem;
  }
  .home-brand-footer > strong {
    font-size: 0.7rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .theme-toggle,
  .auth-mode,
  .auth-card label input,
  .auth-card label select,
  .auth-card .auth-submit {
    transition: none;
  }
}
.icon {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  flex: none;
  position: relative;
  color: currentColor;
}
.graduation-icon::before {
  content: "⌂";
  font-size: 1.05rem;
}
.shield-icon::before {
  content: "◇";
  font-size: 1.15rem;
}
.mail-icon::before {
  content: "✉";
  font-size: 1rem;
}
.lock-icon::before {
  content: "▣";
  font-size: 0.9rem;
}
.eye-icon::before {
  content: "◉";
  font-size: 0.8rem;
}
.arrow-icon::before {
  content: "→";
  font-size: 1.05rem;
}
.gift-icon::before {
  content: "✦";
  font-size: 1rem;
}
.app-navbar {
  color: #fff;
  background: linear-gradient(90deg, var(--blue-primary-dark), var(--blue-700));
  padding: 1.5rem 1.5rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}
.app-navbar-inner {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.app-brand-group {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  flex: 1;
}
.app-brand {
  display: flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}
.app-brand span {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}
.app-brand small {
  display: block;
  margin-top: 0.15rem;
  color: #bfdbfe;
  font-size: 0.875rem;
  font-weight: 400;
}
.app-brand-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}
.brand-logo {
  display: block;
  object-fit: contain;
  background: transparent;
  flex-shrink: 0;
}
.brand-logo-left {
  width: 7rem !important;
  height: 7rem !important;
  min-width: 7rem;
  min-height: 7rem;
  border-radius: 0;
}
.brand-logo-right {
  width: 4.1rem !important;
  height: 4.1rem !important;
  min-width: 4.1rem;
  min-height: 4.1rem;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}
.app-navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.icon-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: 0.5rem;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  text-decoration: none;
}
.icon-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}
.icon-button .icon {
  width: 1.25rem;
  height: 1.25rem;
}
.signed-in {
  margin-left: 0.25rem;
  text-align: right;
}
.signed-in strong,
.signed-in small {
  display: block;
}
.signed-in strong {
  font-size: 0.875rem;
}
.signed-in small {
  color: #bfdbfe;
  font-size: 0.75rem;
}
.admin-page {
  min-height: calc(100vh - 6.5rem);
  background: linear-gradient(135deg, #f8fbff, #eef4ff);
}

/* Ensure all admin dashboard content stays readable on light card surfaces. */
.admin-page,
.admin-page .feature-inner,
.admin-page .feature-heading,
.admin-page .feature-toolbar,
.admin-page .dashboard-card,
.admin-page .dashboard-card-header,
.admin-page .dashboard-card-body,
.admin-page .status-item,
.admin-page .status-label,
.admin-page .status-value,
.admin-page .admin-stat,
.admin-page .admin-stat p,
.admin-page .admin-stat strong,
.admin-page .panel,
.admin-page .table-wrap,
.admin-page .table-wrap th,
.admin-page .table-wrap td,
.admin-page .inventory-primary,
.admin-page .inventory-secondary,
.admin-page .equipment-card,
.admin-page .maintenance-card,
.admin-page .donation-card,
.admin-page .welcome-message,
.admin-page .category-preview,
.admin-page label,
.admin-page input,
.admin-page select,
.admin-page textarea,
.admin-page button,
.admin-page p,
.admin-page li,
.admin-page strong,
.admin-page h1,
.admin-page h2,
.admin-page h3,
.admin-page h4,
.admin-page h5,
.admin-page h6 {
  color: var(--white-900);
}

.admin-page .feature-heading p,
.admin-page .dashboard-card-subtitle,
.admin-page .status-label,
.admin-page .admin-stat p,
.admin-page .panel p,
.admin-page .panel li,
.admin-page .form-hint,
.admin-page .inventory-kpis span,
.admin-page .maintenance-kpis span,
.admin-page .donation-stats span,
.admin-page .equipment-card p,
.admin-page .maintenance-card p,
.admin-page .donation-card p,
.admin-page .table-wrap small,
.admin-page .table-wrap .muted,
.admin-page .table-wrap td[data-label]::before,
.admin-page .table-wrap td small {
  color: var(--text-secondary);
}

.admin-page .welcome-message {
  color: var(--blue-800);
}

.admin-page-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}
.welcome-message {
  margin-bottom: 1.5rem;
  padding: 1rem 1.5rem;
  border: 1px solid var(--blue-200);
  border-radius: var(--radius-md);
  color: var(--blue-800);
  background: var(--blue-50);
}
.admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--blue-100);
}
.admin-nav a,
.admin-nav button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--blue-700);
  background: var(--card-bg);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease;
}
.admin-nav a .icon {
  width: 1rem;
  height: 1rem;
}
.admin-nav a.active {
  border-color: var(--blue-primary);
  color: #fff;
  background: var(--blue-primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}
.admin-nav a:hover:not(.active) {
  color: var(--blue-primary-dark);
  background: var(--blue-50);
}
.admin-nav .admin-logout {
  margin-left: auto;
  color: #dc2626;
  border-color: #fecaca;
}
.admin-nav .admin-logout:hover {
  background: #fef2f2;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}
.admin-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}
.admin-stat:hover {
  border-color: var(--blue-200);
  box-shadow: var(--shadow-lg);
}
.admin-stat p {
  margin: 0 0 0.25rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
}
.admin-stat strong {
  color: var(--blue-800);
  font-size: 1.875rem;
}
.admin-stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
}
.admin-stat-icon.blue {
  color: #2563eb;
  background: #dbeafe;
}
.admin-stat-icon.red {
  color: #dc2626;
  background: #fee2e2;
}
.admin-stat-icon.green {
  color: #16a34a;
  background: #dcfce7;
}
.admin-stat-icon.yellow {
  color: #ca8a04;
  background: #fef9c3;
}
.admin-stat-icon.purple {
  color: #9333ea;
  background: #f3e8ff;
}
.admin-stat-icon.indigo {
  color: #4f46e5;
  background: #e0e7ff;
}
.admin-error {
  color: #b91c1c;
}
/* System status card on the admin dashboard. */
.admin-page > .feature-inner > .dashboard-card {
  margin-top: 1.5rem;
}
.dashboard-card {
  border: 1px solid var(--blue-100);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.dashboard-card-header {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--blue-100);
  background: var(--blue-50);
}
.dashboard-card-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--blue-800);
}
.dashboard-card-subtitle {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.dashboard-card-body {
  padding: 1rem 1.25rem 1.25rem;
}
.system-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}
.status-item {
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--blue-100);
  border-radius: 0.6rem;
  background: #f8fbff;
}
.status-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.status-value {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue-800);
  overflow-wrap: anywhere;
}
.status-value.status-healthy {
  color: #15803d;
}
@media (max-width: 1000px) {
  .system-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .system-status-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .dashboard-card-header,
  .dashboard-card-body {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }
}
@media (max-width: 850px) {
  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 600px) {
  .app-navbar {
    padding: 1rem;
  }
  .app-brand span {
    font-size: 1.15rem;
  }
  .app-brand small {
    font-size: 0.7rem;
  }
  .signed-in {
    display: none;
  }
  .admin-stats {
    grid-template-columns: 1fr;
  }
  .admin-nav .admin-logout {
    margin-left: 0;
  }
}
.admin-shell .feature-nav {
  display: none;
}
/* Borrower pages only have the feature navigation, so reveal it on larger
   screens. Phones keep the existing hamburger drawer. */
@media (min-width: 761px) {
  .admin-shell .feature-nav.borrower-nav {
    display: flex;
  }
}
/* Unified design: the entry screen's deep blue gradient is the backdrop for the
   whole signed-in workspace, so both dashboards sit on the same background as
   the landing/login screen. Content stays on white cards for readability. */
.admin-shell {
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.15), transparent 35%),
    linear-gradient(135deg, #1a2a4a, #2563eb);
  background-color: #1a2a4a;
  background-attachment: fixed;
  overscroll-behavior-y: none;
  min-height: 100vh;
}
.admin-shell > .content {
  min-height: calc(100vh - 6.5rem);
  max-width: 80rem;
  padding: 2rem 1.25rem 4rem;
  background: var(--content-bg);
  color: var(--text-primary);
}
.admin-shell > .content .page-heading h1 {
  color: var(--blue-800);
}
.admin-shell > .content .page-heading p {
  color: var(--text-secondary);
}
.admin-shell > .content .stats {
  margin-top: 0.5rem;
}
.admin-shell > .content,
.admin-page > .feature-inner {
  border: 1px solid var(--blue-200);
  border-radius: var(--radius-lg);
  margin: 1rem auto 2rem;
  width: calc(100% - 2rem);
  max-width: 80rem;
  background: var(--card-bg);
  box-shadow:
    0 10px 28px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
/* Wider windows get a little more of the blue backdrop around the card. */
@media (min-width: 1001px) {
  .admin-shell > .content,
  .admin-page > .feature-inner {
    width: calc(100% - 3rem);
  }
}
.admin-page > .feature-inner {
  padding: 2rem 1rem 4rem;
}
@media (max-width: 600px) {
  .admin-shell > .content,
  .admin-page > .feature-inner {
    width: auto;
    margin: 0.75rem 0.75rem 1.5rem;
    border-radius: 0.75rem;
  }
  .admin-page > .feature-inner {
    padding: 1.25rem 0.75rem 2.5rem;
  }
}
.admin-page {
  background: transparent;
}
.admin-page[data-admin-reservations-page] .admin-reservations-heading {
  margin-bottom: 1.5rem;
  color: var(--blue-800);
}
.admin-page[data-admin-reservations-page] .admin-reservations-heading h1 {
  margin: 0;
  color: var(--blue-800);
  font-size: 2rem;
}
.admin-page[data-admin-reservations-page] .admin-reservations-heading p:not(.eyebrow) {
  margin: 0.35rem 0 0;
  color: var(--text-secondary);
}
.feature-page {
  min-height: calc(100vh - 6.5rem);
}
.feature-inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}
.narrow-feature {
  max-width: 60rem;
}
.feature-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  color: var(--blue-800);
}
.feature-heading h1 {
  margin: 0;
  font-size: 2rem;
}
.feature-heading p {
  margin: 0.3rem 0 0;
  color: var(--text-secondary);
}
.feature-actions,
.form-actions,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.feature-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}
.feature-toolbar .search {
  min-width: 18rem;
}
.feature-toolbar select {
  padding: 0.65rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  background: #fff;
}
.feature-toolbar .inventory-kpis {
  display: flex;
  gap: 1rem;
  margin-left: auto;
}
.donation-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.inventory-kpis span,
.maintenance-kpis span,
.donation-stats span {
  display: flex;
  flex-direction: column;
  min-width: 6rem;
  color: #6b7280;
  font-size: 0.75rem;
}
.inventory-kpis strong,
.maintenance-kpis strong,
.donation-stats strong {
  color: #1f2937;
  font-size: 1.25rem;
}
.category-legend {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.category-legend span {
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}
.legend-ict {
  background: #2563eb;
}
.legend-afa {
  background: #16a34a;
}
.legend-ia {
  background: #9333ea;
}
.legend-he {
  background: #ea580c;
}
.inventory-groups {
  display: grid;
  gap: 0.75rem;
}
.inventory-primary,
.inventory-secondary {
  padding: 0.8rem 1rem;
  border-radius: 0.65rem;
  background: #fff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.1);
}
.inventory-primary > summary,
.inventory-secondary > summary {
  cursor: pointer;
  color: #1e2d4a;
  font-weight: 700;
}
.inventory-primary summary small,
.inventory-secondary summary small {
  margin-left: 0.5rem;
  color: #6b7280;
  font-weight: 400;
}
.equipment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 0.75rem;
  padding: 0.8rem 0 0.2rem;
}
.equipment-card,
.maintenance-card,
.donation-card {
  padding: 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.65rem;
  background: #fff;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}
.equipment-card-top,
.donation-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.equipment-card p,
.maintenance-card p,
.donation-card p {
  margin: 0.4rem 0;
  color: #6b7280;
  font-size: 0.85rem;
}
.compact {
  width: auto;
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
}
.equipment-form h2,
.panel h2 {
  margin-top: 0;
  color: #1e2d4a;
}
.category-preview {
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.45rem;
  color: #1d4ed8;
  background: #dbeafe;
}
.category-preview span {
  margin-left: 1rem;
}
.form-hint {
  color: #6b7280;
  font-size: 0.8rem;
}
.category-columns {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
}
.category-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.6rem;
  align-items: center;
  padding: 0.8rem 0;
  border-bottom: 1px solid #e5e7eb;
}
.category-row small {
  grid-column: 2;
  color: #6b7280;
  font-size: 0.75rem;
}
.category-row button {
  grid-row: 1/3;
  grid-column: 3;
  border: 0;
  color: #dc2626;
  background: transparent;
  cursor: pointer;
}
.category-icon {
  color: #2563eb;
  font-weight: 700;
}
.maintenance-kpis,
.donation-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}
.maintenance-kpis span,
.donation-stats span {
  padding: 1rem;
  border-radius: 0.65rem;
  background: #fff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.1);
}
.maintenance-list,
.donation-list {
  display: grid;
  gap: 0.75rem;
}
.maintenance-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.donation-stats {
  grid-template-columns: repeat(4, 1fr);
}
.donation-toolbar {
  align-items: end;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.donation-toolbar label {
  display: grid;
  gap: 0.35rem;
  color: #4b5563;
  font-size: 0.75rem;
  font-weight: 700;
}
.donation-toolbar input,
.donation-toolbar select {
  min-width: 10rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  background: #fff;
  color: #1f2937;
  font: inherit;
}
.donation-table-wrap {
  overflow-x: auto;
  border: 1px solid #e5e7eb;
  border-radius: 0.55rem;
  background: #fff;
}
.donation-record-table {
  width: 100%;
  min-width: 1050px;
  border-collapse: collapse;
  text-align: left;
}
.donation-record-table th,
.donation-record-table td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: top;
  font-size: 0.8rem;
}
.donation-record-table th {
  position: sticky;
  top: 0;
  color: #374151;
  background: #f8fafc;
  font-weight: 700;
  white-space: nowrap;
}
.donation-record-table td:first-child {
  min-width: 9rem;
  color: #1f2937;
  font-weight: 600;
}
.donation-record-table .card-actions {
  display: flex;
  gap: 0.35rem;
}
.donation-edit-modal {
  width: min(100%, 44rem);
  max-height: 90vh;
  overflow-y: auto;
}
.donation-edit-modal form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 1rem;
}
.donation-edit-modal form label:last-of-type,
.donation-edit-modal .modal-error,
.donation-edit-modal .modal-actions {
  grid-column: 1 / -1;
}
.donation-edit-modal select {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  background: #fff;
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
}
.donation-card {
  cursor: pointer;
}
.badge.danger {
  color: #b91c1c;
  background: #fee2e2;
}
.admin-page .panel {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}
@media (max-width: 750px) {
  .feature-heading {
    flex-direction: column;
  }
  .feature-toolbar .inventory-kpis {
    width: 100%;
    margin-left: 0;
  }
  .category-columns,
  .maintenance-card {
    grid-template-columns: 1fr;
  }
  .maintenance-kpis,
  .donation-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .donation-edit-modal form {
    grid-template-columns: 1fr;
  }
  .donation-edit-modal form label:last-of-type,
  .donation-edit-modal .modal-error,
  .donation-edit-modal .modal-actions {
    grid-column: auto;
  }
}
@media print {
  .feature-nav,
  .feature-heading .primary,
  .donation-toolbar,
  .donation-stats,
  .donation-record-table .card-actions {
    display: none !important;
  }
  .donation-table-wrap {
    overflow: visible;
    border: 0;
  }
  .donation-record-table {
    min-width: 0;
  }
}
.heatmap-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.heatmap-summary div {
  padding: 1rem 1.25rem;
  border-radius: 0.65rem;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}
.heatmap-summary strong,
.heatmap-summary span {
  display: block;
}
.heatmap-summary strong {
  color: #1d4ed8;
  font-size: 1.75rem;
}
.heatmap-summary span {
  color: #6b7280;
  font-size: 0.8rem;
}
.heatmap-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.heatmap-layout h2 {
  margin-top: 0;
  color: #1e2d4a;
  font-size: 1rem;
}
.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.65rem;
}
.heatmap-cell {
  display: flex;
  min-height: 5rem;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.8rem;
  border-radius: 0.55rem;
  color: #1e3a8a;
  background: #dbeafe;
}
.heatmap-cell span {
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.heatmap-cell strong {
  font-size: 1.35rem;
}
.heatmap-cell.level-2 {
  color: #1e40af;
  background: #bfdbfe;
}
.heatmap-cell.level-3 {
  color: #1e3a8a;
  background: #93c5fd;
}
.heatmap-cell.level-4 {
  color: #fff;
  background: #3b82f6;
}
.heatmap-cell.level-5 {
  color: #fff;
  background: #1d4ed8;
}
@media (max-width: 750px) {
  .heatmap-layout,
  .heatmap-summary {
    grid-template-columns: 1fr;
  }
}
.heatmap-wide {
  grid-column: 1/-1;
}
.heatmap-help {
  margin-top: -0.5rem;
  color: #64748b;
  font-size: 0.8rem;
}
.borrow-frequency-list {
  display: grid;
  gap: 0.8rem;
}
.borrow-frequency-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.borrow-frequency-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 0.75rem;
  font-weight: 700;
}
.borrow-frequency-main {
  flex: 1;
  min-width: 0;
}
.borrow-frequency-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.3rem;
}
.borrow-frequency-label strong {
  overflow: hidden;
  color: #1e293b;
  font-size: 0.85rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.borrow-frequency-label span {
  color: #64748b;
  font-size: 0.75rem;
  white-space: nowrap;
}
.borrow-frequency-track {
  height: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}
.borrow-frequency-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #60a5fa, #1d4ed8);
}
.dashboard-switcher {
  position: relative;
}
.dashboard-switcher summary {
  list-style: none;
  cursor: pointer;
  padding: 0.6rem 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0.5rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.dashboard-switcher summary::-webkit-details-marker {
  display: none;
}
.dashboard-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.5rem);
  right: 0;
  display: grid;
  min-width: 12rem;
  padding: 0.4rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.55rem;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}
.dashboard-menu a {
  padding: 0.6rem 0.7rem;
  border-radius: 0.35rem;
  color: #374151;
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
}
.dashboard-menu a:hover {
  color: #1d4ed8;
  background: #eff6ff;
}
.inventory-modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.6);
}
.inventory-modal {
  position: relative;
  width: min(100%, 28rem);
  padding: 2rem;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}
.inventory-modal h2 {
  margin: 0 0 0.35rem;
  color: #1f2937;
  font-size: 1.25rem;
}
.modal-item {
  margin: 0 0 1rem;
  color: #4b5563;
  font-weight: 600;
}
.inventory-modal label {
  display: block;
  margin: 1rem 0;
  color: #6b7280;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.borrower-requested-time-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.5rem;
}
.borrower-requested-time-control label {
  min-width: 0;
}
.borrower-requested-time-control button {
  margin-bottom: 1rem;
  white-space: nowrap;
}
.inventory-modal input,
.inventory-modal textarea {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
}
.inventory-modal textarea {
  min-height: 6rem;
  resize: vertical;
}
.inventory-modal label small {
  display: block;
  margin-top: 0.25rem;
  color: #6b7280;
  font-size: 0.72rem;
  letter-spacing: 0;
  text-transform: none;
}
.inventory-modal fieldset {
  margin: 1rem 0;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
}
.inventory-modal .return-tool-options {
  max-height: 14rem;
  overflow-y: auto;
}
.inventory-modal label.return-tool-option {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0.4rem 0;
  padding: 0.6rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.4rem;
  color: #374151;
  font-size: 0.8rem;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}
.inventory-modal .return-tool-option input {
  display: inline-block;
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  margin: 0.1rem 0 0;
  padding: 0;
}
.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.85rem;
  border: 0;
  color: #6b7280;
  background: transparent;
  font-size: 1.6rem;
  cursor: pointer;
}
.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.modal-actions button {
  flex: 1;
}
.modal-error {
  min-height: 1.2rem;
  margin: 0.5rem 0 0;
  color: #b91c1c;
  font-size: 0.8rem;
}
.feature-nav {
  margin-bottom: 1.25rem;
}
.inventory-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.inventory-panel-heading p {
  margin: 0;
  color: #64748b;
  font-size: 0.8rem;
}
.inventory-panel-heading h2 {
  margin: 0.2rem 0 0;
  color: #0f172a;
  font-size: 1.1rem;
}
.inventory-primary {
  overflow: hidden;
  margin-bottom: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: #fff;
}
.inventory-primary > summary,
.inventory-secondary > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.1rem;
  cursor: pointer;
  list-style: none;
  color: #0f172a;
  font-weight: 700;
}
.inventory-primary > summary::-webkit-details-marker,
.inventory-secondary > summary::-webkit-details-marker {
  display: none;
}
.inventory-primary > summary:before,
.inventory-secondary > summary:before {
  content: "⌄";
  margin-right: 0.5rem;
  color: #64748b;
}
.inventory-primary > summary small,
.inventory-secondary > summary small {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 400;
}
.inventory-secondary-wrap {
  padding: 0.75rem;
  background: #f8fafc;
}
.inventory-secondary {
  margin-bottom: 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #fff;
}
.inventory-secondary > summary {
  padding: 0.75rem 0.9rem;
  font-size: 0.9rem;
}
.equipment-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.equipment-meta div {
  padding: 0.55rem 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.45rem;
  background: #fff;
}
.equipment-meta small,
.equipment-meta strong {
  display: block;
}
.equipment-meta small {
  color: #64748b;
  font-size: 0.65rem;
  text-transform: uppercase;
}
.equipment-meta strong {
  margin-top: 0.2rem;
  color: #0f172a;
  font-size: 0.8rem;
}
.badge.warning {
  color: #a16207;
  background: #fef3c7;
}
.danger-action {
  border: 0;
  border-radius: 0.45rem;
  padding: 0.45rem 0.75rem;
  color: #b91c1c;
  background: #fee2e2;
  cursor: pointer;
  font-weight: 600;
}
.retired-label {
  padding: 0.35rem 0.7rem;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: #64748b;
  font-size: 0.75rem;
}
.empty-state {
  padding: 2rem;
  color: #64748b;
  text-align: center;
}
@media (max-width: 700px) {
  .inventory-panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .equipment-meta {
    grid-template-columns: 1fr 1fr;
  }
  .inventory-primary > summary,
  .inventory-secondary > summary {
    align-items: flex-start;
    flex-direction: column;
  }
}

.app-navbar {
  padding: 0 1.5rem;
}
@media (max-width: 600px) {
  .app-navbar {
    padding: 0 0.75rem;
  }
}

/* ==========================================================================
   Mobile navigation drawer (hamburger menu)
   ========================================================================== */
.nav-toggle {
  display: none;
}
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: flex-start;
  justify-content: flex-start;
}
.mobile-nav-backdrop.open {
  display: flex;
}
.mobile-nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 56;
  width: min(82vw, 18rem);
  max-width: 18rem;
  height: 100dvh;
  background: #fff;
  color: #172b3a;
  transform: translateX(-100%);
  transition: transform 0.22s ease;
  box-shadow: 10px 0 28px rgba(0, 0, 0, 0.14);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  display: none;
}
.mobile-nav-drawer.open {
  transform: translateX(0);
  display: block;
}
.mobile-nav-close {
  position: absolute;
  top: 0.7rem;
  right: 0.85rem;
  z-index: 1;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #fff;
  color: #374151;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.mobile-nav-close .icon {
  width: 1.25rem;
  height: 1.25rem;
}
.mobile-nav-drawer .mobile-nav-logout {
  margin-top: 1rem;
  color: #dc2626;
  border-color: #fecaca;
  width: 100%;
  text-align: left;
}
.mobile-nav-drawer .mobile-nav-logout:hover {
  background: #fef2f2;
}
.mobile-nav-drawer a,
.mobile-nav-drawer button:not(.mobile-nav-close):not(.mobile-nav-logout) {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.7rem 1rem;
  margin: 0.15rem 0;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  color: #374151;
  background: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.mobile-nav-drawer a.active {
  border-color: #2563eb;
  color: #fff;
  background: #2563eb;
}
.mobile-nav-drawer a:hover,
.mobile-nav-drawer button:not(.mobile-nav-close):not(.mobile-nav-logout):hover {
  background: #eff6ff;
  color: #1d4ed8;
}
.mobile-nav-drawer .borrower-cart-nav-badge {
  float: right;
}
@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
  }
  .global-admin-nav {
    display: none;
  }
  .borrower-nav {
    display: none;
  }
  .app-navbar-inner {
    gap: 0.4rem;
  }
}
@media (min-width: 761px) {
  .nav-toggle {
    display: none !important;
  }
  .mobile-nav-backdrop,
  .mobile-nav-drawer {
    display: none !important;
  }
}

.heatmap-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.2);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 0.2rem rgba(74, 222, 128, 0.18);
}
.heatmap-panel {
  padding: 1.25rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
}
.heatmap-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.heatmap-panel-heading .eyebrow {
  color: #64748b;
}
.heatmap-panel-heading h2 {
  margin: 0.25rem 0 0;
}
.heatmap-panel-heading .heatmap-help {
  margin: 0.35rem 0 0;
}
.heatmap-scale {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: #64748b;
  font-size: 0.65rem;
  white-space: nowrap;
}
.heatmap-scale i {
  display: block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 0.2rem;
  background: #dbeafe;
}
.heatmap-scale i.level-3 {
  background: #93c5fd;
}
.heatmap-scale i.level-5 {
  background: #1d4ed8;
}
.tool-usage-grid .heatmap-cell {
  min-height: 6.5rem;
}
.tool-usage-grid .heatmap-cell strong {
  font-size: 1.65rem;
}
.tool-usage-grid .heatmap-cell small {
  display: block;
  margin-top: 0.25rem;
}
@media (max-width: 750px) {
  .heatmap-status {
    align-self: flex-start;
  }
  .heatmap-panel-heading {
    flex-direction: column;
  }
  .heatmap-scale {
    align-self: flex-start;
  }
}

.heatmap-dashboard-layout {
  grid-template-columns: minmax(0, 1.65fr) minmax(18rem, 0.85fr);
  align-items: start;
}
.heatmap-dashboard-layout .heatmap-panel {
  padding: 1.5rem;
}
.heatmap-matrix-panel {
  min-width: 0;
}
.heatmap-matrix-panel .heatmap-panel-heading,
.busiest-panel .heatmap-panel-heading {
  align-items: flex-start;
}
.heatmap-matrix-panel h2,
.busiest-panel h2 {
  margin: 0.15rem 0 0;
  font-size: 1.1rem;
}
.heatmap-icon {
  color: #64748b;
  font-size: 1.35rem;
  line-height: 1;
}
.weekday-matrix {
  overflow-x: auto;
}
.weekday-matrix-row {
  display: grid;
  grid-template-columns: minmax(9rem, 1.5fr) repeat(
      7,
      minmax(2.6rem, 1fr)
    ) minmax(3.5rem, 0.8fr);
  align-items: stretch;
  min-width: 43rem;
  border-bottom: 1px solid #eef2f7;
}
.weekday-matrix-row > div {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: 0.5rem 0.35rem;
  color: #475569;
  font-size: 0.78rem;
  text-align: center;
}
.weekday-matrix-row > div:first-child {
  justify-content: flex-start;
  text-align: left;
}
.weekday-matrix-header {
  border-bottom: 1px solid #cbd5e1;
  color: #64748b;
  font-weight: 700;
}
.weekday-matrix-header > div {
  min-height: 2.5rem;
  font-size: 0.72rem;
}
.weekday-tool {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.weekday-tool strong {
  overflow: hidden;
  max-width: 9rem;
  color: #0f172a;
  font-size: 0.82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.weekday-tool small {
  overflow: hidden;
  max-width: 9rem;
  color: #64748b;
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.weekday-cell {
  margin: 0.3rem 0.15rem;
  border-radius: 0.3rem;
  font-weight: 700;
}
.weekday-cell.level-0 {
  color: #94a3b8;
  background: transparent;
}
.weekday-cell.level-1 {
  color: #1e40af;
  background: #dbeafe;
}
.weekday-cell.level-2 {
  color: #1e40af;
  background: #bfdbfe;
}
.weekday-cell.level-3 {
  color: #1e3a8a;
  background: #93c5fd;
}
.weekday-cell.level-4 {
  color: #fff;
  background: #3b82f6;
}
.weekday-cell.level-5 {
  color: #fff;
  background: #1d4ed8;
}
.weekday-total {
  color: #0f172a !important;
  font-weight: 700;
}
.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  color: #64748b;
  font-size: 0.7rem;
}
.heatmap-legend-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.heatmap-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.heatmap-legend i {
  display: block;
  flex: 0 0 auto;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 0.2rem;
  background: #dbeafe;
}
.heatmap-legend i.level-0 {
  border: 1px solid #cbd5e1;
  background: transparent;
}
.heatmap-legend i.level-2 {
  background: #bfdbfe;
}
.heatmap-legend i.level-3 {
  background: #93c5fd;
}
.heatmap-legend i.level-4 {
  background: #3b82f6;
}
.heatmap-legend i.level-5 {
  background: #1d4ed8;
}
.weekday-summary {
  display: grid;
  gap: 0.35rem;
}
.weekday-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0.9rem;
  border-radius: 0.45rem;
  color: #475569;
  background: #f8fafc;
}
.weekday-summary > div:first-child {
  color: #0f172a;
  background: #dbeafe;
}
.weekday-summary span {
  font-weight: 600;
}
.weekday-summary strong {
  color: #1d4ed8;
  font-size: 0.82rem;
}
@media (max-width: 850px) {
  .heatmap-dashboard-layout {
    grid-template-columns: 1fr;
  }
  .weekday-matrix-row {
    min-width: 39rem;
  }
}
.donation-page {
  min-height: calc(100vh - 6rem);
  padding: 2rem 1rem 4rem;
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.10), transparent 35%),
    linear-gradient(135deg, #f8fbff 0%, #eef4ff 100%);
  background-color: var(--blue-50);
}
.donation-page-inner {
  width: min(100%, 52rem);
  margin: 0 auto;
}
.donation-nav {
  margin-bottom: 1.25rem;
}
.donation-back {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 0.85rem;
  margin-bottom: 1rem;
  border: 1px solid #bfdbfe;
  border-radius: 0.5rem;
  background: #fff;
  color: #1d4ed8;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.1);
}
.donation-back:focus-visible {
  outline: 3px solid #2563eb;
  outline-offset: 2px;
}
.donation-back:hover {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
}
.donation-form-card {
  overflow: hidden;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.22);
}
.donation-form-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.75rem 2rem;
  color: #fff;
  background: linear-gradient(100deg, #2563eb, #1d4ed8);
}
.donation-form-header h1 {
  margin: 0;
  font-size: 1.65rem;
}
.donation-form-header p {
  margin: 0.35rem 0 0;
  color: #dbeafe;
  font-size: 0.9rem;
}
.donation-form-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.18);
}
.donation-form-icon .icon {
  width: 1.7rem;
  height: 1.7rem;
}
.donation-form-body {
  padding: 1.75rem 2rem 2rem;
}
.donation-message {
  min-height: 1.35rem;
  margin-bottom: 0.5rem;
  color: #166534;
  font-size: 0.85rem;
}
.donation-flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid rgba(22, 101, 52, 0.2);
  border-radius: 0.6rem;
  background: rgba(34, 197, 94, 0.08);
  color: #166534;
  font-size: 0.85rem;
  font-weight: 600;
}
.donation-flash.is-hidden {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.donation-flash button {
  flex-shrink: 0;
}
.donation-section {
  padding: 1.25rem 0;
  border-bottom: 1px solid #e5e7eb;
}
.donation-section h2 {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 1rem;
  color: #111827;
  font-size: 1.05rem;
}
.donation-section h2 span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  color: #fff;
  background: #2563eb;
  font-size: 0.8rem;
}
.donation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.donation-grid label {
  margin: 0;
  color: #374151;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}
.donation-grid label b {
  color: #dc2626;
}
.donation-grid input,
.donation-grid select,
.donation-grid textarea {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  color: #111827;
  background: #fff;
  font: inherit;
  outline: none;
}
.donation-grid input:focus,
.donation-grid select:focus,
.donation-grid textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.donation-grid textarea {
  resize: vertical;
}
.full-field {
  grid-column: 1/-1;
}
.donation-form-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 1.5rem;
}
.donation-form-actions a,
.donation-form-actions button {
  width: auto;
  min-width: 9rem;
  text-align: center;
}
.donation-form-actions .primary {
  border: 0;
}
.donation-form-actions .secondary {
  display: inline-block;
  border: 1px solid #d1d5db;
  border-radius: 0.45rem;
  padding: 0.7rem 1rem;
  color: #374151;
  background: #fff;
  text-decoration: none;
}
@media (max-width: 600px) {
  .donation-page {
    padding: 1rem 0.75rem 3rem;
  }
  .donation-form-header,
  .donation-form-body {
    padding: 1.25rem;
  }
  .donation-grid {
    grid-template-columns: 1fr;
  }
  .full-field {
    grid-column: auto;
  }
  .donation-form-actions {
    flex-direction: column-reverse;
  }
  .donation-form-actions a,
  .donation-form-actions button {
    width: 100%;
  }
}
.borrower-page {
  min-height: calc(100vh - 6rem);
  background: transparent;
}
.borrower-welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  color: var(--blue-800);
}
.borrower-welcome h1 {
  margin: 0.35rem 0;
  font-size: 2rem;
}
.borrower-welcome p:not(.eyebrow) {
  margin: 0;
  color: var(--text-secondary);
}
.eyebrow {
  margin: 0;
  color: var(--blue-primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.borrower-welcome .eyebrow {
  color: var(--blue-primary);
}
.borrower-nav {
  margin-bottom: 1.25rem;
}
.borrower-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.borrower-stats div {
  padding: 1.1rem 1.25rem;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border: 1px solid var(--blue-100);
  box-shadow: var(--shadow-md);
}
.borrower-stats strong,
.borrower-stats span {
  display: block;
}
.borrower-stats strong {
  color: var(--blue-primary);
  font-size: 1.7rem;
}
.borrower-stats span {
  color: var(--text-secondary);
  font-size: 0.8rem;
}
.reservation-overview {
  margin-bottom: 1rem;
}
.reservation-guidance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  border-color: var(--blue-200);
  background: linear-gradient(135deg, #fff 0%, var(--blue-50) 100%);
}
.reservation-guidance p:not(.eyebrow) {
  max-width: 62rem;
  margin: 0.35rem 0 0;
  color: var(--text-secondary);
  line-height: 1.55;
}
.reservation-guidance a {
  flex-shrink: 0;
  text-decoration: none;
}
@media (max-width: 600px) {
  .reservation-guidance {
    align-items: stretch;
    flex-direction: column;
  }
  .reservation-guidance a {
    align-self: flex-start;
  }
}
.borrower-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
.borrower-section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.borrower-section-heading h2,
.borrower-guidelines h2 {
  margin: 0.25rem 0 0;
  color: #0f172a;
  font-size: 1.35rem;
}
.borrower-section-heading .search {
  max-width: 22rem;
}
.borrower-category,
.borrower-subcategory {
  margin-bottom: 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #fff;
}
.borrower-category summary,
.borrower-subcategory summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  list-style: none;
  color: #0f172a;
  font-weight: 700;
}
.borrower-category summary::-webkit-details-marker,
.borrower-subcategory summary::-webkit-details-marker {
  display: none;
}
.borrower-category summary small,
.borrower-subcategory summary small {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 400;
}
.borrower-category-body {
  padding: 0.7rem;
  background: #f8fafc;
}
.borrower-item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.7rem;
  padding: 0.7rem;
}
.borrower-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #fff;
}
.borrower-item-image {
  display: block;
  width: 100%;
  max-height: 10rem;
  aspect-ratio: 4/3;
  object-fit: contain;
  background: #f8fafc;
}
.borrower-item h3 {
  margin: 0;
  color: #0f172a;
  font-size: 0.95rem;
}
.borrower-item p {
  margin: 0.25rem 0 0;
  color: #64748b;
  font-size: 0.8rem;
}
.available-count {
  text-align: right;
}
.available-count span {
  display: block;
  color: #64748b;
  font-size: 0.7rem;
}
.available-count strong {
  color: #1d4ed8;
  font-size: 1.35rem;
}
.borrower-item-meta {
  display: flex;
  grid-column: 1/-1;
  gap: 0.5rem;
}
.borrower-item-meta span {
  flex: 1;
  padding: 0.45rem;
  border-radius: 0.4rem;
  color: #64748b;
  background: #f8fafc;
  font-size: 0.7rem;
}
.borrower-item-meta b {
  color: #0f172a;
}
.borrower-item .primary {
  grid-column: 1/-1;
  width: auto;
}
.borrower-inventory-group {
  overflow: hidden;
}
.borrower-layout,
.borrower-equipment,
.borrower-groups,
.borrower-category-body {
  min-width: 0;
  max-width: 100%;
}
.borrower-category-body {
  overflow: hidden;
  padding: 0.45rem;
}
.borrower-tool-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.78rem;
}
.borrower-tool-table th:nth-child(1) {
  width: 5%;
}
.borrower-tool-table th:nth-child(2) {
  width: 10%;
}
.borrower-tool-table th:nth-child(3) {
  width: 19%;
}
.borrower-tool-table th:nth-child(4) {
  width: 11%;
}
.borrower-tool-table th:nth-child(5) {
  width: 11%;
}
.borrower-tool-table th:nth-child(6) {
  width: 8%;
}
.borrower-tool-table th:nth-child(7) {
  width: 10%;
}
.borrower-tool-table th:nth-child(8) {
  width: 10%;
}
.borrower-tool-table th:nth-child(9) {
  width: 16%;
}
.borrower-tool-table th,
.borrower-tool-table td {
  min-width: 0;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
}
.borrower-tool-table thead th {
  color: #475569;
  background: #f8fafc;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 2px solid #cbd5e1;
}
.borrower-tool-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.12s ease;
}
.borrower-tool-table tbody tr:last-child {
  border-bottom: 0;
}
.borrower-tool-table tbody tr:hover {
  background: #f8fafc;
}
.borrower-tool-table tbody tr:hover .borrower-table-actions button {
  opacity: 1;
}
.borrower-tool-name-wrap {
  display: grid;
  gap: 0.2rem;
}
.borrower-tool-name-wrap strong {
  color: #0f172a;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}
.borrower-tool-name-wrap span {
  color: #64748b;
  font-size: 0.72rem;
}
.borrower-row-badge,
.borrower-row-status,
.borrower-table-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.28rem 0.52rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: normal;
  overflow-wrap: anywhere;
  min-width: 5.6rem;
  text-align: center;
}
.borrower-row-badge {
  color: #334155;
  background: #f1f5f9;
}
.borrower-row-status.is-available {
  color: #166534;
  background: #dcfce7;
}
.borrower-row-status.is-borrowed {
  color: #7c2d12;
  background: #ffedd5;
}
.borrower-row-status.is-damaged,
.borrower-row-status.is-maintenance {
  color: #991b1b;
  background: #fee2e2;
}
.borrower-row-status.is-neutral {
  color: #334155;
  background: #e2e8f0;
}
.borrower-table-lock {
  color: #64748b;
  background: #f1f5f9;
  width: 100%;
  text-align: center;
  min-height: 2.1rem;
  padding: 0.35rem 0.4rem;
  font-size: 0.72rem;
  line-height: 1.2;
  border-radius: 0.5rem;
}
@media (max-width: 800px) {
  .borrower-category-body {
    padding: 0.4rem;
  }
  .borrower-tool-table,
  .borrower-tool-table tbody {
    display: block;
    width: 100%;
  }
  .borrower-tool-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .borrower-tool-table tbody {
    display: grid;
    gap: 0.55rem;
  }
  .borrower-tool-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem 0.8rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.45rem;
    background: #fff;
  }
  .borrower-tool-table tbody tr:hover {
    background: #f8fafc;
  }
  .borrower-tool-table td {
    display: grid;
    grid-template-columns: minmax(5.5rem, 0.75fr) minmax(0, 1.25fr);
    align-items: start;
    gap: 0.35rem;
    padding: 0.25rem 0;
    border: 0;
  }
  .borrower-tool-table td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 700;
  }
  .borrower-tool-table td[data-label="Tool Name"] {
    grid-column: 1 / -1;
    grid-template-columns: minmax(5.5rem, 0.35fr) minmax(0, 1.65fr);
  }
  .borrower-tool-table td[data-label="Select"] {
    display: none;
  }
  .borrower-tool-table td[data-label="Action"] {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }
  .borrower-tool-table .borrower-table-actions {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .borrower-tool-table .borrower-table-actions button {
    flex: 1 1 5rem;
    width: auto;
  }
}

.borrower-guidelines {
  height: max-content;
}
.borrower-guidelines ul {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: #64748b;
  font-size: 0.85rem;
  line-height: 1.8;
}
.borrower-history {
  margin-bottom: 2rem;
}
.borrow-return-progress {
  display: block;
  margin-top: 0.2rem;
  color: #64748b;
  font-size: 0.72rem;
}
.muted {
  color: #94a3b8;
}
.modal-check {
  display: flex !important;
  align-items: flex-start;
  gap: 0.5rem;
  color: #475569 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
.modal-check input {
  width: auto !important;
  margin: 0.1rem 0 0 !important;
}
/* Borrow History Toolbar */
.borrower-history-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-bottom: 0;
  flex-wrap: wrap;
}
.borrower-history-toolbar .search {
  flex: 1;
  min-width: 240px;
}
.borrower-history-toolbar select {
  min-width: 200px;
  padding: 0.65rem 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.45rem;
  background: #fff;
  font: inherit;
  font-size: 0.875rem;
  color: #0f172a;
  cursor: pointer;
}

/* Borrow History Table */
.borrower-history-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.875rem;
}
.borrower-history-table thead th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.borrower-history-table th,
.borrower-history-table td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
  white-space: normal;
  min-width: 0;
}
.borrower-history-table th:nth-child(1),
.borrower-history-table td:nth-child(1) {
  width: 3%;
  text-align: center;
}
.borrower-history-table th:nth-child(2),
.borrower-history-table td:nth-child(2) {
  width: 13%;
}
.borrower-history-table th:nth-child(3),
.borrower-history-table td:nth-child(3) {
  width: 25%;
}
.borrower-history-table th:nth-child(4),
.borrower-history-table td:nth-child(4) {
  width: 9%;
  text-align: center;
}
.borrower-history-table th:nth-child(5),
.borrower-history-table td:nth-child(5) {
  width: 11%;
}
.borrower-history-table th:nth-child(6),
.borrower-history-table td:nth-child(6) {
  width: 11%;
}
.borrower-history-table th:nth-child(7),
.borrower-history-table td:nth-child(7) {
  width: 11%;
}
.borrower-history-table th:nth-child(8),
.borrower-history-table td:nth-child(8) {
  width: 8%;
}
.borrower-history-table th:nth-child(9),
.borrower-history-table td:nth-child(9) {
  width: 9%;
  text-align: center;
}
.borrower-history-table tbody tr {
  transition: background 0.12s ease;
}
.borrower-history-table tbody tr:last-child td {
  border-bottom: 0;
}
.borrower-history-table tbody tr:hover {
  background: #f8fafc;
}
.borrower-history-table td.transaction-id strong {
  display: block;
  color: #0f172a;
  font-weight: 700;
  min-width: 0;
  overflow-wrap: anywhere;
}
.borrower-history-table td.total-items {
  color: #334155;
  font-variant-numeric: tabular-nums;
}
.borrower-history-table .borrowed-tools {
  min-width: 0;
}
.borrower-history-table .borrowed-tools strong {
  display: block;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.875rem;
  min-width: 0;
  overflow-wrap: anywhere;
}
.borrowed-tool-line {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.45;
  margin: 0.125rem 0;
}
.borrowed-tool-qty {
  color: #64748b;
  opacity: 0.9;
}
.borrower-history-table .empty-state {
  padding: 2.5rem 2rem;
  color: #64748b;
  text-align: center;
}
.borrower-history-table .empty-state a {
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: underline;
}
.borrower-history-details-button {
  padding: 0;
  border: 0;
  background: none;
  color: #1d4ed8;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.borrower-history-details-button:hover {
  text-decoration: underline;
}
.borrower-detail-items-scroll {
  max-width: 100%;
  margin-top: 0.75rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.borrower-detail-items-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 58rem;
}
.borrower-detail-items-table th,
.borrower-detail-items-table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #eef0f3;
  text-align: left;
  font-size: 0.85rem;
  white-space: nowrap;
}
/* Borrower table responsive layout (desktop/tablet/mobile) is defined at the end of this stylesheet. */
.borrower-transaction-modal {
  max-width: 48rem;
}
.borrower-transaction-tool-image {
  display: block;
  width: min(100%, 22rem);
  max-height: 16rem;
  margin: 0 auto 1rem;
  object-fit: contain;
}
.borrower-transaction-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.75rem;
}
.borrower-transaction-facts div,
.borrower-transaction-photos section {
  min-width: 0;
}
.borrower-transaction-facts dt {
  color: #64748b;
  font-size: 0.75rem;
}
.borrower-transaction-facts dd {
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
}
.borrower-pickup-instructions {
  margin-top: 0.75rem;
  padding: 0.85rem;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #2563eb;
  border-radius: 0.5rem;
  background: #eff6ff;
  overflow-wrap: anywhere;
}
.borrower-pickup-instructions-entry {
  padding: 0.85rem 0;
  border-top: 1px solid #e2e8f0;
}
.borrower-pickup-instructions-entry p {
  margin: 0.35rem 0;
}
.borrower-transaction-photos {
  display: block;
  margin-top: 1.25rem;
}
.borrower-transaction-photos h3 {
  font-size: 0.95rem;
}
.borrower-photo-inspection {
  margin-top: 0.75rem;
  padding: 0.85rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
}
.borrower-photo-inspection h4 {
  margin: 0 0 0.65rem;
}
.borrower-photo-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.borrower-photo-pair > div {
  min-width: 0;
}
.borrower-photo-pair > div > strong {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}
.borrower-photo-link {
  display: inline-block;
  margin: 0.2rem;
}
.borrower-photo-link img {
  display: block;
  width: 7rem;
  height: 7rem;
  border-radius: 0.35rem;
  object-fit: cover;
}
.borrower-photo-empty,
.borrower-photo-pair [data-borrower-photo-gallery] {
  color: #64748b;
  font-size: 0.8rem;
}
@media (max-width: 540px) {
  .borrower-photo-pair {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 800px) {
  .borrower-layout {
    grid-template-columns: 1fr;
  }
  .borrower-stats {
    grid-template-columns: 1fr 1fr;
  }
  .borrower-welcome {
    align-items: flex-start;
    flex-direction: column;
  }
  .borrower-section-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .borrower-section-heading .search {
    max-width: none;
  }
}
@media (max-width: 500px) {
  .borrower-stats {
    grid-template-columns: 1fr;
  }
}
.borrower-equipment-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 1rem;
}
.borrower-equipment-filters > label {
  grid-column: 1 / -1;
}
.borrower-filter-disclosure {
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #f8fafc;
}
.borrower-filter-disclosure > summary {
  padding: 0.65rem 0.85rem;
  color: #334155;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.borrower-filter-disclosure[open] > summary {
  border-bottom: 1px solid #e2e8f0;
}
.borrower-filter-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.65rem;
  padding: 0.75rem;
}
.borrower-equipment-filters label {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
  margin: 0;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
}
.borrower-equipment-filters input,
.borrower-equipment-filters select {
  width: 100%;
  min-width: 0;
  height: 2.65rem;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
  color: #172b3a;
  background: #fff;
  font: inherit;
}
@media (max-width: 800px) {
  .borrower-equipment-filters {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 500px) {
  .borrower-equipment-filters {
    grid-template-columns: 1fr;
  }
  .borrower-filter-options {
    grid-template-columns: 1fr;
  }
}
.borrower-category-legend {
  display: none;
}
.borrower-empty-category {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.65rem;
  padding: 0.85rem 1rem;
  border: 1px solid #bfdbfe;
  border-radius: 0.65rem;
  color: #1e3a8a;
  background: #eff6ff;
}
.borrower-empty-category span {
  color: #64748b;
  font-size: 0.8rem;
}
.borrower-type-groups {
  display: grid;
  gap: 0.55rem;
  padding: 0.65rem;
}
.borrower-tool-group {
  overflow: hidden;
  border: 1px solid #dbe2ea;
  border-radius: 0.45rem;
  background: #fff;
}
.borrower-tool-group > summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  color: #172b3a;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}
.borrower-tool-group > summary::-webkit-details-marker {
  display: none;
}
.borrower-tool-group > summary small {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 400;
  text-align: right;
}
.borrower-category.category-ICT {
  border-left: 4px solid #2563eb;
}
.borrower-category.category-ICT > summary {
  color: #1d4ed8;
  background: linear-gradient(90deg, #eff6ff, #fff 42%);
}
.borrower-category.category-AFA {
  border-left: 4px solid #16a34a;
}
.borrower-category.category-AFA > summary {
  color: #15803d;
  background: linear-gradient(90deg, #f0fdf4, #fff 42%);
}
.borrower-category.category-IA {
  border-left: 4px solid #9333ea;
}
.borrower-category.category-IA > summary {
  color: #7e22ce;
  background: linear-gradient(90deg, #faf5ff, #fff 42%);
}
.borrower-category.category-HE {
  border-left: 4px solid #ea580c;
}
.borrower-category.category-HE > summary {
  color: #c2410c;
  background: linear-gradient(90deg, #fff7ed, #fff 42%);
}
.photo-preview {
  display: block;
  width: 100%;
  max-height: 10rem;
  margin-top: 0.5rem;
  object-fit: contain;
  border: 1px solid #dbeafe;
  border-radius: 0.45rem;
  background: #f8fafc;
}
.photo-previews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.photo-previews .photo-preview {
  width: 100%;
  height: 6rem;
  margin-top: 0;
}
.photo-missing {
  color: #b91c1c;
  font-size: 0.75rem;
  font-weight: 700;
}
.photo-link {
  border: 0;
  color: #1d4ed8;
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline;
}
.photo-compare-modal {
  width: min(100%, 54rem);
}
.photo-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.5rem;
}
.photo-compare h3 {
  color: #475569;
  font-size: 0.85rem;
}
.compare-photo,
.photo-missing.large {
  display: block;
  width: 100%;
  min-height: 12rem;
  max-height: 24rem;
  object-fit: contain;
  border: 1px solid #dbeafe;
  border-radius: 0.45rem;
  background: #f8fafc;
}
.photo-gallery .compare-photo {
  height: 8rem;
  min-height: 0;
}
.photo-missing.large {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b91c1c;
  font-size: 0.85rem;
  font-weight: 700;
}
@media (max-width: 700px) {
  .photo-compare {
    grid-template-columns: 1fr;
  }
}
.maintenance-unified-toolbar {
  display: grid;
  grid-template-columns: minmax(14rem, 2fr) repeat(6, minmax(8rem, 1fr));
  align-items: end;
  gap: 0.75rem;
}
.maintenance-unified-toolbar label {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
  margin: 0;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
}
.maintenance-unified-toolbar label span {
  display: block;
}
.maintenance-unified-toolbar input,
.maintenance-unified-toolbar select {
  width: 100%;
  min-width: 0;
  height: 2.7rem;
  margin: 0;
}
@media (max-width: 1050px) {
  .maintenance-unified-toolbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .maintenance-unified-toolbar label:first-child {
    grid-column: span 2;
  }
}
@media (max-width: 700px) {
  .maintenance-unified-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .maintenance-unified-toolbar label:first-child {
    grid-column: 1/-1;
  }
}
@media (max-width: 450px) {
  .maintenance-unified-toolbar {
    grid-template-columns: 1fr;
  }
  .maintenance-unified-toolbar label:first-child {
    grid-column: auto;
  }
}
.maintenance-history-toolbar {
  align-items: flex-end;
  gap: 0.75rem;
}
.maintenance-history-toolbar label {
  flex: 1 1 10rem;
  min-width: 9rem;
  margin: 0;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}
.maintenance-history-toolbar label span {
  display: block;
  margin-bottom: 0.35rem;
}
.maintenance-history-toolbar input,
.maintenance-history-toolbar select {
  width: 100%;
  min-width: 0;
  height: 2.7rem;
}
.maintenance-history-page .feature-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.maintenance-history-page .feature-actions .secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.maintenance-history-page .feature-actions .icon {
  width: 0.95rem;
  height: 0.95rem;
}
.maintenance-history-page .table-wrap table {
  min-width: 70rem;
}
.maintenance-history-page td {
  vertical-align: top;
}
.tool-details-summary {
  margin: 1rem 0;
  padding: 1rem 0;
  border-top: 1px solid #dbe2ea;
  border-bottom: 1px solid #dbe2ea;
  background: #fff;
}
.tool-details-identity {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.tool-details-identity h2 {
  margin: 0.2rem 0;
  color: #172b3a;
}
.tool-details-identity p {
  margin: 0.3rem 0;
  color: #52616b;
}
.tool-details-image,
.tool-details-image-placeholder {
  width: 7rem;
  height: 7rem;
  flex: 0 0 7rem;
  object-fit: contain;
  border: 1px solid #dbe2ea;
  background: #f5f8f8;
}
.tool-details-image-placeholder {
  display: grid;
  place-items: center;
  color: #28756f;
  font-size: 2rem;
  font-weight: 700;
}
.tool-details-page .table-wrap h2 {
  padding: 1rem 1rem 0;
  font-size: 1.1rem;
}
.tool-status-timeline {
  min-width: 10rem;
  margin-top: 0.3rem;
  font-size: 0.75rem;
}
.tool-status-timeline summary {
  color: #2b635f;
  cursor: pointer;
  font-weight: 700;
}
.tool-status-timeline ol {
  margin: 0.4rem 0 0.3rem 1rem;
  padding-left: 0.8rem;
}
.tool-status-timeline li {
  margin: 0.35rem 0;
}
.tool-status-timeline li span {
  display: block;
  color: #64748b;
  font-size: 0.68rem;
}
.tool-status-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
}
.tool-status-controls .badge {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.missing-tool-note {
  margin: 0.5rem 0 0;
  color: #9b2c2c;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}
@media (max-width: 700px) {
  .maintenance-history-toolbar label {
    flex-basis: calc(50% - 0.75rem);
  }
  .maintenance-history-page .feature-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .maintenance-history-page .feature-actions {
    width: 100%;
  }
  .maintenance-history-page .feature-actions button {
    flex: 1 1 auto;
  }
  .tool-details-identity {
    align-items: flex-start;
  }
  .tool-details-image,
  .tool-details-image-placeholder {
    width: 5rem;
    height: 5rem;
    flex-basis: 5rem;
  }
}
.maintenance-page .feature-heading {
  align-items: center;
  padding: 1rem 1.25rem;
  border: 1px solid #bfdbfe;
  border-radius: 0.9rem;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
.maintenance-page .feature-heading h1 {
  color: #1e293b;
}
.maintenance-page .feature-heading p {
  color: #475569;
}
.maintenance-page .feature-heading .eyebrow {
  margin: 0;
  color: #1d4ed8;
}
.maintenance-page .feature-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.maintenance-page .feature-actions .secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid #1d4ed8;
  background: #1d4ed8;
  color: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.16);
}
.maintenance-page .feature-actions .secondary:hover {
  border-color: #1e40af;
  background: #1e40af;
}
.maintenance-page .feature-actions .icon {
  width: 0.95rem;
  height: 0.95rem;
}
.export-page .feature-heading .eyebrow {
  margin: 0;
  color: #bfdbfe;
}
.export-page .feature-actions .secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.export-page .feature-actions .icon {
  width: 0.95rem;
  height: 0.95rem;
}
.maintenance-toolbar {
  align-items: flex-end;
}
.maintenance-toolbar label {
  flex: 0 0 10rem;
  margin: 0;
  color: #64748b;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.maintenance-toolbar label span {
  display: block;
  margin-bottom: 0.35rem;
}
.maintenance-toolbar .maintenance-search {
  flex: 1 1 20rem;
}
.maintenance-toolbar .search,
.maintenance-toolbar select {
  width: 100%;
  min-width: 0;
  height: 2.75rem;
}
.maintenance-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.maintenance-kpis span {
  min-height: 5rem;
  padding: 1rem 1.1rem;
  border: 1px solid #dbeafe;
  border-radius: 0.7rem;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}
.maintenance-kpis span:nth-child(1) {
  border-top: 3px solid #dc2626;
}
.maintenance-kpis span:nth-child(2) {
  border-top: 3px solid #f59e0b;
}
.maintenance-kpis span:nth-child(3) {
  border-top: 3px solid #16a34a;
}
.maintenance-kpis strong {
  margin-top: 0.25rem;
  font-size: 1.7rem;
}
.maintenance-list {
  display: grid;
  gap: 1rem;
}
.maintenance-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 0.55fr);
  gap: 1.25rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}
.maintenance-card-main {
  min-width: 0;
}
.maintenance-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.maintenance-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 0.75rem;
  font-weight: 700;
}
.maintenance-card-title-wrap {
  flex: 1;
  min-width: 0;
}
.maintenance-card h3 {
  margin: 0 0 0.55rem;
  color: #0f172a;
  font-size: 1.15rem;
}
.maintenance-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
}
.status-pill.status-defective {
  color: #b91c1c;
  background: #fee2e2;
}
.status-pill.status-functional {
  color: #166534;
  background: #dcfce7;
}
.maintenance-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.65rem;
}
.maintenance-meta-grid div {
  padding: 0.75rem 0.8rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.6rem;
  background: #f8fafc;
}
.maintenance-meta-grid p {
  margin: 0 0 0.25rem;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.maintenance-meta-grid strong {
  color: #0f172a;
  font-size: 0.88rem;
}
.maintenance-details {
  margin: 1rem 0 0;
  color: #475569;
  font-size: 0.85rem;
}
.maintenance-details strong {
  color: #1f2937;
}
.maintenance-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.7rem;
  padding-left: 1rem;
  border-left: 1px solid #e2e8f0;
}
.maintenance-actions .button,
.maintenance-actions button {
  width: 100%;
}
.maintenance-history-item {
  margin-top: 0.8rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.55rem;
  background: #f8fafc;
}
.maintenance-history-item strong {
  display: block;
  color: #0f172a;
  margin-bottom: 0.2rem;
}
.maintenance-history-item span {
  display: block;
  color: #64748b;
  font-size: 0.72rem;
}
.maintenance-history-item p {
  margin: 0.45rem 0 0;
  color: #475569;
}
.maintenance-history-empty {
  color: #64748b;
}
@media (max-width: 750px) {
  .maintenance-kpis {
    grid-template-columns: 1fr 1fr;
  }
  .maintenance-card {
    grid-template-columns: 1fr;
  }
  .maintenance-actions {
    padding: 0.9rem 0 0;
    border-top: 1px solid #e2e8f0;
    border-left: 0;
  }
  .maintenance-page .feature-heading {
    flex-direction: column;
    align-items: flex-start;
  }
  .maintenance-page .feature-actions {
    width: 100%;
  }
}
@media (max-width: 500px) {
  .maintenance-kpis {
    grid-template-columns: 1fr;
  }
  .maintenance-toolbar label,
  .maintenance-toolbar .maintenance-search {
    flex-basis: 100%;
  }
  .export-page .feature-actions {
    width: 100%;
  }
  .export-page .feature-actions button {
    flex: 1;
  }
  .maintenance-meta-grid {
    grid-template-columns: 1fr;
  }
}
.inventory-groups > .inventory-primary.category-ICT {
  border-left: 4px solid #2563eb;
}
.inventory-groups > .inventory-primary.category-ICT > summary {
  color: #1d4ed8;
  background: linear-gradient(90deg, #eff6ff, #fff 42%);
}
.inventory-groups > .inventory-primary.category-AFA {
  border-left: 4px solid #16a34a;
}
.inventory-groups > .inventory-primary.category-AFA > summary {
  color: #15803d;
  background: linear-gradient(90deg, #f0fdf4, #fff 42%);
}
.inventory-groups > .inventory-primary.category-IA {
  border-left: 4px solid #64748b;
}
.inventory-groups > .inventory-primary.category-IA > summary {
  color: #475569;
  background: linear-gradient(90deg, #f1f5f9, #fff 42%);
}
.inventory-groups > .inventory-primary.category-HE {
  border-left: 4px solid #2563eb;
}
.inventory-groups > .inventory-primary.category-HE > summary {
  color: #1d4ed8;
  background: linear-gradient(90deg, #eff6ff, #fff 52%);
}
.global-admin-nav {
  max-width: 80rem;
  margin: 1rem auto 0;
  padding: 0.65rem;
  gap: 0.35rem;
  border: 1px solid var(--blue-200);
  background: var(--card-bg);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}
/* Keep the nav's edges lined up with the content card on the blue backdrop. */
@media (min-width: 601px) {
  .global-admin-nav {
    width: calc(100% - 2rem);
  }
}
@media (min-width: 1001px) {
  .global-admin-nav {
    width: calc(100% - 3rem);
  }
}
.global-admin-nav a,
.global-admin-nav button {
  min-height: 2.45rem;
  padding: 0.55rem 0.8rem;
  border-color: transparent;
  border-radius: var(--radius-md);
  color: var(--blue-700);
  font-size: 0.78rem;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.global-admin-nav a:hover,
.global-admin-nav button:hover {
  color: var(--blue-primary-dark);
  background: var(--blue-50);
}
.global-admin-nav a.active {
  color: #fff;
  border-color: var(--blue-primary-dark);
  background: var(--blue-primary-dark);
  box-shadow: 0 3px 8px rgba(29, 78, 216, 0.22);
}
.global-admin-nav a.active:hover {
  color: #fff;
  background: var(--blue-800);
}
.global-admin-nav .icon {
  width: 1rem;
  height: 1rem;
}
.global-admin-nav .admin-logout {
  margin-left: auto;
  color: #b91c1c;
}
.global-admin-nav .admin-logout:hover {
  color: #991b1b;
  background: #fef2f2;
}
@media (max-width: 900px) {
  .global-admin-nav .admin-logout {
    margin-left: 0;
  }
}
@media (max-width: 600px) {
  .global-admin-nav {
    margin: 0.75rem 0.75rem 0;
    padding: 0.5rem;
    gap: 0.3rem;
  }
  .global-admin-nav a,
  .global-admin-nav button {
    flex: 1 1 calc(50% - 0.3rem);
    justify-content: center;
    padding: 0.55rem 0.45rem;
  }
  .global-admin-nav .admin-logout {
    flex-basis: 100%;
  }
}
.inventory-modal {
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.donation-edit-modal {
  max-height: calc(100dvh - 2rem);
  overscroll-behavior: contain;
}
.form-span {
  grid-column: 1 / -1;
}
.inventory-asset-id {
  display: block;
  margin: 0.35rem 0;
  color: #334155;
  font-size: 0.78rem;
}
.inventory-asset-id strong {
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  .form-span {
    grid-column: auto;
  }
}
.inventory-asset-id {
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0.25rem 0;
  text-align: left;
}
.inventory-asset-id:hover,
.inventory-asset-id:focus-visible {
  color: #087e78;
  text-decoration: underline;
}
.inventory-asset-id:focus-visible {
  outline: 2px solid #087e78;
  outline-offset: 3px;
}
.inventory-drawer-backdrop {
  position: fixed;
  z-index: 140;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(17, 33, 40, 0.42);
  animation: asset-drawer-fade 0.18s ease-out;
}
.asset-drawer {
  width: min(34rem, 100vw);
  height: 100%;
  overflow-y: auto;
  background: #fff;
  color: #172b3a;
  box-shadow: -18px 0 45px rgba(12, 31, 38, 0.2);
  animation: asset-drawer-enter 0.24s cubic-bezier(0.2, 0.75, 0.25, 1);
}
.legend-ia {
  background: #64748b;
}
.legend-he {
  color: #1d4ed8;
  background: #fff;
  outline: 1px solid #2563eb;
}
.category-legend span.legend-he {
  color: #1d4ed8;
  background: #fff;
  outline: 1px solid #2563eb;
}
.borrower-category-legend span:nth-child(3) {
  color: #475569;
  background: #e2e8f0;
}
.borrower-category-legend span:nth-child(4) {
  color: #1d4ed8;
  background: #fff;
  outline: 1px solid #2563eb;
}
.borrower-category.category-IA {
  border-left-color: #64748b;
}
.borrower-category.category-IA > summary {
  color: #475569;
  background: linear-gradient(90deg, #f1f5f9, #fff 42%);
}
.borrower-category.category-HE {
  border-left-color: #2563eb;
}
.borrower-category.category-HE > summary {
  color: #1d4ed8;
  background: linear-gradient(90deg, #dbeafe, #fff 52%);
}
.asset-drawer-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  border-bottom: 1px solid #dbe2ea;
}
.asset-drawer-header h2 {
  margin: 0.2rem 0;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
}
.asset-drawer-header p {
  margin: 0.25rem 0;
  color: #52616b;
}
.asset-drawer-header .eyebrow {
  color: #087e78;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}
.asset-drawer-close {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #dbe2ea;
  border-radius: 0.4rem;
  background: #fff;
  color: #172b3a;
  font-size: 1.5rem;
  cursor: pointer;
}
.asset-drawer-content {
  padding: 1.25rem 1.5rem 2rem;
}
.asset-drawer-image,
.asset-drawer-image-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 12rem;
  margin-bottom: 1.2rem;
  object-fit: contain;
  border: 1px solid #dbe2ea;
  background: #f5f8f8;
  color: #087e78;
  font-size: 2rem;
  font-weight: 700;
}
.asset-drawer-facts {
  margin: 0;
  border-top: 1px solid #dbe2ea;
}
.asset-drawer-facts div {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid #e7edf0;
}
.asset-drawer-facts dt {
  color: #64748b;
  font-size: 0.78rem;
}
.asset-drawer-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: 600;
}
.asset-drawer-description,
.asset-drawer-history {
  padding: 1.1rem 0;
  border-bottom: 1px solid #dbe2ea;
}
.asset-drawer-description h3,
.asset-drawer-history h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
}
.asset-drawer-description p,
.asset-drawer-history p {
  margin: 0.35rem 0;
  color: #52616b;
  white-space: pre-wrap;
}
.asset-drawer-history ol {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding-left: 1.2rem;
}
.asset-drawer-history li span {
  display: block;
  color: #64748b;
  font-size: 0.75rem;
}
.asset-drawer-history li p {
  font-size: 0.85rem;
}
.asset-drawer-link {
  display: inline-flex;
  margin-top: 1rem;
}
.asset-drawer-open {
  overflow: hidden;
}
@keyframes asset-drawer-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes asset-drawer-enter {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}
@media (max-width: 540px) {
  .asset-drawer-facts div {
    grid-template-columns: 7rem minmax(0, 1fr);
  }
  .asset-drawer-header,
  .asset-drawer-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}
.asset-type-groups {
  display: grid;
  gap: 0.55rem;
  padding: 0.65rem;
}
.asset-type-group {
  overflow: hidden;
  border: 1px solid #dbe2ea;
  border-radius: 0.45rem;
  background: #fff;
}
.asset-type-group > summary {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  color: #172b3a;
  font-weight: 700;
  cursor: pointer;
}
.asset-type-group > summary small {
  color: #64748b;
  font-weight: 500;
  text-align: right;
}
.asset-unit-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.65rem;
  padding: 0.7rem;
  border-top: 1px solid #e7edf0;
  background: #f7faf9;
}
.asset-unit-card {
  min-width: 0;
  margin: 0;
  padding: 0.8rem;
  border-radius: 0.4rem;
  box-shadow: none;
}
.asset-unit-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.asset-unit-heading .inventory-asset-id {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
}
.asset-unit-card > p {
  margin: 0.5rem 0;
  color: #52616b;
  font-size: 0.8rem;
}
.asset-unit-card .card-actions {
  margin-top: 0.6rem;
}
.inventory-extra-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.65rem;
  width: 100%;
  padding-top: 0.75rem;
  border-top: 1px solid #dbe2ea;
}
.inventory-extra-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: #52616b;
  font-size: 0.72rem;
  font-weight: 700;
}
.inventory-extra-controls input,
.inventory-extra-controls select {
  width: 100%;
  min-width: 0;
  height: 2.5rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid #cbd5d9;
  border-radius: 0.35rem;
  background: #fff;
  color: #172b3a;
  font: inherit;
}
.inventory-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.inventory-kpis span {
  min-width: 7rem;
}
.asset-type-group > summary {
  align-items: center;
}
.low-stock-badge {
  flex: none;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  background: #fff0d4;
  color: #8a4b08;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}
.asset-type-group[hidden],
.inventory-secondary[hidden],
.inventory-primary[hidden],
.asset-unit-card[hidden] {
  display: none !important;
}
.inventory-extra-controls ~ .inventory-kpis {
  margin-top: 0.25rem;
}
.inventory-modal form[data-edit-asset-form] {
  display: grid;
  gap: 0.75rem;
}
.inventory-modal form[data-edit-asset-form] label {
  display: grid;
  gap: 0.35rem;
  color: #52616b;
  font-size: 0.78rem;
  font-weight: 600;
}
.inventory-modal form[data-edit-asset-form] input,
.inventory-modal form[data-edit-asset-form] select,
.inventory-modal form[data-edit-asset-form] textarea {
  width: 100%;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid #cbd5d9;
  border-radius: 0.35rem;
  color: #172b3a;
  font: inherit;
}
[data-equipment-form] label:has([name="toolImage"]),
[data-edit-asset-form] label:has([name="toolImage"]) {
  display: none !important;
}
@media (max-width: 600px) {
  .asset-type-group > summary {
    align-items: flex-start;
    flex-direction: column;
  }
  .asset-type-group > summary small {
    text-align: left;
  }
}

.inventory-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1rem 0;
}
.inventory-message {
  display: none;
  margin: 0.5rem 0;
  padding: 0.65rem 0.8rem;
  border-left: 3px solid #267252;
  background: #eaf5ef;
  color: #175339;
  font-size: 0.82rem;
}
.inventory-message:not(:empty) {
  display: block;
}
.inventory-message.is-error {
  border-color: #a12e2a;
  background: #fdeeed;
  color: #8b2522;
}
.inventory-summary-card {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid #d7e0e2;
  border-radius: 0.35rem;
  background: #fff;
  color: #23353a;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  align-items: center;
}
.inventory-summary-card:hover,
.inventory-summary-card:focus-visible {
  border-color: #32836a;
  outline: 2px solid #b8ded0;
  outline-offset: 1px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.inventory-summary-card span {
  color: #63747a;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.inventory-summary-card strong {
  color: #176b54;
  font-size: 1.35rem;
  font-weight: 700;
}
.inventory-categories {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.15rem 0 0.7rem;
}
.inventory-categories {
  display: none;
}
.inventory-category-tab {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: none;
  min-height: 2.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #d7e0e2;
  border-radius: 0.3rem;
  background: #fff;
  color: #364a50;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
}
.inventory-category-tab span {
  color: #64777c;
  font-size: 0.7rem;
}
.inventory-category-tab.active {
  border-color: #176b54;
  background: #e7f3ee;
  color: #13563f;
  font-weight: 700;
}
.inventory-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  align-items: end;
  gap: 0.65rem;
}
.inventory-toolbar label {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
  color: #52616b;
  font-size: 0.72rem;
  font-weight: 700;
}
.inventory-toolbar input,
.inventory-toolbar select {
  width: 100%;
  min-width: 0;
  height: 2.55rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid #cbd5d9;
  border-radius: 0.35rem;
  background: #fff;
  color: #172b3a;
  font: inherit;
}
.inventory-toolbar .secondary {
  width: 100%;
  min-height: 2.55rem;
  white-space: normal;
}
.borrower-equipment .borrower-inventory-toolbar {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 1rem;
  border-radius: 0.5rem;
  background: #f8fafc;
  box-shadow: none;
}
.borrower-equipment .borrower-equipment-filters.borrower-inventory-filter-wrapper {
  display: block;
  margin: 0 0 1rem;
}
.borrower-inventory-filter-disclosure {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #f8fafc;
}
.borrower-inventory-filter-disclosure > summary {
  padding: 0.75rem 1rem;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
}
.borrower-inventory-filter-disclosure[open] > summary {
  border-bottom: 1px solid #e2e8f0;
}
.borrower-inventory-filter-disclosure .borrower-inventory-toolbar {
  border: 0;
  border-radius: 0;
}
.borrower-equipment .borrower-inventory-toolbar .inventory-search-label {
  grid-column: 1 / -1;
}
.borrower-equipment .borrower-inventory-toolbar > * {
  min-width: 0;
}
@media (max-width: 1000px) {
  .borrower-equipment .borrower-inventory-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 500px) {
  .borrower-equipment .borrower-inventory-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }
}
.inventory-page,
.inventory-page > .feature-inner,
.inventory-panel {
  min-width: 0;
}
.inventory-page,
.inventory-panel {
  width: 100%;
}
.admin-page .feature-heading .eyebrow {
  color: var(--blue-800);
}
.inventory-panel {
  padding: clamp(0.5rem, 1.4vw, 1rem);
}
.inventory-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow: visible;
}
.inventory-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
}
.inventory-table th:nth-child(1) {
  width: 22%;
}
.inventory-table th:nth-child(2) {
  width: 12%;
}
.inventory-table th:nth-child(3) {
  width: 6%;
}
.inventory-table th:nth-child(n + 4):nth-child(-n + 9) {
  width: 6%;
}
.inventory-table th:nth-child(10) {
  width: 8%;
}
.inventory-table th:nth-child(11) {
  width: 18%;
}
}
.inventory-table th {
  padding: 0.6rem 0.3rem;
  background: #edf3f1;
  color: #29413b;
  font-size: clamp(0.55rem, 0.7vw, 0.68rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.25;
  overflow-wrap: anywhere;
  border-bottom: 2px solid #c8d6d2;
}
.inventory-table .inventory-primary-group th {
  padding: 0.25rem 0;
  background: transparent;
}
.inventory-primary-group-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-height: 2.7rem;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: 0.25rem;
  background: #e8f1ed;
  color: #244b3e;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    filter 160ms ease;
}
.inventory-primary-group-toggle strong {
  color: inherit;
  font-weight: 700;
}
.inventory-primary-group[data-primary-category="ICT"] .inventory-primary-group-toggle {
  background: #eff6ff;
  color: #1d4ed8;
}
.inventory-primary-group[data-primary-category="AFA"] .inventory-primary-group-toggle {
  background: #f0fdf4;
  color: #15803d;
}
.inventory-primary-group[data-primary-category="IA"] .inventory-primary-group-toggle {
  background: #f1f5f9;
  color: #475569;
}
.inventory-primary-group[data-primary-category="HE"] .inventory-primary-group-toggle {
  background: #eff6ff;
  color: #1d4ed8;
}
.inventory-primary-group[data-primary-category="ICT"] .inventory-primary-group-toggle[aria-expanded="true"] {
  background: #1d4ed8;
  color: #fff;
}
.inventory-primary-group[data-primary-category="AFA"] .inventory-primary-group-toggle[aria-expanded="true"] {
  background: #15803d;
  color: #fff;
}
.inventory-primary-group[data-primary-category="IA"] .inventory-primary-group-toggle[aria-expanded="true"] {
  background: #475569;
  color: #fff;
}
.inventory-primary-group[data-primary-category="HE"] .inventory-primary-group-toggle[aria-expanded="true"] {
  background: #1d4ed8;
  color: #fff;
}
.inventory-primary-group-toggle[aria-expanded="true"] {
  color: #fff;
}
.inventory-primary-group-toggle[aria-expanded="true"] .inventory-primary-group-icon {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.inventory-primary-group-toggle[aria-expanded="true"] small {
  color: rgba(255, 255, 255, 0.9);
}
.inventory-primary-group-toggle:hover:not([aria-expanded="true"]) {
  filter: brightness(0.96);
}
.inventory-primary-group-toggle:hover[aria-expanded="true"],
.inventory-primary-group-toggle:focus-visible[aria-expanded="true"] {
  filter: brightness(1.04);
}
.inventory-primary-group-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -3px;
}
@media (prefers-reduced-motion: reduce) {
  .inventory-primary-group-toggle {
    transition: none;
  }
}
.inventory-primary-group-toggle:hover,
.inventory-primary-group-toggle:focus-visible {
  outline-offset: -3px;
}
.inventory-primary-group-icon {
  display: grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border: 1px solid #93b3a4;
  border-radius: 0.2rem;
  background: #fff;
  color: inherit;
  font-weight: 700;
}

.borrowers-page .feature-toolbar,
.borrowers-page .borrower-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.85rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.borrowers-page .borrower-toolbar-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  width: 100%;
}

.borrowers-page .borrower-toolbar label,
.borrowers-page .feature-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  margin: 0;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.borrowers-page .borrower-search-field {
  flex: 2 1 18rem;
  min-width: 0;
}

.borrowers-page .borrower-select-field {
  flex: 1 1 11rem;
  min-width: 0;
}

.borrowers-page .borrower-toolbar input,
.borrowers-page .borrower-toolbar select,
.borrowers-page .feature-toolbar input,
.borrowers-page .feature-toolbar select {
  width: 100%;
  height: 2.55rem;
  min-width: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.45rem;
  background-color: #fff;
  color: #1e293b;
  font-size: 0.82rem;
  line-height: 1.4;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.borrowers-page .borrower-toolbar input:focus,
.borrowers-page .borrower-toolbar select:focus,
.borrowers-page .feature-toolbar input:focus,
.borrowers-page .feature-toolbar select:focus {
  outline: none;
  border-color: #0d9488;
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.15);
}

.borrowers-page .borrower-filter-more {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.borrowers-page .borrower-filter-summary,
.borrowers-page .borrower-filter-more > summary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 2.15rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.45rem;
  background: #f8fafc;
  color: #334155;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.borrowers-page .borrower-filter-summary::-webkit-details-marker,
.borrowers-page .borrower-filter-more > summary::-webkit-details-marker {
  display: none;
}

.borrowers-page .borrower-filter-summary:hover,
.borrowers-page .borrower-filter-more > summary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.borrowers-page .borrower-filter-summary .summary-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.borrowers-page .borrower-filter-summary .summary-label svg,
.borrowers-page .borrower-filter-more > summary svg {
  width: 0.95rem;
  height: 0.95rem;
  color: #64748b;
  flex-shrink: 0;
}

.borrowers-page .borrower-filter-summary .summary-chevron {
  display: inline-flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.borrowers-page .borrower-filter-summary .summary-chevron svg {
  width: 0.75rem;
  height: 0.75rem;
}

.borrowers-page .borrower-filter-more[open] > .borrower-filter-summary,
.borrowers-page .borrower-filter-more[open] > summary {
  background: #e6f4f1;
  border-color: #0d9488;
  color: #0f766e;
}

.borrowers-page .borrower-filter-more[open] > .borrower-filter-summary .summary-label svg,
.borrowers-page .borrower-filter-more[open] > summary svg {
  color: #0d9488;
}

.borrowers-page .borrower-filter-more[open] > .borrower-filter-summary .summary-chevron {
  transform: rotate(90deg);
}

.borrowers-page .borrower-filter-fields {
  display: none;
}

.borrowers-page .borrower-filter-more[open] .borrower-filter-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.65rem;
  padding: 0.85rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #f8fafc;
}

@media (max-width: 1024px) {
  .borrowers-page .borrower-filter-more[open] .borrower-filter-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .borrowers-page .feature-toolbar > .borrower-toolbar-primary,
  .borrowers-page .feature-toolbar > .borrower-filter-more,
  .borrowers-page .feature-toolbar > .borrower-filter-actions {
    flex-basis: 100%;
  }
}

@media (max-width: 900px) {
  .borrowers-page .borrower-filter-actions {
    width: 100%;
    justify-content: flex-start;
  }
  .borrowers-page .borrower-filter-more {
    width: 100%;
  }
  .borrowers-page .borrower-toolbar-primary {
    flex-wrap: wrap;
  }
  .borrowers-page .borrower-select-field {
    flex: 1 1 14rem;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .borrowers-page .borrower-toolbar-primary {
    flex-direction: column;
    align-items: stretch;
  }
  .borrowers-page .borrower-search-field,
  .borrowers-page .borrower-select-field {
    flex: 1 1 100%;
    width: 100%;
  }
  .borrowers-page .borrower-filter-more[open] .borrower-filter-fields {
    grid-template-columns: 1fr;
    padding: 0.75rem;
    gap: 0.6rem;
  }
  .borrowers-page .borrower-filter-actions {
    width: 100%;
  }
  .borrowers-page .borrower-filter-actions button {
    flex: 1;
  }
  .borrowers-page .feature-toolbar {
    padding: 0.65rem;
    gap: 0.6rem;
  }
  .borrowers-page .borrower-toolbar-primary,
  .borrowers-page .borrower-filter-more,
  .borrowers-page .borrower-filter-actions {
    width: 100%;
  }
  .borrowers-page .feature-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .borrowers-page .feature-toolbar > * {
    width: 100%;
  }
}
.borrowers-page .borrower-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  width: 100%;
}
.borrowers-page .borrower-filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding-bottom: 0.15rem;
}
.borrowers-page .borrower-filter-actions button {
  white-space: nowrap;
}
.borrowers-page .table-wrap {
  overflow: auto;
}
.borrowers-page table {
  min-width: 0;
  table-layout: fixed;
}
.borrowers-page th {
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: normal;
  overflow-wrap: anywhere;
  background: #edf3f1;
  color: #29413b;
}
.borrowers-page td {
  vertical-align: top;
  overflow-wrap: anywhere;
}
.borrow-photo-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex-wrap: wrap;
}
.borrow-photo-cell > div {
  display: grid;
  justify-items: start;
  gap: 0.25rem;
}
.borrow-photo-thumb {
  width: 3rem;
  height: 3rem;
  object-fit: cover;
  border: 1px solid #cbd5d9;
  border-radius: 0.25rem;
  background: #f4f7f6;
}
.borrow-photo-cell small {
  max-width: 9rem;
  color: #64736f;
  font-size: 0.65rem;
}
.borrow-actions {
  min-width: 0;
}
.borrow-actions button {
  margin: 0 0.2rem 0.25rem 0;
}
.borrow-status-overdue {
  background: #fee2e2;
  color: #991b1b;
}
.borrow-status-returned {
  background: #dcfce7;
  color: #166534;
}
.borrow-status-borrowed {
  background: #fef3c7;
  color: #92400e;
}
.borrow-pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.6rem;
  margin: 0.75rem 0 1.5rem;
  color: #52616b;
  font-size: 0.85rem;
}
.borrow-detail-modal {
  width: min(100%, 68rem);
  max-height: 90vh;
  overflow: auto;
}
.request-review-modal {
  width: min(100%, 58rem);
  max-height: calc(100vh - 2rem);
  overflow: auto;
}
.request-review-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.6rem;
  margin: 1rem 0;
}
.request-review-summary > div {
  display: grid;
  gap: 0.25rem;
  padding: 0.65rem;
  border: 1px solid #dbe3e1;
  border-radius: 0.35rem;
}
.request-review-summary strong,
.request-review-facts dt {
  color: #52616b;
  font-size: 0.75rem;
}
.request-review-summary span,
.request-review-facts dd {
  overflow-wrap: anywhere;
}
.request-review-items {
  display: grid;
  gap: 0.75rem;
}
.request-review-item {
  display: grid;
  grid-template-columns: 6rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.85rem;
  border: 1px solid #dbe3e1;
  border-radius: 0.5rem;
}
.request-review-image {
  display: block;
  width: 6rem;
  height: 6rem;
  object-fit: contain;
  border: 1px solid #dbe3e1;
  border-radius: 0.35rem;
  background: #f4f7f6;
}
.request-review-image-empty {
  display: grid;
  place-items: center;
  color: #64716d;
  font-size: 0.72rem;
}
.request-review-item-content {
  min-width: 0;
}
.request-review-item-content h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
}
.request-review-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.5rem;
  margin: 0.65rem 0;
}
.request-review-facts > div {
  display: grid;
  gap: 0.2rem;
}
.request-review-facts dd {
  margin: 0;
}
.request-review-modal .request-review-decision,
.request-review-modal .request-review-rejection label,
.request-review-modal .request-review-remarks,
.request-review-modal .request-review-photo,
.request-review-modal .request-review-pickup {
  display: grid;
  gap: 0.35rem;
  margin: 0.7rem 0;
  color: #52616b;
  font-size: 0.78rem;
  font-weight: 600;
}
.request-review-modal select,
.request-review-modal textarea,
.request-review-modal input[type="file"] {
  width: 100%;
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid #cbd5d1;
  border-radius: 0.35rem;
  font: inherit;
}
.request-review-modal [hidden] {
  display: none;
}
.request-review-fixed-status {
  margin: 0.75rem 0;
  overflow-wrap: anywhere;
}
.borrow-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.5rem;
  margin: 1rem 0;
}
.borrow-detail-grid > div {
  display: grid;
  gap: 0.25rem;
  padding: 0.65rem;
  border: 1px solid #dbe3e1;
  border-radius: 0.3rem;
}
.borrow-detail-grid strong {
  color: #52616b;
  font-size: 0.75rem;
}
.borrow-detail-photos {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid #dbe3e1;
}
.borrow-detail-photo-item {
  margin: 0.75rem 0;
  padding: 0.75rem;
  border: 1px solid #dbe3e1;
  border-radius: 0.4rem;
}
.borrow-detail-photo-item > h4 {
  margin: 0 0 0.6rem;
}
.borrow-detail-photo-item .photo-compare h5 {
  margin: 0 0 0.4rem;
  color: #475569;
  font-size: 0.8rem;
}
.borrow-detail-photo-item .photo-gallery:empty {
  min-height: 3rem;
}
.borrow-transaction-timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.borrow-transaction-event {
  position: relative;
  display: grid;
  grid-template-columns: 0.75rem minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0 0 1rem;
}
.borrow-transaction-marker {
  position: relative;
  width: 0.55rem;
  height: 0.55rem;
  margin-top: 0.3rem;
  border: 2px solid #2f8067;
  border-radius: 50%;
  background: #fff;
}
.borrow-transaction-event:not(:last-child) .borrow-transaction-marker::after {
  position: absolute;
  top: 0.45rem;
  left: 0.12rem;
  width: 1px;
  height: calc(100% + 1rem);
  background: #d7e4de;
  content: "";
}
.borrow-transaction-copy {
  min-width: 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #edf0ef;
}
.borrow-transaction-event:last-child .borrow-transaction-copy {
  padding-bottom: 0;
  border-bottom: 0;
}
.borrow-transaction-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
}
.borrow-transaction-heading strong {
  color: #263c3b;
  font-size: 0.82rem;
}
.borrow-transaction-heading time,
.borrow-transaction-copy small {
  color: #64716d;
  font-size: 0.7rem;
}
.borrow-transaction-copy p {
  margin: 0.25rem 0;
  color: #465651;
  font-size: 0.76rem;
}
.borrow-transaction-empty {
  margin: 0;
  color: #64716d;
  font-size: 0.78rem;
}
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 0.65rem;
}
.photo-gallery figure {
  min-width: 0;
  margin: 0;
}
.photo-gallery img,
.borrow-photo-large {
  display: block;
  width: 100%;
  max-height: 22rem;
  object-fit: contain;
  background: #f4f7f6;
  border: 1px solid #dbe3e1;
}
.photo-gallery figcaption {
  overflow-wrap: anywhere;
  padding: 0.35rem 0;
  color: #52616b;
  font-size: 0.72rem;
}
.borrow-detail-modal form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #dbe3e1;
}
.borrow-detail-modal form h3,
.borrow-detail-modal form [data-inspection-message] {
  grid-column: 1/-1;
}
.borrow-detail-modal form label {
  display: grid;
  gap: 0.3rem;
}
@media (max-width: 700px) {
  .borrow-pagination {
    justify-content: center;
    flex-wrap: wrap;
  }
  .request-review-modal {
    width: 100%;
    padding: 1rem;
  }
  .request-review-item {
    grid-template-columns: 4.5rem minmax(0, 1fr);
    gap: 0.65rem;
    padding: 0.65rem;
  }
  .request-review-image {
    width: 4.5rem;
    height: 4.5rem;
  }
  .request-review-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.inventory-primary-group-toggle small {
  margin-left: auto;
  color: #5d7169;
  font-size: 0.72rem;
  font-weight: 500;
}
.inventory-primary-group-toggle[aria-expanded="true"] .inventory-primary-group-icon,
.inventory-primary-group-toggle[aria-expanded="true"] small,
.inventory-primary-group-toggle[aria-expanded="true"] strong {
  color: #fff;
}
.inventory-primary-subcategories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0 0.75rem 0.55rem 2.65rem;
}
.inventory-primary-subcategories span {
  padding: 0.18rem 0.4rem;
  border: 1px solid #d4e2dc;
  border-radius: 0.2rem;
  background: #fff;
  color: #566c63;
  font-size: 0.67rem;
  font-weight: 500;
}
.inventory-category-page-note {
  color: #64736e;
  font-size: 0.75rem;
}
.inventory-table td {
  min-width: 0;
  max-width: none;
  vertical-align: middle;
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}
.inventory-table tbody tr:nth-child(even) {
  background: #f7faf9;
}
.inventory-table tbody tr:hover {
  background: #eef5f1;
}
.inventory-table tbody tr.inventory-recently-added {
  outline: 2px solid #32836a;
  outline-offset: -2px;
  background: #e7f3ee;
}
.inventory-table tbody tr.inventory-recently-added td {
  background: #e7f3ee;
}
.inventory-table td {
  padding: 0.5rem 0.35rem;
  border-bottom: 1px solid #e1e8e6;
  line-height: 1.4;
}
.inventory-table td:nth-child(1),
.inventory-table .inventory-count-cell {
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.inventory-table td:nth-child(1) strong,
.inventory-tool-link {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.inventory-tool-link {
  padding: 0;
  border: 0;
  background: none;
  color: #176b54;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.inventory-tool-id-line {
  margin-top: 0.15rem;
}
.inventory-tool-id-line small {
  color: #62707a;
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.inventory-icon-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
  justify-content: center;
  width: 100%;
  overflow: hidden;
}
.icon-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #d4e2dc;
  border-radius: 6px;
  background: #fff;
  color: #3a5c50;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.icon-action-btn svg {
  width: 15px;
  height: 15px;
}
.icon-action-btn:hover:not(:disabled) {
  background: #e7f3ee;
  border-color: #32836a;
  color: #176b54;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.icon-action-btn:active:not(:disabled) {
  transform: translateY(0);
}
.icon-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.icon-action-btn.is-danger {
  color: #c0392b;
  border-color: #e74c3c;
}
.icon-action-btn.is-danger:hover:not(:disabled) {
  background: #fdf2f1;
  border-color: #c0392b;
  color: #c0392b;
}
.inventory-row-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  justify-content: center;
  width: 100%;
  overflow: hidden;
}
.inventory-row-actions button {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.inventory-row-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.inventory-category-cell {
  display: grid;
  justify-items: start;
  gap: 0.3rem;
  min-width: 0;
}
.inventory-category-cell small {
  color: #53636a;
  font-size: 0.67rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.inventory-primary-label,
.inventory-secondary-label {
  display: inline-block;
  max-width: 14rem;
  padding: 0.22rem 0.42rem;
  border-radius: 0.2rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.inventory-primary-label {
  background: #e8f1ed;
  color: #245d48;
  font-size: 0.68rem;
  font-weight: 700;
}
.inventory-secondary-label {
  color: #53636a;
  font-size: 0.74rem;
}
.inventory-actions-menu {
  position: relative;
}
.inventory-actions-menu > summary {
  min-height: 2rem;
  padding: 0.4rem 0.6rem;
  border: 1px solid #d4dddc;
  border-radius: 0.25rem;
  background: #fff;
  color: #34484d;
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 700;
  list-style: none;
}
.inventory-actions-menu > summary::-webkit-details-marker {
  display: none;
}
.inventory-actions-menu[open] > summary {
  border-color: #6b9685;
  background: #eef5f1;
}
.inventory-actions-list {
  position: absolute;
  top: calc(100% + 0.25rem);
  right: 0;
  z-index: 5;
  display: grid;
  min-width: 11rem;
  padding: 0.3rem;
  border: 1px solid #d4dddc;
  border-radius: 0.3rem;
  background: #fff;
  box-shadow: 0 0.4rem 1.2rem #1a302b22;
}
.inventory-actions-list button {
  padding: 0.5rem 0.6rem;
  border: 0;
  border-radius: 0.2rem;
  background: #fff;
  color: #34484d;
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  text-align: left;
}
.inventory-actions-list button:hover,
.inventory-actions-list button:focus-visible {
  outline: none;
  background: #eef5f1;
}
.inventory-actions-list button.is-danger {
  color: #a12e2a;
}
.inventory-actions-list button:disabled {
  color: #8a9496;
  cursor: not-allowed;
}
.inventory-expanded-row > td {
  padding: 0.8rem 1rem;
  background: #f2f7f4;
}
.inventory-expanded-content {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
}
.inventory-expanded-image {
  width: 100%;
  max-height: 10rem;
  object-fit: contain;
  border: 1px solid #dbe3e4;
  background: #fff;
}
.inventory-expanded-image-placeholder {
  display: grid;
  min-height: 8rem;
  place-items: center;
  padding: 0.75rem;
  border: 1px dashed #cbd6d6;
  color: #617077;
  font-size: 0.75rem;
  text-align: center;
}
.inventory-expanded-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem 1.2rem;
  margin: 0;
}
.inventory-expanded-facts div {
  min-width: 0;
}
.inventory-expanded-facts dt {
  margin-bottom: 0.15rem;
  color: #65757a;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
}
.inventory-expanded-facts dd {
  overflow-wrap: anywhere;
  margin: 0;
  color: #293d42;
  font-size: 0.78rem;
}
.inventory-status-badge {
  display: inline-block;
  max-width: 100%;
  padding: 0.25rem 0.45rem;
  border-radius: 0.25rem;
  background: #e7f4eb;
  color: #17633d;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: normal;
  overflow-wrap: anywhere;
}
.inventory-status-badge.status-borrowed {
  background: #e7f0ff;
  color: #2354a3;
}
.inventory-status-badge.status-reserved {
  background: #f1eaff;
  color: #6938a5;
}
.inventory-status-badge.status-under-maintenance {
  background: #fff0d9;
  color: #94540c;
}
.inventory-status-badge.status-damaged {
  background: #fde8e7;
  color: #a12e2a;
}
.inventory-status-badge.status-missing-lost {
  background: #4b2528;
  color: #fff;
}
.inventory-status-badge.status-retired {
  background: #e7e9e9;
  color: #505d60;
}
.inventory-empty {
  padding: 2rem !important;
  color: #617077;
  text-align: center;
}
.inventory-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  color: #52616b;
  font-size: 0.78rem;
}
.inventory-pagination div {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
@media (max-width: 900px) {
  .inventory-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .inventory-table,
  .inventory-table tbody {
    display: block;
    width: 100%;
  }
  .inventory-table thead {
    display: none;
  }
  .inventory-table tbody > tr.inventory-primary-group,
  .inventory-table tbody > tr.inventory-category-page-note {
    display: block;
    width: 100%;
  }
  .inventory-table tbody > tr.inventory-primary-group th,
  .inventory-table tbody > tr.inventory-category-page-note td {
    display: block;
    width: 100%;
  }
  .inventory-primary-group-toggle {
    flex-wrap: wrap;
  }
  .inventory-primary-group-toggle small {
    width: 100%;
    margin-left: 1.9rem;
  }
  .inventory-table tbody > tr.inventory-summary-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    margin: 0 0 0.7rem;
    overflow: visible;
    border: 1px solid #dbe4e1;
    border-radius: 0.35rem;
    background: #fff;
  }
  .inventory-table tbody > tr.inventory-summary-row > td {
    display: grid;
    grid-template-columns: minmax(4.8rem, 0.75fr) minmax(0, 1.25fr);
    align-items: center;
    gap: 0.4rem;
    width: auto;
    max-width: none;
    min-width: 0;
    padding: 0.55rem 0.5rem;
    border-bottom: 1px solid #edf1ef;
    text-align: left;
    overflow-wrap: anywhere;
  }
  .inventory-table tbody > tr.inventory-summary-row > td::before {
    content: attr(data-label);
    color: #61716c;
    font-size: 0.61rem;
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
    overflow-wrap: anywhere;
  }
  .inventory-table tbody > tr.inventory-summary-row > td:nth-child(2),
  .inventory-table tbody > tr.inventory-summary-row > td:nth-child(3),
  .inventory-table tbody > tr.inventory-summary-row > td:nth-child(10),
  .inventory-table tbody > tr.inventory-summary-row > td:nth-child(11) {
    grid-column: 1 / -1;
  }
  .inventory-table tbody > tr.inventory-summary-row > td:nth-child(2) {
    align-items: start;
  }
  .inventory-table .inventory-count-cell {
    font-size: 0.8rem;
    font-weight: 700;
    text-align: left;
  }
  .inventory-table .inventory-row-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.4rem;
  }
  .inventory-table .inventory-row-actions::before {
    flex-basis: 100%;
  }
  .inventory-table .inventory-row-actions > button,
  .inventory-table .inventory-row-actions > details {
    max-width: 100%;
  }
  .inventory-table tbody > tr.inventory-expanded-row:not([hidden]) {
    display: block;
    width: 100%;
    margin: -0.7rem 0 0.7rem;
    border: 1px solid #dbe4e1;
    border-top: 0;
    border-radius: 0 0 0.35rem 0.35rem;
  }
  .inventory-table tbody > tr.inventory-expanded-row > td {
    display: block;
    width: 100%;
    padding: 0.7rem;
  }
  .inventory-expanded-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }
  .inventory-expanded-content {
    grid-template-columns: minmax(6rem, 9rem) minmax(0, 1fr);
  }
  .inventory-pagination {
    justify-content: center;
    text-align: center;
  }
}
@media (max-width: 520px) {
  .inventory-summary {
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
  }
  .inventory-summary-card {
    padding: 0.65rem;
  }
  .inventory-summary-card strong {
    font-size: 1.1rem;
  }
  .inventory-table tbody > tr.inventory-summary-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .inventory-table tbody > tr.inventory-summary-row > td:nth-child(2),
  .inventory-table tbody > tr.inventory-summary-row > td:nth-child(3),
  .inventory-table tbody > tr.inventory-summary-row > td:nth-child(10),
  .inventory-table tbody > tr.inventory-summary-row > td:nth-child(11) {
    grid-column: auto;
  }
  .inventory-expanded-facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .inventory-expanded-content {
    grid-template-columns: minmax(0, 1fr);
  }
  .inventory-pagination div {
    justify-content: center;
  }
}
.inventory-modal-open {
  overflow: hidden;
}
.inventory-detail-modal {
  width: min(64rem, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 0;
  border-radius: 0.4rem;
  background: #fff;
  box-shadow: 0 1.5rem 4rem #15201f55;
}
.inventory-detail-modal > header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.4rem;
  border-bottom: 1px solid #dbe3e4;
  background: #fff;
}
.inventory-detail-modal > header h2 {
  margin: 0;
  color: #203b3a;
  font-size: 1.12rem;
}
.inventory-detail-body {
  display: grid;
  gap: 1.1rem;
  padding: 1.4rem;
}
.inventory-detail-body h3 {
  margin: 0.25rem 0 -0.55rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e7e7;
  color: #203b3a;
  font-size: 0.9rem;
}
.inventory-detail-body .table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e0e7e7;
  border-radius: 0.3rem;
}
.inventory-detail-body table {
  min-width: 42rem;
}
.inventory-detail-body th {
  background: #f3f7f5;
  color: #52616b;
  font-size: 0.68rem;
  text-transform: uppercase;
}
.inventory-detail-body td {
  font-size: 0.76rem;
}
.inventory-detail-body td[colspan] {
  padding: 1.15rem;
  color: #617077;
  text-align: center;
}
.inventory-detail-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 1rem;
  margin: 0;
}
.inventory-detail-facts div {
  min-width: 0;
  padding: 0.75rem 0.25rem;
  border-bottom: 1px solid #edf0ef;
}
.inventory-detail-facts div:nth-child(n + 5):nth-child(-n + 8),
.inventory-detail-facts div:nth-child(n + 9) {
  border-top: 1px solid #dbe3e4;
}
.inventory-detail-facts dt {
  color: #617077;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
}
.inventory-detail-facts dd {
  overflow-wrap: anywhere;
  margin: 0.25rem 0 0;
  color: #263c3b;
  font-size: 0.82rem;
  font-weight: 600;
}
.inventory-edit-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  padding: 1.25rem;
}
.inventory-edit-form label {
  display: grid;
  gap: 0.35rem;
  color: #52616b;
  font-size: 0.75rem;
  font-weight: 700;
}
.inventory-edit-form input,
.inventory-edit-form select,
.inventory-edit-form textarea {
  width: 100%;
  min-width: 0;
  padding: 0.65rem;
  border: 1px solid #cbd5d9;
  border-radius: 0.3rem;
  color: #172b3a;
  font: inherit;
}
.inventory-edit-form textarea {
  min-height: 6rem;
  resize: vertical;
}
.inventory-print-form {
  grid-template-columns: 1fr;
}
.inventory-import-modal {
  width: min(100%, 58rem);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 1.25rem;
}
.inventory-import-content {
  min-width: 0;
}
.inventory-import-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #dbe3e1;
}
.inventory-import-tabs button {
  width: auto;
  min-width: 9rem;
}
.inventory-import-tabs button[aria-selected="true"] {
  background: #1e2d4a;
}
[data-import-panel][hidden] {
  display: none !important;
}
.inventory-import-instructions,
.inventory-import-result-message {
  margin: 0 0 0.75rem;
  color: #52616b;
  font-size: 0.82rem;
  line-height: 1.5;
}
.inventory-import-template-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
}
.inventory-import-template {
  display: inline-block;
  text-decoration: none;
}
.inventory-import-content form > label {
  display: block;
  margin: 0.75rem 0;
}
.inventory-import-content .modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}
.inventory-import-content .modal-actions button {
  width: auto;
}
.inventory-import-message {
  min-height: 1.2rem;
  margin: 0.5rem 0;
  color: #52616b;
  font-size: 0.8rem;
}
.inventory-import-preview,
.inventory-import-results {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #dbe3e4;
}
.inventory-import-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  align-items: baseline;
  margin-bottom: 0.6rem;
  color: #52616b;
  font-size: 0.75rem;
}
.inventory-import-summary strong {
  color: #203b3a;
}
.inventory-import-row-list {
  display: grid;
  gap: 0.45rem;
  max-height: min(42vh, 24rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.inventory-import-row {
  min-width: 0;
  padding: 0.6rem 0.7rem;
  border: 1px solid #dbe3e4;
  border-left: 3px solid #16834a;
  border-radius: 0.3rem;
  background: #f3faf5;
}
.inventory-import-row.is-invalid {
  border-left-color: #b42318;
  background: #fff6f5;
}
.inventory-import-row-heading {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  justify-content: space-between;
  color: #203b3a;
  font-size: 0.8rem;
}
.inventory-import-row-state {
  color: #17633d;
  font-size: 0.7rem;
  font-weight: 700;
}
.inventory-import-row.is-invalid .inventory-import-row-state {
  color: #a12e2a;
}
.inventory-import-row > p {
  margin: 0.3rem 0 0;
  color: #52616b;
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}
.inventory-import-row > .inventory-import-row-valid {
  color: #17633d;
}
.inventory-import-errors {
  margin: 0.3rem 0 0;
  padding-left: 1.1rem;
  color: #a12e2a;
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}
.inventory-import-valid-only {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}
.inventory-import-valid-only input {
  display: inline-block !important;
  flex: 0 0 auto;
  width: 1rem !important;
  min-width: 1rem !important;
  height: 1rem;
  margin: 0 !important;
  padding: 0 !important;
}
.inventory-import-valid-only label {
  margin: 0;
}
.inventory-print-filter-note {
  margin: 0;
  color: #617077;
  font-size: 0.78rem;
}
.inventory-edit-form label:nth-child(5),
.inventory-edit-form footer,
.inventory-action-error {
  grid-column: 1/-1;
}
.inventory-edit-form footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.inventory-action-error {
  margin: 0;
  color: #a12e2a;
}
@media (max-width: 1000px) {
  .inventory-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .inventory-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .inventory-search-label {
    grid-column: span 2;
  }
}
@media (max-width: 760px) {
  .inventory-detail-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .inventory-detail-facts div:nth-child(n + 5):nth-child(-n + 8),
  .inventory-detail-facts div:nth-child(n + 9) {
    border-top: 0;
  }
  .inventory-detail-facts div:nth-child(5),
  .inventory-detail-facts div:nth-child(9) {
    border-top: 1px solid #dbe3e4;
  }
}
@media (max-width: 620px) {
  .inventory-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .inventory-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .inventory-search-label {
    grid-column: 1/-1;
  }
  .inventory-edit-form,
  .inventory-detail-facts,
  .inventory-expanded-facts {
    grid-template-columns: 1fr;
  }
  .inventory-detail-modal {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
  }
  .inventory-detail-modal > header,
  .inventory-detail-body {
    padding: 1rem;
  }
  .inventory-detail-facts div:nth-child(n + 5) {
    border-top: 0;
  }
  .inventory-detail-facts div:nth-child(5) {
    border-top: 1px solid #dbe3e4;
  }
  .inventory-edit-form label:nth-child(5),
  .inventory-edit-form footer,
  .inventory-action-error {
    grid-column: auto;
  }
  .inventory-pagination {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .app-navbar {
    padding: 0.75rem 1rem;
    padding-top: max(0.75rem, env(safe-area-inset-top));
  }
  .app-navbar-inner {
    gap: 0.5rem;
  }
  .app-brand-group {
    gap: 0.6rem;
  }
  .app-brand span {
    font-size: 1.2rem;
    overflow-wrap: anywhere;
  }
  .app-brand small {
    font-size: 0.72rem;
    line-height: 1.35;
  }
  .brand-logo-left {
    width: 3.5rem !important;
    height: 3.5rem !important;
    min-width: 3.5rem;
    min-height: 3.5rem;
  }
  .brand-logo-right {
    width: 2.75rem !important;
    height: 2.75rem !important;
    min-width: 2.75rem;
    min-height: 2.75rem;
  }
  .app-brand-right,
  .app-navbar-actions {
    gap: 0.4rem;
  }
  .feature-inner,
  .content {
    width: auto;
    min-width: 0;
  }
  /* Keep a sliver of the blue backdrop showing on small tablets too. */
  .admin-shell > .content,
  .admin-page > .feature-inner {
    width: calc(100% - 1.5rem);
    min-width: 0;
  }
  .feature-inner {
    padding: 1.25rem 0.75rem 2.5rem;
  }
  .feature-heading h1 {
    font-size: 1.65rem;
    overflow-wrap: anywhere;
  }
  .feature-toolbar {
    min-width: 0;
    padding: 0.75rem;
  }
  .feature-toolbar .search {
    flex: 1 1 14rem;
    min-width: 0;
    max-width: 100%;
  }
  .feature-toolbar > label,
  .feature-toolbar > input,
  .feature-toolbar > select,
  .feature-toolbar > button {
    min-width: 0;
    max-width: 100%;
  }
  .feature-toolbar > label {
    flex: 1 1 10rem;
  }
  .borrowers-page .feature-toolbar > .borrower-toolbar-primary,
  .borrowers-page .feature-toolbar > .borrower-filter-more,
  .borrowers-page .feature-toolbar > .borrower-filter-actions {
    min-width: 0;
    max-width: 100%;
    flex: 1 1 100%;
  }
  .feature-actions > button,
  .feature-actions > a,
  .admin-nav a,
  .admin-nav button,
  .form-actions > button {
    min-height: 2.75rem;
  }
  .global-admin-nav {
    margin-right: 0.75rem;
    margin-left: 0.75rem;
  }
  .borrowers-page .table-wrap,
  .maintenance-history-page .table-wrap {
    overflow: visible;
  }
  .borrowers-page .table-wrap table,
  .maintenance-history-page .table-wrap table {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .borrowers-page .table-wrap thead,
  .maintenance-history-page .table-wrap thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .borrowers-page .table-wrap tbody,
  .maintenance-history-page .table-wrap tbody {
    display: grid;
    gap: 0.65rem;
    width: 100%;
  }
  .borrowers-page .table-wrap tbody tr,
  .maintenance-history-page .table-wrap tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 0.75rem;
    width: 100%;
    min-width: 0;
    padding: 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.45rem;
    background: #fff;
  }
  .borrowers-page .table-wrap tbody td,
  .maintenance-history-page .table-wrap tbody td {
    display: grid;
    grid-template-columns: minmax(5.25rem, 0.8fr) minmax(0, 1.2fr);
    align-items: start;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.35rem 0;
    border: 0;
    overflow-wrap: anywhere;
  }
  .borrowers-page .table-wrap tbody td::before,
  .maintenance-history-page .table-wrap tbody td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 700;
  }
  .borrowers-page .table-wrap tbody td[colspan],
  .maintenance-history-page .table-wrap tbody td[colspan],
  .borrowers-page .table-wrap tbody td[data-label="Actions"],
  .maintenance-history-page .table-wrap tbody td[data-label="Action"] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .app-navbar {
    padding-right: 0.65rem;
    padding-left: 0.65rem;
  }
  .app-brand-group {
    gap: 0.4rem;
  }
  .app-brand span {
    font-size: 1.05rem;
  }
  .brand-logo-left {
    width: 2.6rem !important;
    height: 2.6rem !important;
    min-width: 2.6rem;
    min-height: 2.6rem;
  }
  .brand-logo-right {
    width: 2.2rem !important;
    height: 2.2rem !important;
    min-width: 2.2rem;
    min-height: 2.2rem;
  }
  .global-admin-nav a,
  .global-admin-nav button {
    min-height: 2.75rem;
  }
  .borrowers-page .table-wrap tbody tr,
  .maintenance-history-page .table-wrap tbody tr {
    grid-template-columns: minmax(0, 1fr);
  }
  .borrowers-page .table-wrap tbody td,
  .maintenance-history-page .table-wrap tbody td {
    grid-template-columns: minmax(5.5rem, 0.65fr) minmax(0, 1.35fr);
  }
}

img,
video,
canvas {
  max-width: 100%;
}

@supports (min-height: 100svh) {
  body,
  .min-h-screen,
  .page-gradient,
  .auth-page {
    min-height: 100svh;
  }
}

@media (max-width: 760px) {
  button {
    min-height: 2.75rem;
  }
  input,
  select,
  textarea {
    min-width: 0;
    max-width: 100%;
    font-size: max(1rem, 16px);
  }
  .inventory-modal-backdrop {
    padding: max(0.5rem, env(safe-area-inset-top)) 0.5rem
      max(0.5rem, env(safe-area-inset-bottom));
  }
}

@media (max-width: 1200px) {
  .admin-page .table-wrap,
  .admin-page .donation-table-wrap,
  .content[data-view] .table-wrap {
    overflow: visible;
  }
  .admin-page .donation-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
  }
  .admin-page .table-wrap table.responsive-data-table,
  .admin-page .donation-table-wrap table.responsive-data-table,
  .content[data-view] .table-wrap table.responsive-data-table {
    display: block;
    width: 100%;
    min-width: 0;
  }
  .admin-page .donation-table-wrap table.responsive-data-table td {
    min-width: 0;
  }
  .responsive-data-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .responsive-data-table tbody {
    display: grid;
    gap: 0.65rem;
    width: 100%;
  }
  .responsive-data-table tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 0.75rem;
    width: 100%;
    min-width: 0;
    padding: 0.65rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.45rem;
    background: #fff;
  }
  .responsive-data-table tbody td {
    display: grid;
    grid-template-columns: minmax(5.25rem, 0.8fr) minmax(0, 1.2fr);
    align-items: start;
    gap: 0.35rem;
    min-width: 0;
    padding: 0.35rem 0;
    border: 0;
    overflow-wrap: anywhere;
  }
  .responsive-data-table tbody td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 700;
  }
  .responsive-data-table tbody td[colspan],
  .responsive-data-table tbody td[data-label="Actions"],
  .responsive-data-table tbody td[data-label="Action"] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .responsive-data-table tbody tr {
    grid-template-columns: minmax(0, 1fr);
  }
  .responsive-data-table tbody td {
    grid-template-columns: minmax(5.5rem, 0.65fr) minmax(0, 1.35fr);
  }
}

.borrowers-page > .feature-inner {
  width: auto;
  max-width: none;
  margin: 0.75rem 1rem 1rem;
  padding: 1rem 1rem 1.25rem;
  border-radius: 0.65rem;
}
.borrowers-page .feature-heading {
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.borrowers-page .feature-heading h1 {
  font-size: 1.55rem;
}
.borrowers-page .feature-heading p {
  margin-top: 0.2rem;
  font-size: 0.8rem;
}
.borrowers-page .feature-actions {
  gap: 0.35rem;
}
.borrowers-page .feature-actions button {
  padding: 0.5rem 0.7rem;
  font-size: 0.76rem;
}

.borrowers-page .panel.table-wrap {
  margin-bottom: 0.5rem;
  padding: 0.45rem;
  border-radius: 0.45rem;
}
.borrowers-page table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}
.borrowers-page th,
.borrowers-page td {
  padding: 0.42rem 0.38rem;
  font-size: 0.74rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.borrowers-page th {
  font-size: 0.68rem;
}
.borrowers-page tbody tr:hover {
  background: #f8fafc;
}
.borrower-records-table col:nth-child(1) {
  width: 28%;
}
.borrower-records-table col:nth-child(2) {
  width: 20%;
}
.borrower-records-table col:nth-child(3) {
  width: 60px;
}
.borrower-records-table col:nth-child(4) {
  width: 20%;
}
.borrower-records-table col:nth-child(5) {
  width: 12%;
}
.borrower-records-table col:nth-child(6) {
  width: 12%;
}
.borrower-records-table td.text-center,
.borrower-records-table th.text-center {
  text-align: center;
}
.borrower-records-table th:nth-child(3),
.borrower-records-table th:nth-child(5),
.borrower-records-table th:nth-child(6) {
  text-align: center;
}
.borrower-records-table td {
  vertical-align: middle;
  padding: 0.65rem 0.65rem;
  font-size: 0.8rem;
  line-height: 1.4;
  white-space: nowrap;
}
.borrower-records-table td[data-label="Borrower"],
.borrower-records-table td[data-label="Names"],
.borrower-records-table td[data-label="Schedule"] {
  white-space: normal;
}
.borrower-records-table td[data-label="Actions"] .admin-icon-actions {
  justify-content: center;
  flex-wrap: wrap;
}

/* Borrowed Tools column - keep tool names inside the column and wrap them */
.borrower-records-table td[data-label="Borrowed Tools"] {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.borrower-records-table .borrowed-tools-cell {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}
.borrower-records-table .borrowed-tool-item {
  min-width: 0;
}
.borrower-records-table .borrowed-tool-item .equipment-name {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

/* Borrower Information Cell */
.borrower-info-cell {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  text-align: left;
}
.borrower-name-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.borrower-name-row strong {
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 600;
}
.borrower-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: #64748b;
  flex-wrap: wrap;
}
.borrower-email {
  font-size: 0.72rem;
  color: #64748b;
  word-break: break-all;
  display: inline-block;
  margin-top: 0.05rem;
  text-decoration: none;
}
a.borrower-email:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* Equipment Cell */
.equipment-info-cell {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  text-align: left;
}
.equipment-info-cell .equipment-name {
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 600;
}
.equipment-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.tool-id-tag {
  display: inline-block;
  font-family: monospace;
  font-size: 0.7rem;
  background: #f1f5f9;
  color: #334155;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}
.condition-tag {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-weight: 500;
}
.condition-tag.condition-good {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}
.condition-tag.condition-bad {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Grouped borrowed tools cell */
.borrowed-tools-cell {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-align: left;
}
.borrowed-tool-item {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.8rem;
  line-height: 1.35;
  flex-wrap: wrap;
}
.borrowed-tool-item .equipment-name {
  color: #0f172a;
  font-weight: 600;
}
.borrowed-totals {
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.1rem;
}
.borrowed-totals strong {
  color: #0f172a;
}
.borrowed-units {
  color: #64748b;
}
.text-muted {
  color: #64748b;
  font-size: 0.72rem;
}

/* Schedule Cell */
.schedule-info-cell {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.74rem;
  text-align: left;
}
.schedule-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  color: #334155;
}
.schedule-label {
  font-weight: 600;
  color: #64748b;
  font-size: 0.68rem;
  text-transform: uppercase;
  min-width: 26px;
}

/* Photos Column */
.borrow-photos-compact {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: center;
}
.photo-thumb-btn {
  position: relative;
  display: inline-flex;
  padding: 0;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.photo-thumb-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  border-color: #94a3b8;
}
.photo-thumb-btn .borrow-photo-thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  display: block;
}
.photo-thumb-btn .photo-phase-label {
  position: absolute;
  bottom: 0;
  right: 0;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 0.55rem;
  font-weight: 600;
  padding: 1px 3px;
  border-top-left-radius: 3px;
  line-height: 1;
}
.photo-empty-dash {
  font-size: 0.7rem;
  color: #94a3b8;
  font-family: monospace;
}

/* Icon Action Buttons */
.admin-icon-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  justify-content: flex-start;
  flex-wrap: wrap;
}
.icon-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  position: relative;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.icon-action-btn svg {
  width: 20px;
  height: 20px;
}
.icon-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.icon-action-btn.icon-view:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}
.icon-action-btn.icon-inspect:hover {
  background: #f0fdf4;
  color: #166534;
  border-color: #86efac;
}
.icon-action-btn.icon-approve {
  color: #15803d;
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.icon-action-btn.icon-approve:hover {
  background: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}
.icon-action-btn.icon-reject {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fecaca;
}
.icon-action-btn.icon-reject:hover {
  background: #dc2626;
  color: #ffffff;
  border-color: #dc2626;
}
.icon-action-btn.icon-borrow {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.icon-action-btn.icon-borrow:hover {
  background: #059669;
  color: #ffffff;
  border-color: #059669;
}
.icon-action-btn.icon-return {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}
.icon-action-btn.icon-return:hover {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}
.icon-action-btn.icon-ban {
  color: #64748b;
}
.icon-action-btn.icon-ban:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fca5a5;
}
.icon-action-btn.icon-ban.is-banned {
  color: #dc2626;
  background: #fef2f2;
  border-color: #f87171;
}
.icon-action-btn.icon-upload {
  width: 28px;
  height: 28px;
  min-width: 28px;
  color: #2563eb;
  background: #eff6ff;
  border-color: #bfdbfe;
}
.icon-action-btn.icon-upload .upload-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  font-size: 0.52rem;
  background: #2563eb;
  color: #ffffff;
  border-radius: 50%;
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  line-height: 1;
}
.borrower-summary-cell {
  display: grid;
  gap: 0.18rem;
  min-width: 0;
}
.borrower-summary-cell strong {
  color: #1f2937;
}
.borrower-summary-cell small,
.borrower-status-meta {
  display: block;
  margin-top: 0.18rem;
  color: #64748b;
  font-size: 0.66rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.borrower-status-meta {
  margin-top: 0.35rem;
}
.borrowers-page .borrow-actions button {
  margin: 0;
  padding: 0.34rem 0.42rem;
  font-size: 0.66rem;
  line-height: 1.2;
}
.borrowers-page .borrow-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.25rem;
}
.borrowers-page .borrower-section-heading {
  align-items: center;
  margin-bottom: 0.55rem;
}
.borrowers-page .borrower-section-heading h2 {
  margin: 0;
  font-size: 1rem;
}
.borrowers-page .borrower-section-heading p:not(.eyebrow) {
  margin: 0.2rem 0 0;
  font-size: 0.76rem;
}
.borrowers-page .borrow-pagination {
  margin: 0.25rem 0 0.6rem;
  gap: 0.4rem;
  font-size: 0.76rem;
}
.borrowers-page .borrow-pagination button {
  padding: 0.4rem 0.6rem;
  font-size: 0.72rem;
}

@media (max-width: 1200px) {
  .borrowers-page > .feature-inner {
    margin: 0.5rem 0.75rem 0.75rem;
    padding: 0.8rem;
  }
  .borrowers-page .borrower-records-table col {
    width: auto;
  }
}

@media (max-width: 760px) {
  .borrowers-page .feature-heading {
    align-items: flex-start;
    flex-direction: column;
  }
  .borrowers-page .feature-actions {
    width: 100%;
  }
  .borrowers-page .feature-actions button {
    flex: 1 1 auto;
  }
  .borrowers-page .borrow-actions button {
    min-height: 2.75rem;
  }
}

@media (max-width: 440px) {
  .borrowers-page > .feature-inner {
    margin: 0.35rem;
    padding: 0.6rem;
  }
}

.borrower-cart-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
  color: #2563eb;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid #bfdbfe;
  padding: 0.35rem 0.7rem;
  border-radius: 0.5rem;
  background: #eff6ff;
}
.borrower-cart-link:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}
.borrower-cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  background: #dc2626;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  margin-right: 0.25rem;
}

.borrower-cart-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.82rem;
}
.borrower-cart-table th,
.borrower-cart-table td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: middle;
}
.borrower-cart-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.borrower-cart-table tbody tr:last-child td {
  border-bottom: 0;
}
.borrower-cart-table tbody tr:hover {
  background: #f8fafc;
}
.borrower-cart-table input[type="number"] {
  width: 70px;
  padding: 0.25rem 0.4rem;
  font-size: 0.82rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
}
.borrower-cart-item-info strong {
  display: block;
  color: #0f172a;
}
.borrower-cart-item-info small {
  color: #64748b;
  font-size: 0.75rem;
}
.borrower-cart-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.borrower-cart-summary strong {
  color: #0f172a;
}
.borrower-cart-total-badge {
  color: #475569;
  font-size: 0.9rem;
}
.borrower-cart-total-badge strong {
  color: #0f172a;
}

.borrower-checkout-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1.25rem;
  align-items: start;
}
.borrower-checkout-form-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.borrower-checkout-summary-wrap {
  position: sticky;
  top: 1rem;
}
.borrower-checkout-summary {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.6rem;
  padding: 1rem;
}
.borrower-checkout-items {
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 0.75rem;
  background: #f8fafc;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.borrower-checkout-item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.5rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
}
.borrower-checkout-item-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f1f5f9;
}
.borrower-checkout-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.borrower-checkout-item-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #64748b;
  font-size: 1rem;
}
.borrower-checkout-item-info {
  flex: 1;
  min-width: 0;
}
.borrower-checkout-item-info > div:first-child {
  font-weight: 700;
  color: #0f172a;
}
.borrower-checkout-item-info .muted {
  font-size: 0.78rem;
  color: #64748b;
}
.borrower-checkout-total {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
  font-size: 0.9rem;
  color: #475569;
  text-align: right;
}
.borrower-checkout-total strong {
  color: #0f172a;
}
.borrower-safety {
  margin-top: 0.25rem;
}
.field-note {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.2rem;
}

.borrower-requests-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.82rem;
}
.borrower-requests-table th,
.borrower-requests-table td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: middle;
}
.borrower-requests-table th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.borrower-requests-table tbody tr:hover {
  background: #f8fafc;
}

.borrower-confirmation-notice {
  margin-bottom: 1rem;
}
.borrower-confirmation-msg {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 0.6rem;
  padding: 1rem;
  color: #065f46;
}
.borrower-confirmation-msg strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.borrower-cart-section .borrower-tool-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}
.borrower-cart-section .borrower-tool-card-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
}
.borrower-cart-select-all {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  user-select: none;
}
.borrower-cart-select-all input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
  accent-color: #0f766e;
}
.borrower-cart-section .borrower-cart-card-check {
  width: 1.25rem;
  height: 1.25rem;
  cursor: pointer;
  accent-color: #0f766e;
}
@media (max-width: 640px) {
  .borrower-cart-section .borrower-tool-cards-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .borrower-cart-section .borrower-tool-card-image-wrap {
    height: 140px;
  }
  .borrower-cart-section .borrower-tool-card-body {
    padding: 0.85rem;
  }
}

.borrower-confirm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
  backdrop-filter: blur(2px);
}
.borrower-confirm-modal {
  background: #fff;
  border-radius: 0.85rem;
  padding: 1.5rem;
  max-width: 28rem;
  width: 100%;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
}
.borrower-confirm-modal h2 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  color: #0f172a;
}
.borrower-confirm-modal > p {
  color: #64748b;
  font-size: 0.85rem;
  margin: 0 0 1rem;
}
.borrower-confirm-details {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.6rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.borrower-confirm-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
}
.borrower-confirm-summary-row .confirm-label {
  color: #64748b;
  flex-shrink: 0;
}
.borrower-confirm-summary-row .confirm-label strong {
  color: #64748b;
  font-weight: 600;
}
.borrower-confirm-agreement {
  margin-bottom: 1rem;
}
.borrower-confirm-agreement .modal-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.82rem;
  color: #475569;
}
.borrower-confirm-agreement .modal-check input {
  margin-top: 0.15rem;
}

@media (max-width: 760px) {
  .borrower-checkout-grid {
    grid-template-columns: 1fr;
  }
  .borrower-checkout-form-wrap {
    order: 1;
  }
  .borrower-checkout-summary-wrap {
    order: 2;
    position: static;
  }
  .borrower-checkout-summary {
    position: static;
  }
  .borrower-checkout-items {
    max-height: 400px;
  }
  .borrower-checkout-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .borrower-checkout-item-thumb {
    width: 40px;
    height: 40px;
  }
  .borrower-checkout-item-info {
    width: 100%;
  }
  .borrower-confirm-modal {
    max-width: 100%;
    padding: 1.25rem 1rem;
    margin: 0.5rem;
  }
  .borrower-confirm-modal h2 {
    font-size: 1.1rem;
  }
}

.borrower-reservation-timer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #fcd34d;
  border-radius: 0.6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.borrower-reservation-timer.is-warning {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
  border-color: #fb923c;
}
.borrower-reservation-timer.is-warning .reservation-timer-icon {
  color: #c2410c;
}
.borrower-reservation-timer.is-warning .reservation-timer-label,
.borrower-reservation-timer.is-warning .reservation-timer-note {
  color: #9a3412;
}
.borrower-reservation-timer.is-warning .reservation-timer-countdown {
  color: #9a3412;
}
.borrower-reservation-timer.is-warning .reservation-timer-progress {
  background: #f97316;
}
.borrower-reservation-timer.is-critical {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border-color: #f87171;
}
.reservation-timer-icon {
  flex-shrink: 0;
  color: #b45309;
}
.borrower-reservation-timer.is-critical .reservation-timer-icon {
  color: #dc2626;
}
.reservation-timer-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
}
.reservation-timer-label {
  font-size: 0.72rem;
  color: #92400e;
  font-weight: 600;
}
.borrower-reservation-timer.is-critical .reservation-timer-label {
  color: #991b1b;
}
.reservation-timer-countdown {
  font-size: 1.3rem;
  font-weight: 800;
  color: #78350f;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.borrower-reservation-timer.is-critical .reservation-timer-countdown {
  color: #991b1b;
}
/* A reservation whose deadline ran out: the countdown stops and the tool
   is released to the next student of the queue. */
.reservation-timer-countdown.is-expired {
  color: #991b1b;
  text-decoration: line-through;
}
/* The picker of the pickup schedule of a reservation. */
.pickup-schedule-modal form {
  display: grid;
  gap: 0.25rem;
}
.pickup-schedule-modal .modal-actions {
  margin-top: 1rem;
}
.reservation-timer-bar {
  flex: 1;
  min-width: 8rem;
  height: 6px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  overflow: hidden;
}
.reservation-timer-progress {
  height: 100%;
  background: #f59e0b;
  border-radius: 999px;
  transition: width 0.5s linear, background 0.3s ease;
}
.borrower-reservation-timer.is-critical .reservation-timer-progress {
  background: #ef4444;
}
.reservation-timer-note {
  flex-basis: 100%;
  font-size: 0.7rem;
  color: #92400e;
  margin: 0.35rem 0 0;
  font-weight: 500;
}
.borrower-reservation-timer.is-critical .reservation-timer-note {
  color: #991b1b;
}
@media (max-width: 480px) {
  .borrower-reservation-timer {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .reservation-timer-bar {
    width: 100%;
  }
}

/* -------------------------------------------------------------------------
 * Per tool reservation countdown
 * ------------------------------------------------------------------------- */
.borrower-item-reservation {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.45rem;
  padding: 0.4rem 0.6rem;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 0.5rem;
  transition: background 0.3s ease, border-color 0.3s ease;
}
.borrower-item-reservation .reservation-timer-countdown {
  font-size: 1.05rem;
  font-weight: 800;
  color: #b45309;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
}
.borrower-item-reservation .reservation-timer-hint {
  flex: 1 1 8rem;
  min-width: 0;
  font-size: 0.7rem;
  line-height: 1.35;
  color: #92400e;
  font-weight: 500;
}
.borrower-item-reservation.is-warning {
  background: #fff7ed;
  border-color: #fb923c;
}
.borrower-item-reservation.is-warning .reservation-timer-countdown {
  color: #c2410c;
}
.borrower-item-reservation.is-warning .reservation-timer-hint {
  color: #9a3412;
}
.borrower-item-reservation.is-critical {
  background: #fef2f2;
  border-color: #f87171;
  animation: reservationPulse 1.5s ease-in-out infinite;
}
.borrower-item-reservation.is-critical .reservation-timer-countdown {
  color: #b91c1c;
}
.borrower-item-reservation.is-critical .reservation-timer-hint {
  color: #991b1b;
}
.borrower-item-reservation.is-expired {
  background: #f1f5f9;
  border-color: #cbd5e1;
  animation: none;
}
.borrower-item-reservation.is-expired .reservation-timer-countdown {
  color: #64748b;
}
.borrower-item-reservation.is-expired .reservation-timer-hint {
  color: #64748b;
}

@keyframes reservationPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }
}

.borrower-tool-card-reservation {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.15rem;
  padding: 0.35rem 0.55rem;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 0.5rem;
}
.borrower-tool-card-reservation.is-queue-waiting {
  color: #1e40af;
  background: #eff6ff;
  border-color: #bfdbfe;
}
.borrower-tool-card-reservation.is-queue-ready {
  color: #115e59;
  background: #f0fdfa;
  border-color: #99f6e4;
  font-weight: 600;
}
.borrower-tool-card-reservation .reservation-timer-countdown {
  font-size: 0.95rem;
  font-weight: 800;
  color: #b45309;
  font-variant-numeric: tabular-nums;
}
.borrower-tool-card-reservation .reservation-timer-hint {
  font-size: 0.68rem;
  color: #92400e;
  font-weight: 600;
}
.borrower-tool-card-reservation.is-warning {
  background: #fff7ed;
  border-color: #fb923c;
}
.borrower-tool-card-reservation.is-warning .reservation-timer-countdown {
  color: #c2410c;
}
.borrower-tool-card-reservation.is-warning .reservation-timer-hint {
  color: #9a3412;
}
.borrower-tool-card-reservation.is-critical {
  background: #fef2f2;
  border-color: #f87171;
}
.borrower-tool-card-reservation.is-critical .reservation-timer-countdown {
  color: #b91c1c;
}
.borrower-tool-card-reservation.is-critical .reservation-timer-hint {
  color: #991b1b;
}
.borrower-tool-card.is-reserved {
  border-color: #fcd34d;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.18);
}

.borrower-checkout-reservation-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
  padding: 0.3rem 0.5rem;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 0.45rem;
}
.borrower-checkout-reservation-item .reservation-timer-countdown {
  font-size: 0.9rem;
  font-weight: 800;
  color: #b45309;
  font-variant-numeric: tabular-nums;
}
.borrower-checkout-reservation-item .reservation-timer-hint {
  font-size: 0.68rem;
  color: #92400e;
  font-weight: 500;
}
.borrower-checkout-reservation-item.is-warning {
  background: #fff7ed;
  border-color: #fb923c;
}
.borrower-checkout-reservation-item.is-warning .reservation-timer-countdown {
  color: #c2410c;
}
.borrower-checkout-reservation-item.is-warning .reservation-timer-hint {
  color: #9a3412;
}
.borrower-checkout-reservation-item.is-critical {
  background: #fef2f2;
  border-color: #f87171;
}
.borrower-checkout-reservation-item.is-critical .reservation-timer-countdown {
  color: #b91c1c;
}
.borrower-checkout-reservation-item.is-critical .reservation-timer-hint {
  color: #991b1b;
}

.borrower-reservation-timer.compact {
  margin-bottom: 0.85rem;
  padding: 0.55rem 0.8rem;
}
.borrower-reservation-timer.compact .reservation-timer-countdown {
  font-size: 1.1rem;
}

/* -------------------------------------------------------------------------
 * Borrower notifications (pickup updates, reminders and expiries)
 * ------------------------------------------------------------------------- */
.borrower-notifications {
  margin-bottom: 1.25rem;
}
.borrower-notification-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.borrower-notification-item {
  padding: 0.75rem 0.9rem;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #1d4ed8;
  border-radius: 0.5rem;
  background: #f8fafc;
}
.borrower-notification-item.is-success {
  border-left-color: #16a34a;
  background: #f0fdf4;
}
.borrower-notification-item.is-warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}
.borrower-notification-item.is-error {
  border-left-color: #dc2626;
  background: #fef2f2;
}
.borrower-notification-item.is-read {
  opacity: 0.72;
  background: #f8fafc;
}
.borrower-notification-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.borrower-notification-head strong,
.borrower-notification-head a {
  color: #0f172a;
  font-size: 0.92rem;
}
.borrower-notification-message a {
  color: inherit;
}
.borrower-notification-time {
  color: #64748b;
  font-size: 0.72rem;
}
.borrower-notification-message {
  margin: 0.3rem 0 0;
  color: #475569;
  font-size: 0.84rem;
  line-height: 1.5;
}

/* Notification bell icon button (upper-right corner of dashboard) */
.borrower-notifications-toggle {
  display: flex;
  align-items: center;
}

.borrower-notifications-bell {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 0.5rem;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.borrower-notifications-bell:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
}

.borrower-notifications-bell .borrower-notifications-icon {
  width: 1.25rem;
  height: 1.25rem;
  stroke-width: 2;
}

.borrower-notifications-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
}

.borrower-notifications-bell.has-count .borrower-notifications-badge {
  display: flex;
}

.borrower-notifications-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  margin-left: 0.5rem;
}

.borrower-notifications-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #0f172a;
}

.borrower-notifications-close .borrower-notifications-close-icon {
  width: 1.125rem;
  height: 1.125rem;
}

/* Reserved quantity stepper */
.borrower-qty-stepper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0.3rem 0 0.45rem;
}
.borrower-qty-btn {
  width: 1.9rem;
  height: 1.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: #1e3a8a;
  border: 1px solid #cbd5e1;
  border-radius: 0.45rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.borrower-qty-btn:hover {
  background: #eff6ff;
  border-color: #93c5fd;
}
.borrower-qty-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.borrower-qty-value {
  min-width: 1.75rem;
  text-align: center;
  font-weight: 700;
  color: #0f172a;
  font-variant-numeric: tabular-nums;
}
.borrower-qty-unit {
  font-size: 0.7rem;
  color: #64748b;
  font-weight: 600;
}

/* Toast variants */
.borrower-toast.is-success {
  background: #065f46;
}
.borrower-toast.is-warning {
  background: #b45309;
}
.borrower-toast.is-error {
  background: #b91c1c;
}
.borrower-toast.is-info {
  background: #1e3a8a;
}

@media (max-width: 640px) {
  .borrower-item-reservation,
  .borrower-tool-card-reservation,
  .borrower-checkout-reservation-item {
    width: 100%;
  }
  .borrower-toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }
}

/* -------------------------------------------------------------------------
 * Enhanced Borrower Workflow & Shopping-Cart Style Borrowing UI
 * ------------------------------------------------------------------------- */

.borrower-cart-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  margin-left: 0.35rem;
  background: #dc2626;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  line-height: 1;
}

/* Tool Cards Grid on Borrower Dashboard */
.borrower-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.15rem;
  padding: 0.25rem 0;
}

.borrower-tool-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.borrower-tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.borrower-tool-card-image-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid #f1f5f9;
}

.borrower-tool-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.borrower-tool-card:hover .borrower-tool-card-img {
  transform: scale(1.03);
}

.borrower-tool-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #94a3b8;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  font-size: 0.85rem;
  font-weight: 600;
}

.borrower-tool-card-placeholder svg {
  width: 42px;
  height: 42px;
  opacity: 0.6;
}

.borrower-tool-card-image-wrap .borrower-row-status {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(4px);
}

.borrower-tool-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem;
  gap: 0.65rem;
}

.borrower-tool-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.72rem;
}

.borrower-tool-pill {
  padding: 0.2rem 0.5rem;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  border-radius: 0.35rem;
  letter-spacing: 0.02em;
}

.borrower-tool-id-badge {
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 600;
}

.borrower-tool-card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.borrower-tool-card-desc {
  margin: 0;
  font-size: 0.8rem;
  color: #64748b;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.borrower-tool-card-specs {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.7rem;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 0.5rem;
  font-size: 0.78rem;
  gap: 0.5rem;
}

.borrower-tool-card-specs .spec-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.borrower-tool-card-specs .spec-label {
  color: #64748b;
  font-size: 0.72rem;
}

.borrower-tool-card-specs .stock-count.in-stock {
  color: #166534;
  font-weight: 700;
}

.borrower-tool-card-specs .stock-count.out-of-stock {
  color: #dc2626;
  font-weight: 700;
}

.borrower-tool-card-actions {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.borrower-cart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 600;
}

.borrower-cart-btn.in-cart {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.borrower-cart-btn.in-cart:hover {
  background: #d1fae5;
}

/* Cart Quantity Stepper */
.borrower-qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #cbd5e1;
  border-radius: 0.45rem;
  overflow: hidden;
  background: #fff;
}

.borrower-qty-stepper .stepper-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: #f8fafc;
  color: #334155;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.1s ease;
}

.borrower-qty-stepper .stepper-btn:hover:not(:disabled) {
  background: #e2e8f0;
  color: #0f172a;
}

.borrower-qty-stepper .stepper-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.borrower-qty-stepper input[type="number"] {
  width: 44px;
  height: 28px;
  text-align: center;
  border: none;
  border-left: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  padding: 0;
  -moz-appearance: textfield;
}

.borrower-qty-stepper input[type="number"]::-webkit-outer-spin-button,
.borrower-qty-stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Cart Tool Thumbnail */
.borrower-cart-tool-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.borrower-cart-tool-thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 0.45rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.borrower-cart-tool-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.borrower-cart-tool-thumb-placeholder {
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Comprehensive Status Badge Styles */
.borrower-row-status.is-pending {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.borrower-row-status.is-approved {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.borrower-row-status.is-partially-approved,
.borrower-row-status.is-partially-processed {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.borrower-row-status.is-ready {
  background: #f3e8ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
}

.borrower-row-status.is-borrowed {
  background: #ffedd5;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.borrower-row-status.is-returned {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.borrower-row-status.is-overdue {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
  font-weight: 800;
}

.borrower-row-status.is-rejected {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.borrower-request-items {
  display: grid;
  gap: 0.65rem;
}
.req-tool-item-detail {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #fff;
}
.borrower-request-tool-image {
  flex: 0 0 3rem;
  width: 3rem;
  height: 3rem;
  border-radius: 0.35rem;
  object-fit: cover;
  background: #f1f5f9;
}
.borrower-request-tool-image.is-placeholder {
  display: inline-block;
}
.req-tool-item-copy {
  min-width: 0;
  overflow-wrap: anywhere;
}
.req-tool-item-copy .borrower-row-status {
  display: inline-block;
  margin-top: 0.3rem;
}
.req-decision-note {
  display: block;
  margin-top: 0.25rem;
  color: #475569;
  overflow-wrap: anywhere;
}
.request-item-summary {
  margin: 0.75rem 0;
  padding: 0.65rem 0.8rem;
  border-radius: 0.45rem;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.85rem;
}

/* Requests Toolbar */
.borrower-requests-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.borrower-requests-toolbar .search {
  flex: 1;
  min-width: 220px;
}

.borrower-requests-toolbar select {
  min-width: 180px;
}

/* Request Number Pill */
.req-number-pill {
  display: inline-flex;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  border-radius: 0.35rem;
  font-size: 0.85rem;
}

/* Confirmation Slot & Banner */
.borrower-confirmation-banner {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.08);
}

.borrower-confirmation-banner .confirm-content {
  flex: 1;
}

.borrower-confirmation-banner h3 {
  margin: 0 0 0.35rem;
  color: #065f46;
  font-size: 1.1rem;
}

.borrower-confirmation-banner p {
  margin: 0.25rem 0;
  color: #047857;
  font-size: 0.88rem;
  line-height: 1.45;
}

.borrower-confirmation-banner .confirm-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.borrower-confirmation-banner .confirm-close {
  background: none;
  border: none;
  color: #065f46;
  font-size: 1.35rem;
  cursor: pointer;
  padding: 0.25rem;
  opacity: 0.7;
}

.borrower-confirmation-banner .confirm-close:hover {
  opacity: 1;
}

/* Checkout Info Box */
.borrower-checkout-info-box {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 0.5rem;
  font-size: 0.8rem;
}

.borrower-checkout-info-box strong {
  display: block;
  color: #1e40af;
  margin-bottom: 0.25rem;
}

.borrower-checkout-info-box p {
  margin: 0;
  color: #1e3a8a;
  line-height: 1.4;
}

/* Toast Message */
.borrower-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #0f172a;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: toastFadeIn 0.25s ease-out;
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .borrower-tools-grid {
    grid-template-columns: 1fr;
  }
  .borrower-tool-card-actions {
    grid-template-columns: 1fr;
  }
}

html[data-color-theme] {
  --content-bg: var(--theme-page-bg);
  --card-bg: var(--theme-surface);
  --card-border: var(--theme-border);
  --border-color: var(--theme-border);
  --theme-page-bg: color-mix(in srgb, white 89%, var(--blue-primary) 11%);
  --theme-page-bg-end: color-mix(in srgb, white 82%, var(--blue-primary) 18%);
  --theme-surface: color-mix(in srgb, white 96%, var(--blue-primary) 4%);
  --theme-surface-soft: color-mix(in srgb, white 89%, var(--blue-primary) 11%);
  --theme-surface-strong: color-mix(in srgb, white 82%, var(--blue-primary) 18%);
  --theme-border: color-mix(in srgb, white 58%, var(--blue-primary) 42%);
}
html.admin-document[data-color-theme] {
  background-color: var(--blue-primary-dark);
}
html[data-color-theme] body {
  background-color: var(--theme-page-bg);
  background-image: linear-gradient(
    145deg,
    var(--theme-page-bg),
    var(--theme-page-bg-end)
  );
}
html[data-color-theme] .admin-page,
html[data-color-theme] .borrower-page,
html[data-color-theme] .feature-page {
  background: linear-gradient(
    145deg,
    var(--theme-page-bg),
    var(--theme-page-bg-end)
  );
}
html[data-color-theme] .panel,
html[data-color-theme] .card-surface,
html[data-color-theme] .dashboard-card,
html[data-color-theme] .admin-stat,
html[data-color-theme] .stat,
html[data-color-theme] .equipment-card,
html[data-color-theme] .maintenance-card,
html[data-color-theme] .donation-card,
html[data-color-theme] .welcome-message,
html[data-color-theme] .borrower-stats > div,
html[data-color-theme] .borrower-notifications,
html[data-color-theme] .borrower-layout > .panel,
html[data-color-theme] .asset-unit-card,
html[data-color-theme] .inventory-modal,
html[data-color-theme] .donation-edit-modal,
html[data-color-theme] .borrower-confirm-modal,
html[data-color-theme] .asset-drawer,
html[data-color-theme] .queue-history-detail-modal,
html[data-color-theme] .inventory-detail-modal,
html[data-color-theme] .inventory-import-modal {
  background-color: var(--theme-surface);
  border-color: var(--theme-border);
}
html[data-color-theme] .admin-nav,
html[data-color-theme] .feature-toolbar,
html[data-color-theme] .inventory-toolbar,
html[data-color-theme] .borrower-equipment-filters,
html[data-color-theme] .borrower-inventory-toolbar,
html[data-color-theme] .borrower-toolbar,
html[data-color-theme] .borrower-history-toolbar,
html[data-color-theme] .borrower-requests-toolbar,
html[data-color-theme] .maintenance-toolbar,
html[data-color-theme] .maintenance-history-toolbar,
html[data-color-theme] .maintenance-unified-toolbar,
html[data-color-theme] .donation-toolbar,
html[data-color-theme] .borrower-filter-disclosure,
html[data-color-theme] .dashboard-card-header,
html[data-color-theme] .status-item,
html[data-color-theme] .inventory-primary,
html[data-color-theme] .inventory-secondary,
html[data-color-theme] .asset-type-group > summary {
  background-color: var(--theme-surface-soft);
  border-color: var(--theme-border);
}
html[data-color-theme] .table-wrap th {
  background-color: var(--theme-surface-soft);
}
html[data-color-theme] .table-wrap th,
html[data-color-theme] .table-wrap td {
  border-color: var(--theme-border);
}
html[data-color-theme] .borrower-equipment-filters input,
html[data-color-theme] .borrower-equipment-filters select,
html[data-color-theme] .feature-toolbar input,
html[data-color-theme] .feature-toolbar select,
html[data-color-theme] .inventory-toolbar input,
html[data-color-theme] .inventory-toolbar select,
html[data-color-theme] .panel input,
html[data-color-theme] .panel select,
html[data-color-theme] .panel textarea,
html[data-color-theme] .mobile-nav-drawer,
html[data-color-theme] .mobile-nav-drawer a,
html[data-color-theme] .mobile-nav-drawer button:not(.mobile-nav-close):not(.mobile-nav-logout) {
  background-color: var(--theme-surface);
  border-color: var(--theme-border);
}
html[data-color-theme] .mobile-nav-close {
  background-color: var(--theme-surface);
  border-color: var(--theme-border);
}
html[data-color-theme] .admin-nav a,
html[data-color-theme] .admin-nav button {
  background-color: var(--theme-surface);
}
html[data-color-theme] .admin-nav a.active,
html[data-color-theme] .mobile-nav-drawer a.active {
  background-color: var(--blue-primary);
  border-color: var(--blue-primary);
}
html[data-color-theme] .admin-nav a:hover:not(.active),
html[data-color-theme] .mobile-nav-drawer a:hover,
html[data-color-theme] .mobile-nav-drawer button:not(.mobile-nav-close):not(.mobile-nav-logout):hover {
  background-color: var(--theme-surface-strong);
}
html[data-color-theme] .welcome-message {
  color: var(--blue-800);
}
html[data-color-theme] .theme-settings {
  background-color: var(--theme-surface);
}


/* Enhanced Checkout Form Styles */
.borrower-identity-strip {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  margin-bottom: 0.35rem;
}
.borrower-identity-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #3b82f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.borrower-identity-avatar svg {
  width: 20px;
  height: 20px;
}
.borrower-identity-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
}
.borrower-identity-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 700;
}
.borrower-identity-name {
  font-size: 0.95rem;
  color: #0f172a;
}
.borrower-identity-name-input {
  font: inherit;
  font-size: 0.95rem;
  color: #0f172a;
  border: none;
  background: transparent;
  outline: none;
  margin: 0;
  padding: 0;
  width: auto;
  box-sizing: border-box;
}
.borrower-identity-name-input:focus {
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  border-radius: 0.2rem;
}
.borrower-identity-sub {
  font-size: 0.8rem;
  color: #64748b;
}
.borrower-verified-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.6rem;
  background: #ecfdf5;
  color: #059669;
  border: 1px solid #a7f3d0;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.borrower-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 640px) {
  .borrower-form-row {
    grid-template-columns: 1fr;
  }
}
.borrower-safety-card {
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
}
.borrower-safety-card .modal-check {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: #334155;
  cursor: pointer;
}
.borrower-safety-card .modal-check input {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  cursor: pointer;
}

.settings-trigger {
  width: auto;
  min-width: 2.25rem;
  padding: 0 0.7rem;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.settings-trigger .icon {
  width: 1.1rem;
  height: 1.1rem;
}
.theme-settings-dialog {
  width: min(94vw, 42rem);
  max-width: 42rem;
  max-height: min(88vh, 42rem);
  padding: 0;
  overflow: auto;
  color: var(--text-primary);
  background: transparent;
  border: 0;
}
.theme-settings-dialog::backdrop {
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(3px);
}
.theme-settings {
  margin: 0;
  padding: 1.35rem;
  background: var(--theme-surface, var(--card-bg));
  border: 1px solid var(--theme-border, var(--card-border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.theme-settings-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.theme-settings-heading .eyebrow {
  margin: 0 0 0.2rem;
  color: var(--text-secondary);
}
.theme-settings-heading h2 {
  margin: 0;
  font-size: 1.25rem;
}
.theme-settings-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  color: var(--text-primary);
  background: var(--theme-surface-soft, var(--blue-50));
  border: 1px solid var(--theme-border, var(--card-border));
  border-radius: var(--radius-md);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}
.theme-settings-description {
  margin: 0 0 1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}
.theme-settings-status {
  margin: 1rem 0 0;
  color: var(--text-secondary);
  font-size: 0.8rem;
}
.theme-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.55rem;
}
.theme-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.6rem 0.7rem;
  color: var(--text-primary);
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.theme-option:hover,
.theme-option[aria-pressed="true"] {
  border-color: var(--blue-primary);
  background: var(--blue-50);
}
.theme-option[aria-pressed="true"] {
  box-shadow: inset 0 0 0 1px var(--blue-primary);
}
.theme-option:focus-visible {
  outline: 3px solid var(--blue-300);
  outline-offset: 2px;
}
.theme-option:disabled {
  cursor: wait;
  opacity: 0.7;
}
.theme-option-swatch {
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  border-radius: 50%;
  background: var(--theme-swatch);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

@media (max-width: 760px) {
  .theme-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .settings-trigger {
    padding: 0;
    width: 2.25rem;
  }
  .settings-trigger span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

/* ========================================================================== 
   Checkout Form Cards & Schedule Timeline Styling
   ========================================================================== */

.checkout-field-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.checkout-field-card:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

.checkout-field-header {
  margin-bottom: 0.65rem;
}

.checkout-field-header .field-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.checkout-field-header .field-title svg {
  color: #2563eb;
  flex-shrink: 0;
}

.checkout-field-header .field-title .required {
  color: #ef4444;
  margin-left: 0.15rem;
}

.checkout-field-header .field-desc {
  display: block;
  font-size: 0.76rem;
  color: #64748b;
  margin-top: 0.25rem;
  line-height: 1.4;
}

.checkout-field-card textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #f8fafc;
  color: #1e293b;
  font-size: 0.85rem;
  font-family: inherit;
  line-height: 1.5;
  box-sizing: border-box;
  resize: vertical;
  transition: all 0.15s ease;
}

.checkout-field-card textarea:focus {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

/* Quick tag suggestions */
.checkout-quick-tags {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.checkout-quick-tags .quick-tag-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.checkout-quick-tags .quick-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 500;
  color: #1d4ed8;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.3;
}

.checkout-quick-tags .quick-tag:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1e40af;
  transform: translateY(-1px);
}

/* Borrowing Schedule Card */
.checkout-schedule-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.checkout-schedule-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid #f1f5f9;
}

.checkout-schedule-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
}

.checkout-schedule-title svg {
  color: #2563eb;
  flex-shrink: 0;
}

.checkout-duration-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 700;
  color: #059669;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 9999px;
}

.checkout-duration-badge.is-warning {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.checkout-schedule-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.85rem;
  align-items: center;
}

.checkout-schedule-col {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.6rem;
  padding: 0.85rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.checkout-schedule-col:focus-within {
  background: #ffffff;
  border-color: #93c5fd;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}

.schedule-col-header {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.schedule-bullet {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 0.25rem;
  flex-shrink: 0;
}

.pickup-bullet {
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.return-bullet {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.schedule-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}

.schedule-label .required {
  color: #ef4444;
}

.schedule-desc {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  margin-top: 0.15rem;
  line-height: 1.35;
}

.checkout-datetime-input {
  width: 100%;
  height: 2.5rem;
  padding: 0.4rem 0.65rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.45rem;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.84rem;
  font-family: inherit;
  font-weight: 500;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.checkout-datetime-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

.checkout-return-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.checkout-return-actions[hidden] {
  display: none;
}

.checkout-schedule-divider {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  flex-shrink: 0;
}

@media (max-width: 680px) {
  .checkout-schedule-grid {
    grid-template-columns: 1fr;
  }
  .checkout-schedule-divider {
    transform: rotate(90deg);
    margin: -0.25rem auto;
  }
}

/* Borrowing journey stepper */
.borrower-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.borrower-steps-list {
  display: flex;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.borrower-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}
.borrower-step a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.25rem;
  border-radius: 0.4rem;
  transition: background 0.15s ease, color 0.15s ease;
}
.borrower-step a:hover {
  background: #f1f5f9;
  color: #475569;
}
.borrower-step.is-active a {
  background: #2563eb;
  color: #fff;
}
.borrower-step.is-active a:hover {
  background: #1d4ed8;
}
.borrower-step.is-done a {
  color: #0f766e;
}
.borrower-step.is-done a:hover {
  background: #ecfdf5;
  color: #047857;
}
.borrower-step-index {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.borrower-step.is-active .borrower-step-index {
  border-color: #fff;
  color: #fff;
}
.borrower-step-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Borrower page header / title area */
.borrower-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Borrowing list */
.borrower-cart-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}
.borrower-cart-total-badge {
  font-size: 0.88rem;
  color: #475569;
}
.borrower-cart-total-badge strong {
  color: #0f172a;
}
.borrower-cart-hint {
  margin-top: 0.5rem;
  color: #475569;
  font-size: 0.85rem;
}

/* Pickup slot */
.borrower-pickup-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.6rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  background: #f8fafc;
}
.borrower-pickup-slot.is-held {
  background: #f0fdf4;
  border-color: #a7f3d0;
}
.borrower-pickup-slot.is-missing {
  background: #fffbeb;
  border-color: #fde68a;
}
.borrower-pickup-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: #64748b;
}
.borrower-pickup-value {
  flex: 1;
  font-size: 0.88rem;
  color: #0f172a;
}
.borrower-pickup-actions {
  display: flex;
  gap: 0.4rem;
}

/* Review panel */
.borrower-review {
  margin-top: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.6rem;
  background: #f8fafc;
}
.borrower-review-details {
  padding: 0.75rem 1rem;
}
.confirm-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 0.35rem 0;
  border-bottom: 1px solid #e2e8f0;
}
.confirm-summary-row:last-child {
  border-bottom: 0;
}
.confirm-label {
  color: #64748b;
  font-size: 0.78rem;
}
.confirm-label + strong {
  min-width: 0;
}

/* Draft notice */
.borrower-draft-notice {
  margin-top: 0.7rem;
  padding: 0.6rem 0.9rem;
  background: #fef3c7;
  border: 1px solid #fde047;
  border-radius: 0.5rem;
  color: #92400e;
  font-size: 0.8rem;
  line-height: 1.45;
}
.borrower-draft-notice.hidden {
  display: none;
}

/* Field errors */
.field-error {
  color: #dc2626;
  font-size: 0.76rem;
  margin-top: 0.3rem;
  min-height: 1.1rem;
}
[aria-invalid="true"] {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

/* Reservation banner at checkout */
.borrower-checkout-reservation.compact {
  padding: 0.6rem 0.9rem;
}
.borrower-checkout-reservation.compact .reservation-timer-label {
  font-size: 0.75rem;
}

/* Reservation Queue History (student dashboard) */
.borrower-queue-history-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-bottom: 0;
  flex-wrap: wrap;
}
.borrower-queue-history-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: #475569;
}
.borrower-queue-history-filters label span {
  font-weight: 700;
  color: #334155;
}
.borrower-queue-history-filters input,
.borrower-queue-history-filters select {
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
  background: #fff;
  min-width: 150px;
}
.queue-history-table {
  font-size: 0.9rem;
}
.queue-history-tool {
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.queue-history-tool-image {
  width: 36px;
  height: 36px;
  border-radius: 0.4rem;
  border: 1px solid #e2e8f0;
  background: #f1f5f9;
  object-fit: cover;
  flex-shrink: 0;
}
.queue-history-tool-image.missing {
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  color: #94a3b8;
  font-weight: 700;
}
.queue-history-position {
  font-size: 0.85rem;
  line-height: 1.4;
}
.queue-history-position .label {
  color: #64748b;
  font-size: 0.75rem;
}
.queue-history-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  flex-wrap: wrap;
}
.queue-history-pagination .is-active {
  background: #1e3a5f;
  color: #fff;
  border-color: #1e3a5f;
}
.queue-history-detail-modal {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.5rem 0;
}
.queue-history-detail-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.55rem;
  font-size: 0.9rem;
}
.queue-history-detail-row strong {
  color: #334155;
  min-width: 140px;
}

/* ==========================================================================
   Borrower tables: My Borrowing Requests, My Borrow History, My Queue History
   Responsive layout:
   - Desktop/laptop: full-width table with aligned columns
   - Tablet (≤1024px): compact padding, smaller fonts, wrapped headers
   - Mobile (≤700px): stacked record cards with labelled fields and
     full-width, easy-to-tap action buttons
   ========================================================================== */

/* Shared base: desktop/tablet table */
.borrower-requests-table,
.borrower-history-table,
.queue-history-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.875rem;
}
.borrower-requests-table thead th,
.borrower-history-table thead th,
.queue-history-table thead th {
  background: #f8fafc;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 2px solid #e2e8f0;
  white-space: nowrap;
}
.borrower-requests-table th,
.borrower-requests-table td,
.borrower-history-table th,
.borrower-history-table td,
.queue-history-table th,
.queue-history-table td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
  white-space: normal;
  min-width: 0;
}
.borrower-requests-table tbody tr,
.borrower-history-table tbody tr,
.queue-history-table tbody tr {
  transition: background 0.12s ease;
}
.borrower-requests-table tbody tr:last-child td,
.borrower-history-table tbody tr:last-child td,
.queue-history-table tbody tr:last-child td {
  border-bottom: 0;
}
.borrower-requests-table tbody tr:hover,
.borrower-history-table tbody tr:hover,
.queue-history-table tbody tr:hover {
  background: #f8fafc;
}
.borrower-requests-table .borrower-row-status,
.borrower-history-table .borrower-row-status,
.queue-history-table .borrower-row-status {
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Column widths: Borrow Requests (6 columns) */
.borrower-requests-table th:nth-child(1),
.borrower-requests-table td:nth-child(1) {
  width: 14%;
}
.borrower-requests-table th:nth-child(2),
.borrower-requests-table td:nth-child(2) {
  width: 38%;
}
.borrower-requests-table th:nth-child(3),
.borrower-requests-table td:nth-child(3) {
  width: 12%;
}
.borrower-requests-table th:nth-child(4),
.borrower-requests-table td:nth-child(4) {
  width: 12%;
}
.borrower-requests-table th:nth-child(5),
.borrower-requests-table td:nth-child(5) {
  width: 13%;
}
.borrower-requests-table th:nth-child(6),
.borrower-requests-table td:nth-child(6) {
  width: 11%;
  text-align: center;
}

/* Column widths: Borrow History (8 columns) */
.borrower-history-table th:nth-child(1),
.borrower-history-table td:nth-child(1) {
  width: 3%;
  text-align: center;
}
.borrower-history-table th:nth-child(2),
.borrower-history-table td:nth-child(2) {
  width: 13%;
}
.borrower-history-table th:nth-child(3),
.borrower-history-table td:nth-child(3) {
  width: 34%;
}
.borrower-history-table th:nth-child(4),
.borrower-history-table td:nth-child(4) {
  width: 9%;
  text-align: center;
}
.borrower-history-table th:nth-child(5),
.borrower-history-table td:nth-child(5) {
  width: 11%;
}
.borrower-history-table th:nth-child(6),
.borrower-history-table td:nth-child(6) {
  width: 11%;
}
.borrower-history-table th:nth-child(7),
.borrower-history-table td:nth-child(7) {
  width: 11%;
}
.borrower-history-table th:nth-child(8),
.borrower-history-table td:nth-child(8) {
  width: 8%;
}

/* Column widths: Queue History (8 columns) */
.queue-history-table th:nth-child(1),
.queue-history-table td:nth-child(1) {
  width: 10%;
  text-align: center;
}
.queue-history-table th:nth-child(2),
.queue-history-table td:nth-child(2) {
  width: 31%;
}
.queue-history-table th:nth-child(3),
.queue-history-table td:nth-child(3) {
  width: 12%;
}
.queue-history-table th:nth-child(4),
.queue-history-table td:nth-child(4) {
  width: 8%;
  text-align: center;
}
.queue-history-table th:nth-child(5),
.queue-history-table td:nth-child(5) {
  width: 11%;
}
.queue-history-table th:nth-child(6),
.queue-history-table td:nth-child(6) {
  width: 11%;
}
.queue-history-table th:nth-child(7),
.queue-history-table td:nth-child(7) {
  width: 11%;
}
.queue-history-table th:nth-child(8),
.queue-history-table td:nth-child(8) {
  width: 7%;
  text-align: center;
}

/* Tablet: compact table */
@media (max-width: 1024px) {
  .borrower-requests-table,
  .borrower-history-table,
  .queue-history-table {
    font-size: 0.82rem;
  }
  .borrower-requests-table th,
  .borrower-requests-table td,
  .borrower-history-table th,
  .borrower-history-table td,
  .queue-history-table th,
  .queue-history-table td {
    padding: 0.6rem 0.75rem;
  }
  .borrower-requests-table thead th,
  .borrower-history-table thead th,
  .queue-history-table thead th {
    font-size: 0.68rem;
    white-space: normal;
  }
  .borrower-requests-toolbar,
  .borrower-history-toolbar,
  .borrower-queue-history-filters {
    gap: 0.5rem;
  }
  .borrower-requests-toolbar .search,
  .borrower-requests-toolbar select,
  .borrower-history-toolbar .search,
  .borrower-history-toolbar select,
  .borrower-queue-history-filters input,
  .borrower-queue-history-filters select {
    font-size: 0.875rem;
  }
}

/* Mobile: stacked record cards */
@media (max-width: 700px) {
  .borrower-page .table-wrap {
    overflow: visible;
  }
  .borrower-requests-table,
  .borrower-history-table,
  .queue-history-table,
  .borrower-requests-table tbody,
  .borrower-history-table tbody,
  .queue-history-table tbody,
  .borrower-requests-table tr,
  .borrower-history-table tr,
  .queue-history-table tr {
    display: block;
    width: 100%;
  }
  .borrower-requests-table thead,
  .borrower-history-table thead,
  .queue-history-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .borrower-requests-table tbody tr,
  .borrower-history-table tbody tr,
  .queue-history-table tbody tr {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0.9rem 1rem;
    margin-bottom: 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    background: #fff;
  }
  .borrower-requests-table tbody tr:last-child,
  .borrower-history-table tbody tr:last-child,
  .queue-history-table tbody tr:last-child {
    margin-bottom: 0;
  }
  .borrower-requests-table tbody td,
  .borrower-history-table tbody td,
  .queue-history-table tbody td {
    display: grid;
    grid-template-columns: minmax(7.5rem, 0.5fr) minmax(0, 1fr);
    gap: 0.35rem 0.75rem;
    padding: 0.35rem 0;
    min-width: 0;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    overflow-wrap: anywhere;
  }
  .borrower-requests-table tbody td[colspan],
  .borrower-history-table tbody td[colspan],
  .queue-history-table tbody td[colspan] {
    grid-column: 1 / -1;
  }
  .borrower-requests-table tbody td[colspan]::before,
  .borrower-history-table tbody td[colspan]::before,
  .queue-history-table tbody td[colspan]::before {
    content: none;
  }
  .borrower-requests-table tbody td::before,
  .borrower-history-table tbody td::before,
  .queue-history-table tbody td::before {
    content: attr(data-label);
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    min-width: 0;
  }
  .borrower-requests-toolbar,
  .borrower-history-toolbar,
  .borrower-queue-history-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }
  .borrower-requests-toolbar .search,
  .borrower-requests-toolbar select,
  .borrower-history-toolbar .search,
  .borrower-history-toolbar select,
  .borrower-queue-history-filters input,
  .borrower-queue-history-filters select {
    min-width: 0;
    width: 100%;
  }
}

/* Tablet: keep the record tables on real columns and let them scroll sideways
   rather than squeezing the date columns until every field wraps three deep. */
@media (min-width: 701px) and (max-width: 1000px) {
  .borrower-page .table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
  }
  .borrower-requests-table,
  .queue-history-table {
    min-width: 900px;
  }
  .borrower-history-table {
    min-width: 990px;
  }
}

/* Phone: keep borrower tables horizontal with scroll instead of vertical cards */
@media (max-width: 700px) {
  .borrower-page .table-wrap {
    overflow-x: auto;
    overflow-y: visible;
  }
  .borrower-requests-table,
  .borrower-history-table,
  .queue-history-table {
    display: table !important;
    width: auto !important;
    min-width: 640px !important;
  }
  .borrower-requests-table thead,
  .borrower-history-table thead,
  .queue-history-table thead {
    position: static !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: visible !important;
    clip: auto !important;
    white-space: normal !important;
    border: 0 !important;
    display: table-header-group !important;
  }
  .borrower-requests-table tbody,
  .borrower-history-table tbody,
  .queue-history-table tbody {
    display: table-row-group !important;
  }
  .borrower-requests-table tr,
  .borrower-history-table tr,
  .queue-history-table tr {
    display: table-row !important;
    width: auto !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    background: none !important;
  }
  .borrower-requests-table td,
  .borrower-history-table td,
  .queue-history-table td {
    display: table-cell !important;
    grid-template-columns: none !important;
    gap: 0 !important;
    padding: 0.65rem 0.9rem !important;
    border: none !important;
    border-bottom: 1px solid #f1f5f9 !important;
    min-width: 0 !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    vertical-align: middle !important;
  }
  .borrower-requests-table td::before,
  .borrower-history-table td::before,
  .queue-history-table td::before {
    content: none !important;
  }
}

.password-change-card {
  --auth-accent: #2563eb;
  --auth-accent-dark: #1d4ed8;
  --auth-accent-soft: rgba(37, 99, 235, 0.13);
  --auth-link: #1d4ed8;
  width: min(100%, 32rem);
  margin: auto;
}
.password-change-card h1 {
  margin: 0;
  color: var(--auth-ink);
  font-size: clamp(1.3rem, 2.4vw, 1.55rem);
  line-height: 1.2;
}
.password-change-card form > label {
  display: block;
  margin-top: 1rem;
}
.password-change-card form > label input {
  display: block;
  width: 100%;
}
.password-toggle-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  margin-top: 0.35rem;
}
.password-toggle-wrap input {
  min-width: 0;
  flex: 1 1 auto;
}
.password-visibility-toggle {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.4rem;
  min-width: 2.4rem;
  height: 2.4rem;
  padding: 0;
  border: 0;
  border-radius: 0.5rem;
  color: #64748b;
  background: transparent;
  cursor: pointer;
}
.password-visibility-toggle:hover {
  color: var(--blue-primary);
  background: var(--blue-50);
}
.password-visibility-toggle .icon {
  width: 1.1rem;
  height: 1.1rem;
}
.password-reset-modal .password-reset-toggle {
  margin-top: 0.4rem;
}
.generated-password-toggle {
  margin-top: 0;
}
.password-reset-modal {
  max-height: min(92vh, 48rem);
  overflow: auto;
}
.password-reset-modal [hidden] {
  display: none !important;
}
.password-reset-account {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1rem 0;
  color: #334155;
  font-size: 0.85rem;
}
.password-reset-account div {
  min-width: 0;
}
.password-reset-account dt {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}
.password-reset-account dd {
  margin: 0.15rem 0 0;
  overflow-wrap: anywhere;
}
.password-reset-modal .password-reset-choice,
.password-reset-modal .password-reset-confirm {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.55rem 0;
  color: #334155;
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: none;
}
.password-reset-modal .password-reset-choice input,
.password-reset-modal .password-reset-confirm input {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  margin: 0.1rem 0 0;
}
.password-reset-modal .password-reset-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.45rem;
  margin-top: 0.4rem;
}
.password-reset-modal .password-reset-input-wrap input {
  min-width: 0;
  margin: 0;
}
.password-reset-modal .password-reset-toggle {
  flex: 0 0 auto;
  padding: 0.5rem 0.75rem;
}
.password-reset-modal .password-reset-confirm {
  margin-top: 1rem;
}
.password-reset-modal [data-password-reset-result] {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}
.password-reset-modal [data-password-reset-result] label {
  margin: 0;
  color: #334155;
  font-size: 0.75rem;
  letter-spacing: 0;
  text-transform: none;
}
.password-reset-modal [data-password-reset-result] input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
}
@media (max-width: 520px) {
  .inventory-modal.password-reset-modal {
    padding: 1.35rem;
  }
  .password-reset-account {
    grid-template-columns: 1fr;
  }
  .password-reset-modal .modal-actions {
    flex-direction: column;
  }
  .password-reset-modal .modal-actions button {
    width: 100%;
  }
}
