:root {
  --sidebar-width: 250px;
  --sidebar-collapsed-width: 70px;
  --bs-nav-link-font-size: .75rem;
  --ch0: #fff;
  --ch0-rgb: 255, 255, 255;
  --ch1: #f6f8fa;
  --ch1-rgb: 246, 248, 250;
  --ch2: #e1e4e8;
  --ch2-rgb: 225, 228, 232;
  --ch3: #d1d5da;
  --ch3-rgb: 209, 213, 218;
  --bd: #c6cbd1;
  --bd2: #959da5;
  --tx: #24292e;
  --tx2: #57606a;
  --tx3: #6a737d;
  --blue: #0366d6;
  --blue2: #0356b9;
  --green: #28a745;
  --green2: #22863a;
  --danger: #d73a49;
  --warn: #d29922;
  --canvas: var(--ch1);
  --carea-bg: #e8eaed;
  --sel-c: #58a6ff;
  --nest-depth-0: #58a6ff;
  --nest-depth-1: #3fb950;
  --nest-depth-2: #f0883e;
  --nest-depth-3: #bc8cff;
  --nest-depth-4: #58d9f5;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #e9ecef;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-tertiary: #495057;
  --border-color: #e9ecef;
  --border-hover: #dee2e6;
  --shadow: rgba(0, 0, 0, 0.08);
  --card-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --accent-red: #dc3545;
  --accent-orange: #fd7e14;
  --accent-blue: #0d6efd;
  --accent-green: #198754;
  --accent-teal: #20c997;
  --accent-gray: #6c757d;
  --accent-yellow: #ffc107;
  --accent-purple: #6610f2;
  --accent-success: #198754;
  --accent-warning: #ffc107;
  --accent-danger: #dc3545;
  --overlay: rgba(0, 0, 0, 0.5);
  --standout-item-bg: #f1f3f5;
}

[data-theme="dark"] {
  --ch0: #0d1117;
  --ch0-rgb: 13, 17, 23;
  --ch1: #161b22;
  --ch1-rgb: 22, 27, 34;
  --ch2: #1c2333;
  --ch2-rgb: 28, 35, 51;
  --ch3: #21262d;
  --ch3-rgb: 33, 38, 45;
  --bd: #30363d;
  --bd2: #444c56;
  --tx: #e6edf3;
  --tx2: #8b949e;
  --tx3: #656d76;
  --blue: #58a6ff;
  --blue2: #1f6feb;
  --green: #3fb950;
  --green2: #238636;
  --danger: #f85149;
  --warn: #d29922;
  --canvas: var(--ch1);
  --carea-bg: #1a1f2a;
  --bg-primary: #1a1d23;
  --bg-secondary: #0f1215;
  --bg-tertiary: #2a2e35;
  --text-primary: #e9ecef;
  --text-secondary: #adb5bd;
  --text-tertiary: #ced4da;
  --border-color: #343a40;
  --border-hover: #495057;
  --shadow: rgba(0, 0, 0, 0.3);
  --card-bg: #212529;
  --sidebar-bg: #1a1d23;
  --overlay: rgba(0, 0, 0, 0.7);
  --standout-item-bg: #1c1c1c;
}

html[data-font-size="xxx-small"] {
  font-size: 8px;
}

html[data-font-size="xx-small"] {
  font-size: 10px;
}

html[data-font-size="x-small"] {
  font-size: 12px;
}

html[data-font-size="small"] {
  font-size: 14px;
}

html[data-font-size="medium"] {
  font-size: 16px;
}

html [data-font-size="default"] {
  font-size: 16px;
}

html[data-font-size="large"] {
  font-size: 18px;
}

html[data-font-size="x-large"] {
  font-size: 20px;
}

html[data-font-size="xx-large"] {
  font-size: 22px;
}

html[data-font-size="xxx-large"] {
  font-size: 24px;
}

html {
  transition: font-size 0.25s ease;
}

body {
  transition: background-color 0.3s, color 0.3s, font-size 0.25s ease, line-height 0.25s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  margin: 0;
  display: flex;
  height: 100vh;
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  /* Hide the browser's outer vertical scrollbar and keep horizontal hidden.
         Let the main element be the single scroll container (main { overflow-y: auto }). */
  overflow: hidden;
}

