/* File: wwwroot/css/theme.webapp.css 
   ==========================================================================
   BioMaint CMMS – Web App Theme (Bootstrap 5.3.8)
   - No Tailwind. Pure CSS + Bootstrap variables
   - Light/Dark via [data-bs-theme] on <html>
   - Sidebar & topbar tuned for theme.webapp.js layout
   - Brand-aligned tokens reused across cards, tables, forms, dashboard, etc.
   ==========================================================================
*/

@font-face{
  font-family:"Inter";
  src:url("/fonts/inter/InterVariable.woff2") format("woff2");
  font-style:normal;
  font-weight:100 900;
  font-display:swap;
}
@font-face{
  font-family:"Inter";
  src:url("/fonts/inter/InterVariable-Italic.woff2") format("woff2");
  font-style:italic;
  font-weight:100 900;
  font-display:swap;
}

/* ============================ TOKENS (DARK DEFAULT) ====================== */
:root{
  /* Brand */
  --brand:#10B981;
  --brand-600:#0e9f6e;
  --brand-deep:#047857;

  /* Neutrals (dark default) - tuned away from blue into ChatGPT-like gray */
  --surface:#222327;
  --surface-2:#1d1e22;
  --surface-3:#292b30;

  --text:#f3f4f6;
  --muted:#a7acb4;

  --card:#222429;
  --sidebar-bg:#18191c;
  --sidebar-border:#2b2d33;

  --border:#3a3d45;
  --hairline: color-mix(in srgb, var(--border) 72%, transparent);

  /* Extra surfaces (award-winning polish) */
  --float-surface:#27292e;
  --modal-surface:#23252a;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.16);
  --shadow-md: 0 16px 34px rgba(0,0,0,.22);
  --shadow-lg: 0 24px 58px rgba(0,0,0,.30);

  --backdrop-blur: 2px;
  --backdrop-saturate: 100%;
  --modal-backdrop-bg: rgba(10,11,13,.34);
  --sidebar-backdrop-bg: rgba(10,11,13,.22);
  --menu-active-bg: color-mix(in srgb, var(--brand) 16%, var(--sidebar-bg));
  --menu-active-text: #d9fff0;

  /* “Slab” scale (used in sidebar & subtle tints) */
  --slab-25:#fafafa; --slab-50:#f4f4f5; --slab-100:#e4e4e7; --slab-200:#d4d4d8;
  --slab-300:#a1a1aa; --slab-400:#71717a; --slab-500:#52525b; --slab-600:#3f3f46;
  --slab-700:#27272a; --slab-800:#18181b; --slab-900:#0f0f10;

  /* Elevation */
  --elev: var(--shadow-md);
  --elev-lg: var(--shadow-lg);

  /* Inputs (app-wide) */
  --field-bg:#2a2c31;
  --field-chip-bg:#1f2024;
  --field-border:#484d56;

  /* Focus */
  --focus-ring-color: rgba(16,185,129,.24);
  --focus-ring: 0 0 0 .15rem var(--focus-ring-color);

  /* Sidebar paddings from mockup */
  --pady:.55rem;
  --padx:.85rem;

  /* Sidebar hover shade */
  --side-hover: color-mix(in srgb, var(--brand) 12%, var(--sidebar-bg));

  /* Scrollbar shades (sidebar only uses these) */
  --sb-thumb: rgba(148,163,184,.22);
  --sb-track: transparent;

  /* Control sizing */
  --ctrl-h: 44px;
  --ctrl-pad-y: 10px;
  --ctrl-pad-x: 14px;
  --ctrl-radius: 12px;

  /* App chrome sizing */
  --app-header-h:56px;
  --subhdr-h:54px;

  /* ---- Extra aliases to match Login theme tokens ---- */
  --accent: var(--brand);
  --accent-hover: var(--brand-600);
  --accent-contrast:#ffffff;

  --success:#15803d;
  --success-contrast:#ffffff;

  --info:#115e59;
  --info-contrast:#ffffff;

  --warning:#ea8a11;
  --warning-contrast:#171717;

  --danger:#f97373;             /* same as login theme */
  --danger-contrast:#ffffff;

  /* shadow alias used in login theme */
  --shadow-2: var(--elev);

  /* Award-level details */
  --radius-card: 1rem;
  --radius-soft: .85rem;
  --radius-pill: 999px;
  --app-grad: radial-gradient(760px circle at 12% 0,
    color-mix(in srgb, var(--brand) 4%, transparent) 0%,
    transparent 48%),
    radial-gradient(620px circle at 96% 8%,
    color-mix(in srgb, var(--warning) 2%, transparent) 0%,
    transparent 52%);

  /* Attachment upload ring (default: dark) */
  --bm-attach-ring: rgba(255,255,255,.98);
  --bm-attach-ring-track: rgba(210,210,210,.40);
  --bm-attach-ring-shadow: rgba(0,0,0,.55);

  /* Native control accent (calendar, etc.) */
  accent-color: var(--brand);
}

/* ================================ LIGHT ================================== */
html[data-bs-theme="light"]{
  color-scheme: light;

  --surface:#ffffff;
  --surface-2:#f4f4f5;
  --surface-3:#fafafa;

  --text:#171717;
  --muted:#6b7280;

  --card:#ffffff;
  --sidebar-bg:#f5f5f5;
  --sidebar-border:#e6e7eb;

  --border:#e5e7eb;
  --hairline: rgba(23,23,23,.08);

  --field-bg:#ffffff;
  --field-chip-bg:#f5f5f6;
  --field-border:#d5d8df;

  --side-hover: color-mix(in srgb, var(--brand) 10%, var(--sidebar-bg));
  --float-surface:#ffffff;
  --modal-surface:#ffffff;

  --shadow-sm: 0 1px 2px rgba(17,24,39,.04);
  --shadow-md: 0 12px 28px rgba(15,23,42,.08);
  --shadow-lg: 0 20px 48px rgba(15,23,42,.12);

  --backdrop-blur: 2px;
  --backdrop-saturate: 100%;
  --modal-backdrop-bg: rgba(245,245,246,.58);
  --sidebar-backdrop-bg: rgba(245,245,246,.42);
  --menu-active-bg: color-mix(in srgb, var(--brand) 14%, #edf7f3);
  --menu-active-text: var(--brand-deep);

  --elev: var(--shadow-md);
  --elev-lg: var(--shadow-lg);

  --app-grad: radial-gradient(760px circle at 12% 0,
    color-mix(in srgb, var(--brand) 3%, transparent) 0%,
    transparent 48%),
    radial-gradient(620px circle at 96% 8%,
    color-mix(in srgb, var(--warning) 2%, transparent) 0%,
    transparent 52%);

  /* Attachment upload ring (light) */
  --bm-attach-ring: rgba(255,255,255,.98);
  --bm-attach-ring-track: rgba(210,210,210,.62);
  --bm-attach-ring-shadow: rgba(2,6,23,.18);
}

/* ================================= DARK ================================== */
html[data-bs-theme="dark"]{
  color-scheme: dark;

  --surface:#222327;
  --surface-2:#1d1e22;
  --surface-3:#292b30;

  --text:#f3f4f6;
  --muted:#a7acb4;

  --card:#222429;
  --sidebar-bg:#18191c;
  --sidebar-border:#2b2d33;

  --border:#3a3d45;
  --hairline: color-mix(in srgb, var(--border) 72%, transparent);

  --field-bg:#2a2c31;
  --field-chip-bg:#1f2024;
  --field-border:#484d56;

  --side-hover: color-mix(in srgb, var(--brand) 12%, var(--sidebar-bg));
  --float-surface:#27292e;
  --modal-surface:#23252a;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.16);
  --shadow-md: 0 16px 34px rgba(0,0,0,.22);
  --shadow-lg: 0 24px 58px rgba(0,0,0,.30);

  --backdrop-blur: 2px;
  --backdrop-saturate: 100%;
  --modal-backdrop-bg: rgba(10,11,13,.34);
  --sidebar-backdrop-bg: rgba(10,11,13,.22);
  --menu-active-bg: color-mix(in srgb, var(--brand) 16%, var(--sidebar-bg));
  --menu-active-text: #d9fff0;
}

/* ============================ GLOBAL / BASICS ============================ */
html,body{height:100%}
html{
  background:color-mix(in srgb, var(--surface) 86%, var(--surface-2));
}
body{
  margin:0;
  background:var(--surface);
  color:var(--text);
  font-family:"Inter","Noto Sans Bengali","Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
  overflow-x:hidden;
  overscroll-behavior-x: none;
}

/* Subtle premium background glow (safe, no layout impact) */
body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background: var(--app-grad);
  opacity:.025;
  z-index:-1;
}

html[data-bs-theme="light"] body::before{
  opacity:.015;
}

html[data-bs-theme="dark"] body::before{
  opacity:.02;
}

a{
  color:var(--brand);
  text-decoration:none;
}
a:hover{
  color:var(--brand-600);
}
:focus-visible{
  outline:none;
  box-shadow: var(--focus-ring);
}

/* Make Bootstrap text-muted follow our token */
.text-muted{
  color:var(--muted) !important;
}

/* Headings slightly stronger contrast but still on brand */
h1,h2,h3,h4,h5,h6{
  color:var(--text);
}

/* ======================= BOOTSTRAP VARIABLE OVERRIDES ==================== */
:root,
html[data-bs-theme="light"],
html[data-bs-theme="dark"]{
  --bs-body-bg: var(--surface);
  --bs-body-color: var(--text);
  --bs-border-color: var(--border);

  --bs-primary: var(--brand);
  --bs-primary-rgb: 16,185,129; /* brand glow on focus/active, no blue */
  --bs-secondary: var(--slab-500);
  --bs-success: var(--success);
  --bs-info: var(--info);
  --bs-warning: var(--warning);
  --bs-danger: var(--danger);   /* aligned to login's danger */

  --bs-link-color: var(--brand);
  --bs-link-hover-color: var(--brand-600);

  --bs-card-bg: var(--card);
  --bs-card-color: var(--text);
  --bs-card-border-color: var(--border);
  --bs-card-cap-bg: var(--surface-2);

  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
  --bs-table-striped-bg: color-mix(in srgb, var(--card) 96%, var(--surface-2));
  --bs-table-hover-bg: color-mix(in srgb, var(--brand) 4%, var(--card));

  --bs-dropdown-bg: var(--float-surface);
  --bs-dropdown-color: var(--text);
  --bs-dropdown-border-color: var(--border);
  --bs-dropdown-link-color: var(--text);
  --bs-dropdown-link-hover-bg: color-mix(in srgb, var(--text) 4%, var(--surface-3));

  --bs-modal-bg: var(--modal-surface);
  --bs-modal-color: var(--text);
  --bs-modal-border-color: var(--border);
  --bs-modal-header-border-color: var(--border);
  --bs-modal-footer-border-color: var(--border);

  --bs-pagination-color: var(--brand);
  --bs-pagination-hover-color: var(--brand-600);
  --bs-pagination-bg: var(--surface-2);
  --bs-pagination-border-color: var(--border);
  --bs-pagination-hover-bg: var(--surface-2);
  --bs-pagination-hover-border-color: var(--border);
  --bs-pagination-active-bg: var(--brand);
  --bs-pagination-active-border-color: var(--brand);

  --bs-btn-border-radius: .75rem;

  /* Toast tuning – shared for light & dark */
  --bs-toast-padding-x: .95rem;
  --bs-toast-padding-y: .70rem;
  --bs-toast-border-radius: .85rem;
  --bs-toast-box-shadow: 0 18px 40px rgba(0,0,0,.28);
}

/* =============================== BUTTONS ================================= */
.btn{
  border-radius:.75rem;
  font-weight:600;
}

/* Primary – full brand control (no default Bootstrap blue anywhere) */
.btn-primary{
  --bs-btn-color:#fff;
  --bs-btn-bg: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand-600);
  --bs-btn-hover-border-color: var(--brand-600);
  --bs-btn-focus-shadow-rgb: 16,185,129;
  --bs-btn-active-bg: var(--brand-deep);
  --bs-btn-active-border-color: var(--brand-deep);
  --bs-btn-disabled-bg: color-mix(in srgb, var(--brand) 40%, var(--surface-2));
  --bs-btn-disabled-border-color: color-mix(in srgb, var(--brand) 40%, var(--surface-2));
  --bs-btn-disabled-color: rgba(255,255,255,.75);
}
.btn-primary:focus-visible{
  outline:none;
  box-shadow: var(--focus-ring);
}

.btn-outline-primary{
  --bs-btn-color: var(--brand);
  --bs-btn-border-color: var(--brand);
  --bs-btn-hover-bg: var(--brand);
  --bs-btn-hover-color:#fff;
  --bs-btn-hover-border-color: var(--brand);
}
.btn-outline-secondary{
  --bs-btn-color: var(--muted);
  --bs-btn-border-color: var(--border);
  --bs-btn-hover-bg: var(--surface-2);
  --bs-btn-hover-color: var(--text);
  --bs-btn-hover-border-color: var(--border);
}

/* Brand helpers used in quick actions */
.btn-brand{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}
.btn-brand:hover{
  background:var(--brand-600);
  border-color:var(--brand-600);
}
.btn-slab-dark{
  background:#18181b;
  border-color:#18181b;
  color:#fff;
}
html[data-bs-theme="dark"] .btn-slab-dark{
  background:#2a2f36;
  border-color:#2a2f36;
}
.btn-slab-dark:hover{
  filter:brightness(1.08);
}

/* Button micro-polish */
.btn:active{
  transform: translateY(.5px);
}
.btn .spinner-border{
  vertical-align: -2px;
}

/* Pill badges used across app */
.badge{
  border-radius:999px;
}

/* ============================== BADGE SYSTEM ============================= */
/* Optional “award” look: soft chip + readable in both themes */
.bm-badge{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  padding:.18rem .60rem;
  border-radius:999px;
  border:1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-2));
  color: var(--text);
  font-weight:700;
  font-size:.75rem;
  line-height:1.25;
  letter-spacing:.01em;
  white-space:nowrap;
}
.bm-badge-dot{
  width:.45rem;
  height:.45rem;
  border-radius:999px;
  background:var(--muted);
  flex:0 0 auto;
}

/* Status chips (use if you want later without breaking existing badges) */
.bm-badge--requested{
  background: color-mix(in srgb, var(--surface) 86%, var(--warning));
  border-color: color-mix(in srgb, var(--border) 70%, var(--warning));
}
.bm-badge--requested .bm-badge-dot{ background: var(--warning); }

.bm-badge--open{
  background: color-mix(in srgb, var(--surface) 86%, var(--slab-500));
  border-color: color-mix(in srgb, var(--border) 70%, var(--slab-500));
}
.bm-badge--open .bm-badge-dot{ background: var(--slab-400); }

.bm-badge--approved,
.bm-badge--closed{
  background: color-mix(in srgb, var(--surface) 86%, var(--success));
  border-color: color-mix(in srgb, var(--border) 70%, var(--success));
}
.bm-badge--approved .bm-badge-dot,
.bm-badge--closed .bm-badge-dot{ background: var(--success); }

/* Priority chips */
.bm-badge--high{
  background: color-mix(in srgb, var(--surface) 86%, var(--danger));
  border-color: color-mix(in srgb, var(--border) 70%, var(--danger));
}
.bm-badge--high .bm-badge-dot{ background: var(--danger); }

.bm-badge--normal{
  background: color-mix(in srgb, var(--surface) 92%, var(--brand));
  border-color: color-mix(in srgb, var(--border) 70%, var(--brand));
}
.bm-badge--normal .bm-badge-dot{ background: var(--brand); }

.bm-badge--low{
  background: color-mix(in srgb, var(--surface) 88%, var(--slab-400));
  border-color: color-mix(in srgb, var(--border) 70%, var(--slab-400));
}
.bm-badge--low .bm-badge-dot{ background: var(--slab-400); }

/* ================================ ALERTS ================================ */
.alert-primary {
  --bs-alert-bg: color-mix(in srgb, var(--brand) 12%, var(--surface));
  --bs-alert-border-color: var(--brand);
  --bs-alert-color: var(--text);
}
.alert-success {
  --bs-alert-bg: color-mix(in srgb, var(--success) 12%, var(--surface));
  --bs-alert-border-color: var(--success);
  --bs-alert-color: var(--text);
}
.alert-info {
  /* keep calm + readable */
  --bs-alert-bg: color-mix(in srgb, var(--info) 12%, var(--surface));
  --bs-alert-border-color: var(--info);
  --bs-alert-color: var(--text);
}
.alert-warning {
  --bs-alert-bg: color-mix(in srgb, var(--warning) 18%, var(--surface));
  --bs-alert-border-color: var(--warning);
  --bs-alert-color: #171717;
}
html[data-bs-theme="dark"] .alert-warning{
  --bs-alert-color: var(--text);
}
.alert-danger {
  --bs-alert-bg: color-mix(in srgb, var(--danger) 12%, var(--surface));
  --bs-alert-border-color: var(--danger);
  --bs-alert-color: var(--text);
}

/* ============================= FORMS & INPUTS ============================ */
.form-control,
.form-select,
.input-group-text,
.form-control:disabled,
.form-select:disabled{
  color:var(--text);
  background-color:var(--field-bg);
  border-color:var(--field-border);
}
.input-group-text{
  background:var(--field-chip-bg);
}
.form-control::placeholder{
  color: color-mix(in srgb, var(--text) 55%, transparent);
}
.form-control:focus,
.form-select:focus{
  background-color:var(--field-bg);
  border-color:var(--brand);
  box-shadow: var(--focus-ring);
}
.form-check-input:checked{
  background-color:var(--brand);
  border-color:var(--brand);
}
.form-check-input:focus{
  box-shadow: var(--focus-ring);
}

/* Date/time inputs: ensure icon visible in dark mode */
html[data-bs-theme="dark"] input[type="date"],
html[data-bs-theme="dark"] input[type="datetime-local"]{
  color-scheme: dark;
}
html[data-bs-theme="light"] input[type="date"],
html[data-bs-theme="light"] input[type="datetime-local"]{
  color-scheme: light;
}

/* Make native date/time pickers follow brand accent where supported */
input[type="date"],
input[type="time"],
input[type="datetime-local"]{
  accent-color: var(--brand);
}

/* Controls sizing harmony */
.form-control:not(textarea),
.input-group > .form-control:not(textarea),
.form-select{
  min-height:var(--ctrl-h);
  padding:var(--ctrl-pad-y) var(--ctrl-pad-x);
  border-radius:var(--ctrl-radius);
}
.input-group-text,
.input-group .btn{
  min-height:var(--ctrl-h);
  padding:0 var(--ctrl-pad-x);
  border-color:var(--field-border);
}

/* Validation helpers */
.validation-message{
  color:#ef4444;
  font-size:.85rem;
  margin-top:.25rem;
}
.is-invalid{
  border-color:#ef4444!important;
  background-image:none!important;
}

/* Make disabled checkboxes readable in permissions table */
.form-check-input:disabled{
  opacity:.6;
  cursor:not-allowed;
}

/* ====================== SELECT2 (ENHANCED SELECT DROPDOWNS) ============== */
/* Base container: follow full-width form controls */
.select2-container{
  width:100% !important;
  font-size:14px;
}

/* Single select appearance */
.select2-container--default .select2-selection--single{
  display:flex;
  align-items:center;
  min-height:var(--ctrl-h);
  padding:var(--ctrl-pad-y) var(--ctrl-pad-x);
  background-color:var(--field-bg);
  border:1px solid var(--field-border);
  border-radius:var(--ctrl-radius);
}

/* Rendered text inside single select */
.select2-container--default .select2-selection--single .select2-selection__rendered{
  color:var(--text);
  line-height:1.3;
  padding-left:0;
  padding-right:26px;
}

