/* ============================================================
   DLRL KRC â€” Koha Reports
   Professional institutional theme (AdminLTE 3 + Bootstrap 4)
   ============================================================ */

:root {
  --krc-ink: #0c1e2e;
  --krc-navy: #14324a;
  --krc-navy-mid: #1c4563;
  --krc-accent: #0e7490;
  --krc-accent-hover: #0a5f75;
  --krc-surface: #f0f3f7;
  --krc-surface-2: #e4eaf1;
  --krc-card: #ffffff;
  --krc-border: #d3dce6;
  --krc-border-soft: #e8eef4;
  --krc-text: #1a2332;
  --krc-muted: #5c6b7a;
  --krc-danger: #b91c1c;
  --krc-danger-hover: #991b1b;
  --krc-success: #047857;
  --krc-radius: 6px;
  --krc-shadow: 0 1px 2px rgba(12, 30, 46, 0.04), 0 4px 12px rgba(12, 30, 46, 0.05);
  --krc-sidebar-w: 250px;
  --font-sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
}

/* ---------- App shell ---------- */
body.koha-app {
  font-family: var(--font-sans) !important;
  background: var(--krc-surface);
  color: var(--krc-text);
  font-size: 0.925rem;
  -webkit-font-smoothing: antialiased;
}

body.koha-app .wrapper {
  background: transparent;
}

/* ---------- Top navbar ---------- */
body.koha-app .main-header.navbar {
  background: var(--krc-card);
  border-bottom: 1px solid var(--krc-border);
  box-shadow: none;
  min-height: 52px;
  padding: 0 0.75rem;
}

body.koha-app .main-header .nav-link {
  color: var(--krc-navy) !important;
}

body.koha-app .main-header .nav-link:hover {
  color: var(--krc-accent) !important;
}

body.koha-app .navbar-brand-inline {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-left: 0.25rem;
  text-decoration: none;
}

body.koha-app .navbar-brand-inline .brand-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--krc-ink);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

body.koha-app .navbar-brand-inline .brand-sub {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--krc-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.koha-app .navbar-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--krc-surface);
  border: 1px solid var(--krc-border);
  color: var(--krc-navy);
  font-size: 0.8rem;
  font-weight: 500;
}

body.koha-app .navbar-user-chip i {
  color: var(--krc-accent);
  font-size: 0.85rem;
}

/* ---------- Sidebar ---------- */
body.koha-app .main-sidebar {
  width: var(--krc-sidebar-w);
  background:
    linear-gradient(180deg, #0a1824 0%, var(--krc-ink) 42%, #0b1c2a 100%) !important;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

body.koha-app .brand-link {
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.95rem 1rem;
  display: flex;
  align-items: center;
}

body.koha-app .brand-link .brand-image {
  box-shadow: none !important;
  opacity: 1 !important;
  margin-top: -2px;
}

body.koha-app .brand-link .brand-text {
  font-weight: 600;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  color: #fff !important;
}

body.koha-app .sidebar {
  padding: 0.65rem 0.7rem 1.25rem;
}

body.koha-app .nav-sidebar .nav-header {
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 1.1rem 1.1rem 0.4rem;
}

/* Base links (fallback) */
body.koha-app .nav-sidebar .nav-link {
  color: rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-left: 0;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

body.koha-app .nav-sidebar .nav-link p {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
}

body.koha-app .nav-sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

body.koha-app .nav-sidebar .nav-link.active {
  background: rgba(14, 116, 144, 0.28);
  color: #fff;
}

body.koha-app .nav-sidebar .nav-icon {
  color: rgba(255, 255, 255, 0.5);
  width: 1.35rem;
  font-size: 0.85rem;
  margin-right: 0.35rem;
}

body.koha-app .nav-sidebar .nav-link:hover .nav-icon,
body.koha-app .nav-sidebar .nav-link.active .nav-icon {
  color: #5eead4;
}

@media (min-width: 768px) {
  body.koha-app:not(.sidebar-mini-md) .content-wrapper,
  body.koha-app:not(.sidebar-mini-md) .main-footer {
    margin-left: var(--krc-sidebar-w);
  }

  body.koha-app:not(.sidebar-mini-md) .main-header {
    margin-left: var(--krc-sidebar-w);
  }
}

/* ---------- Content area ---------- */
body.koha-app .content-wrapper {
  background:
    linear-gradient(180deg, #e8eef4 0%, var(--krc-surface) 120px);
  min-height: calc(100vh - 52px);
}

body.koha-app .content-header {
  padding: 1.15rem 0 0.35rem;
}

body.koha-app .content-header h1 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--krc-ink);
  margin: 0;
  letter-spacing: -0.01em;
}

body.koha-app .content-header .report-lead {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--krc-muted);
  max-width: 42rem;
  line-height: 1.45;
}

body.koha-app .breadcrumb {
  background: transparent;
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
}

body.koha-app .breadcrumb-item a {
  color: var(--krc-accent);
}

body.koha-app .breadcrumb-item.active {
  color: var(--krc-muted);
}

body.koha-app .content {
  padding-top: 0.5rem;
}

/* ---------- Report card ---------- */
body.koha-app .report-card {
  border: 1px solid var(--krc-border);
  border-radius: var(--krc-radius);
  box-shadow: var(--krc-shadow);
  background: var(--krc-card);
  overflow: visible; /* allow datepicker dropdown to show fully */
  margin-bottom: 1.5rem;
}

body.koha-app .report-card > .card-body,
body.koha-app .filter-panel,
body.koha-app .filter-row {
  overflow: visible;
}

body.koha-app .report-card > .card-header {
  background: var(--krc-card);
  color: var(--krc-ink);
  border-bottom: 1px solid var(--krc-border-soft);
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

body.koha-app .report-card > .card-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--krc-accent);
}