.badge.bg-red {
  background-color: var(--accent-danger, #dc3545) !important;
  color: #fff !important;
  font-weight: 300;
}

.badge.bg-orange {
  background-color: var(--accent-orange, #fd7e14) !important;
  color: #fff !important;
  font-weight: 300;
}

.badge.bg-blue {
  background-color: var(--accent-blue, #0d6efd) !important;
  color: #fff !important;
  font-weight: 300;
}

.badge.bg-green {
  background-color: var(--accent-green, #198754) !important;
  color: #fff !important;
  font-weight: 300;
}

.badge.bg-teal {
  background-color: var(--accent-teal, #20c997) !important;
  color: #fff !important;
  font-weight: 300;
}

.badge.bg-gray {
  background-color: var(--accent-gray, #6c757d) !important;
  color: #fff !important;
  font-weight: 300;
}

.badge.bg-yellow {
  background-color: var(--accent-yellow, #ffc107) !important;
  color: #fff !important;
  font-weight: 300;
}

.badge.bg-purple {
  background-color: var(--accent-purple, #6610f2) !important;
  color: #fff !important;
  font-weight: 300;
}

/* ═══ SIDEBAR ══════════════════════════════════════════ */

.sidebar {
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bs-body-bg);
  border-right: 1px solid var(--bs-border-color);
  transition: width 0.25s ease;
  position: relative;
  z-index: 1000;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width) !important;
  flex: 0 0 var(--sidebar-collapsed-width) !important;
  max-width: var(--sidebar-collapsed-width) !important;
  min-width: var(--sidebar-collapsed-width) !important;
  overflow-x: hidden !important;
}

/* E48: drag-to-resize handle on the sidebar's right edge */
.sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  z-index: 1200;
  background: transparent;
}
.sidebar-resize-handle:hover,
.sidebar.sidebar-resizing .sidebar-resize-handle {
  background: color-mix(in srgb, var(--bs-primary, #0d6efd) 40%, transparent);
}
.sidebar.sidebar-resizing {
  transition: none !important;
  user-select: none;
}
.sidebar.collapsed .sidebar-resize-handle {
  display: none;
}

/* Brand */
.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  height: 48px;
  min-height: 48px;
  border-bottom: 1px solid var(--bs-border-color);
  flex-shrink: 0;
}

.sidebar-brand .brand-name {
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity 0.2s;
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center;
}

.sidebar.collapsed .sidebar-brand .brand-name {
  opacity: 0;
  display: none !important;
}

/* Collapse button */
.sidebar-close-btn {
  border: none;
  background: none;
  font-size: 1rem;
  cursor: w-resize;
  color: var(--bs-secondary-color);
  padding: 4px 5px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s, color 0.14s;
  flex-shrink: 0;
}

.sidebar-close-btn:hover {
  background: var(--bs-secondary-bg);
  color: var(--bs-body-color);
}

/* Tabs strip */
.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--bs-border-color);
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-tabs {
  display: none;
}

.sidebar-tab {
  flex: 1;
  padding: 9px 4px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--bs-secondary-color);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.14s, border-color 0.14s, background 0.14s;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  /* Single-word labels (Content/Business/System) always fit one line at
     this size - if a future label doesn't, prefer shortening it over
     reintroducing wrapping here, which reads as cramped in a 3-way split
     of a ~250px sidebar. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-tab:hover {
  color: var(--bs-body-color);
  background: var(--bs-secondary-bg);
}

.sidebar-tab.active {
  color: var(--bs-primary);
  border-bottom-color: var(--bs-primary);
}

/* Scrollable nav body */
.sidebar-nav-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.sidebar-nav-body::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav-body::-webkit-scrollbar-thumb {
  background: var(--bs-border-color);
  border-radius: 2px;
}

/* Tab panes — hidden by default, active shown when expanded */
.sidebar-tab-pane {
  display: none;
}

.sidebar-tab-pane.active {
  display: block;
}

/* In collapsed mode all panes are visible (icon-only) */
.sidebar.collapsed .sidebar-tab-pane {
  display: block;
}

/* Nav list */
.sidebar-nav {
  padding: 6px 0;
  margin: 0;
  list-style: none;
}

.sidebar-nav .nav-item {
  width: 100%;
}

/* ── Top-level nav link ── */
.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  color: var(--bs-body-color);
  text-decoration: none;
  transition: background 0.14s, color 0.14s;
  margin: 1px 6px 1px 0;
  border-radius: 0 5px 5px 0;
  font-size: 12px;
  position: relative;
  width: calc(100% - 6px);
  box-sizing: border-box;
  border-left: 3px solid transparent;
}

.sidebar-nav .nav-link:hover {
  background: var(--bs-secondary-bg);
  border-left-color: var(--bs-border-color);
}

/* Active top-level — flush-left accent bar + tinted fill */
.sidebar-nav .nav-link.active {
  background: rgba(var(--bs-primary-rgb), 0.1);
  color: var(--bs-primary);
  font-weight: 600;
  border-left-color: var(--bs-primary);
}

/* Active-parent — you're inside a child; icon tinted, no fill */
.sidebar-nav .nav-link.active-parent {
  color: var(--bs-body-color);
  font-weight: 500;
  border-left-color: transparent;
}

.sidebar-nav .nav-link.active-parent>i {
  color: var(--bs-primary);
}

.sidebar-nav .nav-link i {
  font-size: 14px;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
}

/* ── Children tree rail ── */
.nav-children {
  margin: 0 6px 4px 30px;
  padding-left: 10px;
  border-left: 1.5px solid var(--bs-border-color);
  transition: border-color 0.14s, max-height 0.18s ease, opacity 0.15s ease;
  max-height: 500px;
  opacity: 1;
  overflow: hidden;
}

/* Rail gets a primary tint when parent is active-parent */
.sidebar-nav .nav-link.active-parent+.nav-children {
  border-left-color: rgba(var(--bs-primary-rgb), 0.35);
}

/* Same tint, for a .nav-children whose parent link now lives inside a
   .nav-link-row wrapper (see below) - the adjacent-sibling selector above
   no longer matches once .nav-link isn't .nav-children's direct sibling,
   so the template applies this class directly instead. */
.nav-children.active-parent-children {
  border-left-color: rgba(var(--bs-primary-rgb), 0.35);
}

/* Collapsed submenu (Pages, Booking) - toggled via .nav-toggle-btn */
.nav-children.nav-children-collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  margin-bottom: 0;
  border-left-color: transparent;
}

/* Row holding a collapsible parent link + its toggle chevron */
.nav-link-row {
  display: flex;
  align-items: center;
  gap: 0;
}

.nav-link-row .nav-link {
  width: auto;
  flex: 1 1 auto;
  min-width: 0;
  margin-right: 0;
}

.nav-toggle-btn {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin: 1px 6px 1px 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bs-secondary-color);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.nav-toggle-btn:hover {
  background: var(--bs-secondary-bg);
  color: var(--bs-body-color);
}

.nav-toggle-btn i {
  font-size: 11px;
  transition: transform 0.15s ease;
}

.nav-toggle-btn[aria-expanded="false"] i {
  transform: rotate(-90deg);
}

.sidebar.collapsed .nav-children {
  display: none;
}

.sidebar.collapsed .nav-toggle-btn {
  display: none !important;
}

/* Child link */
.nav-children .nav-link-child {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  color: var(--bs-secondary-color);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  margin: 1px 0;
  border-radius: 4px;
  font-size: 11px;
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.nav-children .nav-link-child:hover {
  background: var(--bs-secondary-bg);
  color: var(--bs-body-color);
}

.nav-children .nav-link-child i {
  font-size: 12px;
  min-width: 14px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.75;
}

/* Active child — tinted fill + dot indicator on the rail */
.nav-children .nav-link-child.active {
  background: rgba(var(--bs-primary-rgb), 0.08);
  color: var(--bs-primary);
  font-weight: 500;
}

.nav-children .nav-link-child.active i {
  opacity: 1;
}

/* Dot sits centered on the rail line */
.nav-children .nav-link-child.active::before {
  content: '';
  position: absolute;
  left: -15px;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--bs-primary);
  box-shadow: 0 0 0 2px var(--bs-body-bg);
}

/* Reset active styles in collapsed icon-only mode */
.sidebar.collapsed .sidebar-nav .nav-link.active {
  border-left-color: transparent;
  border-radius: 5px;
  margin: 1px 4px;
  width: calc(100% - 8px);
  background: rgba(var(--bs-primary-rgb), 0.12);
}

/* Section labels */
.sidebar-section {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--bs-secondary-color);
  padding: 10px 16px 4px;
  opacity: 0.7;
}

.sidebar.collapsed .sidebar-section {
  display: none !important;
}

/* ═══ SIDEBAR: quick "jump to" search ═══════════════════════════════ */
.sidebar-quick-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--bs-border-color);
  color: var(--bs-secondary-color);
  flex-shrink: 0;
}

.sidebar-quick-search i {
  font-size: 12px;
  flex-shrink: 0;
}

.sidebar-quick-search-input {
  border: none;
  background: transparent;
  outline: none;
  color: var(--bs-body-color);
  font-size: 12px;
  width: 100%;
  min-width: 0;
}

.sidebar-quick-search-input::placeholder {
  color: var(--bs-secondary-color);
}

.sidebar.collapsed .sidebar-quick-search {
  display: none !important;
}

/* Search-time overrides - a class-based toggle layered on top of whatever
   the tab/submenu/section is already showing, so clearing the query just
   means removing these classes rather than needing to remember/restore
   prior state. */
.sidebar-nav-body.search-active .sidebar-tab-pane {
  display: block !important;
}

.search-hidden {
  display: none !important;
}

.nav-children.search-force-visible,
.sidebar-section-body.search-force-visible {
  max-height: none !important;
  opacity: 1 !important;
  overflow: visible !important;
}

.sidebar-search-empty {
  padding: 14px 16px;
  font-size: 11.5px;
  color: var(--bs-secondary-color);
  text-align: center;
}

/* ═══ SIDEBAR: recently-visited strip ═══════════════════════════════ */
.sidebar-recent {
  border-bottom: 1px solid var(--bs-border-color);
  padding-bottom: 4px;
}

.sidebar.collapsed .sidebar-recent {
  display: none !important;
}

/* ═══ SIDEBAR: collapsible whole-section groups ═════════════════════ */
.sidebar-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 12px 4px 16px;
  cursor: pointer;
}

.sidebar-section-toggle .sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--bs-secondary-color);
  opacity: 0.7;
}

.sidebar-section-toggle:hover .sidebar-section-label {
  opacity: 1;
}

.sidebar-section-chevron {
  font-size: 9px;
  color: var(--bs-secondary-color);
  opacity: 0.6;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.sidebar-section-toggle[aria-expanded="false"] .sidebar-section-chevron {
  transform: rotate(-90deg);
}

.sidebar-section-body {
  max-height: 3000px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.18s ease, opacity 0.15s ease;
}

.sidebar-section-body.section-collapsed {
  max-height: 0;
  opacity: 0;
}

.sidebar.collapsed .sidebar-section-toggle {
  display: none !important;
}

/* Icon-only mode ignores the user's own section-collapse preference -
   matching how it already flattens everything else (no submenus, no
   labels, just top-level icons) rather than risking hiding an entire
   group's icons behind a stale localStorage choice with no way to tell. */
.sidebar.collapsed .sidebar-section-body {
  max-height: none !important;
  opacity: 1 !important;
  overflow: visible !important;
}

/* Link text */
.link-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  transition: opacity 0.2s;
}

