/**
 * Research Portal–style theme (teal-forward dashboard, inspired by ArcherLabCentral / ALC).
 * Loads after Bootstrap (index.css) to override colors and chrome only.
 */

/* ---- Light tokens (default) ---- */
:root,
html[data-theme="light"] {
  --rp-teal: #007a5e;
  --rp-teal-lighter: #2eb896;
  --rp-teal-light: #1a9a7a;
  --rp-teal-dark: #00513f;
  --rp-teal-dim: #e6f7f3;
  --rp-accent-from: #ff4b7d;
  --rp-accent-to: #ff7eb3;
  --rp-text: #2d3436;
  --rp-text-muted: #636e72;
  --rp-surface: #ffffff;
  --rp-shell: #f5f9f8;
  --rp-border: rgba(0, 0, 0, 0.078);
  --rp-toggle-on: #059669;
  --rp-toggle-on-border: #047857;
  --rp-toggle-focus-ring: rgba(5, 150, 105, 0.35);
  --page-title-gradient: linear-gradient(
    165deg,
    #1a9a7a 0%,
    #0f7560 42%,
    #005c47 72%,
    #003528 100%
  );
}

/* ---- Dark ---- */
html[data-theme="dark"] {
  --rp-text: #e8eaed;
  --rp-text-muted: #9aa0a6;
  --rp-surface: #1e2430;
  --rp-shell: #12161c;
  --rp-teal-dim: rgba(0, 122, 94, 0.18);
  --rp-border: rgba(255, 255, 255, 0.08);
  --rp-toggle-on: #6ee7b7;
  --rp-toggle-on-border: #6ee7b7;
  --rp-toggle-focus-ring: rgba(110, 231, 183, 0.45);
  --page-title-gradient: linear-gradient(
    165deg,
    #2eb896 0%,
    #1a9a7a 42%,
    #007a5e 72%,
    #00513f 100%
  );
}

html[data-theme="dark"] body.app {
  background-color: var(--rp-shell);
  color: var(--rp-text);
}

html[data-theme="dark"] .sidebar-inner,
html[data-theme="dark"] .sidebar-menu {
  background: var(--rp-surface) !important;
}

html[data-theme="dark"] .sidebar-menu li a {
  color: var(--rp-text-muted);
}

html[data-theme="dark"] .sidebar-menu > li.nav-item:not(.actived) > a.sidebar-link,
html[data-theme="dark"] .sidebar-menu > li.nav-item:not(.actived) > a.sidebar-link .title {
  color: var(--rp-text-muted);
}

html[data-theme="dark"] .sidebar-menu li a:hover,
html[data-theme="dark"] .sidebar-menu li a:focus {
  color: var(--rp-text);
}

html[data-theme="dark"] .header.navbar {
  background: var(--rp-surface) !important;
  border-bottom-color: var(--rp-border) !important;
}

html[data-theme="dark"] .main-content.bgc-grey-100 {
  background-color: var(--rp-shell) !important;
}

html[data-theme="dark"] .breadcrumb-item.active {
  color: var(--rp-text-muted);
}