/* Arrow alignment and color */
.select2-container--default .select2-selection--single .select2-selection__arrow{
  height:100%;
  right:10px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b{
  border-color:var(--muted) transparent transparent transparent;
}

/* Disabled state */
.select2-container--default.select2-container--disabled .select2-selection--single{
  background-color:var(--field-bg);
  border-color:var(--field-border);
  opacity:.65;
}

/* Focus state: mirror .form-select focus */
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--multiple{
  border-color:var(--brand);
  box-shadow:var(--focus-ring);
}

/* Multiple select appearance */
.select2-container--default .select2-selection--multiple{
  min-height:var(--ctrl-h);
  padding:4px 6px;
  background-color:var(--field-bg);
  border:1px solid var(--field-border);
  border-radius:var(--ctrl-radius);
  display:flex;
  align-items:center;
  flex-wrap:wrap;
}

/* Multiple select chips */
.select2-container--default .select2-selection--multiple .select2-selection__choice{
  background-color:var(--field-chip-bg);
  border:1px solid var(--field-border);
  color:var(--text);
  border-radius:999px;
  padding:2px 8px;
  margin-top:2px;
  margin-bottom:2px;
  font-size:.8rem;
}

/* Remove icon inside chip */
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{
  margin-right:4px;
  color:var(--muted);
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{
  color:var(--text);
}

/* Search field inside Select2 */
.select2-container--default .select2-search--dropdown .select2-search__field{
  padding:6px 8px;
  background-color:var(--field-bg);
  border:1px solid var(--field-border);
  border-radius:.5rem;
  color:var(--text);
}
.select2-container--default .select2-search--dropdown .select2-search__field:focus{
  outline:none;
  border-color:var(--brand);
  box-shadow:var(--focus-ring);
}

/* Dropdown panel */
.select2-dropdown{
  background-color:var(--float-surface);
  border:1px solid var(--border);
  box-shadow:var(--shadow-lg);
  border-radius: .85rem;
  overflow:hidden;
}

/* Results list */
.select2-results__option{
  padding:8px 10px;
  font-size:.875rem;
  color:var(--text);
}

/* Hover / highlight state */
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable{
  background-color:color-mix(in srgb, var(--brand) 16%, var(--surface));
  color:var(--text);
}

/* Selected state */
.select2-container--default .select2-results__option--selected{
  background-color:color-mix(in srgb, var(--brand) 10%, var(--surface));
}

/* Placeholder text */
.select2-container .select2-selection__placeholder{
  color: color-mix(in srgb, var(--text) 55%, transparent);
}

/* CRITICAL: ensure Select2 dropdown is visible above cards/modals/offcanvas */
.select2-container--open{
  z-index: 2060; /* above Bootstrap modal (1055) + dropdowns (1000) */
}

/* Compact mode for small controls if needed */
.select2-container--sm .select2-selection--single{
  min-height:36px;
  padding:6px 10px;
}

/* Country option template helpers (Signup Select2 templates) */
.bm-country-option{
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.bm-country-flag{
  flex:0 0 auto;
  width:18px;
  height:12px;
  border-radius:2px;
  overflow:hidden;
  border:1px solid var(--border);
  background:var(--surface-2);
}
.bm-country-name{
  flex:1 1 auto;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.bm-country-dial{
  flex:0 0 auto;
  color:var(--muted);
  font-size:.85em;
}

/* ============================ CARDS & TABLES ============================= */
.card{
  background:var(--card);
  color:var(--text);
  border-color:var(--border);
  border-radius:var(--radius-card);
  box-shadow: var(--shadow-sm);
}
.card:hover{
  box-shadow: var(--elev);
  transition: box-shadow .18s ease;
}

/* BioMaint – clip card contents to rounded corners (fix tables in cards) */
.card.bm-card{
  overflow:hidden;          /* makes header + table follow the curve   */
}

.card .card-header,
.card .card-footer{
  background: color-mix(in srgb, var(--surface-3) 82%, var(--surface-2));
  border-color:var(--border);
}
.card-lite{
  background:var(--surface-3);
  border:1px solid var(--border);
}

/* Tables */
.table{
  color:var(--text);
}
.table> :not(caption)>*>*{
  background-color:transparent;
  border-color:var(--border);
}

/* Make “table-light” headers look correct in both themes */
.table thead.table-light,
.table-light>*>*{
  background: color-mix(in srgb, var(--surface-3) 84%, var(--surface-2)) !important;
  color:var(--text)!important;
  border-color:var(--border)!important;
}

/* Subtle hover for rows */
.table-hover>tbody>tr:hover>*{
  background-color: var(--bs-table-hover-bg) !important;
}

/* Premium separators + zebra that works in both modes */
.table tbody tr{
  border-bottom:1px solid var(--hairline);
}
.table tbody tr:last-child{
  border-bottom:0;
}
.table tbody tr:nth-child(2n) > *{
  background-color: color-mix(in srgb, var(--card) 97%, var(--surface-2)) !important;
}

/* Table header typography */
.table thead th{
  font-weight:800;
  letter-spacing:.06em;
  font-size:.72rem;
  text-transform:uppercase;
}

/* Table cell readability */
.table td{
  font-size:.92rem;
}
.table td .small{
  font-size:.82rem;
}

/* ============================== WORK REQUESTS ============================ */
/*
  Work Request list follows the same premium table rhythm as Work Orders,
  while keeping request-specific columns and equipment lookup styling.
*/
.bm-wr-shell{
  overflow:hidden;
}
.bm-wr-table-wrap{
  overflow-x:auto;
  overscroll-behavior-x:contain;
}
.bm-wr-table{
  width:100%;
  min-width:1360px;
  margin:0;
  table-layout:fixed;
}
.bm-wr-table > :not(caption)>*>*{
  vertical-align:top;
}
.bm-wr-table td,
.bm-wr-table th{
  padding-top:.75rem;
  padding-bottom:.75rem;
}
.bm-wr-table .bm-badge{
  white-space:nowrap;
}
.bm-wr-col-wr{ width:150px; }
.bm-wr-col-status{ width:128px; }
.bm-wr-col-priority{ width:102px; }
.bm-wr-col-requester{ width:168px; }
.bm-wr-col-site{ width:240px; }
.bm-wr-col-equipment{ width:240px; }
.bm-wr-col-problem{ width:220px; }
.bm-wr-col-received{ width:168px; }
.bm-wr-col-assigned{ width:156px; }
.bm-wr-col-wos{ width:116px; }
.bm-wr-col-actions{ width:60px; }

.bm-wr-col-mfgmodel{ width:200px; }
.bm-wr-col-serial{ width:140px; }
.bm-wr-col-deptloc{ width:180px; }
.bm-wr-col-select{ width:130px; }

.bm-wr-col-siteloc{ width:280px; }
.bm-wr-col-warranty{ width:180px; }
.bm-wr-col-mfgserial{ width:260px; }

.bm-wr-table thead th{
  font-weight:700;
  letter-spacing:.05em;
  font-size:.70rem;
  text-transform:uppercase;
}
.bm-wr-table--colorful.table-hover>tbody>tr:hover>*{
  background-color: color-mix(in srgb, var(--brand) 3%, var(--bs-table-hover-bg)) !important;
}
.bm-row-glow.table-hover>tbody>tr:hover>*{
  box-shadow:none !important;
}
.bm-wr-code,
.bm-wr-requester-text,
.bm-wr-site-sub,
.bm-wr-assigned-text,
.bm-wr-wo-text,
.bm-wr-wo-sub{
  overflow-wrap:anywhere;
  line-height:1.35;
}
.bm-wr-equip-title,
.bm-wr-equip-meta{
  overflow-wrap:anywhere;
  line-height:1.35;
  display:-webkit-box;
  -webkit-box-orient:vertical;
  overflow:hidden;
  white-space:normal;
}
.bm-wr-equip-title{
  -webkit-line-clamp:2;
  line-clamp:2;
}
.bm-wr-equip-meta{
  -webkit-line-clamp:1;
  line-clamp:1;
}
.bm-wr-problem-text{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  line-clamp:2;
  overflow:hidden;
  white-space:normal;
  line-height:1.4;
}
.bm-wr-due-text{
  line-height:1.3;
}
.bm-wr-action-btn{
  width:36px;
  height:36px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
}

/* Equipment lookup results shell (keeps the list premium inside the card) */
.bm-wr-equip-results{
  border:1px solid var(--border);
  border-radius: var(--radius-soft);
  overflow:hidden;
  background: var(--surface-2);
}

/* Equipment selected summary (no inline styles in markup) */
.bm-wr-equip-summary{
  position:relative;
  overflow:hidden;
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  border:1px solid color-mix(in srgb, var(--border) 70%, var(--brand)) !important;
  border-radius: var(--radius-soft);
  box-shadow: var(--shadow-sm);
}
.bm-wr-equip-summary::after{
  content:"";
  position:absolute;
  inset:-20px;
  pointer-events:none;
  background:
    radial-gradient(520px circle at 18% 18%, color-mix(in srgb, var(--brand) 22%, transparent) 0%, transparent 58%),
    radial-gradient(420px circle at 92% 10%, color-mix(in srgb, var(--warning) 14%, transparent) 0%, transparent 62%);
  opacity:.75;
}
.bm-wr-equip-summary > *{ position:relative; }

.bm-wr-equip-summary-ico{
  width:44px;
  height:44px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  border:1px solid color-mix(in srgb, var(--border) 75%, transparent);
}

@media (max-width: 1399.98px){
  .bm-wr-table{ min-width:1240px; }
  .bm-wr-col-wr{ width:142px; }
  .bm-wr-col-status{ width:122px; }
  .bm-wr-col-priority{ width:96px; }
  .bm-wr-col-requester{ width:156px; }
  .bm-wr-col-site{ width:224px; }
  .bm-wr-col-equipment{ width:220px; }
  .bm-wr-col-problem{ width:190px; }
  .bm-wr-col-received{ width:160px; }
  .bm-wr-col-assigned{ width:148px; }
  .bm-wr-col-wos{ width:108px; }
}
@media (max-width: 1199.98px){
  .bm-wr-table{
    min-width:1040px;
    table-layout:auto;
  }
}

/* =============================== WORK ORDERS ============================== */
/*
  Work Order list uses its own execution-first table tuning.
  Keep these separate from Work Request styles to avoid collisions.
*/
.bm-wo-shell{
  overflow:hidden;
}
.bm-wo-table-wrap{
  overflow-x:auto;
  overscroll-behavior-x:contain;
}
.bm-wo-table{
  width:100%;
  table-layout:fixed;
}
.bm-wo-table > :not(caption)>*>*{
  vertical-align:top;
}
.bm-wo-table td,
.bm-wo-table th{
  padding-top:.75rem;
  padding-bottom:.75rem;
}
.bm-wo-table .bm-badge{
  white-space:nowrap;
}
.bm-wo-col-wo{
  width:150px;
}
.bm-wo-col-status{
  width:128px;
}
.bm-wo-col-priority{
  width:102px;
}
.bm-wo-col-type{
  width:132px;
}
.bm-wo-col-due{
  width:168px;
}
.bm-wo-col-assigned{
  width:156px;
}
.bm-wo-col-actions{
  width:60px;
}
.bm-wo-code,
.bm-wo-site-sub,
.bm-wo-equip-title,
.bm-wo-equip-meta,
.bm-wo-assigned-text,
.bm-wo-execution-text,
.bm-wo-execution-sub{
  overflow-wrap:anywhere;
  line-height:1.35;
}
.bm-wo-problem-text{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  line-clamp:2;
  overflow:hidden;
  white-space:normal;
  line-height:1.4;
}
.bm-wo-due-text{
  line-height:1.3;
}
.bm-wo-action-btn{
  width:36px;
  height:36px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
}
@media (max-width: 1399.98px){
  .bm-wo-col-wo{ width:142px; }
  .bm-wo-col-status{ width:122px; }
  .bm-wo-col-priority{ width:96px; }
  .bm-wo-col-type{ width:124px; }
  .bm-wo-col-due{ width:160px; }
  .bm-wo-col-assigned{ width:148px; }
}
@media (max-width: 1199.98px){
  .bm-wo-table{
    table-layout:auto;
  }
}

 .bm-wo-request-card .card-body{
  height:100%;
}
.bm-wo-request-grid .fw-semibold,
.bm-wo-request-grid .text-muted.small{
  overflow-wrap:anywhere;
}
.bm-wo-request-notes{
  white-space:pre-wrap;
  line-height:1.45;
}

/* Utility: avoid inline style="width:auto; min-width:80px" */
.bm-btn-minw-80{
  width:auto;
  min-width:80px;
}

/* ================= DROPDOWN / MODAL / TOOLTIP / TOAST =================== */
.dropdown-menu{
  background:var(--float-surface);
  color:var(--text);
  border-color:var(--border);
  box-shadow:var(--shadow-lg);
  border-radius: .9rem;
  padding:.35rem;
}
.dropdown-item{
  border-radius:.7rem;
  padding:.55rem .65rem;
}
@supports not (color: color-mix(in srgb, white 50%, black 50%)){
  .dropdown-item:hover{
    background: color-mix(in srgb, var(--surface-2) 88%, var(--surface));
  }
}
.dropdown-item:hover{
  background: color-mix(in srgb, var(--brand) 9%, var(--surface-3));
}
.dropdown-item:focus-visible{
  outline:none;
  box-shadow: var(--focus-ring);
}

.modal-content{
  background:var(--modal-surface);
  color:var(--text);
  border-color:var(--border);
  border-radius: 1rem;
  overflow:hidden;
  box-shadow: var(--elev-lg);
}
.modal-header{
  background: color-mix(in srgb, var(--surface-3) 80%, var(--modal-surface));
}
.modal-footer{
  background: color-mix(in srgb, var(--surface-3) 80%, var(--modal-surface));
}
.modal-header:first-child{
  border-top-left-radius: calc(1rem - 1px);
  border-top-right-radius: calc(1rem - 1px);
}
.modal-footer:last-child{
  border-bottom-left-radius: calc(1rem - 1px);
  border-bottom-right-radius: calc(1rem - 1px);
}

.modal-backdrop,
.offcanvas-backdrop{
  background: var(--modal-backdrop-bg);
  opacity: 1 !important;
  -webkit-backdrop-filter: blur(var(--backdrop-blur)) saturate(var(--backdrop-saturate));
  backdrop-filter: blur(var(--backdrop-blur)) saturate(var(--backdrop-saturate));
}

.modal-backdrop.show,
.offcanvas-backdrop.show{
  opacity: 1 !important;
}
.tooltip .tooltip-inner{
  background:#2a2f36;
}

/* Toast – base Bootstrap toast (if ever used) */
.toast{
  background: var(--float-surface);
  color: var(--text);
  border-color: var(--border);
}

.offcanvas{
  background:var(--modal-surface);
  color:var(--text);
  border-color:var(--border);
}

.offcanvas-header,
.offcanvas-footer{
  background: color-mix(in srgb, var(--surface-3) 80%, var(--modal-surface));
  border-color: var(--border);
}


/* ================================ TOAST ================================= */
/* Host matches login positioning: centered at top, above app shell */
[data-bm-toast-container]{
  position:fixed;
  top:16px;
  left:0;
  right:0;
  display:flex;
  justify-content:center;
  align-items:flex-start;
  z-index:1080;
  pointer-events:none;
}
[data-bm-toast-container] .bm-toast{
  pointer-events:auto;
}

/* Single toast item – identical to login .bm-toast look */
.bm-toast{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:min(92vw, 520px);
  max-width:92vw;
  margin:0 auto .5rem auto;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--float-surface);
  color:var(--text);
  box-shadow:var(--shadow-2);
  animation: bmToastIn .28s ease-out both, bmToastHold 3.4s linear .28s both;
}

/* Body layout */
.bm-toast-body{
  flex: 1 1 auto;
  font-size: 14px;
  line-height: 1.35;
}

/* Icon + close button copied from login */
.bm-toast-icon{
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}
.bm-toast-icon i{
  font-size: 18px;
  display: inline-block;
}
.bm-toast-close{
  flex: 0 0 auto;
  margin-left: auto;
  padding: 4px;
  background: transparent;
  border: 0;
  color: var(--muted);
  box-shadow: none;
  cursor: pointer;
}

/* Kind-specific tints – now exactly like login toast */
.bm-toast-danger{
  background: color-mix(in srgb, var(--surface) 88%, var(--danger));
  border-color:  color-mix(in srgb, var(--border) 70%, var(--danger));
}
.bm-toast-danger .bm-toast-icon i{
  color: var(--danger);
}

.bm-toast-info{
  background: color-mix(in srgb, var(--surface) 88%, var(--accent));
  border-color:  color-mix(in srgb, var(--border) 70%, var(--accent));
}
.bm-toast-info .bm-toast-icon i{
  color: var(--accent);
}

.bm-toast-success{
  background: color-mix(in srgb, var(--surface) 88%, var(--success));
  border-color:  color-mix(in srgb, var(--border) 70%, var(--success));
}
.bm-toast-success .bm-toast-icon i{
  color: var(--success);
}

.bm-toast-warning{
  background: color-mix(in srgb, var(--surface) 90%, var(--warning));
  border-color:  color-mix(in srgb, var(--border) 70%, var(--warning));
}
.bm-toast-warning .bm-toast-icon i{
  color: var(--warning);
}

/* Entrance animation – copied from login */
@keyframes bmToastIn{
  from{
    opacity: 0;
    transform: translateY(-6px);
  }
  to{
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes bmToastHold{
  from{ opacity:1; }
  to{ opacity:1; }
}

/* Code / mark */
code,pre{
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:.375rem;
}
mark{
  background: color-mix(in srgb, var(--brand) 28%, transparent);
}

/* ============================ APP LAYOUT CHROME ========================== */
.app-header{
  position:sticky;
  top:0;
  z-index:1045;
  height:var(--app-header-h);
  background:var(--surface-2);
  border-bottom:1px solid var(--border);
  box-shadow:0 1px 0 rgba(0,0,0,.03);
  isolation:isolate;
}
.app-shell{
  display:flex;
  width:100%;
  min-height:calc(100dvh - var(--app-header-h));
  height:calc(100dvh - var(--app-header-h));
  align-items:stretch;
}
.app-main{
  flex:1 1 auto;
  min-width:0;
  width:0;
}

.subhdr{
  height:var(--subhdr-h);
  background:var(--surface);
  border-bottom:1px solid var(--border);
}
.app-scroll{
  height:calc(100% - var(--subhdr-h));
  min-height:0;
  overflow:auto;
  overflow-x:hidden;
}

/* ================================ TOPBAR ================================ */
.bm-topbar{
  position:relative;
  z-index:2;
  min-height:var(--app-header-h);
  background:transparent;
}
.bm-topbar__inner{
  min-height:var(--app-header-h);
  flex-wrap:nowrap;
}
.bm-topbar__brand{
  min-width:0;
  color:var(--brand);
}
.bm-topbar__brand:hover{
  color:var(--brand-600);
}
.bm-topbar__brand-text{
  display:block;
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:1.125rem;
  font-weight:700;
}
.bm-topbar__actions{
  min-width:0;
  flex:0 0 auto;
}
.bm-topbar__icon,
.bm-topbar__account-btn{
  width:40px;
  min-width:40px;
  height:40px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.bm-topbar__icon{
  color:var(--text);
  text-decoration:none;
}
.bm-topbar__icon:hover,
.bm-topbar__icon:focus-visible,
.bm-topbar__account-btn:hover,
.bm-topbar__account-btn:focus-visible{
  color:var(--text);
  background:color-mix(in srgb, var(--brand) 5%, var(--surface));
}
.bm-topbar__icon--outline{
  border-color:var(--border);
  background:color-mix(in srgb, var(--surface-2) 78%, var(--card));
}
.bm-topbar__icon--outline:hover,
.bm-topbar__icon--outline:focus-visible{
  border-color:color-mix(in srgb, var(--brand) 32%, var(--border));
  background:color-mix(in srgb, var(--brand) 5%, var(--surface));
}
.bm-topbar__account{
  flex:0 0 auto;
}
.bm-topbar__account-btn{
  width:auto;
  min-width:0;
  padding:.25rem .25rem .25rem .35rem;
  text-decoration:none;
}
.bm-topbar__avatar{
  flex:0 0 auto;
}
.bm-topbar__menu{
  min-width:17rem;
  max-width:min(22rem, calc(100vw - 1rem));
  margin-top:.55rem;
  z-index:1055;
}

/* ================================ SIDEBAR ================================ */
/* Desktop: dedicated column. Mobile/tablet: slide-over drawer. */
.app-sidebar{
  width:18rem;
  min-width:18rem;
  flex:0 0 18rem;
  flex-shrink:0;
  background:var(--sidebar-bg);
  border-right:1px solid var(--sidebar-border);
  height:calc(100dvh - var(--app-header-h));
  position:sticky;
  top:var(--app-header-h);
  left:0;
  overflow:auto;
  transform:none;
  transition:transform .22s ease, box-shadow .22s ease;
  will-change:transform;
  z-index:1040;
}
.bm-sidebar-backdrop{
  position:fixed;
  inset:var(--app-header-h) 0 0 0;
  background:var(--sidebar-backdrop-bg);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .22s ease, visibility .22s ease;
  z-index:1038;
  -webkit-backdrop-filter: blur(var(--backdrop-blur)) saturate(var(--backdrop-saturate));
  backdrop-filter: blur(var(--backdrop-blur)) saturate(var(--backdrop-saturate));
}
.bm-sidebar-backdrop.is-visible{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

/* Scrollbar only for sidebar */
.app-sidebar::-webkit-scrollbar{
  width:10px;
  height:10px;
}
.app-sidebar::-webkit-scrollbar-thumb{
  background:var(--sb-thumb);
  border-radius:6px;
}
.app-sidebar::-webkit-scrollbar-track{
  background:var(--sb-track);
}

/* Section label */
.nav-label{
  font-size:.8rem;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--muted);
}

/* Group row (no button chrome) */
.side-row{
  width:100%;
  display:flex;
  align-items:center;
  gap:.5rem;
  padding:var(--pady) var(--padx);
  border-radius:.6rem;
  color:var(--text);
  background:transparent;
  border:0;
  text-align:left;
  cursor:pointer;
}
.side-row:hover,
.side-row:focus-visible{
  background:var(--side-hover);
  color:var(--menu-active-text);
}

/* Submenu links */
.side-link{
  width:100%;
  text-align:left;
  border:0;
  background:transparent;
  color:var(--text);
  padding:var(--pady) var(--padx);
  border-radius:.6rem;
}
.side-link:hover,
.side-link:focus-visible{
  background:var(--side-hover);
  color:var(--menu-active-text);
}

/* Active submenu highlight – exact mock tint */
.menu-active{
  background:var(--menu-active-bg) !important;
  color:var(--menu-active-text) !important;
}

/* Caret only when expanded (JS toggles .d-none) */
.caret-open{
  margin-left:auto;
  color:var(--muted);
}
.caret-open.d-none{
  display:none !important;
}

/* Smoother collapse; keep scroll in sidebar */
.collapse[data-group]{
  will-change: height;
}
.collapse[data-group].show{
  overflow:visible;
}

/* ============================== TOP BAR UTILS ============================ */
.topbtn{
  padding:.35rem .6rem;
  border-radius:.6rem;
  border:1px solid transparent;
  background:transparent;
  color:var(--text);
}
.topbtn:hover{
  background:var(--side-hover);
  border-color: var(--hairline);
}

/* ========================== OPTIONAL KPI CARDS =========================== */
.app-stat{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  padding:14px;
  box-shadow: var(--shadow-sm);
}
.app-stat-ico{
  width:36px;
  height:36px;
  border-radius:10px;
  display:grid;
  place-items:center;
  font-size:18px;
  background:rgba(16,185,129,.12);
  color:var(--brand);
}

/* ===================== DASHBOARD / OVERVIEW BUILDING BLOCKS ============= */
.dash-kpi-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:1rem;
}

.dash-kpi-card{
  border-radius:14px;
  background:var(--card);
  border:1px solid var(--border);
  padding:14px 14px 12px;
  box-shadow:var(--shadow-sm);
}

.dash-kpi-label{
  font-size:.8rem;
  text-transform:uppercase;
  letter-spacing:.09em;
  color:var(--muted);
  margin-bottom:.15rem;
}

.dash-kpi-value{
  font-size:1.75rem;
  font-weight:800;
}

.dash-kpi-sub{
  font-size:.8rem;
  color:var(--muted);
}

.dash-kpi-chip{
  font-size:.75rem;
  padding:.15rem .6rem;
  border-radius:999px;
  background:var(--field-chip-bg);
  color:var(--muted);
}

.dash-section{
  border-radius:14px;
  background:var(--card);
  border:1px solid var(--border);
  padding:14px 16px;
  box-shadow:var(--shadow-sm);
}

.dash-section-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:.35rem;
}

.dash-section-title{
  font-size:.85rem;
  text-transform:uppercase;
  letter-spacing:.09em;
  color:var(--muted);
}

.dash-section-actions{
  font-size:.8rem;
}

.table-sm-tight> :not(caption)>*>*{
  padding-top:.35rem;
  padding-bottom:.35rem;
}

.dash-empty{
  font-size:.85rem;
  color:var(--muted);
}

.dash-pill-priority{
  display:inline-flex;
  align-items:center;
  gap:.25rem;
  padding:.1rem .5rem;
  border-radius:999px;
  font-size:.75rem;
  background:rgba(234,138,17,.12);
  color:#ea8a11;
}
.dash-pill-priority i{
  font-size:.8rem;
}
.dash-pill-status{
  display:inline-flex;
  align-items:center;
  padding:.1rem .5rem;
  border-radius:999px;
  font-size:.75rem;
  background:rgba(16,185,129,.12);
  color:var(--brand);
}

.dash-dot{
  width:.45rem;
  height:.45rem;
  border-radius:999px;
  background:var(--brand);
  flex-shrink:0;
}

/* ============================== MISC QUALITY ============================= */
.pagination .page-link{
  border-color:var(--border);
}

/* Pagination “award” look (works for your table-bottom pager too) */
.pagination{
  gap:.35rem;
}
.pagination .page-item .page-link{
  border-radius:.85rem;
  padding:.45rem .75rem;
  background: var(--surface-2);
  color: var(--text);
  border:1px solid var(--border);
  box-shadow: none;
}
.pagination .page-item .page-link:hover{
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--border) 75%, var(--brand));
}
.pagination .page-item.active .page-link{
  background: var(--brand);
  border-color: var(--brand);
  color:#fff;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 28%, transparent);
}
.pagination .page-item.disabled .page-link{
  opacity:.6;
}

.hr-soft{
  border-color:var(--border);
  opacity:.8;
}

.bm-avatar{
  width:28px;
  height:28px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:.75rem;
  font-weight:700;
  background:var(--brand);
  color:#fff;
}

/* ============================= ATTACHMENTS UX ============================ */
/* WorkRequest attachments dropzone + list (central theme, no inline CSS) */
.bm-attach-drop{
  display:block;
  cursor:pointer;
  border: 1px dashed color-mix(in srgb, var(--border) 80%, transparent);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border-radius: 14px;
  padding: 12px;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.bm-attach-drop:hover{
  border-color: color-mix(in srgb, var(--brand) 55%, var(--border));
  background: color-mix(in srgb, var(--brand) 8%, var(--card));
  transform: translateY(-1px);
}

/* JS can toggle this class during dragover */
.bm-attach-drop.is-dragover{
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, var(--card));
  box-shadow: 0 0 0 .15rem color-mix(in srgb, var(--brand) 35%, transparent);
}

.bm-attach-drop__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.bm-attach-drop__icon{
  width:44px;
  height:44px;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  flex:0 0 auto;
}
.bm-attach-drop__icon i{
  font-size: 20px;
}
.bm-attach-drop__text{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
  flex:1 1 auto;
}
.bm-attach-drop__title{
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}
.bm-attach-drop__sub{
  font-size: 12px;
  line-height: 1.2;
  color: var(--muted);
}
.bm-attach-drop__meta{
  flex:0 0 auto;
  display:flex;
  align-items:center;
  gap:8px;
}

/* Attachment item row */
.bm-attach-item{
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 96%, transparent);
  padding: 10px;
  display:flex;
  align-items:center;
  gap:12px;
  transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.bm-attach-item:hover{
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  background: color-mix(in srgb, var(--brand) 6%, var(--card));
  transform: translateY(-1px);
}

/* Thumbnail */
.bm-attach-thumb{
  width:52px;
  height:52px;
  border-radius:12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 55%, var(--card));
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  position:relative;
  flex:0 0 auto;
}
.bm-attach-thumb__img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.bm-attach-thumb__icon{
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  background: color-mix(in srgb, var(--surface) 72%, var(--card));
}
.bm-attach-ext{
  font-weight: 800;
  letter-spacing: .08em;
  font-size: 11px;
  color: color-mix(in srgb, var(--text) 85%, transparent);
}

/* Attachment thumb progress ring overlay (CSP-safe, no JS-injected CSS)
   Markup is in WorkRequest.cshtml template:
   - [data-bm-attach-thumb-overlay="1"] contains <svg class="bm-attach-ring"> with
     <circle class="bm-attach-ring-track"> and <circle class="bm-attach-ring-bar" data-bm-attach-ring="1">.
   JS only toggles d-none + updates stroke-dashoffset and data-bm-attach-thumb-spin.
*/
.bm-attach-thumb [data-bm-attach-thumb-overlay="1"]{
  position:absolute;
  inset:0;
  z-index:5;
  display:flex;
  align-items:center;
  justify-content:center;
  pointer-events:none;
}

.bm-attach-thumb [data-bm-attach-thumb-overlay="1"] .bm-attach-ring{
  width:40px;
  height:40px;
  display:block;
  transform: rotate(-90deg);
  filter: drop-shadow(0 10px 16px var(--bm-attach-ring-shadow));
}

.bm-attach-thumb [data-bm-attach-thumb-overlay="1"][data-bm-attach-thumb-spin="1"] .bm-attach-ring{
  animation: bmAttachRingSpin 1.05s linear infinite;
}

@keyframes bmAttachRingSpin{
  from{ transform: rotate(-90deg); }
  to{ transform: rotate(270deg); }
}

.bm-attach-ring-track{
  fill: transparent;
  stroke: var(--bm-attach-ring-track);
  stroke-width: 3.5;
}

.bm-attach-ring-bar{
  fill: transparent;
  stroke: var(--bm-attach-ring);
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dashoffset .12s linear;
}

/* Status icon beside size (shown only when Uploaded) */
.bm-attach-status-ico{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color: var(--brand);
  margin-right:.25rem;
}

/* Body + actions */
.bm-attach-body{
  min-width:0;
  flex:1 1 auto;
}
.bm-attach-name{
  font-weight: 600;
  max-width: 100%;
}
.bm-attach-meta{
  color: var(--muted);
}
.bm-attach-actions{
  flex:0 0 auto;
  display:flex;
  gap:8px;
  align-items:center;
}

/* Progress */
.bm-attach-progress{
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 70%, var(--card));
  overflow:hidden;
}
.bm-attach-progress .progress-bar{
  background-color: var(--brand);
}

/* Upload hint panel */
.bm-attach-uploadhint{
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--card) 94%, transparent);
  padding: 10px 12px;
}

/* ====================== DIALOG TABS (Roles / Users modals) ================= */
.bm-dialog-tabs{
  border-bottom:1px solid var(--border);
}

.bm-dialog-tabs .nav-link{
  border-radius:0;
  margin-bottom:-1px;
  padding:.45rem .9rem;
  background:transparent;
  border:0;
  border-bottom:2px solid transparent;
  color:var(--muted);
  font-weight:600;
  display:inline-flex;
  align-items:center;
  gap:.35rem;
}

.bm-dialog-tabs .nav-link:hover{
  color:var(--text);
  border-bottom-color:color-mix(in srgb,var(--brand) 35%,transparent);
}

.bm-dialog-tabs .nav-link.active{
  color:var(--brand);
  border-bottom-color:var(--brand);
}

.bm-dialog-tabs .bm-step-circle{
  width:22px;
  height:22px;
  border-radius:999px;
  border:1px solid var(--border);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:.75rem;
}

.bm-dialog-tabs .nav-link.active .bm-step-circle{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}

.u-no-outline:focus{
  outline:none;
  box-shadow: none;
}

/* =========================
   Auth – activation / reset
   ========================= */

/* UPDATED: do not force flex-centering on the BODY.
   Centering is handled by the <main> bootstrap flex utilities, and this keeps the page scroll-safe
   when Turnstile (or any extra content) increases the card height. */
.bm-auth-shell{
  min-height:100vh;
  background:var(--surface-2);
  overflow-y:auto;
}

[data-bs-theme="light"] .bm-auth-shell{
  background:#f3f4f6;
}

.bm-auth-card{
  width:100%;
  max-width:460px;
  background:var(--card);
  border-radius:0.9rem;
  border:1px solid var(--border);
  box-shadow:0 22px 55px rgba(0, 0, 0, 0.55);
}

[data-bs-theme="light"] .bm-auth-card{
  box-shadow:0 18px 45px rgba(15, 23, 42, 0.25);
}

.bm-auth-card-body{
  padding:2rem 2rem 1.75rem;
}

.bm-auth-header{
  color:var(--text);
}

.bm-auth-logo{
  display:inline-flex;
  align-items:center;
  gap:0.45rem;
}

.bm-auth-logo-mark{
  width:2.1rem;
  height:2.1rem;
  border-radius:0.75rem;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background: radial-gradient(circle at 20% 0,
        #6ee7b7 0,
        var(--brand) 40%,
        var(--brand-deep) 100%);
  color:#0f172a;
  font-weight:700;
  font-size:0.95rem;
  letter-spacing:0.03em;
}

.bm-auth-logo-word{
  font-weight:600;
  letter-spacing:0.06em;
  text-transform:uppercase;
  font-size:0.9rem;
  color:var(--muted);
}

.bm-auth-alert{
  font-size:0.875rem;
}

.bm-password-input-group .form-control{
  border-right:0;
}

.bm-password-input-group .btn{
  border-left:0;
}

/* =========================
   Password strength meter
   ========================= */

.bm-password-meter{
  position:relative;
  height:0.35rem;
  border-radius:999px;
  background: rgba(148, 163, 184, 0.25);
  overflow:hidden;
}

.bm-password-meter-fill{
  position:absolute;
  inset:0;
  width:0;
  transition: width 0.25s ease, background-color 0.25s ease;
}

.bm-password-meter[data-strength="0"] .bm-password-meter-fill{ width:0; }

.bm-password-meter[data-strength="1"] .bm-password-meter-fill{
  width:33%;
  background:#ef4444;
}

.bm-password-meter[data-strength="2"] .bm-password-meter-fill,
.bm-password-meter[data-strength="3"] .bm-password-meter-fill{
  width:66%;
  background:#f59e0b;
}

.bm-password-meter[data-strength="4"] .bm-password-meter-fill,
.bm-password-meter[data-strength="5"] .bm-password-meter-fill{
  width:100%;
  background:var(--brand);
}

.bm-password-requirements{
  list-style:none;
  padding-left:0;
  margin:0;
}

.bm-password-requirements li{
  display:flex;
  align-items:center;
  gap:0.4rem;
  color:var(--muted);
  margin-bottom:0.15rem;
}

.bm-password-requirements li::before{
  content:"●";
  font-size:0.55rem;
  opacity:0.35;
  transform: translateY(-1px);
}

.bm-password-requirements li.is-met{
  color:var(--brand);
}

.bm-password-requirements li.is-met::before{
  opacity:1;
}

/* Prevent content area from shifting when sidebar expands on mobile */
@media (max-width:767.98px){
  body{ overflow-y:auto; }
}

/* Small auth padding improvements */
@media (max-width:420px){
  .bm-auth-card-body{ padding:1.6rem 1.25rem 1.25rem; }
  .bm-auth-brand-text{ font-size:1.15rem; }
}

/* ======================== PRINT & REDUCED-MOTION ========================= */
@media print{
  body{
    background:#fff;
    color:#000;
  }
  .app-sidebar{
    display:none;
  }
  .subhdr{
    border-color:#ddd;
  }
}
@media (prefers-reduced-motion: reduce){
  *{
    transition:none !important;
    animation-duration:.01ms !important;
  }
}

/* ==============================
   AUTH (LOGIN) – MOVED FROM theme.css
   - Keeps auth pages independent from website theme.css
   ============================== */

/* Legacy aliases (if any page still uses bm-login-* classes) */
.bm-login-card{ width:100%; max-width:460px; background:var(--card); border-radius:.9rem; border:1px solid var(--border); box-shadow:0 22px 55px rgba(0,0,0,.55); }
[data-bs-theme="light"] .bm-login-card{ box-shadow:0 18px 45px rgba(15,23,42,.25); }
.bm-login-card-body{ padding:2rem 2rem 1.75rem; }
.bm-login-header{ color:var(--text); }
.bm-login-logo{ display:inline-flex; align-items:center; gap:.45rem; }
.bm-login-logo-mark{ width:2.1rem; height:2.1rem; border-radius:.75rem; display:inline-flex; align-items:center; justify-content:center;
  background: radial-gradient(circle at 20% 0, #6ee7b7 0, var(--brand) 40%, var(--brand-deep) 100%);
  color:#0f172a; font-weight:700; font-size:.95rem; letter-spacing:.03em;
}
.bm-login-logo-word{ font-weight:600; letter-spacing:.06em; text-transform:uppercase; font-size:.9rem; color:var(--muted); }
.bm-login-alert{ font-size:.875rem; }

/* ==============================
   AUTH TOAST LAYOUT FIX (Signup/Login)
   - Reserve space so toast appears ABOVE the card instead of overlapping it.
   - Applies only to pages that set body class "bm-login-wrap".
   ============================== */

/* UPDATED: remove hard height:100vh to keep the page scrollable when card gets taller (Turnstile). */
body.bm-login-wrap{
  overflow-y:auto;
}
body.bm-login-wrap main{
  height:auto;
  min-height:100vh;
  box-sizing:border-box;
  padding-top:84px;
  padding-bottom:18px;

  /* default to top-start so the card can never be cropped off-screen */
  align-items:flex-start !important;
}

/* If viewport is tall enough, we can center the card vertically again */
@media (min-height:820px){
  body.bm-login-wrap main{
    align-items:center !important;
  }
}

@media (max-height: 740px){
  body.bm-login-wrap main{
    padding-top:72px;
  }
}
@media (max-height: 640px){
  body.bm-login-wrap main{
    padding-top:64px;
  }
}

/* Make sure toast is always on top (including Turnstile/iframes) */
[data-bm-toast-container]{
  z-index: 2147483647 !important;
}

/* ==============================
   Cloudflare Turnstile layering safety (optional but safe)
   ============================== */
iframe[src*="turnstile"],
iframe[id*="turnstile"],
.cf-turnstile iframe{
  z-index: 1 !important;
}

/* Turnstile alignment inside auth card */
.bm-turnstile-wrap{
  display:flex;
  justify-content:center;
}

/* Turnstile responsiveness */
.cf-turnstile{
  width:100%;
  max-width:100%;
}
.cf-turnstile iframe{
  max-width:100% !important;
}

/* ==============================
   AUTH HEADER BRAND (MOVED FROM Signup inline <style>)
   - No background chip
   - Proper logo sizing
   - Bold app name
   ============================== */
.bm-auth-brand-link{ color: inherit; }

/* Override legacy chip styling (keep this last so it wins) */
.bm-auth-logo-mark{
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}
.bm-auth-logo-mark img{
  display: block;
  width: 28px;
  height: 28px;
}
.bm-auth-brand-text{
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: .2px;
}


/* ==============================
   AUTH BRAND SIZE TUNING (Signup/Login)
   - Microsoft-like compact logo/text proportion
   - Spacing controlled by gap only
   ============================== */
.bm-auth-brand-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.42rem;
  color:inherit;
}

.bm-auth-logo-mark{
  flex:0 0 auto;
}

.bm-auth-logo-mark img{
  display:block;
  width:24px;
  height:24px;
}

.bm-auth-brand-text{
  display:inline-block;
  margin:0;
  font-weight:700;
  font-size:1.02rem;
  line-height:1;
  letter-spacing:0;
  color:var(--text);
}

@media (max-width: 575.98px){
  .bm-auth-brand-link{
    gap:.38rem;
  }

  .bm-auth-logo-mark img{
    width:22px;
    height:22px;
  }

  .bm-auth-brand-text{
    font-size:.98rem;
  }
}

/* ==============================
   AUTH TOAST HOST FIX (MOVED FROM Signup inline <style>)
   Forces top-centered toast host on auth pages even if older CSS pushes it top-right.
   ============================== */