.sidebar.collapsed .link-text {
  opacity: 0 !important;
  display: none !important;
}

/* Collapsed nav */
.sidebar.collapsed .sidebar-nav .nav-link {
  padding: 7px !important;
  justify-content: center;
  margin: 1px 4px;
  width: calc(100% - 8px);
}

.sidebar.collapsed .nav-link-child {
  display: none !important;
}

/* User section - a real Bootstrap dropdown (data-bs-toggle="dropdown"),
   not the old :hover-driven .user-menu it replaced. That design had two
   real, unfixable-without-JS bugs: the visible gap between the initials
   circle and the menu (position: absolute; bottom: 54px) lost :hover
   before a mouse could cross it, closing the menu before a link could be
   clicked; and .sidebar.collapsed .user-menu:hover could never fire at
   all, since a display:none element is never a hover target in the first
   place - it only ever appeared via the OTHER (non-collapsed-scoped) rule.
   A real dropdown sidesteps both: click-to-open/keyboard-accessible,
   click-outside-to-close, and correct aria-expanded state, all handled by
   Bootstrap itself. */
.sidebar-user {
  padding: 8px 10px;
  border-top: 1px solid var(--bs-border-color);
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-user {
  padding: 8px 4px;
}

.sidebar-user-dropdown {
  width: 100%;
}

.sidebar-user-button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  color: var(--bs-body-color);
}

.sidebar-user-button:hover,
.sidebar-user-button:focus-visible,
.sidebar-user-button[aria-expanded="true"] {
  border-color: var(--bs-border-color);
  background: var(--bs-secondary-bg);
}

.sidebar.collapsed .sidebar-user-button {
  justify-content: center;
  padding: 6px 0;
}

.user-initials,
.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
}

.sidebar-user-avatar {
  object-fit: cover;
}

.user-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  background: var(--bs-primary);
  color: #fff;
}

.user-initials-lg {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 600;
  font-size: 13px;
  background: var(--bs-primary);
  color: #fff;
}

.sidebar-user-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}

.sidebar.collapsed .sidebar-user-text {
  display: none;
}

.sidebar-user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--bs-heading-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  font-size: 10px;
  color: var(--bs-secondary-color);
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-chevron {
  flex-shrink: 0;
  font-size: 0.65rem;
  color: var(--bs-secondary-color);
}

.sidebar.collapsed .sidebar-user-chevron {
  display: none;
}

/* Top-right buttons */
.top-right-buttons {
  position: fixed;
  top: 0;
  right: 0;
  padding: 0.5rem;
  display: flex;
  gap: 0.5rem;
  z-index: 1050;
}

/* sidebar info */
.sidebar-info {
  padding: 8px 12px;
  font-size: 10px;
  color: var(--bs-secondary-color);
  text-align: center;
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-info {
  display: none !important;
}

/* admin section navbar */
.navbar-admin {
  background-color: var(--bs-body-bg) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  min-height: 48px;
  border-bottom: 1px solid var(--bs-border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  z-index: 1001;
}

.navbar-admin .navbar-brand {
  font-weight: 500;
  font-size: 1rem;
  color: var(--bs-body-color);
  text-decoration: none;
}

.navbar-admin .navbar-brand:hover {
  color: var(--bs-primary);
}


/* Main content */
main {
  flex-grow: 1;
  overflow-y: auto;
}

/* Responsive: hide sidebar on mobile */
@media (max-width: 991px) {
  .sidebar {
    transform: translateX(-100%);
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
  }

  .sidebar.show {
    transform: translateX(0);
  }
}

/* Compact on short viewports */
@media (max-height: 900px) {
  .sidebar-brand {
    height: 42px;
    min-height: 42px;
  }

  .sidebar-nav .nav-link {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
  }

  .sidebar-user {
    padding: 7px 12px;
  }
}

/* standard checkbox utility used on select-all rows to conserve vertical space */
.form-check-input {
    width: 1rem;
    height: 1rem;
    margin: 0;
}

/* Small checkbox utility used on select-all rows to conserve vertical space */
.small-checkbox {
  width: 1.2rem !important;
  height: 1.2rem !important;
  vertical-align: middle !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Large checkbox utility for forms that need prominent toggles (replaces inline style width:2em;height:2em) */
.large-checkbox {
  width: 2em !important;
  height: 2em !important;
  vertical-align: middle !important;
}

.template-not-found {
  max-width: 98%;
}

.popover {
  max-width: 350px;
  /* Max Width of the popover (depending on the container!) */
}

/* Target the internal Bootstrap popover body */
.popover-body {
  max-height: 450px;
  /* Set your preferred maximum height */
  overflow-y: auto;
  /* Enable vertical scrolling when content exceeds height */
}

/* popover response styles /*

/* bootstrap custom icon styles */
.rotate-90 {
  display: inline-block;
  transform: rotate(90deg);
}

.rotate-90:hover {
  transform: rotate(90deg) scale(1.2);
  transition: transform 0.2s ease;
}

.rotate-90:active {
  transform: rotate(90deg) scale(0.95);
  transition: transform 0.1s ease;
}

.rotate-90:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.5);
}

.rotate-90:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rotate-90:disabled:hover {
  transform: rotate(90deg);
  box-shadow: none;
}

.rotate-90:disabled:active {
  transform: rotate(90deg);
  box-shadow: none;
}

.rotate-90:disabled:focus {
  box-shadow: none;
}

.rotate-180 {
  display: inline-block;
  transform: rotate(180deg);
}

.rotate-180:hover {
  transform: rotate(180deg) scale(1.2);
  transition: transform 0.2s ease;
}

.rotate-180:active {
  transform: rotate(180deg) scale(0.95);
  transition: transform 0.1s ease;
}

.rotate-180:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.5);
}

.rotate-180:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rotate-180:disabled:hover {
  transform: rotate(180deg);
  box-shadow: none;
}

.rotate-180:disabled:active {
  transform: rotate(180deg);
  box-shadow: none;
}

.rotate-180:disabled:focus {
  box-shadow: none;
}

.rotate-270 {
  display: inline-block;
  transform: rotate(270deg);
}

.rotate-270:hover {
  transform: rotate(270deg) scale(1.2);
  transition: transform 0.2s ease;
}

.rotate-270:active {
  transform: rotate(270deg) scale(0.95);
  transition: transform 0.1s ease;
}

.rotate-270:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.5);
}

.rotate-270:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.rotate-270:disabled:hover {
  transform: rotate(270deg);
  box-shadow: none;
}

.rotate-270:disabled:active {
  transform: rotate(270deg);
  box-shadow: none;
}

.rotate-270:disabled:focus {
  box-shadow: none;
}

.hover-underline:hover {
  text-decoration: underline !important;
}

.pssec {
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--bd)
}

.pssec:last-child {
  border-bottom: none;
  margin-bottom: 0
}

.pstitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--tx);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px
}

.pstitle i {
  color: var(--blue);
  font-size: 13px
}

.border-dashed {
  border-style: dashed !important
}

/*
.table-rounded-rows > :not(caption) > * {
  --bs-table-bg: #f8f9fa; 
}
@media (prefers-color-scheme: dark) {
  .table-rounded-rows > :not(caption) > * {
    --bs-table-bg: #212529; 
  }
}
.table-rounded-rows {
  border-collapse: separate;
  border-spacing: 0 8px; 
}
.table-rounded-rows > :not(caption) > * > td:first-child,
.table-rounded-rows > :not(caption) > * > th:first-child {
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}
.table-rounded-rows > :not(caption) > * > td:last-child,
.table-rounded-rows > :not(caption) > * > th:last-child {
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}
.table-rounded-rows > :not(caption) > * > * {
  border: none !important;
}
*/