html[data-theme="dark"] .header .c-grey-900 {
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .header .c-grey-600 {
  color: var(--rp-text-muted) !important;
}

/* Align Bootstrap palette with teal primary */
:root {
  --bs-primary: #007a5e;
  --bs-primary-rgb: 0, 122, 94;
  --bs-link-color: var(--rp-teal);
  --bs-link-hover-color: var(--rp-teal-dark);
  --bs-font-sans-serif: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --rp-font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---- Toggle switches: green ON state (darker in light mode, lighter in dark mode) ---- */
.form-switch .form-check-input:checked {
  background-color: var(--rp-toggle-on) !important;
  border-color: var(--rp-toggle-on-border) !important;
}

.form-switch .form-check-input:focus {
  border-color: var(--rp-toggle-on-border);
  box-shadow: 0 0 0 0.25rem var(--rp-toggle-focus-ring) !important;
}

.perm-toggle input:checked + .perm-toggle-slider {
  background-color: var(--rp-toggle-on) !important;
}

.perm-toggle input:focus-visible + .perm-toggle-slider {
  outline-color: var(--rp-toggle-focus-ring) !important;
}

/* ---- Typography: Inter globally (overrides index.css Roboto / Helvetica stack) ---- */
html {
  font-family: var(--rp-font-sans);
}

body.app,
body.auth-portal-theme {
  font-family: var(--rp-font-sans);
  color: var(--rp-text);
}

body.app :where(
  h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6,
  p, label, button, input, select, textarea, optgroup,
  .btn, .form-control, .form-select, .form-label,
  .table, .modal-content, .modal-title, .dropdown-menu,
  .nav, .nav-link, .breadcrumb, .card, .card-title, .card-text,
  .dataTables_wrapper, .fc, .flatpickr-calendar, .flatpickr-time,
  .sidebar-menu, .main-content, .header, .page-title, .alert
),
body.auth-portal-theme :where(
  h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6,
  p, label, button, input, select, textarea,
  .btn, .form-control, .form-select, .form-label, .login-card
) {
  font-family: var(--rp-font-sans);
}

.btn-primary {
  background-color: var(--rp-teal);
  border-color: var(--rp-teal);
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--rp-teal-dark);
  border-color: var(--rp-teal-dark);
}

.text-primary {
  color: var(--rp-teal) !important;
}

/* ---- Sidebar brand strip (Pulse-style) ---- */
.sidebar .sidebar-logo {
  --sidebar-brand-padding: 1.5rem;
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  min-height: 0 !important;
  padding: var(--sidebar-brand-padding) !important;
  line-height: normal !important;
  background: linear-gradient(
    165deg,
    var(--rp-teal-lighter) 0%,
    var(--rp-teal-light) 42%,
    var(--rp-teal) 72%,
    var(--rp-teal-dark) 100%
  ) !important;
  border-bottom: none !important;
  border-right: none !important;
}

/* Page titles — gradient text matching sidebar brand strip */
.page-header h2,
.pulse-logs-page-title {
  background-image: var(--page-title-gradient) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

.page-header h2 > i {
  background-image: var(--page-title-gradient) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

.sidebar-inline-toggle {
  position: absolute;
  right: var(--sidebar-brand-padding, 1.5rem);
  top: var(--sidebar-brand-padding, 1.5rem);
  transform: none;
}

.sidebar-logo .sidebar-brand-link {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.55rem !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 1.65rem 0 0 !important;
  position: relative;
  text-align: left;
  text-decoration: none !important;
}

.sidebar-logo a.sidebar-brand-link:hover .logo-title,
.sidebar-logo a.sidebar-brand-link:focus .logo-title {
  color: #fff !important;
  opacity: 0.94;
}

.sidebar-logo .logo-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.5rem;
  background: #fff;
  color: var(--rp-teal-light);
  font-family: var(--rp-font-sans) !important;
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

.sidebar-logo .logo-wordmark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.12rem;
  min-width: 0;
  flex: 1 1 auto;
}

.sidebar-logo .logo-title {
  display: block;
  color: #fff !important;
  font-family: var(--rp-font-sans) !important;
  font-weight: 700 !important;
  font-size: 1.02rem !important;
  line-height: 1.2 !important;
  letter-spacing: 0.01em !important;
  margin: 0 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.sidebar-logo .logo-tagline {
  display: block;
  color: rgba(255, 255, 255, 0.92) !important;
  font-family: var(--rp-font-sans) !important;
  font-weight: 400 !important;
  font-size: 0.68rem !important;
  line-height: 1.25 !important;
  letter-spacing: 0.01em !important;
  margin: 0 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Legacy logo classes (unused) */
.sidebar-logo .logo-icon,
.sidebar-logo .logo-text {
  display: none !important;
}

/* Legacy empty logo gutter (unused after brand text-only header) */
.sidebar .sidebar-logo a.sidebar-brand-link .logo {
  display: none !important;
}

.sidebar {
  border-right: 1px solid var(--rp-border);
  box-shadow: 4px 0 28px rgba(0, 0, 0, 0.04);
  background: var(--rp-surface) !important;
}

.sidebar-menu {
  border-right: none !important;
  background: transparent !important;
}

/* Sidebar link tone */
.sidebar-menu li a {
  color: #111827;
  border-radius: 10px;
  margin-inline: 8px;
  transition:
    background 0.18s ease,
    color 0.18s ease,
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s ease;
}

.sidebar-menu > li.nav-item:not(.actived) > a.sidebar-link,
.sidebar-menu > li.nav-item:not(.actived) > a.sidebar-link .title {
  color: #111827;
}

/* Top-level links without dropdown (Home, Activity Logs) — match dropdown row layout */
.sidebar-menu > li.nav-item:not(.dropdown) > a.sidebar-link {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 0.35rem;
  padding: 5px 15px !important;
  position: relative;
  white-space: nowrap;
  font-weight: 500;
}

.sidebar-menu > li.nav-item:not(.dropdown) > a.sidebar-link > .title {
  flex: 1 1 auto !important;
  min-width: 0;
}

.sidebar-menu > li.nav-item:not(.dropdown) > a.sidebar-link > .icon-holder {
  flex-shrink: 0;
}

.sidebar-menu li a:hover,
.sidebar-menu li a:focus-visible {
  transform: translateX(4px);
}

.sidebar-menu li a:hover .icon-holder,
.sidebar-menu li a:focus-visible .icon-holder {
  transform: translateY(-2px);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-menu li a .icon-holder {
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-menu li a,
  .sidebar-menu li a .icon-holder {
    transition: background 0.18s ease, color 0.18s ease;
  }

  .sidebar-menu li a:hover,
  .sidebar-menu li a:focus-visible,
  .sidebar-menu li a:hover .icon-holder,
  .sidebar-menu li a:focus-visible .icon-holder {
    transform: none;
  }
}

/* Slightly smaller sidebar nav text */
.sidebar-menu > li > a,
.sidebar-menu > li > a .title {
  font-size: 0.875rem !important;
}

.sidebar-menu > li > a .icon-holder {
  font-size: 18px !important;
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  margin-right: 10px !important;
}

.sidebar-menu .icon-holder i[class*="ti-"] {
  font-size: 18px !important;
  line-height: 1 !important;
  display: inline-block;
  vertical-align: middle;
  -webkit-text-stroke: 0.45px currentColor;
  paint-order: stroke fill;
}

.sidebar-menu > li.dropdown ul.dropdown-menu > li > a {
  font-size: 0.8125rem !important;
  padding: 6px 12px !important;
}

.sidebar-menu li a:hover,
.sidebar-menu li a:focus {
  color: var(--rp-text);
  text-decoration: none;
  background: var(--rp-teal-dim);
}

.sidebar-menu li a:hover .icon-holder i,
.sidebar-menu li a:focus .icon-holder i {
  color: var(--rp-teal) !important;
}

.sidebar-menu li.dropdown.open > a {
  color: var(--rp-text);
}

.sidebar-menu li.dropdown.open > a .icon-holder {
  color: var(--rp-teal) !important;
}

.icon-holder .c-green-500,
.sidebar-menu li a .ti-home,
.sidebar-menu li a .ti-user,
.sidebar-menu li a [class*="ti-"] {
  color: inherit;
}

.sidebar-menu > li.dropdown ul.dropdown-menu > li > a {
  padding: 8px 12px !important;
  border-radius: 8px;
  margin-inline: 4px;
  color: #111827 !important;
}

/* Active item: teal pill (ALC-style) */
.sidebar-menu li.actived > a.sidebar-link,
.sidebar-menu .dropdown-menu li.actived > .sidebar-link {
  background-color: var(--rp-teal) !important;
  color: #fff !important;
  font-weight: 600 !important;
}

.sidebar-menu li.actived > a.sidebar-link .title,
.sidebar-menu .dropdown-menu li.actived > .sidebar-link .title {
  color: #fff !important;
  font-weight: 600 !important;
}

.sidebar-menu li.actived > a.sidebar-link .icon-holder i,
.sidebar-menu .dropdown-menu li.actived > .sidebar-link .icon-holder i {
  color: #fff !important;
  opacity: 1 !important;
  -webkit-text-stroke: 0 !important;
}

.sidebar-menu li.actived > a.sidebar-link:hover,
.sidebar-menu li.actived > a.sidebar-link:focus,
.sidebar-menu li.actived > a.sidebar-link:hover .title,
.sidebar-menu li.actived > a.sidebar-link:focus .title,
.sidebar-menu .dropdown-menu li.actived > .sidebar-link:hover,
.sidebar-menu .dropdown-menu li.actived > .sidebar-link:focus {
  color: #fff !important;
  background-color: var(--rp-teal) !important;
}

.sidebar-menu li.actived > a.sidebar-link:hover .icon-holder i,
.sidebar-menu li.actived > a.sidebar-link:focus .icon-holder i,
.sidebar-menu .dropdown-menu li.actived > .sidebar-link:hover .icon-holder i,
.sidebar-menu .dropdown-menu li.actived > .sidebar-link:focus .icon-holder i {
  color: #fff !important;
}

.sidebar-menu .sidebar-link.actived::before {
  display: none !important;
}

/* Sidebar dropdown rows: flex so chevron lines up vertically with label */
.sidebar-menu > li.dropdown > a.dropdown-toggle {
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 0.35rem;
}

.sidebar-menu > li.dropdown > a.dropdown-toggle > .title {
  flex: 1 1 auto !important;
  min-width: 0;
}

.sidebar-menu > li.dropdown > a.dropdown-toggle > .icon-holder {
  flex-shrink: 0;
}

.sidebar-menu > li.dropdown > a.dropdown-toggle > .arrow {
  position: relative !important;
  inset: auto !important;
  right: auto !important;
  left: auto !important;
  top: auto !important;
  float: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  transform: none !important;
  line-height: 1 !important;
  flex-shrink: 0;
  width: 1.25rem;
  opacity: 0.62;
}

.sidebar-menu > li.dropdown > a.dropdown-toggle > .arrow i {
  display: inline-block;
  transition: transform 0.22s ease;
}

.sidebar-menu li.dropdown.open > a.dropdown-toggle > .arrow i {
  transform: rotate(-180deg);
}

/* ---- Top navbar ---- */
.header.navbar {
  background: var(--rp-surface) !important;
  border-bottom: 1px solid var(--rp-border) !important;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.03);
}

.breadcrumb-item {
  font-weight: 500;
}

.breadcrumb-item a {
  color: var(--rp-teal);
  text-decoration: none;
}

.breadcrumb-item a:hover {
  color: var(--rp-teal-dark);
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: var(--rp-text-muted);
}

/* Notification badge */
.notifications .counter,
#notification-count.counter,
.rp-notify-dot {
  background-color: var(--rp-teal) !important;
}

.notifications .dropdown-toggle.no-after .ti-bell,
#sidebar-toggle {
  color: var(--rp-text-muted);
}

.notifications .dropdown-toggle.no-after:hover .ti-bell,
#sidebar-toggle:hover {
  color: var(--rp-teal);
}

.notifications .announcements-bell-trigger .ti-bell {
  font-size: 1.125rem;
}

/* Keep top hamburger clickable above overlapping flex children */
.header.navbar .nav-left #sidebar-toggle,
.header.navbar .nav-left > li:first-child {
  position: relative;
  z-index: 850;
}

/* Theme toggle button — icon only, no surrounding box */
.theme-toggle-btn {
  border: none;
  background: transparent;
  color: var(--rp-text-muted);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.theme-toggle-btn:hover {
  background: var(--rp-teal-dim);
  color: var(--rp-teal);
}

/* Theme toggle icons: outlined moon (light UI) ↔ sun (dark UI) — driven by html[data-theme] */
.theme-toggle-btn svg.theme-svg,
.theme-toggle-auth svg.theme-svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  stroke: currentColor;
  display: none;
}

html:not([data-theme="dark"]) .theme-toggle-btn svg.theme-svg-moon,
html:not([data-theme="dark"]) .theme-toggle-auth svg.theme-svg-moon {
  display: block;
}

html:not([data-theme="dark"]) .theme-toggle-btn svg.theme-svg-sun,
html:not([data-theme="dark"]) .theme-toggle-auth svg.theme-svg-sun {
  display: none !important;
}

html[data-theme="dark"] .theme-toggle-btn svg.theme-svg-moon,
html[data-theme="dark"] .theme-toggle-auth svg.theme-svg-moon {
  display: none !important;
}

html[data-theme="dark"] .theme-toggle-btn svg.theme-svg-sun,
html[data-theme="dark"] .theme-toggle-auth svg.theme-svg-sun {
  display: block !important;
}


/* Navbar avatar only (name/role live in the dropdown) */
.nav-user-menu .nav-user-trigger {
  padding: 0;
}

.navbar-user-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* User account dropdown panel */
.header .user-account-dropdown,
.dropdown-menu.user-account-dropdown {
  padding: 0 !important;
  min-width: 17.5rem !important;
  max-width: 20rem;
  overflow: hidden;
  border: 1px solid var(--rp-border);
  border-radius: 12px;
  background: var(--rp-surface);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.1), 0 2px 8px rgba(15, 23, 42, 0.06);
}

html[data-theme="dark"] .header .user-account-dropdown,
html[data-theme="dark"] .dropdown-menu.user-account-dropdown {
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
}

.user-account-dropdown > li.user-account-menu-card {
  list-style: none;
  padding: 1rem 1rem 1rem !important;
  margin: 0;
}

.user-account-header {
  padding-bottom: 0.25rem;
}

.user-account-name {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--rp-text);
  line-height: 1.3;
}

