
body.prism-ui {
  /* light variant (theme-light) */
  --p-canvas: #f4f4f5;
  --p-surface: #ffffff;
  --p-surface-2: #fafafa;
  --p-input: #ffffff;
  --p-raised: #f1f1f2;
  --p-raised-2: #e6e6e8;
  --p-control: #e4e4e7; 
  --p-border: #e4e4e7;
  --p-border-strong: #d4d4d8;
  --p-text: #18181b;
  --p-text-2: #3f3f46;
  --p-muted: #71717a;
  --p-faint: #a1a1aa;
  --p-accent: #0e7490;
  --p-accent-soft: rgba(14, 116, 144, 0.10);
  --p-primary-bg: #18181b;
  --p-primary-fg: #ffffff;
  --p-primary-hover: #000000;
  --p-focus-ring: rgba(24, 24, 27, 0.10);
  --p-focus-border: #71717a;
  --p-success: #15803d;  --p-success-soft: rgba(21, 128, 61, 0.10);
  --p-danger: #dc2626;   --p-danger-soft: rgba(220, 38, 38, 0.09);
  --p-warning: #b45309;  --p-warning-soft: rgba(180, 83, 9, 0.10);
  --p-info: #0e7490;     --p-info-soft: rgba(14, 116, 144, 0.10);
  --p-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --p-shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.06);
  --p-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.14);
  --p-overlay: rgba(24, 24, 27, 0.45);
  --p-scroll: #d4d4d8;

  --p-radius-xs: 6px;
  --p-radius-sm: 8px;
  --p-radius: 12px;
  --p-radius-lg: 16px;
  --p-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --p-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --p-sidebar-w: 264px;
  --p-topbar-h: 60px;
  --p-gutter: 24px;
  --p-control-h: 36px;

  /* Bootstrap 5.x variables (tames the extra BS 5.3 stylesheet some pages load) */
  --bs-body-bg: var(--p-canvas);
  --bs-body-color: var(--p-text);
  --bs-border-color: var(--p-border);
  --bs-secondary-bg: var(--p-raised);
  --bs-tertiary-bg: var(--p-surface-2);
  --bs-emphasis-color: var(--p-text);
  --bs-secondary-color: var(--p-muted);
  --bs-heading-color: var(--p-text);
  --bs-link-color: var(--p-text);
  --bs-link-hover-color: var(--p-text);
  --bs-card-bg: var(--p-surface);
  --bs-table-bg: transparent;
  --bs-font-sans-serif: var(--p-font);
}
body.prism-ui.theme-dark {
  --p-canvas: #181818;
  --p-surface: #262626;
  --p-surface-2: #1f1f1f;
  --p-input: #1d1d1d;
  --p-raised: #303030;
  --p-raised-2: #3a3a3a;
  --p-control: #404040;
  --p-border: #333333;
  --p-border-strong: #424242;
  --p-text: #f5f5f5;
  --p-text-2: #d4d4d4;
  --p-muted: #a3a3a3;
  --p-faint: #737373;
  --p-accent: #6fdfed;
  --p-accent-soft: rgba(111, 223, 237, 0.10);
  --p-primary-bg: #f2f2f2;
  --p-primary-fg: #141414;
  --p-primary-hover: #ffffff;
  --p-focus-ring: rgba(255, 255, 255, 0.08);
  --p-focus-border: #8a8a8a;
  --p-success: #4ade80;  --p-success-soft: rgba(74, 222, 128, 0.11);
  --p-danger: #f87171;   --p-danger-soft: rgba(248, 113, 113, 0.11);
  --p-warning: #fbbf24;  --p-warning-soft: rgba(251, 191, 36, 0.11);
  --p-info: #6fdfed;     --p-info-soft: rgba(111, 223, 237, 0.10);
  --p-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --p-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.22);
  --p-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.5);
  --p-overlay: rgba(0, 0, 0, 0.6);
  --p-scroll: #3d3d3d;
}

/* ------------------------------------------------------------------ base */
body.prism-ui {
  background: var(--p-canvas) !important;
  color: var(--p-text);
  font-family: var(--p-font);
  font-size: 0.875rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.prism-ui #app { display: none; }
body.prism-ui :where(p, span, div, td, th, label, li, a, input, select, textarea, button, h1, h2, h3, h4, h5, h6, legend, small, strong) {
  font-family: var(--p-font);
}
body.prism-ui h1, body.prism-ui .h1 { font-size: 1.5rem; }
body.prism-ui h2, body.prism-ui .h2 { font-size: 1.3rem; }
body.prism-ui h3, body.prism-ui .h3 { font-size: 1.15rem; }
body.prism-ui h4, body.prism-ui .h4 { font-size: 1rem; }
body.prism-ui h5, body.prism-ui .h5 { font-size: 0.9375rem; }
body.prism-ui h6, body.prism-ui .h6 { font-size: 0.875rem; }
body.prism-ui :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .card-title, .page-title) {
  color: var(--p-text) !important;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
body.prism-ui a { color: var(--p-text); text-decoration: none; transition: color .15s var(--p-ease); }
body.prism-ui a:hover { color: var(--p-accent); }
body.prism-ui hr { border-color: var(--p-border); opacity: 1; margin: 12px 0; }
body.prism-ui small, body.prism-ui .small { color: var(--p-muted); }
body.prism-ui ::selection { background: var(--p-accent-soft); }

body.prism-ui .text-muted,
body.prism-ui .text-secondary,
body.prism-ui .text-gray-400,
body.prism-ui .text-gray-500,
body.prism-ui .text-gray-600 { color: var(--p-muted) !important; }
body.prism-ui .text-dark, body.prism-ui .text-black, body.prism-ui .text-body { color: var(--p-text) !important; }
body.prism-ui .text-primary, body.prism-ui .text-info { color: var(--p-accent) !important; }
body.prism-ui .text-success { color: var(--p-success) !important; }
body.prism-ui .text-danger { color: var(--p-danger) !important; }
body.prism-ui .text-warning { color: var(--p-warning) !important; }
body.prism-ui.theme-dark .text-white { color: var(--p-text) !important; }
body.prism-ui .bg-white, body.prism-ui .bg-light, body.prism-ui .bg-body { background-color: var(--p-surface) !important; color: var(--p-text); }
body.prism-ui .bg-primary, body.prism-ui .bg-dark, body.prism-ui .bg-secondary { background-color: var(--p-raised-2) !important; color: var(--p-text) !important; }
body.prism-ui .bg-info { background-color: var(--p-info-soft) !important; color: var(--p-info) !important; }
body.prism-ui .bg-success { background-color: var(--p-success-soft) !important; color: var(--p-success) !important; }
body.prism-ui .bg-danger { background-color: var(--p-danger-soft) !important; color: var(--p-danger) !important; }
body.prism-ui .bg-warning { background-color: var(--p-warning-soft) !important; color: var(--p-warning) !important; }
body.prism-ui .border, body.prism-ui .border-top, body.prism-ui .border-bottom,
body.prism-ui .border-start, body.prism-ui .border-end, body.prism-ui .border-left, body.prism-ui .border-right { border-color: var(--p-border) !important; }
body.prism-ui .shadow, body.prism-ui .shadow-sm, body.prism-ui .shadow-lg { box-shadow: var(--p-shadow-sm) !important; }

body.prism-ui ::-webkit-scrollbar { width: 8px; height: 8px; }
body.prism-ui ::-webkit-scrollbar-track { background: transparent; }
body.prism-ui ::-webkit-scrollbar-thumb { background: var(--p-scroll); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
body.prism-ui * { scrollbar-color: var(--p-scroll) transparent; scrollbar-width: thin; }

@media (prefers-reduced-motion: reduce) {
  body.prism-ui *, body.prism-ui *::before, body.prism-ui *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ============================================================ SIDEBAR === */
body.prism-ui #sidebar .sidebar-wrapper {
  width: var(--p-sidebar-w);
  background: var(--p-surface) !important;
  border-right: 1px solid var(--p-border);
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1040;
}
body.prism-ui #sidebar:not(.active) .sidebar-wrapper { left: calc(-1 * var(--p-sidebar-w) - 8px); }
body.prism-ui #sidebar.active .sidebar-wrapper { left: 0; }

body.prism-ui #sidebar .sidebar-header {
  padding: 18px 16px 10px;
  font-size: 1rem;
  font-weight: 600;
}
body.prism-ui #sidebar .sidebar-header img { height: auto; }
body.prism-ui #sidebar .logo img { filter: none !important; }
body.prism-ui #sidebar .prism-sidebar-topline { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
body.prism-ui #sidebar .sidebar-toggler.x { position: static; }
body.prism-ui #sidebar .sidebar-toggler a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--p-radius-sm);
  color: var(--p-muted); font-size: 1.1rem;
}
body.prism-ui #sidebar .sidebar-toggler a:hover { background: var(--p-raised); color: var(--p-text); }

/* ---- Pacslink / org logo: original colors on a light plate, subtle 3D ---- */
body.prism-ui .prism-logo-3d { perspective: 700px; display: block; flex: 1; min-width: 0; }
body.prism-ui .prism-logo-plate {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 8px 14px;
  border-radius: 12px;
  background: linear-gradient(160deg, #ffffff 0%, #f3f4f6 60%, #e9ebee 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06),
    0 1px 1px rgba(0, 0, 0, 0.18),
    0 6px 14px -4px rgba(0, 0, 0, 0.40),
    0 14px 26px -14px rgba(0, 0, 0, 0.55);
  transform: rotateX(10deg) translateZ(0);
  transform-style: preserve-3d;
  transition: transform .45s var(--p-ease), box-shadow .45s var(--p-ease);
  animation: prism-logo-settle .9s var(--p-ease) both;
  overflow: hidden;
  text-decoration: none;
}
body.prism-ui:not(.theme-dark) .prism-logo-plate { border: 1px solid var(--p-border); }
body.prism-ui .prism-logo-plate img {
  display: block;
  max-width: 100%;
  max-height: 36px;
  width: auto;
  height: auto;
  object-fit: contain;
  transform: translateZ(14px);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.18)) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.10)) !important;
}
body.prism-ui .prism-logo-plate::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: -60%;
  width: 40%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.65) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg);
  animation: prism-logo-sheen 9s ease-in-out 1.6s infinite;
  pointer-events: none;
}
body.prism-ui .prism-logo-3d:hover .prism-logo-plate {
  transform: rotateX(0deg) rotateY(-7deg) translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06),
    0 2px 2px rgba(0, 0, 0, 0.18),
    0 12px 22px -6px rgba(0, 0, 0, 0.45),
    0 22px 34px -18px rgba(0, 0, 0, 0.6);
}
@keyframes prism-logo-settle {
  0% { opacity: 0; transform: rotateX(28deg) translateY(6px) scale(.96); }
  100% { opacity: 1; transform: rotateX(10deg) translateY(0) scale(1); }
}
@keyframes prism-logo-sheen {
  0%, 82% { left: -60%; }
  100% { left: 130%; }
}

/* ---- user block ---- */
body.prism-ui .prism-user-card {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0 4px;
  padding: 10px;
  border-radius: var(--p-radius);
  background: var(--p-surface-2);
  border: 1px solid var(--p-border);
}
body.prism-ui .prism-user-avatar {
  flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.875rem;
  color: var(--p-text);
  background: var(--p-control);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}
body.prism-ui .prism-user-meta { flex: 1; min-width: 0; text-align: left; }
body.prism-ui .prism-user-meta h6 {
  margin: 0 !important; font-size: 0.8125rem !important; font-weight: 600 !important;
  color: var(--p-text) !important; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.prism-ui .prism-user-meta > span {
  display: block; font-size: 0.72rem !important; color: var(--p-muted) !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35;
}
body.prism-ui .prism-user-status { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
body.prism-ui #sidebar .online-status {
  width: 7px; height: 7px; margin: 0; border: 0; border-radius: 50%;
  background: var(--p-success); box-shadow: 0 0 0 3px var(--p-success-soft);
}
body.prism-ui #sidebar .online-status.away-status { background: var(--p-warning); box-shadow: 0 0 0 3px var(--p-warning-soft); }
body.prism-ui #sidebar .status-text { font-size: 0.7rem !important; color: var(--p-muted) !important; }

/* ---- nav ---- */
body.prism-ui #sidebar .sidebar-menu { flex: 1; display: flex; flex-direction: column; }
body.prism-ui #sidebar .menu { margin-top: 6px; padding: 0 12px 8px; font-weight: 500; }
body.prism-ui #sidebar .menu .sidebar-title {
  margin: 16px 0 6px; padding: 0 10px;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--p-faint) !important;
}
body.prism-ui #sidebar .menu .sidebar-item { margin: 1px 0; list-style: none; }
body.prism-ui #sidebar .menu .sidebar-link {
  display: flex; align-items: center; gap: 10px;
  min-height: 36px; padding: 7px 10px;
  border-radius: var(--p-radius-sm);
  border: 0 !important;
  background: transparent !important;
  color: var(--p-text-2) !important;
  font-size: 0.8125rem; font-weight: 500; line-height: 1.3;
  transition: background-color .15s var(--p-ease), color .15s var(--p-ease);
}
body.prism-ui #sidebar .menu .sidebar-link span { margin-left: 0; flex: 1; min-width: 0; color: inherit !important; white-space: normal; }
body.prism-ui #sidebar .menu .sidebar-link i,
body.prism-ui #sidebar .menu .sidebar-link svg { color: var(--p-muted) !important; font-size: 0.95rem; width: 18px; text-align: center; flex: none; fill: currentColor; }
body.prism-ui #sidebar .menu .sidebar-link::after,
body.prism-ui #sidebar .menu .sidebar-item.has-sub .sidebar-link::after { content: none !important; display: none !important; }
body.prism-ui #sidebar .menu .sidebar-link:hover { background: var(--p-raised) !important; color: var(--p-text) !important; }
body.prism-ui #sidebar .menu .sidebar-link:hover i { color: var(--p-text) !important; }

/* current page (leaf item, e.g. Dashboard) */
body.prism-ui #sidebar .menu .sidebar-item.active:not(.has-sub) > .sidebar-link {
  background: var(--p-raised-2) !important;
  color: var(--p-text) !important;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
body.prism-ui #sidebar .menu .sidebar-item.active > .sidebar-link i { color: var(--p-text) !important; }
/* group that contains the current page: text emphasised, no fill (the page itself is highlighted below) */
body.prism-ui #sidebar .menu .sidebar-item.has-sub.active > .sidebar-link { color: var(--p-text) !important; font-weight: 600; }

body.prism-ui #sidebar .prism-submenu-caret {
  margin-left: auto; font-size: 0.7rem !important; width: auto !important;
  color: var(--p-faint) !important; transition: transform .2s var(--p-ease);
}
body.prism-ui #sidebar .sidebar-item.has-sub.prism-open > .sidebar-link .prism-submenu-caret { transform: rotate(90deg); }

body.prism-ui #sidebar .menu .submenu {
  margin: 2px 0 6px 19px;
  padding: 0 0 0 10px;
  border-left: 1px solid var(--p-border-strong);
  background: transparent;
}
body.prism-ui #sidebar .menu .sidebar-item.has-sub.active > .submenu.active { display: block; }
body.prism-ui #sidebar .menu .submenu .submenu-item { list-style: none; }
body.prism-ui #sidebar .menu .submenu .submenu-item a {
  display: block;
  padding: 6px 10px;
  margin: 1px 0;
  border-radius: var(--p-radius-xs);
  font-size: 0.78rem; font-weight: 500; letter-spacing: 0;
  color: var(--p-muted) !important;
  transition: background-color .15s var(--p-ease), color .15s var(--p-ease);
}
body.prism-ui #sidebar .menu .submenu .submenu-item a:hover { margin-left: 0; background: var(--p-raised); color: var(--p-text) !important; }
body.prism-ui #sidebar .menu .submenu .submenu-item.active > a {
  background: var(--p-raised-2); color: var(--p-text) !important; font-weight: 600;
  position: relative;
}
body.prism-ui #sidebar .menu .submenu .submenu-item.active > a::before {
  content: ""; position: absolute; left: -11px; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--p-text);
}
body.prism-ui #sidebar .menu .submenu .submenu-item.disabled > a { opacity: .5; pointer-events: none; }

/* footer (theme switch + sign out) */
body.prism-ui .prism-sidebar-footer {
  margin-top: auto;
  padding: 12px 12px 16px;
  border-top: 1px solid var(--p-border);
  display: flex; flex-direction: column; gap: 10px;
  opacity: 1;
}
body.prism-ui .prism-theme-toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px; border-radius: var(--p-radius-sm); background: var(--p-surface-2); border: 1px solid var(--p-border);
  font-size: 0.75rem; color: var(--p-muted);
}
body.prism-ui .prism-theme-toggle .form-check { margin: 0; min-height: 0; padding-left: 2.5em; }
body.prism-ui .prism-theme-toggle .prism-theme-icon { color: var(--p-muted); font-size: .85rem; }
body.prism-ui .prism-theme-toggle .prism-theme-label { display: flex; align-items: center; gap: 8px; }
body.prism-ui .prism-signout-btn {
  display: flex !important; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 36px; padding: 7px 12px !important;
  font-size: 0.8125rem !important; font-weight: 500 !important;
  border-radius: var(--p-radius-sm) !important;
  background: transparent !important; color: var(--p-text-2) !important;
  border: 1px solid var(--p-border-strong) !important;
  margin: 0 !important;
}
body.prism-ui .prism-signout-btn:hover { background: var(--p-danger-soft) !important; color: var(--p-danger) !important; border-color: transparent !important; }
body.prism-ui .prism-signout-btn i { margin: 0 !important; }
body.prism-ui .prism-powered { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.68rem; color: var(--p-faint); }
body.prism-ui .prism-powered img { height: 14px; width: auto; filter: none !important; opacity: .9; background: #fff; border-radius: 4px; padding: 2px 4px; box-sizing: content-box; }

/* mobile overlay behind the off-canvas sidebar */
body.prism-ui .prism-sidebar-overlay { display: none; }
@media (max-width: 1199.98px) {
  body.prism-ui #sidebar.active ~ .prism-sidebar-overlay {
    display: block; position: fixed; inset: 0; z-index: 1030;
    background: var(--p-overlay); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  }
  body.prism-ui #sidebar.active .sidebar-wrapper { box-shadow: var(--p-shadow-lg); }
}