/* table rounded rows */
/*
.table-rounded-rows > :not(caption) > * {
  --bs-table-bg: #f8f9fa; 
}

@media (prefers-color-scheme: dark) {
  .table-rounded-rows > :not(caption) > * {
    --bs-table-bg: #212529; 
  }
}
*/
/* ==========================================
   1. BASE COLORS (LIGHT MODE - DEFAULT)
   ========================================== */
/*
.table-rounded-rows > :not(caption) > * {
  --bs-table-bg: #e1e4e8;
  --bs-table-color: #212529; 
}
*/
/* ==========================================
   2. DARK MODE OVERRIDES
   ========================================== */
/*
[data-bs-theme="dark"] .table-rounded-rows > :not(caption) > * {
  --bs-table-bg: #1c2333;
  --bs-table-color: #f8f9fa;
} */

/* Optional: Keep this if you also want to support system preferences without the JS toggle */
/*
@media (prefers-color-scheme: dark) {
  :root:not([data-bs-theme="light"]) .table-rounded-rows > :not(caption) > * {
    --bs-table-bg: #1c2333;
    --bs-table-color: #f8f9fa;
  }
} */
.table-rounded-rows {
  border-collapse: separate;
  border-spacing: 0 0.40rem;
  /* Creates spacing between rows */
  background-color: transparent;
  /* Ensure the table background is transparent */
}

/* remove all borders from thead to prevent interference with rounded row styling */
.table-rounded-rows thead th {
  border: none;
}

.table-rounded-rows tbody tr {
  border-top-width: var(--bs-border-width);
  /* Add top border to each row */
  border-bottom-width: var(--bs-border-width);
  /* Add bottom border to each row */
}

/* Round the front edge of the row */
.table-rounded-rows tr td:first-child,
.table-rounded-rows tr th:first-child {
  border-top-left-radius: 0.5rem;
  border-bottom-left-radius: 0.5rem;
  border-top-width: var(--bs-border-width);
  /* Add left border to the first cell */
  border-left-width: var(--bs-border-width);
  /* Add left border to the first cell */
}

/* Round the back edge of the row */
.table-rounded-rows tr td:last-child,
.table-rounded-rows tr th:last-child {
  border-top-right-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
  border-top-width: var(--bs-border-width);
  /* Add right border to the last cell */
  border-right-width: var(--bs-border-width);
  /* Add right border to the last cell */
}

.table-rounded-rows tbody tr td {
  border-top-width: var(--bs-border-width);
  /* Add top border to each cell */
  border-bottom-width: var(--bs-border-width);
  /* Add bottom border to each cell */
  padding: 0.45rem;
  /* Adjust padding as needed */
}

.table-rounded-rows tbody tr td:first-child {
  padding-left: 0.7rem;
  /* Add left border to the first cell */
}

.table-rounded-rows tbody tr td:last-child {
  padding-right: 0.7rem;
  /* Add right border to the last cell */
}

code {
  font-size: .875em;
  color: var(--bs-code-color);
  word-wrap: break-word;
}

.small {
  font-size: 0.875em;
}

.x-small {
  font-size: 0.75em;
}

.xx-small {
  font-size: 0.625em;
}

.xxx-small {
  font-size: 0.5em;
}

/* remove the bottom border from the last row in dark mode */
@media (prefers-color-scheme: dark) {
  .table-rounded-rows tbody tr td {
    border-bottom: none;
    /* Remove bottom border from each cell in dark mode */
  }
}

/* the light mode bottom border is not working when the color scheme is light */
@media (prefers-color-scheme: light) {
  .table-rounded-rows tbody tr td {
    border-bottom: var(--bs-border-width) var(--bs-border-style, solid) var(--bs-border-color);
    /* Add bottom border to each cell in light mode */
  }
}

/* Also support the app's data-theme toggle (used instead of prefers-color-scheme) */
html[data-bs-theme="dark"] .table-rounded-rows tbody tr td {
  border-bottom: none;
  /* Remove bottom border in explicit dark theme */
  /* border-bottom: var(--bs-border-width) var(--bs-border-style, solid) var(--bs-border-color); Ensure bottom border when theme is dark */
}

html[data-bs-theme="light"] .table-rounded-rows tbody tr td,
html:not([data-bs-theme]) .table-rounded-rows tbody tr td {
  border-bottom: var(--bs-border-width) var(--bs-border-style, solid) var(--bs-border-color);
  /* Ensure bottom border when theme is light or not set */
}

/* Custom styling for small floating labels */
.form-floating-sm>.form-control {
  height: calc(2.8rem + 2px);
  min-height: calc(2.8rem + 2px);
  padding: 1rem 0.75rem 0.25rem 0.75rem;
  font-size: 0.875rem;
}

.form-floating-sm>label {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transform-origin: 0 0;
  transition: opacity .1s ease-in-out, transform .1s ease-in-out;
}

.form-floating-sm>.form-control:focus~label,
.form-floating-sm>.form-control:not(:placeholder-shown)~label {
  transform: scale(.85) translateY(-0.5rem) translateX(0.15rem);
}

/* Targeted override for a specific custom class */
.form-floating-tertiary>label,
.form-floating-tertiary>label {
  color: var(--bs-tertiary-color) !important;
  opacity: 0.9 !important;
}

.form-floating-tertiary>label::after {
  background-color: var(--bs-tertiary-bg) !important;
}

/* style the .form-floating-tertiary inputs background */
.form-floating-tertiary>.form-control {
  background-color: var(--bs-tertiary-bg) !important;
  color: var(--bs-body-color) !important;
}

.btn-xs {
  padding: 0.35rem 0.5rem !important;
  font-size: 0.75rem;
  /* For buttons with icons, we want to keep the width consistent */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* If the button has an icon and text, we add a small gap */
  gap: 0.25rem;
  border-radius: 6px;
}

.btn-xs:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-xs:active {
  transform: translateY(0);
}

.btn-xs:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-xs:disabled:hover {
  opacity: 0.5;
  transform: none;
}

.btn-xs:disabled:active {
  transform: none;
}

.btn-xs:disabled:focus {
  box-shadow: none;
  outline: none;
}

.btn-xs:disabled:focus:hover {
  box-shadow: none;
  outline: none;
  transform: none;
}

/* Custom styling for Raw Code Textarea */
#block-block-raw_code,
.form-control-raw {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
}

/* choice card styles */
.choice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  height: 100%;
  padding: 1.1rem 1.05rem;
  border-radius: 0.75rem;
  border: 1.5px solid var(--bs-border-color);
  background: var(--bs-body-bg);
  color: var(--bs-body-color);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.choice-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
  color: var(--bs-body-color);
}

.choice-card-highlight {
  border-color: var(--bs-primary);
  background: color-mix(in srgb, var(--bs-primary) 6%, var(--bs-body-bg));
}

.choice-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.choice-icon-outline {
  background: var(--bs-body-bg);
  border: 1.5px solid var(--bs-border-color);
  color: var(--bs-secondary);
}

.choice-icon-filled {
  background: var(--bs-primary);
  color: #fff;
  box-shadow: 0 4px 10px rgba(13, 110, 253, 0.28);
}

.choice-title {
  font-size: 0.98rem;
  font-weight: 700;
}

.choice-desc {
  font-size: 0.8rem;
  color: var(--bs-secondary);
  line-height: 1.5;
  flex-grow: 1;
}