body.koha-app .report-card > .card-header {
  position: relative;
  padding-left: 1.35rem;
}

body.koha-app .report-card .card-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--krc-ink);
  letter-spacing: 0.01em;
}

body.koha-app .report-card .card-title-meta {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--krc-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

body.koha-app .report-card .card-body {
  padding: 1.25rem 1.35rem 1.5rem;
}

/* ---------- Filters ---------- */
body.koha-app .filter-panel,
body.koha-app .filter-row {
  background: var(--krc-surface);
  border: 1px solid var(--krc-border-soft);
  border-radius: var(--krc-radius);
  padding: 1rem 1.1rem 0.85rem;
  margin-left: 0;
  margin-right: 0;
  margin-bottom: 1.15rem;
}

body.koha-app .filter-row .form-group {
  margin-bottom: 0.85rem;
}

body.koha-app .filter-row .form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--krc-muted);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body.koha-app .filter-row .form-control,
body.koha-app .filter-row .select2-container--bootstrap4 .select2-selection {
  border-color: var(--krc-border);
  border-radius: 4px;
  font-size: 0.875rem;
  min-height: 38px;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.koha-app .filter-row .form-control:focus {
  border-color: var(--krc-accent);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.15);
}

body.koha-app .lac-member-codes > label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--krc-navy);
  margin-bottom: 0.35rem;
}

body.koha-app .lac-member-codes .form-control-sm {
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

body.koha-app .filter-row .btn-report-search {
  margin-top: 0.15rem;
}

/* ---------- Buttons ---------- */
body.koha-app .btn-report-search,
body.koha-app .btn-report-pdf,
body.koha-app .btn-report-excel,
body.koha-app .btn-report-word {
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  min-width: 100px;
  padding: 0.45rem 0.9rem;
  border-radius: 4px;
  border: none;
  box-shadow: none;
}

body.koha-app .btn-report-search {
  background: var(--krc-accent);
  color: #fff;
}

body.koha-app .btn-report-search:hover,
body.koha-app .btn-report-search:focus {
  background: var(--krc-accent-hover);
  color: #fff;
}

body.koha-app .btn-report-pdf {
  background: transparent;
  color: var(--krc-danger);
  border: 1px solid var(--krc-danger);
}

body.koha-app .btn-report-pdf:hover,
body.koha-app .btn-report-pdf:focus {
  background: var(--krc-danger);
  color: #fff;
  border-color: var(--krc-danger);
}

body.koha-app .btn-report-excel {
  background: transparent;
  color: #0f766e;
  border: 1px solid #0f766e;
}

body.koha-app .btn-report-excel:hover,
body.koha-app .btn-report-excel:focus {
  background: #0f766e;
  color: #fff;
}

body.koha-app .btn-report-word {
  background: transparent;
  color: #1d4ed8;
  border: 1px solid #1d4ed8;
}

body.koha-app .btn-report-word:hover,
body.koha-app .btn-report-word:focus {
  background: #1d4ed8;
  color: #fff;
}

body.koha-app .report-results-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

body.koha-app .report-results-toolbar .report-summary {
  margin-bottom: 0;
}

body.koha-app .report-export-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  margin-left: auto;
}

