/* ==========================================================================
   SNRU GRADUATE SCHOOL LIBRARY — CONSOLIDATED CUSTOM DESIGN SYSTEM (custom.css)
   Palette: Royal Academic Dark Navy (#0c1222 / #0f172a), Warm Gold (#d4af37 / #f59e0b),
            Executive Indigo (#4f46e5) & Emerald (#10b981)
   Typography: Local Kanit + Noto Sans Thai
   Zero External CDN Dependencies
   ========================================================================== */

/* ==========================================================================
   Embedded Local Font-Face Declarations (Kanit & Noto Sans Thai)
   ========================================================================== */
@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: local('Kanit Light'), local('Kanit-Light'),
       url('../assets/fonts/kanit/Kanit-Light.ttf') format('truetype');
}
@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Kanit'), local('Kanit-Regular'),
       url('../assets/fonts/kanit/Kanit-Regular.ttf') format('truetype');
}
@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: local('Kanit Medium'), local('Kanit-Medium'),
       url('../assets/fonts/kanit/Kanit-Medium.ttf') format('truetype');
}
@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: local('Kanit SemiBold'), local('Kanit-SemiBold'), local('Kanit Medium'),
       url('../assets/fonts/kanit/Kanit-Medium.ttf') format('truetype');
}
@font-face {
  font-family: 'Kanit';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Kanit Bold'), local('Kanit-Bold'), local('Kanit Medium'),
       url('../assets/fonts/kanit/Kanit-Medium.ttf') format('truetype');
}

@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: local('Noto Sans Thai'),
       url('../assets/fonts/noto-sans-thai/iJWQBXeUZi_OHPqn4wq6hQ2_hbJ1xyN9wd43SofNWcdfKI2hTWsb-P2c.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: local('Noto Sans Thai SemiBold'), local('Noto Sans Thai Medium'),
       url('../assets/fonts/noto-sans-thai/iJWQBXeUZi_OHPqn4wq6hQ2_hbJ1xyN9wd43SofNWcdfKI2hTWsb-P2c.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: local('Noto Sans Thai Bold'),
       url('../assets/fonts/noto-sans-thai/iJWQBXeUZi_OHPqn4wq6hQ2_hbJ1xyN9wd43SofNWcdfKI2hTWsb-P2c.woff2') format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}

:root,
[data-bs-theme="light"] {
  /* Slate & Deep Navy Scale */
  --navy-950: #080d1a;
  --navy-900: #0c1222;
  --navy-800: #131c31;
  --navy-700: #1e293b;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Royal Gold Accents */
  --gold-50: #fffbeb;
  --gold-100: #fef3c7;
  --gold-200: #fde68a;
  --gold-300: #fcd34d;
  --gold-400: #fbbf24;
  --gold-500: #d4af37;
  --gold-600: #b48a1e;
  --amber-500: #f59e0b;
  --amber-600: #d97706;

  /* Executive Indigo Primary */
  --indigo-50: #eef2ff;
  --indigo-100: #e0e7ff;
  --indigo-200: #c7d2fe;
  --indigo-300: #a5b4fc;
  --indigo-400: #818cf8;
  --indigo-500: #6366f1;
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --indigo-800: #3730a3;
  --indigo-900: #312e81;

  /* Semantic Status Tokens */
  --emerald-50: #ecfdf5;
  --emerald-100: #d1fae5;
  --emerald-500: #10b981;
  --emerald-600: #059669;
  --emerald-700: #047857;

  --rose-50: #fff1f2;
  --rose-100: #ffe4e6;
  --rose-200: #fecdd3;
  --rose-500: #f43f5e;
  --rose-600: #e11d48;
  --rose-700: #be123c;

  /* Typography & Layout Tokens */
  --font-sans: 'Kanit', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --body-bg: #f4f7fb;
  --card-bg: #ffffff;
  --text-main: var(--slate-900);
  --text-muted: var(--slate-500);
  --text-light: var(--slate-400);
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  /* Bootstrap 5 Variable Bridges */
  --bs-primary: #4f46e5;
  --bs-primary-rgb: 79, 70, 229;
  --bs-primary-hover: #4338ca;
  --bs-link-color: #4f46e5;
  --bs-link-hover-color: #3730a3;
  --bs-body-font-family: var(--font-sans);
  --bs-body-color: #0f172a;
  --bs-body-bg: #f4f7fb;
  --bs-border-color: #e2e8f0;
  --bs-border-radius: 0.875rem;
  --bs-border-radius-sm: 0.5rem;
  --bs-border-radius-lg: 1.25rem;

  /* Elevation Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px -1px rgba(15, 23, 42, 0.06), 0 1px 3px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 20px -4px rgba(15, 23, 42, 0.08), 0 4px 8px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 16px 32px -6px rgba(15, 23, 42, 0.12), 0 6px 12px -4px rgba(15, 23, 42, 0.06);
  --shadow-xl: 0 24px 48px -12px rgba(15, 23, 42, 0.18), 0 12px 20px -8px rgba(15, 23, 42, 0.08);
  --shadow-gold: 0 8px 24px -4px rgba(212, 175, 55, 0.28);
  --shadow-indigo: 0 8px 24px -4px rgba(79, 70, 229, 0.28);
}

/* ==========================================================================
   Global Reset & Typography
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html, body,
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6,
p, span, a, label, li, ul, ol, td, th,
button, input, select, textarea,
.btn, .form-control, .form-select,
.lead, small, strong, em, b {
  font-family: var(--font-sans) !important;
  letter-spacing: 0.005em;
}

body.library-ui {
  margin: 0 !important;
  background-color: var(--body-bg) !important;
  background-image:
    radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.04) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(212, 175, 55, 0.05) 0px, transparent 45%);
  color: var(--text-main) !important;
  font-family: var(--font-sans) !important;
  font-size: 0.9375rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.library-ui a {
  color: var(--indigo-600);
  text-decoration: none;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.library-ui a:hover {
  color: var(--indigo-800);
}

.library-ui :focus-visible {
  outline: 2px solid var(--indigo-500);
  outline-offset: 2px;
}

.library-ui .sr-only,
.library-ui .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus {
  position: fixed;
  z-index: 2000;
  background: var(--navy-900);
  color: var(--gold-300);
  font-weight: 600;
  padding: 0.75rem 1.25rem;
  top: 0.75rem;
  left: 0.75rem;
  border-radius: 0.625rem;
  box-shadow: var(--shadow-lg);
}

/* ==========================================================================
   Top Institutional Strip
   ========================================================================== */
.library-strip {
  background: linear-gradient(90deg, var(--navy-950) 0%, var(--navy-900) 50%, #162038 100%);
  color: var(--slate-300);
  font-size: 0.8125rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.22);
}
.strip-container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.strip-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--gold-300);
  font-weight: 600;
}
.strip-link {
  color: var(--slate-300) !important;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
}
.strip-link:hover {
  color: var(--gold-300) !important;
}

/* ==========================================================================
   App Header (Glassmorphism + Academic Branding)
   ========================================================================== */
.app-header {
  height: 78px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  position: sticky;
  top: 0;
  z-index: 1020;
  box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.04);
}
.header-inner {
  max-width: 1420px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none !important;
  flex-shrink: 0;
}
.brand-mark {
  width: 48px;
  height: 48px;
  background: #ffffff;
  border-radius: 0.875rem;
  border: 1px solid rgba(212, 175, 55, 0.45);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px -2px rgba(12, 18, 34, 0.12);
  position: relative;
  padding: 3px;
  flex-shrink: 0;
  transition: none;
}
.brand:hover .brand-mark {
  transform: none;
  box-shadow: none;
}
.brand-mark img.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.brand-text strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--slate-900);
  line-height: 1.15;
}
.brand-text strong > span {
  background: linear-gradient(135deg, var(--indigo-600) 0%, var(--gold-600) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-text small {
  display: block;
  font-size: 0.75rem;
  color: var(--slate-500);
  margin-top: 2px;
  font-weight: 400;
}

/* Public Navigation Pills */
.public-nav {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-left: auto;
  background: var(--slate-100);
  padding: 0.3rem;
  border-radius: 0.875rem;
  border: 1px solid var(--slate-200);
}
.public-nav .nav-link {
  color: var(--slate-600) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 0.45rem 1rem;
  border-radius: 0.625rem;
  transition: all 0.18s ease;
}
.public-nav .nav-link:hover {
  color: var(--slate-900) !important;
  background: rgba(255, 255, 255, 0.65);
}
.public-nav .nav-link.active {
  color: var(--indigo-700) !important;
  background: #ffffff;
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

/* Staff Header Context */
.header-context {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}
.context-badge {
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 100%);
  color: var(--gold-300);
  font-weight: 600;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  border: 1px solid rgba(212, 175, 55, 0.3);
  letter-spacing: 0.02em;
}
.context-separator {
  color: var(--slate-300);
}
.context-title {
  color: var(--slate-800);
  font-weight: 600;
  font-size: 0.95rem;
}

/* Header Actions & Profile Dropdown */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  margin-left: auto;
}
.profile-menu {
  position: relative;
}
.profile-menu summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.35rem 0.75rem 0.35rem 0.45rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  box-shadow: var(--shadow-xs);
  transition: all 0.18s ease;
}
.profile-menu summary:hover {
  border-color: var(--indigo-300);
  box-shadow: var(--shadow-sm);
}
.profile-menu summary::-webkit-details-marker {
  display: none;
}
.avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--indigo-700) 100%);
  color: var(--gold-300);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.9375rem;
  border: 2px solid rgba(212, 175, 55, 0.4);
}
.user-meta {
  text-align: left;
  line-height: 1.2;
}
.user-name {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--slate-800);
}
.user-role {
  display: block;
  font-size: 0.6875rem;
  color: var(--slate-500);
}
.profile-dropdown {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  width: 240px;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 0.5rem;
  box-shadow: var(--shadow-xl);
  z-index: 1060;
}
.dropdown-header {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0.35rem;
}
.profile-dropdown a {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.85rem;
  color: var(--slate-700) !important;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background-color 0.15s ease;
}
.profile-dropdown a:hover {
  background: var(--indigo-50);
  color: var(--indigo-700) !important;
}
.profile-dropdown .dropdown-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.35rem 0;
}

.button-outline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--slate-800) !important;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: var(--shadow-xs);
  transition: all 0.18s ease;
}
.button-outline:hover {
  border-color: var(--indigo-400);
  color: var(--indigo-700) !important;
  background: var(--indigo-50);
  transform: translateY(-1px);
}

.button-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: linear-gradient(135deg, var(--indigo-600) 0%, var(--indigo-700) 100%);
  color: #ffffff !important;
  border: 1px solid var(--indigo-600);
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  transition: all 0.18s ease;
}
.button-primary:hover {
  background: linear-gradient(135deg, var(--indigo-700) 0%, var(--indigo-800) 100%);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.32);
}

.menu-toggle {
  display: none;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 0.625rem;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  color: var(--slate-700);
  font-size: 1.125rem;
  cursor: pointer;
}

/* Mobile Nav Drawer */
.mobile-public-nav {
  display: none;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.5rem;
  flex-direction: column;
  gap: 0.4rem;
  box-shadow: var(--shadow-md);
}
.mobile-public-nav a {
  padding: 0.7rem 0.9rem;
  border-radius: 0.625rem;
  color: var(--slate-700) !important;
  font-weight: 500;
}
.mobile-public-nav a:hover,
.mobile-public-nav a.active {
  background: var(--indigo-50);
  color: var(--indigo-600) !important;
}
.mobile-login-link {
  border-top: 1px solid var(--border-light);
  margin-top: 0.4rem;
  padding-top: 0.75rem !important;
}