/* ======================================================== MAIN / TOPBAR == */
body.prism-ui #main {
  margin-left: var(--p-sidebar-w);
  padding: 0 var(--p-gutter) var(--p-gutter);
  min-height: 100vh;
  background: var(--p-canvas);
  transition: margin-left .35s var(--p-ease);
}
body.prism-ui #sidebar:not(.active) ~ #main { margin-left: 0; }
@media (max-width: 1199.98px) { body.prism-ui #main { margin-left: 0; } }

body.prism-ui .prism-topbar {
  position: sticky; top: 0; z-index: 1020;
  margin: 0 calc(-1 * var(--p-gutter)) 20px;
  padding: 0 var(--p-gutter);
  height: var(--p-topbar-h);
  display: flex; align-items: center;
  background: color-mix(in srgb, var(--p-surface) 88%, transparent) !important;
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--p-border);
}
body.prism-ui .prism-topbar .navbar {
  position: static !important;
  width: 100%;
  height: 100%;
  padding: 0 !important;
  margin: 0 !important;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: transparent !important;
  border: 0 !important;
}
body.prism-ui .prism-topbar .navbar-toggler { display: none !important; }
body.prism-ui .prism-topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
body.prism-ui .prism-burger {
  display: inline-flex !important; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none;
  border-radius: var(--p-radius-sm);
  color: var(--p-text-2) !important;
  line-height: 1 !important;
}
body.prism-ui .prism-burger i { font-size: 1.25rem !important; height: auto; }
body.prism-ui .prism-burger:hover { background: var(--p-raised); color: var(--p-text) !important; }
body.prism-ui .prism-crumbs { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 0.875rem; }
body.prism-ui .prism-crumb-module { color: var(--p-muted); white-space: nowrap; }
body.prism-ui .prism-crumb-sep { color: var(--p-faint); font-size: .7rem; }
body.prism-ui .prism-crumb-page { color: var(--p-text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.prism-ui .prism-topbar-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
body.prism-ui .prism-topbar-org {
  max-width: 320px; padding: 6px 12px;
  border-radius: 999px; border: 1px solid var(--p-border);
  background: var(--p-surface-2);
  font-size: 0.72rem; font-weight: 500; letter-spacing: .02em; color: var(--p-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.prism-ui .prism-topbar-user { display: flex; align-items: center; gap: 10px; }
body.prism-ui .prism-topbar-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--p-control); color: var(--p-text);
  font-weight: 600; font-size: 0.8125rem;
}
@media (max-width: 767.98px) {
  body.prism-ui .prism-crumb-module, body.prism-ui .prism-crumb-sep { display: none; }
}
@media (max-width: 575.98px) {
  body.prism-ui { --p-gutter: 14px; --p-topbar-h: 56px; }
  body.prism-ui .prism-topbar { margin-bottom: 14px; }
}

/* legacy per-page burger headers are superseded by the topbar burger */
body.prism-ui #main > header:not(.prism-topbar) { display: none !important; }
body.prism-ui .navbar-top { position: static; }

/* page structure */
body.prism-ui .page-content, body.prism-ui #main-content { padding: 0; background: transparent; }
body.prism-ui .page-content > section, body.prism-ui section.section, body.prism-ui section.top { margin: 0; }
body.prism-ui .page-heading { margin: 0 0 16px; }
body.prism-ui .page-heading h3 { font-size: 1.25rem; }
body.prism-ui .row.match-height > [class*="col"] { display: flex; flex-direction: column; }
body.prism-ui .row.match-height > [class*="col"] > .card { flex: 1; }

/* page header component */
body.prism-ui .prism-page-header {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  margin: 0 0 16px;
}
body.prism-ui .prism-page-title { margin: 0; font-size: 1.375rem !important; font-weight: 700 !important; letter-spacing: -0.02em; }
body.prism-ui .prism-page-subtitle { margin: 2px 0 0; font-size: 0.8125rem; color: var(--p-muted); }
body.prism-ui .prism-page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ================================================================ CARDS == */
body.prism-ui .card {
  background: var(--p-surface) !important;
  border: 1px solid var(--p-border) !important;
  border-radius: var(--p-radius) !important;
  box-shadow: none !important;
  color: var(--p-text);
  margin-bottom: 16px;
}
body.prism-ui .card .card {
  background: var(--p-surface-2) !important;
  margin-bottom: 12px;
}
body.prism-ui .card-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 12px 16px !important;
  background: transparent !important;
  border-bottom: 1px solid var(--p-border) !important;
  border-radius: var(--p-radius) var(--p-radius) 0 0 !important;
  color: var(--p-text);
  font-weight: 600;
}
body.prism-ui .card-header :is(h1, h2, h3, h4, h5, h6, .card-title) { margin: 0 !important; font-size: 0.9375rem !important; font-weight: 600 !important; }
body.prism-ui .card-body { padding: 16px !important; color: var(--p-text); }
body.prism-ui .card-content { padding: 0; }
body.prism-ui .card-footer { background: transparent !important; border-top: 1px solid var(--p-border) !important; padding: 12px 16px; }
body.prism-ui .card-title { font-size: 0.9375rem; }

/* stat / KPI tiles */
body.prism-ui .stats-icon {
  width: 40px !important; height: 40px !important; border-radius: 10px !important;
  display: inline-flex !important; align-items: center; justify-content: center;
  background: var(--p-raised) !important; color: var(--p-accent) !important;
}
body.prism-ui .stats-icon i { color: inherit !important; font-size: 1.1rem; }
body.prism-ui .prism-stat {
  display: flex; align-items: center; gap: 12px;
}
body.prism-ui .prism-stat-icon {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--p-border-strong); color: var(--p-accent); font-size: 1.1rem;
}
body.prism-ui .prism-stat-label { font-size: 0.75rem; color: var(--p-muted); line-height: 1.2; }
body.prism-ui .prism-stat-value { font-size: 1.25rem; font-weight: 600; color: var(--p-text); line-height: 1.25; }
body.prism-ui .prism-stat-value small { font-size: .75rem; color: var(--p-muted); font-weight: 500; }

/* welcome / org card (dashboard) */
body.prism-ui .prism-welcome-body { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
body.prism-ui .prism-welcome-logo {
  width: 64px; height: 64px; flex: none; border-radius: 14px; padding: 8px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, #ffffff, #eef0f2);
  box-shadow: 0 1px 1px rgba(0,0,0,.2), 0 8px 18px -8px rgba(0,0,0,.5);
}
body.prism-ui .prism-welcome-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
body.prism-ui .prism-welcome-text { flex: 1; min-width: 180px; }
body.prism-ui .prism-welcome-eyebrow { margin: 0 0 2px !important; font-size: 0.6875rem !important; letter-spacing: .06em; text-transform: uppercase; color: var(--p-faint) !important; font-weight: 600 !important; }
body.prism-ui .prism-welcome-title { margin: 0 0 8px !important; font-size: 1.125rem !important; }
body.prism-ui .prism-welcome-badge,
body.prism-ui .prism-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 500; color: var(--p-text-2);
  background: var(--p-raised); border: 1px solid var(--p-border);
}

/* chart cards */
body.prism-ui .prism-chart-header { justify-content: flex-start; gap: 12px; }
body.prism-ui .prism-chart-icon {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--p-border-strong); color: var(--p-accent); background: transparent;
}
body.prism-ui .prism-chart-header h4 { font-size: 0.9375rem !important; }
body.prism-ui .prism-chart-subtitle { margin: 1px 0 0; font-size: 0.75rem; color: var(--p-muted); }

/* account card (dashboard right column) */
body.prism-ui .prism-account-card { text-align: center; }
body.prism-ui .prism-account-avatar {
  width: 76px; height: 76px; margin: 4px auto 12px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 600; color: var(--p-text);
  background: var(--p-control);
  box-shadow: 0 0 0 4px var(--p-surface), 0 0 0 5px var(--p-border-strong);
}
body.prism-ui .prism-account-name { margin: 0 0 2px !important; font-size: 1rem !important; }
body.prism-ui .prism-account-role { margin: 0 0 14px; font-size: 0.8125rem; color: var(--p-muted); }
body.prism-ui .prism-account-rows { border-top: 1px solid var(--p-border); text-align: left; }
body.prism-ui .prism-account-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--p-border); font-size: 0.8125rem;
}
body.prism-ui .prism-account-row:last-child { border-bottom: 0; padding-bottom: 0; }
body.prism-ui .prism-account-row span { color: var(--p-muted); }
body.prism-ui .prism-account-row strong { color: var(--p-text); font-weight: 500; text-align: right; overflow-wrap: anywhere; }
body.prism-ui .prism-account-status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--p-success); margin-right: 6px; box-shadow: 0 0 0 3px var(--p-success-soft); vertical-align: middle; }

/* skeleton loaders */
body.prism-ui .skeleton-loader { display: flex; gap: 10px; align-items: flex-end; height: 260px !important; }
body.prism-ui .skeleton-bar, body.prism-ui .skeleton, body.prism-ui .skeleton-box {
  background: linear-gradient(90deg, var(--p-surface-2) 25%, var(--p-raised) 37%, var(--p-surface-2) 63%) !important;
  background-size: 400% 100% !important;
  animation: prism-shimmer 1.4s ease-in-out infinite !important;
  border-radius: var(--p-radius-sm);
}
body.prism-ui .skeleton-bar:nth-child(1) { height: 55% !important; }
body.prism-ui .skeleton-bar:nth-child(2) { height: 80% !important; }
body.prism-ui .skeleton-bar:nth-child(3) { height: 45% !important; }
body.prism-ui .skeleton-bar:nth-child(4) { height: 95% !important; }
body.prism-ui .skeleton-bar:nth-child(5) { height: 65% !important; }
@keyframes prism-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ================================================================ FORMS == */
body.prism-ui label,
body.prism-ui .form-label,
body.prism-ui .col-form-label {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 0.75rem !important;
  font-weight: 500 !important;
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: var(--p-muted) !important;
}
body.prism-ui .col-form-label { padding-top: calc((var(--p-control-h) - 1rem) / 2); padding-bottom: 0; }
body.prism-ui .form-check-label, body.prism-ui .form-check label { color: var(--p-text-2) !important; font-size: 0.8125rem !important; margin-bottom: 0; }
body.prism-ui .form-group, body.prism-ui .mb-3.form-group, body.prism-ui .mb-4.form-group { margin-bottom: 12px; }
body.prism-ui form .row, body.prism-ui .form-body .row, body.prism-ui .card-body .row, body.prism-ui .modal-body .row { --bs-gutter-x: 1rem; }
body.prism-ui fieldset { border: 0; padding: 0; margin: 0 0 8px; }
body.prism-ui legend, body.prism-ui .form-section-title {
  display: block; width: 100%;
  margin: 4px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--p-border);
  font-size: 0.75rem !important; font-weight: 600 !important; letter-spacing: .05em; text-transform: uppercase;
  color: var(--p-muted) !important;
}

body.prism-ui .form-control,
body.prism-ui .form-select,
body.prism-ui select.form-control,
body.prism-ui input[type="text"]:not(.select2-search__field):not(.choices__input),
body.prism-ui input[type="number"], body.prism-ui input[type="email"], body.prism-ui input[type="password"],
body.prism-ui input[type="date"], body.prism-ui input[type="time"], body.prism-ui input[type="datetime-local"],
body.prism-ui input[type="search"], body.prism-ui input[type="tel"], body.prism-ui input[type="month"],
body.prism-ui textarea,
body.prism-ui .choices__inner,
body.prism-ui .textarea-like {
  min-height: var(--p-control-h);
  padding: 6px 10px;
  font-size: 0.8125rem !important;
  line-height: 1.4;
  color: var(--p-text) !important;
  background-color: var(--p-input) !important;
  border: 1px solid var(--p-border-strong) !important;
  border-radius: var(--p-radius-sm) !important;
  box-shadow: none !important;
  transition: border-color .15s var(--p-ease), box-shadow .15s var(--p-ease), background-color .15s var(--p-ease);
  max-width: 100%;
}
body.prism-ui input.form-check-input { min-height: 0; padding: 0; }
body.prism-ui .form-control-sm, body.prism-ui .form-select-sm { min-height: 32px; padding: 4px 9px; font-size: 0.78rem !important; }
body.prism-ui .form-control-lg, body.prism-ui .form-control-xl, body.prism-ui .form-select-lg { min-height: 42px; padding: 8px 12px; font-size: 0.875rem !important; }
body.prism-ui textarea, body.prism-ui textarea.form-control { min-height: 72px; resize: vertical; }
body.prism-ui .form-select, body.prism-ui select.form-control {
  padding-right: 30px;
  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='%23a3a3a3' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.6' d='m4 6 4 4 4-4'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 9px center !important;
  background-size: 14px 14px !important;
  -webkit-appearance: none; appearance: none;
}
body.prism-ui select[multiple].form-control, body.prism-ui select[multiple].form-select, body.prism-ui select[size].form-select { background-image: none !important; padding-right: 10px; }
body.prism-ui .form-control::placeholder, body.prism-ui textarea::placeholder, body.prism-ui input::placeholder { color: var(--p-faint) !important; opacity: 1; }
body.prism-ui .form-control:hover:not(:disabled):not([readonly]), body.prism-ui .form-select:hover:not(:disabled) { border-color: var(--p-focus-border) !important; }
body.prism-ui .form-control:focus, body.prism-ui .form-select:focus, body.prism-ui textarea:focus,
body.prism-ui input:focus:not(.form-check-input):not(.select2-search__field), body.prism-ui .textarea-like:focus {
  outline: none;
  border-color: var(--p-focus-border) !important;
  box-shadow: 0 0 0 3px var(--p-focus-ring) !important;
}
body.prism-ui .form-control:disabled, body.prism-ui .form-control[readonly], body.prism-ui .form-select:disabled,
body.prism-ui input:disabled, body.prism-ui input[readonly], body.prism-ui textarea[readonly] {
  background-color: var(--p-surface-2) !important;
  color: var(--p-muted) !important;
  border-color: var(--p-border) !important;
  opacity: 1;
}
body.prism-ui.theme-dark input[type="date"]::-webkit-calendar-picker-indicator,
body.prism-ui.theme-dark input[type="time"]::-webkit-calendar-picker-indicator,
body.prism-ui.theme-dark input[type="datetime-local"]::-webkit-calendar-picker-indicator,
body.prism-ui.theme-dark input[type="month"]::-webkit-calendar-picker-indicator { filter: invert(0.75); cursor: pointer; }
body.prism-ui.theme-dark input { color-scheme: dark; }
body.prism-ui input[type="file"].form-control { padding: 4px 6px; }
body.prism-ui input[type="file"]::file-selector-button {
  margin-right: 10px; padding: 4px 10px; border: 0; border-radius: 6px;
  background: var(--p-raised-2); color: var(--p-text); font-size: .78rem; cursor: pointer;
}
body.prism-ui .form-control.success, body.prism-ui .is-valid { border-color: var(--p-success) !important; }
body.prism-ui .form-control.error, body.prism-ui .is-invalid { border-color: var(--p-danger) !important; }
body.prism-ui .validation-message.success, body.prism-ui .valid-feedback { color: var(--p-success) !important; font-size: .75rem; }
body.prism-ui .validation-message.error, body.prism-ui .invalid-feedback, body.prism-ui .text-error { color: var(--p-danger) !important; font-size: .75rem; }
body.prism-ui .form-text { color: var(--p-faint); font-size: .72rem; }

/* icon-left inputs (Mazer has-icon-left) */
body.prism-ui .has-icon-left .form-control { padding-left: 34px; }
body.prism-ui .has-icon-left .form-control-icon { top: 50%; transform: translateY(-50%); padding: 0 0 0 10px; line-height: 1; }
body.prism-ui .form-control-icon i { color: var(--p-faint) !important; font-size: .95rem; }

/* input groups */
body.prism-ui .input-group { flex-wrap: nowrap; }
body.prism-ui .input-group > .form-control, body.prism-ui .input-group > .form-select { min-width: 0; }
body.prism-ui .input-group-text {
  min-height: var(--p-control-h);
  padding: 4px 10px;
  font-size: 0.8125rem;
  background: var(--p-raised) !important;
  border: 1px solid var(--p-border-strong) !important;
  color: var(--p-muted) !important;
  border-radius: var(--p-radius-sm);
}
body.prism-ui .input-group > :not(:first-child):not(.dropdown-menu):not(.valid-tooltip):not(.valid-feedback):not(.invalid-tooltip):not(.invalid-feedback) { border-top-left-radius: 0 !important; border-bottom-left-radius: 0 !important; }
body.prism-ui .input-group > :not(:last-child):not(.dropdown-toggle):not(.dropdown-menu) { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
body.prism-ui .input-group .btn { min-height: var(--p-control-h); }

/* checkboxes / radios / switches */
body.prism-ui .form-check-input {
  width: 1rem; height: 1rem; margin-top: .2em;
  background-color: var(--p-input);
  border: 1px solid var(--p-border-strong);
  box-shadow: none !important;
}
body.prism-ui .form-check-input:checked { background-color: var(--p-primary-bg); border-color: var(--p-primary-bg); }
body.prism-ui.theme-dark .form-check-input:checked[type="checkbox"] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23141414' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}
body.prism-ui.theme-dark .form-check-input:checked[type="radio"] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2' fill='%23141414'/%3e%3c/svg%3e");
}
body.prism-ui .form-switch .form-check-input { width: 2.1em; height: 1.15em; border-radius: 2em; }
body.prism-ui.theme-dark .form-switch .form-check-input:not(:checked) {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23737373'/%3e%3c/svg%3e");
}
body.prism-ui.theme-dark .form-switch .form-check-input:checked {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23141414'/%3e%3c/svg%3e");
}
body.prism-ui input[type="checkbox"]:not(.form-check-input), body.prism-ui input[type="radio"]:not(.form-check-input) { accent-color: var(--p-primary-bg); }

/* legacy editable-div / bordered group patterns used across old pages */
body.prism-ui [contenteditable="true"] { background-color: var(--p-input) !important; color: var(--p-text) !important; border-color: var(--p-border-strong) !important; }
body.prism-ui .custom-border {
  border: 1px solid var(--p-border) !important;
  border-radius: var(--p-radius) !important;
  padding: 12px !important;
  background: var(--p-surface-2) !important;
}