body.koha-app .report-export-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--krc-muted);
  margin-right: 0.15rem;
}

body.koha-app .export-preview-wrap {
  border: 1px solid var(--krc-border);
  border-radius: var(--krc-radius);
  overflow: hidden;
  background: #fff;
}

body.koha-app .export-preview-head {
  padding: 0.85rem 1.1rem;
  background: var(--krc-surface);
  border-bottom: 1px solid var(--krc-border-soft);
}

body.koha-app .export-preview-head h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--krc-ink);
}

body.koha-app .export-preview-head p {
  font-size: 0.8rem;
  color: var(--krc-muted);
  margin-top: 0.2rem;
}

body.koha-app .export-preview-frame {
  max-height: 640px;
  overflow: auto;
  padding: 1.25rem;
  background: #f8fafc;
  transform-origin: top left;
}

body.koha-app .export-preview-frame .ndc-wrap {
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  margin: 0 auto;
  max-width: 720px;
}

body.koha-app .export-preview-frame table {
  background: #fff;
}

/* ---------- Summary + table ---------- */
body.koha-app .report-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--krc-muted);
  margin-bottom: 0.85rem;
  padding: 0.4rem 0.75rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 4px;
  color: var(--krc-success);
}

body.koha-app .report-summary strong {
  color: var(--krc-ink);
  font-weight: 700;
}

body.koha-app .table-report {
  width: 100% !important;
  font-size: 0.8125rem;
  margin-bottom: 0 !important;
  border-color: var(--krc-border) !important;
}

body.koha-app .table-report thead th {
  background: #f7f9fc;
  color: var(--krc-ink);
  border-bottom: 2px solid var(--krc-border) !important;
  border-top: none !important;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.65rem 0.75rem;
  vertical-align: middle;
}

body.koha-app .table-report tbody td {
  padding: 0.55rem 0.75rem;
  vertical-align: middle;
  color: var(--krc-text);
  border-color: var(--krc-border-soft) !important;
}

/* DataTables controls must always show (search / length / info / pagination) */
body.koha-app .report-datatable-wrap {
  width: 100%;
  clear: both;
  margin-top: 0.5rem;
  overflow-x: auto;
}

body.koha-app .dataTables_wrapper {
  width: 100% !important;
  clear: both;
  display: block !important;
  visibility: visible !important;
}

body.koha-app .dataTables_wrapper .row {
  display: flex !important;
  flex-wrap: wrap;
  margin-left: -7.5px;
  margin-right: -7.5px;
}

body.koha-app .dataTables_wrapper .row > [class*="col-"] {
  padding-left: 7.5px;
  padding-right: 7.5px;
}

body.koha-app div.dataTables_wrapper div.dataTables_length,
body.koha-app div.dataTables_wrapper div.dataTables_filter,
body.koha-app div.dataTables_wrapper div.dataTables_info,
body.koha-app div.dataTables_wrapper div.dataTables_paginate {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  font-size: 0.875rem;
  color: var(--krc-muted);
  margin: 0.5rem 0;
}

body.koha-app div.dataTables_wrapper div.dataTables_filter {
  text-align: right;
}

body.koha-app div.dataTables_wrapper div.dataTables_filter label,
body.koha-app div.dataTables_wrapper div.dataTables_length label {
  display: inline-flex !important;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  font-weight: 500;
}