.user-account-roles {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--rp-text-muted);
  line-height: 1.4;
}

.user-account-divider {
  height: 1px;
  background: var(--rp-border);
  margin: 0.75rem 0 0.5rem;
}

.user-account-link-secondary {
  display: block;
  padding: 0.25rem 0 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--rp-text-muted);
  text-decoration: none;
}

.user-account-link-secondary:hover {
  color: var(--rp-teal);
  text-decoration: underline;
}

.user-account-logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.85rem;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 10px;
  background: var(--rp-teal);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.user-account-logout-btn:hover {
  background: var(--rp-teal-dark);
  color: #fff;
}

.user-account-logout-btn svg {
  flex-shrink: 0;
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: linear-gradient(
    145deg,
    var(--rp-teal) 0%,
    var(--rp-teal-dark) 100%
  );
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---- Main workspace pattern ---- */
.main-content.bgc-grey-100 {
  background-color: var(--rp-shell) !important;
  background-image:
    radial-gradient(
      ellipse 900px 400px at 90% -10%,
      rgba(0, 122, 94, 0.065),
      transparent 55%
    ),
    radial-gradient(
      ellipse 600px 500px at 10% 100%,
      rgba(255, 75, 125, 0.04),
      transparent 45%
    );
}

/* Accent card helper (promo / admin banners) — optional class on any gradient card */
.rp-accent-banner {
  background: linear-gradient(
    120deg,
    var(--rp-accent-from) 0%,
    var(--rp-accent-to) 100%
  );
  border: none !important;
  border-radius: 14px !important;
  color: #fff !important;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 12px 32px rgba(255, 75, 125, 0.25);
}

/* Dashboard cards — dark mode readability */
html[data-theme="dark"] .event-card {
  background: var(--rp-surface) !important;
  border-color: var(--rp-border) !important;
  box-shadow: none;
}

html[data-theme="dark"] .event-title {
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .empty-state {
  color: var(--rp-text-muted);
}

/* ---- Announcements dropdown (navbar bell) ---- */
#approval-notification-menu.announcements-dropdown-menu,
.header .announcements-dropdown-menu {
  padding: 0 !important;
  min-width: 20rem !important;
  max-width: 22rem;
  overflow: hidden;
  border: 1px solid var(--rp-border);
  border-radius: 12px;
  background: var(--rp-surface);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.1), 0 2px 8px rgba(15, 23, 42, 0.06);
}

html[data-theme="dark"] #approval-notification-menu.announcements-dropdown-menu,
html[data-theme="dark"] .header .announcements-dropdown-menu {
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
}

.announcements-dropdown-menu > li.announcements-menu-card {
  list-style: none;
  padding: 0 !important;
  margin: 0;
}

.announcements-menu-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rp-border);
  background: var(--rp-surface);
}