/* --------------------------------------------- select2 / choices / misc -- */
body.prism-ui .select2-container { max-width: 100%; }
body.prism-ui .select2-container--default .select2-selection--single,
body.prism-ui .select2-container--default .select2-selection--multiple {
  min-height: var(--p-control-h) !important;
  height: auto !important;
  background: var(--p-input) !important;
  border: 1px solid var(--p-border-strong) !important;
  border-radius: var(--p-radius-sm) !important;
  display: flex; align-items: center;
}
body.prism-ui .select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--p-text) !important; line-height: 1.4 !important; padding: 6px 30px 6px 10px !important; font-size: .8125rem;
}
body.prism-ui .select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--p-faint) !important; }
body.prism-ui .select2-container--default .select2-selection--single .select2-selection__arrow { height: 100% !important; right: 6px !important; top: 0 !important; }
body.prism-ui .select2-container--default .select2-selection--single .select2-selection__arrow b { border-color: var(--p-muted) transparent transparent transparent !important; }
body.prism-ui .select2-container--default.select2-container--focus .select2-selection,
body.prism-ui .select2-container--default.select2-container--open .select2-selection { border-color: var(--p-focus-border) !important; box-shadow: 0 0 0 3px var(--p-focus-ring) !important; }
body.prism-ui .select2-container--default .select2-selection--multiple .select2-selection__choice {
  background: var(--p-raised-2) !important; border: 0 !important; color: var(--p-text) !important; border-radius: 6px !important; font-size: .75rem; padding: 1px 8px !important;
}
body.prism-ui .select2-container--default .select2-selection--multiple .select2-selection__choice__remove { color: var(--p-muted) !important; border: 0 !important; background: transparent !important; }
body.prism-ui .select2-dropdown {
  background: var(--p-surface) !important; border: 1px solid var(--p-border-strong) !important;
  border-radius: var(--p-radius-sm) !important; box-shadow: var(--p-shadow-lg); overflow: hidden; color: var(--p-text);
}
body.prism-ui .select2-search--dropdown { padding: 6px; }
body.prism-ui .select2-search--dropdown .select2-search__field {
  background: var(--p-input) !important; border: 1px solid var(--p-border-strong) !important; color: var(--p-text) !important;
  border-radius: 6px; padding: 5px 8px; font-size: .8125rem; outline: none;
}
body.prism-ui .select2-results__option { padding: 6px 10px; font-size: .8125rem; color: var(--p-text-2); }
body.prism-ui .select2-container--default .select2-results__option--highlighted[aria-selected],
body.prism-ui .select2-container--default .select2-results__option--highlighted.select2-results__option--selectable { background: var(--p-raised-2) !important; color: var(--p-text) !important; }
body.prism-ui .select2-container--default .select2-results__option[aria-selected=true],
body.prism-ui .select2-container--default .select2-results__option--selected { background: var(--p-raised) !important; color: var(--p-text) !important; }

body.prism-ui .choices { margin-bottom: 0; }
body.prism-ui .choices__inner { display: flex; align-items: center; padding: 4px 8px !important; }
body.prism-ui .choices__list--single { padding: 0 20px 0 2px; }
body.prism-ui .choices__list--dropdown, body.prism-ui .choices__list[aria-expanded] {
  background: var(--p-surface) !important; border: 1px solid var(--p-border-strong) !important; border-radius: var(--p-radius-sm) !important; color: var(--p-text);
  z-index: 1060;
}
body.prism-ui .choices__list--dropdown .choices__item--selectable.is-highlighted { background: var(--p-raised-2) !important; }
body.prism-ui .choices__input { background: var(--p-input) !important; color: var(--p-text) !important; }
body.prism-ui .choices[data-type*=select-one]::after { border-color: var(--p-muted) transparent transparent !important; }

/* virtual-select plugin */
body.prism-ui .vscomp-toggle-button { background: var(--p-input) !important; border: 1px solid var(--p-border-strong) !important; border-radius: var(--p-radius-sm) !important; color: var(--p-text) !important; min-height: var(--p-control-h); padding: 6px 30px 6px 10px !important; font-size: .8125rem; }
body.prism-ui .vscomp-dropbox { background: var(--p-surface) !important; color: var(--p-text) !important; border: 1px solid var(--p-border-strong); border-radius: var(--p-radius-sm); }
body.prism-ui .vscomp-option.focused { background: var(--p-raised-2) !important; }
body.prism-ui .vscomp-search-container, body.prism-ui .vscomp-search-input { background: var(--p-input) !important; color: var(--p-text) !important; border-color: var(--p-border) !important; }
body.prism-ui .vscomp-arrow::after { border-color: var(--p-muted) !important; }

/* jQuery UI autocomplete / datepickers / daterangepicker */
body.prism-ui .ui-autocomplete, body.prism-ui .ui-menu {
  background: var(--p-surface) !important; border: 1px solid var(--p-border-strong) !important; border-radius: var(--p-radius-sm);
  box-shadow: var(--p-shadow-lg); padding: 4px; max-height: 280px; overflow-y: auto; z-index: 2000 !important; font-family: var(--p-font);
}
body.prism-ui .ui-menu .ui-menu-item-wrapper { color: var(--p-text-2); padding: 6px 10px; border-radius: 6px; font-size: .8125rem; border: 0 !important; margin: 0 !important; }
body.prism-ui .ui-menu .ui-menu-item-wrapper.ui-state-active { background: var(--p-raised-2) !important; color: var(--p-text) !important; }
body.prism-ui .daterangepicker, body.prism-ui .datepicker, body.prism-ui .ui-datepicker {
  background: var(--p-surface) !important; border: 1px solid var(--p-border-strong) !important; border-radius: var(--p-radius) !important;
  color: var(--p-text) !important; box-shadow: var(--p-shadow-lg); font-family: var(--p-font);
}
body.prism-ui .daterangepicker::before, body.prism-ui .daterangepicker::after { display: none; }
body.prism-ui .daterangepicker .calendar-table { background: transparent !important; border: 0 !important; }
body.prism-ui .daterangepicker td, body.prism-ui .daterangepicker th { color: var(--p-text-2); border-radius: 6px !important; }
body.prism-ui .daterangepicker td.off { color: var(--p-faint) !important; background: transparent !important; }
body.prism-ui .daterangepicker td.available:hover, body.prism-ui .daterangepicker th.available:hover { background: var(--p-raised) !important; }
body.prism-ui .daterangepicker td.in-range { background: var(--p-raised) !important; color: var(--p-text) !important; }
body.prism-ui .daterangepicker td.active, body.prism-ui .daterangepicker td.active:hover { background: var(--p-primary-bg) !important; color: var(--p-primary-fg) !important; }
body.prism-ui .daterangepicker .ranges li { font-size: .78rem; color: var(--p-text-2); border-radius: 6px; }
body.prism-ui .daterangepicker .ranges li:hover { background: var(--p-raised) !important; }
body.prism-ui .daterangepicker .ranges li.active { background: var(--p-primary-bg) !important; color: var(--p-primary-fg) !important; }
body.prism-ui .daterangepicker .drp-buttons { border-top-color: var(--p-border) !important; }
body.prism-ui .daterangepicker select { background: var(--p-input); color: var(--p-text); border: 1px solid var(--p-border-strong); border-radius: 6px; }
body.prism-ui .daterangepicker .calendar-table .next span, body.prism-ui .daterangepicker .calendar-table .prev span { border-color: var(--p-muted) !important; }

/* summernote / rich text */
body.prism-ui .note-editor.note-frame, body.prism-ui .note-editor.note-airframe {
  border: 1px solid var(--p-border-strong) !important; border-radius: var(--p-radius-sm) !important; background: var(--p-input) !important; overflow: hidden;
}
body.prism-ui .note-toolbar, body.prism-ui .note-popover .popover-content, body.prism-ui .note-statusbar {
  background: var(--p-surface-2) !important; border-color: var(--p-border) !important;
}
body.prism-ui .note-editing-area .note-editable { background: var(--p-input) !important; color: var(--p-text) !important; }
body.prism-ui .note-btn, body.prism-ui .note-toolbar .btn {
  background: var(--p-raised) !important; border: 1px solid var(--p-border) !important; color: var(--p-text-2) !important;
  min-height: 28px; padding: 3px 8px !important; font-size: .75rem !important;
}
body.prism-ui .note-btn:hover, body.prism-ui .note-btn.active { background: var(--p-raised-2) !important; color: var(--p-text) !important; }
body.prism-ui .note-dropdown-menu, body.prism-ui .note-modal-content { background: var(--p-surface) !important; color: var(--p-text) !important; border-color: var(--p-border) !important; }

/* ============================================================== BUTTONS == */
body.prism-ui .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--p-control-h);
  padding: 6px 14px;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  border-radius: var(--p-radius-sm);
  border: 1px solid transparent;
  box-shadow: none !important;
  white-space: nowrap;
  transition: background-color .15s var(--p-ease), border-color .15s var(--p-ease), color .15s var(--p-ease), transform .08s var(--p-ease);
}
body.prism-ui .btn:active:not(:disabled) { transform: translateY(1px); }
body.prism-ui .btn:focus-visible { outline: 2px solid var(--p-focus-border); outline-offset: 2px; }
body.prism-ui .btn:disabled, body.prism-ui .btn.disabled { opacity: .45; cursor: not-allowed; }
body.prism-ui .btn i, body.prism-ui .btn .bi, body.prism-ui .btn .fa, body.prism-ui .btn .fas { margin: 0 !important; font-size: .9em; }
body.prism-ui .btn-sm, body.prism-ui .btn-group-sm > .btn { min-height: 30px; padding: 4px 10px; font-size: 0.75rem; border-radius: 7px; }
body.prism-ui .btn-lg, body.prism-ui .btn-xl { min-height: 40px; padding: 8px 18px; font-size: 0.875rem; }
body.prism-ui .btn-block, body.prism-ui .btn.w-100 { width: 100%; display: flex; }
body.prism-ui .btn.form-control { width: 100%; }

/* primary — high contrast monochrome */
body.prism-ui .btn-primary, body.prism-ui .btn-dark {
  background: var(--p-primary-bg) !important; color: var(--p-primary-fg) !important; border-color: var(--p-primary-bg) !important;
}
body.prism-ui .btn-primary:hover:not(:disabled), body.prism-ui .btn-dark:hover:not(:disabled) { background: var(--p-primary-hover) !important; border-color: var(--p-primary-hover) !important; }
/* neutral */
body.prism-ui .btn-secondary, body.prism-ui .btn-light, body.prism-ui .btn-default,
body.prism-ui .btn-outline-secondary, body.prism-ui .btn-outline-primary, body.prism-ui .btn-outline-dark, body.prism-ui .btn-outline-light {
  background: var(--p-raised) !important; color: var(--p-text) !important; border-color: var(--p-border-strong) !important;
}
body.prism-ui .btn-outline-primary, body.prism-ui .btn-outline-secondary, body.prism-ui .btn-outline-dark, body.prism-ui .btn-outline-light { background: transparent !important; }
body.prism-ui .btn-secondary:hover:not(:disabled), body.prism-ui .btn-light:hover:not(:disabled), body.prism-ui .btn-default:hover:not(:disabled),
body.prism-ui .btn-outline-secondary:hover:not(:disabled), body.prism-ui .btn-outline-primary:hover:not(:disabled),
body.prism-ui .btn-outline-dark:hover:not(:disabled), body.prism-ui .btn-outline-light:hover:not(:disabled) {
  background: var(--p-raised-2) !important; border-color: var(--p-focus-border) !important; color: var(--p-text) !important;
}
/* semantic — tinted, subtle */
body.prism-ui .btn-success, body.prism-ui .btn-outline-success { background: var(--p-success-soft) !important; color: var(--p-success) !important; border-color: color-mix(in srgb, var(--p-success) 30%, transparent) !important; }
body.prism-ui .btn-danger, body.prism-ui .btn-outline-danger { background: var(--p-danger-soft) !important; color: var(--p-danger) !important; border-color: color-mix(in srgb, var(--p-danger) 30%, transparent) !important; }
body.prism-ui .btn-warning, body.prism-ui .btn-outline-warning { background: var(--p-warning-soft) !important; color: var(--p-warning) !important; border-color: color-mix(in srgb, var(--p-warning) 30%, transparent) !important; }
body.prism-ui .btn-info, body.prism-ui .btn-outline-info { background: var(--p-info-soft) !important; color: var(--p-info) !important; border-color: color-mix(in srgb, var(--p-info) 30%, transparent) !important; }
body.prism-ui .btn-success:hover:not(:disabled), body.prism-ui .btn-outline-success:hover:not(:disabled) { background: color-mix(in srgb, var(--p-success) 22%, transparent) !important; }
body.prism-ui .btn-danger:hover:not(:disabled), body.prism-ui .btn-outline-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--p-danger) 22%, transparent) !important; }
body.prism-ui .btn-warning:hover:not(:disabled), body.prism-ui .btn-outline-warning:hover:not(:disabled) { background: color-mix(in srgb, var(--p-warning) 22%, transparent) !important; }
body.prism-ui .btn-info:hover:not(:disabled), body.prism-ui .btn-outline-info:hover:not(:disabled) { background: color-mix(in srgb, var(--p-info) 20%, transparent) !important; }
body.prism-ui .btn-link { background: transparent !important; border: 0 !important; color: var(--p-accent) !important; min-height: 0; padding: 2px 4px; }
body.prism-ui .btn-close { filter: none; opacity: .6; width: 28px; height: 28px; padding: 0; border-radius: 7px;
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath stroke='%23a3a3a3' stroke-width='1.6' stroke-linecap='round' d='m4 4 8 8M12 4l-8 8'/%3e%3c/svg%3e") center/14px no-repeat !important; }
body.prism-ui .btn-close:hover { opacity: 1; background-color: var(--p-raised) !important; }
body.prism-ui .close { color: var(--p-muted); opacity: 1; text-shadow: none; background: transparent; border: 0; font-size: 1.3rem; line-height: 1; }
body.prism-ui .close:hover { color: var(--p-text); }
body.prism-ui .btn-group > .btn { flex: 0 1 auto; }

/* action button rows / toolbars wrap instead of overflowing */
body.prism-ui .prism-actions, body.prism-ui .form-actions, body.prism-ui .button-group, body.prism-ui .btn-toolbar { display: flex; flex-wrap: wrap; gap: 8px; }

/* report launcher tiles (Administrator/Financial dashboards) */
body.prism-ui .report-button {
  min-height: 44px !important;
  height: auto !important;
  border-radius: var(--p-radius-sm) !important;
  padding: 8px 12px !important;
  white-space: normal !important;
  font-size: .78rem !important; font-weight: 500 !important;
  background: var(--p-surface-2) !important; color: var(--p-text) !important;
  border: 1px solid var(--p-border) !important;
}
body.prism-ui .report-button:not(:disabled):hover { background: var(--p-raised) !important; border-color: var(--p-focus-border) !important; }
body.prism-ui .report-button:disabled { opacity: .35; }

/* =============================================================== TABLES == */
body.prism-ui .table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: transparent;
  --bs-table-hover-bg: transparent;
  --bs-table-accent-bg: transparent;
  width: 100%;
  margin-bottom: 0;
  color: var(--p-text) !important;
  font-size: 0.8125rem;
  border-color: var(--p-border) !important;
  background: transparent !important;
}
body.prism-ui .table > :not(caption) > * > * { background-color: transparent; box-shadow: none; }
body.prism-ui .table thead th, body.prism-ui .table > thead > tr > th, body.prism-ui table thead th {
  position: sticky; top: 0; z-index: 2;
  padding: 9px 12px !important;
  background: var(--p-surface-2) !important;
  color: var(--p-muted) !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
  text-transform: none;
  white-space: nowrap;
  vertical-align: middle;
  border-bottom: 1px solid var(--p-border-strong) !important;
  border-top: 0 !important;
}
body.prism-ui .table td, body.prism-ui .table th, body.prism-ui table.table td {
  padding: 8px 12px !important;
  vertical-align: middle;
  border-color: var(--p-border) !important;
  color: var(--p-text-2) !important;
  font-size: 0.8125rem !important;
  background-color: transparent;
}
body.prism-ui .table.table-sm td, body.prism-ui .table.table-sm th { padding: 6px 10px !important; }
body.prism-ui .table-bordered, body.prism-ui .table-bordered td, body.prism-ui .table-bordered th { border-color: var(--p-border) !important; }
body.prism-ui .table-striped > tbody > tr:nth-of-type(odd) > * { background-color: color-mix(in srgb, var(--p-raised) 35%, transparent) !important; --bs-table-accent-bg: transparent; }
body.prism-ui .table tbody tr { transition: background-color .1s var(--p-ease); }
body.prism-ui .table tbody tr:hover > * { background-color: var(--p-raised) !important; color: var(--p-text) !important; }
body.prism-ui .table tbody tr.selected > *, body.prism-ui .table tbody tr.selected-row > *, body.prism-ui .table tbody tr.highlight-row > *,
body.prism-ui .table tbody tr.active > *, body.prism-ui .table tbody tr.table-active > *, body.prism-ui tr.selected > td, body.prism-ui tr.selected-row > td, body.prism-ui tr.highlight-row > td {
  background-color: var(--p-raised-2) !important; color: var(--p-text) !important;
}
body.prism-ui .selected-row, body.prism-ui .highlight-row { color: var(--p-text) !important; }
body.prism-ui .table-primary > *, body.prism-ui .table-info > *, body.prism-ui .table-light > *, body.prism-ui .table-dark > *, body.prism-ui .table-secondary > * { background-color: var(--p-raised) !important; color: var(--p-text) !important; }
body.prism-ui .table-success > * { background-color: var(--p-success-soft) !important; }
body.prism-ui .table-danger > * { background-color: var(--p-danger-soft) !important; }
body.prism-ui .table-warning > * { background-color: var(--p-warning-soft) !important; }
body.prism-ui thead.thead-dark th, body.prism-ui thead.thead-light th, body.prism-ui .thead-dark th, body.prism-ui .thead-light th { background: var(--p-surface-2) !important; color: var(--p-muted) !important; border-color: var(--p-border) !important; }
body.prism-ui .table caption { color: var(--p-muted); }