body.koha-app div.dataTables_wrapper div.dataTables_filter input {
  display: inline-block !important;
  width: auto !important;
  min-width: 14rem;
  margin-left: 0.35rem;
  border: 1px solid var(--krc-border);
  border-radius: 4px;
  padding: 0.35rem 0.55rem;
}

body.koha-app div.dataTables_wrapper div.dataTables_length select {
  display: inline-block !important;
  width: auto !important;
  min-width: 4.5rem;
  margin: 0 0.35rem;
}

body.koha-app div.dataTables_wrapper div.dataTables_paginate {
  text-align: right;
}

body.koha-app div.dataTables_wrapper div.dataTables_paginate ul.pagination {
  display: inline-flex !important;
  margin: 0;
  justify-content: flex-end;
}

/* Single table layout — header and body scroll together */
body.koha-app .dataTables_wrapper .table-report {
  width: 100% !important;
  margin-bottom: 0;
}

body.koha-app .dataTables_wrapper .dataTables_scroll,
body.koha-app .dataTables_wrapper .dataTables_scrollHead,
body.koha-app .dataTables_wrapper .dataTables_scrollBody {
  overflow: visible !important;
  max-height: none !important;
}

body.koha-app .table-report.table-striped tbody tr:nth-of-type(odd) {
  background-color: #fafbfc;
}

body.koha-app .table-report.table-hover tbody tr:hover {
  background-color: #eef6f9;
}

body.koha-app .dataTables_wrapper .page-item.active .page-link {
  background-color: var(--krc-accent);
  border-color: var(--krc-accent);
}

body.koha-app .dataTables_wrapper .page-link {
  color: var(--krc-navy);
}

body.koha-app .report-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--krc-muted);
  font-size: 0.9rem;
  border: 1px dashed var(--krc-border);
  border-radius: var(--krc-radius);
  background: var(--krc-surface);
  margin-top: 0.5rem;
}

body.koha-app .report-empty i {
  display: block;
  font-size: 1.75rem;
  color: var(--krc-border);
  margin-bottom: 0.65rem;
}

/* ---------- Footer ---------- */
body.koha-app .main-footer {
  background: var(--krc-card);
  border-top: 1px solid var(--krc-border);
  color: var(--krc-muted);
  font-size: 0.8rem;
  padding: 0.85rem 1.25rem;
}

body.koha-app .main-footer a {
  color: var(--krc-navy);
  font-weight: 600;
}

body.koha-app .main-footer a:hover {
  color: var(--krc-accent);
}

/* ============================================================
   Login
   ============================================================ */
body.koha-login {
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-sans);
  display: flex;
  background: var(--krc-surface);
  -webkit-font-smoothing: antialiased;
}

body.koha-login .login-aside {
  display: none;
  flex: 1 1 48%;
  background:
    radial-gradient(ellipse 80% 60% at 50% 30%, rgba(255, 255, 255, 0.14), transparent 60%),
    linear-gradient(165deg, #0a2740 0%, #0f3a5c 45%, #0e5f7a 100%);
  color: #fff;
  padding: 2.5rem 3rem;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
}

body.koha-login .login-aside-brand {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  text-align: center;
}

body.koha-login .login-logo-badge {
  width: min(280px, 58vw);
  height: min(280px, 58vw);
  max-width: 300px;
  max-height: 300px;
  border-radius: 50%;
  background: #ffffff;
  padding: 0.85rem;
  box-shadow:
    0 0 0 6px rgba(255, 255, 255, 0.35),
    0 0 0 12px rgba(94, 234, 212, 0.25),
    0 16px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.75rem;
}

body.koha-login .login-logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
  display: block;
}

body.koha-login .login-aside-inner {
  position: relative;
  z-index: 1;
}