.announcements-menu-header-bell {
  color: var(--rp-teal);
  font-size: 1.1rem;
  line-height: 1;
}

.announcements-menu-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--rp-text);
  letter-spacing: -0.02em;
}

.announcements-menu-body {
  min-height: 10rem;
  background: var(--rp-surface);
}

.announcements-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5rem 1.25rem;
}

.announcements-empty[hidden] {
  display: none !important;
}

.announcements-empty-bell {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.875rem;
  color: var(--rp-text-muted);
  opacity: 0.42;
}

.announcements-empty-text {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--rp-text-muted);
}

#notification-list.announcements-notification-list:not([hidden]) {
  display: block;
}

.announcements-notification-list {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
}

.announcements-notification-list::-webkit-scrollbar {
  width: 6px;
}

.announcements-notification-list::-webkit-scrollbar-thumb {
  background: #bdbdbd;
  border-radius: 3px;
}

html[data-theme="dark"] .announcements-notification-list::-webkit-scrollbar-thumb {
  background: #4a5465;
}

.announcements-notification-list::-webkit-scrollbar-thumb:hover {
  background: #9e9e9e;
}

html[data-theme="dark"] .announcements-notification-list::-webkit-scrollbar-thumb:hover {
  background: #5f6a7d;
}

/* ============================================================
   Dark mode readability overrides
   - Page titles, section headings (utility classes + custom)
   - Sidebar sub-menu hover/active text legibility
   - Modal surfaces, labels, and form controls
   ============================================================ */