.bm-auth-shell [data-bm-toast-container]{
  position: fixed !important;
  top: 16px !important;
  left: 0 !important;
  right: 0 !important;

  bottom: auto !important;
  margin: 0 !important;
  transform: none !important;

  display: flex !important;
  justify-content: center !important;
  align-items: flex-start !important;

  z-index: 1080 !important;
  padding-left: 12px;
  padding-right: 12px;

  pointer-events: none;
}
.bm-auth-shell [data-bm-toast-container] .bm-toast{
  pointer-events: auto;
}

/* ============================== END THEME ================================ */

/* === BioMaint Work Request Modal (WR) === */
#wrModal .bm-wr-modal-dialog{
  /* Facebook-like responsive width */
  --bs-modal-width: 920px;
  margin: 1.25rem auto;
}

@media (max-width: 1199.98px){
  #wrModal .bm-wr-modal-dialog{ --bs-modal-width: 860px; }
}
@media (max-width: 991.98px){
  #wrModal .bm-wr-modal-dialog{ --bs-modal-width: 760px; }
}
@media (max-width: 767.98px){
  #wrModal .bm-wr-modal-dialog{ --bs-modal-width: calc(100vw - 1.5rem); margin: .75rem; }
}
@media (max-width: 575.98px){
  #wrModal .bm-wr-modal-dialog{ --bs-modal-width: calc(100vw - 1rem); margin: .5rem; }
}

/* Ensure close (X) follows the standard global modal corner placement */
#wrModal .modal-content{ position: relative; }
#wrModal .modal-header{ padding-right: var(--bm-modal-close-reserve); }
#wrModal .bm-wr-modal-close{
  position: absolute;
  top: var(--bm-modal-close-offset);
  right: var(--bm-modal-close-offset);
  margin: 0;
  z-index: 3;
}

/* Tighten spacing on very small screens */
@media (max-width: 575.98px){
  #wrModal .modal-header{ padding-right: var(--bm-modal-close-reserve-sm); }
  #wrModal .bm-wr-modal-close{
    top: var(--bm-modal-close-offset-sm);
    right: var(--bm-modal-close-offset-sm);
  }
}

/* ============================================================
   BioMaint: Standard Close (X) Button (Bootstrap .btn-close)
   - Global override for the whole WebApp
   - Uses Bootstrap's built-in close icon (no url()/data-URI in our CSS)
   - Theme-aligned: light grey background, centered icon
   - Same interaction polish as other buttons
   ============================================================ */
:root{
  --bm-close-size: 1.5rem;            /* 24px */
  --bm-close-icon-size: 12px;         /* icon size inside the circle */
  --bm-modal-close-offset: .7rem;
  --bm-modal-close-offset-sm: .5rem;
  --bm-modal-close-reserve: calc(var(--bm-close-size) + 1.9rem);
  --bm-modal-close-reserve-sm: calc(var(--bm-close-size) + 1.35rem);
}

/* Global button look */
.btn-close{
  width: var(--bm-close-size);
  height: var(--bm-close-size);
  padding: 0;
  margin: 0;

  border-radius: 999px;
  border: 1px solid var(--border);
  background-color: var(--surface-2);

  opacity: 1;

  /* Ensure the Bootstrap close icon is centered and consistent */
  background-position: center;
  background-repeat: no-repeat;
  background-size: var(--bm-close-icon-size) var(--bm-close-icon-size);

  /* Remove Bootstrap dimming/filter variants */
  filter: none;

  /* Match our other buttons' micro-polish */
  transition: background-color .12s ease, border-color .12s ease, transform .06s ease, box-shadow .12s ease;
  box-shadow: none;
}

/* Hover/active */
.btn-close:hover{
  opacity: 1;
  background-color: color-mix(in srgb, var(--surface-2) 70%, var(--surface) 30%);
  border-color: color-mix(in srgb, var(--border) 70%, var(--text) 30%);
}
.btn-close:active{
  opacity: 1;
  transform: translateY(.5px);
  background-color: color-mix(in srgb, var(--surface-2) 55%, var(--surface) 45%);
}

/* Focus (keyboard only) */
.btn-close:focus{
  outline: 0;
  box-shadow: none;
}
.btn-close:focus-visible{
  outline: 0;
  box-shadow: var(--focus-ring);
}

/* Dark mode: keep a light-grey surface so the X stays visible */
html[data-bs-theme="dark"] .btn-close{
  background-color: #F7F8FA;  /* light grey */
  border-color: #E6E9ED;
}
html[data-bs-theme="dark"] .btn-close:hover{
  background-color: #E6E9ED;
  border-color: #D7DBE1;
}
html[data-bs-theme="dark"] .btn-close:active{
  background-color: #D7DBE1;
}

/* If legacy markup uses .btn-close-white, keep it consistent with our theme */
.btn-close.btn-close-white{
  filter: none;
}


/* ============================= WORK ORDER ACTIVITY HISTORY ============================ */
.bm-wo-activity-feed{display:flex;flex-direction:column;gap:12px;}
.bm-wo-activity-item{position:relative;display:grid;grid-template-columns:28px minmax(0,1fr);gap:12px;align-items:stretch;}
.bm-wo-activity-rail{position:relative;display:flex;justify-content:center;align-items:flex-start;padding-top:1rem;}
.bm-wo-activity-rail::before{content:"";position:absolute;top:1.8rem;bottom:-1rem;left:50%;transform:translateX(-50%);width:2px;background:color-mix(in srgb,var(--border) 78%, transparent);border-radius:999px;}
.bm-wo-activity-item:last-child .bm-wo-activity-rail::before{display:none;}
.bm-wo-activity-dot{position:relative;z-index:1;width:12px;height:12px;border-radius:999px;background:var(--brand);box-shadow:0 0 0 4px color-mix(in srgb,var(--brand) 18%, transparent);margin-top:0;}
.bm-wo-activity-card{border-radius:18px;}
.bm-wo-activity-main{min-width:0;}
.bm-wo-activity-time{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem;line-height:1.3;}
.bm-wo-activity-arrow{opacity:.75;}
.bm-wo-activity-title{font-size:1.05rem;line-height:1.35;word-break:break-word;}
.bm-wo-activity-person{display:flex;align-items:center;gap:10px;min-width:0;}
.bm-wo-activity-avatar{flex:0 0 auto;width:34px;height:34px;font-size:.8rem;}
.bm-wo-activity-person-copy{min-width:0;text-align:right;}
.bm-wo-activity-person-name{line-height:1.2;word-break:break-word;}
.bm-wo-activity-person-role{line-height:1.2;}
.bm-wo-activity-notes-wrap{padding:10px 12px;border:1px solid var(--border);border-radius:14px;background:color-mix(in srgb,var(--surface-2) 65%, transparent);}
.bm-wo-activity-notes{white-space:pre-wrap;word-break:break-word;}
.bm-wo-activity-empty .card-body{padding:2rem 1rem;}
.bm-wo-activity-empty-ico{width:52px;height:52px;border-radius:16px;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--brand) 12%, transparent);color:var(--brand);font-size:1.35rem;}
@media (max-width: 767.98px){.bm-wo-activity-item{grid-template-columns:1fr;gap:8px;}.bm-wo-activity-rail{display:none;}.bm-wo-activity-person{justify-content:flex-start;}.bm-wo-activity-person-copy{text-align:left;}}


/* ============================= WORK ORDER PARTS ============================ */
.bm-wo-part-picker{position:relative;}
.bm-wo-part-suggestions{
  position:absolute;
  inset:calc(100% + 6px) 0 auto 0;
  z-index:2060;
  display:none;
  max-height:260px;
  overflow:auto;
  background:var(--float-surface);
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:var(--shadow-md);
}
.bm-wo-part-suggestion,
.bm-wo-part-suggestion-empty{
  width:100%;
  padding:.8rem .9rem;
}
.bm-wo-part-suggestion{
  border:0;
  border-bottom:1px solid var(--hairline);
  background:transparent;
  color:var(--text);
  text-align:left;
}
.bm-wo-part-suggestion:last-child{border-bottom:0;}
.bm-wo-part-suggestion:hover,
.bm-wo-part-suggestion:focus{
  background:color-mix(in srgb, var(--brand) 5%, var(--surface));
  outline:0;
}
.bm-wo-part-suggestion-empty{color:var(--muted);}
.bm-wo-part-meta{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:.75rem;
  padding:.95rem 1rem;
  margin-top:.85rem;
  border:1px solid var(--border);
  border-radius:14px;
  background:color-mix(in srgb, var(--surface-2) 68%, transparent);
}
.bm-wo-part-meta-label{
  color:var(--muted);
  font-size:.74rem;
  letter-spacing:.05em;
  text-transform:uppercase;
  margin-bottom:.2rem;
}
.bm-wo-part-meta-value{
  color:var(--text);
  font-weight:700;
  line-height:1.35;
  overflow-wrap:anywhere;
}
.bm-wo-parts-filter-wrap{width:min(100%, 300px);}
.bm-wo-parts-filter-empty,
.bm-wo-parts-empty{
  border:1px dashed var(--border);
  border-radius:14px;
  padding:1rem;
  text-align:center;
  color:var(--muted);
  background:color-mix(in srgb, var(--surface-2) 55%, transparent);
}
.bm-wo-part-code{
  color:color-mix(in srgb, var(--brand) 72%, var(--text));
  font-size:.8rem;
  font-weight:700;
  letter-spacing:.04em;
}
.bm-wo-parts-table td,
.bm-wo-parts-table th{vertical-align:top;}
@media (max-width: 991.98px){
  .bm-wo-part-meta{grid-template-columns:repeat(2,minmax(0,1fr));}
}
@media (max-width: 575.98px){
  .bm-wo-part-meta{grid-template-columns:1fr;}
  .bm-wo-parts-filter-wrap{width:100%;}
}



/* === BioMaint Work Order Modal (WO) === */
#woModal .bm-wr-modal-dialog{
  /* Match Work Request modal width for a consistent Facebook-like dialog feel */
  --bs-modal-width: 920px;
  margin: 1.25rem auto;
}

@media (max-width: 1199.98px){
  #woModal .bm-wr-modal-dialog{ --bs-modal-width: 860px; }
}
@media (max-width: 991.98px){
  #woModal .bm-wr-modal-dialog{ --bs-modal-width: 760px; }
}
@media (max-width: 767.98px){
  #woModal .bm-wr-modal-dialog{ --bs-modal-width: calc(100vw - 1.5rem); margin: .75rem auto; }
}
@media (max-width: 575.98px){
  #woModal .bm-wr-modal-dialog{ --bs-modal-width: calc(100vw - 1rem); margin: .5rem auto; }
}

#woModal .modal-content{
  position: relative;
}

#woModal .modal-header{
  padding-right: 2.75rem;
}

#woModal .bm-wo-modal-header{
  align-items:flex-start;
  gap:1rem;
}

#woModal .bm-wo-modal-header-main{
  min-width:0;
  flex:1 1 auto;
}

#woModal .bm-wo-modal-title-row{
  min-width:0;
}

#woModal #woModalTitle{
  font-weight:800;
  line-height:1.15;
}

#woModal .bm-wo-header-no-badge{
  background:color-mix(in srgb, var(--surface) 80%, var(--slab-500));
  border-color:color-mix(in srgb, var(--border) 72%, var(--slab-500));
}

#woModal .bm-wo-header-no-badge .bm-badge-dot{
  background:var(--slab-300);
}

#woModal .bm-wo-header-lock-badge{
  background:color-mix(in srgb, var(--surface) 88%, var(--warning));
  border-color:color-mix(in srgb, var(--border) 72%, var(--warning));
}

#woModal .bm-wo-header-lock-badge i{
  font-size:.78rem;
}

#woModal .modal-body{
  padding: 1rem;
}


#woModal .bm-dialog-tabs{
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

#woModal .bm-dialog-tabs .nav-item{
  flex: 0 0 auto;
}

#woModal .bm-dialog-tabs .nav-link{
  white-space: nowrap;
}

.bm-wo-table-wrap{
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.bm-wo-table{
  width:100%;
  min-width: 1360px;
  margin:0;
}

.bm-wo-col-site{ width:240px; }
.bm-wo-col-equipment{ width:240px; }
.bm-wo-col-problem{ width:210px; }
.bm-wo-col-execution{ width:190px; }

@media (max-width: 1399.98px){
  .bm-wo-table{ min-width: 1240px; }
  .bm-wo-col-site{ width:220px; }
  .bm-wo-col-equipment{ width:220px; }
  .bm-wo-col-problem{ width:190px; }
  .bm-wo-col-execution{ width:180px; }
}

@media (max-width: 1199.98px){
  .bm-wo-table{ min-width: 1040px; }
}

.bm-wo-overview-kpi .card-body,
.bm-wo-completion-kpi .card-body{
  min-height:88px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.bm-wo-overview-kpi-label,
.bm-wo-completion-kpi-label{
  line-height:1.35;
  min-height:2.25rem;
}

.bm-wo-overview-kpi-value,
.bm-wo-completion-kpi-value{
  line-height:1.4;
  overflow-wrap:anywhere;
}


.bm-wo-readonly-banner{
  border-color:color-mix(in srgb, var(--border) 65%, var(--warning));
}

#woModal.bm-wo-readonly .bm-wo-signature-pad-wrap{
  opacity:1;
}

#woModal.bm-wo-readonly [data-bm-signature-placeholder]{
  opacity:.9;
}

#woModal.bm-wo-readonly .bm-wo-part-suggestion{
  pointer-events:none;
}

.bm-wo-section-header{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:.15rem;
  min-width:0;
}

.bm-wo-section-title{
  line-height:1.3;
}

.bm-wo-section-subtitle{
  line-height:1.35;
}

.bm-wo-card-help,
.bm-wo-state{
  line-height:1.35;
  overflow-wrap:anywhere;
}

.bm-wo-card-help{
  max-width:min(100%, 24rem);
  text-align:right;
}

.bm-wo-part-actions{
  justify-content:flex-end;
}

.bm-wo-completion-summary-card .card-body{
  min-height:132px;
  display:flex;
  align-items:center;
}

.bm-wo-completion-notes-list{
  padding-left:1rem;
}

.bm-wo-request-stack{
  display:flex;
  flex-direction:column;
  gap:1rem;
}

.bm-wo-request-card{
  height:100%;
}

.bm-wo-request-card .card-body{
  display:flex;
  flex-direction:column;
  gap:.9rem;
}

.bm-wo-request-card .card-header{
  background:var(--surface-2);
}

.bm-wo-request-card .card-header .bm-wo-section-title{
  line-height:1.3;
}

.bm-wo-request-card--summary{
  border-color:color-mix(in srgb, var(--border) 72%, var(--brand));
}

.bm-wo-request-card--summary .card-header{
  background:color-mix(in srgb, var(--surface-2) 88%, var(--brand) 12%);
}

.bm-wo-request-card--lifecycle{
  border-color:color-mix(in srgb, var(--border) 72%, var(--warning));
}

.bm-wo-request-card--lifecycle .card-header{
  background:color-mix(in srgb, var(--surface-2) 90%, var(--warning) 10%);
}

.bm-wo-request-grid > [class*='col-'] > .small{
  margin-bottom:.2rem;
}

.bm-wo-request-grid .fw-semibold,
.bm-wo-request-grid .text-muted{
  overflow-wrap:anywhere;
}

.bm-wo-request-grid .bm-badge{
  max-width:100%;
}

.bm-wo-request-problem,
.bm-wo-request-notes{
  line-height:1.55;
  white-space:pre-wrap;
  word-break:break-word;
}

.bm-wo-request-problem{
  color:var(--text);
}

.bm-wo-request-notes{
  min-height:2.5rem;
}

@media (max-width: 1199.98px){
  .bm-wo-request-card .card-body{
    gap:.8rem;
  }
}

@media (max-width: 575.98px){
  .bm-wo-request-stack{
    gap:.85rem;
  }

  .bm-wo-request-card .card-body{
    padding:.9rem;
  }
}

@media (max-width: 575.98px){
  .bm-wo-overview-kpi .card-body,
  .bm-wo-completion-kpi .card-body{
    min-height:82px;
  }

  .bm-wo-completion-summary-card .card-body{
    min-height:auto;
  }
}

@media (max-width: 991.98px){
  .bm-wo-table{ min-width: 880px; }
}

@media (max-width: 767.98px){
  #woModal .modal-body{ padding: .9rem; }
  #woModal .bm-dialog-tabs .nav-link{ padding: .45rem .75rem; font-size: .875rem; }
  #woModal .bm-wo-modal-header{ gap:.75rem; }
  #woModal .bm-wo-modal-title-row{ gap:.45rem !important; }
  .bm-wo-table{ min-width: 760px; }
}

@media (max-width: 575.98px){
  #woModal .modal-body{ padding: .75rem; }
  .bm-wo-shell .card-header,
  .bm-wo-shell .card-footer{ padding-left: .75rem; padding-right: .75rem; }
  .bm-wo-table{ min-width: 680px; }
}

@media (max-width: 767.98px){
  .bm-wo-card-help{
    width:100%;
    max-width:none;
    text-align:left;
  }
}

.bm-wo-signature-card{
  overflow: hidden;
}

.bm-wo-signature-card .card-body{
  display:flex;
  flex-direction:column;
  min-height: 100%;
}

.bm-wo-signature-fields{
  display:grid;
  grid-template-columns:1fr;
  gap:0;
}

.bm-wo-signature-pad-wrap,
.bm-wo-signature-preview-box{
  min-height: 236px;
}

.bm-wo-signature-pad-wrap{
  position:relative;
  display:block;
  min-height: 236px;
  border-radius: .85rem;
}

.bm-wo-signature-preview-box{
  display:flex;
  align-items:center;
  justify-content:center;
}

.bm-wo-signature-preview-image{
  width:100%;
  max-height:220px;
  object-fit:contain;
}

.bm-wo-signature-loading-grid .card-body{
  min-height: 320px;
}

.bm-wo-signature-skeleton-box{
  min-height: 236px;
  border-radius: .85rem;
  border:1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-2));
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

.bm-wo-signature-skeleton-box .placeholder{
  display:block;
  width:100%;
  min-height:236px;
  margin:0;
  border-radius:0;
}

@media (min-width: 992px){
  .bm-wo-signature-loading-grid,
  #woTabSignatures .row.align-items-stretch{
    --bs-gutter-x: 1.25rem;
  }
}

@media (max-width: 767.98px){
  .bm-wo-signature-pad-wrap,
  .bm-wo-signature-preview-box{
    min-height: 220px;
  }

  .bm-wo-signature-preview-image{
    max-height: 204px;
  }
}

#woTabSignatures .bm-wo-signature-pad-wrap,
#woTabSignatures .bm-wo-signature-preview-box{
  border:1px solid #d8e0ea !important;
  background:#ffffff !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.95), 0 1px 2px rgba(15,23,42,.06);
}

#woTabSignatures .bm-wo-signature-pad-wrap{
  padding:0 !important;
}

#woTabSignatures .bm-wo-signature-preview-box{
  padding:.85rem;
}

html[data-bs-theme="dark"] #woTabSignatures .bm-wo-signature-pad-wrap,
html[data-bs-theme="dark"] #woTabSignatures .bm-wo-signature-preview-box{
  border-color:#dbe3ee !important;
  background:#ffffff !important;
  box-shadow:0 12px 28px rgba(0,0,0,.20);
}

#woTabSignatures canvas[data-bm-signature-canvas]{
  width:100%;
  height:100%;
  min-height: 236px;
  background:#ffffff !important;
}

@media (max-width: 767.98px){
  #woTabSignatures canvas[data-bm-signature-canvas]{
    min-height: 220px;
  }
}

#woTabSignatures [data-bm-signature-placeholder]{
  color:#64748b !important;
  text-shadow:0 1px 0 rgba(255,255,255,.92);
}

#woTabSignatures .bm-wo-signature-preview-image{
  background:#ffffff;
  image-rendering:auto;
  filter:none;
  mix-blend-mode:normal;
}


/* ======================= APP CHROME RESPONSIVE TUNING ==================== */
@media (max-width: 991.98px){
  .app-sidebar{
    position:fixed;
    inset:var(--app-header-h) auto 0 0;
    width:min(18rem, calc(100vw - 1rem));
    min-width:min(18rem, calc(100vw - 1rem));
    height:calc(100dvh - var(--app-header-h));
    transform:translateX(-100%);
    box-shadow:none;
  }

  .app-sidebar.is-open{
    transform:translateX(0);
    box-shadow:0 18px 48px rgba(0,0,0,.24);
  }

  .app-main{
    width:100%;
    flex-basis:100%;
  }
}

@media (min-width: 992px){
  .bm-sidebar-open,
  body.bm-sidebar-open{
    overflow:auto;
  }
}

@media (max-width: 767.98px){
  :root{
    --app-header-h:52px;
  }

  html.bm-sidebar-open,
  body.bm-sidebar-open{
    overflow:hidden;
  }

  .app-header,
  .bm-topbar,
  .bm-topbar__inner{
    min-height:52px;
    height:52px;
  }

  .bm-topbar{
    padding-inline:0;
  }

  .bm-topbar__brand{
    margin-right:auto;
  }

  .bm-topbar__brand-text{
    font-size:1rem;
  }

  .bm-topbar__logo{
    width:24px;
    height:24px;
  }

  .bm-topbar__actions{
    gap:.125rem;
  }

  .bm-topbar__icon,
  .bm-topbar__account-btn{
    width:36px;
    min-width:36px;
    height:36px;
  }

  .bm-topbar__account-btn{
    padding:.2rem;
  }

  .bm-topbar__menu{
    position:fixed;
    top:calc(var(--app-header-h) + .4rem) !important;
    right:.5rem !important;
    left:auto !important;
    inset:auto .5rem auto auto !important;
    transform:none !important;
    max-height:calc(100dvh - var(--app-header-h) - 1rem);
    overflow:auto;
  }
}

@media (max-width: 575.98px){
  :root{
    --subhdr-h:46px;
  }


  .bm-topbar__inner{
    gap:.35rem !important;
  }

  .bm-topbar__brand-text{
    max-width:9.5rem;
  }
}


/* ================================ USERS ================================= */
.bm-users-shell{
  overflow:hidden;
}
.bm-users-shell .card-header,
.bm-users-shell .card-footer{
  background:color-mix(in srgb, var(--surface-3) 84%, var(--surface-2));
  border-color:var(--border);
}
.bm-users-table-wrap{
  overflow-x:auto;
  overscroll-behavior-x:contain;
}
.bm-users-table{
  width:100%;
  min-width:1260px;
  table-layout:fixed;
}
.bm-users-table > :not(caption)>*>*{
  vertical-align:top;
}
.bm-users-table td,
.bm-users-table th{
  padding-top:.75rem;
  padding-bottom:.75rem;
}
.bm-users-col-user{ width:300px; }
.bm-users-col-email{ width:280px; }
.bm-users-col-role{ width:220px; }
.bm-users-col-status{ width:180px; }
.bm-users-col-last-login{ width:180px; }
.bm-users-col-created{ width:130px; }
.bm-users-col-actions{ width:72px; }
.bm-users-table.table-hover>tbody>tr:hover>*{
  background-color: color-mix(in srgb, var(--brand) 3%, var(--bs-table-hover-bg)) !important;
}
.bm-users-shell .min-w-0{ min-width:0; }
.bm-users-filter-btn,
.bm-users-filter-btn:hover,
.bm-users-filter-btn:focus-visible{
  min-height:var(--ctrl-h);
  padding:.65rem .95rem;
  border-radius:var(--ctrl-radius);
  border:1px solid var(--field-border);
  background:var(--field-bg);
  color:var(--text);
  box-shadow:none;
}
.bm-users-filter-btn:focus-visible,
.bm-users-filter-btn.show{
  border-color:var(--brand);
  box-shadow:var(--focus-ring);
}
.bm-users-filter-menu .dropdown-item.active,
.bm-users-filter-menu .dropdown-item:active,
.bm-users-pagesize-menu .dropdown-item.active,
.bm-users-pagesize-menu .dropdown-item:active{
  background: color-mix(in srgb, var(--brand) 16%, var(--surface));
  color: var(--text);
}
.bm-users-filter-menu .dropdown-item.active:hover,
.bm-users-pagesize-menu .dropdown-item.active:hover{
  background: color-mix(in srgb, var(--brand) 20%, var(--surface));
}