body.koha-login .login-aside h1 {
  font-size: 2.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0;
  line-height: 1.05;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

body.koha-login .login-aside .aside-krc {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  margin: 0.4rem 0 0.85rem;
  color: #5eead4;
  text-transform: uppercase;
}

body.koha-login .login-aside .aside-lead {
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  max-width: 22rem;
  margin: 0 auto;
}

body.koha-login .login-aside .aside-foot {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.04em;
  text-align: center;
  margin-top: 1.5rem;
}

body.koha-login .login-main {
  flex: 1 1 52%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

body.koha-login .login-shell {
  width: 100%;
  max-width: 380px;
}

body.koha-login .login-mobile-brand {
  text-align: center;
  margin-bottom: 1.5rem;
}

body.koha-login .login-mobile-brand .mobile-logo {
  width: 72px;
  height: auto;
  margin-bottom: 0.75rem;
  display: inline-block;
}

body.koha-login .login-mobile-brand h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--krc-ink);
  margin: 0;
  letter-spacing: 0.08em;
}

body.koha-login .login-mobile-brand p {
  margin: 0.2rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--krc-accent);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

body.koha-login .login-panel {
  background: var(--krc-card);
  border: 1px solid var(--krc-border);
  border-radius: 10px;
  padding: 1.75rem 1.5rem 1.6rem;
  box-shadow: var(--krc-shadow);
}

body.koha-login .login-panel h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--krc-ink);
  margin: 0 0 0.35rem;
}

body.koha-login .login-panel .login-msg {
  color: var(--krc-muted);
  margin-bottom: 1.35rem;
  font-size: 0.875rem;
}

body.koha-login .login-panel label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--krc-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}

body.koha-login .login-panel .form-control {
  border-color: var(--krc-border);
  border-radius: 4px;
  height: 42px;
  font-size: 0.9rem;
}

body.koha-login .login-panel .form-control:focus {
  border-color: var(--krc-accent);
  box-shadow: 0 0 0 3px rgba(14, 116, 144, 0.15);
}

body.koha-login .input-group-text {
  background: var(--krc-surface);
  border-color: var(--krc-border);
  color: var(--krc-muted);
}

body.koha-login .btn-login {
  width: 100%;
  background: var(--krc-ink);
  border: none;
  font-weight: 600;
  padding: 0.65rem;
  border-radius: 4px;
  margin-top: 0.35rem;
  letter-spacing: 0.02em;
}

body.koha-login .btn-login:hover,
body.koha-login .btn-login:focus {
  background: var(--krc-accent);
}

body.koha-login .alert {
  font-size: 0.85rem;
  border-radius: 4px;
}

@media (min-width: 900px) {
  body.koha-login .login-aside {
    display: flex;
  }

  body.koha-login .login-mobile-brand {
    display: none;
  }
}

/* ---------- Datepicker (jQuery UI) ---------- */
body.koha-app .js-date-wrap {
  position: relative;
}

body.koha-app .js-date-wrap .form-control {
  border-right: 0;
}

body.koha-app .js-date-wrap .input-group-text {
  background: #fff;
  border-color: var(--krc-border);
  color: var(--krc-accent);
  cursor: pointer;
}

body.koha-app .js-date-wrap .form-control:focus {
  box-shadow: none;
  border-color: var(--krc-accent);
}

body.koha-app .js-date-wrap:focus-within .input-group-text,
body.koha-app .js-date-wrap:focus-within .form-control {
  border-color: var(--krc-accent);
}

#ui-datepicker-div {
  z-index: 10050 !important;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  border: 1px solid var(--krc-border);
  border-radius: var(--krc-radius);
  box-shadow: 0 8px 24px rgba(12, 30, 46, 0.18);
  padding: 0.35rem;
  background: #fff;
}

#ui-datepicker-div .ui-datepicker-header {
  background: var(--krc-surface);
  border: 1px solid var(--krc-border-soft);
  color: var(--krc-ink);
  border-radius: 4px;
  font-weight: 600;
}

#ui-datepicker-div .ui-datepicker-calendar th {
  color: var(--krc-muted);
  font-weight: 600;
  font-size: 0.7rem;
}

#ui-datepicker-div .ui-state-default {
  background: #fff;
  border: 1px solid transparent;
  color: var(--krc-text);
  text-align: center;
}