/* --- Page title / heading utility classes --- */
html[data-theme="dark"] .c-grey-900,
html[data-theme="dark"] .cH-grey-900:hover,
html[data-theme="dark"] .c-grey-800,
html[data-theme="dark"] .cH-grey-800:hover,
html[data-theme="dark"] .c-grey-700,
html[data-theme="dark"] .cH-grey-700:hover,
html[data-theme="dark"] .c-black {
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .c-grey-600,
html[data-theme="dark"] .cH-grey-600:hover,
html[data-theme="dark"] .c-grey-500,
html[data-theme="dark"] .cH-grey-500:hover {
  color: var(--rp-text-muted) !important;
}

/* Custom inline page-header / section styles used across templates */
html[data-theme="dark"] .page-header h1,
html[data-theme="dark"] .page-header h3,
html[data-theme="dark"] .page-header h4,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .section-card .section-title {
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .page-subtitle {
  color: var(--rp-text-muted) !important;
}

html[data-theme="dark"] .section-card {
  background: var(--rp-surface) !important;
  border-color: var(--rp-border) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .table th {
  background-color: rgba(255, 255, 255, 0.04) !important;
  color: var(--rp-text) !important;
  border-bottom-color: var(--rp-border) !important;
}

html[data-theme="dark"] .table td,
html[data-theme="dark"] .table {
  color: var(--rp-text);
  border-color: var(--rp-border);
}

/* Generic white card surfaces used across pages (bgc-white) */
html[data-theme="dark"] .bgc-white,
html[data-theme="dark"] .bgc-lightest {
  background-color: var(--rp-surface) !important;
  color: var(--rp-text);
  border-color: var(--rp-border) !important;
}

/* --- Sidebar sub-menu hover/active in dark mode (override index.css) --- */
html[data-theme="dark"] .sidebar-menu > li.dropdown ul.dropdown-menu > li > a,
html[data-theme="dark"] .sidebar-menu > li.dropdown ul.dropdown-menu > li > a:hover,
html[data-theme="dark"] .sidebar-menu > li.dropdown ul.dropdown-menu > li > a:focus {
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .sidebar-menu > li.dropdown ul.dropdown-menu > li > a:hover,
html[data-theme="dark"] .sidebar-menu > li.dropdown ul.dropdown-menu > li > a:focus {
  background-color: var(--rp-teal-dim) !important;
}

html[data-theme="dark"] .sidebar-menu > li.dropdown ul.dropdown-menu > li.actived a {
  color: #fff !important;
}

/* --- Modals: full dark surface treatment --- */
html[data-theme="dark"] .modal-content {
  background-color: var(--rp-surface) !important;
  color: var(--rp-text);
  border: 1px solid var(--rp-border);
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
  border-color: var(--rp-border) !important;
}

/* Bootstrap utility classes used in modal headers (e.g. bg-light, bg-warning, bg-danger) */
html[data-theme="dark"] .modal-header.bg-light {
  background-color: rgba(255, 255, 255, 0.04) !important;
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .modal-header.bg-warning {
  background-color: #6e530a !important;
  color: #fff !important;
}

html[data-theme="dark"] .modal-header.bg-danger {
  background-color: #7a1f29 !important;
  color: #fff !important;
}

html[data-theme="dark"] .modal-title {
  color: inherit !important;
}

/* Scope modal text rules to .modal-content (not just .modal-body) — some
   templates put labels/textareas as siblings of .modal-body, e.g. the
   Deny Reservation Request modal. */
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .modal-content p,
html[data-theme="dark"] .modal-content strong,
html[data-theme="dark"] .modal-content label,
html[data-theme="dark"] .modal-content .form-label,
html[data-theme="dark"] .modal-content .form-check-label,
html[data-theme="dark"] .modal-content .col-form-label,
html[data-theme="dark"] .modal-content .modal-body {
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .modal-content .text-muted,
html[data-theme="dark"] .modal-content .form-text {
  color: var(--rp-text-muted) !important;
}

/* Preserve semantic emphasis colors inside dark-mode modals (lighter shades
   so they remain legible on the dark surface). */
html[data-theme="dark"] .modal-content .text-danger,
html[data-theme="dark"] .modal-content p.text-danger,
html[data-theme="dark"] .modal-content span.text-danger,
html[data-theme="dark"] .modal-content strong.text-danger,
html[data-theme="dark"] .modal-content div.text-danger {
  color: #f5b5bd !important;
}

html[data-theme="dark"] .modal-content .text-warning {
  color: #ffd166 !important;
}

html[data-theme="dark"] .modal-content .text-success {
  color: #a8e6c8 !important;
}

html[data-theme="dark"] .modal-content .text-info {
  color: #a4d4ee !important;
}

html[data-theme="dark"] .modal-content .text-primary {
  color: #4cd6b8 !important;
}

/* Bootstrap close (X) button — preserve background-image (do not use background shorthand) */
.modal-header .btn-close {
  background-color: transparent !important;
  opacity: 0.85;
}

html[data-theme="light"] .modal-header .btn-close,
html:not([data-theme="dark"]) .modal-header .btn-close {
  filter: none;
}

/* Bootstrap close (X) button visibility on dark headers */
html[data-theme="dark"] .modal-header .btn-close,
html[data-theme="dark"] .modal-header .modal-dismiss-x {
  filter: invert(1) grayscale(100%) brightness(2);
}

html[data-theme="dark"] .modal-header.bg-warning .btn-close,
html[data-theme="dark"] .modal-header.bg-danger .btn-close,
html[data-theme="dark"] .modal-header.bg-warning .modal-dismiss-x,
html[data-theme="dark"] .modal-header.bg-danger .modal-dismiss-x {
  filter: invert(1) grayscale(100%) brightness(2.2);
}

/* Modal dismiss — plain X icon, no border or button chrome */
.modal-header .modal-dismiss-x,
.modal-header .btn-close,
.modal-header .close {
  border: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
  outline: none !important;
}

.modal-header .modal-dismiss-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: 0 0 0 auto;
  padding: 0.15rem 0.35rem;
  color: #6c757d;
  font-size: 1.65rem;
  font-weight: 300;
  line-height: 1;
  opacity: 0.75;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.modal-header .modal-dismiss-x span {
  display: block;
  line-height: 1;
}

.modal-header .modal-dismiss-x:hover,
.modal-header .modal-dismiss-x:focus {
  color: #212529;
  opacity: 1;
  box-shadow: none !important;
  outline: none !important;
  text-decoration: none;
}

html[data-theme="dark"] .modal-header .modal-dismiss-x {
  color: #cbd5e1;
}

html[data-theme="dark"] .modal-header .modal-dismiss-x:hover,
html[data-theme="dark"] .modal-header .modal-dismiss-x:focus {
  color: #f8fafc;
}

.modal-header .btn-close:focus,
.modal-header .close:focus {
  box-shadow: none !important;
  outline: none !important;
}

/* --- Form controls inside modals & on pages in dark mode --- */
html[data-theme="dark"] .form-label,
html[data-theme="dark"] .col-form-label,
html[data-theme="dark"] label,
html[data-theme="dark"] legend {
  color: var(--rp-text);
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] textarea.form-control {
  background-color: rgba(255, 255, 255, 0.04);
  color: var(--rp-text);
  border-color: var(--rp-border);
}

/* Date / time inputs in dark mode — make their value text noticeably bolder
   so users can read the selected date/time at a glance. */
html[data-theme="dark"] input[type="date"],
html[data-theme="dark"] input[type="time"],
html[data-theme="dark"] input[type="datetime-local"],
html[data-theme="dark"] input[type="month"],
html[data-theme="dark"] input[type="week"] {
  color: var(--rp-text) !important;
  font-weight: 500;
}

/* Light mode: ensure the date/time value is the standard dark body text
   color (some custom rules elsewhere were dimming this). */
html:not([data-theme="dark"]) input[type="date"],
html:not([data-theme="dark"]) input[type="time"],
html:not([data-theme="dark"]) input[type="datetime-local"],
html:not([data-theme="dark"]) input[type="month"],
html:not([data-theme="dark"]) input[type="week"] {
  color: #212529;
  font-weight: 500;
}

html[data-theme="dark"] .form-control:focus,
html[data-theme="dark"] .form-select:focus {
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--rp-text);
  border-color: var(--rp-teal);
  box-shadow: 0 0 0 0.2rem rgba(0, 168, 132, 0.25);
}

html[data-theme="dark"] .form-control::placeholder {
  color: var(--rp-text-muted);
  opacity: 0.7;
}

html[data-theme="dark"] .form-control[readonly],
html[data-theme="dark"] .form-control:disabled {
  background-color: rgba(255, 255, 255, 0.02);
  color: var(--rp-text-muted);
}

/* Form-select chevron tinting for dark mode (default chevron is dark gray) */
html[data-theme="dark"] .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23e8eaed' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}

html[data-theme="dark"] .form-select option {
  background-color: var(--rp-surface);
  color: var(--rp-text);
}

html[data-theme="dark"] select.form-control option,
html[data-theme="dark"] select option {
  background-color: var(--rp-surface);
  color: var(--rp-text);
}

/* Reservation setup modals — white save/delete button text */
.rs-modal-save-btn {
  color: #ffffff !important;
}

.rs-modal-save-btn:hover,
.rs-modal-save-btn:focus {
  color: #ffffff !important;
}

/* Date / time inputs use a calendar/clock icon — invert it so it's visible */
html[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
html[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(1.2);
  cursor: pointer;
}

/* Make the entire date/time field clickable as a "picker trigger" hint */
input[type="time"],
input[type="date"],
input[type="datetime-local"] {
  cursor: pointer;
}

/* Inline alert chips in dark modals (.alert-warning et al.) */
html[data-theme="dark"] .alert.alert-warning {
  background-color: #423409;
  color: #ffe699;
  border-color: #6e530a;
}

html[data-theme="dark"] .alert.alert-danger {
  background-color: #4a181f;
  color: #f5b5bd;
  border-color: #7a1f29;
}

html[data-theme="dark"] .alert.alert-success {
  background-color: #14442f;
  color: #a8e6c8;
  border-color: #1f6b48;
}

html[data-theme="dark"] .alert.alert-info {
  background-color: #133040;
  color: #a4d4ee;
  border-color: #1d4868;
}

/* Custom card surfaces used in some templates */
html[data-theme="dark"] .bd {
  border-color: var(--rp-border) !important;
}

/* ---- Manage Users / Roles tables: hardcoded dark text colors that
   become invisible on dark surfaces. Re-tint for dark mode. ---- */
html[data-theme="dark"] .user-email,
html[data-theme="dark"] .user-name,
html[data-theme="dark"] .user-display-name {
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .user-sub,
html[data-theme="dark"] .user-meta {
  color: var(--rp-text-muted) !important;
}

/* Light pill backgrounds get a darker, slightly translucent teal-tinted
   surface in dark mode, with brighter text. */
html[data-theme="dark"] .role-pill {
  background: rgba(0, 168, 132, 0.16) !important;
  color: #5fe0c0 !important;
  border-color: rgba(0, 168, 132, 0.45) !important;
}

html[data-theme="dark"] .role-pill.role-empty {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--rp-text-muted) !important;
  border-color: var(--rp-border) !important;
}

/* DataTables styling on dark surfaces */
html[data-theme="dark"] table.dataTable tbody tr {
  background-color: transparent !important;
  color: var(--rp-text);
}

html[data-theme="dark"] table.dataTable tbody tr:hover,
html[data-theme="dark"] table.dataTable.table-hover tbody tr:hover > * {
  background-color: rgba(255, 255, 255, 0.03) !important;
  color: var(--rp-text);
}

html[data-theme="dark"] table.dataTable thead th,
html[data-theme="dark"] table.dataTable tfoot th {
  color: var(--rp-text) !important;
  border-color: var(--rp-border) !important;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_length,
html[data-theme="dark"] .dataTables_wrapper .dataTables_filter,
html[data-theme="dark"] .dataTables_wrapper .dataTables_info,
html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate {
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_length label,
html[data-theme="dark"] .dataTables_wrapper .dataTables_filter label {
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
html[data-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  color: var(--rp-text-muted) !important;
}

/* ---------------------------------------------------------------
   Per-page dark-mode sweep:
   These selectors are used by inline <style> blocks across admin
   pages (approval requests, roles & permissions, reservations,
   role change requests, etc.) and would otherwise stay locked to
   their hardcoded light-theme colors.
   --------------------------------------------------------------- */

/* Filter labels & inline section labels (2c3e50 text on light cards) */
html[data-theme="dark"] .filter-label,
html[data-theme="dark"] .filter-block .filter-label {
  color: var(--rp-text) !important;
}

/* Role & Permission Management page — role tabs */
html[data-theme="dark"] .role-tab {
  color: var(--rp-text-muted) !important;
}

html[data-theme="dark"] .role-tab:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: var(--rp-border) !important;
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .role-tab.active {
  background: rgba(110, 231, 183, 0.12) !important;
  border-color: #6ee7b7 !important;
  color: #6ee7b7 !important;
  box-shadow: 0 2px 4px rgba(110, 231, 183, 0.12) !important;
}

html[data-theme="dark"] .role-tab-count {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--rp-text-muted) !important;
}

html[data-theme="dark"] .role-tab.active .role-tab-count {
  background: rgba(110, 231, 183, 0.18) !important;
  color: #6ee7b7 !important;
}

html[data-theme="dark"] .role-selector-card {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: var(--rp-border) !important;
}

html[data-theme="dark"] .role-selector-label {
  color: var(--rp-text-muted) !important;
}

/* Permission editor card / toolbar / rows */
html[data-theme="dark"] .perm-editor-card {
  background: var(--rp-surface) !important;
  border-color: var(--rp-border) !important;
}

html[data-theme="dark"] .perm-toolbar {
  background: rgba(255, 255, 255, 0.03) !important;
  border-bottom-color: var(--rp-border) !important;
}

html[data-theme="dark"] .perm-search-wrap i {
  color: var(--rp-text-muted) !important;
}

html[data-theme="dark"] .perm-row {
  border-bottom-color: var(--rp-border) !important;
}

html[data-theme="dark"] .perm-row:hover {
  background: rgba(255, 255, 255, 0.03) !important;
}

html[data-theme="dark"] .perm-row-title {
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .perm-row-desc {
  color: var(--rp-text-muted) !important;
}

html[data-theme="dark"] .perm-category-header,
html[data-theme="dark"] .perm-empty-search,
html[data-theme="dark"] .roles-empty-card,
html[data-theme="dark"] .roles-empty-search,
html[data-theme="dark"] .form-note,
html[data-theme="dark"] .perm-unsaved-hint {
  color: var(--rp-text-muted) !important;
}

html[data-theme="dark"] .perm-category-header i {
  color: #6ee7b7 !important;
}

html[data-theme="dark"] .perm-toggle-slider {
  background-color: rgba(255, 255, 255, 0.18) !important;
}

html[data-theme="dark"] .perm-toggle input:checked + .perm-toggle-slider {
  background-color: var(--rp-toggle-on) !important;
}

html[data-theme="dark"] .roles-search-wrap i {
  color: var(--rp-text-muted) !important;
}

html[data-theme="dark"] .roles-count-pill {
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--rp-text-muted) !important;
}

html[data-theme="dark"] .roles-empty-card {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: var(--rp-border) !important;
}

html[data-theme="dark"] .perm-save-bar {
  border-top-color: var(--rp-border) !important;
}

/* Manage Reservation Requests — row tinting via inline style attributes
   (Bootstrap pastel greens/yellows) makes light text unreadable in dark
   mode. Override with darker, higher-contrast tints. */
html[data-theme="dark"] table.dataTable tbody tr[style*="d4edda"],
html[data-theme="dark"] table.dataTable tbody tr[style*="D4EDDA"] {
  background-color: rgba(20, 80, 50, 0.45) !important;
  color: var(--rp-text) !important;
}

html[data-theme="dark"] table.dataTable tbody tr[style*="fff3cd"],
html[data-theme="dark"] table.dataTable tbody tr[style*="FFF3CD"] {
  background-color: rgba(110, 80, 10, 0.45) !important;
  color: var(--rp-text) !important;
}

html[data-theme="dark"] table.dataTable tbody tr.table-danger,
html[data-theme="dark"] table.dataTable tbody tr.table-danger > * {
  background-color: rgba(120, 30, 40, 0.45) !important;
  color: var(--rp-text) !important;
}

/* Role Change Requests page — its status badges use light-pill colors.
   Re-tint for dark mode without changing semantics. */
html[data-theme="dark"] .badge-pending {
  background-color: rgba(255, 209, 102, 0.18) !important;
  color: #ffd166 !important;
}

/* User Management — empty-state container */
html[data-theme="dark"] .empty-state {
  color: var(--rp-text-muted) !important;
}

html[data-theme="dark"] .empty-state i {
  color: var(--rp-text-muted) !important;
  opacity: 0.7;
}

/* ---- Manage Timeslots & Available Days for Room ---- */
/* Each timeslot card (.slot-list .form-row) has a hard-coded #f8f9fa
   background that swallows the time text in dark mode. Theme it. */
html[data-theme="dark"] .slot-list .form-row {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid var(--rp-border);
  box-shadow: none !important;
}

html[data-theme="dark"] .slot-list .form-row .form-control,
html[data-theme="dark"] .slot-list .form-row input[type="time"] {
  background-color: var(--rp-surface) !important;
  color: var(--rp-text) !important;
  border-color: var(--rp-border) !important;
}

html[data-theme="dark"] .slot-list .form-row .remove-slot-btn,
html[data-theme="dark"] .slot-list .form-row .btn-link {
  color: var(--rp-text-muted) !important;
}

html[data-theme="dark"] .slot-list .form-row .remove-slot-btn:hover {
  color: #f5b5bd !important;
}

/* Ensure the timeslot cards still read clearly in light mode (the existing
   style is fine) — light-mode rule kept as-is, no override needed. */

/* The day checkbox column also has white surfaces in dark mode */
html[data-theme="dark"] .day-col,
html[data-theme="dark"] .timeslot-col {
  color: var(--rp-text);
}

/* The Autofill row in Manage Timeslots uses Bootstrap 4's `.form-row`,
   but the loaded Bootstrap CSS is Bootstrap 5 (which dropped `.form-row`
   entirely). That collapses the row into a vertical stack with no
   spacing. Re-implement `.form-row` as a flex container with sensible
   gaps so labels, inputs, and the Autofill button line up horizontally
   and breathe properly.                                            */
.form-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 0.5rem;
  column-gap: 0.75rem;
}

.form-row.align-items-end {
  align-items: flex-end;
}

.form-row.align-items-center {
  align-items: center;
}

.form-row > .col-auto {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.form-row > .col-auto > .col-form-label,
.form-row > .col-auto > label {
  margin-bottom: 0.25rem;
}

/* Light theme tweak: the slot card border looks crisper with a subtle line */
html:not([data-theme="dark"]) .slot-list .form-row {
  border: 1px solid #e6e8eb;
}

/* =====================================================================
   Dark mode: Reports pages (User Reports / Reservation Reports)
   These templates hardcode white/light backgrounds in inline <style>
   blocks, so we override them here to match the darker shell shown in
   the Logs page.
   ===================================================================== */
html[data-theme="dark"] .stat-card {
  background: var(--rp-surface) !important;
  border-color: var(--rp-border) !important;
}

html[data-theme="dark"] .stat-value {
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .stat-label,
html[data-theme="dark"] .stat-card .text-muted {
  color: var(--rp-text-muted) !important;
}

html[data-theme="dark"] .tab-content {
  background: var(--rp-surface) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .nav-tabs {
  border-bottom-color: var(--rp-border) !important;
}

html[data-theme="dark"] .nav-tabs .nav-link {
  color: var(--rp-text-muted) !important;
}

html[data-theme="dark"] .nav-tabs .nav-link:hover {
  color: var(--rp-text) !important;
  background-color: var(--rp-teal-dim) !important;
}

html[data-theme="dark"] .nav-tabs .nav-link.active {
  color: var(--rp-teal) !important;
  background-color: var(--rp-surface) !important;
  border-bottom-color: var(--rp-teal) !important;
}

html[data-theme="dark"] .roles-perms-tabs .nav-link.active {
  color: #6ee7b7 !important;
  background-color: rgba(110, 231, 183, 0.12) !important;
  border-bottom-color: #6ee7b7 !important;
}

html[data-theme="dark"] .date-filter-container,
html[data-theme="dark"] .filter-controls {
  background: var(--rp-shell) !important;
  border-color: var(--rp-border) !important;
}

html[data-theme="dark"] .date-filter-container label,
html[data-theme="dark"] .filter-controls label {
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .dashboard-section-title {
  color: var(--rp-text) !important;
  border-bottom-color: var(--rp-border) !important;
}

html[data-theme="dark"] .page-subtitle {
  color: var(--rp-text-muted) !important;
}

html[data-theme="dark"] .role-distribution-item {
  background: var(--rp-surface) !important;
  border-color: var(--rp-border) !important;
}

html[data-theme="dark"] .role-name {
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .role-count {
  color: var(--rp-teal) !important;
  background: var(--rp-teal-dim) !important;
}

/* =====================================================================
   Dark mode: View Available Rooms and Spaces (reservation finder)
   ===================================================================== */
html[data-theme="dark"] .reservation-finder {
  background-color: var(--rp-shell) !important;
}

html[data-theme="dark"] .advanced-btn,
html[data-theme="dark"] .search-input,
html[data-theme="dark"] .advanced-search-panel,
html[data-theme="dark"] .rooms-table-container {
  background: var(--rp-surface) !important;
  border-color: var(--rp-border) !important;
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .advanced-btn:hover {
  background: var(--rp-teal-dim) !important;
}

html[data-theme="dark"] .search-input::placeholder {
  color: var(--rp-text-muted) !important;
}

html[data-theme="dark"] .search-btn {
  background: var(--rp-teal-dim) !important;
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .search-btn:hover {
  background: var(--rp-border) !important;
}

html[data-theme="dark"] .rooms-table thead,
html[data-theme="dark"] .rooms-table th {
  background: var(--rp-shell) !important;
  color: var(--rp-text) !important;
  border-color: var(--rp-border) !important;
}

html[data-theme="dark"] .rooms-table th.sortable:hover {
  background: var(--rp-teal-dim) !important;
}

html[data-theme="dark"] .rooms-table td {
  color: var(--rp-text) !important;
  border-color: var(--rp-border) !important;
}

html[data-theme="dark"] .rooms-table tbody tr:hover {
  background-color: var(--rp-teal-dim) !important;
}

html[data-theme="dark"] .alert-info {
  background: var(--rp-surface) !important;
  color: var(--rp-text) !important;
  border-color: var(--rp-border) !important;
}

/* Bootstrap cards — used on All Conflicts and other admin pages */
html[data-theme="dark"] .card {
  background-color: var(--rp-surface) !important;
  border-color: var(--rp-border) !important;
  color: var(--rp-text);
}

html[data-theme="dark"] .card-header {
  background-color: rgba(255, 255, 255, 0.04) !important;
  border-bottom-color: var(--rp-border) !important;
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .card-body {
  background-color: var(--rp-surface) !important;
  color: var(--rp-text);
}

html[data-theme="dark"] .card h4,
html[data-theme="dark"] .card h5,
html[data-theme="dark"] .card h6,
html[data-theme="dark"] .card p,
html[data-theme="dark"] .card strong,
html[data-theme="dark"] .card small,
html[data-theme="dark"] .card td,
html[data-theme="dark"] .card th {
  color: var(--rp-text);
}

html[data-theme="dark"] .card-header.bg-info {
  background-color: rgba(13, 110, 253, 0.32) !important;
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .card-header.bg-info small,
html[data-theme="dark"] .card-header.bg-info strong {
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .table-light,
html[data-theme="dark"] .table-light > :not(caption) > * > * {
  background-color: rgba(255, 255, 255, 0.06) !important;
  color: var(--rp-text) !important;
  border-color: var(--rp-border) !important;
}

html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
  background-color: rgba(255, 255, 255, 0.03) !important;
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(even) > * {
  background-color: transparent !important;
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .table-bordered > :not(caption) > * > * {
  border-color: var(--rp-border) !important;
}

html[data-theme="dark"] .text-muted {
  color: var(--rp-text-muted) !important;
}

html[data-theme="dark"] .dataTables_wrapper .dataTables_length select,
html[data-theme="dark"] .dataTables_wrapper .dataTables_filter input {
  background-color: var(--rp-surface) !important;
  color: var(--rp-text) !important;
  border-color: var(--rp-border) !important;
}

/* All Conflicts — pastel row tints from inline page styles */
html[data-theme="dark"] tr.table-request,
html[data-theme="dark"] tr.table-request > * {
  background-color: rgba(110, 80, 10, 0.38) !important;
  color: var(--rp-text) !important;
}

html[data-theme="dark"] tr.table-reservation,
html[data-theme="dark"] tr.table-reservation > * {
  background-color: rgba(120, 30, 40, 0.38) !important;
  color: var(--rp-text) !important;
}

html[data-theme="dark"] .reference-card {
  border-color: var(--rp-border) !important;
}