html[data-bs-theme="light"] .bm-users-filter-btn,
html[data-bs-theme="light"] .bm-users-filter-btn:hover,
html[data-bs-theme="light"] .bm-users-filter-btn:focus-visible,
html[data-bs-theme="light"] .bm-users-filter-btn.show{
  background:#fff;
  color:var(--text);
}
html[data-bs-theme="dark"] .bm-users-filter-btn.show{
  background:var(--field-bg);
  color:var(--text);
}
.bm-users-filter-menu{
  padding:.35rem;
}
.bm-users-filter-menu .dropdown-item{
  color:var(--text);
  border-radius:.75rem;
}
.bm-users-filter-menu .dropdown-item:hover,
.bm-users-filter-menu .dropdown-item:focus-visible,
.bm-users-pagesize-menu .dropdown-item:hover,
.bm-users-pagesize-menu .dropdown-item:focus-visible{
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  color: var(--text);
}
html[data-bs-theme="light"] .bm-users-filter-menu .dropdown-item:hover,
html[data-bs-theme="light"] .bm-users-filter-menu .dropdown-item:focus-visible,
html[data-bs-theme="light"] .bm-users-pagesize-menu .dropdown-item:hover,
html[data-bs-theme="light"] .bm-users-pagesize-menu .dropdown-item:focus-visible{
  background: color-mix(in srgb, var(--brand) 12%, #ffffff);
}
html[data-bs-theme="light"] .bm-users-filter-menu .dropdown-item.active,
html[data-bs-theme="light"] .bm-users-filter-menu .dropdown-item:active,
html[data-bs-theme="light"] .bm-users-pagesize-menu .dropdown-item.active,
html[data-bs-theme="light"] .bm-users-pagesize-menu .dropdown-item:active{
  background: color-mix(in srgb, var(--brand) 16%, #ffffff);
  color: var(--text);
}
html[data-bs-theme="light"] .bm-users-avatar{
  border-color: color-mix(in srgb, var(--border) 78%, transparent);
}
html[data-bs-theme="dark"] .bm-users-avatar-tone-0{ background:rgba(20,184,166,.28); color:#99f6e4; }
html[data-bs-theme="dark"] .bm-users-avatar-tone-1{ background:rgba(14,165,233,.28); color:#bae6fd; }
html[data-bs-theme="dark"] .bm-users-avatar-tone-2{ background:rgba(99,102,241,.28); color:#c7d2fe; }
html[data-bs-theme="dark"] .bm-users-avatar-tone-3{ background:rgba(139,92,246,.28); color:#ddd6fe; }
html[data-bs-theme="dark"] .bm-users-avatar-tone-4{ background:rgba(217,70,239,.26); color:#f5d0fe; }
html[data-bs-theme="dark"] .bm-users-avatar-tone-5{ background:rgba(236,72,153,.26); color:#fbcfe8; }
html[data-bs-theme="dark"] .bm-users-avatar-tone-6{ background:rgba(249,115,22,.28); color:#fdba74; }
html[data-bs-theme="dark"] .bm-users-avatar-tone-7{ background:rgba(245,158,11,.30); color:#fde68a; }
html[data-bs-theme="dark"] .bm-users-avatar-tone-8{ background:rgba(132,204,22,.28); color:#d9f99d; }
html[data-bs-theme="dark"] .bm-users-avatar-tone-9{ background:rgba(34,197,94,.28); color:#bbf7d0; }
html[data-bs-theme="dark"] .bm-users-avatar-tone-10{ background:rgba(6,182,212,.28); color:#a5f3fc; }
html[data-bs-theme="dark"] .bm-users-avatar-tone-11{ background:rgba(100,116,139,.28); color:#e2e8f0; }

.bm-inline-link-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.35rem;
  padding:0;
  min-height:var(--ctrl-h);
  border:0;
  border-radius:0;
  color:var(--brand);
  font-weight:600;
  text-decoration:none;
  box-shadow:none !important;
}
.bm-inline-link-btn:hover,
.bm-inline-link-btn:focus-visible{
  color:var(--brand-600);
  text-decoration:none;
}
.bm-users-avatar-stack{
  width:36px;
  height:36px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  position:relative;
  flex:0 0 auto;
}
.bm-users-avatar,
.bm-users-avatar-image-shell{
  width:36px;
  height:36px;
  border-radius:999px;
}
.bm-users-avatar{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:.80rem;
  font-weight:700;
  border:1px solid color-mix(in srgb, var(--border) 72%, transparent);
}
.bm-users-avatar-image-shell{
  display:block;
  background-position:center;
  background-repeat:no-repeat;
  background-size:cover;
  border:1px solid color-mix(in srgb, var(--border) 72%, transparent);
  background-color:var(--surface-2);
}
.bm-users-avatar-tone-0{ background:rgba(20,184,166,.24); color:#0f766e; }
.bm-users-avatar-tone-1{ background:rgba(14,165,233,.24); color:#075985; }
.bm-users-avatar-tone-2{ background:rgba(99,102,241,.24); color:#4338ca; }
.bm-users-avatar-tone-3{ background:rgba(139,92,246,.24); color:#6d28d9; }
.bm-users-avatar-tone-4{ background:rgba(217,70,239,.22); color:#a21caf; }
.bm-users-avatar-tone-5{ background:rgba(236,72,153,.22); color:#be185d; }
.bm-users-avatar-tone-6{ background:rgba(249,115,22,.24); color:#c2410c; }
.bm-users-avatar-tone-7{ background:rgba(245,158,11,.26); color:#b45309; }
.bm-users-avatar-tone-8{ background:rgba(132,204,22,.24); color:#4d7c0f; }
.bm-users-avatar-tone-9{ background:rgba(34,197,94,.24); color:#15803d; }
.bm-users-avatar-tone-10{ background:rgba(6,182,212,.24); color:#0e7490; }
.bm-users-avatar-tone-11{ background:rgba(100,116,139,.24); color:#475569; }
.bm-users-name-link{
  color:var(--text);
  text-decoration:none;
  box-shadow:none !important;
  max-width:100%;
}
.bm-users-name-link:hover,
.bm-users-name-link:focus-visible{
  color:var(--brand);
  text-decoration:none;
}
.bm-users-name-text,
.bm-users-email-text,
.bm-users-subtext,
.bm-users-date-text{
  overflow-wrap:anywhere;
  line-height:1.35;
}

.bm-users-perm-toolbar-main{
  min-width:0;
}

.bm-users-role-panel{
  padding:.95rem 1rem;
  border:1px solid var(--border);
  border-radius:1rem;
  background:color-mix(in srgb, var(--surface-2) 82%, var(--card));
  box-shadow:var(--shadow-sm);
}

.bm-users-role-selector{
  width:100%;
}

.bm-users-role-toggle{
  min-height:var(--ctrl-h);
  border-radius:var(--ctrl-radius);
  background:var(--field-bg);
  border-color:var(--field-border);
  color:var(--text);
}

.bm-users-role-toggle:hover,
.bm-users-role-toggle:focus-visible{
  background:var(--field-bg);
  border-color:var(--brand);
  color:var(--text);
  box-shadow:var(--focus-ring);
}

.bm-users-role-toggle[disabled],
.bm-users-role-toggle:disabled{
  opacity:.7;
  background:var(--field-bg);
  border-color:var(--field-border);
  color:var(--muted);
}

.bm-users-role-toggle-text{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.bm-users-role-toggle-count{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:1.5rem;
  height:1.5rem;
  padding:0 .45rem;
  border-radius:999px;
  background:color-mix(in srgb, var(--brand) 14%, var(--surface));
  border:1px solid color-mix(in srgb, var(--brand) 28%, var(--border));
  color:var(--text);
  font-size:.72rem;
  font-weight:700;
}

.bm-users-role-menu{
  border:1px solid var(--border);
  border-radius:1rem;
  background:var(--float-surface);
  box-shadow:var(--shadow-lg);
  overflow:hidden;
}

.bm-users-role-menu-head{
  padding:.75rem .75rem .5rem;
  border-bottom:1px solid var(--border);
  background:color-mix(in srgb, var(--surface-2) 84%, var(--float-surface));
}

.bm-users-role-search .input-group-text{
  background:var(--field-chip-bg);
  border-color:var(--field-border);
  color:var(--muted);
}

.bm-users-role-search .form-control{
  border-left:0;
}

.bm-users-role-search .form-control:focus,
.bm-users-role-search .form-control:focus-visible{
  box-shadow:none;
}

.bm-users-role-options{
  max-height:16rem;
  overflow:auto;
  padding:.35rem;
}

.bm-users-role-option{
  display:flex;
  align-items:center;
  gap:.7rem;
  padding:.65rem .7rem;
  border-radius:.8rem;
  color:var(--text);
  cursor:pointer;
  user-select:none;
  white-space:normal;
}

.bm-users-role-option:hover,
.bm-users-role-option:focus-visible{
  background:color-mix(in srgb, var(--brand) 9%, var(--surface-3));
  color:var(--text);
}

.bm-users-role-option[aria-selected="true"]{
  background:color-mix(in srgb, var(--brand) 10%, var(--surface));
}

.bm-users-role-option-check{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}

.bm-users-role-option-input{
  margin:0;
  cursor:pointer;
}

.bm-users-role-option-name{
  min-width:0;
  overflow-wrap:anywhere;
  line-height:1.35;
}

.bm-users-role-empty{
  padding:.75rem;
  color:var(--muted);
  font-size:.875rem;
  border-top:1px solid var(--border);
  background:color-mix(in srgb, var(--surface-2) 84%, var(--float-surface));
}

.bm-users-role-preview-bar{
  min-height:2.5rem;
}

.bm-users-role-chip,
#btnUserCombinedPreview{
  border-radius:999px;
  white-space:nowrap;
  background:var(--surface);
  border-color:var(--border);
  color:var(--text);
}

.bm-users-role-chip:hover,
#btnUserCombinedPreview:hover{
  border-color:color-mix(in srgb, var(--brand) 38%, var(--border));
  background:color-mix(in srgb, var(--brand) 8%, var(--surface));
  color:var(--text);
}

.bm-users-role-chip.active,
#btnUserCombinedPreview.active{
  border-color:color-mix(in srgb, var(--brand) 55%, var(--border));
  background:color-mix(in srgb, var(--brand) 12%, var(--surface));
  color:var(--text);
}

.bm-users-role-chip:disabled,
#btnUserCombinedPreview:disabled{
  opacity:.75;
}

#btnUserCombinedPreview.is-editing,
#btnToggleEditPerms.is-editing{
  border-color:color-mix(in srgb, var(--brand) 55%, var(--border));
  background:color-mix(in srgb, var(--brand) 10%, var(--surface));
  color:var(--text);
}

.bm-users-perm-search .input-group-text{
  background:var(--field-chip-bg);
  border-color:var(--field-border);
  color:var(--muted);
}

.bm-users-perm-search .form-control{
  border-left:0;
}

.bm-users-perm-search .form-control:focus,
.bm-users-perm-search .form-control:focus-visible{
  box-shadow:none;
  border-color:var(--field-border);
}

.bm-users-perm-search .input-group:focus-within .input-group-text,
.bm-users-perm-search .input-group:focus-within .form-control{
  border-color:color-mix(in srgb, var(--brand) 36%, var(--field-border) 64%);
}

.bm-users-perm-search .input-group{
  border-radius:.85rem;
}

#btnToggleEditPerms.is-editing{
  border-color:var(--brand);
}

@media (max-width: 575.98px){
  .bm-users-perm-toolbar > .d-flex{
    align-items:stretch !important;
  }

  .bm-users-perm-toolbar .d-flex.align-items-sm-end{
    width:100%;
  }

  #btnToggleEditPerms{
    width:100%;
  }
}

.bm-users-perm-search .form-control[type="search"]::-webkit-search-cancel-button{
  cursor:pointer;
}

.bm-perm-search-hidden{
  display:none !important;
}

.bm-users-subtext{
  margin-top:.15rem;
}
.bm-users-action-btn,
.bm-users-pager-btn,
.bm-users-page-current{
  width:36px;
  height:36px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
}
.bm-users-footer{
  gap:.75rem 1rem;
}
.bm-users-footer-meta,
.bm-users-footer-pages{
  min-width:0;
  align-items:center;
}
.bm-users-footer-sep{
  color:var(--muted);
}
.bm-users-page-current,
.bm-users-page-current:hover,
.bm-users-page-current:focus-visible,
.bm-users-page-current:disabled{
  background: color-mix(in srgb, var(--brand) 18%, var(--surface));
  border-color: color-mix(in srgb, var(--border) 75%, var(--brand));
  color: var(--brand);
  opacity: 1;
}
.bm-users-skeleton-row > *{
  background:transparent !important;
}
.bm-users-skeleton-avatar,
.bm-users-skeleton-line,
.bm-users-skeleton-chip,
.bm-users-skeleton-action{
  position:relative;
  overflow:hidden;
  background: color-mix(in srgb, var(--surface) 85%, var(--surface-2));
}
.bm-users-skeleton-avatar::after,
.bm-users-skeleton-line::after,
.bm-users-skeleton-chip::after,
.bm-users-skeleton-action::after{
  content:"";
  position:absolute;
  inset:0;
  transform:translateX(-100%);
  background:linear-gradient(90deg, transparent, color-mix(in srgb, #fff 16%, transparent), transparent);
  animation: bmUsersSkeletonShimmer 1.2s infinite;
}
.bm-users-skeleton-avatar{
  width:36px;
  height:36px;
  border-radius:999px;
  flex:0 0 auto;
}
.bm-users-skeleton-line{
  height:.8rem;
  border-radius:999px;
}
.bm-users-skeleton-line--name{ width:9rem; margin-bottom:.45rem; }
.bm-users-skeleton-line--sub{ width:5rem; height:.65rem; }
.bm-users-skeleton-line--email{ width:13rem; }
.bm-users-skeleton-line--date{ width:8.5rem; }
.bm-users-skeleton-line--date-short{ width:6rem; }
.bm-users-skeleton-chip{
  width:6.5rem;
  height:1.4rem;
  border-radius:999px;
}
.bm-users-skeleton-chip--status{ width:7.8rem; }
.bm-users-skeleton-action{
  width:36px;
  height:36px;
  border-radius:12px;
  display:inline-block;
}
@keyframes bmUsersSkeletonShimmer{
  100%{ transform:translateX(100%); }
}
#userModal .bm-users-modal-dialog{
  --bs-modal-width: 920px;
}
@media (max-width: 1399.98px){
  .bm-users-table{ min-width:1180px; }
  .bm-users-col-user{ width:280px; }
  .bm-users-col-email{ width:260px; }
}
@media (max-width: 1199.98px){
  .bm-users-table{ min-width:1120px; table-layout:auto; }
  #userModal .bm-users-modal-dialog{ --bs-modal-width: 860px; }
}
@media (max-width: 991.98px){
  .bm-users-footer{
    flex-direction:column;
    align-items:flex-start;
  }
  .bm-users-footer-pages{
    margin-left:0 !important;
  }
  #userModal .bm-users-modal-dialog{ --bs-modal-width: 760px; }
}
@media (max-width: 575.98px){
  .bm-inline-link-btn{
    margin-left:0;
  }
  #userModal .bm-users-modal-dialog{
    --bs-modal-width: calc(100vw - 1rem);
    margin:.5rem auto;
  }
}


/* ========================================================================
   BioMaint theme tuning patch
   - Dark mode only: make table/card/modal header-footer slightly deeper
   - Keep light mode header/footer surfaces unchanged
   - Modal close button alignment + theme-specific background tuning
   ======================================================================== */

/* Close button: keep same size, ensure centered fit inside modal headers */
.btn-close{
  min-width: var(--bm-close-size);
  min-height: var(--bm-close-size);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background-color: color-mix(in srgb, var(--surface-2) 88%, var(--surface-3));
  border-color: color-mix(in srgb, var(--border) 84%, var(--surface-3));
}

.modal-content{
  position:relative;
}

.modal-header{
  position:relative;
  padding-right: var(--bm-modal-close-reserve);
}

.modal-header .btn-close{
  position:absolute;
  top: var(--bm-modal-close-offset);
  right: var(--bm-modal-close-offset);
  margin:0;
  z-index:3;
  flex:0 0 var(--bm-close-size);
}

@media (max-width: 575.98px){
  .modal-header{
    padding-right: var(--bm-modal-close-reserve-sm);
  }

  .modal-header .btn-close{
    top: var(--bm-modal-close-offset-sm);
    right: var(--bm-modal-close-offset-sm);
  }
}

/* Light mode: close button should sit naturally on the light header tone */
html[data-bs-theme="light"] .btn-close{
  background-color: color-mix(in srgb, var(--surface-2) 92%, var(--surface-3));
  border-color: color-mix(in srgb, var(--border) 84%, var(--surface-3));
  filter:none;
}
html[data-bs-theme="light"] .btn-close:hover{
  background-color: color-mix(in srgb, var(--surface-2) 82%, var(--surface-3));
  border-color: color-mix(in srgb, var(--border) 74%, var(--text) 26%);
}
html[data-bs-theme="light"] .btn-close:active{
  background-color: color-mix(in srgb, var(--surface-2) 72%, var(--surface-3));
}

/* Dark mode only: header/footer/table head should be a little deeper than content */
html[data-bs-theme="dark"] .card .card-header,
html[data-bs-theme="dark"] .card .card-footer,
html[data-bs-theme="dark"] .bm-users-shell .card-header,
html[data-bs-theme="dark"] .bm-users-shell .card-footer{
  background: color-mix(in srgb, var(--surface-2) 90%, #111214) !important;
}

html[data-bs-theme="dark"] .table thead.table-light,
html[data-bs-theme="dark"] .table-light>*>*{
  background: color-mix(in srgb, var(--surface-2) 92%, #111214 8%) !important;
}

html[data-bs-theme="dark"] .modal-header,
html[data-bs-theme="dark"] .modal-footer,
html[data-bs-theme="dark"] .offcanvas-header,
html[data-bs-theme="dark"] .offcanvas-footer{
  background: color-mix(in srgb, var(--surface-2) 90%, #111214) !important;
}

/* Keep dark request/WO component headers consistent with the deeper shell rhythm */
html[data-bs-theme="dark"] .bm-wo-request-card .card-header{
  background: color-mix(in srgb, var(--surface-2) 90%, #111214) !important;
}

/* Dark mode close button: light-grey circle, clearly lighter than the header */
html[data-bs-theme="dark"] .btn-close{
  background-color: #d8dde4;
  border-color: #c2c9d3;
  filter: none;
  opacity: 1;
}
html[data-bs-theme="dark"] .btn-close:hover{
  background-color: #e4e8ee;
  border-color: #ccd3dc;
}
html[data-bs-theme="dark"] .btn-close:active{
  background-color: #cdd3db;
  border-color: #b8c0cb;
}

/* ========================================================================
   BioMaint modal close button visual refinement
   - Keep existing position logic unchanged
   - Match the requested light and dark X-button look
   - Remove Bootstrap ring-style focus glow
   ======================================================================== */
.btn-close{
  position:relative;
  background-image:none !important;
  color:#1f2937;
  opacity:1;
  box-shadow:none;
}

.btn-close::before,
.btn-close::after{
  content:"";
  position:absolute;
  top:50%;
  left:50%;
  width:12px;
  height:2px;
  border-radius:999px;
  background-color:currentColor;
  transform-origin:center;
  pointer-events:none;
}

.btn-close::before{
  transform:translate(-50%, -50%) rotate(45deg);
}

.btn-close::after{
  transform:translate(-50%, -50%) rotate(-45deg);
}

.btn-close:hover,
.btn-close:focus,
.btn-close:focus-visible,
.btn-close:active{
  outline:0;
  box-shadow:none !important;
}

html[data-bs-theme="light"] .btn-close{
  color:#1f2937;
  background-color:#eceff3;
  border-color:#d6dbe2;
}

html[data-bs-theme="light"] .btn-close:hover{
  color:#111827;
  background-color:#e2e6eb;
  border-color:#c8ced7;
}

html[data-bs-theme="light"] .btn-close:active{
  color:#111827;
  background-color:#d8dde5;
  border-color:#bcc4cf;
}

html[data-bs-theme="dark"] .btn-close{
  color:#f7f8fa;
  background-color:#3f434a;
  border-color:#4b5058;
}

html[data-bs-theme="dark"] .btn-close:hover{
  color:#ffffff;
  background-color:#4a4f57;
  border-color:#5a6069;
}

html[data-bs-theme="dark"] .btn-close:active{
  color:#f3f4f6;
  background-color:#373b42;
  border-color:#474c54;
}

/* ========================================================================
   BioMaint modal close button final tuning
   - Keep existing position and circle size unchanged
   - Make the X icon fit better inside the circle
   - Light mode circle stays close to the header tone
   ======================================================================== */
.btn-close::before,
.btn-close::after{
  width:14px;
  height:2.2px;
}

html[data-bs-theme="light"] .btn-close{
  color:#1f2937;
  background-color: color-mix(in srgb, var(--surface-3) 88%, var(--modal-surface));
  border-color: color-mix(in srgb, var(--border) 78%, var(--surface-3));
}

html[data-bs-theme="light"] .btn-close:hover{
  color:#111827;
  background-color: color-mix(in srgb, var(--surface-3) 82%, var(--modal-surface));
  border-color: color-mix(in srgb, var(--border) 72%, var(--text) 28%);
}

html[data-bs-theme="light"] .btn-close:active{
  color:#111827;
  background-color: color-mix(in srgb, var(--surface-2) 68%, var(--surface-3));
  border-color: color-mix(in srgb, var(--border) 70%, var(--text) 30%);
}

/* ========================================================================
   BioMaint modal close button interaction tuning
   - Keep existing position and circle size unchanged
   - Remove hover/focus ring completely for modal/offcanvas close buttons
   - Increase X size for a better fit inside the circle
   - Keep hover/click behavior clean and standard in both themes
   ======================================================================== */
.modal .btn-close,
.offcanvas .btn-close{
  outline:none !important;
  box-shadow:none !important;
  background-image:none !important;
}

.modal .btn-close::before,
.modal .btn-close::after,
.offcanvas .btn-close::before,
.offcanvas .btn-close::after{
  width:16px;
  height:2.35px;
}

.modal .btn-close:hover,
.modal .btn-close:focus,
.modal .btn-close:focus-visible,
.modal .btn-close:active,
.offcanvas .btn-close:hover,
.offcanvas .btn-close:focus,
.offcanvas .btn-close:focus-visible,
.offcanvas .btn-close:active{
  outline:none !important;
  box-shadow:none !important;
}

html[data-bs-theme="light"] .modal .btn-close,
html[data-bs-theme="light"] .offcanvas .btn-close{
  color:#1f2937;
  background-color: color-mix(in srgb, var(--surface-3) 88%, var(--modal-surface));
  border-color: color-mix(in srgb, var(--border) 78%, var(--surface-3));
}

html[data-bs-theme="light"] .modal .btn-close:hover,
html[data-bs-theme="light"] .offcanvas .btn-close:hover,
html[data-bs-theme="light"] .modal .btn-close:focus,
html[data-bs-theme="light"] .offcanvas .btn-close:focus,
html[data-bs-theme="light"] .modal .btn-close:focus-visible,
html[data-bs-theme="light"] .offcanvas .btn-close:focus-visible{
  color:#111827;
  background-color: color-mix(in srgb, var(--surface-3) 82%, var(--modal-surface));
  border-color: color-mix(in srgb, var(--border) 72%, var(--text) 28%);
}

html[data-bs-theme="light"] .modal .btn-close:active,
html[data-bs-theme="light"] .offcanvas .btn-close:active{
  color:#111827;
  background-color: color-mix(in srgb, var(--surface-2) 68%, var(--surface-3));
  border-color: color-mix(in srgb, var(--border) 70%, var(--text) 30%);
}

html[data-bs-theme="dark"] .modal .btn-close,
html[data-bs-theme="dark"] .offcanvas .btn-close{
  color:#f7f8fa;
  background-color:#3f434a;
  border-color:#4b5058;
}

html[data-bs-theme="dark"] .modal .btn-close:hover,
html[data-bs-theme="dark"] .offcanvas .btn-close:hover,
html[data-bs-theme="dark"] .modal .btn-close:focus,
html[data-bs-theme="dark"] .offcanvas .btn-close:focus,
html[data-bs-theme="dark"] .modal .btn-close:focus-visible,
html[data-bs-theme="dark"] .offcanvas .btn-close:focus-visible{
  color:#ffffff;
  background-color:#4a4f57;
  border-color:#5a6069;
}

html[data-bs-theme="dark"] .modal .btn-close:active,
html[data-bs-theme="dark"] .offcanvas .btn-close:active{
  color:#f3f4f6;
  background-color:#373b42;
  border-color:#474c54;
}

/* ========================================================================
   BioMaint permission matrix
   - Shared matrix UI stays size-free
   - Host sizing is applied only by the calling page
   ======================================================================== */
.bm-perm-matrix-scroll{
  --bm-perm-surface: color-mix(in srgb, var(--card) 97%, var(--surface-2) 3%);
  --bm-perm-section-bg: color-mix(in srgb, var(--surface-2) 82%, var(--card) 18%);
  --bm-perm-row-hover: color-mix(in srgb, var(--brand) 7%, var(--surface-2) 93%);
  --bm-perm-section-border: color-mix(in srgb, var(--border) 88%, transparent);
  display:block;
  width:100%;
  max-width:100%;
  min-width:0;
  overflow:auto;
  border:1px solid color-mix(in srgb, var(--border) 88%, transparent);
  border-radius:1rem;
  background:var(--bm-perm-surface);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

html[data-bs-theme="dark"] .bm-perm-matrix-scroll{
  --bm-perm-surface: linear-gradient(180deg, color-mix(in srgb, var(--card) 96%, #111827 4%), color-mix(in srgb, var(--surface-2) 95%, #0f1723 5%));
  --bm-perm-section-bg: color-mix(in srgb, var(--surface-2) 90%, #172332 10%);
  --bm-perm-row-hover: color-mix(in srgb, var(--brand) 9%, var(--surface-2) 91%);
  --bm-perm-section-border: color-mix(in srgb, var(--border) 78%, #8ebba9 22%);
  border-color:color-mix(in srgb, var(--border) 80%, #6b7280 20%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.bm-perm-matrix-table{
  width:100%;
  min-width:0;
  margin:0;
  table-layout:fixed;
  border-collapse:separate;
  border-spacing:0;
}

.bm-perm-matrix-table > :not(caption) > * > *{
  padding:.66rem .84rem;
  border-bottom:1px solid color-mix(in srgb, var(--border) 86%, transparent);
  vertical-align:middle;
  background:transparent;
  box-shadow:none;
}

.bm-perm-matrix-table thead th{
  position:sticky;
  top:0;
  z-index:2;
}

.bm-perm-col-permission{
  width:68%;
}

.bm-perm-col-flag{
  width:16%;
}

.bm-perm-head-cell{
  font-size:.685rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.045em;
  color:color-mix(in srgb, var(--muted) 74%, var(--text) 26%);
  background:var(--bm-perm-section-bg) !important;
  border-bottom-color:var(--bm-perm-section-border) !important;
  white-space:nowrap;
}

html[data-bs-theme="dark"] .bm-perm-head-cell{
  color:color-mix(in srgb, #dce4f3 78%, var(--text) 22%);
}

.bm-perm-head-permission,
.bm-perm-item-cell,
.bm-perm-group-cell{
  text-align:left;
}

.bm-perm-group-row > td{
  background:transparent !important;
  border-bottom-color:color-mix(in srgb, var(--border) 86%, transparent) !important;
}

.bm-perm-group-toggle{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  width:100%;
  max-width:100%;
  padding:0;
  border:0;
  background:transparent;
  color:inherit;
  font:inherit;
  text-align:left;
  line-height:1.2;
  box-shadow:none !important;
}

.bm-perm-group-toggle:hover,
.bm-perm-group-toggle:focus,
.bm-perm-group-toggle:focus-visible{
  outline:none;
  box-shadow:none !important;
}

.bm-perm-group-title{
  display:inline-flex;
  align-items:center;
  gap:.46rem;
  min-width:0;
}

.bm-perm-group-arrow{
  position:relative;
  flex:0 0 .78rem;
  width:.78rem;
  height:.78rem;
  color:color-mix(in srgb, var(--brand) 80%, var(--text) 20%);
}

.bm-perm-group-arrow::before{
  content:"";
  position:absolute;
  top:50%;
  left:50%;
  width:.43rem;
  height:.43rem;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform:translate(-50%, -62%) rotate(45deg);
  transform-origin:center;
  transition:transform .18s ease;
}

.bm-perm-group-toggle[aria-expanded="false"] .bm-perm-group-arrow::before{
  transform:translate(-58%, -50%) rotate(-45deg);
}

.bm-perm-group-name{
  font-size:.965rem;
  font-weight:700;
  color:color-mix(in srgb, var(--text) 88%, var(--muted) 12%);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

html[data-bs-theme="dark"] .bm-perm-group-name{
  color:color-mix(in srgb, #eff5ff 86%, var(--muted) 14%);
}

.bm-perm-group-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:1.34rem;
  height:1.34rem;
  padding:0 .44rem;
  border-radius:999px;
  font-size:.71rem;
  font-weight:800;
  line-height:1;
  color:var(--brand-deep);
  background:color-mix(in srgb, var(--brand) 16%, var(--surface) 84%);
  border:1px solid color-mix(in srgb, var(--brand) 28%, var(--border) 72%);
  box-shadow:none;
}

html[data-bs-theme="dark"] .bm-perm-group-badge{
  color:color-mix(in srgb, var(--brand) 82%, white 18%);
  background:color-mix(in srgb, var(--brand) 18%, var(--surface-2) 82%);
  border-color:color-mix(in srgb, var(--brand) 26%, rgba(255,255,255,.1) 74%);
}

.bm-perm-group-check-cell{
  background:transparent !important;
}

.bm-perm-group-na{
  font-size:.8rem;
  font-weight:600;
  color:var(--muted);
}

.bm-perm-item-row > td{
  background:transparent !important;
}

.bm-perm-item-row:hover > td{
  background:var(--bm-perm-row-hover) !important;
}

.bm-perm-item-name-wrap{
  display:flex;
  align-items:center;
  gap:.55rem;
  min-width:0;
  padding-left:1.22rem;
}

.bm-perm-item-name{
  display:block;
  min-width:0;
  font-weight:600;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.bm-perm-override-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:.18rem .5rem;
  border-radius:999px;
  font-size:.7rem;
  font-weight:800;
  line-height:1;
  color:#8a4b00;
  background:#fff0cc;
  border:1px solid #ffd480;
  white-space:nowrap;
}

html[data-bs-theme="dark"] .bm-perm-override-badge{
  color:#ffd58a;
  background:rgba(245, 158, 11, .14);
  border-color:rgba(251, 191, 36, .24);
}

.bm-perm-check-cell{
  text-align:center;
}

.bm-perm-check-wrap{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:1.12rem;
  min-height:1.12rem;
}

.bm-perm-check-wrap-group{
  min-width:1.24rem;
  min-height:1.24rem;
}

.bm-perm-checkbox{
  -webkit-appearance:none;
  appearance:none;
  width:.96rem;
  height:.96rem;
  margin:0;
  border-radius:.24rem;
  border:1.5px solid color-mix(in srgb, var(--muted) 38%, var(--border) 62%);
  background-color:color-mix(in srgb, var(--surface) 96%, white 4%);
  background-repeat:no-repeat;
  background-position:center;
  background-size:.56rem .56rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 0 0 1px rgba(0,0,0,.015);
  cursor:pointer;
  transition:background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .12s ease;
}

.bm-perm-checkbox:hover,
.bm-perm-checkbox:focus,
.bm-perm-checkbox:focus-visible,
.bm-perm-checkbox:active{
  outline:none !important;
  box-shadow:0 0 0 .14rem color-mix(in srgb, var(--brand) 18%, transparent) !important;
}

.bm-perm-checkbox:checked,
html[data-bs-theme="dark"] .bm-perm-checkbox:checked,
.bm-perm-checkbox:disabled:checked,
html[data-bs-theme="dark"] .bm-perm-checkbox:disabled:checked{
  border-color:var(--brand) !important;
  background-color:var(--brand) !important;
  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='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='M3.2 8.2l3.1 3.1 6.5-6.5'/%3E%3C/svg%3E") !important;
  box-shadow:0 0 0 .08rem color-mix(in srgb, var(--brand) 16%, transparent), inset 0 1px 0 rgba(255,255,255,.1) !important;
}

.bm-perm-checkbox:indeterminate,
html[data-bs-theme="dark"] .bm-perm-checkbox:indeterminate,
.bm-perm-checkbox:disabled:indeterminate,
html[data-bs-theme="dark"] .bm-perm-checkbox:disabled:indeterminate{
  border-color:var(--brand) !important;
  background-color:color-mix(in srgb, var(--brand) 78%, white 22%) !important;
  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='%23fff' stroke-linecap='round' stroke-width='2.2' d='M3.5 8h9'/%3E%3C/svg%3E") !important;
}

.bm-perm-checkbox:disabled{
  opacity:1;
  cursor:default;
}

.bm-perm-checkbox:disabled:not(:checked):not(:indeterminate){
  background-color:color-mix(in srgb, var(--surface-2) 94%, var(--surface) 6%);
  border-color:color-mix(in srgb, var(--border) 82%, var(--muted) 18%);
}

html[data-bs-theme="dark"] .bm-perm-checkbox{
  border-color:color-mix(in srgb, #9ca3af 38%, var(--border) 62%);
  background-color:color-mix(in srgb, var(--surface-2) 90%, #111827 10%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 0 0 1px rgba(255,255,255,.02);
}

html[data-bs-theme="dark"] .bm-perm-checkbox:disabled:not(:checked):not(:indeterminate){
  background-color:color-mix(in srgb, var(--surface-2) 91%, #111827 9%);
  border-color:color-mix(in srgb, #7b8596 32%, var(--border) 68%);
}

.bm-perm-na{
  font-size:.81rem;
  font-weight:600;
  color:var(--muted);
}

.bm-perm-overridden > td{
  background:color-mix(in srgb, #fff6da 66%, var(--surface) 34%) !important;
}

html[data-bs-theme="dark"] .bm-perm-overridden > td{
  background:linear-gradient(180deg, rgba(245, 158, 11, .08), rgba(245, 158, 11, .04)) !important;
}

.bm-perm-row-hidden{
  display:none;
}

.bm-perm-row-enter{
  animation:bmPermRowIn .18s ease;
}

.bm-perm-row-leave{
  opacity:0;
  transform:translateY(-2px);
  transition:opacity .14s ease, transform .14s ease;
}

@keyframes bmPermRowIn{
  from{
    opacity:0;
    transform:translateY(-2px);
  }
  to{
    opacity:1;
    transform:translateY(0);
  }
}

.bm-perm-state{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:12.75rem;
  border:1px solid color-mix(in srgb, var(--brand) 28%, var(--border) 72%);
  border-radius:1rem;
  background:color-mix(in srgb, var(--brand) 4%, var(--card) 96%);
}

.bm-perm-state-inner{
  width:100%;
  max-width:26rem;
  padding:1.15rem 1rem;
  text-align:center;
}

.bm-perm-state-text{
  font-size:.96rem;
  font-weight:600;
  color:color-mix(in srgb, var(--text) 88%, var(--muted) 12%);
}

.bm-perm-state-loading .bm-perm-state-text,
.bm-perm-state-info .bm-perm-state-text{
  color:color-mix(in srgb, var(--text) 86%, var(--muted) 14%);
}

.bm-perm-state-error{
  border-color:color-mix(in srgb, var(--danger) 30%, var(--border) 70%);
  background:color-mix(in srgb, var(--danger) 5%, var(--card) 95%);
}

html[data-bs-theme="dark"] .bm-perm-state{
  border-color:color-mix(in srgb, var(--brand) 22%, rgba(255,255,255,.14) 78%);
  background:color-mix(in srgb, var(--brand) 5%, var(--surface-2) 95%);
}

html[data-bs-theme="dark"] .bm-perm-state-error{
  border-color:color-mix(in srgb, var(--danger) 22%, rgba(255,255,255,.12) 78%);
  background:color-mix(in srgb, var(--danger) 6%, var(--surface-2) 94%);
}

#userMatrixHost{
  padding:0;
  overflow:hidden;
  background:transparent;
}

#userMatrixHost .bm-perm-matrix-scroll{
  max-height:24.5rem;
  border-radius:inherit;
  border:0;
}

#userMatrixHost .bm-perm-state{
  min-height:16.1rem;
}

@media (max-width: 991.98px){
  #userMatrixHost .bm-perm-matrix-scroll{
    max-height:22rem;
  }

  #userMatrixHost .bm-perm-state{
    min-height:14.5rem;
  }
}

@media (max-width: 575.98px){
  .bm-perm-matrix-table > :not(caption) > * > *{
    padding:.58rem .66rem;
  }

  .bm-perm-col-permission{
    width:66%;
  }

  .bm-perm-col-flag{
    width:17%;
  }

  .bm-perm-head-cell{
    font-size:.64rem;
    letter-spacing:.03em;
  }

  .bm-perm-group-name{
    font-size:.91rem;
  }

  .bm-perm-group-badge{
    min-width:1.24rem;
    height:1.24rem;
    font-size:.68rem;
  }

  .bm-perm-item-name-wrap{
    padding-left:1rem;
  }
}


/* ============================== LOGIN PAGE TUNING ============================== */
.bm-login-page{
  min-height:100dvh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px 16px;
}

.bm-login-card-shell{
  max-width:432px;
  width:100%;
}

.bm-login-brand-block{
  text-align:center;
  margin-bottom:1.55rem;
}

.bm-login-brand-row{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.6rem;
  margin-bottom:.42rem;
}

.bm-login-brand-logo{
  width:44px;
  height:44px;
  flex:0 0 44px;
  display:block;
  filter:drop-shadow(0 10px 24px color-mix(in srgb, var(--brand) 16%, transparent));
}

.bm-login-brand-title{
  margin:0;
  color:var(--accent);
  font-family:inherit;
  font-size:2.15rem;
  line-height:.98;
  font-weight:800;
  letter-spacing:-.035em;
  text-rendering:optimizeLegibility;
}

.bm-login-subtitle{
  margin:0;
  color:var(--muted);
  font-size:.95rem;
}

.bm-login-field{
  margin-bottom:1rem;
}

.bm-login-label{
  font-weight:600;
  color:var(--text);
}

.bm-login-input-group .input-group-text{
  background:var(--field-chip-bg);
  border-color:var(--field-border);
}

.bm-login-input-group .form-control,
.bm-login-password-toggle{
  background:var(--field-bg);
  color:var(--text);
  border-color:var(--field-border);
}

.bm-login-password-toggle:hover,
.bm-login-password-toggle:focus-visible{
  background:color-mix(in srgb, var(--field-bg) 88%, var(--brand) 12%);
  color:var(--text);
  border-color:color-mix(in srgb, var(--field-border) 72%, var(--brand));
}

.bm-login-remember{
  margin-bottom:1rem;
}

.bm-login-turnstile-field{
  margin-bottom:1rem;
}

.bm-login-turnstile-title,
.bm-login-turnstile-status{
  display:block;
}

.bm-login-turnstile-title[hidden],
.bm-login-turnstile-status[hidden]{
  display:none !important;
}

.bm-login-turnstile-title{
  margin:0 0 .55rem;
  font-size:.95rem;
  font-weight:600;
  color:var(--text);
}

.bm-login-turnstile-wrap{
  display:block;
  width:100%;
}

.cf-turnstile.cf-host{
  width:100%;
  min-height:78px;
  display:flex;
  justify-content:flex-start;
  align-items:center;
}

.cf-turnstile.cf-host > div,
.cf-turnstile.cf-host iframe,
.cf-turnstile.cf-host .cf-turnstile{
  width:100% !important;
  max-width:100% !important;
}

.cf-turnstile.cf-host[data-turnstile-state="loading"]{
  opacity:.92;
}

.cf-turnstile.cf-host[data-turnstile-state="error"],
.cf-turnstile.cf-host[data-turnstile-state="offline"],
.cf-turnstile.cf-host[data-turnstile-state="disabled"]{
  border:1px dashed color-mix(in srgb, var(--danger) 55%, var(--border));
  border-radius:12px;
}

.bm-login-turnstile-status{
  margin-top:.55rem;
  min-height:1rem;
  font-size:.84rem;
  line-height:1.4;
}

.bm-login-turnstile-field .text-danger.small{
  display:block;
  margin-top:.35rem;
}

.bm-login-terms a,
.bm-login-footer-link a{
  color:var(--accent);
}

.bm-login-submit{
  min-height:48px;
  border-radius:12px;
  font-size:1rem;
  font-weight:700;
}

.bm-login-footer-link{
  text-align:center;
  margin-top:1rem;
}

.bm-login-mfa-intro{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.85rem;
}

.bm-login-mfa-badge{
  width:44px;
  height:44px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:color-mix(in srgb, var(--brand) 14%, transparent);
  color:var(--brand);
  font-size:1.1rem;
}

.bm-login-mfa-title{
  font-size:1.15rem;
  font-weight:700;
}

@media (min-width: 992px) and (min-height: 760px){
  .bm-auth-shell{
    overflow:hidden;
  }

  .bm-login-page{
    padding-top:20px;
    padding-bottom:20px;
  }
}

@media (max-height: 760px){
  .bm-login-page{
    align-items:flex-start;
    padding-top:20px;
    padding-bottom:20px;
  }
}

@media (max-width: 575.98px){
  .bm-login-page{
    padding:16px 12px;
  }

  .bm-login-brand-logo{
    width:40px;
    height:40px;
    flex-basis:40px;
  }

  .bm-login-brand-title{
    font-size:1.85rem;
  }
}

/* ================================ ROLES ================================= */
.bm-roles-shell{
  overflow:hidden;
}
.bm-roles-shell .card-header,
.bm-roles-shell .card-footer{
  background: color-mix(in srgb, var(--surface-3) 82%, var(--surface-2));
}
.bm-roles-shell .min-w-0{
  min-width:0;
}
.bm-roles-table-wrap{
  overflow-x:auto;
  overscroll-behavior-x:contain;
}
.bm-roles-table{
  width:100%;
  min-width:980px;
  table-layout:fixed;
}
.bm-roles-table > :not(caption)>*>*{
  vertical-align:middle;
}
.bm-roles-table td,
.bm-roles-table th{
  padding-top:.8rem;
  padding-bottom:.8rem;
}
.bm-roles-col-role{ width:260px; }
.bm-roles-col-description{ width:auto; }
.bm-roles-col-status{ width:140px; }
.bm-roles-col-actions{ width:290px; }
.bm-roles-name-text,
.bm-roles-description-text{
  overflow-wrap:anywhere;
  line-height:1.4;
}
.bm-roles-filter-btn,
.bm-roles-filter-btn:hover,
.bm-roles-filter-btn:focus-visible{
  min-height:var(--ctrl-h);
  border-radius:var(--ctrl-radius);
  background:var(--field-bg);
  border-color:var(--field-border);
  color:var(--text);
  box-shadow:none;
}
.bm-roles-filter-btn:focus-visible,
.bm-roles-filter-btn.show{
  border-color:color-mix(in srgb, var(--brand) 36%, var(--field-border) 64%);
}
.bm-roles-filter-menu .dropdown-item.active,
.bm-roles-filter-menu .dropdown-item:active,
.bm-roles-pagesize-menu .dropdown-item.active,
.bm-roles-pagesize-menu .dropdown-item:active{
  background:color-mix(in srgb, var(--brand) 18%, var(--surface));
  color:var(--brand);
}
.bm-roles-filter-menu .dropdown-item.active:hover,
.bm-roles-pagesize-menu .dropdown-item.active:hover{
  color:var(--brand);
}
html[data-bs-theme="light"] .bm-roles-filter-btn,
html[data-bs-theme="light"] .bm-roles-filter-btn:hover,
html[data-bs-theme="light"] .bm-roles-filter-btn:focus-visible,
html[data-bs-theme="light"] .bm-roles-filter-btn.show{
  background:#fff;
}
html[data-bs-theme="dark"] .bm-roles-filter-btn.show{
  background:var(--field-bg);
}
.bm-roles-filter-menu{
  border-radius:.9rem;
}
.bm-roles-filter-menu .dropdown-item,
.bm-roles-pagesize-menu .dropdown-item{
  border-radius:.7rem;
}
.bm-roles-filter-menu .dropdown-item:hover,
.bm-roles-filter-menu .dropdown-item:focus-visible,
.bm-roles-pagesize-menu .dropdown-item:hover,
.bm-roles-pagesize-menu .dropdown-item:focus-visible{
  background: color-mix(in srgb, var(--brand) 9%, var(--surface-3));
}
html[data-bs-theme="light"] .bm-roles-filter-menu .dropdown-item:hover,
html[data-bs-theme="light"] .bm-roles-filter-menu .dropdown-item:focus-visible,
html[data-bs-theme="light"] .bm-roles-pagesize-menu .dropdown-item:hover,
html[data-bs-theme="light"] .bm-roles-pagesize-menu .dropdown-item:focus-visible{
  background: color-mix(in srgb, var(--brand) 8%, #fff);
}
html[data-bs-theme="light"] .bm-roles-filter-menu .dropdown-item.active,
html[data-bs-theme="light"] .bm-roles-filter-menu .dropdown-item:active,
html[data-bs-theme="light"] .bm-roles-pagesize-menu .dropdown-item.active,
html[data-bs-theme="light"] .bm-roles-pagesize-menu .dropdown-item:active{
  background: color-mix(in srgb, var(--brand) 14%, #edf7f3);
  color: var(--brand-deep);
}
.bm-roles-perm-toolbar-main{
  min-width:0;
}
.bm-roles-perm-search .input-group-text{
  background:var(--field-chip-bg);
  border-color:var(--field-border);
  color:var(--muted);
}
.bm-roles-perm-search .form-control{
  border-left:0;
}
.bm-roles-perm-search .form-control:focus,
.bm-roles-perm-search .form-control:focus-visible{
  box-shadow:none;
  border-color:var(--field-border);
}
.bm-roles-perm-search .input-group:focus-within .input-group-text,
.bm-roles-perm-search .input-group:focus-within .form-control{
  border-color:color-mix(in srgb, var(--brand) 36%, var(--field-border) 64%);
}
.bm-roles-perm-search .input-group{
  border-radius:.85rem;
}
.bm-roles-perm-search .form-control[type="search"]::-webkit-search-cancel-button{
  cursor:pointer;
}
.bm-roles-pager-btn,
.bm-roles-page-current{
  width:36px;
  height:36px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
}
.bm-roles-footer{
  gap:.75rem 1rem;
}
.bm-roles-footer-meta,
.bm-roles-footer-pages{
  min-width:0;
  align-items:center;
}
.bm-roles-footer-sep{
  color:var(--muted);
}
.bm-roles-page-current,
.bm-roles-page-current:hover,
.bm-roles-page-current:focus-visible,
.bm-roles-page-current:disabled{
  background: color-mix(in srgb, var(--brand) 18%, var(--surface));
  border-color: color-mix(in srgb, var(--border) 75%, var(--brand));
  color: var(--brand);
  opacity: 1;
}
#dlgRole .bm-roles-modal-dialog{
  --bs-modal-width: 920px;
}
#roleMatrixHost{
  padding:0;
  overflow:hidden;
  background:transparent;
}
#roleMatrixHost .bm-perm-matrix-scroll{
  max-height:24.5rem;
  border-radius:inherit;
  border:0;
}
#roleMatrixHost .bm-perm-state{
  min-height:16.1rem;
}
@media (max-width: 1399.98px){
  .bm-roles-table{ min-width:940px; }
}
@media (max-width: 1199.98px){
  .bm-roles-table{ min-width:900px; table-layout:auto; }
  #dlgRole .bm-roles-modal-dialog{ --bs-modal-width: 860px; }
}
@media (max-width: 991.98px){
  .bm-roles-footer{
    flex-direction:column;
    align-items:flex-start;
  }
  .bm-roles-footer-pages{
    margin-left:0 !important;
  }
  #dlgRole .bm-roles-modal-dialog{ --bs-modal-width: 760px; }
  #roleMatrixHost .bm-perm-matrix-scroll{
    max-height:22rem;
  }
  #roleMatrixHost .bm-perm-state{
    min-height:14.5rem;
  }
}
@media (max-width: 575.98px){
  #dlgRole .bm-roles-modal-dialog{
    --bs-modal-width: calc(100vw - 1rem);
    margin:.5rem auto;
  }
  .bm-roles-col-actions{ width:240px; }
  .bm-inline-link-btn{
    margin-left:0;
  }
}
html[data-bs-theme="dark"] .bm-roles-shell .card-header,
html[data-bs-theme="dark"] .bm-roles-shell .card-footer{
  background: color-mix(in srgb, var(--surface-2) 88%, #131416 12%);
}


/* ========================================================================
   BioMaint Roles tuning patch
   - Merged onto latest theme.webapp.css
   - Keeps current design intact
   - Adds small compatibility styles for roles list/modal/matrix flow
   ======================================================================== */
.bm-roles-shell .card-header,
.bm-roles-shell .card-footer{
  border-color:var(--border);
}

.bm-roles-table.table-hover>tbody>tr:hover>*{
  background-color: color-mix(in srgb, var(--brand) 3%, var(--bs-table-hover-bg)) !important;
}

.bm-roles-action-btn,
.bm-roles-pager-btn,
.bm-roles-page-current{
  width:36px;
  height:36px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:12px;
}

.bm-roles-modal-header{
  align-items:flex-start;
  gap:.75rem;
}

.bm-roles-modal-header .modal-title,
.bm-roles-name-text,
.bm-roles-description-text{
  overflow-wrap:anywhere;
}

.bm-roles-perm-toolbar .input-group{
  min-width:0;
}

/* Future-safe: supports the three-dot action menu if/when Roles uses it */
.bm-roles-action-menu{
  min-width:12.5rem;
}

.bm-roles-action-menu .dropdown-item{
  display:flex;
  align-items:center;
  gap:.5rem;
}

@media (max-width: 575.98px){
  .bm-roles-perm-toolbar > .d-flex{
    align-items:stretch !important;
  }

  .bm-roles-perm-toolbar .d-flex.align-items-sm-end,
  .bm-roles-perm-toolbar .d-flex.align-items-end{
    width:100%;
  }

  .bm-roles-modal-header{
    gap:.6rem;
  }
}


/* ========================================================================
   BioMaint final sidebar-only chrome
   - No topbar
   - Sidebar owns brand, rail toggle, mobile close, and bottom account menu
   - Mobile/tablet uses a floating launcher button + full drawer
   ======================================================================== */
.app-header{
  display:none !important;
}

.app-shell{
  min-height:100dvh;
  height:100dvh;
}

.app-sidebar{
  overflow:visible;
  height:100dvh;
  top:0;
}

.bm-sidebar-backdrop{
  inset:0;
}

.bm-sidebar-shell{
  display:flex;
  flex-direction:column;
  min-height:100%;
  height:100%;
  overflow:visible;
}

.bm-sidebar__header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  padding:.9rem .9rem .8rem;
  border-bottom:1px solid var(--sidebar-border);
  background:color-mix(in srgb, var(--sidebar-bg) 94%, var(--surface-2));
}

.bm-sidebar__header-actions{
  display:flex;
  align-items:center;
  gap:.5rem;
  flex:0 0 auto;
}

.bm-sidebar__toggle--header{
  display:inline-flex;
}

.bm-sidebar__brand{
  min-width:0;
  display:flex;
  align-items:center;
  gap:.65rem;
  color:var(--brand);
  text-decoration:none;
}

.bm-sidebar__brand:hover,
.bm-sidebar__brand:focus-visible{
  color:var(--brand-600);
}

.bm-sidebar__brand-mark{
  flex:0 0 auto;
  display:block;
}

.bm-sidebar__brand-text{
  min-width:0;
  font-size:1.12rem;
  font-weight:800;
  line-height:1;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.bm-sidebar__toggle{
  width:2.2rem;
  height:2.2rem;
  min-width:2.2rem;
  padding:0;
  border:1px solid color-mix(in srgb, var(--border) 78%, transparent);
  border-radius:.8rem;
  background:color-mix(in srgb, var(--brand) 9%, var(--sidebar-bg));
  color:var(--menu-active-text);
  align-items:center;
  justify-content:center;
  box-shadow:none;
  transition:background-color .16s ease, border-color .16s ease, color .16s ease, transform .12s ease;
}

.bm-sidebar__toggle:hover,
.bm-sidebar__toggle:focus,
.bm-sidebar__toggle:focus-visible{
  background:color-mix(in srgb, var(--brand) 15%, var(--sidebar-bg));
  border-color:color-mix(in srgb, var(--brand) 34%, var(--border));
  color:var(--menu-active-text);
  box-shadow:none !important;
  outline:none;
}

.bm-sidebar__toggle:active{
  transform:translateY(.5px);
}

html[data-bs-theme="light"] .bm-sidebar__toggle{
  color:var(--brand-deep);
  background:color-mix(in srgb, var(--brand) 12%, #fff);
  border-color:color-mix(in srgb, var(--brand) 20%, var(--border));
}

html[data-bs-theme="light"] .bm-sidebar__toggle:hover,
html[data-bs-theme="light"] .bm-sidebar__toggle:focus,
html[data-bs-theme="light"] .bm-sidebar__toggle:focus-visible{
  color:var(--brand-deep);
  background:color-mix(in srgb, var(--brand) 18%, #fff);
  border-color:color-mix(in srgb, var(--brand) 28%, var(--border));
}

.bm-sidebar__nav{
  flex:1 1 auto;
  min-height:0;
  overflow:auto;
  padding:.35rem 0 .75rem;
}

.bm-sidebar__nav::-webkit-scrollbar{
  width:10px;
  height:10px;
}
.bm-sidebar__nav::-webkit-scrollbar-thumb{
  background:var(--sb-thumb);
  border-radius:6px;
}
.bm-sidebar__nav::-webkit-scrollbar-track{
  background:var(--sb-track);
}

.bm-sidebar__footer{
  flex:0 0 auto;
  padding:.85rem .75rem;
  border-top:1px solid var(--sidebar-border);
  background:color-mix(in srgb, var(--sidebar-bg) 95%, var(--surface-2));
}

.bm-sidebar__account{
  position:relative;
}

.bm-sidebar__account-trigger{
  width:100%;
  display:flex;
  align-items:center;
  gap:.7rem;
  padding:.6rem .7rem;
  border:1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius:1rem;
  background:color-mix(in srgb, var(--brand) 8%, var(--sidebar-bg));
  color:var(--text);
  text-align:left;
  box-shadow:none;
  transition:background-color .16s ease, border-color .16s ease, color .16s ease, transform .12s ease;
}

.bm-sidebar__account-trigger:hover,
.bm-sidebar__account-trigger:focus,
.bm-sidebar__account-trigger:focus-visible{
  background:color-mix(in srgb, var(--brand) 14%, var(--sidebar-bg));
  border-color:color-mix(in srgb, var(--brand) 30%, var(--border));
  color:var(--text);
  box-shadow:none !important;
  outline:none;
}

html[data-bs-theme="light"] .bm-sidebar__account-trigger{
  background:color-mix(in srgb, var(--brand) 10%, #fff);
}

html[data-bs-theme="light"] .bm-sidebar__account-trigger:hover,
html[data-bs-theme="light"] .bm-sidebar__account-trigger:focus,
html[data-bs-theme="light"] .bm-sidebar__account-trigger:focus-visible{
  background:color-mix(in srgb, var(--brand) 16%, #fff);
}

.bm-sidebar__account-trigger:active{
  transform:translateY(.5px);
}

.bm-sidebar__account-avatar{
  flex:0 0 auto;
}

.bm-sidebar__account-meta{
  min-width:0;
  flex:1 1 auto;
  display:flex;
  align-items:center;
}

.bm-sidebar__account-name{
  display:block;
  min-width:0;
  font-weight:700;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.bm-sidebar__account-caret{
  margin-left:auto;
  font-size:.78rem;
  color:var(--muted);
}

.bm-sidebar__account-menu{
  width:min(18rem, calc(100vw - 1rem));
  max-width:calc(100vw - 1rem);
  margin-bottom:.45rem !important;
}

.bm-sidebar__account-menu .dropdown-item[data-bs-toggle="modal"]{
  cursor:pointer;
}

.bm-sidebar-launcher{
  position:fixed;
  top:.85rem;
  left:.85rem;
  z-index:1046;
  width:2.7rem;
  height:2.7rem;
  min-width:2.7rem;
  padding:0;
  border:1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius:.95rem;
  background:color-mix(in srgb, var(--sidebar-bg) 90%, var(--surface));
  color:var(--text);
  align-items:center;
  justify-content:center;
  box-shadow:var(--shadow-md);
  transition:opacity .18s ease, transform .18s ease, background-color .16s ease, border-color .16s ease;
}

.bm-sidebar-launcher:hover,
.bm-sidebar-launcher:focus,
.bm-sidebar-launcher:focus-visible{
  background:color-mix(in srgb, var(--brand) 12%, var(--sidebar-bg));
  border-color:color-mix(in srgb, var(--brand) 30%, var(--border));
  color:var(--menu-active-text);
  outline:none;
  box-shadow:var(--shadow-md);
}

.bm-sidebar-launcher.is-hidden{
  opacity:0;
  pointer-events:none;
  transform:translateY(-4px);
}

.bm-settings-theme-picker{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:.65rem;
}

.bm-settings-theme-btn{
  min-height:var(--ctrl-h);
  padding:.75rem .95rem;
  border:1px solid var(--field-border);
  border-radius:var(--ctrl-radius);
  background:var(--field-bg);
  color:var(--text);
  font-weight:600;
  text-align:center;
  transition:background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.bm-settings-theme-btn:hover,
.bm-settings-theme-btn:focus,
.bm-settings-theme-btn:focus-visible{
  border-color:color-mix(in srgb, var(--brand) 36%, var(--field-border));
  background:color-mix(in srgb, var(--brand) 6%, var(--field-bg));
  color:var(--text);
  outline:none;
  box-shadow:none;
}

.bm-settings-theme-btn.active{
  border-color:color-mix(in srgb, var(--brand) 56%, var(--field-border));
  background:color-mix(in srgb, var(--brand) 16%, var(--field-bg));
  color:var(--menu-active-text);
  box-shadow:var(--focus-ring);
}

html[data-bs-theme="light"] .bm-settings-theme-btn.active{
  color:var(--brand-deep);
}

@media (min-width: 992px){
  .app-sidebar{
    transition:width .22s ease, min-width .22s ease, flex-basis .22s ease, box-shadow .22s ease;
  }

  .app-sidebar:not(.is-collapsed) .bm-sidebar__footer-actions{
    display:none !important;
  }

  .app-sidebar.is-collapsed .bm-sidebar__header-actions{
    display:none !important;
  }

  .app-sidebar.is-collapsed{
    width:5rem;
    min-width:5rem;
    flex:0 0 5rem;
  }

  .app-sidebar.is-collapsed .bm-sidebar__brand-text,
  .app-sidebar.is-collapsed .side-row span,
  .app-sidebar.is-collapsed .side-link,
  .app-sidebar.is-collapsed .collapse[data-group],
  .app-sidebar.is-collapsed .bm-sidebar__account-meta,
  .app-sidebar.is-collapsed .bm-sidebar__account-caret{
    display:none !important;
  }

  .app-sidebar.is-collapsed .bm-sidebar__header{
    justify-content:center;
    padding-inline:.55rem;
  }

  .app-sidebar.is-collapsed .bm-sidebar__brand{
    justify-content:center;
    gap:0;
  }

  .app-sidebar.is-collapsed .px-2{
    padding-left:.5rem !important;
    padding-right:.5rem !important;
  }

  .app-sidebar.is-collapsed .side-row{
    justify-content:center;
    padding-left:0;
    padding-right:0;
    min-height:2.65rem;
  }

  .app-sidebar.is-collapsed .side-row > i:first-child{
    margin:0;
  }

  .app-sidebar.is-collapsed .bm-sidebar__footer{
    padding-inline:.55rem;
  }

  .app-sidebar.is-collapsed .bm-sidebar__account-trigger{
    justify-content:center;
    padding:.55rem;
    border-radius:.95rem;
  }
}

@media (max-width: 991.98px){
  .app-sidebar{
    position:fixed;
    inset:0 auto 0 0;
    width:min(18rem, calc(100vw - 3.5rem));
    min-width:min(18rem, calc(100vw - 3.5rem));
    max-width:calc(100vw - 3.5rem);
    height:100dvh;
    transform:translateX(-100%);
    box-shadow:none;
    z-index:1045;
  }

  .app-sidebar.is-open{
    transform:translateX(0);
    box-shadow:0 18px 48px rgba(0,0,0,.24);
  }

  .app-main{
    width:100%;
    flex-basis:100%;
  }

  .bm-sidebar__header{
    padding:.8rem .8rem .72rem;
  }

  .bm-sidebar__footer{
    padding:.75rem;
  }

  .bm-sidebar__account-menu{
    width:min(20rem, calc(100vw - 1.5rem));
  }
}

@media (max-width: 767.98px){
  .bm-settings-theme-picker{
    grid-template-columns:1fr;
  }

  .bm-sidebar-launcher{
    top:.7rem;
    left:.7rem;
  }
}


/* -------------------------------------------------------------------------- */
/* BioMaint settings modal + sidebar responsive refinements                   */
/* -------------------------------------------------------------------------- */
.bm-settings-modal-dialog{
  max-width:min(860px, calc(100vw - 1.5rem));
}

.bm-settings-modal .modal-content{
  border:1px solid var(--border);
  border-radius:1.4rem;
  overflow:hidden;
  max-height:min(82vh, 760px);
}

.bm-settings-modal .modal-header{
  padding:1.1rem 1.2rem .95rem;
  border-bottom:1px solid var(--border);
  align-items:flex-start;
}

.bm-settings-modal .modal-body{
  padding:1rem 1.1rem 1.1rem;
  overflow:hidden;
}

.bm-settings-title{
  font-size:1.45rem;
  font-weight:700;
  line-height:1.2;
  margin:0;
}

.bm-settings-subtitle{
  margin:.35rem 0 0;
  color:var(--muted);
  font-size:.94rem;
}

.bm-settings-layout{
  display:grid;
  grid-template-columns:14.5rem minmax(0, 1fr);
  gap:1rem;
  min-height:31rem;
}

.bm-settings-nav{
  display:flex;
  flex-direction:column;
  gap:.35rem;
  padding:.5rem;
  border:1px solid var(--border);
  border-radius:1.1rem;
  background:color-mix(in srgb, var(--surface-2) 78%, var(--surface));
}

.bm-settings-nav .nav-link{
  display:flex;
  align-items:center;
  gap:.75rem;
  border:0;
  border-radius:.9rem;
  padding:.8rem .9rem;
  color:var(--text);
  background:transparent;
  font-weight:600;
  text-align:left;
}

.bm-settings-nav .nav-link i{
  width:1rem;
  text-align:center;
  color:var(--muted);
}

.bm-settings-nav .nav-link:hover,
.bm-settings-nav .nav-link:focus,
.bm-settings-nav .nav-link:focus-visible{
  background:color-mix(in srgb, var(--brand) 8%, var(--surface));
  color:var(--text);
  outline:none;
  box-shadow:none;
}

.bm-settings-nav .nav-link.active{
  background:color-mix(in srgb, var(--brand) 13%, var(--surface));
  color:var(--menu-active-text);
}

.bm-settings-nav .nav-link.active i{
  color:inherit;
}

html[data-bs-theme="light"] .bm-settings-nav .nav-link.active{
  color:var(--brand-deep);
}

.bm-settings-content{
  min-width:0;
  min-height:0;
}

.bm-settings-panel{
  height:100%;
  max-height:calc(min(82vh, 760px) - 8.25rem);
  overflow:auto;
  border:1px solid var(--border);
  border-radius:1.1rem;
  background:var(--surface);
  padding:1rem 1rem 1.05rem;
}

.bm-settings-panel__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:1rem;
  padding-bottom:.85rem;
  border-bottom:1px solid var(--border);
}

.bm-settings-panel__title{
  margin:0;
  font-size:1.04rem;
  font-weight:700;
  line-height:1.25;
}

.bm-settings-panel__text{
  margin:.35rem 0 0;
  color:var(--muted);
  font-size:.92rem;
}

.bm-settings-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:.9rem;
}

.bm-settings-field,
.bm-settings-card,
.bm-settings-stat{
  border:1px solid var(--border);
  border-radius:1rem;
  background:color-mix(in srgb, var(--surface-2) 82%, var(--surface));
}

.bm-settings-field{
  padding:.9rem 1rem;
}

.bm-settings-field__label{
  display:block;
  margin:0 0 .45rem;
  font-size:.8rem;
  font-weight:600;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.03em;
}

.bm-settings-field__value{
  color:var(--text);
  font-weight:600;
  line-height:1.35;
}

.bm-settings-card{
  padding:1rem;
}

.bm-settings-card__title{
  margin:0;
  font-size:1rem;
  font-weight:700;
}

.bm-settings-card__text{
  margin:.35rem 0 0;
  font-size:.9rem;
  color:var(--muted);
}

.bm-settings-card__body{
  margin-top:.9rem;
}

.bm-settings-status-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:.75rem;
  margin-top:.85rem;
}

.bm-settings-stat{
  padding:.85rem .95rem;
}

.bm-settings-stat__label{
  display:block;
  margin-bottom:.35rem;
  color:var(--muted);
  font-size:.79rem;
  text-transform:uppercase;
  letter-spacing:.03em;
}

.bm-settings-stat__value{
  display:flex;
  align-items:center;
  gap:.5rem;
  font-weight:700;
}

.bm-settings-status-dot{
  width:.55rem;
  height:.55rem;
  border-radius:50%;
  background:var(--muted);
  box-shadow:0 0 0 3px color-mix(in srgb, currentColor 15%, transparent);
}

.bm-settings-status-dot.is-good{
  background:var(--success);
  color:var(--success);
}

.bm-settings-status-dot.is-warn{
  background:var(--warning);
  color:var(--warning);
}

.bm-settings-status-dot.is-muted{
  background:var(--muted);
  color:var(--muted);
}

.bm-settings-select{
  width:100%;
  min-height:var(--ctrl-h);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  padding:.75rem .95rem;
  border:1px solid var(--field-border);
  border-radius:var(--ctrl-radius);
  background:var(--field-bg);
  color:var(--text);
  font-weight:600;
  box-shadow:none;
}

.bm-settings-select:hover,
.bm-settings-select:focus,
.bm-settings-select:focus-visible{
  background:color-mix(in srgb, var(--brand) 4%, var(--field-bg));
  border-color:color-mix(in srgb, var(--brand) 32%, var(--field-border));
  color:var(--text);
  outline:none;
  box-shadow:none !important;
}

.bm-settings-select-label{
  display:flex;
  align-items:center;
  gap:.75rem;
}

.bm-settings-select-menu{
  width:100%;
  border-radius:1rem;
}

.bm-settings-select-menu .dropdown-item{
  display:flex;
  align-items:center;
  gap:.7rem;
  padding:.7rem .9rem;
}

.bm-settings-select-menu .dropdown-item.active,
.bm-settings-select-menu .dropdown-item:active{
  background:color-mix(in srgb, var(--brand) 14%, var(--surface));
  color:var(--menu-active-text);
}

html[data-bs-theme="light"] .bm-settings-select-menu .dropdown-item.active,
html[data-bs-theme="light"] .bm-settings-select-menu .dropdown-item:active{
  color:var(--brand-deep);
}

.bm-settings-session-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  margin-bottom:1rem;
  flex-wrap:wrap;
}

.bm-settings-session-summary{
  display:flex;
  align-items:center;
  gap:.75rem;
  flex-wrap:wrap;
}

.bm-settings-session-list{
  display:flex;
  flex-direction:column;
  gap:.75rem;
}

.bm-settings-session-item{
  border:1px solid var(--border);
  border-radius:1rem;
  background:color-mix(in srgb, var(--surface-2) 82%, var(--surface));
  padding:.95rem 1rem;
}

.bm-settings-session-item__top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:.8rem;
}

.bm-settings-session-item__title{
  margin:0;
  font-size:.98rem;
  font-weight:700;
}

.bm-settings-session-item__meta{
  margin:.2rem 0 0;
  color:var(--muted);
  font-size:.9rem;
}

.bm-settings-session-item__grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:.75rem;
}

.bm-settings-session-item__actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
}

.bm-settings-help{
  margin-top:.9rem;
  color:var(--muted);
  font-size:.89rem;
}

@media (max-width: 991.98px){
  .bm-settings-modal-dialog{
    max-width:min(760px, calc(100vw - 1.25rem));
    margin:.625rem auto;
  }

  .bm-settings-layout{
    grid-template-columns:1fr;
    min-height:auto;
  }

  .bm-settings-nav{
    flex-direction:row;
    flex-wrap:nowrap;
    overflow:auto;
    padding:.4rem;
  }

  .bm-settings-nav .nav-link{
    min-width:max-content;
  }

  .bm-settings-content,
  .bm-settings-panel{
    min-width:0;
  }

  .bm-settings-panel{
    max-height:none;
    overflow:visible;
  }
}

@media (max-width: 767.98px){
  .bm-settings-modal-dialog{
    max-width:calc(100vw - 1rem);
  }

  .bm-settings-modal .modal-header{
    padding:1rem 1rem .85rem;
  }

  .bm-settings-modal .modal-body{
    padding:.9rem;
  }

  .bm-settings-grid,
  .bm-settings-status-grid,
  .bm-settings-session-item__grid{
    grid-template-columns:1fr;
  }

  .bm-settings-session-item__top{
    flex-direction:column;
    align-items:stretch;
  }

  .bm-settings-session-item__actions{
    justify-content:flex-start;
  }
}


/* -------------------------------------------------------------------------- */
/* BioMaint patch: menu anchor + responsive settings modal                     */
/* -------------------------------------------------------------------------- */
.subhdr{
  padding:0 .75rem;
  gap:.65rem;
}

.subhdr__content{
  min-width:0;
  flex:1 1 auto;
}

.subhdr__content > *{
  width:100%;
  min-width:0;
}

.bm-subhdr-menu{
  flex:0 0 auto;
}

.bm-sidebar__footer{
  padding:.8rem .75rem;
}

.bm-sidebar__footer-actions{
  padding-bottom:.75rem;
}

.bm-sidebar__footer-account{
  padding-top:.75rem;
  border-top:1px solid var(--sidebar-border);
}

.bm-sidebar__footer-toggle{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.6rem;
  min-height:2.75rem;
  padding:.65rem .75rem;
  border:1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius:1rem;
  background:color-mix(in srgb, var(--brand) 7%, var(--sidebar-bg));
  color:var(--text);
  font-weight:700;
  text-align:center;
  box-shadow:none;
  transition:background-color .16s ease, border-color .16s ease, color .16s ease, transform .12s ease;
}

.bm-sidebar__footer-toggle:hover,
.bm-sidebar__footer-toggle:focus,
.bm-sidebar__footer-toggle:focus-visible{
  background:color-mix(in srgb, var(--brand) 14%, var(--sidebar-bg));
  border-color:color-mix(in srgb, var(--brand) 30%, var(--border));
  color:var(--text);
  box-shadow:none !important;
  outline:none;
}

.bm-sidebar__footer-toggle:active{
  transform:translateY(.5px);
}

.bm-sidebar__footer-toggle i{
  flex:0 0 auto;
}

.bm-sidebar__footer-toggle-label{
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

html[data-bs-theme="light"] .bm-sidebar__footer-toggle{
  background:color-mix(in srgb, var(--brand) 10%, #fff);
}

html[data-bs-theme="light"] .bm-sidebar__footer-toggle:hover,
html[data-bs-theme="light"] .bm-sidebar__footer-toggle:focus,
html[data-bs-theme="light"] .bm-sidebar__footer-toggle:focus-visible{
  background:color-mix(in srgb, var(--brand) 16%, #fff);
}

@media (min-width: 992px){
  .app-sidebar.is-collapsed .bm-sidebar__footer-actions{
    padding-bottom:.55rem;
  }

  .app-sidebar.is-collapsed .bm-sidebar__footer-toggle{
    justify-content:center;
    padding:.6rem;
  }

  .app-sidebar.is-collapsed .bm-sidebar__footer-toggle-label{
    display:none;
  }
}

@media (max-width: 991.98px){
  .app-sidebar{
    z-index:1048;
  }

  .bm-sidebar-backdrop{
    z-index:1047;
  }

  .subhdr{
    padding:0 .65rem;
  }
}

#settingsModal .bm-settings-modal-dialog{
  --bs-modal-width: 980px;
  max-width:min(980px, calc(100vw - 2rem));
  margin:1rem auto;
}

#settingsModal .bm-settings-modal{
  height:min(44rem, calc(100dvh - 2rem));
  display:flex;
  flex-direction:column;
}

#settingsModal .modal-body{
  flex:1 1 auto;
  overflow:hidden;
}

#settingsModal .bm-settings-layout{
  height:100%;
  min-height:0;
}

#settingsModal .bm-settings-layout__nav,
#settingsModal .bm-settings-content{
  min-height:0;
}

#settingsModal .bm-settings-nav{
  height:100%;
}

#settingsModal .bm-settings-content{
  height:100%;
  overflow:hidden;
}

#settingsModal .bm-settings-content > .tab-pane{
  height:100%;
  overflow:auto;
  padding-right:.2rem;
  scrollbar-gutter:stable;
}

#settingsModal .bm-settings-panel{
  min-height:100%;
}

#settingsModal .bm-settings-session-loading{
  margin-bottom:.85rem;
}

#settingsModal .bm-settings-session-list:empty,
#settingsModal [data-bm-settings-session-empty].d-none{
  display:none !important;
}

@media (max-width: 991.98px){
  #settingsModal .bm-settings-modal-dialog{
    --bs-modal-width: calc(100vw - 1.25rem);
    max-width:calc(100vw - 1.25rem);
    margin:.625rem auto;
  }

  #settingsModal .bm-settings-modal{
    height:auto;
    max-height:calc(100dvh - 1.25rem);
  }

  #settingsModal .modal-body{
    overflow:auto;
  }

  #settingsModal .bm-settings-content{
    height:auto;
    overflow:visible;
  }

  #settingsModal .bm-settings-content > .tab-pane{
    height:auto;
    overflow:visible;
    padding-right:0;
  }
}

@media (max-width: 767.98px){
  .subhdr{
    padding:0 .55rem;
  }

  #settingsModal .bm-settings-modal-dialog{
    --bs-modal-width: calc(100vw - 1rem);
    max-width:calc(100vw - 1rem);
    margin:.5rem auto;
  }

  #settingsModal .bm-settings-modal{
    max-height:calc(100dvh - 1rem);
  }
}

/* ========================================================================
   BioMaint sidebar refinement patch
   - Slightly reduce sidebar width
   - Improve sidebar account avatar + name fitting
   - Remove logo section bottom border
   - Add mobile drawer close button support
   - Keep collapsed expand button borderless
   ======================================================================== */
:root{
  --bm-sidebar-width:16.25rem;
  --bm-sidebar-width-collapsed:4.75rem;
}

.app-sidebar{
  width:var(--bm-sidebar-width);
  min-width:var(--bm-sidebar-width);
  flex:0 0 var(--bm-sidebar-width);
}

.bm-sidebar__header{
  padding:.85rem .8rem .75rem;
  border-bottom:0 !important;
}

.bm-sidebar__header-actions{
  margin-left:auto;
}

.bm-sidebar__brand{
  gap:.55rem;
}

.bm-sidebar__brand-text{
  font-size:1.03rem;
}

.bm-sidebar__toggle--mobile-close{
  font-size:.95rem;
}

.bm-sidebar__account-trigger{
  min-height:3rem;
  padding:.55rem .65rem;
  gap:.65rem;
}

.bm-sidebar__account-avatar-shell{
  position:relative;
  width:2.4rem;
  height:2.4rem;
  flex:0 0 2.4rem;
  border-radius:999px;
  overflow:hidden;
}

.bm-sidebar__account-avatar-image,
.bm-sidebar__account-avatar{
  width:100%;
  height:100%;
  border-radius:999px;
}

.bm-sidebar__account-avatar-image{
  display:block;
  object-fit:cover;
  background:color-mix(in srgb, var(--surface-2) 86%, var(--surface));
}

.bm-sidebar__account-avatar{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  font-size:.82rem;
  font-weight:700;
  color:#fff;
  border:0;
  background:linear-gradient(135deg,
    color-mix(in srgb, var(--brand) 76%, #ffffff 24%),
    color-mix(in srgb, var(--brand-deep) 84%, #111827 16%));
}

html[data-bs-theme="light"] .bm-sidebar__account-avatar{
  color:#fff;
}

.bm-sidebar__account-meta{
  min-width:0;
  overflow:hidden;
}

.bm-sidebar__account-name{
  font-size:.95rem;
  font-weight:500;
  line-height:1.25;
}

.bm-sidebar__account-menu-head{
  display:flex;
  align-items:center;
  gap:.7rem;
  min-width:0;
}

.bm-sidebar__account-menu-meta{
  min-width:0;
  flex:1 1 auto;
}

.bm-sidebar__account-menu-name{
  font-size:.95rem;
  font-weight:600;
  line-height:1.3;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

@media (min-width: 992px){
  .app-sidebar.is-collapsed{
    width:var(--bm-sidebar-width-collapsed);
    min-width:var(--bm-sidebar-width-collapsed);
    flex:0 0 var(--bm-sidebar-width-collapsed);
  }

  .app-sidebar.is-collapsed .bm-sidebar__header{
    padding-inline:.5rem;
  }

  .app-sidebar.is-collapsed .bm-sidebar__footer-toggle{
    background:transparent;
    border-color:transparent;
    box-shadow:none;
  }

  .app-sidebar.is-collapsed .bm-sidebar__footer-toggle:hover,
  .app-sidebar.is-collapsed .bm-sidebar__footer-toggle:focus,
  .app-sidebar.is-collapsed .bm-sidebar__footer-toggle:focus-visible{
    background:color-mix(in srgb, var(--brand) 10%, var(--sidebar-bg));
    border-color:transparent;
    box-shadow:none !important;
  }
}

@media (max-width: 991.98px){
  .app-sidebar{
    width:min(var(--bm-sidebar-width), calc(100vw - 3.75rem));
    min-width:min(var(--bm-sidebar-width), calc(100vw - 3.75rem));
    max-width:calc(100vw - 3.75rem);
  }

  .bm-sidebar__header{
    padding:.8rem .8rem .7rem;
  }
}

@media (max-width: 575.98px){
  .app-sidebar{
    width:min(var(--bm-sidebar-width), calc(100vw - 2.75rem));
    min-width:min(var(--bm-sidebar-width), calc(100vw - 2.75rem));
    max-width:calc(100vw - 2.75rem);
  }

  .bm-sidebar__brand-text{
    font-size:1rem;
  }
}


/* ========================================================================
   BioMaint sidebar refinement patch v2
   - Hide group arrow in slim mode
   - Use right/down arrow before menu icon in expanded mode
   - Keep active parent group highlighted
   - Use lighter avatar placeholder tone
   - Remove old footer toggle separator when expanded
   ======================================================================== */
.side-row{
  position:relative;
}

.side-row > .caret-open{
  order:-1;
  flex:0 0 auto;
  margin-left:0;
  margin-right:.1rem;
  font-size:.72rem;
  color:var(--muted);
  transition:color .16s ease, transform .16s ease;
}

.side-row.menu-active{
  background:var(--menu-active-bg) !important;
  color:var(--menu-active-text) !important;
}

.side-row.menu-active > i,
.side-row.menu-active .caret-open{
  color:var(--menu-active-text) !important;
}

.bm-sidebar__account-avatar{
  color:color-mix(in srgb, var(--brand-deep) 86%, #1f2937 14%);
  background:color-mix(in srgb, var(--brand) 18%, var(--surface));
}

html[data-bs-theme="light"] .bm-sidebar__account-avatar{
  color:color-mix(in srgb, var(--brand-deep) 88%, #0f172a 12%);
  background:color-mix(in srgb, var(--brand) 16%, #f7fffb);
}

html[data-bs-theme="dark"] .bm-sidebar__account-avatar{
  color:#c8fff0;
  background:color-mix(in srgb, var(--brand) 26%, #223038);
}

@media (min-width: 992px){
  .app-sidebar.is-collapsed .side-row > .caret-open{
    display:none !important;
  }

  .app-sidebar:not(.is-collapsed) .bm-sidebar__footer-account{
    padding-top:0;
    border-top:0;
  }

  .app-sidebar:not(.is-collapsed) .bm-sidebar__footer-actions{
    padding-bottom:0;
    border:0;
  }
}

/* -------------------------------------------------------------------------- */
/* BioMaint settings modal redesign                                           */
/* ChatGPT-inspired split panel layout with single-column content flow        */
/* -------------------------------------------------------------------------- */
#settingsModal .bm-settings-modal-dialog{
  --bs-modal-width: 1040px;
  max-width:min(1040px, calc(100vw - 2rem));
  margin:1rem auto;
}

#settingsModal .bm-settings-modal{
  height:min(46rem, calc(100dvh - 2rem));
  display:flex;
  flex-direction:column;
  border-radius:1.35rem;
  overflow:hidden;
}

#settingsModal .modal-header{
  padding:1.35rem 1.5rem 1rem;
  align-items:flex-start;
  border-bottom:1px solid var(--border);
  background:color-mix(in srgb, var(--surface-2) 90%, var(--modal-surface));
}

#settingsModal .modal-body{
  flex:1 1 auto;
  padding:0;
  overflow:hidden;
}

#settingsModal .bm-settings-title{
  font-size:1.65rem;
  font-weight:750;
  letter-spacing:-.02em;
}

#settingsModal .bm-settings-subtitle{
  max-width:42rem;
  font-size:.95rem;
}

#settingsModal .bm-settings-layout{
  display:grid;
  grid-template-columns:16.5rem minmax(0, 1fr);
  gap:0;
  height:100%;
  min-height:0;
}

#settingsModal .bm-settings-layout__nav{
  min-height:0;
  border-right:1px solid var(--border);
  background:color-mix(in srgb, var(--surface-2) 86%, var(--surface));
}

#settingsModal .bm-settings-nav{
  height:100%;
  padding:1rem .75rem;
  gap:.2rem;
  border:0;
  border-radius:0;
  background:transparent;
}

#settingsModal .bm-settings-nav .nav-link{
  display:flex;
  align-items:center;
  gap:.75rem;
  width:100%;
  min-height:2.8rem;
  padding:.7rem .85rem;
  border:0;
  border-radius:.9rem;
  color:var(--text);
  background:transparent;
  font-weight:600;
  text-align:left;
  transition:background-color .16s ease, color .16s ease, transform .12s ease;
}

#settingsModal .bm-settings-nav .nav-link i{
  width:1.05rem;
  text-align:center;
  color:var(--muted);
  flex:0 0 auto;
}

#settingsModal .bm-settings-nav .nav-link:hover,
#settingsModal .bm-settings-nav .nav-link:focus,
#settingsModal .bm-settings-nav .nav-link:focus-visible{
  background:color-mix(in srgb, var(--brand) 7%, var(--surface));
  color:var(--text);
  box-shadow:none;
  outline:none;
}

#settingsModal .bm-settings-nav .nav-link.active{
  background:color-mix(in srgb, var(--brand) 14%, var(--surface));
  color:var(--menu-active-text);
}

#settingsModal .bm-settings-nav .nav-link.active i{
  color:inherit;
}

html[data-bs-theme="light"] #settingsModal .bm-settings-nav .nav-link.active{
  color:var(--brand-deep);
}

#settingsModal .bm-settings-content{
  min-height:0;
  height:100%;
  overflow:hidden;
  background:var(--surface);
}

#settingsModal .bm-settings-content > .tab-pane{
  height:100%;
  overflow:auto;
  padding:1.35rem 1.5rem 1.5rem;
  scrollbar-gutter:stable;
}

#settingsModal .bm-settings-panel{
  min-height:100%;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}

#settingsModal .bm-settings-panel__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  margin:0;
  padding:0 0 1rem;
  border-bottom:1px solid var(--border);
}