/* ==========================================================================
   Executive Dark Navy Staff Sidebar & Workspace
   ========================================================================== */
.staff-workspace {
  display: flex;
  min-height: calc(100vh - 78px);
  background: var(--body-bg);
}

.app-sidebar {
  width: 272px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-950) 100%);
  color: var(--slate-300);
  border-right: 1px solid rgba(255, 255, 255, 0.07);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  box-shadow: 4px 0 24px rgba(8, 13, 26, 0.08);
}

.sidebar-section-title {
  padding: 0 0.75rem 0.35rem;
}
.sidebar-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold-400);
  text-transform: uppercase;
  opacity: 0.9;
}

.workspace-nav {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.workspace-nav a {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #cbd5e1 !important;
  transition: all 0.18s ease;
  position: relative;
  border: 1px solid transparent;
}
.workspace-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff !important;
}
.workspace-nav a.active,
.workspace-nav a[aria-current="page"] {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.28) 0%, rgba(212, 175, 55, 0.14) 100%);
  border-color: rgba(212, 175, 55, 0.32);
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.nav-icon-box {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--slate-300);
  font-size: 0.875rem;
  transition: all 0.18s ease;
}
.workspace-nav a.active .nav-icon-box {
  background: linear-gradient(135deg, var(--gold-500) 0%, var(--amber-500) 100%);
  color: var(--navy-950);
  box-shadow: 0 2px 8px rgba(212, 175, 55, 0.4);
}
.nav-title {
  flex: 1;
}
.active-dot {
  width: 7px;
  height: 7px;
  background: var(--gold-400);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--gold-400);
}

.context-nav {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.15rem;
}
.context-nav-inner ul {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.context-nav-inner li {
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--slate-400);
  font-size: 0.825rem;
}
.context-nav-inner li > a,
.context-nav-inner > a {
  display: block;
  padding: 0.48rem 0.8rem;
  font-size: 0.825rem;
  color: #94a3b8 !important;
  border-radius: 0.55rem;
  transition: all 0.15s ease;
}
.context-nav-inner li > a:hover,
.context-nav-inner > a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff !important;
}
.context-nav-inner li.active {
  padding: 0.48rem 0.8rem !important;
  color: var(--gold-300) !important;
  font-weight: 600;
  background: rgba(212, 175, 55, 0.12) !important;
  border-left: 3px solid var(--gold-400) !important;
  border-radius: 0 0.55rem 0.55rem 0;
}
.context-nav-inner .navbutton,
.page-section-nav .navbutton,
.page-section-nav button:has(.fa-right-from-bracket),
.context-nav-inner button:has(.fa-right-from-bracket),
.context-nav-inner input.navbutton,
.context-nav-inner br {
  display: none !important;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-public-btn {
  display: flex;
  align-items: center;
  padding: 0.7rem 0.9rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.825rem;
  font-weight: 500;
  color: #e2e8f0 !important;
}
.sidebar-public-btn:hover {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.4);
  color: var(--gold-300) !important;
}

.staff-main {
  flex: 1;
  min-width: 0;
  padding: 2.25rem 2.5rem 4rem;
  max-width: 1460px;
}
.public-main {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

/* ==========================================================================
   Public Home Landing Page (`home/main.php`)
   ========================================================================== */
.home-hero {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 3rem;
  margin-top: 2rem;
  padding: 3.5rem 3.25rem;
  background: linear-gradient(135deg, var(--navy-900) 0%, #16223be6 55%, #1e1b4b 100%);
  border-radius: 1.75rem;
  color: #ffffff;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(212, 175, 55, 0.25);
}
.home-hero::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero-copy {
  position: relative;
  z-index: 2;
}
.hero-copy .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gold-300);
  background: rgba(212, 175, 55, 0.14);
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  margin-bottom: 1.25rem;
}
.hero-copy h1 {
  font-size: clamp(2.15rem, 3.8vw, 3.15rem);
  font-weight: 700;
  line-height: 1.22;
  color: #ffffff;
  margin-bottom: 1.15rem;
  letter-spacing: -0.02em;
}
.hero-copy h1 > span {
  background: linear-gradient(135deg, var(--gold-300) 0%, var(--amber-500) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-copy > p {
  font-size: 1.05rem;
  color: #cbd5e1;
  line-height: 1.75;
  margin-bottom: 2rem;
}

/* Hero Search Bar */
.hero-search {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 1rem;
  padding: 0.45rem 0.5rem 0.45rem 1.2rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  gap: 0.75rem;
  max-width: 620px;
  transition: all 0.2s ease;
}
.hero-search:focus-within {
  border-color: var(--gold-400);
  box-shadow: 0 12px 36px rgba(212, 175, 55, 0.28);
}
.hero-search > i {
  color: var(--indigo-600);
  font-size: 1.15rem;
}
.hero-search input {
  flex: 1;
  min-width: 0;
  border: 0 !important;
  background: transparent !important;
  padding: 0.55rem 0 !important;
  font-size: 0.96rem !important;
  color: var(--slate-900) !important;
  outline: none !important;
  box-shadow: none !important;
}
.hero-search button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--indigo-600) 0%, var(--indigo-700) 100%);
  color: #ffffff;
  border: 0;
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}
.hero-search button:hover {
  background: linear-gradient(135deg, var(--indigo-700) 0%, var(--indigo-800) 100%);
  transform: translateY(-1px);
}

.hero-suggestions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  font-size: 0.8125rem;
  color: #cbd5e1;
}
.hero-suggestions > a {
  padding: 0.3rem 0.85rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  color: #f8fafc !important;
  font-size: 0.8125rem;
  backdrop-filter: blur(6px);
  transition: all 0.18s ease;
}
.hero-suggestions > a:hover {
  background: var(--gold-400);
  border-color: var(--gold-400);
  color: var(--navy-950) !important;
  font-weight: 600;
}

/* Hero Art (3D Books Display) */
.hero-art {
  height: 350px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 1.35rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}
.hero-books {
  position: absolute;
  inset: 1.5rem 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-volume {
  width: 175px;
  height: 250px;
  border-radius: 0.5rem 0.875rem 0.875rem 0.5rem;
  position: absolute;
  padding: 1.35rem 1.15rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.hero-volume.volume-0 {
  background: linear-gradient(135deg, #4338ca 0%, #1e1b4b 100%);
  color: #ffffff;
  transform: rotate(-9deg) translate(-28px, 12px);
  z-index: 2;
}
.hero-volume.volume-1 {
  background: linear-gradient(135deg, #b48a1e 0%, #78350f 100%);
  color: #ffffff;
  transform: rotate(8deg) translate(28px, -10px);
  z-index: 1;
}
.hero-volume strong {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-volume span {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-top: auto;
}
.hero-volume img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Metrics Section */
.library-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin: 2rem 0 3rem;
}
.library-metrics > div {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 1.15rem;
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.library-metrics > div:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.library-metrics strong {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1.1;
}
.library-metrics strong > span {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-500);
  margin-left: 0.35rem;
}
.library-metrics p {
  font-size: 0.825rem;
  color: var(--slate-600);
  margin: 0.45rem 0 0;
  font-weight: 500;
}
.library-metrics > a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #ffffff !important;
  background: linear-gradient(135deg, var(--indigo-600) 0%, var(--indigo-800) 100%);
  border-radius: 1.15rem;
  padding: 1.25rem;
  box-shadow: var(--shadow-indigo);
  transition: all 0.2s ease;
}
.library-metrics > a:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

/* Collections Grid */
.home-section {
  padding-top: 2.5rem;
}
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}
.section-heading h2 {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--slate-900);
  margin: 0;
}
.section-heading p {
  font-size: 0.875rem;
  color: var(--slate-500);
  margin: 0.25rem 0 0;
}
.text-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--indigo-600) !important;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.text-link:hover {
  color: var(--indigo-800) !important;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.collection-tile {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 1.15rem;
  padding: 1.5rem;
  position: relative;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
}
.collection-tile:hover {
  transform: translateY(-4px);
  border-color: var(--indigo-300);
  box-shadow: var(--shadow-md);
}
.collection-number {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--slate-300);
}
.collection-tile-icon {
  width: 46px;
  height: 46px;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, var(--indigo-50) 0%, var(--indigo-100) 100%);
  color: var(--indigo-600);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  margin-bottom: 1.15rem;
}
.collection-tile h3 {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--slate-900);
  margin-bottom: 0.5rem;
}
.collection-tile > span:last-child {
  font-size: 0.8125rem;
  color: var(--slate-500);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

/* ==========================================================================
   Book Cards & Grid Component
   ========================================================================== */
.book-grid {
  display: grid;
  gap: 1.35rem;
  grid-template-columns: repeat(4, 1fr);
}
.home-book-grid {
  grid-template-columns: repeat(6, 1fr);
  gap: 1.15rem;
}

.book-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.22s ease;
  box-shadow: var(--shadow-xs);
}
.book-card:hover {
  transform: translateY(-4px);
  border-color: var(--indigo-300);
  box-shadow: var(--shadow-lg);
}

.book-cover {
  aspect-ratio: 0.72;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 1.15rem;
  text-decoration: none !important;
  color: #ffffff !important;
}
.book-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.book-card:hover .book-cover img {
  transform: scale(1.05);
}