.choice-meta {
  font-size: 0.72rem;
  color: var(--bs-secondary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.choice-cta {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  padding: 0.4rem 0.75rem;
  border-radius: 0.4rem;
  border: 1.5px solid var(--bs-border-color);
}

.choice-card-highlight .choice-cta {
  border-color: transparent;
  background: var(--bs-primary);
  color: #fff;
}

.choice-pill {
  position: absolute;
  top: -9px;
  left: 1.05rem;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fff;
  background: var(--bs-primary);
  border-radius: 100px;
  padding: 0.2rem 0.55rem;
  box-shadow: 0 3px 8px rgba(13, 110, 253, 0.35);
}

/* Stat-tile grid inside a choice card (Maintenance dashboard's Trash/Reports
   counts) - a row of small KPI tiles (value + label) instead of a wrapping
   line of inline "N label" text, so a 3-stat and a 6-stat card both read as
   a clean, evenly-divided grid regardless of item count. */
.choice-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.choice-stat {
  text-align: center;
  padding: 0.5rem 0.35rem;
  border-top: 1px solid var(--bs-border-color-translucent, var(--bs-border-color));
  border-right: 1px solid var(--bs-border-color-translucent, var(--bs-border-color));
}

.choice-stats-grid-3 .choice-stat:nth-child(-n+3) {
  border-top: none;
}

.choice-stats-grid-3 .choice-stat:nth-child(3n) {
  border-right: none;
}

.choice-stats-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.choice-stats-grid-4 .choice-stat:nth-child(-n+4) {
  border-top: none;
}

.choice-stats-grid-4 .choice-stat:nth-child(4n) {
  border-right: none;
}

.choice-stat-value {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--bs-body-color);
}

.choice-stat-value.is-nonzero {
  color: var(--bs-warning-emphasis, #997404);
}

.choice-stat-label {
  margin-top: 0.15rem;
  font-size: 0.68rem;
  color: var(--bs-secondary);
  line-height: 1.25;
}

.content-admin-navbar {
  z-index: 1030;
  border-bottom: 1px solid var(--bs-border-color);
  /* background: var(--bs-tertiary-bg) !important; */
  /* box-shadow: 0 0.2rem 0.8rem rgba(var(--bs-body-color-rgb), 0.045); */
}

.content-admin-navbar>.container-fluid {
  gap: 0.75rem;
}

/* Brand */

.content-admin-brand {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
  margin-right: 1rem;
  padding: 0;
  color: var(--bs-heading-color);
  font-size: 0.88rem;
  font-weight: 650;
  white-space: nowrap;
}

.content-admin-brand:hover {
  color: var(--bs-primary);
}

.content-admin-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 0.5rem;
  background: rgba(var(--bs-primary-rgb), 0.12);
  color: var(--bs-primary);
  font-size: 0.82rem;
}

/* Primary navigation */

.content-admin-nav {
  gap: 0.15rem;
}

.content-admin-nav .nav-link {
  display: inline-flex;
  gap: 0.38rem;
  align-items: center;
  min-height: 2.15rem;
  padding: 0.35rem 0.55rem !important;
  border-radius: 0.5rem;
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
  font-weight: 550;
}

.content-admin-nav .nav-link:hover,
.content-admin-nav .nav-link:focus {
  background: rgba(var(--bs-primary-rgb), 0.08);
  color: var(--bs-primary);
}

.content-admin-nav .nav-link.active,
.content-admin-nav .nav-link.show {
  background: rgba(var(--bs-primary-rgb), 0.13);
  color: var(--bs-primary);
}

.content-admin-nav .nav-link i {
  font-size: 0.78rem;
}

.content-admin-nav .dropdown-toggle::after {
  margin-left: 0.1rem;
  font-size: 0.65rem;
}

/* Dropdown menus */

.content-admin-menu {
  width: min(20rem, calc(100vw - 2rem));
  padding: 0.45rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.75rem;
  background: var(--bs-body-bg);
  box-shadow:
    0 0.9rem 2.4rem rgba(var(--bs-body-color-rgb), 0.16);
}

.content-admin-menu-heading {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.5rem 0.55rem;
}

.content-admin-menu-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background: rgba(var(--bs-primary-rgb), 0.12);
  color: var(--bs-primary);
}

.content-admin-menu-heading strong,
.content-admin-menu-heading small {
  display: block;
}

.content-admin-menu-heading strong {
  color: var(--bs-heading-color);
  font-size: 0.76rem;
}

.content-admin-menu-heading small {
  margin-top: 0.05rem;
  color: var(--bs-secondary-color);
  font-size: 0.64rem;
}

.content-admin-menu .dropdown-divider {
  margin: 0.3rem 0;
}

.content-admin-menu .dropdown-item {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  min-height: 2.65rem;
  padding: 0.4rem 0.5rem;
  border-radius: 0.5rem;
  white-space: normal;
}

.content-admin-menu .dropdown-item>span:last-child {
  min-width: 0;
}

.content-admin-menu .dropdown-item strong,
.content-admin-menu .dropdown-item small {
  display: block;
}

.content-admin-menu .dropdown-item strong {
  color: inherit;
  font-size: 0.72rem;
  font-weight: 600;
}

.content-admin-menu .dropdown-item small {
  margin-top: 0.05rem;
  color: var(--bs-secondary-color);
  font-size: 0.62rem;
}

.content-admin-menu .dropdown-item:hover,
.content-admin-menu .dropdown-item:focus {
  background: var(--bs-tertiary-bg);
}

.content-admin-menu .dropdown-item.active {
  background: rgba(var(--bs-primary-rgb), 0.13);
  color: var(--bs-primary);
}

.content-admin-menu .dropdown-item.active small {
  color: var(--bs-primary-text-emphasis);
}

.content-admin-item-icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.45rem;
  color: var(--bs-secondary-color);
  font-size: 0.72rem;
}

.content-admin-menu .dropdown-item.active .content-admin-item-icon {
  border-color: rgba(var(--bs-primary-rgb), 0.35);
  background: rgba(var(--bs-primary-rgb), 0.1);
  color: var(--bs-primary);
}

/* Desktop utilities */

.content-admin-utilities {
  gap: 0.45rem;
  align-items: center;
  margin-left: auto;
}

.content-admin-utility-button,
.content-admin-user-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.1rem;
  border: 1px solid var(--bs-border-color);
  border-radius: 0.55rem;
  background: var(--bs-body-bg);
  color: var(--bs-secondary-color);
}

.content-admin-utility-button {
  width: 2.1rem;
  text-decoration: none;
}

.content-admin-utility-button:hover,
.content-admin-user-button:hover {
  border-color: rgba(var(--bs-primary-rgb), 0.45);
  color: var(--bs-primary);
}

.content-admin-user-button {
  gap: 0.4rem;
  padding: 0.15rem 0.45rem 0.15rem 0.2rem;
}

.content-admin-user-button img,
.content-admin-user-summary img {
  border-radius: 50%;
  object-fit: cover;
}

.content-admin-user-chevron {
  font-size: 0.6rem;
}

.content-admin-user-menu {
  min-width: 16rem;
  padding: 0.45rem;
  border-color: var(--bs-border-color);
  border-radius: 0.75rem;
  background: var(--bs-body-bg);
  box-shadow:
    0 0.9rem 2.4rem rgba(var(--bs-body-color-rgb), 0.16);
}

.content-admin-user-summary {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  padding: 0.5rem;
}

.content-admin-user-summary strong,
.content-admin-user-summary small {
  display: block;
}

.content-admin-user-summary strong {
  color: var(--bs-heading-color);
  font-size: 0.76rem;
}

.content-admin-user-summary small {
  max-width: 12rem;
  overflow: hidden;
  color: var(--bs-secondary-color);
  font-size: 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.content-admin-role-list {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  padding: 0 0.5rem 0.35rem;
}

.content-admin-role-list .badge {
  font-size: 0.58rem;
}

.content-admin-user-menu .dropdown-item {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  padding: 0.45rem 0.55rem;
  border-radius: 0.45rem;
  font-size: 0.72rem;
}

/* Mobile */

.content-admin-toggler {
  margin-left: auto;
  padding: 0.25rem 0.45rem;
  border-radius: 0.5rem;
}

.content-admin-mobile-utilities {
  display: grid;
  gap: 0.2rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--bs-border-color);
}