#settingsModal .bm-settings-panel__title{
  margin:0;
  font-size:1.28rem;
  font-weight:720;
  letter-spacing:-.02em;
}

#settingsModal .bm-settings-panel__text{
  margin:.4rem 0 0;
  max-width:46rem;
  color:var(--muted);
  font-size:.95rem;
  line-height:1.55;
}

#settingsModal .bm-settings-scope-pill,
#settingsModal .bm-settings-status-chip{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  padding:.4rem .75rem;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--border) 78%, transparent);
  background:color-mix(in srgb, var(--brand) 10%, var(--surface));
  color:var(--text);
  font-size:.82rem;
  font-weight:700;
  white-space:nowrap;
}

#settingsModal .bm-settings-scope-pill__dot,
#settingsModal .bm-settings-status-dot{
  width:.5rem;
  height:.5rem;
  border-radius:999px;
  background:var(--brand);
  flex:0 0 auto;
}

#settingsModal .bm-settings-scope-pill--muted,
#settingsModal .bm-settings-status-chip.is-muted{
  background:color-mix(in srgb, var(--surface-2) 88%, var(--surface));
}

#settingsModal .bm-settings-scope-pill--muted .bm-settings-scope-pill__dot,
#settingsModal .bm-settings-status-dot.is-muted{
  background:var(--muted);
}