/* Cover Color Themes */
.book-cover.tone-0 { background: linear-gradient(145deg, #1e1b4b 0%, #4338ca 100%); }
.book-cover.tone-1 { background: linear-gradient(145deg, #0c1222 0%, #334155 100%); }
.book-cover.tone-2 { background: linear-gradient(145deg, #064e3b 0%, #0d9488 100%); }
.book-cover.tone-3 { background: linear-gradient(145deg, #312e81 0%, #6366f1 100%); }
.book-cover.tone-4 { background: linear-gradient(145deg, #78350f 0%, #d97706 100%); }

.cover-pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 12px 12px;
  opacity: 0.45;
}
.cover-badge {
  font-size: 0.625rem;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--gold-300);
  margin-bottom: 0.65rem;
  position: relative;
  z-index: 1;
}
.cover-icon {
  font-size: 1.45rem;
  opacity: 0.75;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}
.cover-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.cover-author {
  font-size: 0.6875rem;
  opacity: 0.8;
  margin-top: auto;
  position: relative;
  z-index: 1;
}

.book-copy {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.book-kind {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--indigo-700);
  background: var(--indigo-50);
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  display: inline-block;
}
.book-callno {
  font-size: 0.6875rem;
  color: var(--slate-600);
  background: var(--slate-100);
  padding: 0.15rem 0.45rem;
  border-radius: 0.3rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.book-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 0.5rem 0 0.35rem;
  min-height: 2.85em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-title a {
  color: var(--slate-900) !important;
}
.book-title a:hover {
  color: var(--indigo-600) !important;
}
.book-author {
  font-size: 0.76rem;
  color: var(--slate-500);
  margin-bottom: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.book-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-light);
}

.availability-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.availability-badge.is-available {
  color: var(--emerald-600);
}
.availability-badge.is-available .status-indicator {
  background: var(--emerald-500);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}
.availability-badge.is-unavailable {
  color: var(--slate-500);
}
.availability-badge.is-unavailable .status-indicator {
  background: var(--slate-400);
}

.btn-detail-link {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--slate-100);
  color: var(--slate-700) !important;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  transition: all 0.18s ease;
}
.btn-detail-link:hover {
  background: var(--indigo-600);
  color: #ffffff !important;
}

/* ==========================================================================
   OPAC & Staff Catalog Search (`opac/index.php` & `catalog/index.php`)
   ========================================================================== */
.catalog-intro {
  padding: 2rem 0 1.25rem;
}
.catalog-intro .eyebrow,
.dashboard-heading .eyebrow,
.service-summary .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--indigo-600);
  margin-bottom: 0.4rem;
}
.catalog-intro h1 {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 0.35rem;
}
.catalog-intro > p {
  color: var(--slate-500);
  font-size: 0.9375rem;
  margin: 0;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--slate-500);
  margin-bottom: 0.85rem;
}
.breadcrumb a {
  color: var(--slate-600) !important;
}

.catalog-search-form {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  padding: 1.35rem 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.catalog-search-line {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid var(--indigo-200);
  border-radius: 1rem;
  padding: 0.35rem 0.5rem 0.35rem 1.15rem;
  gap: 0.75rem;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.08);
  transition: all 0.2s ease;
}
.catalog-search-line:focus-within {
  background: #ffffff;
  border-color: var(--indigo-600);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.16), 0 8px 24px rgba(79, 70, 229, 0.12);
}
.catalog-search-line > i,
.catalog-search-line > svg {
  color: var(--indigo-600);
  font-size: 1.15rem;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.catalog-search-line input#catalog-query,
.catalog-search-line input[type="search"] {
  flex: 1;
  min-width: 140px;
  border: 0 !important;
  background: transparent !important;
  padding: 0.55rem 0.5rem !important;
  font-size: 1rem !important;
  font-weight: 500 !important;
  color: var(--slate-900) !important;
  outline: none !important;
  box-shadow: none !important;
}
.catalog-search-line input#catalog-query::placeholder,
.catalog-search-line input[type="search"]::placeholder {
  color: #94a3b8 !important;
  font-weight: 400 !important;
  font-size: 0.95rem !important;
  opacity: 1 !important;
}
.catalog-search-line select#search-type {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  max-width: 200px;
  height: 42px;
  border: 1px solid #cbd5e1 !important;
  border-radius: 0.625rem !important;
  background-color: #f8fafc !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 0.75rem center !important;
  background-size: 12px 10px !important;
  font-size: 0.875rem !important;
  font-weight: 500 !important;
  color: #334155 !important;
  padding: 0.45rem 2.2rem 0.45rem 0.85rem !important;
  outline: none !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.catalog-search-line select#search-type::-ms-expand {
  display: none !important;
}
.catalog-search-line select#search-type:hover {
  background-color: #f1f5f9 !important;
  border-color: #94a3b8 !important;
}
.catalog-search-line select#search-type:focus {
  border-color: var(--indigo-500) !important;
  background-color: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12) !important;
}
.catalog-search-line button,
.catalog-search-line .catalog-search-submit {
  background: linear-gradient(135deg, var(--indigo-600) 0%, var(--indigo-700) 100%) !important;
  color: #ffffff !important;
  border: 0 !important;
  border-radius: 0.65rem !important;
  padding: 0.65rem 1.6rem !important;
  font-weight: 600 !important;
  font-size: 0.95rem !important;
  cursor: pointer;
  transition: all 0.2s ease !important;
  white-space: nowrap;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.28) !important;
  min-height: 42px;
  flex-shrink: 0;
}
.catalog-search-line button:hover,
.catalog-search-line .catalog-search-submit:hover {
  background: linear-gradient(135deg, var(--indigo-700) 0%, var(--indigo-800) 100%) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.38) !important;
}
.catalog-search-line button:active,
.catalog-search-line .catalog-search-submit:active {
  transform: translateY(0);
}
.catalog-search-line button:disabled,
.catalog-search-line .catalog-search-submit:disabled,
.btn-search-loading {
  opacity: 0.92 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  background: linear-gradient(135deg, var(--indigo-700) 0%, var(--indigo-800) 100%) !important;
}

.catalog-filters {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin: 1.15rem 0 0.5rem;
  flex-wrap: wrap;
}
.catalog-filters > label:not(.availability-filter) {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  min-width: 170px;
  max-width: 260px;
}
.catalog-filters > label > span {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--slate-600);
}
.catalog-filters select {
  background: #ffffff !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 0.625rem !important;
  padding: 0.48rem 0.75rem !important;
  font-size: 0.875rem !important;
  height: 40px;
}
.availability-filter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 40px;
  cursor: pointer;
  padding: 0 0.5rem;
}
.availability-filter input {
  accent-color: var(--indigo-600);
  width: 18px;
  height: 18px;
}
.availability-filter > span {
  font-size: 0.875rem !important;
  color: var(--slate-700) !important;
  font-weight: 500;
}
.reset-filters {
  border: 1px solid var(--border-color);
  background: var(--slate-50);
  color: var(--slate-600);
  font-size: 0.8125rem !important;
  font-weight: 500;
  border-radius: 0.625rem;
  cursor: pointer;
  padding: 0.48rem 0.9rem;
  margin-left: auto;
  transition: all 0.15s ease;
}
.reset-filters:hover {
  border-color: var(--rose-200);
  background: var(--rose-50);
  color: var(--rose-600);
}

.advanced-filters {
  margin: 0.75rem 0 0.5rem;
  color: var(--slate-600);
  font-size: 0.8125rem;
}
.advanced-filters summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--indigo-600);
}
.advanced-filters > div {
  display: flex;
  gap: 1rem;
  padding-top: 0.75rem;
  flex-wrap: wrap;
}
.advanced-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 220px;
  flex: 1;
}

.catalog-toolbar {
  border-top: 1px solid var(--border-light);
  margin-top: 1rem;
  padding-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.catalog-toolbar p {
  font-size: 0.875rem;
  color: var(--slate-600);
  margin: 0;
}
.catalog-toolbar p strong {
  color: var(--slate-900);
}
.catalog-toolbar > label {
  font-size: 0.8125rem;
  color: var(--slate-600);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.catalog-toolbar select {
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.8125rem;
  background: #ffffff;
}

/* Pagination */
.catalog-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 2.5rem;
  flex-wrap: wrap;
}
.catalog-pagination a {
  min-width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-color);
  border-radius: 0.625rem;
  background: #ffffff;
  color: var(--slate-700) !important;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.15s ease;
}
.catalog-pagination a:hover {
  border-color: var(--indigo-400);
  color: var(--indigo-600) !important;
  background: var(--indigo-50);
}
.catalog-pagination a[aria-current="page"],
.catalog-pagination a.active {
  background: linear-gradient(135deg, var(--indigo-600) 0%, var(--indigo-700) 100%);
  color: #ffffff !important;
  border-color: var(--indigo-600);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}
.catalog-pagination > span {
  font-size: 0.8125rem;
  color: var(--slate-500);
  margin-left: 0.75rem;
}

.empty-state {
  grid-column: 1 / -1;
  background: #ffffff;
  border: 1.5px dashed var(--border-color);
  border-radius: 1.25rem;
  padding: 4rem 2rem;
  text-align: center;
}
.empty-state i {
  font-size: 2.75rem;
  color: var(--indigo-400);
  margin-bottom: 1rem;
}
.empty-state h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 0.5rem;
}
.empty-state p {
  color: var(--slate-500);
  font-size: 0.875rem;
  margin: 0;
}

/* ==========================================================================
   Staff Dashboard & Module Grids (`home/index`, `admin/index`, `reports/index`, `utilities/index`)
   ========================================================================== */
.dashboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.dashboard-heading h1 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 0.25rem;
}
.dashboard-heading p {
  font-size: 0.9rem;
  color: var(--slate-500);
  margin: 0;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.25rem;
}
.stat-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 1.15rem;
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}
.stat-0::after { background: linear-gradient(90deg, var(--indigo-500), var(--indigo-700)); }
.stat-1::after { background: linear-gradient(90deg, var(--emerald-500), var(--emerald-700)); }
.stat-2::after { background: linear-gradient(90deg, var(--gold-500), var(--amber-600)); }
.stat-3::after { background: linear-gradient(90deg, var(--rose-500), var(--rose-700)); }

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 0.75rem;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
}
.stat-0 .stat-card-icon { background: var(--indigo-50); color: var(--indigo-600); }
.stat-1 .stat-card-icon { background: var(--emerald-50); color: var(--emerald-600); }
.stat-2 .stat-card-icon { background: var(--gold-50); color: var(--amber-600); }
.stat-3 .stat-card-icon { background: var(--rose-50); color: var(--rose-600); }

.stat-card-title {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--slate-500);
}
.stat-card strong {
  display: block;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1.15;
  margin-bottom: 0.3rem;
}
.stat-card p {
  font-size: 0.78rem;
  color: var(--slate-500);
  margin: 0;
}

/* Quick Actions & Module Cards */
.dashboard-panel {
  margin-top: 2rem;
}
.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.quick-actions > a {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 1.15rem;
  padding: 1.4rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}
.quick-actions > a:hover {
  transform: translateY(-3px);
  border-color: var(--indigo-300);
  box-shadow: var(--shadow-md);
}
.quick-actions > a > span {
  width: 50px;
  height: 50px;
  border-radius: 0.875rem;
  background: linear-gradient(135deg, var(--indigo-50) 0%, var(--indigo-100) 100%);
  color: var(--indigo-600);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.quick-action-content {
  flex: 1;
}
.quick-action-content strong {
  display: block;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--slate-900);
  margin-bottom: 0.2rem;
}
.quick-action-content small {
  display: block;
  font-size: 0.78rem;
  color: var(--slate-500);
}
.quick-action-arrow {
  color: var(--slate-400);
  font-size: 0.875rem;
}

/* Module Grid (Admin / Reports / Utilities) */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}
.module-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 1.15rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s ease;
}
.module-card:hover {
  transform: translateY(-3px);
  border-color: var(--indigo-300);
  box-shadow: var(--shadow-md);
}
.module-icon {
  width: 46px;
  height: 46px;
  border-radius: 0.75rem;
  background: var(--indigo-50);
  color: var(--indigo-600);
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.module-icon svg {
  width: 22px;
  height: 22px;
}
.module-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--slate-900);
  margin: 0;
}
.module-card p {
  font-size: 0.84rem;
  color: var(--slate-500);
  margin: 0 0 0.75rem;
  flex: 1;
}
.module-action {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--indigo-600);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: auto;
}
.module-action svg {
  width: 15px;
  height: 15px;
}

.reports-note {
  background: linear-gradient(135deg, var(--indigo-50) 0%, #ffffff 100%);
  border: 1px solid var(--indigo-200);
  border-radius: 1rem;
  padding: 1rem 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 2rem;
  color: var(--slate-700);
  font-size: 0.875rem;
}
.reports-note svg {
  width: 22px;
  height: 22px;
  color: var(--indigo-600);
  flex-shrink: 0;
}
.reports-note b {
  margin-left: auto;
  background: #ffffff;
  color: var(--indigo-700);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  border: 1px solid var(--indigo-200);
}
.report-count {
  background: var(--navy-900);
  color: var(--gold-300);
  padding: 0.4rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
}

/* ==========================================================================
   Tables & DataTables
   ========================================================================== */
.library-ui .modern-table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
  font-size: 0.875rem;
}
.modern-table th {
  background: #f8fafc;
  color: var(--slate-700);
  font-weight: 600;
  padding: 0.9rem 1.1rem;
  text-align: left;
  border-bottom: 1.5px solid var(--border-color);
}
.modern-table td {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.modern-table tr:hover td {
  background: var(--slate-50);
}
.table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: var(--shadow-xs);
}

