/* ==========================================================================
   OLM Admin — design system
   --------------------------------------------------------------------------
   Replaces the Material Dashboard theme (446 KB of BS4 CSS plus its demo
   sheet). Bootstrap 5 supplies the component base; this file supplies the
   shell, the OLM palette and the component skin, and a small compatibility
   layer for the Bootstrap 4 utility names still present in the module views.

   Light only. There is deliberately no dark mode.
   ========================================================================== */

:root {
  --olm-primary: #910742;
  --olm-primary-dark: #6d0531;
  --olm-primary-light: #b02a5f;
  --olm-primary-soft: #f7e9ef;
  --olm-secondary: #881e23;
  --olm-accent: #f0a500;

  --olm-ink: #2b1f23;
  --olm-body: #4a3b40;
  --olm-muted: #7d6c71;
  --olm-line: #e8dbdf;
  --olm-line-soft: #f1e8eb;
  --olm-surface: #ffffff;
  --olm-bg: #fff9f0;

  --olm-good: #1e8e5a;
  --olm-warn: #d98324;
  --olm-bad: #c0392b;
  --olm-info: #2b6cb0;

  --olm-sidebar-w: 264px;
  --olm-topbar-h: 62px;
  /* Inset of the sticky header from the window edges. */
  --olm-gutter: 12px;
  --olm-radius: 12px;
  --olm-radius-sm: 9px;
  --olm-shadow: 0 2px 10px rgba(43, 31, 35, .06);
  --olm-shadow-lg: 0 12px 32px rgba(43, 31, 35, .12);

  --olm-font: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Force light rendering even when the OS asks for dark. */
html { color-scheme: light; }

body {
  margin: 0;
  font-family: var(--olm-font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--olm-body);
  background: var(--olm-bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { color: var(--olm-ink); font-weight: 700; }
a { color: var(--olm-primary); text-decoration: none; }
a:hover { color: var(--olm-secondary); text-decoration: none; }

/* ==========================================================================
   Shell
   ========================================================================== */

.olm-shell { min-height: 100vh; }

/* Header spans the full width above everything; the sidebar and the content
   sit side by side beneath it. */
.olm-body { display: flex; align-items: flex-start; }

.olm-sidebar {
  position: sticky;
  top: calc(var(--olm-topbar-h) + var(--olm-gutter) * 2);
  flex: none;
  width: var(--olm-sidebar-w);
  height: calc(100vh - var(--olm-topbar-h) - var(--olm-gutter) * 2);
  background: var(--olm-surface);
  border-right: 1px solid var(--olm-line);
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: margin-left .28s cubic-bezier(0.16, 1, 0.3, 1), transform .28s ease, opacity .25s ease, visibility .28s ease;
}

.olm-nav {
  padding-left: 20px;
}

.olm-shell.sidebar-collapsed .olm-sidebar {
  margin-left: calc(-1 * var(--olm-sidebar-w)) !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.olm-floating-collapse-btn {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 52px;
  background: var(--olm-primary, #910742);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-left: none;
  border-radius: 0 10px 10px 0;
  box-shadow: 2px 0 10px rgba(145, 7, 66, 0.22), 0 2px 6px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1060;
  padding: 0;
  transition: width 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}

.olm-floating-collapse-btn:hover {
  background: var(--olm-primary-dark, #6d0531);
  width: 28px;
  box-shadow: 3px 0 14px rgba(145, 7, 66, 0.35);
}

.olm-floating-collapse-btn .material-icons,
.olm-floating-collapse-btn i {
  font-size: 20px;
  line-height: 1;
  color: #ffffff;
  transition: transform 0.28s ease;
}

.olm-shell:not(.sidebar-collapsed) .olm-floating-collapse-btn .material-icons,
.olm-shell:not(.sidebar-collapsed) .olm-floating-collapse-btn i {
  transform: rotate(180deg);
}

.olm-shell.sidebar-collapsed .olm-floating-collapse-btn .material-icons,
.olm-shell.sidebar-collapsed .olm-floating-collapse-btn i {
  transform: rotate(0deg);
}

@media (max-width: 991.98px) {
  .olm-floating-collapse-btn {
    display: none !important;
  }
}

.olm-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: calc(100vh - var(--olm-topbar-h) - var(--olm-gutter) * 2);
  display: flex;
  flex-direction: column;
  transition: width .28s ease, max-width .28s ease;
}

.olm-shell.sidebar-collapsed .olm-main {
  width: 100% !important;
  max-width: 100% !important;
}

.olm-content { flex: 1 0 auto; padding: 22px; }

/* ==========================================================================
   Brand (in the header)
   ========================================================================== */

.olm-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex: none;
  text-decoration: none;
}

.olm-brand img {
  height: 38px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
  object-position: left center;
}

.olm-brand-tag {
  flex: none;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--olm-primary);
  background: #f6e3ea;
  border-radius: 20px;
  padding: 3px 9px;
}

.olm-topbar-divider {
  flex: none;
  width: 1px;
  height: 26px;
  background: var(--olm-line);
}

.olm-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 10px 24px;
}

.olm-nav::-webkit-scrollbar { width: 7px; }
.olm-nav::-webkit-scrollbar-thumb { background: #ddcdd4; border-radius: 4px; }
.olm-nav::-webkit-scrollbar-thumb:hover { background: #c9b3bc; }

.olm-nav-section {
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .9px;
  text-transform: uppercase;
  color: #a8969c;
  padding: 16px 12px 7px;
}

.olm-nav-section:first-child { padding-top: 6px; }

/* Top level item: either a direct link or a group toggle. */
.olm-nav-link,
.olm-nav-toggle {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: none;
  border-radius: var(--olm-radius-sm);
  color: var(--olm-body);
  font-size: .845rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}

.olm-nav-link:hover,
.olm-nav-toggle:hover {
  background: #f7edf1;
  color: var(--olm-primary);
}

.olm-nav-link .material-icons,
.olm-nav-toggle .material-icons {
  font-size: 20px;
  flex: none;
  color: var(--olm-muted);
  transition: color .16s ease;
}

.olm-nav-link:hover .material-icons,
.olm-nav-toggle:hover .material-icons { color: var(--olm-primary); }

.olm-nav-label { flex: 1 1 auto; min-width: 0; }

.olm-nav-caret {
  font-size: 19px !important;
  color: #b9a6ac !important;
  transition: transform .2s ease;
}

.olm-nav-toggle[aria-expanded="true"] .olm-nav-caret { transform: rotate(180deg); }

/* Active states */
.olm-nav-link.is-active {
  background: var(--olm-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(145, 7, 66, .26);
}

.olm-nav-link.is-active .material-icons { color: #fff; }

.olm-nav-toggle.is-open,
.olm-nav-toggle.is-current {
  color: var(--olm-primary);
  font-weight: 600;
}

.olm-nav-toggle.is-current .material-icons { color: var(--olm-primary); }

/* Submenu */
.olm-subnav { list-style: none; margin: 2px 0 6px; padding: 0 0 0 16px; position: relative; }

.olm-subnav::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--olm-line);
  border-radius: 1px;
}

.olm-subnav a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px 8px 20px;
  border-radius: var(--olm-radius-sm);
  font-size: .81rem;
  color: var(--olm-body);
  position: relative;
}

.olm-subnav a::before {
  content: "";
  position: absolute;
  left: 1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--olm-line);
  border: 2px solid var(--olm-surface);
  transition: background .16s ease;
}

.olm-subnav a:hover { background: #f7edf1; color: var(--olm-primary); }
.olm-subnav a:hover::before { background: var(--olm-secondary); }

.olm-subnav a.is-active {
  background: #f6e3ea;
  color: var(--olm-primary);
  font-weight: 600;
}

.olm-subnav a.is-active::before { background: var(--olm-primary); }

/* ==========================================================================
   Top bar
   ========================================================================== */

/* Full width, sticky, inset from the window edges by --olm-gutter. */
.olm-topbar {
  position: sticky;
  top: var(--olm-gutter);
  z-index: 1050;
  height: var(--olm-topbar-h);
  margin: var(--olm-gutter) var(--olm-gutter) 0;
  background: var(--olm-surface);
  border: 1px solid var(--olm-line);
  border-radius: var(--olm-radius);
  box-shadow: var(--olm-shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  flex: none;
}

.olm-topbar h1 {
  font-size: 1.02rem;
  font-weight: 700;
  margin: 0;
  color: var(--olm-ink);
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.olm-icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--olm-line);
  border-radius: var(--olm-radius-sm);
  background: var(--olm-surface);
  color: var(--olm-body);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  transition: background .16s ease, color .16s ease, border-color .16s ease;
}

.olm-icon-btn:hover {
  background: #f7edf1;
  border-color: #e0c7d1;
  color: var(--olm-primary);
}

#olmSidebarToggle { display: none; }

.olm-user {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 11px 5px 6px;
  border: 1px solid var(--olm-line);
  border-radius: 30px;
  background: var(--olm-surface);
  cursor: pointer;
  color: var(--olm-body);
}

.olm-user:hover { background: #f7edf1; border-color: #e0c7d1; }

.olm-avatar {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--olm-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .76rem;
  font-weight: 700;
  flex: none;
}

.olm-user-name { display: block; font-size: .82rem; font-weight: 600; line-height: 1.2; }
.olm-user-role { display: block; font-size: .68rem; color: var(--olm-muted); line-height: 1.2; }

.olm-topbar .dropdown-menu {
  border: 1px solid var(--olm-line);
  border-radius: var(--olm-radius);
  box-shadow: var(--olm-shadow-lg);
  padding: 6px;
  font-size: .84rem;
  min-width: 190px;
}

.olm-topbar .dropdown-item {
  border-radius: var(--olm-radius-sm);
  padding: 8px 11px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--olm-body);
}

.olm-topbar .dropdown-item .material-icons { font-size: 18px; color: var(--olm-muted); }
.olm-topbar .dropdown-item:hover { background: #f7edf1; color: var(--olm-primary); }
.olm-topbar .dropdown-item:hover .material-icons { color: var(--olm-primary); }
.olm-topbar .dropdown-item.is-danger:hover { background: #fdeeee; color: var(--olm-bad); }
.olm-topbar .dropdown-item.is-danger:hover .material-icons { color: var(--olm-bad); }

/* ==========================================================================
   Footer
   ========================================================================== */

.olm-footer {
  flex: none;
  border-top: 1px solid var(--olm-line);
  background: var(--olm-surface);
  padding: 13px 22px;
  font-size: .78rem;
  color: var(--olm-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

/* ==========================================================================
   Components
   ========================================================================== */

.card {
  background: var(--olm-surface);
  border: 1px solid var(--olm-line);
  border-radius: var(--olm-radius);
  box-shadow: var(--olm-shadow);
  margin-bottom: 20px;
}

.card-header {
  background: var(--olm-surface);
  border-bottom: 1px solid var(--olm-line);
  padding: 15px 18px;
  border-radius: var(--olm-radius) var(--olm-radius) 0 0;
  font-weight: 700;
  color: var(--olm-primary);
}

.card-header h1, .card-header h2, .card-header h3,
.card-header h4, .card-header h5, .card-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--olm-primary);
}

.card-body { padding: 18px; }
.card-footer { padding: 14px 18px; border-top: 1px solid var(--olm-line); background: #fdfbfc; border-radius: 0 0 var(--olm-radius) var(--olm-radius); }

/* Material Dashboard's coloured header pills, kept so existing markup that
   uses them still reads as a heading rather than an unstyled block. */
.card-header-primary, .card-header-rose, .card-header-info,
.card-header-success, .card-header-warning, .card-header-danger {
  /* Flat, not a gradient: the palette carries no gradients anywhere. */
  background: var(--olm-primary);
  color: #fff;
}

.card-header-primary h1, .card-header-primary h2, .card-header-primary h3,
.card-header-primary h4, .card-header-primary h5, .card-header-primary .card-title,
.card-header-rose h4, .card-header-rose .card-title,
.card-header-info h4, .card-header-info .card-title,
.card-header-success h4, .card-header-success .card-title,
.card-header-warning h4, .card-header-warning .card-title,
.card-header-danger h4, .card-header-danger .card-title { color: #fff; }

.page-title {
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--olm-primary);
  margin: 0 0 4px;
}

/* Buttons */

.btn {
  border-radius: var(--olm-radius-sm);
  font-weight: 600;
  font-size: .84rem;
  padding: 9px 16px;
  border: 1px solid transparent;
  transition: filter .16s ease, box-shadow .16s ease, transform .12s ease;
}

.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid rgba(139, 22, 73, .28); outline-offset: 1px; }

.btn-primary, .btn-rose {
  background: var(--olm-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(139, 22, 73, .22);
}

.btn-primary:hover, .btn-rose:hover { filter: brightness(1.07); color: #fff; }

.btn-secondary { background: #efe6ea; border-color: #e2d3d9; color: var(--olm-primary); }
.btn-secondary:hover { background: #e7d8de; color: var(--olm-primary-dark); }

.btn-success { background: var(--olm-good); border-color: var(--olm-good); color: #fff; }
.btn-info    { background: var(--olm-info); border-color: var(--olm-info); color: #fff; }
.btn-warning { background: var(--olm-warn); border-color: var(--olm-warn); color: #fff; }
.btn-danger  { background: var(--olm-bad);  border-color: var(--olm-bad);  color: #fff; }
.btn-success:hover, .btn-info:hover, .btn-warning:hover, .btn-danger:hover { filter: brightness(1.08); color: #fff; }

.btn-outline-primary { border-color: var(--olm-primary); color: var(--olm-primary); background: transparent; }
.btn-outline-primary:hover { background: var(--olm-primary); color: #fff; }

.btn-sm { padding: 6px 12px; font-size: .78rem; }
.btn-lg { padding: 12px 22px; font-size: .92rem; }

/* Forms */

.form-control, .form-select, .custom-select, textarea.form-control {
  border: 1px solid var(--olm-line);
  border-radius: var(--olm-radius-sm);
  padding: 9px 12px;
  font-size: .86rem;
  color: var(--olm-ink);
  background-color: #fff;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.form-control:focus, .form-select:focus, .custom-select:focus {
  border-color: var(--olm-primary);
  box-shadow: 0 0 0 3px rgba(139, 22, 73, .1);
  outline: none;
}

.form-control::placeholder { color: #b5a4aa; }
.form-control:disabled, .form-control[readonly] { background: #f6f1f3; color: var(--olm-muted); }
.form-control.is-invalid, .is-invalid { border-color: var(--olm-bad); }

label, .col-form-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--olm-ink);
  margin-bottom: 5px;
}

.form-text, .text-muted { color: var(--olm-muted) !important; font-size: .77rem; }
.invalid-feedback, .text-danger { color: var(--olm-bad) !important; font-size: .78rem; }

.form-check-input:checked { background-color: var(--olm-primary); border-color: var(--olm-primary); }
.form-check-input:focus { border-color: var(--olm-primary); box-shadow: 0 0 0 3px rgba(139, 22, 73, .12); }
.form-check-label { font-weight: 500; font-size: .84rem; }

input[type="file"].form-control { padding: 7px 12px; }
input[type="date"], input[type="time"], input[type="datetime-local"] { color-scheme: light; }

/* Tables */

.table {
  width: 100%;
  margin-bottom: 0;
  color: var(--olm-body);
  font-size: .83rem;
  border-collapse: collapse;
}

.table > :not(caption) > * > * { padding: 11px 13px; }

.table thead th {
  background: var(--olm-primary);
  color: #fff;
  font-weight: 600;
  font-size: .71rem;
  letter-spacing: .4px;
  text-transform: uppercase;
  border: none;
  vertical-align: middle;
}

.table tbody td { border-bottom: 1px solid var(--olm-line-soft); vertical-align: middle; }
.table tbody tr:hover { background: #fbf5f7; }
.table-striped > tbody > tr:nth-of-type(odd) > * { background: #fdfafb; color: var(--olm-body); }

.table-responsive, .dataTables_wrapper .table-responsive {
  border: 1px solid var(--olm-line);
  border-radius: var(--olm-radius);
  overflow-x: auto;
}

/* DataTables chrome */
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--olm-line);
  border-radius: var(--olm-radius-sm);
  padding: 6px 10px;
  font-size: .82rem;
}

.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
  border-color: var(--olm-primary);
  outline: none;
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { font-size: .8rem; color: var(--olm-muted); padding: 10px 0; }

/* DataTables pagination styling defined in dedicated section below */

/* Alerts */

.alert {
  border-radius: var(--olm-radius);
  border: 1px solid transparent;
  padding: 13px 16px;
  font-size: .85rem;
  margin-bottom: 18px;
}

.alert-success { background: #eaf7f0; border-color: #b9e3cd; color: #17603c; }
.alert-danger  { background: #fdeeee; border-color: #f3c6c6; color: #8c2020; }
.alert-warning { background: #fdf5e8; border-color: #f5dfb4; color: #8a5a12; }
.alert-info    { background: #eaf1fa; border-color: #c3d7ef; color: #1d4f85; }

/* Badges, pagination, modal, misc */

.badge { border-radius: 20px; padding: 4px 10px; font-size: .7rem; font-weight: 600; }
.badge.bg-primary, .badge-primary { background: var(--olm-primary) !important; color: #fff; }
.badge.bg-success, .badge-success { background: var(--olm-good) !important; color: #fff; }
.badge.bg-danger,  .badge-danger  { background: var(--olm-bad) !important;  color: #fff; }
.badge.bg-warning, .badge-warning { background: var(--olm-warn) !important; color: #fff; }

.page-link { color: var(--olm-primary); border-color: var(--olm-line); }
.page-item.active .page-link { background: var(--olm-primary); border-color: var(--olm-primary); }

.modal-content { border: none; border-radius: var(--olm-radius); box-shadow: var(--olm-shadow-lg); }
.modal-header { border-bottom: 1px solid var(--olm-line); padding: 15px 18px; }
.modal-header .modal-title { font-size: 1rem; font-weight: 700; color: var(--olm-primary); }
.modal-body { padding: 18px; }
.modal-footer { border-top: 1px solid var(--olm-line); padding: 13px 18px; }

/* SweetAlert2 v7 chrome */
.swal2-popup { border-radius: var(--olm-radius) !important; font-family: var(--olm-font) !important; }
.swal2-title { color: var(--olm-ink) !important; font-size: 1.15rem !important; }
.swal2-content { color: var(--olm-body) !important; font-size: .88rem !important; }

/* ==========================================================================
   Bootstrap 4 compatibility
   The module views still use these utility names; Bootstrap 5 renamed or
   dropped them. Mapping them here avoids editing sixty views.
   ========================================================================== */

.ml-0 { margin-left: 0 !important; }      .mr-0 { margin-right: 0 !important; }
.ml-1 { margin-left: .25rem !important; } .mr-1 { margin-right: .25rem !important; }
.ml-2 { margin-left: .5rem !important; }  .mr-2 { margin-right: .5rem !important; }
.ml-3 { margin-left: 1rem !important; }   .mr-3 { margin-right: 1rem !important; }
.ml-4 { margin-left: 1.5rem !important; } .mr-4 { margin-right: 1.5rem !important; }
.ml-5 { margin-left: 3rem !important; }   .mr-5 { margin-right: 3rem !important; }
.ml-auto { margin-left: auto !important; } .mr-auto { margin-right: auto !important; }

.pl-0 { padding-left: 0 !important; }      .pr-0 { padding-right: 0 !important; }
.pl-1 { padding-left: .25rem !important; } .pr-1 { padding-right: .25rem !important; }
.pl-2 { padding-left: .5rem !important; }  .pr-2 { padding-right: .5rem !important; }
.pl-3 { padding-left: 1rem !important; }   .pr-3 { padding-right: 1rem !important; }
.pl-4 { padding-left: 1.5rem !important; } .pr-4 { padding-right: 1.5rem !important; }
.pl-5 { padding-left: 3rem !important; }   .pr-5 { padding-right: 3rem !important; }

.float-left  { float: left !important; }
.float-right { float: right !important; }
.text-left   { text-align: left !important; }
.text-right  { text-align: right !important; }

.font-weight-bold   { font-weight: 700 !important; }
.font-weight-normal { font-weight: 400 !important; }
.font-weight-light  { font-weight: 300 !important; }

.form-group { margin-bottom: 1rem; }
.btn-block  { display: block; width: 100%; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

.input-group-append, .input-group-prepend { display: flex; }
.input-group-append .btn { border-radius: 0 var(--olm-radius-sm) var(--olm-radius-sm) 0; }

/* Bootstrap 4 close button markup (`<button class="close">&times;</button>`) */
button.close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  opacity: .6;
  cursor: pointer;
  color: inherit;
  padding: 0 4px;
}

button.close:hover { opacity: 1; }

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1199.98px) {
  :root { --olm-sidebar-w: 236px; }
}

@media (max-width: 991.98px) {
  /* Off canvas drawer, hanging below the sticky header. */
  .olm-sidebar {
    position: fixed;
    top: calc(var(--olm-topbar-h) + var(--olm-gutter) * 2);
    left: 0;
    bottom: 0;
    height: auto;
    width: 280px;
    transform: translateX(-100%);
    box-shadow: var(--olm-shadow-lg);
    border-right: 1px solid var(--olm-line);
  }

  .olm-shell.sidebar-open .olm-sidebar { transform: translateX(0); }

  #olmSidebarToggle { display: inline-flex; }

  .olm-backdrop {
    position: fixed;
    inset: calc(var(--olm-topbar-h) + var(--olm-gutter) * 2) 0 0 0;
    background: rgba(43, 31, 35, .45);
    z-index: 1035;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
  }

  .olm-shell.sidebar-open .olm-backdrop { opacity: 1; visibility: visible; }
}

@media (max-width: 767.98px) {
  .olm-content { padding: 14px; }
  .olm-topbar { padding: 0 13px; gap: 8px; }
  .olm-topbar h1 { font-size: .92rem; }
  .olm-user-name, .olm-user-role { display: none; }
  .olm-topbar-divider { display: none; }
  .olm-brand img { max-width: 118px; height: 32px; }
  .olm-brand-tag { display: none; }
  .olm-user { padding: 4px; border-radius: 50%; }
  .card-body { padding: 14px; }
  .olm-footer { justify-content: center; text-align: center; font-size: .73rem; }
  .table { font-size: .78rem; }
}

@media (max-width: 575.98px) {
  .olm-content { padding: 11px; }
  .btn { padding: 8px 13px; font-size: .8rem; }
  .page-title { font-size: 1.05rem; }
}

/* Tables inside cards should always be able to scroll sideways on a phone
   rather than forcing the whole page wide. */
@media (max-width: 991.98px) {
  .card-body > .table,
  .card-body > table.table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media print {
  .olm-sidebar, .olm-topbar, .olm-footer, .olm-backdrop { display: none !important; }
  .card { box-shadow: none; border-color: #ccc; }
}

/* ==========================================================================
   Preview before publish
   ========================================================================== */

.olm-preview-modal .modal-content {
  border: none;
  border-radius: var(--olm-radius);
  box-shadow: var(--olm-shadow-lg);
}

.olm-preview-modal .modal-header {
  background: var(--olm-primary-soft);
  border-bottom: 1px solid var(--olm-line);
}

.olm-preview-modal .modal-title { color: var(--olm-primary); }

.olm-preview-lead {
  background: var(--olm-bg);
  border: 1px solid var(--olm-line);
  border-radius: var(--olm-radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--olm-body);
}

.olm-preview-list {
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  gap: 0;
  margin: 0;
}

.olm-preview-list dt,
.olm-preview-list dd {
  padding: 10px 12px;
  border-top: 1px solid var(--olm-line-soft);
  margin: 0;
  min-width: 0;
}

.olm-preview-list dt {
  font-weight: 600;
  color: var(--olm-ink);
  background: #fffdfa;
  word-break: break-word;
}

.olm-preview-list dd { overflow-wrap: anywhere; }

.olm-preview-thumb {
  display: block;
  max-width: 260px;
  max-height: 180px;
  border-radius: var(--olm-radius-sm);
  border: 1px solid var(--olm-line);
  margin-bottom: 6px;
}

.olm-preview-filename { font-size: 12px; color: var(--olm-muted); }

.olm-preview-rich {
  border: 1px dashed var(--olm-line);
  border-radius: var(--olm-radius-sm);
  padding: 10px 12px;
  background: #fff;
  max-height: 320px;
  overflow: auto;
}

.olm-preview-rich img { max-width: 100%; height: auto; }

@media (max-width: 575.98px) {
  .olm-preview-list { grid-template-columns: 1fr; }
  .olm-preview-list dd { border-top: none; padding-top: 0; }
}

/* ==========================================================================
   Tips panel
   ========================================================================== */

.olm-tips {
  border: 1px solid var(--olm-line);
  border-left: 3px solid var(--olm-primary);
  border-radius: var(--olm-radius);
  background: #fffdfa;
  padding: 14px 16px;
}

.olm-tips__head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.olm-tips__icon {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--olm-primary-soft);
  color: var(--olm-primary);
  font-size: 14px;
}

.olm-tips__title {
  flex: 1 1 auto;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--olm-ink);
}

.olm-tips__toggle {
  border: 1px solid var(--olm-line);
  background: #fff;
  border-radius: 14px;
  padding: 2px 12px;
  font-size: 12px;
  color: var(--olm-body);
  cursor: pointer;
}

.olm-tips__toggle:hover { border-color: var(--olm-primary); color: var(--olm-primary); }
.olm-tips__toggle[aria-expanded="false"]::after { content: " tips"; }

.olm-tips__list {
  margin: 10px 0 0;
  padding-left: 18px;
  color: var(--olm-body);
  font-size: 13px;
  line-height: 1.6;
}

.olm-tips__list li + li { margin-top: 4px; }
.olm-tips__list strong { color: var(--olm-ink); }

.olm-tips-tooltip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--olm-primary);
  background: var(--olm-primary-soft, rgba(37, 99, 235, 0.1));
  border: none;
  cursor: pointer;
  vertical-align: middle;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.olm-tips-tooltip-btn:hover,
.olm-tips-tooltip-btn:focus {
  transform: scale(1.1);
  background: rgba(37, 99, 235, 0.18);
  color: var(--olm-primary);
}

.olm-tips-tooltip .tooltip-inner {
  max-width: 360px;
  text-align: left;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  background-color: #1e293b;
  color: #f8fafc;
  border-radius: 8px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
}

.olm-tips-tip-header {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}

.olm-tips-tip-list {
  margin: 0;
  padding-left: 18px;
}

.olm-tips-tip-list li + li {
  margin-top: 5px;
}

.olm-tips-tip-list strong {
  color: #93c5fd;
}

/* ==========================================================================
   Media gallery
   ========================================================================== */

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

.olm-media-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.olm-chip {
  border: 1px solid var(--olm-line);
  background: #fff;
  border-radius: 16px;
  padding: 5px 14px;
  font-size: 13px;
  color: var(--olm-body);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.olm-chip:hover { border-color: var(--olm-primary); color: var(--olm-primary); text-decoration: none; }

.olm-chip.is-active {
  background: var(--olm-primary);
  border-color: var(--olm-primary);
  color: #fff;
  font-weight: 600;
}

.olm-media-search {
  position: relative;
  min-width: 240px;
}

.olm-media-search .fa {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--olm-muted);
  font-size: 13px;
  pointer-events: none;
}

.olm-media-search .form-control { padding-left: 32px; }

.olm-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
}

.olm-media-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--olm-line);
  border-radius: var(--olm-radius);
  background: #fff;
  overflow: hidden;
  transition: box-shadow .15s ease, border-color .15s ease;
}

.olm-media-card:hover {
  border-color: var(--olm-primary);
  box-shadow: var(--olm-shadow);
}

.olm-media-card.is-selected {
  border-color: var(--olm-primary);
  box-shadow: 0 0 0 2px var(--olm-primary);
  background-color: rgba(37, 99, 235, 0.03);
}

.olm-media-select {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  padding: 3px;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  line-height: 1;
}

.olm-media-select input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--olm-primary);
}

.olm-bulk-bar {
  background: #f8fafc;
  border: 1px solid var(--olm-line);
  border-radius: var(--olm-radius);
  padding: 10px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  animation: olmFadeDown .2s ease-out;
}

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

.olm-media-card.is-featured { border-color: #2f7d4f; }

/* Every tile is the same 16:9 box whatever sits inside it: a portrait photo,
   a 4:3 news picture, an uploaded video or a YouTube still. */
.olm-media-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--olm-line-soft);
  background: #f3efe9;
  cursor: pointer;
  overflow: hidden;
}

.olm-media-thumb img,
.olm-media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.olm-media-thumb__none {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--olm-muted);
  font-size: 26px;
}

.olm-media-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(23, 18, 20, .72);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding-left: 3px;
}

.olm-media-type {
  position: absolute;
  left: 8px;
  top: 8px;
  background: rgba(23, 18, 20, .78);
  color: #fff;
  border-radius: 12px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.olm-media-body {
  padding: 12px 14px 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.olm-media-caption {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--olm-ink);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.olm-media-caption-od {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--olm-body);
  overflow-wrap: anywhere;
}

.olm-media-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 10px 0 0;
  font-size: 12px;
}

.olm-media-home { color: var(--olm-muted); }
.olm-media-home.is-on { color: #1f6b41; font-weight: 600; }
.olm-media-id { color: var(--olm-muted); }

.olm-media-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  border-top: 1px solid var(--olm-line-soft);
  background: #fffdfa;
}

.olm-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none !important;
  background: transparent;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  color: var(--olm-body);
  cursor: pointer;
  text-decoration: none;
  line-height: 1;
}

.olm-icon-btn:hover {
  border: none !important;
  background: rgba(0, 0, 0, .05);
  color: var(--olm-primary);
  text-decoration: none;
}

.olm-icon-btn.is-danger:hover { color: #a12020; }
.olm-icon-btn .fa { font-size: 13px; }
.olm-media-actions form { margin-left: auto; }
.olm-media-actions .is-danger { margin-left: 2px; }

.olm-media-empty {
  border: 1px dashed var(--olm-line);
  border-radius: var(--olm-radius);
  padding: 36px 20px;
  text-align: center;
  color: var(--olm-muted);
}

.olm-media-empty .fa { font-size: 30px; margin-bottom: 10px; display: block; }

.olm-count-badge {
  background: #1f6b41;
  color: #fff;
  font-size: 12px;
  padding: 3px 10px;
}

/* Switch: the only control on Homepage Gallery. */
.olm-media-actions--switch { justify-content: center; }

.olm-switch__input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.olm-switch__label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--olm-body);
}

.olm-switch__track {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: #cfc6c0;
  position: relative;
  transition: background .15s ease;
  flex: 0 0 auto;
}

.olm-switch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .15s ease;
}

.olm-switch__input:checked + .olm-switch__label .olm-switch__track { background: #1f6b41; }
.olm-switch__input:checked + .olm-switch__label .olm-switch__knob { transform: translateX(18px); }
.olm-switch__input:focus-visible + .olm-switch__label .olm-switch__track { outline: 2px solid var(--olm-primary); outline-offset: 2px; }
.olm-switch__input:disabled + .olm-switch__label { opacity: .6; cursor: progress; }

/* Full-size media dialog. */
.olm-lightbox__stage {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #171214;
  border-radius: var(--olm-radius-sm);
  min-height: 240px;
  overflow: hidden;
}

.olm-lightbox__stage img,
.olm-lightbox__stage video {
  max-width: 100%;
  max-height: 70vh;
  display: block;
}

.olm-lightbox__stage iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  display: block;
}

.olm-lightbox__stage p { padding: 40px 20px; }

@media (max-width: 575.98px) {
  .olm-media-grid { grid-template-columns: 1fr; }
  .olm-media-search { min-width: 100%; }
}

/* ==========================================================================
   Confirmation dialog
   ========================================================================== */

.olm-confirm-modal .modal-dialog { max-width: 460px; }

.olm-confirm-modal .modal-content {
  border: none;
  border-radius: var(--olm-radius);
  box-shadow: var(--olm-shadow-lg);
}

.olm-confirm-modal .modal-header {
  background: var(--olm-primary-soft);
  border-bottom: 1px solid var(--olm-line);
}

.olm-confirm-modal .modal-title {
  color: var(--olm-primary);
  font-size: 17px;
}

.olm-confirm-modal .modal-body { padding: 20px; }

.olm-confirm-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.olm-confirm-icon {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: #fdf1e0;
  color: #8a5300;
}

.olm-confirm-row[data-tone="danger"] .olm-confirm-icon {
  background: #fbe7e7;
  color: #a12020;
}

.olm-confirm-row[data-tone="primary"] .olm-confirm-icon {
  background: var(--olm-primary-soft);
  color: var(--olm-primary);
}

.olm-confirm-text {
  font-size: 14px;
  line-height: 1.55;
  color: var(--olm-body);
}

.olm-confirm-modal .modal-footer { border-top: 1px solid var(--olm-line); }

.olm-confirm-modal .btn-warning {
  background: #8a5300;
  border-color: #8a5300;
  color: #fff;
}

.olm-confirm-modal .btn-warning:hover,
.olm-confirm-modal .btn-warning:focus {
  background: #6d4100;
  border-color: #6d4100;
  color: #fff;
}

/* ==========================================================================
   Audit log
   ========================================================================== */

.olm-audit-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.olm-audit-event {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.olm-audit-event--created { background: #e6f4ec; color: var(--olm-good); }
.olm-audit-event--updated { background: #fdf1e2; color: var(--olm-warn); }
.olm-audit-event--deleted { background: #fbeae8; color: var(--olm-bad); }

.olm-audit-diff {
  font-size: 12px;
  margin: 0;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) minmax(0, 1fr);
  gap: 4px 12px;
}

.olm-audit-diff__head {
  font-weight: 700;
  color: var(--olm-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .04em;
}

.olm-audit-old { color: var(--olm-bad); }
.olm-audit-new { color: var(--olm-good); }

/* ==========================================================================
   25. Admin form standardisation
   --------------------------------------------------------------------------
   Thirty admin forms each hand-rolled their own upload field: previews sat
   below the input at four different widths with four different borders. The
   rules below normalise every one of them without touching the markup, and
   the <x-admin.image-field> component renders the same shape for new work.
   ========================================================================== */

.olm-upload,
form .col-md-6:has(> input[type="file"]),
form .col-sm-6:has(> input[type="file"]),
form .col-md-9:has(> input[type="file"]) {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px;
}

.olm-upload__control,
form .col-md-6:has(> input[type="file"]) > input[type="file"],
form .col-sm-6:has(> input[type="file"]) > input[type="file"],
form .col-md-9:has(> input[type="file"]) > input[type="file"] {
  flex: 1 1 260px;
  min-width: 0;
}

/* The preview moves to the right of the control instead of underneath it. */
.olm-upload__preview,
form .col-md-6:has(> input[type="file"]) > div:has(> img),
form .col-sm-6:has(> input[type="file"]) > div:has(> img),
form .col-md-9:has(> input[type="file"]) > div:has(> img),
form .col-md-6:has(> input[type="file"]) > img,
form .col-sm-6:has(> input[type="file"]) > img {
  flex: 0 0 auto;
  order: 3;
  margin-top: 0 !important;
}

/* One preview size and frame everywhere. */
.olm-upload__preview img,
form .col-md-6:has(> input[type="file"]) img,
form .col-sm-6:has(> input[type="file"]) img,
form .col-md-9:has(> input[type="file"]) img {
  width: 104px !important;
  height: 72px !important;
  object-fit: contain;
  background: var(--olm-surface, #fff);
  border: 1px solid #e8dbdf;
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 1px 3px rgba(43, 31, 35, .08);
}

/* Helper text and validation messages always take the full row. */
.olm-upload > .form-text,
.olm-upload > .text-danger,
form .col-md-6:has(> input[type="file"]) > small,
form .col-md-6:has(> input[type="file"]) > span.text-danger,
form .col-sm-6:has(> input[type="file"]) > small,
form .col-sm-6:has(> input[type="file"]) > span.text-danger {
  flex: 1 0 100%;
  order: 4;
  margin: 0;
}

/* ==========================================================================
   Module screens
   --------------------------------------------------------------------------
   The list and edit views were written against the old Material template:
   bare icon links for row actions, hand coloured modal headers, and the stock
   DataTables chrome. Nothing here changes their markup — it re-skins what is
   already on the page so every module reads the same way.
   ========================================================================== */

/* ---- Page heading ---- */

.page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--olm-line);
}

.page-title::before {
  content: "";
  width: 4px;
  height: 1.05em;
  border-radius: var(--olm-radius-sm);
  background: var(--olm-primary);
}

/* ---- Card header: title left, actions right ---- */

.card-header.d-flex { align-items: center; gap: 10px; min-height: 56px; }

/* A header that only carries a button reads as a toolbar. */
.card-header:has(> .btn:only-child) { background: #fdfbfc; }

/* ---- Tables ---- */

.card > .card-body > .table-responsive { margin: -4px 0; }

.table thead th {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--olm-muted);
  background: #fbf7f8;
  border-bottom: 1px solid var(--olm-line);
  white-space: nowrap;
}

.table > :not(caption) > * > * { padding: 12px 14px; }
.table tbody tr { transition: background-color .14s ease; }

/* Thumbnails inside a listing row. */
.table td img {
  border-radius: var(--olm-radius-sm);
  border: 1px solid var(--olm-line);
  object-fit: cover;
  background: #fff;
}

/* ---- Row actions ----
   Simple, borderless icon design with comfortable hit area and clean hover feedback. */

.table td a[title] > i.fa,
.table td a.view-banner > i.fa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--olm-radius-sm);
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: .95rem;
  line-height: 1;
  transition: background-color .14s ease, color .14s ease;
}

.table td a[title]:hover > i.fa,
.table td a.view-banner:hover > i.fa {
  border: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.table td a.text-primary:hover > i.fa,
.table td a[title*="Edit"]:hover > i.fa,
.table td a[title*="edit"]:hover > i.fa {
  background: var(--olm-primary-soft) !important;
  color: var(--olm-primary) !important;
}
.table td a.text-info:hover    > i.fa { background: #eaf1fa !important; }
.table td a.text-danger:hover  > i.fa { background: #fdeeee !important; }
.table td a.text-success:hover > i.fa { background: #eaf7f0 !important; }

.table td a[title]:focus-visible > i.fa {
  outline: none;
  background: var(--olm-primary-soft);
}

/* Edit button in all modules: simple, strictly no border */
.table td a[title*="Edit"],
.table td a[title*="edit"],
.table td a.text-primary,
.table td a > i.fa-pencil,
.table td button > i.fa-pencil,
a[title*="Edit"] > i.fa,
a[title*="edit"] > i.fa {
  border: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.table td a[title*="Edit"]:hover,
.table td a[title*="edit"]:hover,
.table td a.text-primary:hover,
a[title*="Edit"]:hover > i.fa,
a[title*="edit"]:hover > i.fa {
  border: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Actions sit on one line with even spacing. */
.table td a[title] + a[title] { margin-left: 4px; }

/* ---- DataTables chrome ---- */

.dataTables_wrapper .row:first-child { align-items: center; margin-bottom: 6px; }

.dataTables_wrapper .dataTables_filter { text-align: right; }

.dataTables_wrapper .dataTables_filter input {
  min-width: 220px;
  margin-left: 8px;
  border-radius: var(--olm-radius-sm);
}

.dataTables_wrapper .dataTables_length select {
  border-radius: var(--olm-radius-sm);
  margin: 0 6px;
}

/* ==========================================================================
   DATATABLES & PAGINATION GLOBAL CONTROLS (HIGH CONTRAST & ACCESSIBILITY)
   ========================================================================== */
div.dataTables_wrapper div.dataTables_paginate,
.dataTables_wrapper .dataTables_paginate {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  padding-top: 12px !important;
  margin-top: 8px !important;
}

div.dataTables_wrapper div.dataTables_paginate span,
.dataTables_wrapper .dataTables_paginate span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

div.dataTables_wrapper div.dataTables_paginate a.paginate_button,
div.dataTables_wrapper div.dataTables_paginate .paginate_button,
.dataTables_wrapper .dataTables_paginate a.paginate_button,
.dataTables_wrapper .dataTables_paginate .paginate_button {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 34px !important;
  height: 34px !important;
  padding: 0 10px !important;
  margin: 0 !important;
  border-radius: 4px !important;
  border: 1px solid #ced4da !important;
  background: #ffffff !important;
  color: #212529 !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  cursor: pointer !important;
  user-select: none !important;
  transition: all 0.15s ease-in-out !important;
  line-height: 1 !important;
}

div.dataTables_wrapper div.dataTables_paginate a.paginate_button:hover:not(.disabled):not(.current),
div.dataTables_wrapper div.dataTables_paginate .paginate_button:hover:not(.disabled):not(.current),
.dataTables_wrapper .dataTables_paginate a.paginate_button:hover:not(.disabled):not(.current),
.dataTables_wrapper .dataTables_paginate .paginate_button:hover:not(.disabled):not(.current) {
  background-color: #f1f3f5 !important;
  border-color: #adb5bd !important;
  color: #bb345a !important;
}

div.dataTables_wrapper div.dataTables_paginate a.paginate_button.current,
div.dataTables_wrapper div.dataTables_paginate a.paginate_button.current:hover,
div.dataTables_wrapper div.dataTables_paginate .paginate_button.current,
div.dataTables_wrapper div.dataTables_paginate .paginate_button.current:hover,
.dataTables_wrapper .dataTables_paginate a.paginate_button.current,
.dataTables_wrapper .dataTables_paginate a.paginate_button.current:hover,
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background-color: #bb345a !important;
  background-image: none !important;
  border-color: #bb345a !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  cursor: default !important;
  box-shadow: 0 2px 4px rgba(187, 52, 90, 0.3) !important;
}

div.dataTables_wrapper div.dataTables_paginate a.paginate_button.disabled,
div.dataTables_wrapper div.dataTables_paginate a.paginate_button.disabled:hover,
div.dataTables_wrapper div.dataTables_paginate a.paginate_button.disabled:active,
div.dataTables_wrapper div.dataTables_paginate .paginate_button.disabled,
div.dataTables_wrapper div.dataTables_paginate .paginate_button.disabled:hover,
div.dataTables_wrapper div.dataTables_paginate .paginate_button.disabled:active,
.dataTables_wrapper .dataTables_paginate a.paginate_button.disabled,
.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
  opacity: 0.45 !important;
  cursor: not-allowed !important;
  background-color: #f8f9fa !important;
  border-color: #e9ecef !important;
  color: #868e96 !important;
  box-shadow: none !important;
}

div.dataTables_wrapper div.dataTables_paginate .ellipsis,
.dataTables_wrapper .dataTables_paginate .ellipsis {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 6px !important;
  color: #6c757d !important;
  font-weight: bold !important;
}

/* Bootstrap 5 / Standard Pagination fallback */
.pagination {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin-top: 10px !important;
}

.pagination .page-item .page-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 34px !important;
  height: 34px !important;
  padding: 0 10px !important;
  border-radius: 4px !important;
  border: 1px solid #ced4da !important;
  background: #ffffff !important;
  color: #212529 !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

.pagination .page-item.active .page-link {
  background-color: #bb345a !important;
  border-color: #bb345a !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 4px rgba(187, 52, 90, 0.3) !important;
}

.pagination .page-item.disabled .page-link {
  opacity: 0.45 !important;
  background-color: #f8f9fa !important;
  border-color: #e9ecef !important;
  color: #868e96 !important;
}

/* The stock sorting arrows are background images that sit under the label;
   these are drawn in the header cell itself. */
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
  background-image: none !important;
  position: relative;
  padding-right: 26px !important;
  cursor: pointer;
}

table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::after {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: .7rem;
  opacity: .45;
}

/* The DataTables sheet is linked inside the module views, so it loads after
   this file and wins on equal specificity — hence the !important. */
table.dataTable thead th.sorting::after     { content: "\2195" !important; }
table.dataTable thead th.sorting_asc::after { content: "\2191" !important; opacity: 1; color: var(--olm-primary); }
table.dataTable thead th.sorting_desc::after{ content: "\2193" !important; opacity: 1; color: var(--olm-primary); }

/* Same reason: the stock sheet also styles these. */
table.dataTable thead th.sorting::before,
table.dataTable thead th.sorting_asc::before,
table.dataTable thead th.sorting_desc::before { content: none !important; }

/* ---- Modals ----
   Thirty three views set the header colour inline. These win it back to the
   palette; the inline value would otherwise beat any plain rule. */

.modal-header[style] {
  background-color: var(--olm-primary) !important;
  color: #fff !important;
  border-bottom: none !important;
  border-radius: var(--olm-radius) var(--olm-radius) 0 0;
}

.modal-header[style] .modal-title,
.modal-header[style] .close,
.modal-header[style] .btn-close { color: #fff !important; }

.modal-header[style] .btn-close { filter: invert(1) grayscale(1) brightness(2); }

/* A definition table inside a details modal. */
.modal-body .table th {
  font-weight: 600;
  color: var(--olm-muted);
  background: transparent;
  border-bottom: 1px solid var(--olm-line-soft);
}

.modal-body .table td { border-bottom: 1px solid var(--olm-line-soft); }
.modal-body .table tbody tr:last-child th,
.modal-body .table tbody tr:last-child td { border-bottom: none; }

/* ---- Forms ---- */

.form-horizontal .col-form-label,
form .col-form-label,
form .form-label {
  font-weight: 600;
  color: var(--olm-ink);
  font-size: .84rem;
}

/* The required marker the views append as a red asterisk. */
form .col-form-label .text-danger { font-weight: 700; }

.form-control, .form-select, .custom-select {
  min-height: 40px;
  font-size: .87rem;
}

textarea.form-control { min-height: 88px; }

.form-text, form small.text-muted {
  font-size: .76rem;
  color: var(--olm-muted);
}

/* A row of buttons at the foot of an edit form. */
form .card-body > .row:last-child .btn,
form .card-footer .btn { min-width: 116px; }

/* ---- Alerts: a colour bar rather than a full tint ---- */

.alert { border-left-width: 4px; }
.alert-success { border-left-color: var(--olm-good); }
.alert-danger  { border-left-color: var(--olm-bad); }
.alert-warning { border-left-color: var(--olm-warn); }
.alert-info    { border-left-color: var(--olm-info); }

/* ---- Empty state ---- */

.table tbody tr td[colspan] {
  text-align: center;
  color: var(--olm-muted);
  padding: 26px 14px;
}

@media (max-width: 767.98px) {
  .dataTables_wrapper .dataTables_filter { text-align: left; }
  .dataTables_wrapper .dataTables_filter input { min-width: 0; width: 100%; margin: 6px 0 0; }
  .card-header.d-flex { flex-wrap: wrap; }
}

/* ==========================================================================
   Scroll to Top Floating Action Button (Overlay)
   ========================================================================== */

.olm-scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--olm-primary, #910742);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 14px rgba(145, 7, 66, 0.35), 0 2px 6px rgba(0, 0, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1045;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(18px) scale(0.88);
  transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.28s,
              background-color 0.2s,
              box-shadow 0.2s,
              border-color 0.2s;
  outline: none;
  padding: 0;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
}

.olm-scroll-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.olm-scroll-top:hover {
  background-color: var(--olm-primary-dark, #6d0531);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 8px 22px rgba(145, 7, 66, 0.45), 0 4px 10px rgba(0, 0, 0, 0.18);
}

.olm-scroll-top:active {
  transform: translateY(-1px) scale(0.96);
  box-shadow: 0 3px 10px rgba(145, 7, 66, 0.3);
}

.olm-scroll-top:focus-visible {
  outline: 3px solid rgba(176, 42, 95, 0.65);
  outline-offset: 3px;
}

.olm-scroll-top__icon {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.5;
  transition: transform 0.2s ease;
}

.olm-scroll-top:hover .olm-scroll-top__icon {
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .olm-scroll-top {
    bottom: 22px;
    right: 20px;
    width: 42px;
    height: 42px;
  }
  .olm-scroll-top__icon {
    width: 18px;
    height: 18px;
  }
}

@media print {
  .olm-scroll-top {
    display: none !important;
  }
}