#settingsModal .bm-settings-scope-pill--security{
  background:color-mix(in srgb, var(--brand) 12%, var(--surface));
}

#settingsModal .bm-settings-status-chip.is-good{
  background:color-mix(in srgb, var(--brand) 12%, var(--surface));
}

#settingsModal .bm-settings-status-dot.is-good{
  background:var(--brand);
}

#settingsModal .bm-settings-status-chip.is-warn{
  background:color-mix(in srgb, var(--warning) 12%, var(--surface));
}

#settingsModal .bm-settings-status-dot.is-warn{
  background:var(--warning);
}

#settingsModal .bm-settings-sections{
  display:flex;
  flex-direction:column;
}

#settingsModal .bm-settings-section{
  padding:1.05rem 0;
  border-bottom:1px solid var(--hairline);
}

#settingsModal .bm-settings-section:last-child{
  border-bottom:0;
  padding-bottom:0;
}

#settingsModal .bm-settings-row{
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(16rem, 21rem);
  gap:1.25rem 1.5rem;
  align-items:start;
}

#settingsModal .bm-settings-row__main{
  min-width:0;
}

#settingsModal .bm-settings-row__label{
  display:block;
  margin:0;
  color:var(--muted);
  font-size:.76rem;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
}

#settingsModal .bm-settings-row__title{
  margin:0;
  color:var(--text);
  font-size:1rem;
  font-weight:700;
}

#settingsModal .bm-settings-row__text{
  margin:.35rem 0 0;
  color:var(--muted);
  font-size:.92rem;
  line-height:1.55;
}

#settingsModal .bm-settings-row__aside{
  min-width:0;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  justify-content:flex-start;
  gap:.45rem;
}

#settingsModal .bm-settings-inline-value{
  max-width:100%;
  color:var(--text);
  font-weight:650;
  text-align:right;
  line-height:1.45;
  word-break:break-word;
}

#settingsModal .bm-settings-inline-note{
  margin:0;
  color:var(--muted);
  font-size:.87rem;
  line-height:1.45;
  text-align:right;
}

#settingsModal .bm-settings-inline-note--strong{
  color:var(--text);
}

#settingsModal .bm-settings-select{
  width:100%;
  min-width:0;
  min-height:2.85rem;
  justify-content:space-between;
  padding:.72rem .95rem;
  border-radius:.95rem;
}

#settingsModal .bm-settings-select-label{
  min-width:0;
  display:flex;
  align-items:center;
  gap:.75rem;
}

#settingsModal .bm-settings-select-menu{
  border-radius:1rem;
}

#settingsModal .bm-settings-session-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  flex-wrap:wrap;
  padding:1.05rem 0 1rem;
  border-bottom:1px solid var(--hairline);
  margin-bottom:0;
}

#settingsModal .bm-settings-session-summary{
  display:flex;
  align-items:center;
  gap:.75rem;
  flex-wrap:wrap;
}

#settingsModal .bm-settings-session-loading{
  padding-top:1rem;
}

#settingsModal .bm-settings-state{
  padding:1rem 0;
}

#settingsModal .bm-settings-state__title{
  margin:0;
  font-size:1rem;
  font-weight:700;
}

#settingsModal .bm-settings-state__text{
  margin:.35rem 0 0;
  color:var(--muted);
  font-size:.92rem;
  line-height:1.5;
}

#settingsModal .bm-settings-session-list{
  display:flex;
  flex-direction:column;
  gap:0;
}

#settingsModal .bm-settings-session-item{
  padding:1rem 0;
  border:0;
  border-bottom:1px solid var(--hairline);
  border-radius:0;
  background:transparent;
}

#settingsModal .bm-settings-session-item:last-child{
  border-bottom:0;
}

#settingsModal .bm-settings-session-item__top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:.8rem;
}

#settingsModal .bm-settings-session-item__title{
  margin:0;
  font-size:1rem;
  font-weight:700;
}

#settingsModal .bm-settings-session-item__meta{
  margin:.25rem 0 0;
  color:var(--muted);
  font-size:.9rem;
  line-height:1.5;
  word-break:break-word;
}

#settingsModal .bm-settings-session-item__details{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:.9rem 1rem;
}

#settingsModal .bm-settings-session-meta-item{
  min-width:0;
}

#settingsModal .bm-settings-session-meta-item__label{
  display:block;
  margin:0 0 .35rem;
  color:var(--muted);
  font-size:.76rem;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
}

#settingsModal .bm-settings-session-meta-item__value{
  color:var(--text);
  font-weight:650;
  line-height:1.45;
  word-break:break-word;
}

#settingsModal .bm-settings-session-item__actions{
  display:flex;
  justify-content:flex-end;
  margin-top:.95rem;
}

#settingsModal .bm-settings-session-list:empty,
#settingsModal [data-bm-settings-session-empty].d-none{
  display:none !important;
}

@media (max-width: 991.98px){
  #settingsModal .bm-settings-modal-dialog{
    --bs-modal-width: calc(100vw - 1.25rem);
    max-width:calc(100vw - 1.25rem);
    margin:.625rem auto;
  }

  #settingsModal .bm-settings-modal{
    height:auto;
    max-height:calc(100dvh - 1.25rem);
  }

  #settingsModal .bm-settings-layout{
    grid-template-columns:13rem minmax(0, 1fr);
  }

  #settingsModal .bm-settings-content > .tab-pane{
    padding:1.15rem 1.15rem 1.25rem;
  }

  #settingsModal .bm-settings-row{
    grid-template-columns:minmax(0, 1fr) minmax(13rem, 17rem);
  }
}

@media (max-width: 767.98px){
  #settingsModal .bm-settings-modal-dialog{
    --bs-modal-width: calc(100vw - 1rem);
    max-width:calc(100vw - 1rem);
    margin:.5rem auto;
  }

  #settingsModal .bm-settings-modal{
    max-height:calc(100dvh - 1rem);
    border-radius:1.1rem;
  }

  #settingsModal .modal-header{
    padding:1rem 1rem .85rem;
  }

  #settingsModal .bm-settings-layout{
    grid-template-columns:1fr;
  }

  #settingsModal .bm-settings-layout__nav{
    border-right:0;
    border-bottom:1px solid var(--border);
  }

  #settingsModal .bm-settings-nav{
    height:auto;
    flex-direction:row;
    flex-wrap:nowrap;
    overflow:auto;
    padding:.65rem;
    scrollbar-width:none;
  }

  #settingsModal .bm-settings-nav::-webkit-scrollbar{
    display:none;
  }

  #settingsModal .bm-settings-nav .nav-link{
    min-width:max-content;
  }

  #settingsModal .bm-settings-content{
    height:auto;
  }

  #settingsModal .bm-settings-content > .tab-pane{
    height:auto;
    overflow:auto;
    padding:1rem;
  }

  #settingsModal .bm-settings-panel__header,
  #settingsModal .bm-settings-row,
  #settingsModal .bm-settings-session-item__top,
  #settingsModal .bm-settings-session-toolbar{
    display:flex;
    flex-direction:column;
    align-items:stretch;
  }

  #settingsModal .bm-settings-row__aside,
  #settingsModal .bm-settings-inline-value,
  #settingsModal .bm-settings-inline-note,
  #settingsModal .bm-settings-session-item__actions{
    align-items:flex-start;
    justify-content:flex-start;
    text-align:left;
  }

  #settingsModal .bm-settings-session-item__details{
    grid-template-columns:1fr;
  }
}


/* Settings modal refinement: flatter single-column shell, lighter session hierarchy, compact session rows */
#settingsModal .bm-settings-panel__summary{
  min-width:0;
  flex:1 1 auto;
}

#settingsModal .bm-settings-panel__header .bm-settings-panel__text{
  margin:0;
}

#settingsModal .bm-settings-panel__title{
  display:none;
}

#settingsModal .bm-settings-row__title{
  font-weight:620;
}

#settingsModal .bm-settings-inline-value{
  font-weight:560;
}

#settingsModal .bm-settings-inline-note--strong{
  font-weight:560;
}

#settingsModal .bm-settings-session-item{
  padding:1rem 0 .95rem;
}

#settingsModal .bm-settings-session-item__top{
  align-items:center;
  margin-bottom:.7rem;
}

#settingsModal .bm-settings-session-item__identity{
  min-width:0;
  flex:1 1 auto;
}

#settingsModal .bm-settings-session-item__title{
  font-size:.98rem;
  font-weight:620;
  line-height:1.4;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

#settingsModal .bm-settings-session-item__meta{
  margin:.2rem 0 0;
  font-size:.86rem;
  line-height:1.4;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

#settingsModal .bm-settings-session-item__details{
  gap:.8rem 1rem;
}

#settingsModal .bm-settings-session-meta-item__label{
  font-weight:650;
}

#settingsModal .bm-settings-session-meta-item__value{
  font-weight:560;
}

#settingsModal .bm-settings-session-item__actions{
  margin-top:.85rem;
}

@media (max-width: 767.98px){
  #settingsModal .bm-settings-session-item__title,
  #settingsModal .bm-settings-session-item__meta{
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
  }
}

/* ========================================================================
   BioMaint Settings sessions refinement
   - Compact modal width
   - Active sessions list with browser/device icon
   ======================================================================== */
#settingsModal .bm-settings-modal-dialog{
  --bs-modal-width: 920px;
  max-width:min(920px, calc(100vw - 1.5rem));
  margin:.75rem auto;
}

#settingsModal .bm-settings-modal{
  height:min(43rem, calc(100dvh - 1.5rem));
}

#settingsModal .bm-settings-panel__header{
  gap:.85rem;
}

#settingsModal .bm-settings-session-toolbar{
  padding:1rem 0 .9rem;
  gap:.85rem 1rem;
}

#settingsModal .bm-settings-session-summary{
  min-width:0;
}

#settingsModal .bm-settings-session-list{
  gap:0;
}

#settingsModal .bm-settings-session-item{
  padding:1rem 0;
  border-bottom:1px solid var(--hairline);
}

#settingsModal .bm-settings-session-item__top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  margin-bottom:.8rem;
}

#settingsModal .bm-settings-session-item__heading{
  display:flex;
  align-items:flex-start;
  gap:.85rem;
  min-width:0;
  flex:1 1 auto;
}

#settingsModal .bm-settings-session-item__icon{
  width:2.35rem;
  height:2.35rem;
  min-width:2.35rem;
  border-radius:.85rem;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid color-mix(in srgb, var(--border) 82%, transparent);
  background:color-mix(in srgb, var(--brand) 9%, var(--surface-2));
  color:var(--brand);
  box-shadow:var(--shadow-sm);
}

#settingsModal .bm-settings-session-item__icon i{
  font-size:1.1rem;
  line-height:1;
}