/* DataTables Container */
.library-ui .dt-container {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 1.15rem;
  padding: 1.25rem;
  box-shadow: var(--shadow-xs);
}
.library-ui #catalog-table {
  font-size: 0.9rem;
  min-width: 850px;
  border-collapse: separate;
  border-spacing: 0;
}
.library-ui #catalog-table th {
  white-space: nowrap;
  background: var(--slate-100);
  color: var(--slate-700);
  font-weight: 600;
  padding: 0.875rem 1rem;
  border-bottom: 2px solid var(--border-color);
}
.library-ui #catalog-table td {
  padding: 0.875rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-light);
}

/* ==========================================================================
   Circulation & Member Services (`circ/index.php`)
   ========================================================================== */
.circulation-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.operation-panel {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 1.15rem;
  padding: 2rem;
  box-shadow: var(--shadow-xs);
}
.operation-panel h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 0.25rem;
}
.operation-panel > p {
  color: var(--slate-500);
  font-size: 0.875rem;
}
.operation-search {
  margin: 1.5rem 0;
}
.operation-search > label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 0.5rem;
}
.operation-search > input {
  width: 100%;
  height: 48px;
  background: #ffffff !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem !important;
  font-size: 0.95rem !important;
}
.operation-search > .operation-search-actions,
.operation-search > div:not(.member-search-wrapper):not(#member-search-not-found) {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.operation-search select {
  flex: 1;
  border: 1px solid var(--border-color) !important;
  border-radius: 0.75rem !important;
  padding: 0.6rem 0.875rem !important;
}
.operation-search button {
  background: linear-gradient(135deg, var(--indigo-600) 0%, var(--indigo-700) 100%);
  color: #ffffff;
  border: 0;
  border-radius: 0.75rem;
  padding: 0.65rem 1.35rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
}

.service-summary {
  background: linear-gradient(145deg, var(--navy-900) 0%, var(--navy-800) 100%);
  color: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 1.15rem;
  padding: 2rem;
  box-shadow: var(--shadow-md);
}
.service-summary .eyebrow {
  color: var(--gold-300);
}
.service-summary h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 1.25rem;
}
.service-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.service-summary > div > span {
  font-size: 0.875rem;
  color: #cbd5e1;
}
.service-summary > div > strong {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gold-300);
}
.service-summary .overdue-number {
  color: #fda4af !important;
}
.service-summary p.text-muted {
  color: #94a3b8 !important;
}

/* ==========================================================================
   Staff Login Portal (`shared/loginform.php`)
   ========================================================================== */
.login-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3.5rem;
  max-width: 1020px;
  margin: 3.5rem auto;
  align-items: center;
}
.login-story .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--indigo-50);
  color: var(--indigo-700);
  border: 1px solid var(--indigo-200);
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.login-story h1 {
  font-family: var(--font-sans) !important;
  font-size: 2.35rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--slate-900);
  margin-bottom: 1rem;
}
.login-story > p {
  font-family: var(--font-sans) !important;
  color: var(--slate-600);
  font-size: 0.95rem;
  line-height: 1.8;
}
.login-illustration {
  background: linear-gradient(135deg, var(--navy-900) 0%, #1e1b4b 100%);
  color: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 1.25rem;
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-lg);
}
.login-illustration img.login-logo-img {
  width: 54px;
  height: 68px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}
.login-illustration i {
  font-size: 2.75rem;
  color: var(--gold-400);
}
.login-illustration span {
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.04em;
  line-height: 1.5;
}
.login-illustration span small {
  color: var(--gold-300) !important;
}

.login-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 1.35rem;
  padding: 2.5rem;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--navy-900), var(--indigo-600), var(--gold-500));
}
.login-lock {
  width: 52px;
  height: 52px;
  border-radius: 0.875rem;
  background: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.45);
  display: grid;
  place-items: center;
  padding: 4px;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 12px -2px rgba(12, 18, 34, 0.12);
}
.login-lock img.login-card-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.login-card h2 {
  font-family: var(--font-sans) !important;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 0.35rem;
}
.login-card > p {
  font-size: 0.875rem;
  color: var(--slate-500);
  margin-bottom: 1.75rem;
}
.login-card label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 0.4rem;
}
.login-card input {
  height: 48px;
  width: 100%;
  border: 1px solid var(--border-color) !important;
  border-radius: 0.75rem;
  padding: 0.65rem 0.95rem;
  font-size: 0.95rem;
  margin-bottom: 1.1rem;
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 48px !important;
}
.password-field > button {
  position: absolute;
  top: 0;
  right: 0.25rem;
  height: 48px;
  width: 44px;
  border: 0;
  background: transparent;
  color: var(--slate-400);
  font-size: 1.15rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: color 0.18s ease, transform 0.18s ease;
}
.password-field > button:hover {
  color: var(--indigo-600);
  transform: scale(1.08);
}
.password-field > button:active {
  transform: scale(0.95);
}
.password-field > button[aria-pressed="true"] {
  color: var(--indigo-600);
}
.login-submit {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, var(--indigo-600) 0%, var(--indigo-700) 100%);
  color: #ffffff;
  border: 0;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  cursor: pointer;
  margin-top: 0.5rem;
  box-shadow: var(--shadow-indigo);
  transition: all 0.18s ease;
}
.login-submit:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.back-to-public {
  display: block;
  text-align: center;
  margin-top: 1.35rem;
  font-size: 0.825rem;
  color: var(--slate-500) !important;
}

/* ==========================================================================
   Footer (with mandatory Develop by Anusit link)
   ========================================================================== */
.app-footer {
  background: var(--navy-950);
  color: var(--slate-300);
  border-top: 1px solid rgba(212, 175, 55, 0.22);
  padding: 2.25rem 1.5rem;
}
.footer-container {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.footer-brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 0.625rem;
  background: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.45);
  display: grid;
  place-items: center;
  padding: 3px;
  flex-shrink: 0;
}
.footer-brand-icon img.footer-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.footer-brand strong {
  display: block;
  font-size: 0.925rem;
  color: #ffffff;
}
.footer-brand span {
  display: block;
  font-size: 0.76rem;
  color: var(--slate-400);
}
.footer-center p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--slate-300);
}
.footer-meta small {
  font-size: 0.8125rem;
  color: var(--slate-400);
}
.footer-meta a {
  color: var(--gold-300) !important;
  font-weight: 600;
  text-decoration: none;
}
.footer-meta a:hover {
  color: var(--gold-200) !important;
  text-decoration: underline;
}

/* ==========================================================================
   Badges & Utility Classes
   ========================================================================== */
.library-ui .badge {
  font-weight: 600;
  padding: 0.38em 0.8em;
  border-radius: 9999px;
  font-size: 0.78rem;
}
.library-ui .badge-indigo {
  background-color: var(--indigo-100);
  color: var(--indigo-800);
}
.library-ui .badge-emerald {
  background-color: var(--emerald-100);
  color: var(--emerald-700);
}
.library-ui .badge-rose {
  background-color: var(--rose-100);
  color: var(--rose-700);
}
.library-ui .badge-slate {
  background-color: var(--slate-100);
  color: var(--slate-700);
}
.library-ui .badge-gold {
  background-color: var(--gold-100);
  color: #92400e;
}

/* ==========================================================================
   Legacy OpenBiblio Form, Table & Detail Page Modernization
   ========================================================================== */
.library-ui .app-main h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--slate-900);
  margin: 1.25rem 0 1rem;
}
.library-ui .app-main font {
  font-family: inherit;
  font-size: inherit;
}
.library-ui .app-main .error {
  color: var(--rose-600) !important;
  font-weight: 600;
}
#errorMsg {
  background: var(--rose-50);
  color: var(--rose-700);
  border: 1px solid var(--rose-200);
  border-radius: 0.75rem;
  padding: 0.85rem 1.15rem;
  margin: 1rem 0;
}

.library-ui .app-main table.primary {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-xs);
}
.library-ui .app-main table.primary th {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  color: var(--slate-800);
  font-size: 0.825rem;
  font-weight: 700;
  padding: 0.9rem 1.1rem;
  border-bottom: 1.5px solid var(--border-color);
  text-align: left;
}
.library-ui .app-main table.primary td {
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.875rem;
  vertical-align: middle;
  background: transparent;
}
.library-ui .app-main table.primary tr:last-child td {
  border-bottom: 0;
}
.library-ui .app-main table.primary tr:hover > td {
  background: var(--slate-50);
}
.library-ui .app-main table.primary tr.biblio-late > td {
  background: var(--rose-50) !important;
  color: var(--rose-700);
}

.library-ui .app-main input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]):not([type=button]),
.library-ui .app-main select,
.library-ui .app-main textarea {
  border: 1px solid #cbd5e1;
  border-radius: 0.625rem;
  padding: 0.55rem 0.85rem;
  background: #ffffff;
  color: var(--slate-800);
  font-family: inherit;
  font-size: 0.875rem;
  max-width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.library-ui .app-main input:focus,
.library-ui .app-main select:focus,
.library-ui .app-main textarea:focus {
  border-color: var(--indigo-500);
  outline: none;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

.library-ui .app-main input[type=submit]:not(.btn-cancel):not(.btn-secondary),
.library-ui .app-main input[type=button]:not(.btn-cancel):not(.btn-secondary),
.library-ui .app-main button.button:not(.btn-cancel):not(.btn-secondary),
.library-ui .app-main .button:not(.btn-cancel):not(.btn-secondary) {
  background: linear-gradient(135deg, var(--indigo-600) 0%, var(--indigo-700) 100%) !important;
  color: #ffffff !important;
  border: 1px solid var(--indigo-600) !important;
  border-radius: 0.625rem;
  padding: 0.55rem 1.2rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.22);
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
}
.library-ui .app-main input[type=submit]:not(.btn-cancel):not(.btn-secondary):hover,
.library-ui .app-main input[type=button]:not(.btn-cancel):not(.btn-secondary):hover,
.library-ui .app-main .button:not(.btn-cancel):not(.btn-secondary):hover {
  background: linear-gradient(135deg, var(--indigo-700) 0%, var(--indigo-800) 100%) !important;
  transform: translateY(-1px);
}

/* Custom Confirmation Modal */
.snru-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 18, 34, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.snru-modal-card {
  background: #ffffff;
  border-radius: 1.25rem;
  max-width: 440px;
  width: 100%;
  padding: 1.75rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-color);
  animation: snruModalIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes snruModalIn {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Toastr Customization - Positioned cleanly below top navbar */
#toast-container,
.toast-top-right {
  top: 76px !important;
  right: 24px !important;
  z-index: 999999 !important;
}
#toast-container > div,
.toast {
  font-family: 'Kanit', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  border-radius: 12px !important;
  box-shadow: 0 10px 25px -3px rgba(15, 23, 42, 0.3), 0 4px 10px -2px rgba(15, 23, 42, 0.15) !important;
  padding: 0.75rem 1.15rem 0.75rem 3.25rem !important;
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  opacity: 1 !important;
}
#toast-container > .toast-warning {
  background-color: #d97706 !important;
  color: #ffffff !important;
}
#toast-container > .toast-success {
  background-color: #059669 !important;
  color: #ffffff !important;
}
#toast-container > .toast-error {
  background-color: #dc2626 !important;
  color: #ffffff !important;
}
#toast-container > .toast-info {
  background-color: #4f46e5 !important;
  color: #ffffff !important;
}
#toast-container .toast-title {
  font-family: 'Kanit', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  margin-bottom: 0.2rem !important;
}
#toast-container .toast-message {
  font-family: 'Kanit', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 0.875rem !important;
  line-height: 1.4 !important;
  color: #ffffff !important;
}
#toast-container .toast-close-button {
  display: none !important;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1100px) {
  .home-hero {
    grid-template-columns: 1fr;
    padding: 2.5rem 2rem;
    gap: 2rem;
  }
  .hero-art {
    height: 280px;
  }
  .library-metrics,
  .collection-grid,
  .dashboard-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .home-book-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .quick-actions {
    grid-template-columns: repeat(2, 1fr);
  }
  .circulation-layout,
  .login-layout {
    grid-template-columns: 1fr;
  }
  .login-illustration {
    display: none;
  }
}