body.prism-ui .table-responsive {
  border: 1px solid var(--p-border);
  border-radius: var(--p-radius-sm);
  background: var(--p-surface);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
body.prism-ui .card .table-responsive { background: transparent; }
body.prism-ui .table-responsive > .table { margin: 0; }
/* fallback: tables that aren't wrapped scroll inside themselves instead of widening the page */
@media (max-width: 991.98px) {
  body.prism-ui :not(.table-responsive):not(.dataTables_scrollBody):not(.dataTables_scrollHead) > table.table,
  body.prism-ui :not(.table-responsive):not(.dataTables_scrollBody):not(.dataTables_scrollHead) > table.dataTable {
    display: block; width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
}
body.prism-ui .empty-state, body.prism-ui .no-data, body.prism-ui .dataTables_empty, body.prism-ui td.dataTables_empty {
  color: var(--p-muted) !important; text-align: center; padding: 20px !important;
}

/* DataTables chrome */
body.prism-ui .dataTables_wrapper { color: var(--p-text-2); font-size: .8125rem; }
body.prism-ui .dataTables_wrapper .dataTables_length, body.prism-ui .dataTables_wrapper .dataTables_filter,
body.prism-ui .dataTables_wrapper .dataTables_info, body.prism-ui .dataTables_wrapper .dataTables_paginate { color: var(--p-muted) !important; font-size: .78rem; padding: 8px 0; }
body.prism-ui .dataTables_wrapper .dataTables_filter input, body.prism-ui .dataTables_wrapper .dataTables_length select {
  background: var(--p-input) !important; border: 1px solid var(--p-border-strong) !important; color: var(--p-text) !important; border-radius: 7px; padding: 4px 8px; min-height: 30px;
}
body.prism-ui .dataTables_wrapper .dataTables_paginate .paginate_button { color: var(--p-text-2) !important; border: 1px solid transparent !important; border-radius: 7px !important; background: transparent !important; }
body.prism-ui .dataTables_wrapper .dataTables_paginate .paginate_button:hover { background: var(--p-raised) !important; color: var(--p-text) !important; }
body.prism-ui .dataTables_wrapper .dataTables_paginate .paginate_button.current { background: var(--p-primary-bg) !important; color: var(--p-primary-fg) !important; }

/* =========================================================== PAGINATION == */
body.prism-ui .pagination { gap: 4px; flex-wrap: wrap; margin: 12px 0 0; }
body.prism-ui .pagination .page-link {
  min-width: 32px; min-height: 32px; padding: 4px 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--p-surface) !important; border: 1px solid var(--p-border) !important;
  color: var(--p-text-2) !important; border-radius: 7px !important; font-size: .78rem; box-shadow: none !important;
}
body.prism-ui .pagination .page-link:hover { background: var(--p-raised) !important; color: var(--p-text) !important; }
body.prism-ui .pagination .page-item.active .page-link { background: var(--p-primary-bg) !important; border-color: var(--p-primary-bg) !important; color: var(--p-primary-fg) !important; }
body.prism-ui .pagination .page-item.disabled .page-link { opacity: .45; }

/* ============================================================ TABS/PILLS == */
body.prism-ui .nav-tabs, body.prism-ui .nav-pills {
  display: inline-flex; flex-wrap: wrap; gap: 4px;
  padding: 4px; margin-bottom: 14px;
  border: 1px solid var(--p-border) !important;
  border-radius: 999px;
  background: var(--p-surface-2);
  max-width: 100%;
}
body.prism-ui .nav-tabs .nav-link, body.prism-ui .nav-pills .nav-link {
  border: 0 !important; margin: 0 !important;
  padding: 6px 14px; border-radius: 999px !important;
  font-size: .8125rem; font-weight: 500;
  color: var(--p-muted) !important; background: transparent !important;
  white-space: nowrap;
}
body.prism-ui .nav-tabs .nav-link:hover, body.prism-ui .nav-pills .nav-link:hover { color: var(--p-text) !important; }
body.prism-ui .nav-tabs .nav-link.active, body.prism-ui .nav-tabs .nav-item.show .nav-link,
body.prism-ui .nav-pills .nav-link.active, body.prism-ui .nav-pills .show > .nav-link {
  background: var(--p-raised-2) !important; color: var(--p-text) !important; box-shadow: var(--p-shadow-sm);
}
body.prism-ui .tab-content { color: var(--p-text); }

/* pill segmented control component */
body.prism-ui .prism-pill-tabs { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--p-surface-2); border: 1px solid var(--p-border); }
body.prism-ui .prism-pill-tab { border: 0; background: transparent; color: var(--p-muted); font-size: .8125rem; font-weight: 500; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
body.prism-ui .prism-pill-tab.active { background: var(--p-raised-2); color: var(--p-text); }

/* ========================================================== BADGES/ALERT = */
body.prism-ui .badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  font-size: .7rem; font-weight: 600; letter-spacing: .01em;
  background: var(--p-raised-2); color: var(--p-text);
}
body.prism-ui .badge.bg-primary, body.prism-ui .badge.bg-secondary, body.prism-ui .badge.bg-dark, body.prism-ui .badge.bg-light, body.prism-ui .badge-primary, body.prism-ui .badge-secondary { background: var(--p-raised-2) !important; color: var(--p-text) !important; }
body.prism-ui .badge.bg-success, body.prism-ui .badge-success { background: var(--p-success-soft) !important; color: var(--p-success) !important; }
body.prism-ui .badge.bg-danger, body.prism-ui .badge-danger { background: var(--p-danger-soft) !important; color: var(--p-danger) !important; }
body.prism-ui .badge.bg-warning, body.prism-ui .badge-warning { background: var(--p-warning-soft) !important; color: var(--p-warning) !important; }
body.prism-ui .badge.bg-info, body.prism-ui .badge-info { background: var(--p-info-soft) !important; color: var(--p-info) !important; }

body.prism-ui .alert {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin-bottom: 14px;
  border-radius: var(--p-radius-sm);
  border: 1px solid var(--p-border) !important;
  background: var(--p-surface) !important;
  color: var(--p-text-2) !important;
  font-size: .8125rem;
}
body.prism-ui .alert i { font-size: 1rem; }
body.prism-ui .alert-success { background: var(--p-success-soft) !important; color: var(--p-success) !important; border-color: color-mix(in srgb, var(--p-success) 25%, transparent) !important; }
body.prism-ui .alert-danger { background: var(--p-danger-soft) !important; color: var(--p-danger) !important; border-color: color-mix(in srgb, var(--p-danger) 25%, transparent) !important; }
body.prism-ui .alert-warning { background: var(--p-warning-soft) !important; color: var(--p-warning) !important; border-color: color-mix(in srgb, var(--p-warning) 25%, transparent) !important; }
body.prism-ui .alert-info, body.prism-ui .alert-primary { background: var(--p-info-soft) !important; color: var(--p-info) !important; border-color: color-mix(in srgb, var(--p-info) 25%, transparent) !important; }
body.prism-ui .alert .btn-close { margin-left: auto; }

/* ================================================================ MODALS = */
body.prism-ui .modal-backdrop.show { opacity: 1; background: var(--p-overlay); }
body.prism-ui .modal-backdrop { background-color: #000; }
body.prism-ui .modal-content {
  background: var(--p-surface) !important;
  color: var(--p-text) !important;
  border: 1px solid var(--p-border-strong) !important;
  border-radius: var(--p-radius-lg) !important;
  box-shadow: var(--p-shadow-lg) !important;
  overflow: hidden;
}
body.prism-ui .modal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px !important;
  background: transparent !important;
  border-bottom: 1px solid var(--p-border) !important;
  color: var(--p-text) !important;
}
body.prism-ui .modal-title, body.prism-ui .modal-header :is(h1, h2, h3, h4, h5, h6) { margin: 0; font-size: 0.9375rem !important; font-weight: 600 !important; color: var(--p-text) !important; }
body.prism-ui .modal-header .close, body.prism-ui .modal-header .btn-close { margin: 0 0 0 auto; padding: 0; }
body.prism-ui .modal-body { padding: 16px 18px !important; background: transparent !important; color: var(--p-text) !important; }
body.prism-ui .modal-footer {
  gap: 8px; padding: 12px 18px !important;
  background: var(--p-surface-2) !important;
  border-top: 1px solid var(--p-border) !important;
}
body.prism-ui .modal-footer > * { margin: 0; }
body.prism-ui .modal.fade .modal-dialog { transition: transform .22s var(--p-ease), opacity .22s var(--p-ease); }
@media (max-width: 575.98px) {
  body.prism-ui .modal-dialog { margin: 8px; max-width: calc(100% - 16px) !important; }
  body.prism-ui .modal-body { padding: 14px !important; }
}
@media (min-width: 576px) and (max-width: 1199.98px) {
  body.prism-ui .modal-dialog.modal-xl, body.prism-ui .modal-dialog.modal-lg, body.prism-ui .custom-modal-dialog { max-width: calc(100% - 32px) !important; }
}

/* ============================================================ DROPDOWNS == */
body.prism-ui .dropdown-menu {
  background: var(--p-surface) !important; border: 1px solid var(--p-border-strong) !important;
  border-radius: var(--p-radius-sm) !important; box-shadow: var(--p-shadow-lg) !important;
  padding: 4px; color: var(--p-text); font-size: .8125rem;
}
body.prism-ui .dropdown-item { color: var(--p-text-2) !important; border-radius: 6px; padding: 6px 10px; }
body.prism-ui .dropdown-item:hover, body.prism-ui .dropdown-item:focus { background: var(--p-raised) !important; color: var(--p-text) !important; }
body.prism-ui .dropdown-item.active, body.prism-ui .dropdown-item:active { background: var(--p-raised-2) !important; color: var(--p-text) !important; }
body.prism-ui .dropdown-divider { border-color: var(--p-border); }
body.prism-ui .list-group-item { background: var(--p-surface) !important; color: var(--p-text) !important; border-color: var(--p-border) !important; font-size: .8125rem; }
body.prism-ui .list-group-item.active { background: var(--p-raised-2) !important; }
body.prism-ui .list-group-item-action:hover { background: var(--p-raised) !important; }
body.prism-ui .progress { background: var(--p-raised); border-radius: 999px; height: 8px; }
body.prism-ui .progress-bar { background: var(--p-text-2); }
body.prism-ui .breadcrumb { background: transparent; padding: 0; margin: 0; font-size: .78rem; }
body.prism-ui .breadcrumb-item, body.prism-ui .breadcrumb-item a { color: var(--p-muted); }
body.prism-ui .breadcrumb-item.active { color: var(--p-text); }
body.prism-ui .tooltip .tooltip-inner { background: var(--p-primary-bg); color: var(--p-primary-fg); font-size: .72rem; border-radius: 6px; padding: 4px 8px; }
body.prism-ui .popover { background: var(--p-surface); border-color: var(--p-border-strong); }
body.prism-ui .popover-body { color: var(--p-text); }
body.prism-ui .popover-header { background: var(--p-surface-2); color: var(--p-text); border-color: var(--p-border); }

/* ============================================== SweetAlert2 / Toastr ==== */
body.prism-ui .swal2-container.swal2-backdrop-show { background: var(--p-overlay) !important; }
body.prism-ui .swal2-popup {
  background: var(--p-surface) !important; color: var(--p-text) !important;
  border: 1px solid var(--p-border-strong); border-radius: var(--p-radius-lg) !important;
  padding: 22px 20px 18px !important; font-family: var(--p-font);
  width: min(420px, calc(100vw - 24px)) !important;
}
body.prism-ui .swal2-title { color: var(--p-text) !important; font-size: 1.05rem !important; font-weight: 600 !important; }
body.prism-ui .swal2-html-container, body.prism-ui .swal2-content { color: var(--p-text-2) !important; font-size: .85rem !important; }
body.prism-ui .swal2-actions { gap: 8px; margin-top: 16px !important; }
body.prism-ui .swal2-styled { margin: 0 !important; min-height: 36px; padding: 7px 16px !important; font-size: .8125rem !important; font-weight: 500 !important; border-radius: var(--p-radius-sm) !important; box-shadow: none !important; }
body.prism-ui .swal2-styled.swal2-confirm { background: var(--p-primary-bg) !important; color: var(--p-primary-fg) !important; }
body.prism-ui .swal2-styled.swal2-cancel, body.prism-ui .swal2-styled.swal2-deny { background: var(--p-raised) !important; color: var(--p-text) !important; border: 1px solid var(--p-border-strong) !important; }
body.prism-ui .swal2-input, body.prism-ui .swal2-textarea, body.prism-ui .swal2-select { background: var(--p-input) !important; color: var(--p-text) !important; border: 1px solid var(--p-border-strong) !important; border-radius: var(--p-radius-sm) !important; box-shadow: none !important; font-size: .85rem; }
body.prism-ui .swal2-icon { transform: scale(.8); margin: 4px auto 8px !important; }

body.prism-ui #toast-container > div {
  background-color: var(--p-surface) !important;
  color: var(--p-text) !important;
  border: 1px solid var(--p-border-strong);
  border-left-width: 3px;
  border-radius: var(--p-radius-sm) !important;
  box-shadow: var(--p-shadow-lg) !important;
  opacity: 1 !important;
  font-size: .8125rem;
  padding: 12px 14px 12px 46px;
}
body.prism-ui #toast-container > div.toast-success { border-left-color: var(--p-success); background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234ade80' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpath d='M20 6 9 17l-5-5'/%3e%3c/svg%3e") !important; }
body.prism-ui #toast-container > div.toast-error { border-left-color: var(--p-danger); background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f87171' stroke-width='2' stroke-linecap='round'%3e%3cpath d='M18 6 6 18M6 6l12 12'/%3e%3c/svg%3e") !important; }
body.prism-ui #toast-container > div.toast-warning { border-left-color: var(--p-warning); background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fbbf24' stroke-width='2' stroke-linecap='round'%3e%3cpath d='M12 8v5M12 16.5v.5'/%3e%3cpath d='M10.3 3.9 1.8 18a2 2 0 0 0 1.7 3h17a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z'/%3e%3c/svg%3e") !important; }
body.prism-ui #toast-container > div.toast-info { border-left-color: var(--p-info); background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236fdfed' stroke-width='2' stroke-linecap='round'%3e%3ccircle cx='12' cy='12' r='9'/%3e%3cpath d='M12 11v5M12 8v.5'/%3e%3c/svg%3e") !important; }
body.prism-ui #toast-container > div { background-size: 20px 20px !important; background-position: 16px center !important; background-repeat: no-repeat !important; }
body.prism-ui .toast-title { font-weight: 600; }
body.prism-ui .toast-progress { background: var(--p-text); opacity: .25; }