.content-admin-mobile-utilities a {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  padding: 0.5rem;
  border-radius: 0.45rem;
  color: var(--bs-secondary-color);
  font-size: 0.75rem;
  text-decoration: none;
}

.content-admin-mobile-utilities a:hover {
  background: var(--bs-tertiary-bg);
  color: var(--bs-primary);
}

@media (max-width: 1199.98px) {
  .content-admin-navbar {
    padding-block: 0.4rem;
  }

  .content-admin-navbar .navbar-collapse {
    margin-top: 0.5rem;
    padding: 0.55rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.7rem;
    background: var(--bs-body-bg);
  }

  .content-admin-nav {
    gap: 0.15rem;
  }

  .content-admin-nav .nav-link {
    width: 100%;
    justify-content: flex-start;
    padding: 0.5rem 0.6rem !important;
  }

  .content-admin-menu {
    width: 100%;
    margin: 0.2rem 0 0.35rem;
    border-radius: 0.6rem;
    box-shadow: none;
  }
}

@media (max-width: 575.98px) {
  .content-admin-brand {
    font-size: 0.8rem;
  }

  .content-admin-brand-icon {
    width: 1.75rem;
    height: 1.75rem;
  }
}

.plugin-nav {
  --plugin-nav-border: color-mix(in srgb, var(--bs-border-color) 78%, transparent);
  --plugin-nav-muted: var(--bs-secondary-color);
  --plugin-nav-soft: color-mix(in srgb, var(--bs-primary) 11%, transparent);
  padding: 0 12px;
  min-height: 48px;
  border-bottom: 1px solid var(--plugin-nav-border);
  background: color-mix(in srgb, var(--bs-body-bg) 94%, transparent);
  backdrop-filter: blur(14px);
}

.plugin-nav>.container-fluid {
  gap: .75rem;
}

.plugin-nav-brand {
  display: flex;
  gap: .6rem;
  align-items: center;
  min-width: 10.5rem;
  margin: 0;
  padding: 0;
  color: var(--bs-body-color);
}

.plugin-nav-brand:hover {
  color: var(--bs-body-color);
}

.plugin-nav-brand-mark {
  display: grid;
  flex: 0 0 2.25rem;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: .7rem;
  color: var(--bs-primary);
  background: var(--plugin-nav-soft);
}

.plugin-nav-brand-copy {
  display: grid;
  line-height: 1.05;
}

.plugin-nav-brand-copy strong {
  font-size: .9rem;
  font-weight: 750;
}

.plugin-nav-brand-copy small {
  margin-top: .18rem;
  color: var(--plugin-nav-muted);
  font-size: .63rem;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.plugin-nav-links {
  gap: .2rem;
  align-items: center;
  margin-left: .75rem;
}

.plugin-nav-links .nav-link {
  display: flex;
  gap: .4rem;
  align-items: center;
  min-height: 2.35rem;
  padding: .42rem .68rem !important;
  border-radius: .62rem;
  color: var(--plugin-nav-muted);
  font-size: .78rem;
  font-weight: 650;
}

.plugin-nav-links .nav-link:hover,
.plugin-nav-links .nav-link:focus-visible {
  color: var(--bs-body-color);
  background: var(--bs-tertiary-bg);
}

.plugin-nav-links .nav-link.active,
.plugin-nav-links .nav-link.show {
  color: var(--bs-primary);
  background: var(--plugin-nav-soft);
}

.plugin-nav-links .dropdown-toggle::after {
  margin-left: .1rem;
  font-size: .65rem;
}

.plugin-nav-mega-menu {
  width: min(36rem, calc(100vw - 2rem));
  margin-top: .16rem !important;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--plugin-nav-border);
  border-radius: .9rem;
  background: var(--bs-body-bg);
  box-shadow: 0 0.9rem 2.4rem rgba(var(--bs-body-color-rgb), 0.16);
}

/* active menu item highlight for mega menus */
.plugin-nav-menu-link .active,
.plugin-nav-menu-link.active,
.plugin-nav-menu-link:active,
.plugin-nav-menu-link:focus-visible {
  color: var(--bs-primary);
  background: var(--plugin-nav-soft);
}

.plugin-nav-menu-header {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: .85rem;
  border-bottom: 1px solid var(--plugin-nav-border);
  background: var(--bs-tertiary-bg);
}

.plugin-nav-menu-header>div {
  display: grid;
}

.plugin-nav-menu-header strong {
  font-size: .9rem;
  font-weight: 750;
}

.plugin-nav-menu-label,
.plugin-nav-menu-grid h2 {
  color: var(--bs-primary);
  font-size: .62rem;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.plugin-nav-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  padding: .75rem;
}

.plugin-nav-menu-grid section {
  min-width: 0;
}

.plugin-nav-menu-grid h2 {
  margin: 0;
  padding: .25rem .45rem .4rem;
}

.plugin-nav-menu-link {
  display: grid;
  grid-template-columns: 1.9rem minmax(0, 1fr);
  gap: .5rem;
  align-items: center;
  padding: .48rem;
  border-radius: .62rem;
  color: var(--bs-body-color);
  text-decoration: none;
}

.plugin-nav-menu-link>i {
  display: grid;
  width: 1.9rem;
  height: 1.9rem;
  place-items: center;
  border-radius: .52rem;
  color: var(--bs-primary);
  background: var(--plugin-nav-soft);
}

.plugin-nav-menu-link>span {
  display: grid;
  min-width: 0;
}