#settingsModal .bm-settings-session-item__icon--edge,
#settingsModal .bm-settings-session-item__icon--chrome,
#settingsModal .bm-settings-session-item__icon--firefox,
#settingsModal .bm-settings-session-item__icon--safari,
#settingsModal .bm-settings-session-item__icon--mobile,
#settingsModal .bm-settings-session-item__icon--tablet,
#settingsModal .bm-settings-session-item__icon--desktop,
#settingsModal .bm-settings-session-item__icon--default{
  color:var(--brand);
}

#settingsModal .bm-settings-session-item__identity{
  min-width:0;
  flex:1 1 auto;
}

#settingsModal .bm-settings-session-item__title-row{
  display:flex;
  align-items:center;
  gap:.55rem;
  flex-wrap:wrap;
}

#settingsModal .bm-settings-session-item__title{
  margin:0;
  min-width:0;
  font-size:1rem;
  font-weight:650;
  line-height:1.35;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

#settingsModal .bm-settings-session-item__meta{
  margin:.22rem 0 0;
  color:var(--muted);
  font-size:.88rem;
  line-height:1.45;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

#settingsModal .bm-settings-session-item__actions{
  display:flex;
  align-items:flex-start;
  justify-content:flex-end;
  flex:0 0 auto;
  margin-top:0;
}

#settingsModal .bm-settings-session-item__terminate{
  min-width:7.25rem;
}

#settingsModal .bm-settings-session-item__details{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:.8rem 1rem;
}

#settingsModal .bm-settings-session-meta-item{
  min-width:0;
}

#settingsModal .bm-settings-session-meta-item__label{
  display:block;
  margin:0 0 .32rem;
  color:var(--muted);
  font-size:.74rem;
  font-weight:750;
  letter-spacing:.06em;
  text-transform:uppercase;
}

#settingsModal .bm-settings-session-meta-item__value{
  color:var(--text);
  font-weight:600;
  line-height:1.45;
  word-break:break-word;
}

@media (max-width: 991.98px){
  #settingsModal .bm-settings-modal-dialog{
    --bs-modal-width: calc(100vw - 1.25rem);
    max-width:calc(100vw - 1.25rem);
    margin:.625rem auto;
  }

  #settingsModal .bm-settings-modal{
    height:min(42rem, calc(100dvh - 1.25rem));
  }
}

@media (max-width: 767.98px){
  #settingsModal .bm-settings-modal-dialog{
    --bs-modal-width: calc(100vw - 1rem);
    max-width:calc(100vw - 1rem);
    margin:.5rem auto;
  }

  #settingsModal .bm-settings-modal{
    height:min(100dvh - 1rem, 42rem);
    border-radius:1.05rem;
  }

  #settingsModal .bm-settings-session-item__top,
  #settingsModal .bm-settings-session-toolbar{
    flex-direction:column;
    align-items:stretch;
  }

  #settingsModal .bm-settings-session-item__title,
  #settingsModal .bm-settings-session-item__meta{
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
  }

  #settingsModal .bm-settings-session-item__actions{
    justify-content:flex-start;
  }

  #settingsModal .bm-settings-session-item__terminate{
    min-width:0;
  }

  #settingsModal .bm-settings-session-item__details{
    grid-template-columns:1fr;
  }
}


/* ========================================================================
   BioMaint typography refinement
   - Self-hosted Inter variable font
   - Slightly smaller, smoother app typography
   - Keeps existing layout and component structure unchanged
   ======================================================================== */
html{
  font-size:15px;
  -webkit-text-size-adjust:100%;
  text-rendering:optimizeLegibility;
}

body,
button,
input,
optgroup,
select,
textarea{
  font-family:"Inter","Noto Sans Bengali","Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif;
  font-size:14px;
  line-height:1.5;
  font-optical-sizing:auto;
  font-kerning:normal;
  font-feature-settings:"cv11" 1,"ss01" 1;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

small,
.small,
.text-muted.small{
  font-size:.8125rem;
}

.btn,
.form-control,
.form-select,
.input-group-text{
  font-size:.9375rem;
}

.btn{
  font-weight:500;
}

.nav-label{
  font-size:.75rem;
}

.table td{
  font-size:.9rem;
}

.table td .small{
  font-size:.8125rem;
}

.bm-topbar__brand-text{
  font-size:1.05rem;
}

.bm-sidebar__brand-text{
  font-size:1rem;
}

.bm-sidebar__account-name{
  font-size:.92rem;
}

#settingsModal .bm-settings-title{
  font-size:1.35rem;
  font-weight:700;
}

#settingsModal .bm-settings-subtitle,
#settingsModal .bm-settings-panel__text,
#settingsModal .bm-settings-row__text{
  font-size:.875rem;
  line-height:1.5;
}

#settingsModal .bm-settings-nav .nav-link{
  font-size:.9375rem;
  font-weight:500;
}

#settingsModal .bm-settings-row__title,
#settingsModal .bm-settings-session-item__title{
  font-weight:600;
}

#settingsModal .bm-settings-inline-note,
#settingsModal .bm-settings-session-item__meta,
#settingsModal .bm-settings-session-meta-item__value{
  font-size:.85rem;
}

.bm-login-subtitle,
.bm-auth-alert,
.bm-login-turnstile-status{
  font-size:.875rem;
}

.bm-login-label,
.bm-auth-logo-word{
  font-size:.875rem;
}

@media (max-width: 767.98px){
  html{
    font-size:15px;
  }

  body,
  button,
  input,
  optgroup,
  select,
  textarea{
    font-size:14px;
  }
}


/* ==========================================================================
   BioMaint CMMS – System Console
   Added for Pages/App/System/System.cshtml
   ========================================================================== */