@media (max-width: 800px) {
  .public-nav,
  .header-context {
    display: none;
  }
  .menu-toggle {
    display: flex;
  }
  .mobile-public-nav.is-open {
    display: flex;
  }
  .staff-workspace {
    display: block;
  }
  .app-sidebar {
    display: none;
    width: 100%;
    position: absolute;
    z-index: 1030;
    box-shadow: var(--shadow-xl);
  }
  .app-sidebar.is-open {
    display: flex;
  }
  .staff-main {
    padding: 1.5rem 1rem;
  }
  .public-main {
    padding: 0 1rem 3rem;
  }
  .book-grid,
  .home-book-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  .quick-actions,
  .dashboard-stats,
  .library-metrics {
    grid-template-columns: 1fr;
  }
  .footer-container {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
}
/* Top URL Address Progress Bar (NProgress / YouTube / GitHub style) */
.top-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  z-index: 99999;
  pointer-events: none;
  background: transparent;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.top-progress-bar.is-active,
html[aria-busy="true"] .top-progress-bar {
  opacity: 1;
}
.top-progress-bar::before {
  content: '';
  display: block;
  height: 100%;
  width: var(--progress-width, 0%);
  background: linear-gradient(90deg, #4f46e5 0%, #fbbf24 60%, #10b981 100%);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.85), 0 0 8px rgba(79, 70, 229, 0.7);
  border-radius: 0 999px 999px 0;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.top-progress-bar.is-indeterminate::before {
  width: 45%;
  animation: topProgressSlide 1.1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes topProgressSlide {
  0% { transform: translateX(-110%); }
  50% { transform: translateX(90%); }
  100% { transform: translateX(240%); }
}


/* ==========================================================================
   Enhanced Button Animations & Ripple Micro-interactions
   ========================================================================== */
.btn, button.btn, input[type="submit"].btn, input[type="button"].btn, .button-primary, .button-outline {
  position: relative;
  overflow: hidden;
  transform: translateZ(0);
  transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  font-weight: 500;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn:hover, button.btn:hover, input[type="submit"].btn:hover, input[type="button"].btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.15);
}
.btn:active, button.btn:active, input[type="submit"].btn:active, input[type="button"].btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.38) !important;
}

/* Force bright white text on all primary buttons and search buttons */
.btn-primary,
.button-primary,
a.btn-primary,
a.btn-primary:link,
a.btn-primary:visited,
a.btn-primary:hover,
a.btn-primary:focus,
a.btn-primary:active,
a[href*="opac"].btn-primary,
a[href*="opac"].btn-primary:link,
a[href*="opac"].btn-primary:visited,
.hero-search button,
.hero-search-btn,
.catalog-search-line button,
.catalog-search-submit,
button.catalog-search-submit,
.operation-search button {
  color: #ffffff !important;
}

.btn-primary *,
.button-primary *,
a.btn-primary *,
a[href*="opac"].btn-primary *,
.hero-search button *,
.hero-search-btn *,
.catalog-search-line button *,
.catalog-search-submit *,
.operation-search button * {
  color: #ffffff !important;
}
.btn-success:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.38) !important;
}
.btn-danger:hover {
  box-shadow: 0 6px 20px rgba(225, 29, 72, 0.38) !important;
}
.btn-warning:hover {
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.38) !important;
}
.btn-gold {
  background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
  color: #0c1222 !important;
  font-weight: 600;
  border: none;
}
.btn-gold:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.45) !important;
  transform: translateY(-2px);
}

/* Secondary & Cancel Buttons */
.library-ui .app-main .btn-secondary,
.library-ui .app-main .btn-cancel,
.library-ui .app-main button.btn-secondary,
.library-ui .app-main button.btn-cancel,
.library-ui .app-main .button.btn-cancel,
.btn-secondary,
.btn-cancel,
button.btn-cancel,
.button.btn-cancel {
  background: #f8fafc !important;
  background-image: none !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 0.625rem !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}
.library-ui .app-main .btn-secondary:hover,
.library-ui .app-main .btn-cancel:hover,
.library-ui .app-main button.btn-secondary:hover,
.library-ui .app-main button.btn-cancel:hover,
.library-ui .app-main .button.btn-cancel:hover,
.btn-secondary:hover,
.btn-cancel:hover,
button.btn-cancel:hover,
.button.btn-cancel:hover {
  background: #f1f5f9 !important;
  background-image: none !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1) !important;
}
.btn-secondary span,
.btn-cancel span,
button.btn-cancel span,
.button.btn-cancel span {
  color: #334155 !important;
}
.btn-secondary:hover span,
.btn-cancel:hover span,
button.btn-cancel:hover span,
.button.btn-cancel:hover span {
  color: #0f172a !important;
}

/* Cancel Cross Icon: Rose Red Accent with Smooth Interactive Hover */
.btn-cancel i,
.btn-secondary i.fa-xmark,
.btn-secondary i.fa-times,
.library-ui .app-main .btn-cancel i,
.library-ui .app-main .btn-secondary i.fa-xmark,
.library-ui .app-main .btn-secondary i.fa-times,
button.btn-cancel i,
.button.btn-cancel i {
  color: #ef4444 !important;
  font-size: 0.95rem !important;
  display: inline-block !important;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.15s ease !important;
}
.btn-cancel:hover i,
.btn-secondary:hover i.fa-xmark,
.btn-secondary:hover i.fa-times,
.library-ui .app-main .btn-cancel:hover i,
.library-ui .app-main .btn-secondary:hover i.fa-xmark,
.library-ui .app-main .btn-secondary:hover i.fa-times,
button.btn-cancel:hover i,
.button.btn-cancel:hover i {
  color: #dc2626 !important;
  transform: rotate(90deg) scale(1.15) !important;
}

/* Uniform Button Icon alignment */
.btn i,
button i,
.button i {
  display: inline-block;
  font-size: 0.95em;
  vertical-align: middle;
  line-height: 1;
}



/* Button Loading Spinner State */
.btn.is-loading:not(.has-text),
button.btn.is-loading:not(.has-text),
input[type="submit"].btn.is-loading:not(.has-text) {
  pointer-events: none !important;
  position: relative;
  color: transparent !important;
}
.btn.is-loading:not(.has-text)::after,
button.btn.is-loading:not(.has-text)::after,
input[type="submit"].btn.is-loading:not(.has-text)::after {
  content: "";
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
  top: 50%;
  left: 50%;
  margin-top: -0.575rem;
  margin-left: -0.575rem;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: btn-spin 0.65s linear infinite;
  z-index: 15;
}
.btn.has-text,
button.btn.has-text,
.login-submit.is-loading {
  pointer-events: none !important;
  opacity: 0.92;
}
.btn.has-text::after,
.login-submit.is-loading::after {
  display: none !important;
}
.btn-outline-primary.is-loading::after,
.btn-light.is-loading::after {
  border-color: rgba(79, 70, 229, 0.25);
  border-top-color: #4f46e5;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* Pulse Glow Animation */
.btn-pulse {
  animation: btn-pulse-glow 2.2s infinite;
}
@keyframes btn-pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.45);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(79, 70, 229, 0);
  }
}

/* ==========================================================================
   SweetAlert2 Modern Styling (SNRU Royal Navy & Warm Gold)
   ========================================================================== */
.swal2-container {
  z-index: 100000 !important;
}
.swal2-container.swal2-top-end,
.swal2-container.swal2-top-right,
.swal2-container.swal2-top {
  padding: 1rem !important;
}

/* Modal Dialogs */
.swal2-popup.swal2-modal {
  font-family: 'Kanit', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  border-radius: 18px !important;
  padding: 1.75rem 2rem !important;
  box-shadow: 0 20px 45px rgba(12, 18, 34, 0.28) !important;
  border: 1px solid rgba(226, 232, 240, 0.8) !important;
}
.swal2-popup.swal2-modal .swal2-title {
  font-family: 'Kanit', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 1.35rem !important;
  font-weight: 600 !important;
  color: #0c1222 !important;
  letter-spacing: -0.01em !important;
}
.swal2-popup.swal2-modal .swal2-html-container {
  font-family: 'Kanit', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 0.96rem !important;
  color: #475569 !important;
  line-height: 1.6 !important;
}
.swal2-actions {
  margin-top: 1.5rem !important;
  gap: 0.75rem !important;
}
.swal2-styled.swal2-confirm {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
  color: #ffffff !important;
  border-radius: 10px !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  padding: 0.65rem 1.6rem !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35) !important;
  transition: all 0.2s ease !important;
}
.swal2-styled.swal2-confirm:hover {
  background: linear-gradient(135deg, #4338ca 0%, #312e81 100%) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.45) !important;
}
.swal2-styled.swal2-cancel {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  padding: 0.65rem 1.4rem !important;
  transition: all 0.2s ease !important;
}
.swal2-styled.swal2-cancel:hover {
  background: #e2e8f0 !important;
  color: #1e293b !important;
}

/* ==========================================================================
   SweetAlert2 Toast Styling — Compact, Sleek, Beautiful Kanit Typography
   ========================================================================== */
.swal2-popup.swal2-toast,
.snru-toast-popup {
  font-family: 'Kanit', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  border-radius: 12px !important;
  padding: 0.55rem 0.85rem !important;
  box-shadow: 0 10px 25px -3px rgba(15, 23, 42, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.05) !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.55rem !important;
  width: auto !important;
  max-width: 380px !important;
  min-height: auto !important;
}

.swal2-popup.swal2-toast .swal2-title,
.swal2-toast .swal2-title,
.snru-toast-title,
h2.swal2-title:where(.swal2-toast *) {
  font-family: 'Kanit', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 0.9rem !important;
  font-weight: 400 !important;
  color: #1e293b !important;
  line-height: 1.45 !important;
  letter-spacing: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 1 1 auto !important;
  text-align: left !important;
}

.swal2-popup.swal2-toast .swal2-html-container,
.swal2-toast .swal2-html-container,
.snru-toast-html {
  font-family: 'Kanit', 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 0.825rem !important;
  color: #64748b !important;
  line-height: 1.4 !important;
  margin: 0.15rem 0 0 0 !important;
  padding: 0 !important;
}

/* Use SweetAlert's own em-based geometry for complete success/error icons. */
.swal2-popup.swal2-toast .swal2-icon { flex-shrink:0; }

.swal2-popup.swal2-toast .swal2-timer-progress-bar,
.swal2-toast .swal2-timer-progress-bar {
  height: 3px !important;
  border-radius: 0 0 12px 12px !important;
  opacity: 0.85 !important;
}
.swal2-popup.swal2-toast.swal2-icon-error .swal2-timer-progress-bar {
  background: #f43f5e !important;
}
.swal2-popup.swal2-toast.swal2-icon-success .swal2-timer-progress-bar {
  background: #10b981 !important;
}
.swal2-popup.swal2-toast.swal2-icon-warning .swal2-timer-progress-bar {
  background: #f59e0b !important;
}
.swal2-popup.swal2-toast.swal2-icon-info .swal2-timer-progress-bar {
  background: #6366f1 !important;
}

/* ==========================================================================
   Selectpicker Custom Modern Styling
   ========================================================================== */
.bootstrap-select > .dropdown-toggle {
  height: 42px;
  border-radius: 10px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #0c1222 !important;
  font-size: 0.925rem;
  padding: 0.5rem 0.85rem !important;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
}
.bootstrap-select > .dropdown-toggle:hover {
  border-color: #94a3b8 !important;
  background: #f8fafc !important;
}
.bootstrap-select > .dropdown-toggle:focus,
.bootstrap-select.show > .dropdown-toggle {
  border-color: #d4af37 !important;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2) !important;
  outline: none !important;
}
.bootstrap-select .dropdown-menu {
  border-radius: 14px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14) !important;
  padding: 0.5rem !important;
  font-family: inherit;
}
.bootstrap-select .bs-searchbox {
  padding: 0.4rem 0.5rem 0.6rem !important;
}
.bootstrap-select .bs-searchbox .form-control {
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  font-size: 0.875rem !important;
  padding: 0.45rem 0.75rem !important;
}
.bootstrap-select .dropdown-menu li a {
  border-radius: 8px !important;
  padding: 0.55rem 0.85rem !important;
  font-size: 0.9rem !important;
  color: #334155 !important;
  transition: all 0.15s ease;
}
.bootstrap-select .dropdown-menu li a:hover,
.bootstrap-select .dropdown-menu li.active a {
  background: #eef2ff !important;
  color: #4338ca !important;
  font-weight: 500 !important;
}