/* =============================================================== CHARTS == */
body.prism-ui canvas { background: transparent !important; max-width: 100%; }
body.prism-ui .apexcharts-canvas, body.prism-ui .apexcharts-svg { background: transparent !important; max-width: 100%; }
body.prism-ui .apexcharts-text, body.prism-ui .apexcharts-legend-text, body.prism-ui .apexcharts-xaxis-label, body.prism-ui .apexcharts-yaxis-label, body.prism-ui .apexcharts-title-text {
  fill: var(--p-muted) !important; color: var(--p-muted) !important; font-family: var(--p-font) !important;
}
body.prism-ui .apexcharts-gridline, body.prism-ui .apexcharts-xaxis-tick, body.prism-ui .apexcharts-grid-borders line { stroke: var(--p-border) !important; }
body.prism-ui .apexcharts-tooltip, body.prism-ui .apexcharts-xaxistooltip {
  background: var(--p-surface) !important; color: var(--p-text) !important; border: 1px solid var(--p-border-strong) !important; box-shadow: var(--p-shadow) !important;
}
body.prism-ui .apexcharts-tooltip-title { background: var(--p-surface-2) !important; border-bottom-color: var(--p-border) !important; }
body.prism-ui .apexcharts-menu { background: var(--p-surface) !important; border-color: var(--p-border-strong) !important; }
body.prism-ui .apexcharts-menu-item:hover { background: var(--p-raised) !important; }
body.prism-ui .apexcharts-toolbar svg { fill: var(--p-muted) !important; }
body.prism-ui .apexcharts-pie-label, body.prism-ui .apexcharts-datalabel { fill: #fff !important; }

/* ============================================================== RESPONSIVE */
body.prism-ui img { max-width: 100%; }
body.prism-ui .container, body.prism-ui .container-fluid { max-width: 100%; }
@media (max-width: 991.98px) {
  body.prism-ui .card-body { padding: 14px !important; }
  body.prism-ui .card-header { padding: 11px 14px !important; }
}
@media (max-width: 767.98px) {
  body.prism-ui .row > [class*="col-"] { min-width: 0; }
  body.prism-ui .btn { white-space: normal; }
  body.prism-ui .card-header { align-items: flex-start; }
  body.prism-ui .prism-page-title { font-size: 1.2rem !important; }
  body.prism-ui .nav-tabs, body.prism-ui .nav-pills { border-radius: var(--p-radius); }
}
@media (max-width: 575.98px) {
  body.prism-ui .card-body { padding: 12px !important; }
  body.prism-ui .card { border-radius: 10px !important; }
  body.prism-ui .table td, body.prism-ui .table th { padding: 7px 10px !important; }
}

/* ============================================================ AUTH PAGES = */
body.prism-ui.prism-auth { background: var(--p-canvas) !important; }
body.prism-ui #auth.prism-auth-shell { display: flex; align-items: stretch; min-height: 100vh; height: auto; overflow-x: hidden; }
body.prism-ui #auth.prism-auth-shell #auth-left { padding: 40px 6vw; height: auto; }
body.prism-ui .prism-auth-form {
  flex: 1 1 46%;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 6vw;
  background: var(--p-canvas);
}
body.prism-ui .prism-auth-panel { width: 100%; max-width: 380px; animation: prism-rise .5s var(--p-ease) both; }
body.prism-ui .prism-auth-brand { margin-bottom: 36px; }
body.prism-ui .prism-auth-brand .prism-logo-3d { display: inline-block; }
body.prism-ui .prism-auth-brand .prism-logo-plate { height: 64px; padding: 10px 18px; border-radius: 14px; }
body.prism-ui .prism-auth-brand .prism-logo-plate img { max-height: 44px; }
body.prism-ui .prism-auth-title { margin: 0 0 6px !important; font-size: 1.6rem !important; font-weight: 700 !important; letter-spacing: -0.025em; }
body.prism-ui .prism-auth-sub { margin: 0 0 28px; color: var(--p-muted); font-size: .875rem; }
body.prism-ui .prism-field { margin-bottom: 16px; }
body.prism-ui .prism-field label { display: block; margin-bottom: 6px; font-size: .75rem !important; color: var(--p-text-2) !important; }
body.prism-ui .prism-input-wrap { position: relative; display: flex; align-items: center; }
body.prism-ui .prism-input-wrap .prism-input-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); line-height: 1; display: flex; color: var(--p-faint); font-size: 1rem; pointer-events: none; transition: color .15s var(--p-ease); z-index: 1; }
body.prism-ui .prism-input-wrap .prism-input-icon::before { vertical-align: 0; }
body.prism-ui .prism-input-wrap input.prism-input {
  width: 100%; height: 46px; min-height: 46px; padding: 0 44px 0 40px !important;
  font-size: .875rem !important; border-radius: 10px !important;
}
body.prism-ui .prism-input-wrap:focus-within .prism-input-icon { color: var(--p-text); }
body.prism-ui .prism-eye-toggle {
  position: absolute; right: 8px; width: 32px; height: 32px; border: 0; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: var(--p-faint); cursor: pointer;
}
body.prism-ui .prism-eye-toggle:hover { color: var(--p-text); background: var(--p-raised); }
body.prism-ui .prism-submit-btn {
  width: 100%; height: 46px; margin-top: 8px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px;
  background: var(--p-primary-bg); color: var(--p-primary-fg);
  font-size: .9rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 8px 20px -10px rgba(0,0,0,.6);
  transition: background-color .15s var(--p-ease), transform .1s var(--p-ease), opacity .15s var(--p-ease);
}
body.prism-ui .prism-submit-btn:hover:not(:disabled) { background: var(--p-primary-hover); }
body.prism-ui .prism-submit-btn:active:not(:disabled) { transform: translateY(1px); }
body.prism-ui .prism-submit-btn:disabled { opacity: .4; cursor: not-allowed; }
body.prism-ui .prism-submit-btn .prism-spinner { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: none; animation: prism-spin .7s linear infinite; }
body.prism-ui .prism-submit-btn.is-loading .prism-spinner { display: inline-block; }
body.prism-ui .prism-auth-foot { margin-top: 28px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: .72rem; color: var(--p-faint); }
body.prism-ui .prism-auth-foot a { color: var(--p-muted); }
body.prism-ui #auth #auth-right.prism-auth-visual,
body.prism-ui .prism-auth-visual {
  flex: 1 1 54%;
  height: auto !important;
  min-height: calc(100vh - 24px);
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  margin: 12px 12px 12px 0;
  border-radius: 20px;
  background:
    radial-gradient(ellipse 70% 55% at 70% 20%, rgba(255,255,255,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 20% 90%, rgba(111,223,237,0.07) 0%, transparent 60%),
    linear-gradient(160deg, #2a2a2a 0%, #1f1f1f 55%, #1a1a1a 100%) !important;
  border: 1px solid #333;
}
body.prism-ui:not(.theme-dark) #auth #auth-right.prism-auth-visual {
  background:
    radial-gradient(ellipse 70% 55% at 70% 20%, rgba(255,255,255,0.9) 0%, transparent 60%),
    linear-gradient(160deg, #f4f4f5 0%, #e9e9ec 100%) !important;
  border-color: var(--p-border);
}
body.prism-ui .prism-auth-visual::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 60% 60% at 50% 45%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 60% at 50% 45%, #000 20%, transparent 75%);
}
body.prism-ui:not(.theme-dark) .prism-auth-visual::before { background-image: linear-gradient(rgba(0,0,0,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(0,0,0,.05) 1px, transparent 1px); }
body.prism-ui .prism-auth-visual-inner { position: relative; z-index: 1; text-align: center; padding: 40px; max-width: 520px; }
body.prism-ui .prism-auth-visual .prism-logo-3d { display: inline-block; perspective: 900px; }
body.prism-ui .prism-auth-visual .prism-logo-plate { height: 96px; padding: 16px 28px; border-radius: 20px; animation: prism-logo-settle 1s var(--p-ease) both, prism-float 7s ease-in-out 1s infinite; }
body.prism-ui .prism-auth-visual .prism-logo-plate img { max-height: 64px; transform: translateZ(22px); }
body.prism-ui .prism-auth-product { margin-top: 32px; font-size: 2.1rem; font-weight: 700; letter-spacing: .08em; color: var(--p-text); line-height: 1; }
body.prism-ui .prism-auth-tagline { margin-top: 10px; color: var(--p-muted); font-size: .95rem; }
body.prism-ui .prism-auth-points { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 24px; }
body.prism-ui .prism-auth-points span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: .75rem; color: var(--p-text-2);
  background: rgba(255,255,255,.04); border: 1px solid var(--p-border-strong);
}
body.prism-ui .prism-auth-points i { color: var(--p-accent); }
body.prism-ui .prism-auth-visual-foot { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; font-size: .72rem; color: var(--p-faint); z-index: 1; }
@keyframes prism-float { 0%, 100% { transform: rotateX(10deg) translateY(0); } 50% { transform: rotateX(4deg) rotateY(-4deg) translateY(-8px); } }
@keyframes prism-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes prism-spin { to { transform: rotate(360deg); } }
@media (max-width: 991.98px) {
  body.prism-ui #auth #auth-right.prism-auth-visual, body.prism-ui .prism-auth-visual { display: none; }
  body.prism-ui .prism-auth-form { padding: 32px 20px; }
}

/* error pages (403/404) */
body.prism-ui .prism-error { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; }
body.prism-ui .prism-error-code { font-size: 4.5rem; font-weight: 700; letter-spacing: -0.04em; color: var(--p-text); line-height: 1; }
body.prism-ui .prism-error-text { margin: 10px 0 20px; color: var(--p-muted); }

/* ================================================================ PRINT == */
@media print {
  body.prism-ui {
    --p-canvas: #fff; --p-surface: #fff; --p-surface-2: #fff; --p-input: #fff; --p-raised: #f3f3f3; --p-raised-2: #eee;
    --p-border: #ddd; --p-border-strong: #ccc; --p-text: #000; --p-text-2: #111; --p-muted: #444; --p-faint: #666;
    background: #fff !important; color: #000;
  }
  body.prism-ui #sidebar, body.prism-ui .prism-topbar, body.prism-ui .prism-sidebar-overlay { display: none !important; }
  body.prism-ui #main { margin: 0 !important; padding: 0 !important; }
  body.prism-ui .card { border: 0 !important; }
}

/* Choices.js: app.css paints .choices__list white — neutralise it everywhere */
body.prism-ui .choices__list:not(.choices__list--dropdown):not([aria-expanded]) { background-color: transparent !important; }
body.prism-ui .choices__list--single .choices__item { color: var(--p-text) !important; }
body.prism-ui .choices__list--dropdown .choices__item, body.prism-ui .choices__list[aria-expanded] .choices__item { color: var(--p-text-2) !important; background: transparent; }
body.prism-ui .choices__list--dropdown .choices__item--selectable.is-highlighted, body.prism-ui .choices__list[aria-expanded] .choices__item--selectable.is-highlighted { background: var(--p-raised-2) !important; color: var(--p-text) !important; }
body.prism-ui .prism-field .choices__inner { min-height: 46px; border-radius: 10px !important; padding: 4px 12px !important; }
body.prism-ui .prism-section-label { display: block; margin: 0 0 6px; font-size: .72rem !important; font-weight: 600 !important; letter-spacing: .05em; text-transform: uppercase; color: var(--p-muted) !important; }
/* logos designed for dark backgrounds (e.g. IDC.png with white lettering) sit on a dark plate */
body.prism-ui .prism-logo-plate.is-dark {
  background: linear-gradient(160deg, #2f2f2f 0%, #1f1f1f 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -1px 0 rgba(0,0,0,.4), 0 1px 1px rgba(0,0,0,.3), 0 6px 14px -4px rgba(0,0,0,.45), 0 14px 26px -14px rgba(0,0,0,.6);
  border: 1px solid #3a3a3a;
}
body.prism-ui .prism-logo-plate.is-dark::after { background: linear-gradient(100deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.10) 50%, rgba(255,255,255,0) 100%); }
body.prism-ui .prism-welcome-logo.is-dark { background: linear-gradient(160deg, #2f2f2f, #1f1f1f); border: 1px solid #3a3a3a; }

/* ==========================================================================
   v7.1 — contrast refinements (fields, buttons, sidebar active state).
   Same layout and direction; only visibility of key elements is raised.
   Brand accent is derived from the Pacslink logo blue (#0088b8), darkened
   so white text on it passes WCAG AA (4.5:1+).
   ========================================================================== */
body.prism-ui {
  --p-brand: #0b6f9c;            /* light-mode buttons / active */
  --p-brand-hover: #095d83;
  --p-brand-active: #084f70;
  --p-brand-soft: rgba(11, 111, 156, 0.10);
  --p-brand-line: #0b6f9c;
  --p-accent: #0b6f9c;
  --p-field-bg: #ffffff;
  --p-field-border: #b9bcc3;
  --p-field-border-hover: #8e939c;
  --p-field-focus: #0b6f9c;
  --p-field-ring: rgba(11, 111, 156, 0.18);
  --p-field-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.04);
  --p-field-readonly: #f1f2f4;
  --p-label: #3f3f46;
  --p-border: #dcdce0;
  --p-canvas: #eeeff1;
}
body.prism-ui.theme-dark {
  --p-canvas: #161616;
  --p-surface: #282828;
  --p-surface-2: #212121;
  --p-raised: #333333;
  --p-raised-2: #3d3d3d;
  --p-border: #383838;
  --p-border-strong: #4a4a4a;
  --p-text: #f7f7f7;
  --p-text-2: #e0e0e0;
  --p-muted: #b0b0b0;
  --p-faint: #8a8a8a;
  --p-brand: #0c7aab;
  --p-brand-hover: #0e89bf;
  --p-brand-active: #0a6a95;
  --p-brand-soft: rgba(38, 160, 214, 0.16);
  --p-brand-line: #3fb0e0;
  --p-accent: #5cc0e8;
  --p-accent-soft: rgba(92, 192, 232, 0.12);
  --p-info: #5cc0e8;
  --p-field-bg: #323234;
  --p-field-border: #5e5e62;
  --p-field-border-hover: #7a7a80;
  --p-field-focus: #3fb0e0;
  --p-field-ring: rgba(63, 176, 224, 0.25);
  --p-field-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
  --p-field-readonly: #2a2a2b;
  --p-label: #cfcfcf;
  --p-focus-border: #3fb0e0;
  --p-focus-ring: rgba(63, 176, 224, 0.25);
}

/* ---------- Fields: clearly separated from the card, obvious boundaries ---------- */
body.prism-ui .form-control,
body.prism-ui .form-select,
body.prism-ui select.form-control,
body.prism-ui input[type="text"]:not(.select2-search__field):not(.choices__input),
body.prism-ui input[type="number"], body.prism-ui input[type="email"], body.prism-ui input[type="password"],
body.prism-ui input[type="date"], body.prism-ui input[type="time"], body.prism-ui input[type="datetime-local"],
body.prism-ui input[type="search"], body.prism-ui input[type="tel"], body.prism-ui input[type="month"],
body.prism-ui textarea,
body.prism-ui .choices__inner,
body.prism-ui .textarea-like,
body.prism-ui [contenteditable="true"],
body.prism-ui .select2-container--default .select2-selection--single,
body.prism-ui .select2-container--default .select2-selection--multiple,
body.prism-ui .vscomp-toggle-button,
body.prism-ui .note-editor.note-frame {
  background-color: var(--p-field-bg) !important;
  border: 1px solid var(--p-field-border) !important;
  box-shadow: var(--p-field-shadow) !important;
  color: var(--p-text) !important;
}
body.prism-ui .note-editing-area .note-editable { background: var(--p-field-bg) !important; }
body.prism-ui .form-control:hover:not(:disabled):not([readonly]):not(:focus),
body.prism-ui .form-select:hover:not(:disabled):not(:focus),
body.prism-ui textarea:hover:not(:disabled):not([readonly]):not(:focus),
body.prism-ui input:hover:not(:disabled):not([readonly]):not(:focus):not(.form-check-input):not([type="checkbox"]):not([type="radio"]),
body.prism-ui .select2-container--default:hover .select2-selection,
body.prism-ui .choices:hover .choices__inner {
  border-color: var(--p-field-border-hover) !important;
}
body.prism-ui .form-control:focus, body.prism-ui .form-select:focus, body.prism-ui textarea:focus,
body.prism-ui input:focus:not(.form-check-input):not(.select2-search__field):not([type="checkbox"]):not([type="radio"]),
body.prism-ui .textarea-like:focus, body.prism-ui [contenteditable="true"]:focus,
body.prism-ui .select2-container--default.select2-container--focus .select2-selection,
body.prism-ui .select2-container--default.select2-container--open .select2-selection,
body.prism-ui .choices.is-focused .choices__inner, body.prism-ui .choices.is-open .choices__inner {
  outline: none !important;
  border-color: var(--p-field-focus) !important;
  box-shadow: 0 0 0 3px var(--p-field-ring) !important;
}
body.prism-ui .form-control:disabled, body.prism-ui .form-control[readonly], body.prism-ui .form-select:disabled,
body.prism-ui input:disabled, body.prism-ui input[readonly], body.prism-ui textarea[readonly], body.prism-ui textarea:disabled,
body.prism-ui .select2-container--default.select2-container--disabled .select2-selection {
  background-color: var(--p-field-readonly) !important;
  border: 1px solid var(--p-border-strong) !important;
  box-shadow: none !important;
  color: var(--p-muted) !important;
}
body.prism-ui .form-select, body.prism-ui select.form-control {
  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='%23c4c4c4' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='m4 6 4 4 4-4'/%3e%3c/svg%3e") !important;
}
body.prism-ui:not(.theme-dark) .form-select, body.prism-ui:not(.theme-dark) select.form-control {
  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='%2352525b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='m4 6 4 4 4-4'/%3e%3c/svg%3e") !important;
}
body.prism-ui .select2-container--default .select2-selection--single .select2-selection__arrow b { border-top-color: var(--p-text-2) !important; }
body.prism-ui .form-control::placeholder, body.prism-ui textarea::placeholder, body.prism-ui input::placeholder { color: var(--p-faint) !important; }
body.prism-ui.theme-dark input[type="date"]::-webkit-calendar-picker-indicator,
body.prism-ui.theme-dark input[type="time"]::-webkit-calendar-picker-indicator,
body.prism-ui.theme-dark input[type="datetime-local"]::-webkit-calendar-picker-indicator,
body.prism-ui.theme-dark input[type="month"]::-webkit-calendar-picker-indicator { filter: invert(0.9); }
body.prism-ui .input-group-text { background: var(--p-raised-2) !important; border: 1px solid var(--p-field-border) !important; color: var(--p-text-2) !important; }
body.prism-ui .form-check-input { background-color: var(--p-field-bg); border: 1px solid var(--p-field-border-hover); }
body.prism-ui .form-check-input:checked { background-color: var(--p-brand) !important; border-color: var(--p-brand) !important; }
body.prism-ui.theme-dark .form-check-input:checked[type="checkbox"] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}
body.prism-ui.theme-dark .form-check-input:checked[type="radio"],
body.prism-ui.theme-dark .form-switch .form-check-input:checked {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='2.6' fill='%23ffffff'/%3e%3c/svg%3e");
}
body.prism-ui input[type="checkbox"]:not(.form-check-input), body.prism-ui input[type="radio"]:not(.form-check-input) { accent-color: var(--p-brand); }

/* labels: readable, a touch stronger */
body.prism-ui label, body.prism-ui .form-label, body.prism-ui .col-form-label {
  color: var(--p-label) !important;
  font-weight: 500 !important;
}
body.prism-ui .form-check-label, body.prism-ui .form-check label { color: var(--p-text-2) !important; }

/* ---------- Buttons: one consistent, clearly visible set ---------- */
body.prism-ui .btn { font-weight: 500; letter-spacing: .005em; }
body.prism-ui .btn-primary, body.prism-ui .btn-dark {
  background: var(--p-brand) !important; border-color: var(--p-brand) !important; color: #ffffff !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.10) inset, 0 1px 2px rgba(0, 0, 0, 0.25) !important;
}
body.prism-ui .btn-primary:hover:not(:disabled), body.prism-ui .btn-dark:hover:not(:disabled) {
  background: var(--p-brand-hover) !important; border-color: var(--p-brand-hover) !important; color: #ffffff !important;
}
body.prism-ui .btn-primary:active:not(:disabled), body.prism-ui .btn-dark:active:not(:disabled) { background: var(--p-brand-active) !important; border-color: var(--p-brand-active) !important; }

body.prism-ui .btn-secondary, body.prism-ui .btn-light, body.prism-ui .btn-default, body.prism-ui .btn-light-secondary {
  background: var(--p-raised-2) !important; border-color: var(--p-field-border) !important; color: var(--p-text) !important;
}
body.prism-ui:not(.theme-dark) .btn-secondary, body.prism-ui:not(.theme-dark) .btn-light, body.prism-ui:not(.theme-dark) .btn-default, body.prism-ui:not(.theme-dark) .btn-light-secondary {
  background: #ffffff !important;
}
body.prism-ui .btn-secondary:hover:not(:disabled), body.prism-ui .btn-light:hover:not(:disabled),
body.prism-ui .btn-default:hover:not(:disabled), body.prism-ui .btn-light-secondary:hover:not(:disabled) {
  background: var(--p-control) !important; border-color: var(--p-field-border-hover) !important; color: var(--p-text) !important;
}
body.prism-ui .btn-outline-primary { background: transparent !important; color: var(--p-accent) !important; border-color: var(--p-brand-line) !important; }
body.prism-ui .btn-outline-primary:hover:not(:disabled) { background: var(--p-brand) !important; color: #ffffff !important; border-color: var(--p-brand) !important; }
body.prism-ui .btn-outline-secondary, body.prism-ui .btn-outline-dark, body.prism-ui .btn-outline-light {
  background: transparent !important; color: var(--p-text) !important; border-color: var(--p-field-border) !important;
}
body.prism-ui .btn-outline-secondary:hover:not(:disabled), body.prism-ui .btn-outline-dark:hover:not(:disabled), body.prism-ui .btn-outline-light:hover:not(:disabled) {
  background: var(--p-raised-2) !important; border-color: var(--p-field-border-hover) !important;
}
/* semantic actions: solid, muted-but-strong fills with white text (all >= 4.5:1) */
body.prism-ui .btn-success { background: #1e7a4c !important; border-color: #1e7a4c !important; color: #ffffff !important; }
body.prism-ui .btn-success:hover:not(:disabled) { background: #238a57 !important; border-color: #238a57 !important; }
body.prism-ui .btn-danger { background: #b83a3a !important; border-color: #b83a3a !important; color: #ffffff !important; }
body.prism-ui .btn-danger:hover:not(:disabled) { background: #c94545 !important; border-color: #c94545 !important; }
body.prism-ui .btn-warning { background: #b7791f !important; border-color: #b7791f !important; color: #ffffff !important; }
body.prism-ui .btn-warning:hover:not(:disabled) { background: #c6862a !important; border-color: #c6862a !important; }
body.prism-ui .btn-info { background: var(--p-brand) !important; border-color: var(--p-brand) !important; color: #ffffff !important; }
body.prism-ui .btn-info:hover:not(:disabled) { background: var(--p-brand-hover) !important; border-color: var(--p-brand-hover) !important; }
body.prism-ui .btn-success:active:not(:disabled), body.prism-ui .btn-danger:active:not(:disabled),
body.prism-ui .btn-warning:active:not(:disabled), body.prism-ui .btn-info:active:not(:disabled) { filter: brightness(.92); }
body.prism-ui .btn-outline-success { background: transparent !important; color: var(--p-success) !important; border-color: color-mix(in srgb, var(--p-success) 55%, transparent) !important; }
body.prism-ui .btn-outline-danger { background: transparent !important; color: var(--p-danger) !important; border-color: color-mix(in srgb, var(--p-danger) 55%, transparent) !important; }
body.prism-ui .btn-outline-warning { background: transparent !important; color: var(--p-warning) !important; border-color: color-mix(in srgb, var(--p-warning) 55%, transparent) !important; }
body.prism-ui .btn-outline-info { background: transparent !important; color: var(--p-accent) !important; border-color: var(--p-brand-line) !important; }
body.prism-ui .btn-outline-success:hover:not(:disabled) { background: #1e7a4c !important; color: #fff !important; }
body.prism-ui .btn-outline-danger:hover:not(:disabled) { background: #b83a3a !important; color: #fff !important; }
body.prism-ui .btn-outline-warning:hover:not(:disabled) { background: #b7791f !important; color: #fff !important; }
body.prism-ui .btn-outline-info:hover:not(:disabled) { background: var(--p-brand) !important; color: #fff !important; }
body.prism-ui .btn:disabled, body.prism-ui .btn.disabled { opacity: .5; }
body.prism-ui .btn:focus-visible { outline: 2px solid var(--p-field-focus); outline-offset: 2px; }
body.prism-ui .report-button:not(:disabled):hover { border-color: var(--p-brand-line) !important; }
body.prism-ui .swal2-styled.swal2-confirm { background: var(--p-brand) !important; color: #fff !important; }
body.prism-ui .prism-submit-btn { background: var(--p-brand); color: #fff; }
body.prism-ui .prism-submit-btn:hover:not(:disabled) { background: var(--p-brand-hover); }
body.prism-ui .pagination .page-item.active .page-link,
body.prism-ui .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.prism-ui .daterangepicker td.active, body.prism-ui .daterangepicker td.active:hover,
body.prism-ui .daterangepicker .ranges li.active { background: var(--p-brand) !important; border-color: var(--p-brand) !important; color: #fff !important; }

/* ---------- Sidebar: hover vs active immediately distinguishable ---------- */
body.prism-ui #sidebar .menu .sidebar-link { color: var(--p-text-2) !important; }
body.prism-ui #sidebar .menu .sidebar-link i { color: var(--p-muted) !important; }
body.prism-ui #sidebar .menu .sidebar-link:hover { background: var(--p-raised) !important; color: var(--p-text) !important; }
body.prism-ui #sidebar .menu .sidebar-link:hover i { color: var(--p-text) !important; }
/* current page (leaf): solid brand fill */
body.prism-ui #sidebar .menu .sidebar-item.active:not(.has-sub) > .sidebar-link {
  background: var(--p-brand) !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .10) inset, 0 4px 12px -4px rgba(0, 0, 0, .45);
}
body.prism-ui #sidebar .menu .sidebar-item.active:not(.has-sub) > .sidebar-link i { color: #ffffff !important; }
/* module containing the current page */
body.prism-ui #sidebar .menu .sidebar-item.has-sub.active > .sidebar-link {
  background: var(--p-brand-soft) !important;
  color: var(--p-text) !important;
  font-weight: 600;
}
body.prism-ui #sidebar .menu .sidebar-item.has-sub.active > .sidebar-link i { color: var(--p-accent) !important; }
body.prism-ui #sidebar .menu .submenu { border-left-color: var(--p-border-strong); }
body.prism-ui #sidebar .menu .submenu .submenu-item a { color: var(--p-muted) !important; }
body.prism-ui #sidebar .menu .submenu .submenu-item a:hover { background: var(--p-raised) !important; color: var(--p-text) !important; }
/* current page inside a module: brand fill + accent bar on the guide line */
body.prism-ui #sidebar .menu .submenu .submenu-item.active > a {
  background: var(--p-brand) !important;
  color: #ffffff !important;
  font-weight: 600;
}
body.prism-ui #sidebar .menu .submenu .submenu-item.active > a::before { background: var(--p-brand-line); width: 3px; left: -12px; top: 5px; bottom: 5px; }
body.prism-ui #sidebar .prism-submenu-caret { color: var(--p-muted) !important; }
body.prism-ui #sidebar .menu .sidebar-item.active:not(.has-sub) .prism-submenu-caret { color: #fff !important; }
body.prism-ui .prism-topbar .prism-crumb-page { color: var(--p-text); }

/* Primary commit actions across the app are marked btn-secondary in markup; give them the
   brand treatment by their stable ids (CSS only — no class or JS hook touched). */
body.prism-ui button.btn:is(#register, #registerDiagnosis, #Save, #saveBtn, #saveOrder, #SaveAddendumReport, #Submit, #submitForward,
  #GenerateLicense, #UpdateLicense, #assignBtn, #assignTo, #proceedWithDiagnosis) {
  background: var(--p-brand) !important; border-color: var(--p-brand) !important; color: #ffffff !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.10) inset, 0 1px 2px rgba(0, 0, 0, 0.25) !important;
}
body.prism-ui button.btn:is(#register, #registerDiagnosis, #Save, #saveBtn, #saveOrder, #SaveAddendumReport, #Submit, #submitForward,
  #GenerateLicense, #UpdateLicense, #assignBtn, #assignTo, #proceedWithDiagnosis):hover:not(:disabled) {
  background: var(--p-brand-hover) !important; border-color: var(--p-brand-hover) !important;
}
/* secondary commit actions (update / search / forward): brand outline */
body.prism-ui button.btn:is(#update, #updateBtn, #UpdateDiagnosis, #UpdateAddendumReport, #updateIdcId, #IDCLocationupdate,
  #updatebackupServer, #updatefrontServer, #updateWordShortcut, #search, #searchBtn, #searchButton, #Search, #updateRequsitionNo,
  #updateReferringPhysician-btn, #ForwardBtn, #addWordShortcut) {
  background: transparent !important; border-color: var(--p-brand-line) !important; color: var(--p-accent) !important;
}
body.prism-ui button.btn:is(#update, #updateBtn, #UpdateDiagnosis, #UpdateAddendumReport, #updateIdcId, #IDCLocationupdate,
  #updatebackupServer, #updatefrontServer, #updateWordShortcut, #search, #searchBtn, #searchButton, #Search, #updateRequsitionNo,
  #updateReferringPhysician-btn, #ForwardBtn, #addWordShortcut):hover:not(:disabled) {
  background: var(--p-brand) !important; border-color: var(--p-brand) !important; color: #ffffff !important;
}

/* ==========================================================================
   v7.2 — final polish: fields → tables → buttons → sidebar → theme switch.
   Same layout / grey-black-white direction; only prominence is raised.
   ========================================================================== */
body.prism-ui {
  /* light */
  --p-canvas: #eceef1;
  --p-field-bg: #f8f9fb;
  --p-field-bg-focus: #ffffff;
  --p-field-border: #aeb3bb;
  --p-field-border-hover: #7d838d;
  --p-field-readonly: #edeff2;
  --p-field-readonly-border: #cfd2d8;
  --p-field-readonly-fg: #5b6068;
  --p-field-shadow: inset 0 1px 2px rgba(16, 24, 40, 0.06);
  --p-label: #2f3237;
  --p-th-bg: #e6eef3;
  --p-th-fg: #1d3a4a;
  --p-th-line: rgba(11, 111, 156, 0.38);
  --p-row-sep: #e4e6ea;
  --p-row-stripe: #fafbfc;
  --p-row-hover: #edf5fa;
  --p-row-selected: #d9ebf5;
  --p-btn-neutral-bg: #ffffff;
  --p-btn-neutral-border: #b4b8bf;
  --p-btn-neutral-fg: #1f2328;
  --p-btn-neutral-hover: #f0f2f5;
  --p-btn-shadow: 0 1px 2px rgba(16, 24, 40, 0.10);
  --p-btn-shadow-hover: 0 3px 8px -2px rgba(16, 24, 40, 0.18);
  --p-side-active-bar: #7cc9ec;
  --p-tone-success: #177245; --p-tone-warning: #9a6212; --p-tone-danger: #b3312f; --p-tone-info: #0b6f9c;
}
body.prism-ui.theme-dark {
  --p-canvas: #161616;
  --p-field-bg: #37373b;
  --p-field-bg-focus: #3b3b40;
  --p-field-border: #6a6a71;
  --p-field-border-hover: #8d8d95;
  --p-field-readonly: #2b2b2d;
  --p-field-readonly-border: #4c4c51;
  --p-field-readonly-fg: #a9a9ae;
  --p-field-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.30);
  --p-label: #dcdcdf;
  --p-th-bg: #253139;
  --p-th-fg: #e4eef4;
  --p-th-line: rgba(63, 176, 224, 0.50);
  --p-row-sep: #37393c;
  --p-row-stripe: rgba(255, 255, 255, 0.022);
  --p-row-hover: rgba(63, 176, 224, 0.09);
  --p-row-selected: rgba(63, 176, 224, 0.20);
  --p-btn-neutral-bg: #45454a;
  --p-btn-neutral-border: #67676d;
  --p-btn-neutral-fg: #ffffff;
  --p-btn-neutral-hover: #525258;
  --p-btn-shadow: 0 1px 0 rgba(255, 255, 255, 0.07) inset, 0 1px 2px rgba(0, 0, 0, 0.35);
  --p-btn-shadow-hover: 0 1px 0 rgba(255, 255, 255, 0.09) inset, 0 4px 10px -3px rgba(0, 0, 0, 0.55);
  --p-side-active-bar: #9adcf7;
  --p-tone-success: #5fd08f; --p-tone-warning: #f0b54a; --p-tone-danger: #f08080; --p-tone-info: #6cc8ee;
}

/* ---------- theme switch: no dark flash, no animated cross-fade ---------- */
html[data-prism-theme="dark"] { background-color: #161616; color-scheme: dark; }
html[data-prism-theme="light"] { background-color: #eceef1; color-scheme: light; }
/* guard for the instant between <body> being parsed and the boot script running */
html[data-prism-theme="light"] body.prism-ui { background-color: #eceef1 !important; }
html.prism-theme-switching *, html.prism-theme-switching *::before, html.prism-theme-switching *::after { transition: none !important; }
body.prism-ui.theme-light input, body.prism-ui:not(.theme-dark) input { color-scheme: light; }

/* ---------- 1. Fields ---------- */
body.prism-ui .form-control,
body.prism-ui .form-select,
body.prism-ui select.form-control,
body.prism-ui input[type="text"]:not(.select2-search__field):not(.choices__input),
body.prism-ui input[type="number"], body.prism-ui input[type="email"], body.prism-ui input[type="password"],
body.prism-ui input[type="date"], body.prism-ui input[type="time"], body.prism-ui input[type="datetime-local"],
body.prism-ui input[type="search"], body.prism-ui input[type="tel"], body.prism-ui input[type="month"],
body.prism-ui textarea,
body.prism-ui .choices__inner,
body.prism-ui .textarea-like,
body.prism-ui .select2-container--default .select2-selection--single,
body.prism-ui .select2-container--default .select2-selection--multiple,
body.prism-ui .vscomp-toggle-button,
body.prism-ui .dataTables_wrapper .dataTables_filter input,
body.prism-ui .dataTables_wrapper .dataTables_length select {
  background-color: var(--p-field-bg) !important;
  border: 1px solid var(--p-field-border) !important;
  border-radius: var(--p-radius-sm) !important;
  box-shadow: var(--p-field-shadow) !important;
  color: var(--p-text) !important;
}
body.prism-ui .form-control:focus, body.prism-ui .form-select:focus, body.prism-ui textarea:focus,
body.prism-ui input:focus:not(.form-check-input):not(.select2-search__field):not([type="checkbox"]):not([type="radio"]):not(.choices__input),
body.prism-ui .choices.is-focused .choices__inner, body.prism-ui .choices.is-open .choices__inner,
body.prism-ui .select2-container--default.select2-container--focus .select2-selection,
body.prism-ui .select2-container--default.select2-container--open .select2-selection {
  background-color: var(--p-field-bg-focus) !important;
  border-color: var(--p-field-focus) !important;
  box-shadow: 0 0 0 3px var(--p-field-ring) !important;
  outline: none !important;
}
body.prism-ui .form-control:disabled, body.prism-ui .form-control[readonly], body.prism-ui .form-select:disabled,
body.prism-ui select:disabled, body.prism-ui input:disabled, body.prism-ui input[readonly],
body.prism-ui textarea[readonly], body.prism-ui textarea:disabled,
body.prism-ui .choices.is-disabled .choices__inner,
body.prism-ui .select2-container--default.select2-container--disabled .select2-selection {
  background-color: var(--p-field-readonly) !important;
  border: 1px solid var(--p-field-readonly-border) !important;
  box-shadow: none !important;
  color: var(--p-field-readonly-fg) !important;
  -webkit-text-fill-color: var(--p-field-readonly-fg);
  cursor: default;
}
body.prism-ui input:disabled, body.prism-ui select:disabled, body.prism-ui textarea:disabled { cursor: not-allowed; }
body.prism-ui .form-control::placeholder, body.prism-ui textarea::placeholder, body.prism-ui input::placeholder { color: var(--p-faint) !important; }
body.prism-ui.theme-dark .form-control::placeholder, body.prism-ui.theme-dark textarea::placeholder, body.prism-ui.theme-dark input::placeholder { color: #9a9aa1 !important; }
body.prism-ui .choices__inner .choices__list--single .choices__item, body.prism-ui .choices__placeholder { color: var(--p-text) !important; opacity: 1; }
body.prism-ui .choices[data-type*="select-one"]::after { border-top-color: var(--p-text-2) !important; }
body.prism-ui .choices[data-type*="select-one"].is-open::after { border-top-color: transparent !important; border-bottom-color: var(--p-text-2) !important; }
body.prism-ui .input-group > .form-control, body.prism-ui .input-group > .form-select { border-radius: 0 !important; }
body.prism-ui .input-group > :first-child { border-top-left-radius: var(--p-radius-sm) !important; border-bottom-left-radius: var(--p-radius-sm) !important; }
body.prism-ui .input-group > :last-child { border-top-right-radius: var(--p-radius-sm) !important; border-bottom-right-radius: var(--p-radius-sm) !important; }
body.prism-ui .input-group-text { background: var(--p-raised-2) !important; border-color: var(--p-field-border) !important; }
/* labels */
body.prism-ui label:not(.form-check-label):not(.btn), body.prism-ui .form-label, body.prism-ui .col-form-label {
  color: var(--p-label) !important;
  font-weight: 600 !important;
  font-size: .78rem;
  letter-spacing: .005em;
}
body.prism-ui .form-group > label, body.prism-ui .form-label { margin-bottom: 5px; }
/* validation stays readable on the new field colors */
body.prism-ui .form-control.is-invalid, body.prism-ui .was-validated .form-control:invalid, body.prism-ui .form-select.is-invalid { border-color: var(--p-tone-danger) !important; }
body.prism-ui .form-control.is-valid, body.prism-ui .form-select.is-valid { border-color: var(--p-tone-success) !important; }
body.prism-ui .invalid-feedback, body.prism-ui .text-danger { color: var(--p-tone-danger) !important; }

/* ---------- 2. Tables ---------- */
body.prism-ui .table > :not(:first-child) { border-top: 0 !important; }   /* kills Bootstrap's white 2px line under thead */
body.prism-ui .table thead th, body.prism-ui .table > thead > tr > th, body.prism-ui table thead th,
body.prism-ui thead.thead-dark th, body.prism-ui thead.thead-light th, body.prism-ui .thead-dark th, body.prism-ui .thead-light th,
body.prism-ui table.dataTable thead th, body.prism-ui .dataTables_scrollHead thead th {
  background-color: var(--p-th-bg) !important;
  color: var(--p-th-fg) !important;
  font-weight: 600 !important;
  font-size: .74rem !important;
  letter-spacing: .01em;
  border-bottom: 2px solid var(--p-th-line) !important;
  border-color: var(--p-row-sep);
}
body.prism-ui table.dataTable thead .sorting, body.prism-ui table.dataTable thead .sorting_asc, body.prism-ui table.dataTable thead .sorting_desc { background-repeat: no-repeat !important; }
body.prism-ui .table-bordered > thead > tr > th { border-right-color: color-mix(in srgb, var(--p-th-fg) 12%, transparent) !important; }
body.prism-ui .table > tbody > tr > td { border-bottom: 1px solid var(--p-row-sep) !important; color: var(--p-text-2) !important; }
body.prism-ui .table-bordered > tbody > tr > td { border-left-color: var(--p-row-sep) !important; border-right-color: var(--p-row-sep) !important; }
body.prism-ui .table > tbody > tr:last-child > td { border-bottom-color: transparent !important; }
body.prism-ui .table-striped > tbody > tr:nth-of-type(odd) > * { background-color: var(--p-row-stripe) !important; }
body.prism-ui .table > tbody > tr:hover > * { background-color: var(--p-row-hover) !important; color: var(--p-text) !important; }
body.prism-ui .table tbody tr.selected > *, body.prism-ui .table tbody tr.selected-row > *, body.prism-ui .table tbody tr.highlight-row > *,
body.prism-ui .table tbody tr.row-selected > *, body.prism-ui .table tbody tr.active > *, body.prism-ui .table tbody tr.table-active > *,
body.prism-ui tr.selected > td, body.prism-ui tr.selected-row > td, body.prism-ui tr.highlight-row > td, body.prism-ui tr.row-selected > td {
  background-color: var(--p-row-selected) !important; color: var(--p-text) !important;
}
body.prism-ui .table tbody tr.selected > td:first-child, body.prism-ui .table tbody tr.selected-row > td:first-child,
body.prism-ui .table tbody tr.row-selected > td:first-child, body.prism-ui .table tbody tr.highlight-row > td:first-child { box-shadow: inset 3px 0 0 var(--p-brand-line) !important; }
body.prism-ui .table-responsive, body.prism-ui .dataTables_scrollBody { border-color: var(--p-field-readonly-border) !important; }
body.prism-ui .table-responsive { border-radius: var(--p-radius-sm); }
body.prism-ui .table td strong, body.prism-ui .table td b { color: var(--p-text); }
/* action cells: buttons centred, never wrapping */
body.prism-ui .table td:has(> .btn, > button, > a.btn, > .btn-group) { text-align: center; white-space: nowrap; }
body.prism-ui .table td > .btn, body.prism-ui .table td > button.btn, body.prism-ui .table td .btn-group > .btn { min-height: 28px; padding: 3px 10px; font-size: .74rem; }
/* column roles (set from header text by the layout script: i=index, s=status, a=action, n=numeric) */
body.prism-ui table > * > tr > [data-p-role="i"] { text-align: center; width: 1%; white-space: nowrap; font-variant-numeric: tabular-nums; }
body.prism-ui table > tbody > tr > td[data-p-role="i"] { color: var(--p-muted) !important; }
body.prism-ui table > * > tr > [data-p-role="n"] { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
body.prism-ui table > tbody > tr > td[data-p-role="n"] { color: var(--p-text) !important; font-weight: 500; }
body.prism-ui table > * > tr > [data-p-role="a"] { text-align: center; white-space: nowrap; }
body.prism-ui table > tbody > tr > td[data-p-role="s"] { font-weight: 600; color: var(--p-text) !important; white-space: nowrap; }
body.prism-ui table > tbody > tr > td[data-p-tone][data-p-role]::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; background: currentColor; }
body.prism-ui table > tbody > tr > td[data-p-tone="success"][data-p-role] { color: var(--p-tone-success) !important; }
body.prism-ui table > tbody > tr > td[data-p-tone="warning"][data-p-role] { color: var(--p-tone-warning) !important; }
body.prism-ui table > tbody > tr > td[data-p-tone="danger"][data-p-role]  { color: var(--p-tone-danger) !important; }
body.prism-ui table > tbody > tr > td[data-p-tone="info"][data-p-role]    { color: var(--p-tone-info) !important; }

/* ---------- 3. Buttons ---------- */
body.prism-ui .btn {
  font-weight: 600 !important;
  min-height: 36px;
  padding: 7px 16px;
  border-radius: var(--p-radius-sm);
  transition: background-color .15s var(--p-ease), border-color .15s var(--p-ease), color .15s var(--p-ease), box-shadow .15s var(--p-ease), transform .1s var(--p-ease);
}
body.prism-ui .btn-sm, body.prism-ui .btn-group-sm > .btn { min-height: 30px; padding: 4px 11px; }
body.prism-ui .btn:is(.btn-primary, .btn-dark, .btn-success, .btn-danger, .btn-warning, .btn-info, .btn-secondary, .btn-light, .btn-default, .btn-light-secondary),
body.prism-ui button.btn:is(#register, #registerDiagnosis, #Save, #saveBtn, #saveOrder, #SaveAddendumReport, #Submit, #submitForward, #GenerateLicense, #UpdateLicense, #assignBtn, #assignTo, #proceedWithDiagnosis) {
  box-shadow: var(--p-btn-shadow) !important;
}
body.prism-ui .btn:not(:disabled):not(.disabled):not(.btn-link):not(.btn-close):hover { transform: translateY(-1px); box-shadow: var(--p-btn-shadow-hover) !important; }
body.prism-ui .btn:not(:disabled):not(.disabled):not(.btn-link):not(.btn-close):active { transform: translateY(0); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25) !important; }
body.prism-ui .btn-secondary, body.prism-ui .btn-light, body.prism-ui .btn-default, body.prism-ui .btn-light-secondary,
body.prism-ui:not(.theme-dark) .btn-secondary, body.prism-ui:not(.theme-dark) .btn-light, body.prism-ui:not(.theme-dark) .btn-default, body.prism-ui:not(.theme-dark) .btn-light-secondary {
  background: var(--p-btn-neutral-bg) !important; border-color: var(--p-btn-neutral-border) !important; color: var(--p-btn-neutral-fg) !important;
}
body.prism-ui .btn-secondary:hover:not(:disabled), body.prism-ui .btn-light:hover:not(:disabled),
body.prism-ui .btn-default:hover:not(:disabled), body.prism-ui .btn-light-secondary:hover:not(:disabled) {
  background: var(--p-btn-neutral-hover) !important; border-color: var(--p-field-border-hover) !important; color: var(--p-btn-neutral-fg) !important;
}
body.prism-ui .btn-outline-primary, body.prism-ui .btn-outline-info,
body.prism-ui button.btn:is(#update, #updateBtn, #UpdateDiagnosis, #UpdateAddendumReport, #updateIdcId, #IDCLocationupdate, #updatebackupServer, #updatefrontServer, #updateWordShortcut, #search, #searchBtn, #searchButton, #Search, #updateRequsitionNo, #updateReferringPhysician-btn, #ForwardBtn, #addWordShortcut) {
  background: var(--p-brand-soft) !important; border-color: var(--p-brand-line) !important; color: var(--p-accent) !important;
}
body.prism-ui:not(.theme-dark) .btn-outline-primary, body.prism-ui:not(.theme-dark) .btn-outline-info,
body.prism-ui:not(.theme-dark) button.btn:is(#update, #updateBtn, #UpdateDiagnosis, #UpdateAddendumReport, #updateIdcId, #IDCLocationupdate, #updatebackupServer, #updatefrontServer, #updateWordShortcut, #search, #searchBtn, #searchButton, #Search, #updateRequsitionNo, #updateReferringPhysician-btn, #ForwardBtn, #addWordShortcut) {
  color: var(--p-brand) !important;
}
body.prism-ui .btn-outline-primary:hover:not(:disabled), body.prism-ui .btn-outline-info:hover:not(:disabled),
body.prism-ui button.btn:is(#update, #updateBtn, #UpdateDiagnosis, #UpdateAddendumReport, #updateIdcId, #IDCLocationupdate, #updatebackupServer, #updatefrontServer, #updateWordShortcut, #search, #searchBtn, #searchButton, #Search, #updateRequsitionNo, #updateReferringPhysician-btn, #ForwardBtn, #addWordShortcut):hover:not(:disabled) {
  background: var(--p-brand) !important; border-color: var(--p-brand) !important; color: #ffffff !important;
}
body.prism-ui .btn-outline-secondary, body.prism-ui .btn-outline-dark, body.prism-ui .btn-outline-light { border-color: var(--p-btn-neutral-border) !important; color: var(--p-text) !important; }
body.prism-ui .btn-outline-success { border-color: color-mix(in srgb, var(--p-tone-success) 60%, transparent) !important; color: var(--p-tone-success) !important; }
body.prism-ui .btn-outline-danger  { border-color: color-mix(in srgb, var(--p-tone-danger) 60%, transparent) !important;  color: var(--p-tone-danger) !important; }
body.prism-ui .btn-outline-warning { border-color: color-mix(in srgb, var(--p-tone-warning) 60%, transparent) !important; color: var(--p-tone-warning) !important; }
body.prism-ui .btn-outline-success:hover:not(:disabled), body.prism-ui .btn-outline-danger:hover:not(:disabled), body.prism-ui .btn-outline-warning:hover:not(:disabled) { color: #ffffff !important; }
/* disabled: clearly inactive but still legible */
body.prism-ui .btn:disabled, body.prism-ui .btn.disabled { opacity: .55 !important; transform: none !important; box-shadow: none !important; filter: saturate(.6); cursor: not-allowed; pointer-events: auto; }
body.prism-ui .btn:is(.btn-secondary, .btn-light, .btn-default, .btn-light-secondary):disabled { opacity: .7 !important; color: var(--p-muted) !important; }
/* form action rows: centred where the row is a full-width footer (explicit justify-* classes still win) */
body.prism-ui .prism-actions:not([class*="justify-content-"]):not([class*="col-"]),
body.prism-ui .form-actions:not([class*="justify-content-"]):not([class*="col-"]) { justify-content: center; }
body.prism-ui .prism-actions > .btn, body.prism-ui .form-actions > .btn { min-width: 96px; }
@media (max-width: 575.98px) {
  body.prism-ui .prism-actions > .btn, body.prism-ui .form-actions > .btn { flex: 1 1 calc(50% - 8px); min-width: 0; }
}

/* ---------- 4. Sidebar ---------- */
body.prism-ui #sidebar .menu .sidebar-link i, body.prism-ui #sidebar .menu .sidebar-link svg { color: var(--p-text-2) !important; opacity: .85; }
body.prism-ui #sidebar .menu .sidebar-link { color: var(--p-text-2) !important; font-weight: 500; }
body.prism-ui #sidebar .menu .sidebar-link:hover { background: var(--p-raised) !important; color: var(--p-text) !important; }
body.prism-ui #sidebar .menu .sidebar-link:hover i { opacity: 1; color: var(--p-text) !important; }
body.prism-ui #sidebar .menu .sidebar-item.active:not(.has-sub) > .sidebar-link,
body.prism-ui #sidebar .menu .submenu .submenu-item.active > a {
  background: var(--p-brand) !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  box-shadow: inset 3px 0 0 var(--p-side-active-bar), 0 4px 12px -5px rgba(0, 0, 0, .5) !important;
}
body.prism-ui #sidebar .menu .sidebar-item.active:not(.has-sub) > .sidebar-link i,
body.prism-ui #sidebar .menu .sidebar-item.active:not(.has-sub) > .sidebar-link svg { color: #ffffff !important; opacity: 1; }
body.prism-ui #sidebar .menu .sidebar-item.active:not(.has-sub) > .sidebar-link:hover,
body.prism-ui #sidebar .menu .submenu .submenu-item.active > a:hover { background: var(--p-brand-hover) !important; color: #ffffff !important; }
body.prism-ui #sidebar .menu .sidebar-item.has-sub.active > .sidebar-link { background: var(--p-brand-soft) !important; color: var(--p-text) !important; font-weight: 600 !important; }
body.prism-ui #sidebar .menu .sidebar-item.has-sub.active > .sidebar-link i { color: var(--p-accent) !important; opacity: 1; }
body.prism-ui:not(.theme-dark) #sidebar .menu .sidebar-item.has-sub.active > .sidebar-link i { color: var(--p-brand) !important; }
body.prism-ui #sidebar .menu .submenu .submenu-item a { color: var(--p-text-2) !important; opacity: .9; }
body.prism-ui #sidebar .menu .submenu .submenu-item a:hover { opacity: 1; background: var(--p-raised) !important; color: var(--p-text) !important; }
body.prism-ui #sidebar .menu .submenu .submenu-item.active > a { opacity: 1; }
/* joined controls stay aligned on hover */
body.prism-ui .input-group .btn:hover, body.prism-ui .input-group .btn:active,
body.prism-ui .btn-group > .btn:hover, body.prism-ui .btn-group > .btn:active,
body.prism-ui .dataTables_wrapper .btn:hover { transform: none !important; }

/* ==========================================================================
   v7.3 — coloured table header bars (both themes) + prominent clicked row
   ========================================================================== */
body.prism-ui {
  --p-th-bg: #11729f;
  --p-th-fg: #ffffff;
  --p-th-line: #0b5a80;
  --p-th-sep: rgba(255, 255, 255, 0.16);
  --p-th-glow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  --p-cur-bg: #cfe6f3;
  --p-cur-hover: #c3e0f0;
  --p-cur-fg: #08324a;
  --p-cur-bar: #0b6f9c;
  --p-cur-line: rgba(11, 111, 156, 0.45);
}
body.prism-ui.theme-dark {
  --p-th-bg: #15435d;
  --p-th-fg: #ffffff;
  --p-th-line: #3fb0e0;
  --p-th-sep: rgba(255, 255, 255, 0.10);
  --p-th-glow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  --p-cur-bg: #1f5b7c;
  --p-cur-hover: #246789;
  --p-cur-fg: #ffffff;
  --p-cur-bar: #5cc8f2;
  --p-cur-line: rgba(92, 200, 242, 0.55);
}
/* header bar */
body.prism-ui table > thead > tr > th, body.prism-ui table > thead > tr > td,
body.prism-ui .table thead th, body.prism-ui table.dataTable thead th, body.prism-ui .dataTables_scrollHead thead th,
body.prism-ui thead.thead-dark th, body.prism-ui thead.thead-light th, body.prism-ui .thead-dark th, body.prism-ui .thead-light th {
  background-color: var(--p-th-bg) !important;
  color: var(--p-th-fg) !important;
  font-weight: 600 !important;
  border-bottom: 2px solid var(--p-th-line) !important;
  box-shadow: var(--p-th-glow);
}
body.prism-ui table > thead > tr > th:not([class*="sorting"]) { background-image: none !important; }
body.prism-ui table > thead > tr > th + th, body.prism-ui .table-bordered > thead > tr > th { border-left-color: var(--p-th-sep) !important; border-right-color: var(--p-th-sep) !important; }
body.prism-ui table > thead > tr > th a, body.prism-ui table > thead > tr > th i, body.prism-ui table > thead > tr > th .bi,
body.prism-ui thead [data-p-role] { color: var(--p-th-fg) !important; }
body.prism-ui table > thead .form-check-input { border-color: rgba(255, 255, 255, 0.7); }
body.prism-ui .table-responsive:has(> table > thead), body.prism-ui .dataTables_scrollHead { border-top-left-radius: var(--p-radius-sm); border-top-right-radius: var(--p-radius-sm); }
body.prism-ui .table-responsive > table > thead > tr:first-child > th:first-child { border-top-left-radius: calc(var(--p-radius-sm) - 1px); }
body.prism-ui .table-responsive > table > thead > tr:first-child > th:last-child { border-top-right-radius: calc(var(--p-radius-sm) - 1px); }

/* clicked / selected row — one look for every selection class the pages use,
   plus [data-p-current] which the layout sets on the last clicked row.
   :not(#p-x) lifts specificity above page-local #TableId rules. */
body.prism-ui table > tbody > tr:is([data-p-current], .selected, .selected-row, .selected-rows, .row-selected, .highlight-row, .active, .table-active) > :is(td, th):not(#p-x) {
  background-color: var(--p-cur-bg) !important;
  color: var(--p-cur-fg) !important;
  font-weight: 600 !important;
  box-shadow: inset 0 1px 0 var(--p-cur-line), inset 0 -1px 0 var(--p-cur-line) !important;
}
body.prism-ui table > tbody > tr:is([data-p-current], .selected, .selected-row, .selected-rows, .row-selected, .highlight-row, .active, .table-active) > :is(td, th):first-child:not(#p-x) {
  box-shadow: inset 4px 0 0 var(--p-cur-bar), inset 0 1px 0 var(--p-cur-line), inset 0 -1px 0 var(--p-cur-line) !important;
}
body.prism-ui table > tbody > tr:is([data-p-current], .selected, .selected-row, .selected-rows, .row-selected, .highlight-row, .active, .table-active):hover > :is(td, th):not(#p-x) {
  background-color: var(--p-cur-hover) !important;
}
body.prism-ui table > tbody > tr:is([data-p-current], .selected, .selected-row, .selected-rows, .row-selected, .highlight-row, .active, .table-active) > td[data-p-role="i"]:not(#p-x):not(#p-y) { color: var(--p-cur-fg) !important; }
body.prism-ui table > tbody > tr:is([data-p-current], .selected, .selected-row, .selected-rows, .row-selected, .highlight-row, .active, .table-active) a:not(.btn) { color: var(--p-cur-fg) !important; }
body.prism-ui:not(.theme-dark) table > tbody > tr:is([data-p-current], .selected, .selected-row, .selected-rows, .row-selected, .highlight-row, .active, .table-active) > td[data-p-tone="success"]:not(#p-x):not(#p-y) { color: #0f5c35 !important; }
body.prism-ui:not(.theme-dark) table > tbody > tr:is([data-p-current], .selected, .selected-row, .selected-rows, .row-selected, .highlight-row, .active, .table-active) > td[data-p-tone="warning"]:not(#p-x):not(#p-y) { color: #7a4c0a !important; }
body.prism-ui:not(.theme-dark) table > tbody > tr:is([data-p-current], .selected, .selected-row, .selected-rows, .row-selected, .highlight-row, .active, .table-active) > td[data-p-tone="danger"]:not(#p-x):not(#p-y) { color: #962624 !important; }
body.prism-ui table > tbody > tr:is([data-p-current], .selected, .selected-row, .selected-rows, .row-selected, .highlight-row, .active, .table-active) > td[data-p-tone]:not([data-p-tone="success"]):not([data-p-tone="warning"]):not([data-p-tone="danger"]):not(#p-x) { color: var(--p-cur-fg) !important; }
body.prism-ui.theme-dark table > tbody > tr:is([data-p-current], .selected, .selected-row, .selected-rows, .row-selected, .highlight-row, .active, .table-active) > td[data-p-tone="success"]:not(#p-x):not(#p-y) { color: #7ee2a8 !important; }
body.prism-ui.theme-dark table > tbody > tr:is([data-p-current], .selected, .selected-row, .selected-rows, .row-selected, .highlight-row, .active, .table-active) > td[data-p-tone="warning"]:not(#p-x):not(#p-y) { color: #ffc864 !important; }
body.prism-ui.theme-dark table > tbody > tr:is([data-p-current], .selected, .selected-row, .selected-rows, .row-selected, .highlight-row, .active, .table-active) > td[data-p-tone="danger"]:not(#p-x):not(#p-y) { color: #ff9a9a !important; }
/* calendars and editors keep their own look */
body.prism-ui :is(.daterangepicker, .datepicker, .ui-datepicker, .note-editor, .flatpickr-calendar, .swal2-container) table > thead > tr > th {
  background-color: transparent !important; color: inherit !important; border-bottom: 0 !important; box-shadow: none !important;
}
body.prism-ui :is(.daterangepicker, .datepicker, .ui-datepicker, .note-editor, .flatpickr-calendar) table > tbody > tr > td { box-shadow: none !important; font-weight: inherit !important; }

/* ==========================================================================
   v7.4 — semantic button colours (one token set, both themes)
   primary = brand blue (search / filter / navigate)   success = muted green (save / submit / confirm)
   warning = muted amber (update / edit / refund)       danger  = muted red (delete / remove / cancel order)
   info    = soft cyan tint (view / details / attach)    export  = slate indigo (export / print / download)
   soft    = soft blue tint (refresh)                   neutral = grey (clear / cancel / close / exit)
   The role comes from the class (.btn-primary …) and, inside PRISM layouts, from a small script that sets
   data-p-intent from the button's label/icon, so mis-classed buttons (e.g. a "Save" marked btn-secondary)
   still get the right colour. `:not(#p-x)` lifts these above the older id-based rules.
   ========================================================================== */
body.prism-ui {
  --p-b-primary: #0b6f9c; --p-b-primary-h: #095d83; --p-b-primary-a: #084f70;
  --p-b-success: #1d7a4b; --p-b-success-h: #18683f; --p-b-success-a: #145735;
  --p-b-warning: #a0600d; --p-b-warning-h: #8c530a; --p-b-warning-a: #784708;
  --p-b-danger: #b3302e; --p-b-danger-h: #9c2927; --p-b-danger-a: #852321;
  --p-b-export: #4d5b8c; --p-b-export-h: #414e7a; --p-b-export-a: #364168;
  --p-b-info-bg: #e2f2f6; --p-b-info-border: #86c6d5; --p-b-info-fg: #0d6275; --p-b-info-solid: #0f7a8f; --p-b-info-solid-a: #0b6677;
  --p-b-soft-bg: #e5eff6; --p-b-soft-border: #8fbad4; --p-b-soft-fg: #0b5c82;
  --p-b-neutral-bg: #ffffff; --p-b-neutral-border: #b4b8bf; --p-b-neutral-fg: #2b2f36; --p-b-neutral-h: #eef0f3; --p-b-neutral-border-h: #878d97; --p-b-neutral-a: #e2e5e9;
  --p-b-lift: 0 4px 10px -3px rgba(16, 24, 40, 0.28);
  --p-b-rest: 0 1px 2px rgba(16, 24, 40, 0.12);
  --p-b-press: inset 0 2px 4px rgba(0, 0, 0, 0.22);
}
body.prism-ui.theme-dark {
  --p-b-primary: #0c7aab; --p-b-primary-h: #0e89bf; --p-b-primary-a: #0a6a95;
  --p-b-success: #1f7d52; --p-b-success-h: #248d5d; --p-b-success-a: #1a6a45;
  --p-b-warning: #9c620e; --p-b-warning-h: #ad6e12; --p-b-warning-a: #8a560b;
  --p-b-danger: #b83a3a; --p-b-danger-h: #c94545; --p-b-danger-a: #a33232;
  --p-b-export: #56639a; --p-b-export-h: #6371aa; --p-b-export-a: #4a5687;
  --p-b-info-bg: rgba(56, 178, 204, 0.14); --p-b-info-border: rgba(86, 196, 220, 0.55); --p-b-info-fg: #86d6e8; --p-b-info-solid: #1a8196; --p-b-info-solid-a: #156c7e;
  --p-b-soft-bg: rgba(63, 176, 224, 0.14); --p-b-soft-border: rgba(63, 176, 224, 0.50); --p-b-soft-fg: #93d2ef;
  --p-b-neutral-bg: #45454a; --p-b-neutral-border: #67676d; --p-b-neutral-fg: #f2f2f3; --p-b-neutral-h: #525258; --p-b-neutral-border-h: #85858c; --p-b-neutral-a: #3c3c41;
  --p-b-lift: 0 1px 0 rgba(255, 255, 255, 0.08) inset, 0 5px 12px -4px rgba(0, 0, 0, 0.6);
  --p-b-rest: 0 1px 0 rgba(255, 255, 255, 0.07) inset, 0 1px 2px rgba(0, 0, 0, 0.35);
  --p-b-press: inset 0 2px 5px rgba(0, 0, 0, 0.4);
}
body.prism-ui .btn {
  transition: background-color .16s var(--p-ease), border-color .16s var(--p-ease), color .16s var(--p-ease), box-shadow .16s var(--p-ease), transform .12s var(--p-ease);
}
body.prism-ui .btn i, body.prism-ui .btn svg, body.prism-ui .btn .bi, body.prism-ui .btn [class*="fa-"] { color: inherit !important; }
body.prism-ui .btn[data-p-intent="primary"]:not(#p-x):not(#p-y),
body.prism-ui .btn-primary,
body.prism-ui .btn-dark {
  background: var(--p-b-primary) !important; border-color: var(--p-b-primary) !important; color: #ffffff !important; box-shadow: var(--p-b-rest) !important;
}
body.prism-ui .btn[data-p-intent="primary"]:not(#p-x):not(#p-y):hover:not(:disabled):not(.disabled),
body.prism-ui .btn-primary:hover:not(:disabled):not(.disabled),
body.prism-ui .btn-dark:hover:not(:disabled):not(.disabled) {
  background: var(--p-b-primary-h) !important; border-color: var(--p-b-primary-h) !important; color: #ffffff !important; transform: translateY(-1px); box-shadow: var(--p-b-lift) !important;
}
body.prism-ui .btn[data-p-intent="primary"]:not(#p-x):not(#p-y):is(:active, .active):not(:disabled):not(.disabled),
body.prism-ui .btn-primary:is(:active, .active):not(:disabled):not(.disabled),
body.prism-ui .btn-dark:is(:active, .active):not(:disabled):not(.disabled) {
  background: var(--p-b-primary-a) !important; border-color: var(--p-b-primary-a) !important; color: #ffffff !important; transform: translateY(0); box-shadow: var(--p-b-press) !important;
}
body.prism-ui .btn[data-p-intent="success"]:not(#p-x):not(#p-y),
body.prism-ui .btn-success {
  background: var(--p-b-success) !important; border-color: var(--p-b-success) !important; color: #ffffff !important; box-shadow: var(--p-b-rest) !important;
}
body.prism-ui .btn[data-p-intent="success"]:not(#p-x):not(#p-y):hover:not(:disabled):not(.disabled),
body.prism-ui .btn-success:hover:not(:disabled):not(.disabled) {
  background: var(--p-b-success-h) !important; border-color: var(--p-b-success-h) !important; color: #ffffff !important; transform: translateY(-1px); box-shadow: var(--p-b-lift) !important;
}
body.prism-ui .btn[data-p-intent="success"]:not(#p-x):not(#p-y):is(:active, .active):not(:disabled):not(.disabled),
body.prism-ui .btn-success:is(:active, .active):not(:disabled):not(.disabled) {
  background: var(--p-b-success-a) !important; border-color: var(--p-b-success-a) !important; color: #ffffff !important; transform: translateY(0); box-shadow: var(--p-b-press) !important;
}
body.prism-ui .btn[data-p-intent="warning"]:not(#p-x):not(#p-y),
body.prism-ui .btn-warning {
  background: var(--p-b-warning) !important; border-color: var(--p-b-warning) !important; color: #ffffff !important; box-shadow: var(--p-b-rest) !important;
}
body.prism-ui .btn[data-p-intent="warning"]:not(#p-x):not(#p-y):hover:not(:disabled):not(.disabled),
body.prism-ui .btn-warning:hover:not(:disabled):not(.disabled) {
  background: var(--p-b-warning-h) !important; border-color: var(--p-b-warning-h) !important; color: #ffffff !important; transform: translateY(-1px); box-shadow: var(--p-b-lift) !important;
}
body.prism-ui .btn[data-p-intent="warning"]:not(#p-x):not(#p-y):is(:active, .active):not(:disabled):not(.disabled),
body.prism-ui .btn-warning:is(:active, .active):not(:disabled):not(.disabled) {
  background: var(--p-b-warning-a) !important; border-color: var(--p-b-warning-a) !important; color: #ffffff !important; transform: translateY(0); box-shadow: var(--p-b-press) !important;
}
body.prism-ui .btn[data-p-intent="danger"]:not(#p-x):not(#p-y),
body.prism-ui .btn-danger {
  background: var(--p-b-danger) !important; border-color: var(--p-b-danger) !important; color: #ffffff !important; box-shadow: var(--p-b-rest) !important;
}
body.prism-ui .btn[data-p-intent="danger"]:not(#p-x):not(#p-y):hover:not(:disabled):not(.disabled),
body.prism-ui .btn-danger:hover:not(:disabled):not(.disabled) {
  background: var(--p-b-danger-h) !important; border-color: var(--p-b-danger-h) !important; color: #ffffff !important; transform: translateY(-1px); box-shadow: var(--p-b-lift) !important;
}
body.prism-ui .btn[data-p-intent="danger"]:not(#p-x):not(#p-y):is(:active, .active):not(:disabled):not(.disabled),
body.prism-ui .btn-danger:is(:active, .active):not(:disabled):not(.disabled) {
  background: var(--p-b-danger-a) !important; border-color: var(--p-b-danger-a) !important; color: #ffffff !important; transform: translateY(0); box-shadow: var(--p-b-press) !important;
}
body.prism-ui .btn[data-p-intent="export"]:not(#p-x):not(#p-y) {
  background: var(--p-b-export) !important; border-color: var(--p-b-export) !important; color: #ffffff !important; box-shadow: var(--p-b-rest) !important;
}
body.prism-ui .btn[data-p-intent="export"]:not(#p-x):not(#p-y):hover:not(:disabled):not(.disabled) {
  background: var(--p-b-export-h) !important; border-color: var(--p-b-export-h) !important; color: #ffffff !important; transform: translateY(-1px); box-shadow: var(--p-b-lift) !important;
}
body.prism-ui .btn[data-p-intent="export"]:not(#p-x):not(#p-y):is(:active, .active):not(:disabled):not(.disabled) {
  background: var(--p-b-export-a) !important; border-color: var(--p-b-export-a) !important; color: #ffffff !important; transform: translateY(0); box-shadow: var(--p-b-press) !important;
}
body.prism-ui .btn-outline-success { background: color-mix(in srgb, var(--p-b-success) 10%, transparent) !important; border-color: color-mix(in srgb, var(--p-b-success) 60%, transparent) !important; color: var(--p-tone-success) !important; box-shadow: none !important; }
body.prism-ui .btn-outline-success:hover:not(:disabled):not(.disabled) { background: var(--p-b-success) !important; border-color: var(--p-b-success) !important; color: #fff !important; transform: translateY(-1px); box-shadow: var(--p-b-lift) !important; }
body.prism-ui .btn-outline-success:is(:active, .active):not(:disabled):not(.disabled) { background: var(--p-b-success-a) !important; border-color: var(--p-b-success-a) !important; color: #fff !important; transform: translateY(0); box-shadow: var(--p-b-press) !important; }
body.prism-ui .btn-outline-warning { background: color-mix(in srgb, var(--p-b-warning) 10%, transparent) !important; border-color: color-mix(in srgb, var(--p-b-warning) 60%, transparent) !important; color: var(--p-tone-warning) !important; box-shadow: none !important; }
body.prism-ui .btn-outline-warning:hover:not(:disabled):not(.disabled) { background: var(--p-b-warning) !important; border-color: var(--p-b-warning) !important; color: #fff !important; transform: translateY(-1px); box-shadow: var(--p-b-lift) !important; }
body.prism-ui .btn-outline-warning:is(:active, .active):not(:disabled):not(.disabled) { background: var(--p-b-warning-a) !important; border-color: var(--p-b-warning-a) !important; color: #fff !important; transform: translateY(0); box-shadow: var(--p-b-press) !important; }
body.prism-ui .btn-outline-danger { background: color-mix(in srgb, var(--p-b-danger) 10%, transparent) !important; border-color: color-mix(in srgb, var(--p-b-danger) 60%, transparent) !important; color: var(--p-tone-danger) !important; box-shadow: none !important; }
body.prism-ui .btn-outline-danger:hover:not(:disabled):not(.disabled) { background: var(--p-b-danger) !important; border-color: var(--p-b-danger) !important; color: #fff !important; transform: translateY(-1px); box-shadow: var(--p-b-lift) !important; }
body.prism-ui .btn-outline-danger:is(:active, .active):not(:disabled):not(.disabled) { background: var(--p-b-danger-a) !important; border-color: var(--p-b-danger-a) !important; color: #fff !important; transform: translateY(0); box-shadow: var(--p-b-press) !important; }
body.prism-ui .btn[data-p-intent="info"]:not(#p-x):not(#p-y),
body.prism-ui .btn-info,
body.prism-ui .btn-outline-info {
  background: var(--p-b-info-bg) !important; border-color: var(--p-b-info-border) !important; color: var(--p-b-info-fg) !important; box-shadow: none !important;
}
body.prism-ui .btn[data-p-intent="info"]:not(#p-x):not(#p-y):hover:not(:disabled):not(.disabled),
body.prism-ui .btn-info:hover:not(:disabled):not(.disabled),
body.prism-ui .btn-outline-info:hover:not(:disabled):not(.disabled) {
  background: var(--p-b-info-solid) !important; border-color: var(--p-b-info-solid) !important; color: #ffffff !important; transform: translateY(-1px); box-shadow: var(--p-b-lift) !important;
}
body.prism-ui .btn[data-p-intent="info"]:not(#p-x):not(#p-y):is(:active, .active):not(:disabled):not(.disabled),
body.prism-ui .btn-info:is(:active, .active):not(:disabled):not(.disabled),
body.prism-ui .btn-outline-info:is(:active, .active):not(:disabled):not(.disabled) {
  background: var(--p-b-info-solid-a) !important; border-color: var(--p-b-info-solid-a) !important; color: #ffffff !important; transform: translateY(0); box-shadow: var(--p-b-press) !important;
}
body.prism-ui .btn[data-p-intent="soft"]:not(#p-x):not(#p-y),
body.prism-ui .btn-outline-primary {
  background: var(--p-b-soft-bg) !important; border-color: var(--p-b-soft-border) !important; color: var(--p-b-soft-fg) !important; box-shadow: none !important;
}
body.prism-ui .btn[data-p-intent="soft"]:not(#p-x):not(#p-y):hover:not(:disabled):not(.disabled),
body.prism-ui .btn-outline-primary:hover:not(:disabled):not(.disabled) {
  background: var(--p-b-primary) !important; border-color: var(--p-b-primary) !important; color: #ffffff !important; transform: translateY(-1px); box-shadow: var(--p-b-lift) !important;
}
body.prism-ui .btn[data-p-intent="soft"]:not(#p-x):not(#p-y):is(:active, .active):not(:disabled):not(.disabled),
body.prism-ui .btn-outline-primary:is(:active, .active):not(:disabled):not(.disabled) {
  background: var(--p-b-primary-a) !important; border-color: var(--p-b-primary-a) !important; color: #ffffff !important; transform: translateY(0); box-shadow: var(--p-b-press) !important;
}
body.prism-ui .btn[data-p-intent="neutral"]:not(#p-x):not(#p-y),
body.prism-ui .btn-secondary,
body.prism-ui .btn-light,
body.prism-ui .btn-default,
body.prism-ui .btn-light-secondary,
body.prism-ui .btn-outline-secondary,
body.prism-ui .btn-outline-dark,
body.prism-ui .btn-outline-light {
  background: var(--p-b-neutral-bg) !important; border-color: var(--p-b-neutral-border) !important; color: var(--p-b-neutral-fg) !important; box-shadow: var(--p-b-rest) !important;
}
body.prism-ui .btn[data-p-intent="neutral"]:not(#p-x):not(#p-y):hover:not(:disabled):not(.disabled),
body.prism-ui .btn-secondary:hover:not(:disabled):not(.disabled),
body.prism-ui .btn-light:hover:not(:disabled):not(.disabled),
body.prism-ui .btn-default:hover:not(:disabled):not(.disabled),
body.prism-ui .btn-light-secondary:hover:not(:disabled):not(.disabled),
body.prism-ui .btn-outline-secondary:hover:not(:disabled):not(.disabled),
body.prism-ui .btn-outline-dark:hover:not(:disabled):not(.disabled),
body.prism-ui .btn-outline-light:hover:not(:disabled):not(.disabled) {
  background: var(--p-b-neutral-h) !important; border-color: var(--p-b-neutral-border-h) !important; color: var(--p-b-neutral-fg) !important; transform: translateY(-1px); box-shadow: var(--p-b-lift) !important;
}
body.prism-ui .btn[data-p-intent="neutral"]:not(#p-x):not(#p-y):is(:active, .active):not(:disabled):not(.disabled),
body.prism-ui .btn-secondary:is(:active, .active):not(:disabled):not(.disabled),
body.prism-ui .btn-light:is(:active, .active):not(:disabled):not(.disabled),
body.prism-ui .btn-default:is(:active, .active):not(:disabled):not(.disabled),
body.prism-ui .btn-light-secondary:is(:active, .active):not(:disabled):not(.disabled),
body.prism-ui .btn-outline-secondary:is(:active, .active):not(:disabled):not(.disabled),
body.prism-ui .btn-outline-dark:is(:active, .active):not(:disabled):not(.disabled),
body.prism-ui .btn-outline-light:is(:active, .active):not(:disabled):not(.disabled) {
  background: var(--p-b-neutral-a) !important; border-color: var(--p-b-neutral-border-h) !important; color: var(--p-b-neutral-fg) !important; transform: translateY(0); box-shadow: var(--p-b-press) !important;
}
/* focus ring in the button's own family */
body.prism-ui .btn:focus-visible { outline: 2px solid var(--p-field-focus) !important; outline-offset: 2px; }
body.prism-ui .btn[data-p-intent="success"]:focus-visible, body.prism-ui .btn-success:focus-visible { outline-color: var(--p-b-success) !important; }
body.prism-ui .btn[data-p-intent="warning"]:focus-visible, body.prism-ui .btn-warning:focus-visible { outline-color: var(--p-b-warning) !important; }
body.prism-ui .btn[data-p-intent="danger"]:focus-visible, body.prism-ui .btn-danger:focus-visible { outline-color: var(--p-b-danger) !important; }
/* disabled: same family, clearly inactive, text still legible */
body.prism-ui .btn:disabled, body.prism-ui .btn.disabled,
body.prism-ui .btn[data-p-intent]:not(#p-x):not(#p-y):disabled, body.prism-ui .btn[data-p-intent]:not(#p-x):not(#p-y).disabled {
  opacity: .5 !important; transform: none !important; box-shadow: none !important; filter: saturate(.55); cursor: not-allowed;
}
/* compact buttons inside table cells keep the colour but a lighter shadow */
body.prism-ui table .btn[data-p-intent]:not(#p-x):not(#p-y) { box-shadow: none !important; }
body.prism-ui table .btn[data-p-intent]:not(#p-x):not(#p-y):hover:not(:disabled):not(.disabled) { box-shadow: 0 3px 8px -3px rgba(0, 0, 0, 0.35) !important; }
/* image tools (zoom / rotate) and close glyphs stay compact neutral squares */
body.prism-ui .btn[data-p-intent="neutral"]:is(#zoomInBtn, #zoomOutBtn, #rotateLeftBtn, #rotateRightBtn):not(#p-x) { min-width: 34px; }

/* report launcher tiles (Administrator / Financial / Radiology / Location dashboards) */
body.prism-ui .report-button:not(#p-x) {
  background: var(--p-surface) !important;
  border: 1px solid var(--p-b-neutral-border) !important;
  border-left: 3px solid var(--p-b-primary) !important;
  color: var(--p-text) !important;
  font-weight: 600 !important;
  box-shadow: var(--p-b-rest) !important;
}
body.prism-ui .report-button:not(#p-x):hover:not(:disabled):not(.disabled) {
  background: var(--p-b-soft-bg) !important;
  border-color: var(--p-b-soft-border) !important;
  border-left-color: var(--p-b-primary) !important;
  color: var(--p-b-soft-fg) !important;
  transform: translateY(-1px);
  box-shadow: var(--p-b-lift) !important;
}
body.prism-ui .report-button:not(#p-x):is(:active, .active):not(:disabled):not(.disabled) { background: var(--p-b-primary) !important; border-color: var(--p-b-primary) !important; color: #fff !important; transform: translateY(0); box-shadow: var(--p-b-press) !important; }
body.prism-ui .report-button:not(#p-x):is(:disabled, .disabled) { border-left-color: var(--p-border-strong) !important; background: transparent !important; color: var(--p-muted) !important; box-shadow: none !important; opacity: .6 !important; filter: none; }

/* SweetAlert dialogs follow the same families */
body.prism-ui .swal2-styled.swal2-confirm { background: var(--p-b-success) !important; color: #fff !important; }
body.prism-ui .swal2-styled.swal2-confirm:hover { background: var(--p-b-success-h) !important; }
body.prism-ui .swal2-styled.swal2-deny { background: var(--p-b-danger) !important; color: #fff !important; }
body.prism-ui .swal2-styled.swal2-cancel { background: var(--p-b-neutral-bg) !important; color: var(--p-b-neutral-fg) !important; border: 1px solid var(--p-b-neutral-border) !important; }
body.prism-ui .swal2-styled.swal2-cancel:hover { background: var(--p-b-neutral-h) !important; }