.bm-system-shell{
  min-height:calc(100dvh - var(--subhdr-h) - 2rem);
}
.bm-system-panel{
  min-height:460px;
}
.bm-system-nav-btn,
.bm-system-billing-nav,
.bm-system-action-btn,
.bm-system-pager-btn,
.bm-system-page-current{
  min-height:36px;
  border-radius:12px;
}
.bm-system-kpi-grid{
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
}
.bm-system-kpi-card{
  position:relative;
  overflow:hidden;
}
.bm-system-kpi-card::after{
  content:"";
  position:absolute;
  inset:auto -18% -34% auto;
  width:140px;
  height:140px;
  border-radius:999px;
  background:radial-gradient(circle, color-mix(in srgb, var(--brand) 16%, transparent) 0%, transparent 72%);
  pointer-events:none;
}
.bm-system-summary-card .card-body,
.bm-system-feed-card .card-body{
  min-height:100%;
}
.bm-system-status-chip{
  display:inline-flex;
  align-items:center;
  gap:.45rem;
  padding:.35rem .7rem;
  border-radius:999px;
  background:color-mix(in srgb, var(--brand) 12%, var(--surface));
  color:var(--brand);
  border:1px solid color-mix(in srgb, var(--brand) 30%, var(--border));
  font-weight:700;
  font-size:.78rem;
  white-space:nowrap;
}
.bm-system-summary-box{
  height:100%;
  border:1px solid var(--border);
  border-radius:var(--radius-soft);
  background:color-mix(in srgb, var(--card) 94%, var(--surface-2));
  padding:1rem;
}
.bm-system-summary-stat{
  font-size:1.35rem;
  font-weight:800;
  line-height:1.2;
}
.bm-system-progress-list{
  display:flex;
  flex-direction:column;
  gap:.55rem;
}
.bm-system-progress-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  font-size:.9rem;
}
.bm-system-progress-row span{
  color:var(--muted);
}
.bm-system-progress-row strong{
  color:var(--text);
  font-weight:700;
}
.bm-system-note-card{
  border:1px solid var(--border);
  border-radius:var(--radius-soft);
  background:color-mix(in srgb, var(--card) 92%, var(--surface-2));
  padding:.95rem 1rem;
}
.bm-system-list{
  display:flex;
  flex-direction:column;
}
.bm-system-list-item{
  padding:1rem;
  border-bottom:1px solid var(--hairline);
}
.bm-system-list-item:last-child{
  border-bottom:0;
}
.bm-system-toolbar .form-label,
.bm-system-detail-body .form-label{
  font-size:.8rem;
}
.bm-inline-link-btn{
  --bs-btn-padding-x:0;
  --bs-btn-padding-y:0;
  color:var(--brand);
  text-decoration:none;
}
.bm-inline-link-btn:hover,
.bm-inline-link-btn:focus-visible{
  color:var(--brand-600);
}
.bm-system-table-wrap{
  overflow-x:auto;
  overscroll-behavior-x:contain;
}
.bm-system-table{
  width:100%;
  min-width:1160px;
  table-layout:fixed;
}
.bm-system-table > :not(caption)>*>*{
  vertical-align:top;
}
.bm-system-table td,
.bm-system-table th{
  padding-top:.8rem;
  padding-bottom:.8rem;
}
.bm-system-col-tenant{ width:220px; }
.bm-system-col-owner{ width:180px; }
.bm-system-col-plan{ width:210px; }
.bm-system-col-status{ width:150px; }
.bm-system-col-users{ width:150px; }
.bm-system-col-payment{ width:170px; }
.bm-system-col-subscription{ width:210px; }
.bm-system-col-created{ width:150px; }
.bm-system-col-money{ width:130px; }
.bm-system-col-actions{ width:96px; }
.bm-system-link{
  color:var(--text);
  text-decoration:none;
}
.bm-system-link:hover,
.bm-system-link:focus-visible{
  color:var(--brand);
}
.bm-system-action-btn{
  width:36px;
  height:36px;
  padding:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.bm-system-page-current,
.bm-system-page-current:hover,
.bm-system-page-current:focus-visible,
.bm-system-page-current:disabled{
  background:color-mix(in srgb, var(--brand) 18%, var(--surface));
  border-color:color-mix(in srgb, var(--border) 75%, var(--brand));
  color:var(--brand);
  opacity:1;
}
.bm-system-footer{
  gap:.75rem 1rem;
}
.bm-system-modal-dialog{
  --bs-modal-width:920px;
}
.bm-system-detail-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:.85rem;
}
.bm-system-detail-item{
  border:1px solid var(--border);
  border-radius:var(--radius-soft);
  background:color-mix(in srgb, var(--card) 94%, var(--surface-2));
  padding:.9rem 1rem;
  min-width:0;
}
.bm-system-detail-label{
  font-size:.78rem;
  color:var(--muted);
  text-transform:uppercase;
  letter-spacing:.05em;
  margin-bottom:.35rem;
}
.bm-system-detail-value{
  font-size:.95rem;
  font-weight:600;
  overflow-wrap:anywhere;
}
.bm-system-loading{
  position:relative;
}
.bm-system-loading::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(90deg, transparent, color-mix(in srgb, #fff 10%, transparent), transparent);
  animation:bmSystemLoading 1.1s linear infinite;
  pointer-events:none;
}
@keyframes bmSystemLoading{
  from{ transform:translateX(-100%); }
  to{ transform:translateX(100%); }
}
@media (max-width: 1399.98px){
  .bm-system-table{ min-width:1080px; }
  .bm-system-col-tenant{ width:200px; }
  .bm-system-col-owner{ width:160px; }
  .bm-system-col-plan{ width:180px; }
}
@media (max-width: 1199.98px){
  .bm-system-table{ min-width:960px; table-layout:auto; }
}
@media (max-width: 767.98px){
  .bm-system-kpi-grid{ grid-template-columns:1fr; }
  .bm-system-detail-grid{ grid-template-columns:1fr; }
  .bm-system-summary-box,
  .bm-system-note-card,
  .bm-system-detail-item{
    padding:.85rem .9rem;
  }
  .bm-system-status-chip{
    align-self:flex-start;
  }
}


/* ==========================================================================
   BioMaint CMMS – System Overview premium shell
   ========================================================================== */
.bm-system-overview-hero{
  position:relative;
  overflow:hidden;
  border:1px solid color-mix(in srgb, var(--border) 82%, transparent);
  border-radius:1.35rem;
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--card) 90%, var(--surface-2)) 0%,
      color-mix(in srgb, var(--card) 96%, var(--surface)) 48%,
      color-mix(in srgb, var(--card) 88%, var(--surface-2)) 100%);
  box-shadow:var(--shadow-md);
}
.bm-system-overview-hero__glow{
  position:absolute;
  inset:-18% auto auto -6%;
  width:420px;
  height:420px;
  border-radius:999px;
  pointer-events:none;
  background:radial-gradient(circle,
    color-mix(in srgb, var(--brand) 18%, transparent) 0%,
    color-mix(in srgb, var(--brand) 8%, transparent) 34%,
    transparent 72%);
  filter:blur(8px);
  opacity:.95;
}
.bm-system-overview-hero__content,
.bm-system-overview-sidecard{
  position:relative;
  z-index:1;
}
.bm-system-overview-hero__content{
  padding:1.35rem 1.35rem 1.15rem;
}
.bm-system-overview-sidecard{
  display:flex;
  flex-direction:column;
  min-height:100%;
  border-left:1px solid color-mix(in srgb, var(--border) 76%, transparent);
  background:color-mix(in srgb, var(--card) 80%, transparent);
}
.bm-system-overview-sidecard__header,
.bm-system-overview-sidecard__body,
.bm-system-overview-sidecard__footer{
  padding:1.1rem 1.2rem;
}
.bm-system-overview-sidecard__body{
  display:flex;
  flex-direction:column;
  gap:.75rem;
  flex:1 1 auto;
}
.bm-system-overview-sidecard__footer{
  border-top:1px solid var(--hairline);
}
.bm-system-eyebrow{
  font-size:.76rem;
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--brand);
}
.bm-system-overview-title{
  font-size:clamp(1.5rem, 2.6vw, 2.25rem);
  line-height:1.12;
  letter-spacing:-.02em;
}
.bm-system-overview-copy{
  max-width:62ch;
  color:var(--muted);
  line-height:1.65;
}
.bm-system-health-chip{
  display:inline-flex;
  align-items:center;
  gap:.6rem;
  min-height:44px;
  padding:.7rem 1rem;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--brand) 36%, var(--border));
  background:color-mix(in srgb, var(--brand) 12%, var(--surface));
  box-shadow:0 12px 24px color-mix(in srgb, var(--brand) 10%, transparent);
}
.bm-system-health-chip__dot{
  width:.68rem;
  height:.68rem;
  border-radius:999px;
  background:var(--brand);
  box-shadow:0 0 0 .24rem color-mix(in srgb, var(--brand) 18%, transparent);
  animation:bmSystemPulse 2.2s ease-in-out infinite;
}
.bm-system-health-chip__label{
  font-weight:800;
  color:var(--brand);
}
@keyframes bmSystemPulse{
  0%, 100%{ transform:scale(1); opacity:1; }
  50%{ transform:scale(1.08); opacity:.82; }
}
.bm-system-overview-kpi-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:1rem;
}
.bm-system-overview-kpi-card{
  position:relative;
  overflow:hidden;
  min-height:100%;
  padding:1rem 1rem .95rem;
  border-radius:1rem;
  border:1px solid color-mix(in srgb, var(--border) 80%, transparent);
  background:linear-gradient(180deg,
    color-mix(in srgb, var(--card) 98%, var(--surface-2)) 0%,
    color-mix(in srgb, var(--card) 94%, var(--surface)) 100%);
  box-shadow:var(--shadow-sm);
  transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.bm-system-overview-kpi-card:hover{
  transform:translateY(-2px);
  box-shadow:var(--shadow-md);
  border-color:color-mix(in srgb, var(--brand) 28%, var(--border));
}
.bm-system-overview-kpi-card::after{
  content:"";
  position:absolute;
  right:-26px;
  bottom:-32px;
  width:120px;
  height:120px;
  border-radius:999px;
  background:radial-gradient(circle,
    color-mix(in srgb, var(--brand) 16%, transparent) 0%,
    transparent 72%);
  pointer-events:none;
}
.bm-system-overview-kpi-card__icon{
  width:42px;
  height:42px;
  border-radius:12px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:color-mix(in srgb, var(--brand) 12%, var(--surface));
  color:var(--brand);
  font-size:1.1rem;
}
.bm-system-overview-kpi-card__label{
  font-size:.8rem;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--muted);
}
.bm-system-overview-kpi-card__value{
  font-size:1.95rem;
  font-weight:800;
  line-height:1.1;
  letter-spacing:-.03em;
}
.bm-system-overview-kpi-card__sub{
  color:var(--muted);
  line-height:1.45;
}
.bm-system-mini-stat{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  padding:.85rem 1rem;
  border-radius:.95rem;
  border:1px solid color-mix(in srgb, var(--border) 82%, transparent);
  background:color-mix(in srgb, var(--card) 94%, var(--surface-2));
}
.bm-system-mini-stat__label{
  color:var(--muted);
  font-size:.88rem;
}
.bm-system-mini-stat__value{
  font-size:1.15rem;
  font-weight:800;
  letter-spacing:-.02em;
}
.bm-system-insight-card .card-header,
.bm-system-activity-card .card-header{
  background:color-mix(in srgb, var(--surface-3) 72%, var(--surface-2));
}
.bm-system-insight-value{
  font-size:1.55rem;
  font-weight:800;
  line-height:1.15;
  letter-spacing:-.02em;
}
.bm-system-progress-group{
  display:flex;
  flex-direction:column;
  gap:.45rem;
}
.bm-system-progress{
  position:relative;
  height:.62rem;
  border-radius:999px;
  background:color-mix(in srgb, var(--surface-2) 85%, var(--border));
  overflow:hidden;
}
.bm-system-progress__bar{
  display:block;
  width:0;
  height:100%;
  border-radius:999px;
  background:linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #ffffff));
  transition:width .6s ease;
}
.bm-system-progress--warning .bm-system-progress__bar{
  background:linear-gradient(90deg, #f59e0b, #fbbf24);
}
.bm-system-progress--danger .bm-system-progress__bar{
  background:linear-gradient(90deg, #ef4444, #f87171);
}
.bm-system-chip-stat-grid,
.bm-system-progress-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:.75rem;
}
.bm-system-chip-stat{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.75rem;
  padding:.8rem .9rem;
  border-radius:.95rem;
  border:1px solid color-mix(in srgb, var(--border) 82%, transparent);
  background:color-mix(in srgb, var(--card) 94%, var(--surface-2));
}
.bm-system-chip-stat span{
  font-size:.82rem;
  color:var(--muted);
}
.bm-system-chip-stat strong{
  font-size:1rem;
  font-weight:800;
}
.bm-system-activity-list{
  display:flex;
  flex-direction:column;
}
.bm-system-activity-item{
  padding:1rem 1.05rem;
  border-bottom:1px solid var(--hairline);
}
.bm-system-activity-item:last-child{
  border-bottom:0;
}
.bm-system-activity-item__top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
}
.bm-system-activity-item__amount{
  font-weight:800;
  white-space:nowrap;
}
html[data-bs-theme="light"] .bm-system-overview-hero{
  background:
    linear-gradient(135deg,
      color-mix(in srgb, #ffffff 88%, #edf7f3) 0%,
      color-mix(in srgb, #ffffff 94%, #f8fafc) 52%,
      color-mix(in srgb, #ffffff 88%, #eef6f2) 100%);
}
html[data-bs-theme="light"] .bm-system-overview-sidecard{
  background:color-mix(in srgb, #ffffff 76%, transparent);
}
html[data-bs-theme="light"] .bm-system-overview-kpi-card{
  background:linear-gradient(180deg,
    color-mix(in srgb, #ffffff 96%, #f5faf7) 0%,
    color-mix(in srgb, #ffffff 98%, #fafafa) 100%);
}
@media (max-width: 1399.98px){
  .bm-system-overview-sidecard{
    border-left:0;
    border-top:1px solid color-mix(in srgb, var(--border) 76%, transparent);
  }
}
@media (max-width: 767.98px){
  .bm-system-overview-hero__content,
  .bm-system-overview-sidecard__header,
  .bm-system-overview-sidecard__body,
  .bm-system-overview-sidecard__footer{
    padding:1rem;
  }
  .bm-system-overview-kpi-grid,
  .bm-system-progress-grid,
  .bm-system-chip-stat-grid{
    grid-template-columns:1fr;
  }
  .bm-system-overview-title{
    font-size:1.45rem;
  }
  .bm-system-health-chip{
    width:100%;
    justify-content:flex-start;
  }
  .bm-system-activity-item__top{
    flex-direction:column;
    gap:.35rem;
  }
}

.bm-system-overview-hero__glow--two{
  inset:auto -8% -28% auto;
  width:360px;
  height:360px;
  background:radial-gradient(circle,
    color-mix(in srgb, #f59e0b 12%, transparent) 0%,
    color-mix(in srgb, var(--brand) 6%, transparent) 36%,
    transparent 74%);
}
.bm-system-health-chip__sub{
  color:var(--muted);
  line-height:1.45;
}
.bm-system-overview-kpi-card__value--money{
  font-size:1.6rem;
}

/* ============================ BILLING PLANS PAGE ============================ */
.bm-billing-plans-title{
  max-width:38rem;
  margin-inline:auto;
  font-size:clamp(1.8rem, 3vw, 2.45rem);
  line-height:1.06;
  font-weight:800;
  letter-spacing:-.03em;
}

.bm-billing-plans-subtitle{
  max-width:42rem;
  font-size:.98rem;
  line-height:1.6;
}

.bm-billing-plan-current-card{
  overflow:hidden;
}

.bm-billing-plan-current-stats{
  min-width:min(100%, 32rem);
}

.bm-billing-plans-switch{
  display:inline-flex;
  align-items:center;
  gap:.35rem;
  padding:.35rem;
  border:1px solid var(--border);
  border-radius:999px;
  background:color-mix(in srgb, var(--surface-2) 84%, var(--card));
  box-shadow:var(--shadow-sm);
}

.bm-billing-plans-switch-btn{
  border:0;
  min-height:2.5rem;
  padding:.55rem 1.1rem;
  border-radius:999px;
  background:transparent;
  color:var(--muted);
  font-weight:700;
  line-height:1.2;
  transition:background-color .16s ease, color .16s ease, box-shadow .16s ease;
}

.bm-billing-plans-switch-btn:hover,
.bm-billing-plans-switch-btn:focus,
.bm-billing-plans-switch-btn:focus-visible{
  outline:none;
  color:var(--text);
  background:color-mix(in srgb, var(--brand) 7%, var(--surface));
  box-shadow:none;
}

.bm-billing-plans-switch-btn.is-active{
  color:var(--text);
  background:color-mix(in srgb, var(--surface) 88%, var(--surface-3));
  box-shadow:var(--shadow-sm);
}

.bm-billing-plans-status{
  max-width:42rem;
  margin-inline:auto;
}

.bm-billing-plan-card{
  border-radius:1.2rem;
  overflow:hidden;
  transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.bm-billing-plan-card:hover{
  transform:translateY(-1px);
}

.bm-billing-plan-card--featured{
  border-color:color-mix(in srgb, var(--brand) 34%, var(--border));
  box-shadow:0 20px 44px color-mix(in srgb, var(--brand) 12%, transparent);
}

.bm-billing-plan-card--current{
  border-color:color-mix(in srgb, var(--brand) 32%, var(--border));
  background:color-mix(in srgb, var(--brand) 4%, var(--card));
}

.bm-billing-plan-icon{
  width:3rem;
  height:3rem;
  border-radius:1rem;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:color-mix(in srgb, var(--brand) 14%, transparent);
  color:var(--brand);
  font-size:1.2rem;
}

.bm-billing-plan-title{
  font-size:1.65rem;
  line-height:1.08;
  font-weight:800;
  letter-spacing:-.02em;
}

.bm-billing-plan-tagline{
  min-height:2.8rem;
  font-size:.96rem;
  line-height:1.45;
}

.bm-billing-plan-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:.3rem .72rem;
  border-radius:999px;
  background:color-mix(in srgb, var(--brand) 10%, var(--surface));
  border:1px solid color-mix(in srgb, var(--brand) 20%, var(--border));
  color:var(--brand);
  font-size:.74rem;
  font-weight:800;
  white-space:nowrap;
}

.bm-billing-plan-old-price{
  min-height:1.25rem;
  display:flex;
  align-items:center;
  gap:.1rem;
  color:var(--muted);
  font-size:.9rem;
  text-decoration:line-through;
}

.bm-billing-plan-old-price-symbol,
.bm-billing-plan-old-price-amount{
  line-height:1;
}

.bm-billing-plan-price{
  display:flex;
  align-items:flex-end;
  gap:.16rem;
  flex-wrap:wrap;
}

.bm-billing-plan-price-symbol{
  font-size:1.5rem;
  line-height:1.1;
  font-weight:700;
}

.bm-billing-plan-price-amount{
  font-size:3.1rem;
  line-height:.94;
  font-weight:800;
  letter-spacing:-.04em;
}

.bm-billing-plan-price-unit{
  font-size:1rem;
  line-height:1.35;
  color:var(--muted);
  font-weight:600;
  margin-bottom:.22rem;
}

.bm-billing-plan-copy{
  font-size:.96rem;
  line-height:1.58;
  color:var(--muted);
  min-height:4.6rem;
}

.bm-billing-plan-meta{
  display:flex;
  flex-wrap:wrap;
  gap:.5rem;
}

.bm-billing-plan-meta-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:1.85rem;
  padding:.26rem .72rem;
  border-radius:999px;
  border:1px solid var(--border);
  background:color-mix(in srgb, var(--surface-2) 84%, var(--surface));
  color:var(--text);
  font-size:.77rem;
  font-weight:700;
  white-space:nowrap;
}

.bm-billing-plan-feature-list{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:.7rem;
}

.bm-billing-plan-feature-list li{
  position:relative;
  padding-left:1.45rem;
  line-height:1.45;
  color:var(--text);
}

.bm-billing-plan-feature-list li::before{
  content:"\F26E";
  font-family:"bootstrap-icons";
  position:absolute;
  left:0;
  top:.05rem;
  color:var(--brand);
  font-size:.95rem;
}

.bm-billing-plan-cta{
  min-height:3rem;
  border-radius:1rem;
}

.bm-billing-plan-cta[disabled],
.bm-billing-plan-cta:disabled{
  opacity:1;
  cursor:not-allowed;
}

.bm-billing-plan-helper{
  min-height:2.1rem;
  line-height:1.45;
}

html[data-bs-theme="light"] .bm-billing-plan-card--current{
  background:color-mix(in srgb, var(--brand) 6%, #fff);
}

html[data-bs-theme="light"] .bm-billing-plans-switch-btn.is-active{
  background:#fff;
}

html[data-bs-theme="dark"] .bm-billing-plan-card--featured{
  box-shadow:0 24px 54px rgba(0,0,0,.24), 0 0 0 1px color-mix(in srgb, var(--brand) 18%, transparent);
}

html[data-bs-theme="dark"] .bm-billing-plans-switch-btn.is-active{
  background:color-mix(in srgb, var(--surface-3) 86%, var(--surface));
}

@media (max-width: 1199.98px){
  .bm-billing-plan-price-amount{
    font-size:2.8rem;
  }

  .bm-billing-plan-copy{
    min-height:5rem;
  }
}

@media (max-width: 991.98px){
  .bm-billing-plan-current-stats{
    min-width:0;
  }
}

@media (max-width: 767.98px){
  .bm-billing-plans-switch{
    width:100%;
    justify-content:stretch;
  }

  .bm-billing-plans-switch-btn{
    flex:1 1 0;
    padding-inline:.85rem;
  }

  .bm-billing-plan-tagline,
  .bm-billing-plan-copy,
  .bm-billing-plan-helper{
    min-height:0;
  }

  .bm-billing-plan-price-amount{
    font-size:2.5rem;
  }
}

@media (max-width: 575.98px){
  .bm-billing-plans-title{
    font-size:1.65rem;
  }

  .bm-billing-plan-card .card-body{
    padding:1.1rem;
  }

  .bm-billing-plan-title{
    font-size:1.45rem;
  }
}

/* ============================ BILLING CHECKOUT PAGE ============================ */
.bm-billing-checkout-shell{
  max-width:72rem;
  margin-inline:auto;
}

.bm-billing-checkout-section{
  min-height:100%;
}

.bm-billing-checkout-plan-card,
.bm-billing-checkout-billing-card,
.bm-billing-checkout-summary-card,
.bm-billing-checkout-note-card,
.bm-billing-checkout-method-card,
.bm-billing-checkout-action-card{
  border-radius:1.2rem;
  overflow:hidden;
}

.bm-billing-checkout-plan-card{
  border-color:color-mix(in srgb, var(--brand) 22%, var(--border));
}

.bm-billing-checkout-interval-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:1rem;
}

.bm-billing-checkout-interval-card{
  position:relative;
  display:flex;
  flex-direction:column;
  gap:.35rem;
  min-height:9rem;
  padding:1.2rem 1.2rem 1.15rem;
  border:1px solid var(--border);
  border-radius:1rem;
  background:color-mix(in srgb, var(--surface-2) 86%, var(--card));
  color:var(--text);
  text-decoration:none;
  box-shadow:var(--shadow-sm);
  transition:border-color .18s ease, box-shadow .18s ease, transform .18s ease, background-color .18s ease;
}

.bm-billing-checkout-interval-card:hover,
.bm-billing-checkout-interval-card:focus,
.bm-billing-checkout-interval-card:focus-visible{
  color:var(--text);
  transform:translateY(-1px);
  border-color:color-mix(in srgb, var(--brand) 26%, var(--border));
  box-shadow:var(--elev);
  outline:none;
}

.bm-billing-checkout-interval-card.is-selected{
  border-color:color-mix(in srgb, var(--brand) 42%, var(--border));
  background:color-mix(in srgb, var(--brand) 8%, var(--card));
  box-shadow:0 16px 34px color-mix(in srgb, var(--brand) 10%, transparent);
}

.bm-billing-checkout-interval-card__radio{
  width:1.7rem;
  height:1.7rem;
  border-radius:999px;
  border:1.8px solid color-mix(in srgb, var(--muted) 72%, var(--border));
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-bottom:.2rem;
}

.bm-billing-checkout-interval-card__radio::after{
  content:"";
  width:.78rem;
  height:.78rem;
  border-radius:999px;
  background:transparent;
  transition:background-color .18s ease;
}

.bm-billing-checkout-interval-card.is-selected .bm-billing-checkout-interval-card__radio{
  border-color:var(--brand);
}

.bm-billing-checkout-interval-card.is-selected .bm-billing-checkout-interval-card__radio::after{
  background:var(--brand);
}

.bm-billing-checkout-interval-card__label{
  font-size:1.05rem;
  line-height:1.2;
  font-weight:800;
}

.bm-billing-checkout-interval-card__price{
  font-size:1.45rem;
  line-height:1.1;
  font-weight:800;
  letter-spacing:-.02em;
}

.bm-billing-checkout-interval-card__sub{
  color:var(--muted);
  line-height:1.45;
  font-size:.92rem;
  max-width:16rem;
}

.bm-billing-checkout-interval-card__chip{
  position:absolute;
  top:1rem;
  right:1rem;
}

.bm-billing-checkout-highlights{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:.85rem;
}

.bm-billing-checkout-highlights li{
  position:relative;
  padding-left:1.55rem;
  line-height:1.45;
}

.bm-billing-checkout-highlights li::before{
  content:"\F26E";
  font-family:"bootstrap-icons";
  position:absolute;
  left:0;
  top:.08rem;
  color:var(--brand);
}

.bm-billing-summary-list{
  display:flex;
  flex-direction:column;
  gap:0;
}

.bm-billing-summary-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
  padding:.85rem 0;
}

.bm-billing-summary-row--divider{
  border-top:1px solid var(--hairline);
  margin-top:.2rem;
}

.bm-billing-summary-row--total{
  border-top:1px solid var(--hairline);
  margin-top:.2rem;
  padding-top:1rem;
}

.bm-billing-checkout-note-copy,
.bm-billing-checkout-payment-copy{
  line-height:1.7;
  color:var(--text);
}

.bm-billing-checkout-method-badges{
  display:flex;
  flex-wrap:wrap;
  gap:.65rem;
}

.bm-billing-checkout-method-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:2.25rem;
  padding:.4rem .85rem;
  border:1px solid var(--border);
  border-radius:.8rem;
  background:color-mix(in srgb, var(--surface-2) 84%, var(--surface));
  font-weight:700;
  white-space:nowrap;
}

.bm-billing-checkout-terms .form-check-label{
  line-height:1.65;
}

.bm-billing-checkout-submit{
  min-height:3.3rem;
  border-radius:1rem;
}

.bm-billing-checkout-security-note{
  line-height:1.65;
  font-size:.92rem;
}

.bm-billing-checkout-opening-card{
  max-width:34rem;
}

.bm-billing-checkout-status{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:.6rem;
  padding:.85rem 1rem;
  border:1px solid var(--border);
  border-radius:1rem;
  background:color-mix(in srgb, var(--surface-2) 84%, var(--surface));
  color:var(--text);
  font-weight:700;
  line-height:1.45;
  text-align:center;
}

.bm-billing-checkout-status.is-info{
  border-color:color-mix(in srgb, var(--brand) 24%, var(--border));
  background:color-mix(in srgb, var(--brand) 7%, var(--surface));
}

.bm-billing-checkout-status.is-success{
  border-color:color-mix(in srgb, var(--success) 26%, var(--border));
  background:color-mix(in srgb, var(--success) 8%, var(--surface));
}

.bm-billing-checkout-status.is-warning{
  border-color:color-mix(in srgb, var(--warning) 32%, var(--border));
  background:color-mix(in srgb, var(--warning) 12%, var(--surface));
}

.bm-billing-checkout-status.is-danger{
  border-color:color-mix(in srgb, var(--danger) 30%, var(--border));
  background:color-mix(in srgb, var(--danger) 10%, var(--surface));
}

.bm-billing-payment-success-alert{
  border-color:color-mix(in srgb, var(--success) 28%, var(--border));
}

html[data-bs-theme="light"] .bm-billing-checkout-interval-card.is-selected{
  background:color-mix(in srgb, var(--brand) 7%, #ffffff);
}

@media (max-width: 991.98px){
  .bm-billing-checkout-shell{
    max-width:none;
  }
}

@media (max-width: 767.98px){
  .bm-billing-checkout-interval-grid{
    grid-template-columns:1fr;
  }

  .bm-billing-summary-row{
    gap:.75rem;
  }
}

@media (max-width: 575.98px){
  .bm-billing-checkout-plan-card .card-body,
  .bm-billing-checkout-billing-card .card-body,
  .bm-billing-checkout-summary-card .card-body,
  .bm-billing-checkout-note-card .card-body,
  .bm-billing-checkout-method-card .card-body,
  .bm-billing-checkout-action-card .card-body{
    padding:1.1rem;
  }

  .bm-billing-checkout-interval-card{
    min-height:8.4rem;
    padding:1rem;
  }

  .bm-billing-checkout-interval-card__price{
    font-size:1.3rem;
  }
}


/* =========================== BILLING OVERVIEW PAGE ========================== */
.bm-billing-subhdr{
  width:100%;
  padding:.78rem 1rem .7rem;
}

.bm-billing-subhdr__inner{
  width:min(100%, 1080px);
  max-width:1080px;
  margin-inline:0;
  display:flex;
  align-items:flex-start;
  justify-content:flex-start;
  gap:1rem;
}

.bm-billing-subhdr__copy{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:.2rem;
}

.bm-billing-page-shell{
  position:relative;
  width:min(100%, 1080px);
  max-width:1080px;
  margin-inline:0;
  padding-inline:1rem;
}

.bm-billing-page-main{
  width:100%;
  max-width:none;
  margin-inline:0;
}

.bm-billing-page-history{
  width:100%;
  max-width:none;
  margin-inline:0;
}

.bm-billing-stack{
  display:flex;
  flex-direction:column;
  gap:1.1rem;
}

.bm-billing-hero,
.bm-billing-profile-card,
.bm-billing-history-card{
  overflow:hidden;
}

.bm-billing-hero{
  position:relative;
  border-color:color-mix(in srgb, var(--brand) 20%, var(--border));
  background:linear-gradient(180deg,
    color-mix(in srgb, var(--card) 98%, var(--brand) 2%) 0%,
    color-mix(in srgb, var(--card) 99%, var(--surface-2) 1%) 100%);
}

.bm-billing-hero::before,
.bm-billing-hero::after{
  content:"";
  position:absolute;
  pointer-events:none;
  border-radius:999px;
}

.bm-billing-hero::before{
  inset:-22% auto auto -10%;
  width:260px;
  height:260px;
  background:radial-gradient(circle,
    color-mix(in srgb, var(--brand) 9%, transparent) 0%,
    color-mix(in srgb, var(--brand) 3%, transparent) 44%,
    transparent 74%);
}

.bm-billing-hero::after{
  inset:auto -12% -38% auto;
  width:280px;
  height:280px;
  background:radial-gradient(circle,
    color-mix(in srgb, var(--warning) 7%, transparent) 0%,
    color-mix(in srgb, var(--brand) 3%, transparent) 36%,
    transparent 74%);
}

.bm-billing-hero .card-body,
.bm-billing-profile-card .card-body{
  position:relative;
  z-index:1;
}

.bm-billing-hero__plan{
  font-size:clamp(1.6rem, 2vw, 1.95rem);
  font-weight:800;
  line-height:1.08;
  letter-spacing:-.02em;
}

.bm-billing-hero__limits{
  font-size:.96rem;
  line-height:1.45;
}

.bm-billing-eyebrow{
  font-size:.72rem;
  font-weight:800;
  letter-spacing:.08em;
}

.bm-billing-subtle-meta{
  min-width:min(100%, 14rem);
  padding:.15rem 0;
}

.bm-billing-hero__aside{
  min-width:min(100%, 15rem);
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:.8rem;
}

.bm-billing-section-head{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:space-between;
  gap:.95rem;
  padding-bottom:1rem;
  margin-bottom:1rem !important;
  border-bottom:1px solid var(--hairline);
}

.bm-billing-section-head__meta{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:.5rem;
  width:100%;
}

.bm-billing-section-actions{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:.6rem;
  flex-wrap:wrap;
}

.bm-billing-lastupdated{
  line-height:1.4;
  font-size:.84rem;
}

.bm-billing-stat-grid{
  align-items:stretch;
}

.bm-billing-stat{
  height:100%;
  padding:1rem 1rem .95rem;
  border:1px solid color-mix(in srgb, var(--border) 90%, transparent);
  border-radius:1rem;
  background:color-mix(in srgb, var(--surface) 72%, transparent);
  box-shadow:none;
}

.bm-billing-stat__label{
  margin-bottom:.4rem;
  color:var(--muted);
  font-size:.74rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.05em;
}

.bm-billing-stat__value{
  font-size:1.18rem;
  font-weight:800;
  line-height:1.2;
  color:var(--text);
}

.bm-billing-stat__sub{
  margin-top:.35rem;
  color:var(--muted);
  font-size:.88rem;
  line-height:1.45;
}

.bm-billing-status{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:1.7rem;
  padding:.24rem .65rem;
  border-radius:999px;
  border:1px solid var(--border);
  background:color-mix(in srgb, var(--surface-2) 85%, var(--surface));
  color:var(--text);
  font-size:.76rem;
  font-weight:800;
  line-height:1.15;
  white-space:nowrap;
}

.bm-billing-status--success{
  background:color-mix(in srgb, var(--success) 14%, var(--surface));
  border-color:color-mix(in srgb, var(--success) 36%, var(--border));
}

.bm-billing-status--warning{
  background:color-mix(in srgb, var(--warning) 18%, var(--surface));
  border-color:color-mix(in srgb, var(--warning) 38%, var(--border));
}

.bm-billing-status--danger{
  background:color-mix(in srgb, var(--danger) 14%, var(--surface));
  border-color:color-mix(in srgb, var(--danger) 36%, var(--border));
}

.bm-billing-status--info{
  background:color-mix(in srgb, var(--info) 14%, var(--surface));
  border-color:color-mix(in srgb, var(--info) 34%, var(--border));
}

.bm-billing-status--neutral{
  background:color-mix(in srgb, var(--surface-2) 78%, var(--surface));
  border-color:color-mix(in srgb, var(--border) 88%, transparent);
  color:var(--muted);
}

.bm-billing-profile-card{
  border-color:color-mix(in srgb, var(--border) 90%, transparent);
}

.bm-billing-profile-grid--single{
  width:100%;
}

.bm-billing-profile-grid{
  align-items:stretch;
}

.bm-billing-detail-list{
  margin:0;
}

.bm-billing-detail-list dt,
.bm-billing-detail-list dd{
  margin:0;
  padding:.74rem 0;
  border-bottom:1px solid var(--hairline);
}

.bm-billing-detail-list dt{
  color:var(--muted);
  font-size:.79rem;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.045em;
}

.bm-billing-detail-list dd{
  color:var(--text);
  font-weight:600;
  line-height:1.45;
}

.bm-billing-detail-list > :nth-last-child(-n+2){
  border-bottom:0;
}

.bm-preline{
  white-space:pre-line;
}

.bm-billing-side-block{
  display:flex;
  flex-direction:column;
  gap:.95rem;
  min-height:100%;
  padding:1rem 1rem 1.05rem;
  border:1px solid color-mix(in srgb, var(--brand) 20%, var(--border));
  border-radius:1rem;
  background:color-mix(in srgb, var(--brand) 6%, var(--surface));
}

.bm-billing-payment-meta{
  display:flex;
  flex-direction:column;
  gap:.35rem;
}

.bm-billing-side-note{
  margin-top:auto;
  padding-top:.95rem;
  border-top:1px solid color-mix(in srgb, var(--border) 84%, transparent);
  color:var(--muted);
  font-size:.85rem;
  line-height:1.5;
}

.bm-billing-alert{
  margin-bottom:0;
  padding:.95rem 1.05rem;
  border-radius:1rem;
  border:1px solid color-mix(in srgb, var(--border) 84%, transparent);
  background:color-mix(in srgb, var(--surface-2) 88%, var(--surface));
  color:var(--text);
  box-shadow:none;
}

.bm-billing-alert__title{
  margin-bottom:.2rem;
  font-size:1rem;
  line-height:1.35;
}

.bm-billing-alert__message{
  line-height:1.55;
}

.bm-billing-alert--trial{
  border-color:color-mix(in srgb, #f59e0b 42%, var(--border));
  background:linear-gradient(180deg,
    color-mix(in srgb, #fff8df 92%, #fde68a) 0%,
    color-mix(in srgb, #fffdf6 96%, #fef3c7) 100%);
  color:#4b3a12;
  box-shadow:0 16px 34px rgba(217, 119, 6, .12);
}

.bm-billing-alert--trial .btn{
  border-color:color-mix(in srgb, #d97706 38%, rgba(75,58,18,.18));
  color:inherit;
  background:rgba(255,255,255,.42);
}

.bm-billing-alert--trial .btn:hover,
.bm-billing-alert--trial .btn:focus,
.bm-billing-alert--trial .btn:focus-visible{
  color:inherit;
  background:rgba(255,255,255,.62);
  border-color:color-mix(in srgb, #d97706 46%, rgba(75,58,18,.2));
  box-shadow:none;
}

.bm-billing-history-card{
  border-color:color-mix(in srgb, var(--border) 92%, transparent);
}

.bm-billing-history-card .card-body{
  overflow:hidden;
}

.bm-billing-history-card--attention{
  border-color:color-mix(in srgb, var(--warning) 32%, var(--border));
}

.bm-billing-history-head{
  background:color-mix(in srgb, var(--surface-2) 68%, transparent);
}

.bm-billing-history-table th,
.bm-billing-history-table td{
  vertical-align:top;
}

.bm-billing-history-table thead th{
  white-space:nowrap;
}

.bm-billing-history-table tbody td{
  padding-top:.82rem;
  padding-bottom:.82rem;
}

.bm-billing-history-table td .bm-billing-status{
  max-width:100%;
}

.bm-billing-hero:hover,
.bm-billing-profile-card:hover,
.bm-billing-history-card:hover{
  box-shadow:var(--shadow-sm);
}

/* ============================== BILLING MODAL ============================== */
#billingProfileModal .bm-billing-modal-dialog{
  --bs-modal-width: 920px;
  margin: 1.25rem auto;
}

#billingProfileModal .modal-content{
  position:relative;
}

#billingProfileModal .modal-header{
  padding-right: 2.75rem;
}

#billingProfileModal .bm-billing-modal-header{
  align-items:flex-start;
  gap:1rem;
}

#billingProfileModal .modal-body{
  padding:1rem;
}

.bm-billing-modal-shell{
  display:flex;
  flex-direction:column;
  gap:1rem;
}

.bm-billing-modal-section{
  display:flex;
  flex-direction:column;
  gap:.9rem;
  padding-bottom:1rem;
  border-bottom:1px solid var(--hairline);
}

.bm-billing-modal-section:last-of-type{
  padding-bottom:0;
  border-bottom:0;
}

.bm-billing-modal-section__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:1rem;
}

.bm-billing-modal-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:.75rem;
  padding-top:.25rem;
}

html[data-bs-theme="light"] .bm-billing-hero{
  background:linear-gradient(180deg,
    color-mix(in srgb, #ffffff 98%, #edf7f3) 0%,
    color-mix(in srgb, #ffffff 100%, #f8fafc) 100%);
}

html[data-bs-theme="light"] .bm-billing-stat{
  background:linear-gradient(180deg,
    color-mix(in srgb, #ffffff 99%, #f7faf8) 0%,
    color-mix(in srgb, #ffffff 100%, #ffffff) 100%);
}

html[data-bs-theme="light"] .bm-billing-history-head{
  background:color-mix(in srgb, #f8fafc 78%, #ffffff);
}

html[data-bs-theme="dark"] .bm-billing-alert--trial{
  border-color:color-mix(in srgb, #f59e0b 38%, var(--border));
  background:linear-gradient(180deg,
    color-mix(in srgb, #4d3a18 56%, var(--surface)) 0%,
    color-mix(in srgb, #3c2d13 52%, var(--surface-2)) 100%);
  color:color-mix(in srgb, #fff1cb 92%, var(--text));
  box-shadow:0 18px 36px rgba(0,0,0,.18);
}

html[data-bs-theme="dark"] .bm-billing-alert--trial .btn{
  background:color-mix(in srgb, rgba(255,255,255,.06) 72%, transparent);
  border-color:color-mix(in srgb, #f59e0b 28%, var(--border));
  color:color-mix(in srgb, #fff1cb 92%, var(--text));
}

html[data-bs-theme="dark"] .bm-billing-alert--trial .btn:hover,
html[data-bs-theme="dark"] .bm-billing-alert--trial .btn:focus,
html[data-bs-theme="dark"] .bm-billing-alert--trial .btn:focus-visible{
  background:color-mix(in srgb, rgba(255,255,255,.1) 78%, transparent);
  border-color:color-mix(in srgb, #f59e0b 34%, var(--border));
  color:#fff7e6;
}

@media (min-width: 992px){
  .bm-billing-hero__aside,
  .bm-billing-section-head__meta{
    align-items:flex-end;
  }

  .bm-billing-section-actions{
    justify-content:flex-end;
  }

  .bm-billing-lastupdated{
    text-align:right;
  }
}

@media (min-width: 1600px){
  .bm-billing-page-shell{
    width:min(100%, 1080px);
    max-width:1080px;
  }

  .bm-billing-page-history{
    width:100%;
    max-width:none;
  }
}

@media (max-width: 1199.98px){
  #billingProfileModal .bm-billing-modal-dialog{
    --bs-modal-width: 860px;
  }
}

@media (max-width: 991.98px){
  .bm-billing-subhdr{
    padding:.7rem .85rem;
  }

  .bm-billing-subhdr__inner,
  .bm-billing-page-main,
  .bm-billing-page-history{
    width:100%;
    max-width:none;
  }

  .bm-billing-subhdr__inner{
    flex-direction:column;
    align-items:stretch;
  }

  .bm-billing-subtle-meta,
  .bm-billing-hero__aside{
    min-width:0;
  }

  #billingProfileModal .bm-billing-modal-dialog{
    --bs-modal-width: 760px;
  }
}

@media (max-width: 767.98px){
  .bm-billing-page-shell{
    padding-inline:.75rem;
  }

  .bm-billing-stack{
    gap:.85rem;
  }

  .bm-billing-stat,
  .bm-billing-side-block{
    padding:.9rem;
  }

  .bm-billing-detail-list dt,
  .bm-billing-detail-list dd{
    padding:.7rem 0;
  }

  .bm-billing-alert{
    padding:.95rem 1rem;
  }

  .bm-billing-history-card .card-body > .p-4,
  .bm-billing-profile-card .card-body,
  .bm-billing-hero .card-body{
    padding:1rem !important;
  }

  #billingProfileModal .bm-billing-modal-dialog{
    --bs-modal-width: calc(100vw - 1.5rem);
    margin:.75rem auto;
  }

  #billingProfileModal .modal-body{
    padding:.9rem;
  }

  .bm-billing-modal-actions{
    flex-direction:column-reverse;
    align-items:stretch;
  }

  .bm-billing-modal-actions .btn{
    width:100%;
  }
}

@media (max-width: 575.98px){
  .bm-billing-detail-list dt{
    padding-bottom:.15rem;
    border-bottom:0;
  }

  .bm-billing-detail-list dd{
    padding-top:0;
  }

  .bm-billing-section-actions .btn{
    width:100%;
  }

  #billingProfileModal .bm-billing-modal-dialog{
    --bs-modal-width: calc(100vw - 1rem);
    margin:.5rem auto;
  }

  #billingProfileModal .modal-body{
    padding:.75rem;
  }
}


/* ============================== BILLING DOCUMENTS & MODAL LOADING ============================== */
.bm-billing-doc-actions{
  display:flex;
  flex-wrap:wrap;
  gap:.5rem;
}

.bm-billing-doc-btn{
  min-height:2.1rem;
  border-radius:.85rem;
  white-space:nowrap;
}

.bm-billing-doc-btn.is-busy{
  pointer-events:none;
  opacity:.92;
}

.bm-billing-modal-loading{
  display:flex;
  flex-direction:column;
  gap:1rem;
}

.bm-billing-modal-skeleton{
  display:flex;
  flex-direction:column;
  gap:.9rem;
}

.bm-billing-modal-skeleton__title,
.bm-billing-modal-skeleton__field{
  display:block;
  border-radius:.85rem;
}

.bm-billing-modal-skeleton__title{
  min-height:.85rem;
}

.bm-billing-modal-skeleton__field{
  min-height:2.9rem;
}

#billingProfileModalLoading .placeholder{
  background-color:color-mix(in srgb, var(--surface-2) 78%, var(--surface));
  opacity:.65;
}

#billingProfileModal .select2-container--default .select2-selection--single{
  min-height:var(--ctrl-h);
}

#billingProfileModal .select2-container--default .select2-selection--single .select2-selection__rendered{
  line-height:1.3;
}

#billingProfileModal .select2-container--default .select2-selection--single.is-invalid,
#billingProfileModal .select2-container--default.select2-container--focus .select2-selection--single.is-invalid{
  border-color:#ef4444;
  box-shadow:none;
}

@media (max-width: 767.98px){
  .bm-billing-doc-actions{
    flex-direction:column;
    align-items:stretch;
  }

  .bm-billing-doc-actions .btn{
    width:100%;
  }
}


/* ============================= WEBSITE CMS ============================= */
.bm-website-shell{
  overflow:hidden;
}

.bm-website-shell .card-header,
.bm-website-shell .card-footer{
  background:color-mix(in srgb, var(--surface-3) 84%, var(--surface-2));
  border-color:var(--border);
}

.bm-website-table-wrap{
  overflow-x:auto;
  overscroll-behavior-x:contain;
}

.bm-website-table{
  width:100%;
  min-width:1180px;
  table-layout:fixed;
}

.bm-website-table > :not(caption)>*>*{
  vertical-align:top;
}

.bm-website-table td,
.bm-website-table th{
  padding-top:.75rem;
  padding-bottom:.75rem;
}

.bm-website-table.table-hover>tbody>tr:hover>*{
  background-color: color-mix(in srgb, var(--brand) 3%, var(--bs-table-hover-bg)) !important;
}

.bm-website-col-preview{ width:92px; }
.bm-website-col-asset{ width:270px; }
.bm-website-col-type{ width:130px; }
.bm-website-col-usage{ width:170px; }
.bm-website-col-details{ width:150px; }
.bm-website-col-url{ width:270px; }
.bm-website-col-status{ width:120px; }
.bm-website-col-actions{ width:86px; }

.bm-website-asset-thumb{
  width:64px;
  height:48px;
  border-radius:14px;
  border:1px solid var(--border);
  background:color-mix(in srgb, var(--surface-2) 78%, var(--card));
  object-fit:cover;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  box-shadow:var(--shadow-sm);
}

.bm-website-asset-thumb--empty{
  color:var(--muted);
  font-size:1.15rem;
}

.bm-website-asset-name,
.bm-website-asset-key,
.bm-website-url{
  overflow-wrap:anywhere;
  line-height:1.35;
}

.bm-website-url{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  line-clamp:2;
  overflow:hidden;
  white-space:normal;
}

.bm-website-footer{
  min-height:64px;
}

.bm-website-footer-pages{
  flex:0 0 auto;
}

.bm-website-preview-card .card-body{
  min-height:260px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:1rem;
}

.bm-website-preview-empty{
  width:100%;
  min-height:220px;
  border:1px dashed var(--border);
  border-radius:16px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:.45rem;
  color:var(--muted);
  background:color-mix(in srgb, var(--surface-2) 55%, transparent);
}

.bm-website-preview-empty i{
  font-size:1.65rem;
  color:color-mix(in srgb, var(--brand) 72%, var(--muted));
}

.bm-website-preview-image{
  width:100%;
  max-height:320px;
  object-fit:contain;
  border:1px solid var(--border);
  border-radius:16px;
  background:color-mix(in srgb, var(--surface-2) 55%, transparent);
}

.bm-website-upload-drop{
  display:flex;
  align-items:center;
  gap:14px;
  width:100%;
  border:1px dashed color-mix(in srgb, var(--border) 84%, transparent);
  border-radius:18px;
  padding:14px;
  background:color-mix(in srgb, var(--card) 94%, transparent);
  cursor:pointer;
  transition:border-color .15s ease, background-color .15s ease, transform .15s ease;
}

.bm-website-upload-drop:hover,
.bm-website-upload-drop.is-dragover{
  border-color:color-mix(in srgb, var(--brand) 60%, var(--border));
  background:color-mix(in srgb, var(--brand) 8%, var(--card));
  transform:translateY(-1px);
}

.bm-website-upload-drop__icon{
  width:50px;
  height:50px;
  border-radius:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  background:color-mix(in srgb, var(--brand) 14%, transparent);
  color:var(--brand);
  font-size:1.45rem;
}

.bm-website-upload-drop__body{
  min-width:0;
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  gap:2px;
}

.bm-website-upload-drop__title{
  font-weight:700;
  color:var(--text);
  line-height:1.25;
}

.bm-website-upload-drop__sub{
  color:var(--muted);
  font-size:.82rem;
  line-height:1.35;
}

.bm-website-upload-drop__cta{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:34px;
  padding:.35rem .75rem;
  border-radius:999px;
  border:1px solid var(--border);
  color:var(--text);
  background:var(--surface-2);
  font-weight:700;
  font-size:.82rem;
}

.bm-website-upload-progress{
  height:.45rem;
  border-radius:999px;
  background:color-mix(in srgb, var(--surface-2) 72%, var(--card));
  overflow:hidden;
}

.bm-website-upload-progress .progress-bar{
  background-color:var(--brand);
}

.bm-website-skeleton-row .bm-website-skeleton-line{
  height:14px;
  width:100%;
  max-width:180px;
  border-radius:999px;
  background:linear-gradient(90deg,
    color-mix(in srgb, var(--surface-2) 78%, var(--card)) 0%,
    color-mix(in srgb, var(--surface-3) 78%, var(--card)) 45%,
    color-mix(in srgb, var(--surface-2) 78%, var(--card)) 100%);
  background-size:220% 100%;
  animation:bmWebsiteSkeleton 1.15s ease-in-out infinite;
}

.bm-website-skeleton-row td:nth-child(1) .bm-website-skeleton-line{ max-width:64px; height:42px; border-radius:14px; }
.bm-website-skeleton-row td:nth-child(2) .bm-website-skeleton-line{ max-width:220px; }
.bm-website-skeleton-row td:nth-child(3) .bm-website-skeleton-line{ max-width:120px; }
.bm-website-skeleton-row td:nth-child(4) .bm-website-skeleton-line{ max-width:150px; }
.bm-website-skeleton-row td:nth-child(5) .bm-website-skeleton-line{ max-width:180px; }

@keyframes bmWebsiteSkeleton{
  0%{ background-position:160% 0; }
  100%{ background-position:-60% 0; }
}

@media (max-width: 1199.98px){
  .bm-website-table{
    min-width:1040px;
  }
}

@media (max-width: 767.98px){
  .bm-website-footer-pages{
    width:100%;
    justify-content:flex-start;
    margin-left:0 !important;
  }

  .bm-website-upload-drop{
    align-items:flex-start;
  }

  .bm-website-upload-drop__cta{
    display:none;
  }
}

/* =========================== END WEBSITE CMS ============================ */

/* ========================================================================
   BioMaint auth brand final alignment
   - Applies to both Login.cshtml and Signup.cshtml
   - Matches the larger DeepSeek-like logo/text proportion
   - Keeps all page structure and logic unchanged
   ======================================================================== */
.bm-auth-header .bm-auth-brand-link,
.bm-login-brand-block .bm-auth-brand-link{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:.50rem !important;
  line-height:1;
  color:inherit;
}

.bm-auth-header .bm-auth-logo-mark,
.bm-login-brand-block .bm-auth-logo-mark{
  flex:0 0 auto;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:30px;
  height:30px;
}

.bm-auth-header .bm-auth-logo-mark img,
.bm-login-brand-block .bm-auth-logo-mark img{
  display:block;
  width:30px !important;
  height:30px !important;
}

.bm-auth-header .bm-auth-brand-text,
.bm-login-brand-block .bm-auth-brand-text{
  display:inline-block;
  margin:0;
  color:var(--text);
  font-family:"Inter","Noto Sans Bengali","Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  font-size:1.35rem !important;
  font-weight:800;
  line-height:1;
  letter-spacing:-.015em;
  text-rendering:optimizeLegibility;
}

/* Compatibility for any older login markup that still uses bm-login-brand-row/title/logo. */
.bm-login-brand-row{
  gap:.50rem;
}

.bm-login-brand-logo{
  width:30px;
  height:30px;
  flex-basis:30px;
}

.bm-login-brand-title{
  font-size:1.35rem;
  font-weight:800;
  line-height:1;
  letter-spacing:-.015em;
}

@media (max-width: 575.98px){
  .bm-auth-header .bm-auth-brand-link,
  .bm-login-brand-block .bm-auth-brand-link{
    gap:.46rem !important;
  }

  .bm-auth-header .bm-auth-logo-mark,
  .bm-login-brand-block .bm-auth-logo-mark{
    width:28px;
    height:28px;
  }

  .bm-auth-header .bm-auth-logo-mark img,
  .bm-login-brand-block .bm-auth-logo-mark img{
    width:28px !important;
    height:28px !important;
  }

  .bm-auth-header .bm-auth-brand-text,
  .bm-login-brand-block .bm-auth-brand-text{
    font-size:1.25rem !important;
  }

  .bm-login-brand-row{
    gap:.46rem;
  }

  .bm-login-brand-logo{
    width:28px;
    height:28px;
    flex-basis:28px;
  }

  .bm-login-brand-title{
    font-size:1.25rem;
  }
}

@media (max-width: 360px){
  .bm-auth-header .bm-auth-brand-link,
  .bm-login-brand-block .bm-auth-brand-link{
    gap:.42rem !important;
  }

  .bm-auth-header .bm-auth-logo-mark,
  .bm-login-brand-block .bm-auth-logo-mark{
    width:26px;
    height:26px;
  }

  .bm-auth-header .bm-auth-logo-mark img,
  .bm-login-brand-block .bm-auth-logo-mark img{
    width:26px !important;
    height:26px !important;
  }

  .bm-auth-header .bm-auth-brand-text,
  .bm-login-brand-block .bm-auth-brand-text{
    font-size:1.16rem !important;
  }
}