/* ==========================================================================
   Datetimepicker & Flatpickr Custom Styling
   ========================================================================== */
.flatpickr-calendar {
  border-radius: 16px !important;
  box-shadow: 0 16px 36px rgba(12, 18, 34, 0.18) !important;
  border: 1px solid #e2e8f0 !important;
  font-family: 'Kanit', 'Noto Sans Thai', sans-serif !important;
  padding: 0.4rem !important;
}
.flatpickr-months {
  border-radius: 12px 12px 0 0 !important;
  background: #0c1222 !important;
  color: #ffffff !important;
  padding: 0.4rem 0 !important;
}
.flatpickr-months .flatpickr-month {
  color: #ffffff !important;
  fill: #ffffff !important;
}
.flatpickr-current-month .numInputWrapper span.arrowUp:after {
  border-bottom-color: #d4af37 !important;
}
.flatpickr-current-month .numInputWrapper span.arrowDown:after {
  border-top-color: #d4af37 !important;
}
.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
  fill: #d4af37 !important;
}
.flatpickr-day {
  border-radius: 10px !important;
  font-weight: 500 !important;
  color: #1e293b !important;
  transition: all 0.15s ease !important;
}
.flatpickr-day:hover {
  background: #e2e8f0 !important;
}
.flatpickr-day.today {
  border-color: #d4af37 !important;
}
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
  border-color: #4f46e5 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35) !important;
}
.flatpickr-day.inRange {
  background: #eef2ff !important;
  border-color: #eef2ff !important;
  color: #4338ca !important;
}
.flatpickr-time {
  border-top: 1px solid #f1f5f9 !important;
  border-radius: 0 0 12px 12px !important;
}
/* Bootstrap datetimepicker fallback support */
.bootstrap-datetimepicker-widget {
  border-radius: 14px !important;
  box-shadow: 0 14px 34px rgba(12, 18, 34, 0.16) !important;
  border: 1px solid #e2e8f0 !important;
  font-family: inherit !important;
}


/* ==========================================================================
   Icon Spinner & Action Button Animations
   ========================================================================== */
@keyframes iconSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.fa-spin,
.icon-spin {
  animation: iconSpin 0.85s infinite linear !important;
  display: inline-block;
}
.btn .fa-spin,
button .fa-spin {
  display: inline-block;
  vertical-align: -0.1em;
}
.btn-search-loading {
  pointer-events: none !important;
  opacity: 0.92 !important;
  transition: all 0.2s ease !important;
}
.login-submit.has-text {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
}

/* Author search interactive links */
.author-search-link,
.author-link {
  color: var(--indigo-600, #4f46e5) !important;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer;
}
.author-search-link:hover,
.author-link:hover {
  color: var(--indigo-800, #3730a3) !important;
  text-decoration: underline !important;
}
.author-search-link i {
  color: var(--indigo-600, #4f46e5) !important;
}
.author-search-link:hover i {
  color: var(--indigo-800, #3730a3) !important;
}


/* ==========================================================================
   About Page & Library Information Styles (หน้าเกี่ยวกับห้องสมุด)
   ========================================================================== */
.about-page {
  padding-bottom: 2rem;
}
.about-intro {
  background: linear-gradient(135deg, rgba(238, 242, 255, 0.75) 0%, rgba(248, 250, 252, 0.95) 100%);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}
.quick-info-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
}
.quick-info-pill i {
  font-size: 1.25rem;
}
.quick-info-pill small {
  display: block;
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.2;
}
.quick-info-pill strong {
  display: block;
  color: #0f172a;
  font-weight: 600;
  line-height: 1.3;
}
.about-hero-seal {
  background: linear-gradient(145deg, #0c1222 0%, #1e1b4b 100%);
  border: 2px solid rgba(212, 175, 55, 0.35);
  border-radius: 24px;
  padding: 2rem 1.5rem;
  box-shadow: 0 16px 36px rgba(12, 18, 34, 0.18);
  display: inline-block;
  width: 100%;
  max-width: 260px;
  text-align: center;
}
.about-seal-img {
  max-height: 130px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.35));
  transition: transform 0.3s ease;
}
.about-hero-seal:hover .about-seal-img {
  transform: scale(1.04);
}
.about-seal-caption {
  display: block;
  margin-top: 0.85rem;
  color: #d4af37;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.badge-indigo {
  display: inline-flex;
  align-items: center;
  background: rgba(79, 70, 229, 0.1);
  color: #4338ca;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  letter-spacing: 0.3px;
}
.vision-card {
  background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
  border: 1px solid #e0e7ff !important;
  border-left: 5px solid #4f46e5 !important;
  border-radius: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.vision-card:hover, .mission-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08) !important;
}
.mission-card {
  background: linear-gradient(180deg, #fffdf8 0%, #ffffff 100%);
  border: 1px solid #fef3c7 !important;
  border-left: 5px solid #d4af37 !important;
  border-radius: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feature-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.bg-indigo-50 { background-color: #eef2ff !important; }
.text-indigo { color: #4f46e5 !important; }
.bg-gold-50 { background-color: #fffbeb !important; }
.text-gold { color: #d4af37 !important; }
.bg-rose-50 { background-color: #fff1f2 !important; }
.text-rose-600 { color: #e11d48 !important; }

.service-box {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  background: #ffffff;
}
.service-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(12, 18, 34, 0.1) !important;
  border-color: #c7d2fe;
}
.service-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(79, 70, 229, 0.08);
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  transition: all 0.25s ease;
}
.service-box:hover .service-icon {
  background: #4f46e5;
  color: #ffffff;
  transform: scale(1.05);
}
.rule-item {
  transition: all 0.2s ease;
}
.rule-item:hover {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
}
.contact-location-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%);
  border-radius: 20px;
}

/* ==========================================================================
   Circulation Member Live Search (jQuery AJAX Autocomplete)
   ========================================================================== */
.member-search-wrapper {
  position: relative;
  width: 100%;
}
.member-search-wrapper > input,
.operation-search > .member-search-wrapper > input {
  width: 100%;
  height: 50px;
  background: #ffffff !important;
  border: 1.5px solid var(--border-color) !important;
  border-radius: 0.85rem !important;
  padding: 0.75rem 2.85rem 0.75rem 1rem !important;
  font-size: 0.95rem !important;
  font-family: var(--font-sans) !important;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}
.member-search-wrapper > input:focus,
.operation-search > .member-search-wrapper > input:focus {
  border-color: var(--indigo-600) !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15), 0 4px 12px rgba(79, 70, 229, 0.08) !important;
  outline: none;
}
.member-search-spinner {
  position: absolute;
  top: 50%;
  right: 1.15rem;
  transform: translateY(-50%);
  color: var(--indigo-600);
  font-size: 1.1rem;
  pointer-events: none;
  z-index: 5;
}
.member-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 14px;
  box-shadow: 0 20px 40px -6px rgba(12, 18, 34, 0.16), 0 8px 16px -4px rgba(12, 18, 34, 0.08);
  z-index: 1050;
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  font-family: var(--font-sans) !important;
  animation: memberDropdownSlide 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes memberDropdownSlide {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.member-search-list {
  padding: 0.35rem 0;
}
.member-search-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  text-decoration: none !important;
  color: var(--slate-900) !important;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  position: relative;
  cursor: pointer;
}
.member-search-item:last-child {
  border-bottom: 0;
}
.member-search-item:hover,
.member-search-item.is-selected {
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.07) 0%, rgba(212, 175, 55, 0.05) 100%) !important;
  border-left: 3px solid var(--indigo-600);
  padding-left: calc(1rem - 3px);
}
.member-item-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--indigo-50);
  color: var(--indigo-600);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  border: 1px solid var(--indigo-100);
}
.member-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.member-item-avatar .status-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid #ffffff;
}
.member-item-avatar .status-indicator.is-active {
  background: #10b981;
}
.member-item-avatar .status-indicator.is-inactive {
  background: #94a3b8;
}
.member-item-info {
  flex: 1 1 auto;
  min-width: 0;
}
.member-item-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 0.2rem;
}
.member-item-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.badge-barcode {
  display: inline-flex;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 600;
  background: #f1f5f9;
  color: #334155;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  letter-spacing: 0.02em;
}
.badge-class {
  font-size: 0.78rem;
  color: #64748b;
}
.member-item-action {
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.member-search-item:hover .member-item-action,
.member-search-item.is-selected .member-item-action {
  opacity: 1;
  transform: translateX(2px);
}
.member-item-action .action-hint {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--indigo-600);
  background: rgba(79, 70, 229, 0.08);
  padding: 4px 9px;
  border-radius: 6px;
}
mark.match-highlight {
  background: rgba(254, 240, 138, 0.75);
  color: #0f172a;
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 700;
}
.member-search-footer {
  padding: 0.55rem 1rem;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  border-radius: 0 0 14px 14px;
  font-size: 0.78rem;
}
.member-search-empty {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--slate-600);
}

#member-search-not-found {
  background: #fffbeb !important;
  border: 1px solid #fde68a !important;
  color: #92400e !important;
  font-size: 0.88rem !important;
  border-radius: 0.75rem !important;
  padding: 0.75rem 1rem !important;
  margin-top: 0.75rem !important;
  margin-bottom: 0.25rem !important;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
#member-search-not-found .not-found-msg {
  color: #92400e !important;
  font-weight: 500;
}
#member-search-not-found .not-found-msg strong {
  color: #78350f !important;
  font-weight: 700;
}