#ui-datepicker-div .ui-state-hover {
  background: var(--krc-surface);
  border-color: var(--krc-border-soft);
  color: var(--krc-ink);
}

#ui-datepicker-div .ui-state-active {
  background: var(--krc-accent) !important;
  border-color: var(--krc-accent) !important;
  color: #fff !important;
}

#ui-datepicker-div .ui-datepicker-today .ui-state-default {
  border-color: var(--krc-accent);
}

/* When picker is appended to body (legacy Tempus styles kept harmless) */
.bootstrap-datetimepicker-widget.dropdown-menu {
  z-index: 10050 !important;
}

body.koha-app .bootstrap-datetimepicker-widget {
  font-family: var(--font-sans);
  border: 1px solid var(--krc-border);
  border-radius: var(--krc-radius);
  box-shadow: 0 8px 24px rgba(12, 30, 46, 0.18);
  padding: 0.35rem;
  z-index: 10050 !important;
}

body.koha-app .bootstrap-datetimepicker-widget table td,
body.koha-app .bootstrap-datetimepicker-widget table th {
  text-shadow: none;
}

body.koha-app .bootstrap-datetimepicker-widget table td.day:hover,
body.koha-app .bootstrap-datetimepicker-widget table td.hour:hover,
body.koha-app .bootstrap-datetimepicker-widget table td.minute:hover,
body.koha-app .bootstrap-datetimepicker-widget table td.second:hover {
  background: var(--krc-surface);
}

body.koha-app .bootstrap-datetimepicker-widget table td.active,
body.koha-app .bootstrap-datetimepicker-widget table td.active:hover {
  background-color: var(--krc-accent) !important;
  color: #fff;
  text-shadow: none;
}

body.koha-app .bootstrap-datetimepicker-widget table td.today:before {
  border-bottom-color: var(--krc-accent);
}

body.koha-app .bootstrap-datetimepicker-widget .picker-switch,
body.koha-app .bootstrap-datetimepicker-widget .prev,
body.koha-app .bootstrap-datetimepicker-widget .next {
  color: var(--krc-navy);
}

/* ---------- Admin / RBAC tables ---------- */
body.koha-app .admin-table thead th,
body.koha-app .perm-matrix thead th {
  background: var(--krc-surface);
  border-bottom: 1px solid var(--krc-border);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--krc-muted);
  font-weight: 600;
  white-space: nowrap;
}

body.koha-app .btn-xs {
  padding: 0.2rem 0.4rem;
  font-size: 0.75rem;
  line-height: 1.2;
}

/* ---------- Report loading overlay (table / after Submit only) ---------- */
body.koha-app .report-table-stage {
  position: relative;
  min-height: 120px;
}

body.koha-app .report-results-wrap {
  position: relative;
}

body.koha-app .krc-report-loading {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(240, 243, 247, 0.82);
  border-radius: var(--krc-radius);
  transition: opacity 0.2s ease;
}

body.koha-app .krc-report-loading.is-hidden,
body.koha-app .krc-page-loading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.koha-app .krc-page-loading {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 30, 46, 0.28);
  transition: opacity 0.2s ease;
}

body.koha-app .krc-report-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.75rem;
  background: var(--krc-card);
  border: 1px solid var(--krc-border);
  border-radius: var(--krc-radius);
  box-shadow: var(--krc-shadow);
  color: var(--krc-navy);
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 280px;
  max-width: min(420px, 92vw);
}

body.koha-app .krc-report-loading-inner .fa-spin {
  font-size: 1.75rem;
  color: var(--krc-accent);
}

body.koha-app .krc-export-panel .krc-export-msg {
  text-align: center;
  line-height: 1.35;
}

body.koha-app .krc-export-progress {
  width: 100%;
  margin-top: 0.15rem;
}

body.koha-app .krc-export-progress.is-hidden {
  display: none;
}

body.koha-app .krc-export-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(12, 30, 46, 0.08);
  overflow: hidden;
}

body.koha-app .krc-export-bar-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--krc-accent), #2f6fed);
  transition: width 0.35s ease;
}

body.koha-app .krc-export-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--krc-muted, #5b6b7c);
}