.plugin-nav-menu-link strong {
  overflow: hidden;
  font-size: .75rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plugin-nav-menu-link small {
  overflow: hidden;
  color: var(--plugin-nav-muted);
  font-size: .66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plugin-nav-menu-link:hover,
.plugin-nav-menu-link:focus-visible {
  color: var(--bs-body-color);
  background: var(--bs-tertiary-bg);
}

.plugin-nav-menu-footer {
  display: flex;
  gap: .35rem;
  padding: .6rem .75rem;
  border-top: 1px solid var(--plugin-nav-border);
  background: var(--bs-tertiary-bg);
}

.plugin-nav-menu-footer a {
  display: flex;
  gap: .4rem;
  align-items: center;
  padding: .4rem .55rem;
  border-radius: .55rem;
  color: var(--plugin-nav-muted);
  font-size: .7rem;
  font-weight: 650;
  text-decoration: none;
}

.plugin-nav-menu-footer a:first-child {
  flex: 1 1 auto;
}

.plugin-nav-menu-footer a:hover {
  color: var(--bs-primary);
  background: var(--plugin-nav-soft);
}

.plugin-nav-utilities {
  gap: .45rem;
  align-items: center;
  margin-left: auto;
}

.plugin-nav-icon-button,
.plugin-nav-user-button {
  display: inline-flex;
  gap: .45rem;
  align-items: center;
  justify-content: center;
  min-height: 2.35rem;
  border: 1px solid var(--plugin-nav-border);
  border-radius: .65rem;
  color: var(--plugin-nav-muted);
  background: transparent;
}

.plugin-nav-icon-button {
  width: 2.35rem;
  text-decoration: none;
}

.plugin-nav-user-button {
  padding: .25rem .5rem .25rem .3rem;
}

.plugin-nav-icon-button:hover,
.plugin-nav-user-button:hover {
  border-color: color-mix(in srgb, var(--bs-primary) 48%, var(--bs-border-color));
  color: var(--bs-primary);
  background: var(--plugin-nav-soft);
}

.plugin-nav-user-button img,
.plugin-nav-user-summary img {
  border-radius: .55rem;
  object-fit: cover;
}

.plugin-nav-user-name {
  max-width: 9rem;
  overflow: hidden;
  color: var(--bs-body-color);
  font-size: .72rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plugin-nav-user-button>.bi-chevron-down {
  font-size: .65rem;
}

.plugin-nav-user-menu {
  width: 17rem;
  padding: .45rem;
  border: 1px solid var(--plugin-nav-border);
  border-radius: .8rem;
  box-shadow: 0 1rem 2.5rem rgba(0, 0, 0, .18);
}

.plugin-nav-user-summary {
  display: flex;
  gap: .6rem;
  align-items: center;
  padding: .45rem;
}

.plugin-nav-user-summary>div {
  display: grid;
  min-width: 0;
}

.plugin-nav-user-summary strong,
.plugin-nav-user-summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.plugin-nav-user-summary strong {
  font-size: .78rem;
}

.plugin-nav-user-summary small {
  color: var(--plugin-nav-muted);
  font-size: .67rem;
}

.plugin-nav-role-list {
  display: flex;
  gap: .25rem;
  flex-wrap: wrap;
  padding: .2rem .45rem;
}

.plugin-nav-user-menu .dropdown-item {
  display: flex;
  gap: .5rem;
  align-items: center;
  padding: .48rem .55rem;
  border-radius: .5rem;
  font-size: .73rem;
}

.plugin-nav-mobile-utilities {
  display: grid;
  gap: .15rem;
  margin-top: .65rem;
  padding-top: .65rem;
  border-top: 1px solid var(--plugin-nav-border);
}

.plugin-nav-mobile-utilities a {
  display: flex;
  gap: .55rem;
  align-items: center;
  padding: .55rem .65rem;
  border-radius: .55rem;
  color: var(--plugin-nav-muted);
  font-size: .76rem;
  text-decoration: none;
}

.plugin-nav-mobile-utilities a:hover {
  background: var(--bs-tertiary-bg);
}

.plugin-nav-toggler {
  margin-left: auto;
  padding: .35rem .5rem;
  border-color: var(--plugin-nav-border);
}

@media (max-width: 1199.98px) {
  .plugin-nav {
    padding-inline: .6rem;
  }

  .plugin-nav .navbar-collapse {
    margin: .55rem -.6rem -.45rem;
    padding: .55rem .6rem .7rem;
    border-top: 1px solid var(--plugin-nav-border);
    background: var(--bs-body-bg);
  }

  .plugin-nav-links {
    gap: .15rem;
    align-items: stretch;
    margin: 0;
  }

  .plugin-nav-links .nav-link {
    justify-content: flex-start;
  }

  .plugin-nav-mega-menu {
    position: static !important;
    width: 100%;
    margin: .3rem 0 .45rem !important;
    transform: none !important;
    box-shadow: none;
  }
}

@media (max-width: 575.98px) {
  .plugin-nav-brand-copy small {
    display: none;
  }

  .plugin-nav-brand {
    min-width: 0;
  }

  .plugin-nav-menu-grid {
    grid-template-columns: 1fr;
  }

  .plugin-nav-menu-footer {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {

  .plugin-nav *,
  .plugin-nav *::before,
  .plugin-nav *::after {
    transition-duration: .01ms !important;
  }
}
/* ---------------------------------------------------------------------------
   Admin Toolbar (backlog N42) - a slim sticky strip at the top of the
   admin content area. Admin-area only. Styled to match the plugin admin
   navbar (.navbar-admin): solid body-bg, ~48px tall, hairline border +
   soft shadow.
   ------------------------------------------------------------------------- */
/* CMSAgent global admin toolbar v1.4
 * Load after base_admin/main.css.
 */

.admin-toolbar {
  --admin-toolbar-height: 48px;
  --admin-toolbar-surface: var(--bs-body-bg);
  --admin-toolbar-subtle: var(--bs-tertiary-bg);
  --admin-toolbar-border: var(--bs-border-color);
  --admin-toolbar-radius: .7rem;

  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-width: 0;
  height: var(--admin-toolbar-height);
  min-height: var(--admin-toolbar-height);
  padding: .3rem clamp(.65rem, 1.4vw, 1.15rem);
  color: var(--bs-body-color);
  background:
    linear-gradient(90deg, rgba(var(--bs-primary-rgb), .035), transparent 32%),
    var(--admin-toolbar-surface);
  border-bottom: 1px solid var(--admin-toolbar-border);
  box-shadow: 0 .2rem .7rem rgba(var(--bs-body-color-rgb), .055);
}

.admin-toolbar-left,
.admin-toolbar-right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.admin-toolbar-left { gap: .65rem; }
.admin-toolbar-right { gap: .38rem; margin-left: auto; }

.admin-toolbar-context,
.admin-toolbar-utilities {
  display: flex;
  align-items: center;
  gap: .42rem;
  min-width: 0;
}

.admin-toolbar-context {
  padding-right: .55rem;
  margin-right: .15rem;
  border-right: 1px solid var(--admin-toolbar-border);
}

/* Quick actions */
.admin-toolbar-quickadd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .38rem;
  min-height: 2.25rem;
  padding-inline: .78rem;
  border-radius: .6rem;
  font-size: .72rem;
  font-weight: 700;
  box-shadow: 0 .25rem .7rem rgba(var(--bs-primary-rgb), .16);
}

.admin-toolbar-quickadd::after { margin-left: .12rem; }

.admin-toolbar-view-site {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .38rem;
  min-height: 2.25rem;
  padding: .35rem .68rem;
  color: var(--bs-secondary-color);
  background: var(--admin-toolbar-surface);
  border: 1px solid var(--admin-toolbar-border);
  border-radius: .6rem;
  font-size: .7rem;
  font-weight: 650;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

.admin-toolbar-view-site:hover,
.admin-toolbar-view-site:focus-visible {
  color: var(--bs-primary);
  background: rgba(var(--bs-primary-rgb), .065);
  border-color: rgba(var(--bs-primary-rgb), .3);
}

.admin-toolbar-view-site:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .14);
}

.admin-toolbar-left .dropdown-menu,
.admin-toolbar-user-menu {
  margin-top: .42rem !important;
  padding: .42rem;
  color: var(--bs-body-color);
  background: var(--admin-toolbar-surface);
  border: 1px solid var(--admin-toolbar-border);
  border-radius: .8rem;
  box-shadow: 0 1rem 2.5rem rgba(var(--bs-body-color-rgb), .16);
}

.admin-toolbar-left .dropdown-menu { min-width: 13.5rem; }

.admin-toolbar .dropdown-item {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 2.25rem;
  padding: .48rem .62rem;
  border-radius: .5rem;
  color: var(--bs-body-color);
  font-size: .74rem;
  font-weight: 550;
}

.admin-toolbar .dropdown-item i {
  display: inline-grid;
  width: 1.2rem;
  place-items: center;
  color: var(--bs-secondary-color);
  font-size: .85rem;
}

.admin-toolbar .dropdown-item:hover,
.admin-toolbar .dropdown-item:focus {
  color: var(--bs-primary-text-emphasis);
  background: rgba(var(--bs-primary-rgb), .085);
}

.admin-toolbar .dropdown-item:hover i,
.admin-toolbar .dropdown-item:focus i { color: var(--bs-primary); }

.admin-toolbar .dropdown-item.text-danger:hover,
.admin-toolbar .dropdown-item.text-danger:focus {
  color: var(--bs-danger-text-emphasis) !important;
  background: var(--bs-danger-bg-subtle);
}

.admin-toolbar .dropdown-item.text-danger:hover i,
.admin-toolbar .dropdown-item.text-danger:focus i { color: inherit; }

.admin-toolbar .dropdown-divider {
  margin: .35rem .25rem;
  border-color: var(--admin-toolbar-border);
}

/* Environment and impersonation context */
.admin-toolbar-env,
.admin-toolbar-impersonating {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 1.8rem;
  padding: .25rem .55rem;
  border: 1px solid;
  border-radius: 50rem;
  font-size: .61rem;
  font-weight: 750;
  letter-spacing: .055em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.admin-toolbar-env {
  min-height: auto;
  padding: .2rem .3rem;
  color: var(--bs-secondary-color);
  background: transparent;
  border-color: transparent;
  border-radius: .35rem;
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .025em;
  text-transform: none;
  opacity: .78;
}

.admin-toolbar-env i {
  font-size: .65rem;
  opacity: .8;
}

.admin-toolbar-impersonating {
  color: var(--bs-danger-text-emphasis);
  background: var(--bs-danger-bg-subtle);
  border-color: var(--bs-danger-border-subtle);
  text-decoration: none;
}

.admin-toolbar-impersonating:hover {
  color: var(--bs-danger-text-emphasis);
  filter: brightness(.97);
}

/* Utility controls */
.admin-toolbar-theme,
.admin-toolbar-bell,
.admin-toolbar-reports,
.admin-toolbar-help,
.admin-toolbar-support,
.admin-toolbar-dashboard {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.25rem;
  color: var(--bs-secondary-color);
  background: transparent;
  border: 1px solid transparent;
  border-radius: .58rem;
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

.admin-toolbar-theme,
.admin-toolbar-bell {
  width: 2.25rem;
  padding: 0;
  font-size: .95rem;
}

.admin-toolbar-reports,
.admin-toolbar-help,
.admin-toolbar-support,
.admin-toolbar-dashboard {
  gap: .38rem;
  padding: .35rem .58rem;
  font-size: .72rem;
  font-weight: 650;
}

.admin-toolbar-theme:hover,
.admin-toolbar-theme:focus-visible,
.admin-toolbar-bell:hover,
.admin-toolbar-bell:focus-visible,
.admin-toolbar-bell.is-active,
.admin-toolbar-reports:hover,
.admin-toolbar-reports:focus-visible,
.admin-toolbar-reports.is-active,
.admin-toolbar-help:hover,
.admin-toolbar-help:focus-visible,
.admin-toolbar-help.is-active,
.admin-toolbar-support:hover,
.admin-toolbar-support:focus-visible,
.admin-toolbar-support.is-active,
.admin-toolbar-dashboard:hover,
.admin-toolbar-dashboard:focus-visible,
.admin-toolbar-dashboard.is-active {
  color: var(--bs-primary);
  background: rgba(var(--bs-primary-rgb), .075);
  border-color: rgba(var(--bs-primary-rgb), .22);
}

.admin-toolbar-theme:focus-visible,
.admin-toolbar-bell:focus-visible,
.admin-toolbar-reports:focus-visible,
.admin-toolbar-help:focus-visible,
.admin-toolbar-support:focus-visible,
.admin-toolbar-dashboard:focus-visible,
.admin-toolbar-user-btn:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .14);
}

.admin-toolbar-badge {
  position: absolute;
  top: -.12rem;
  right: -.16rem;
  display: inline-grid;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 .25rem;
  place-items: center;
  border: 2px solid var(--admin-toolbar-surface);
  font-size: .55rem;
  font-weight: 750;
  line-height: 1;
}

.admin-toolbar-badge[hidden] { display: none !important; }

/* Account trigger */
.admin-toolbar-user {
  min-width: 0;
  margin-left: .15rem;
  padding-left: .55rem;
  border-left: 1px solid var(--admin-toolbar-border);
}

.admin-toolbar-user-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-width: 0;
  min-height: 2.35rem;
  padding: .18rem .48rem .18rem .22rem;
  color: var(--bs-body-color);
  background: var(--admin-toolbar-subtle);
  border: 1px solid var(--admin-toolbar-border);
  border-radius: .68rem;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

.admin-toolbar-user-btn:hover,
.admin-toolbar-user-btn[aria-expanded="true"] {
  color: var(--bs-body-color);
  background: rgba(var(--bs-primary-rgb), .065);
  border-color: rgba(var(--bs-primary-rgb), .32);
}

.admin-toolbar-user-avatar,
.admin-toolbar-user-avatar > img,
.admin-toolbar-user-avatar > .user-initials {
  display: inline-grid;
  flex: 0 0 auto;
  width: 1.8rem;
  height: 1.8rem;
  place-items: center;
  border-radius: .52rem;
}

.admin-toolbar-user-avatar > img { object-fit: cover; }

.admin-toolbar-user-avatar > .user-initials {
  color: var(--bs-primary-text-emphasis);
  background: var(--bs-primary-bg-subtle);
  border: 1px solid var(--bs-primary-border-subtle);
  font-size: .7rem;
  font-weight: 750;
}

.admin-toolbar-user-meta {
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.12;
}

.admin-toolbar-user-name {
  max-width: 11rem;
  overflow: hidden;
  color: var(--bs-body-color);
  font-size: .72rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-toolbar-user-role {
  color: var(--bs-secondary-color);
  font-size: .55rem;
  font-weight: 750;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.admin-toolbar-user-btn .content-admin-user-chevron {
  margin-left: .12rem;
  color: var(--bs-secondary-color);
  font-size: .58rem;
  transition: transform .15s ease;
}

.admin-toolbar-user-btn[aria-expanded="true"] .content-admin-user-chevron {
  transform: rotate(180deg);
}

.admin-toolbar-user-menu { min-width: 17.5rem; }

.admin-toolbar-user-menu .content-admin-user-summary {
  display: flex;
  align-items: center;
  gap: .68rem;
  margin-bottom: .25rem;
  padding: .65rem;
  border: 1px solid rgba(var(--bs-primary-rgb), .16);
  border-radius: .65rem;
  background: rgba(var(--bs-primary-rgb), .055);
}

.admin-toolbar-user-menu .content-admin-user-summary strong,
.admin-toolbar-user-menu .content-admin-user-summary small { display: block; }

.admin-toolbar-user-menu .content-admin-user-summary strong {
  color: var(--bs-heading-color);
  font-size: .78rem;
}

.admin-toolbar-user-menu .content-admin-user-summary small {
  max-width: 13rem;
  overflow: hidden;
  color: var(--bs-secondary-color);
  font-size: .63rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-toolbar-user-menu .user-initials-lg {
  display: inline-grid;
  flex: 0 0 auto;
  width: 2.45rem;
  height: 2.45rem;
  place-items: center;
  border-radius: .7rem;
  color: var(--bs-primary-text-emphasis);
  background: var(--bs-primary-bg-subtle);
  border: 1px solid var(--bs-primary-border-subtle);
  font-weight: 750;
}

.admin-toolbar-user-menu .content-admin-role-list {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  padding: .15rem .5rem .25rem;
}

.admin-toolbar-user-menu .content-admin-role-list .badge {
  border-radius: 50rem;
  font-size: .56rem;
  font-weight: 650;
}

@media (max-width: 767.98px) {
  .admin-toolbar { gap: .55rem; }
  .admin-toolbar-right { gap: .2rem; }
  .admin-toolbar-env { max-width: 7rem; overflow: hidden; text-overflow: ellipsis; }
  .admin-toolbar-context { padding-right: .35rem; }
  .admin-toolbar-user { margin-left: .08rem; padding-left: .38rem; }
}

@media (max-width: 575.98px) {
  .admin-toolbar { padding: .3rem .5rem; }
  .admin-toolbar-env { display: none; }
  .admin-toolbar-context:empty { display: none; }
  .admin-toolbar-context { padding-right: 0; margin-right: 0; border-right: 0; }
  .admin-toolbar-theme,
  .admin-toolbar-bell { width: 2.1rem; min-height: 2.1rem; }
  .admin-toolbar-view-site { width: 2.1rem; min-height: 2.1rem; padding: 0; }
  .admin-toolbar-support { width: 2.1rem; min-height: 2.1rem; padding: 0; }
  .admin-toolbar-user { padding-left: .35rem; }
  .admin-toolbar-user-btn { min-height: 2.2rem; padding-right: .35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .admin-toolbar *,
  .admin-toolbar *::before,
  .admin-toolbar *::after { transition: none !important; }
}