/* Keep staff navigation within the visible workspace. */
.staff-ui .header-inner {
  max-width: none;
  gap: 1.5rem;
}
.staff-ui .brand-text {
  min-width: 0;
}
.staff-ui .brand-text small {
  max-width: 30rem;
  line-height: 1.4;
}
.staff-ui .header-context {
  min-width: 0;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.staff-ui .context-badge,
.staff-ui .header-actions {
  flex-shrink: 0;
}
.nav-icon-box {
  flex-shrink: 0;
}
@media (min-width: 801px) {
  .staff-ui .app-sidebar {
    position: sticky;
    top: 78px;
    align-self: flex-start;
    height: calc(100vh - 78px);
    height: calc(100dvh - 78px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #475569 #0c1222;
  }
  .staff-ui .app-sidebar > * {
    flex-shrink: 0;
  }
}
@media (min-width: 801px) and (max-width: 1100px) {
  .staff-ui .header-context .context-badge,
  .staff-ui .context-separator {
    display: none;
  }
  .staff-ui .header-inner {
    gap: 1rem;
  }
}
@media (max-width: 800px) {
  .staff-ui .header-inner {
    padding-inline: 1rem;
    gap: 0.75rem;
  }
  .staff-ui .brand {
    flex: 1;
    min-width: 0;
    gap: 0.6rem;
  }
  .staff-ui .brand-text small {
    font-size: 0.65rem;
  }
  .staff-ui .user-meta {
    display: none;
  }
  .staff-ui .app-sidebar {
    position: fixed;
    top: 78px;
    bottom: 0;
    max-height: calc(100dvh - 78px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* Dark staff navbar */
.staff-ui .app-header { background: #0c1222; border-bottom-color: #293247; }
.staff-ui .brand-text strong { color: #f8fafc; }
.staff-ui .brand-text strong > span { background: linear-gradient(135deg, #c4b5fd, #fcd34d); background-clip: text; -webkit-background-clip: text; }
.staff-ui .brand-text small { color: #cbd5e1; }
.staff-ui .profile-menu > summary { background: #182237; border-color: #334155; }
.staff-ui .app-header .user-name { color: #f8fafc; }
.staff-ui .app-header .user-role, .staff-ui .profile-menu > summary .text-muted { color: #cbd5e1 !important; }
.staff-ui .menu-toggle { color: #f8fafc; border-color: #475569; background: #182237; }

/* Compact AdminLTE-style footer for staff pages. */
.admin-footer {
  background: #fff;
  border-top: 1px solid #dee2e6;
  color: #64748b;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem 1.5rem;
  font-size: .8125rem;
  line-height: 1.6;
}
.admin-footer-copyright { display: flex; flex-wrap: wrap; gap: .25rem .75rem; }
.admin-footer-copyright strong { color: #475569; font-weight: 600; }
.admin-footer a { color: #4f46e5; text-decoration: none; font-weight: 600; }
.admin-footer a:hover { color: #3730a3; text-decoration: underline; }
.admin-footer-credit { white-space: nowrap; }
.public-footer { padding-block: 1.5rem; }
.public-footer .footer-meta { display: flex; flex-direction: column; gap: .25rem; text-align: right; }
@media (max-width: 800px) {
  .admin-footer { padding: 1rem; align-items: flex-start; flex-direction: column; }
  .public-footer .footer-meta { text-align: center; }
  .public-footer .footer-brand span { max-width: 24rem; }
}

/* Staff sidebar spans the content and its adjoining footer. */
.sidebar-content { display: flex; flex-direction: column; gap: 1.25rem; min-height: 0; }
@media (min-width: 801px) {
  .staff-ui .staff-workspace {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr);
    grid-template-rows: 1fr auto;
    min-height: calc(100vh - 78px);
    min-height: calc(100dvh - 78px);
  }
  .staff-ui .app-sidebar {
    grid-column: 1;
    grid-row: 1 / -1;
    position: static;
    align-self: stretch;
    height: auto;
    padding: 0;
    overflow: visible;
    display: block;
  }
  .staff-ui .sidebar-content {
    position: sticky;
    top: 78px;
    height: calc(100vh - 78px);
    height: calc(100dvh - 78px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #475569 #0c1222;
    padding: 1.5rem 1rem;
  }
  .staff-ui .sidebar-content > * { flex-shrink: 0; }
  .staff-ui .staff-main { grid-column: 2; grid-row: 1; width: 100%; }
  .staff-ui .admin-footer { grid-column: 2; grid-row: 2; margin: 0; }
}
@media (max-width: 800px) {
  .staff-ui .sidebar-content { min-height: 100%; }
}

/* Preserve icon fonts on spans generated by plugins such as selectpicker. */
.fa, .fas, .fa-solid, .far, .fa-regular {
  font-family: "Font Awesome 6 Free" !important;
  font-style: normal;
  letter-spacing: normal;
}
.fa, .fas, .fa-solid { font-weight: 900; }
.far, .fa-regular { font-weight: 400; }
.fab, .fa-brands {
  font-family: "Font Awesome 6 Brands" !important;
  font-weight: 400;
  font-style: normal;
  letter-spacing: normal;
}

/* Let the emblem sit directly on the navbar without a square backing. */
.brand-mark {
  width: 48px;
  height: 60px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.brand:hover .brand-mark { box-shadow: none; }
.brand-mark img.brand-logo-img {
  width: 100%;
  height: 100%;
  max-height: 60px;
  object-fit: contain;
}

/* Keep navbar branding still during hover, clicks, and navigation. */
.app-header .brand,
.app-header .brand-mark,
.app-header .brand-logo-img {
  animation: none !important;
  transition: none !important;
  transform: none !important;
}

/* Hide waves from any previously registered click handlers until a reload. */
.btn-ripple-wave { display: none !important; }

.circulation-layout.circulation-search-only { grid-template-columns: minmax(0, 1fr); }

/* Circulation actions live with the page content. */
.page-section-nav {
  position: relative;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1.25rem 1rem 1rem 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.03);
}

.page-section-nav-badge {
  position: absolute;
  top: -11px;
  left: 1.25rem;
  background: #ffffff;
  padding: 0.12rem 0.65rem;
  font-family: var(--font-heading, 'Kanit', sans-serif);
  font-size: 0.75rem;
  font-weight: 700;
  color: #4f46e5;
  border: 1px solid #cbd5e1;
  border-radius: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.35;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
  letter-spacing: 0.03em;
  user-select: none;
  z-index: 2;
}

.page-section-nav-title { color: #64748b; font-size: .8rem; margin-bottom: .65rem; font-weight: 500; }
.page-section-nav-title i { color: #4f46e5; margin-right: .4rem; }

.page-section-nav .context-nav-inner ul {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  gap: 0.65rem !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  align-items: center !important;
}

.page-section-nav .context-nav-inner li {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 0;
}

/* Inactive button */
.page-section-nav .context-nav-inner li > a {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  padding: 0.55rem 1.05rem !important;
  font-family: var(--font-heading, 'Kanit', sans-serif) !important;
  font-size: 0.88rem !important;
  font-weight: 500 !important;
  color: #334155 !important;
  background: #ffffff !important;
  border: 1.5px solid #e2e8f0 !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

.page-section-nav .context-nav-inner li > a i {
  font-size: 0.95rem !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Hover state */
.page-section-nav .context-nav-inner li > a:hover {
  color: #4338ca !important;
  background: linear-gradient(135deg, #ffffff 0%, #f5f7ff 100%) !important;
  border-color: #c7d2fe !important;
  transform: translateY(-1.5px) !important;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.14) !important;
}

.page-section-nav .context-nav-inner li > a:hover i {
  transform: scale(1.18) !important;
}

/* Active button */
.page-section-nav .context-nav-inner li.active {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  padding: 0.55rem 1.15rem !important;
  font-family: var(--font-heading, 'Kanit', sans-serif) !important;
  font-size: 0.88rem !important;
  font-weight: 600 !important;
  color: #ffffff !important;
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
  border: 1.5px solid transparent !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.32) !important;
  white-space: nowrap !important;
}

.page-section-nav .context-nav-inner li.active i {
  font-size: 0.95rem !important;
  color: #ffffff !important;
}

@media (max-width: 600px) {
  .page-section-nav .context-nav-inner li { flex: 1 1 calc(50% - .5rem); }
  .page-section-nav .context-nav-inner li > a { width: 100%; justify-content: center; }
  .page-section-nav .context-nav-inner li.active { width: 100%; justify-content: center; }
}

/* ==========================================================================
   Executive Luxury Admin Dashboard Styles
   ========================================================================== */
.admin-hub-container {
  max-width: 1360px;
  margin: 0 auto;
  padding-bottom: 3rem;
  font-family: var(--font-sans, 'Noto Sans Thai', sans-serif);
}

/* Executive Hero Banner */
.admin-hero-card {
  background: linear-gradient(135deg, #0c1222 0%, #1e293b 100%);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-top: 4px solid #d4af37;
  border-radius: 1.35rem;
  padding: 2rem 2.25rem;
  color: #ffffff;
  box-shadow: 0 12px 32px -4px rgba(12, 18, 34, 0.25), 0 4px 12px rgba(12, 18, 34, 0.15);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}
.admin-hero-card::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.12) 0%, transparent 70%);
  pointer-events: none;
}
.admin-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #d4af37;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.admin-hero-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.5rem 0;
  font-family: var(--font-heading, 'Kanit', sans-serif);
  line-height: 1.3;
}
.admin-hero-subtitle {
  color: #94a3b8;
  font-size: 0.95rem;
  max-width: 720px;
  margin: 0 0 1.25rem 0;
  line-height: 1.6;
}
.admin-hero-badges {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.admin-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 2rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #e2e8f0;
  backdrop-filter: blur(4px);
}
.admin-hero-pill.is-gold {
  background: rgba(212, 175, 55, 0.15);
  border-color: rgba(212, 175, 55, 0.4);
  color: #fef08a;
}
.admin-hero-pill.is-green {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: #6ee7b7;
}

/* Key Metrics Summary Grid */
.admin-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.25rem;
}
.admin-metric-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 1.15rem;
  padding: 1.25rem 1.4rem;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.admin-metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -4px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}
.admin-metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--metric-color, #4f46e5);
}
.admin-metric-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.admin-metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.admin-metric-val {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
  font-family: var(--font-heading, 'Kanit', sans-serif);
}
.admin-metric-val small {
  font-size: 0.85rem;
  font-weight: 400;
  color: #64748b;
  margin-left: 0.25rem;
}
.admin-metric-desc {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.25rem;
}

/* Category Sections */
.admin-category-section {
  margin-bottom: 2.25rem;
}
.admin-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.15rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid #e2e8f0;
}
.admin-category-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.admin-category-icon {
  width: 34px;
  height: 34px;
  border-radius: 0.6rem;
  background: #eef2ff;
  color: #4f46e5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.admin-category-title h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  font-family: var(--font-heading, 'Kanit', sans-serif);
}
.admin-category-count {
  font-size: 0.825rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.25rem 0.65rem;
  border-radius: 1rem;
}

/* Luxury Module Cards */
.admin-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}
.admin-luxury-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 1.25rem;
  padding: 1.5rem;
  text-decoration: none !important;
  color: inherit !important;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.admin-luxury-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px -4px rgba(12, 18, 34, 0.09), 0 4px 10px rgba(12, 18, 34, 0.04);
  border-color: #cbd5e1;
}
.admin-luxury-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--card-accent, #4f46e5);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.admin-luxury-card:hover::after {
  opacity: 1;
}

.admin-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.admin-icon-box {
  width: 50px;
  height: 50px;
  border-radius: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease;
}
.admin-luxury-card:hover .admin-icon-box {
  transform: scale(1.06);
}
.admin-badge-pill {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 1rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.admin-card-body h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.35rem 0;
  font-family: var(--font-heading, 'Kanit', sans-serif);
}
.admin-card-body p {
  font-size: 0.86rem;
  color: #64748b;
  margin: 0;
  line-height: 1.5;
  flex: 1;
}

.admin-card-footer {
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--card-accent, #4f46e5);
}
.admin-card-footer i {
  transition: transform 0.2s ease;
}
.admin-luxury-card:hover .admin-card-footer i {
  transform: translateX(4px);
}

@media (max-width: 1024px) {
  .admin-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .admin-hero-card {
    padding: 1.5rem 1.25rem;
  }
  .admin-hero-title {
    font-size: 1.5rem;
  }
  .admin-metrics-grid {
    grid-template-columns: 1fr;
  }
  .admin-module-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Utilities / Print Forms Modernization
   ========================================================================== */
.utility-print-page {
  max-width: 960px;
  margin: 0.5rem auto 2.5rem;
}
.utility-header {
  margin-bottom: 1.75rem;
}
.utility-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--slate-800);
}
.utility-header p {
  color: var(--slate-500);
  margin-bottom: 0;
  font-size: 0.925rem;
}
.utility-form-card {
  background: #ffffff;
  border: 1px solid var(--slate-200);
  border-radius: 1rem;
  box-shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.05), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  overflow: hidden;
}
.utility-form-card .card-header {
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--slate-200);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.utility-form-card .card-body {
  padding: 1.75rem 1.5rem;
}
.utility-field-group {
  margin-bottom: 1.5rem;
}
.utility-field-group label {
  display: block;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 0.5rem;
  font-size: 0.925rem;
}
.utility-field-group textarea.form-control,
.utility-field-group select.form-select,
.utility-field-group input.form-control {
  border: 1px solid var(--slate-300);
  border-radius: 0.625rem;
  padding: 0.625rem 0.875rem;
  font-size: 0.925rem;
  color: var(--slate-800);
  background-color: #ffffff;
  width: 100%;
  transition: all 0.18s ease;
}
.utility-field-group textarea.form-control:focus,
.utility-field-group select.form-select:focus,
.utility-field-group input.form-control:focus {
  border-color: var(--indigo-500);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
  outline: none;
}
.utility-field-group textarea::-webkit-input-placeholder,
.utility-field-group input::-webkit-input-placeholder,
.form-control::-webkit-input-placeholder,
textarea::-webkit-input-placeholder,
input::-webkit-input-placeholder {
  color: #cbd5e1 !important;
  opacity: 1 !important;
  font-weight: 300 !important;
  font-size: 0.875rem !important;
  line-height: 1.6 !important;
}
.utility-field-group textarea::-moz-placeholder,
.utility-field-group input::-moz-placeholder,
.form-control::-moz-placeholder,
textarea::-moz-placeholder,
input::-moz-placeholder {
  color: #cbd5e1 !important;
  opacity: 1 !important;
  font-weight: 300 !important;
  font-size: 0.875rem !important;
  line-height: 1.6 !important;
}
.utility-field-group textarea::placeholder,
.utility-field-group input::placeholder,
.form-control::placeholder,
textarea::placeholder,
input::placeholder {
  color: #cbd5e1 !important;
  opacity: 1 !important;
  font-weight: 300 !important;
  font-size: 0.875rem !important;
  line-height: 1.6 !important;
}
.utility-field-group .form-text {
  font-size: 0.8125rem;
  color: #a8b3cf !important;
  margin-top: 0.4rem;
}
.utility-field-group .form-text i {
  color: #a8b3cf !important;
}

/* Modern Datepicker Styling */
.date-select-group {
  display: block;
  width: 100%;
}
.modern-datepicker-group {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  width: 100% !important;
  border: 1px solid #cbd5e1;
  border-radius: 0.625rem !important;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  background-color: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.modern-datepicker-group:focus-within {
  border-color: #4f46e5 !important;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1) !important;
}
.modern-datepicker-group .input-group-text {
  flex: 0 0 auto !important;
  background-color: #f8fafc !important;
  border: none !important;
  border-right: 1px solid #f1f5f9 !important;
  color: #4f46e5 !important;
  padding: 0.55rem 0.85rem !important;
  font-size: 0.95rem;
  border-radius: 0 !important;
}
.modern-datepicker-group input.form-control,
.modern-datepicker-group input.modern-date-input {
  flex: 1 1 auto !important;
  width: 1% !important;
  min-width: 0 !important;
  border: none !important;
  font-size: 0.925rem;
  padding: 0.55rem 0.85rem !important;
  color: #1e293b;
  background-color: #ffffff !important;
  cursor: pointer;
  box-shadow: none !important;
  border-radius: 0 !important;
}
.modern-datepicker-group .btn-clear-date {
  flex: 0 0 auto !important;
  border: none !important;
  border-left: 1px solid #f1f5f9 !important;
  background-color: #ffffff;
  padding: 0.55rem 0.85rem !important;
  color: #94a3b8;
  border-radius: 0 !important;
  transition: all 0.15s ease;
}
.modern-datepicker-group .btn-clear-date:hover {
  background-color: #fee2e2 !important;
  color: #ef4444 !important;
}
.modern-datepicker-group .btn-clear-date:hover i {
  color: #ef4444 !important;
}

/* Flatpickr Calendar Styling */
.flatpickr-calendar {
  padding: 8px !important;
  background: #ffffff;
  border: 1px solid #e2e8f0 !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 36px -8px rgba(15, 23, 42, 0.22) !important;
  font-family: 'Kanit', 'Noto Sans Thai', sans-serif !important;
  font-size: 14px;
}
.flatpickr-calendar:not(.multiMonth) {
  width: 308px !important;
  max-width: calc(100vw - 24px);
}
.flatpickr-calendar:not(.multiMonth) .flatpickr-innerContainer,
.flatpickr-calendar:not(.multiMonth) .flatpickr-rContainer,
.flatpickr-calendar:not(.multiMonth) .flatpickr-days,
.flatpickr-calendar:not(.multiMonth) .dayContainer {
  width: 100% !important;
  min-width: 0;
  max-width: 100%;
}
.flatpickr-calendar .flatpickr-months {
  position: relative;
  background: #0f172a !important;
  border-radius: 10px !important;
  padding: 6px 0 !important;
  margin-bottom: 6px;
  color: #ffffff !important;
}
.flatpickr-calendar .flatpickr-month {
  height: 34px;
  color: #ffffff !important;
  fill: #ffffff !important;
}
.flatpickr-calendar .flatpickr-current-month {
  height: 34px;
  padding-top: 5px;
  font-size: 15px;
  font-weight: 500;
}
.flatpickr-calendar .flatpickr-monthDropdown-months,
.flatpickr-calendar input.cur-year {
  color: #ffffff !important;
  background: transparent;
  font-size: 15px;
  font-weight: 500 !important;
  border-radius: 5px;
}
.flatpickr-calendar .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month {
  background: #0f172a;
  color: #ffffff;
}
.flatpickr-calendar .flatpickr-prev-month,
.flatpickr-calendar .flatpickr-next-month {
  top: 7px;
  height: 32px;
  width: 32px;
  padding: 9px;
  border-radius: 8px;
}
.flatpickr-calendar .flatpickr-prev-month:hover,
.flatpickr-calendar .flatpickr-next-month:hover {
  background: rgba(255, 255, 255, 0.12);
}
.flatpickr-calendar .flatpickr-prev-month svg,
.flatpickr-calendar .flatpickr-next-month svg {
  width: 14px;
  height: 14px;
  fill: #fbbf24 !important;
}
.flatpickr-calendar .flatpickr-weekdays {
  height: 30px;
  background: #f8fafc !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 6px;
  margin-bottom: 4px;
}
.flatpickr-calendar span.flatpickr-weekday {
  color: #64748b !important;
  font-size: 12px;
  font-weight: 500 !important;
}
.flatpickr-calendar .flatpickr-day {
  flex-basis: 14.285714%;
  max-width: none;
  height: 36px;
  line-height: 34px;
  margin: 2px 0;
  border-radius: 8px !important;
  font-size: 13px;
  font-weight: 400 !important;
  box-shadow: none !important;
}
.flatpickr-calendar .flatpickr-day:hover,
.flatpickr-calendar .flatpickr-day:focus {
  background: #eef2ff !important;
  border-color: #eef2ff !important;
}
.flatpickr-calendar .flatpickr-day.today {
  border-color: #c7d2fe !important;
  color: #4338ca !important;
  font-weight: 600 !important;
}
.flatpickr-calendar .flatpickr-day.prevMonthDay,
.flatpickr-calendar .flatpickr-day.nextMonthDay,
.flatpickr-calendar .flatpickr-day.flatpickr-disabled {
  color: #94a3b8 !important;
}
.flatpickr-calendar .flatpickr-day.selected,
.flatpickr-calendar .flatpickr-day.startRange,
.flatpickr-calendar .flatpickr-day.endRange,
.flatpickr-calendar .flatpickr-day.selected:hover {
  background: #4f46e5 !important;
  border-color: #4f46e5 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
}

/* Form Actions */
.utility-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--slate-100);
  margin-top: 1.5rem;
}
.utility-form-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  border-radius: 0.625rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.925rem;
}

/* ==========================================================================
   Modern Reports Design System (`reports/report_criteria.php`, `run_report.php`)
   ========================================================================== */
.report-criteria-page,
.report-results-page {
  max-width: 100%;
}

.rpt_params {
  width: 100%;
  max-width: 780px;
  border-collapse: separate;
  border-spacing: 0 0.85rem;
}
.rpt_params tr.rpt_param td:first-child {
  width: 250px;
  font-weight: 600;
  color: var(--slate-700);
  vertical-align: middle;
  padding-right: 1.25rem;
  font-size: 0.925rem;
}
.rpt_params tr.rpt_param td:last-child {
  vertical-align: middle;
}
.rpt_params input[type="text"],
.rpt_params input[type="date"],
.rpt_params select {
  width: 100%;
  max-width: 480px;
  padding: 0.55rem 0.85rem;
  font-size: 0.925rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  background-color: #fff;
  color: #1e293b;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.rpt_params input[type="text"]:focus,
.rpt_params input[type="date"]:focus,
.rpt_params select:focus {
  border-color: #6366f1;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.modern-report-table {
  font-size: 0.915rem;
  border-collapse: separate;
  border-spacing: 0;
}
.modern-report-table th {
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.modern-report-table td {
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}
.modern-report-table tbody tr:hover td {
  background-color: #f8fafc;
}

@media print {
  .app-sidebar,
  .app-header,
  .page-section-nav,
  .ci-breadcrumb,
  .dashboard-heading .d-flex.gap-2,
  .card-footer,
  .pagination,
  .btn,
  .skip-link,
  #top-progress-bar {
    display: none !important;
  }
  .staff-ui .staff-main {
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }
  .card {
    border: none !important;
    box-shadow: none !important;
  }
  .modern-report-table th,
  .modern-report-table td {
    padding: 6px 8px !important;
    font-size: 10pt !important;
    border-bottom: 1px solid #ddd !important;
  }
}