body.koha-app .krc-export-detail,
body.koha-app .krc-export-finish {
  margin-top: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--krc-muted, #5b6b7c);
  text-align: center;
  line-height: 1.35;
}

body.koha-app .select2-container .select2-selection--multiple {
  min-height: 38px !important;
}

/* ---------- Sidebar accordion (parent / child) ---------- */
body.koha-app .krc-side-nav {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 72px);
}

body.koha-app .krc-nav-label {
  margin: 0.15rem 0.45rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

body.koha-app .krc-nav-accordion {
  gap: 0.35rem;
}

body.koha-app .krc-nav-group {
  margin: 0 0 0.35rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

body.koha-app .krc-nav-group.menu-open {
  background: rgba(14, 116, 144, 0.12);
  border-color: rgba(45, 212, 191, 0.22);
}

body.koha-app .krc-nav-parent {
  display: flex !important;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.7rem !important;
  color: rgba(255, 255, 255, 0.92) !important;
  background: transparent !important;
  border-radius: 0 !important;
}

body.koha-app .krc-nav-parent:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

body.koha-app .krc-nav-group.menu-open > .krc-nav-parent,
body.koha-app .krc-nav-parent.active {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #fff !important;
}

body.koha-app .krc-nav-parent-icon {
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.07);
  color: #5eead4;
  font-size: 0.82rem;
}

body.koha-app .krc-nav-group.menu-open .krc-nav-parent-icon {
  background: rgba(45, 212, 191, 0.18);
  color: #99f6e4;
}

body.koha-app .krc-nav-parent p {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
  margin: 0 !important;
}

body.koha-app .krc-nav-parent-text {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

body.koha-app .krc-nav-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

body.koha-app .krc-nav-count {
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.25rem;
  text-align: center;
}

body.koha-app .krc-nav-chevron {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.45);
  transition: transform 0.2s ease;
}

body.koha-app .krc-nav-group.menu-open .krc-nav-chevron {
  transform: rotate(180deg);
  color: #5eead4;
}

/* Hide AdminLTE default angle icon if present */
body.koha-app .krc-nav-parent .right {
  display: none !important;
}

body.koha-app .krc-nav-children {
  margin: 0 !important;
  padding: 0.15rem 0.45rem 0.55rem 0.7rem !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.18);
}

body.koha-app .krc-nav-children > .nav-item {
  margin: 0;
}

body.koha-app .krc-nav-child {
  position: relative;
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  margin: 0.15rem 0 !important;
  padding: 0.48rem 0.65rem 0.48rem 0.55rem !important;
  border-radius: 7px !important;
  color: rgba(255, 255, 255, 0.72) !important;
  background: transparent !important;
  font-size: 0.84rem;
}

body.koha-app .krc-nav-child p {
  margin: 0 !important;
  font-size: 0.84rem !important;
  font-weight: 500;
  line-height: 1.25;
}

body.koha-app .krc-nav-child-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  flex-shrink: 0;
}

body.koha-app .krc-nav-child:hover {
  background: rgba(255, 255, 255, 0.07) !important;
  color: #fff !important;
}

body.koha-app .krc-nav-child:hover .krc-nav-child-dot {
  background: #5eead4;
}

body.koha-app .krc-nav-child.active {
  background: rgba(45, 212, 191, 0.16) !important;
  color: #fff !important;
  box-shadow: inset 2px 0 0 #2dd4bf;
}

body.koha-app .krc-nav-child.active .krc-nav-child-dot {
  background: #2dd4bf;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.2);
}

body.koha-app .krc-nav-account {
  margin-top: auto;
  padding-top: 1rem;
}

body.koha-app .krc-nav-logout {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0.15rem;
  padding: 0.65rem 0.8rem;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(185, 28, 28, 0.12);
  color: #fecaca;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

body.koha-app .krc-nav-logout:hover {
  background: rgba(185, 28, 28, 0.22);
  color: #fff;
  text-decoration: none;
}

body.koha-app .krc-nav-logout i {
  width: 1rem;
  text-align: center;
  opacity: 0.9;
}

