/* ===================================================================
   GRID4 NETSAPIENS PORTAL SKIN v5.0.11
   ARCHITECTURE: SCOPED APP SHELL
   - All styles are scoped to #grid4-app-shell to prevent global conflicts.
   - Table header fixes with sortable link colors (#23A455)
   - Color-primary button overrides to match theme
   - Enhanced modal form element theming
   - Smooth theme transition support
   - Domain banner spacing handled by JS measuring actual position.
   - Icon sprites use CDN paths for NetSapiens server access.
   - Fixed nav tabs visibility, dropdown hover behavior, removed tooltips.
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Open+Sans:wght@400;500;600;700&display=swap');

/* ===================================
   REM BASELINE: Smooth desktop scale across 1080p through 4k
   =================================== */
html {
  font-size: clamp(15px, 0.625vw, 18px);
}

@media (max-width: 1024px) {
  html { font-size: 14px; }
}

/* ===================================
   1. FOUNDATION: THEME-AGNOSTIC CONSTANTS
   =================================== */
:root {
  /* Layout Constants */
  --g4-sidebar-width: 12.825rem; /* 250px converted to REM */
  --g4-header-height: 2.25rem; /* 60px converted to REM */
  --g4-banner-header-height: 3.35rem;
  --g4-banner-active-offset: var(--g4-banner-header-height);
  --g4-content-padding: clamp(0.68rem, 0.78vw, 0.92rem);
  --g4-radius-sm: 0.20rem; /* 4px converted to REM */
  --g4-radius-md: 0.325rem; /* 6px converted to REM */
  --g4-radius-lg: 0.5rem; /* 8px converted to REM */
  --g4-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --g4-transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Brand constants */
  --g4-brand-sky: #52B4FA;
  --g4-brand-navy: #1C2143;
  --g4-brand-cloud: #F4F4F4;
  --g4-brand-charcoal: #404040;
  --g4-brand-black: #000000;
  --g4-brand-white: #FFFFFF;
  --g4-brand-sky-rgb: 82, 180, 250;
  --g4-brand-navy-rgb: 28, 33, 67;
  --g4-brand-cloud-rgb: 244, 244, 244;

  /* Typography */
  --g4-font-family-body: 'Open Sans', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --g4-font-family-heading: 'Manrope', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --g4-font-family: var(--g4-font-family-body);
  --g4-font-weight-light: 300;
  --g4-font-weight-regular: 400;
  --g4-font-weight-semibold: 500;
  --g4-font-weight-bold: 700;
  --g4-font-size-xs: 0.625rem;
  --g4-font-size-sm: 0.78125rem;
  --g4-font-size-base: 0.8125rem;
  --g4-font-size-md: 0.9375rem;
  --g4-font-size-lg: 1.125rem;
}

/* ===================================
   2. THEME DEFINITIONS (SCOPED TO APP SHELL)
   =================================== */

/* --- LIGHT THEME --- */
#grid4-app-shell.theme-light {
  --app-bg: #edf2f7;
  --surface-primary-bg: #fbfcfe;
  --surface-secondary-bg: #e7eef6;
  --border-color: rgba(var(--g4-brand-navy-rgb), 0.14);
  --text-primary: var(--g4-brand-navy);
  --text-secondary: #4d5c72;
  --text-muted: #75839b;
  --accent-primary: var(--g4-brand-sky);
  --accent-secondary: var(--g4-brand-navy);
  --heading-color: var(--g4-brand-navy);
  --shadow-color: rgba(var(--g4-brand-navy-rgb), 0.08);
  --sortable-header-text: var(--g4-brand-navy);
  --sortable-header-text-hover: var(--g4-brand-sky);
  --table-hover-bg: rgba(var(--g4-brand-sky-rgb), 0.1);
  --table-hover-text: var(--g4-brand-navy);

  /* RGB values for effects */
  --surface-primary-rgb: 255, 255, 255;
  --surface-secondary-rgb: var(--g4-brand-cloud-rgb);
  --accent-primary-rgb: var(--g4-brand-sky-rgb);
  --g4-button-surface: #f4f8fc;
  --g4-button-surface-hover: rgba(var(--g4-brand-sky-rgb), 0.11);
  --g4-button-surface-border: rgba(var(--g4-brand-navy-rgb), 0.12);
  --g4-button-primary-bg: var(--accent-primary);
  --g4-button-primary-hover-bg: #3fa6e8;
  --g4-button-primary-border: rgba(var(--g4-brand-sky-rgb), 0.95);
  --g4-button-danger-bg: #c64657;
  --g4-button-danger-hover-bg: #d95768;
  --g4-button-danger-border: #b63d4c;
  --g4-banner-bg: rgba(248, 250, 253, 0.96);
  --g4-banner-border: rgba(var(--g4-brand-navy-rgb), 0.1);
  --g4-banner-button-bg: rgba(var(--g4-brand-sky-rgb), 0.16);
  --g4-banner-button-hover-bg: var(--accent-primary);
  --g4-banner-button-text: var(--g4-brand-navy);
  --g4-banner-button-border: rgba(var(--g4-brand-sky-rgb), 0.26);
  --g4-banner-button-height: 2.35rem;
  --g4-banner-button-height-compact: 2rem;
  --g4-banner-action-view-bg: #3b82f6;
  --g4-banner-action-view-hover-bg: #2563eb;
  --g4-banner-action-view-text: #f8fbff;
  --g4-banner-action-edit-bg: #f59e0b;
  --g4-banner-action-edit-hover-bg: #d97706;
  --g4-banner-action-edit-text: #f8fbff;
  --g4-banner-action-configs-bg: #10b981;
  --g4-banner-action-configs-hover-bg: #059669;
  --g4-banner-action-configs-text: #f6fffb;
  --g4-banner-action-masq-bg: #ef4444;
  --g4-banner-action-masq-hover-bg: #dc2626;
  --g4-banner-action-masq-text: #fff7f7;
  --g4-popover-bg: #fbfdff;
  --g4-popover-text: var(--text-primary);
  --g4-popover-border: rgba(var(--g4-brand-navy-rgb), 0.18);
}

/* --- DARK THEME --- */
#grid4-app-shell.theme-dark {
  --app-bg: #050608;
  --surface-primary-bg: #0f1318;
  --surface-secondary-bg: #171c22;
  --border-color: rgba(255, 255, 255, 0.11);
  --text-primary: #e7ecf3;
  --text-secondary: #bcc6d3;
  --text-muted: #8792a3;
  --accent-primary: var(--g4-brand-sky);
  --accent-secondary: #20262e;
  --heading-color: #edf2f8;
  --shadow-color: rgba(0, 0, 0, 0.48);
  --sortable-header-text: #e7ecf3;
  --sortable-header-text-hover: var(--g4-brand-sky);
  --table-hover-bg: rgba(var(--g4-brand-sky-rgb), 0.14);
  --table-hover-text: #eef2f8;

  /* RGB values for effects */
  --surface-primary-rgb: 15, 19, 24;
  --surface-secondary-rgb: 23, 28, 34;
  --accent-primary-rgb: var(--g4-brand-sky-rgb);
  --g4-button-surface: rgba(255, 255, 255, 0.05);
  --g4-button-surface-hover: rgba(var(--g4-brand-sky-rgb), 0.12);
  --g4-button-surface-border: rgba(255, 255, 255, 0.1);
  --g4-button-primary-bg: rgb(var(--g4-brand-sky-rgb));
  --g4-button-primary-hover-bg: #6bc6f8;
  --g4-button-primary-border: rgb(var(--g4-brand-sky-rgb));
  --g4-button-danger-bg: #b63e4d;
  --g4-button-danger-hover-bg: #ce5463;
  --g4-button-danger-border: rgba(255, 118, 142, 0.42);
  --g4-banner-bg: rgba(8, 11, 15, 0.94);
  --g4-banner-border: rgba(255, 255, 255, 0.1);
  --g4-banner-button-bg: rgba(255, 255, 255, 0.06);
  --g4-banner-button-hover-bg: rgba(var(--g4-brand-sky-rgb), 0.22);
  --g4-banner-button-text: #dfe8f5;
  --g4-banner-button-border: rgba(255, 255, 255, 0.13);
  --g4-banner-button-height: 2.35rem;
  --g4-banner-button-height-compact: 2rem;
  --g4-banner-action-view-bg: #3b82f6;
  --g4-banner-action-view-hover-bg: #2563eb;
  --g4-banner-action-view-text: #f8fbff;
  --g4-banner-action-edit-bg: #f59e0b;
  --g4-banner-action-edit-hover-bg: #d97706;
  --g4-banner-action-edit-text: #f8fbff;
  --g4-banner-action-configs-bg: #10b981;
  --g4-banner-action-configs-hover-bg: #059669;
  --g4-banner-action-configs-text: #f6fffb;
  --g4-banner-action-masq-bg: #ef4444;
  --g4-banner-action-masq-hover-bg: #dc2626;
  --g4-banner-action-masq-text: #fff7f7;
  --g4-popover-bg: #10151c;
  --g4-popover-text: var(--text-primary);
  --g4-popover-border: rgba(255, 255, 255, 0.12);
}

/* --- BODY THEME VARIABLES (for proper CSS variable inheritance) --- */
/* Mirror the core theme vars onto body so out-of-shell UI can inherit them */
body.theme-light {
       --app-bg: #edf2f7;
       --surface-primary-bg: #fbfcfe;
       --surface-secondary-bg: #e7eef6;
       --border-color: rgba(var(--g4-brand-navy-rgb), 0.14);
       --text-primary: var(--g4-brand-navy);
       --text-secondary: #4d5c72;
       --text-muted: #75839b;
       --accent-primary: var(--g4-brand-sky);
       --accent-secondary: var(--g4-brand-navy);
       --heading-color: var(--g4-brand-navy);
       --shadow-color: rgba(var(--g4-brand-navy-rgb), 0.08);
       --sortable-header-text: var(--g4-brand-navy);
       --sortable-header-text-hover: var(--g4-brand-sky);
       --table-hover-bg: rgba(var(--g4-brand-sky-rgb), 0.1);
       --table-hover-text: var(--g4-brand-navy);
       --surface-primary-rgb: 255, 255, 255;
       --surface-secondary-rgb: var(--g4-brand-cloud-rgb);
       --accent-primary-rgb: var(--g4-brand-sky-rgb);
       --g4-button-surface: #f4f8fc;
       --g4-button-surface-hover: rgba(var(--g4-brand-sky-rgb), 0.11);
       --g4-button-surface-border: rgba(var(--g4-brand-navy-rgb), 0.12);
       --g4-button-primary-bg: var(--accent-primary);
       --g4-button-primary-hover-bg: #3fa6e8;
       --g4-button-primary-border: rgba(var(--g4-brand-sky-rgb), 0.95);
       --g4-button-danger-bg: #c64657;
       --g4-button-danger-hover-bg: #d95768;
       --g4-button-danger-border: #b63d4c;
       --g4-banner-bg: rgba(248, 250, 253, 0.96);
       --g4-banner-border: rgba(var(--g4-brand-navy-rgb), 0.1);
       --g4-banner-button-bg: rgba(var(--g4-brand-sky-rgb), 0.16);
       --g4-banner-button-hover-bg: var(--accent-primary);
       --g4-banner-button-text: var(--g4-brand-navy);
       --g4-banner-button-border: rgba(var(--g4-brand-sky-rgb), 0.26);
       --g4-banner-button-height: 2.35rem;
       --g4-banner-button-height-compact: 2rem;
       --g4-banner-action-view-bg: #3b82f6;
       --g4-banner-action-view-hover-bg: #2563eb;
       --g4-banner-action-view-text: #f8fbff;
       --g4-banner-action-edit-bg: #f59e0b;
       --g4-banner-action-edit-hover-bg: #d97706;
       --g4-banner-action-edit-text: #f8fbff;
       --g4-banner-action-configs-bg: #10b981;
       --g4-banner-action-configs-hover-bg: #059669;
       --g4-banner-action-configs-text: #f6fffb;
       --g4-banner-action-masq-bg: #ef4444;
       --g4-banner-action-masq-hover-bg: #dc2626;
       --g4-banner-action-masq-text: #fff7f7;
       --g4-popover-bg: #fbfdff;
       --g4-popover-text: var(--text-primary);
       --g4-popover-border: rgba(var(--g4-brand-navy-rgb), 0.18);
}

body.theme-dark {
       --app-bg: #050608;
       --surface-primary-bg: #0f1318;
       --surface-secondary-bg: #171c22;
       --border-color: rgba(255, 255, 255, 0.11);
       --text-primary: #e7ecf3;
       --text-secondary: #bcc6d3;
       --text-muted: #8792a3;
       --accent-primary: var(--g4-brand-sky);
       --accent-secondary: #20262e;
       --heading-color: #edf2f8;
       --shadow-color: rgba(0, 0, 0, 0.48);
       --sortable-header-text: #e7ecf3;
       --sortable-header-text-hover: var(--g4-brand-sky);
       --table-hover-bg: rgba(var(--g4-brand-sky-rgb), 0.14);
       --table-hover-text: #eef2f8;
       --surface-primary-rgb: 15, 19, 24;
       --surface-secondary-rgb: 23, 28, 34;
       --accent-primary-rgb: var(--g4-brand-sky-rgb);
       --g4-button-surface: rgba(255, 255, 255, 0.05);
       --g4-button-surface-hover: rgba(var(--g4-brand-sky-rgb), 0.12);
       --g4-button-surface-border: rgba(255, 255, 255, 0.1);
       --g4-button-primary-bg: rgb(var(--g4-brand-sky-rgb));
       --g4-button-primary-hover-bg: #6bc6f8;
       --g4-button-primary-border: rgb(var(--g4-brand-sky-rgb));
       --g4-button-danger-bg: #b63e4d;
       --g4-button-danger-hover-bg: #ce5463;
       --g4-button-danger-border: rgba(255, 118, 142, 0.42);
       --g4-banner-bg: rgba(8, 11, 15, 0.94);
       --g4-banner-border: rgba(255, 255, 255, 0.1);
       --g4-banner-button-bg: rgba(255, 255, 255, 0.06);
       --g4-banner-button-hover-bg: rgba(var(--g4-brand-sky-rgb), 0.22);
       --g4-banner-button-text: #dfe8f5;
       --g4-banner-button-border: rgba(255, 255, 255, 0.13);
       --g4-banner-button-height: 2.35rem;
       --g4-banner-button-height-compact: 2rem;
       --g4-banner-action-view-bg: #3b82f6;
       --g4-banner-action-view-hover-bg: #2563eb;
       --g4-banner-action-view-text: #f8fbff;
       --g4-banner-action-edit-bg: #f59e0b;
       --g4-banner-action-edit-hover-bg: #d97706;
       --g4-banner-action-edit-text: #f8fbff;
       --g4-banner-action-configs-bg: #10b981;
       --g4-banner-action-configs-hover-bg: #059669;
       --g4-banner-action-configs-text: #f6fffb;
       --g4-banner-action-masq-bg: #ef4444;
       --g4-banner-action-masq-hover-bg: #dc2626;
       --g4-banner-action-masq-text: #fff7f7;
       --g4-popover-bg: #10151c;
       --g4-popover-text: var(--text-primary);
       --g4-popover-border: rgba(255, 255, 255, 0.12);
}

/* ===================================
   3. APP SHELL & CORE LAYOUT
   =================================== */

/* Apply font family globally within shell */
#grid4-app-shell {
  font-family: var(--g4-font-family) !important;
  font-size: var(--g4-font-size-base);
  font-weight: var(--g4-font-weight-regular);
  line-height: 1.45;
  letter-spacing: 0.01em;
  min-height: 100vh;
  background-color: var(--app-bg) !important;
}

/* Vendor .page-container keeps 80px gutters on both sides even though the
   Grid4 shell already owns sidebar/content spacing. Reclaim that space only
   when the shell is active so login/other non-shell pages are unaffected. */
.page-container.g4-shell-host {
  padding-left: clamp(0.75rem, 1.25vw, 1.5rem) !important;
  padding-right: clamp(0.75rem, 1.25vw, 1.5rem) !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
}

.page-container.g4-shell-host > #grid4-app-shell {
  width: 100% !important;
}

/* Fix wrapper to prevent white background bleed */
#grid4-app-shell .wrapper,
.wrapper {
  display: flex;
  flex: 1;
  min-height: 100vh;
  padding-top: var(--g4-header-height);
  padding-left: var(--g4-sidebar-width);
  background-color: var(--app-bg) !important;
  width: 100%;
  box-sizing: border-box;
}

/* The has-domain-banner class is added by JS but spacing is handled dynamically */

/* Ensure body and html don't interfere */
body {
  margin: 0;
  padding: 0;
  font-family: var(--g4-font-family-body) !important;
  background-color: var(--app-bg, #030507) !important;
}

#grid4-app-shell #header {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  height: var(--g4-header-height);
  background-color: var(--surface-secondary-bg) !important;
  border-bottom: 5px solid var(--border-color) !important;
  z-index: 1030; /* Lower than modals (1050) but higher than sidebar (1000) */
  display: flex;
  align-items: center;
  padding: 0 1.25rem;
  box-shadow: 0 0.125rem 0.5rem var(--shadow-color);
  transition: background-color var(--g4-transition-normal), border-color var(--g4-transition-normal);
}

#grid4-app-shell #header,
#grid4-app-shell #navigation {
  box-sizing: border-box !important;
}

#grid4-app-shell #content {
  flex: 1;
  padding: calc(var(--g4-content-padding) + 0.35rem) var(--g4-content-padding) var(--g4-content-padding) !important;
  margin-left: 0 !important;
  background-color: var(--app-bg) !important;
  color: var(--text-primary) !important;
  min-width: 0; /* Prevent flex item from overflowing */
  box-sizing: border-box;
  width: 100%;
}

/* Fix content area backgrounds
#grid4-app-shell #content > *,
#grid4-app-shell .container-fluid,
#grid4-app-shell .row-fluid {
  background-color: transparent !important;
} */

/* Hide original header logo */
#grid4-app-shell #header-logo {
  display: none !important;
}

/* Move user toolbar to the right side */
#grid4-app-shell #header-user {
  position: absolute !important;
  right: 1.25rem !important;
  top: 75% !important;
  transform: translateY(-50%) !important;
  margin-left: 0 !important;
  color: var(--text-primary) !important;
  font-family: var(--g4-font-family-heading) !important;
  font-size: 0.84rem !important;
  font-weight: var(--g4-font-weight-semibold) !important;
  line-height: 1.35 !important;
  letter-spacing: 0.01em;
}

#grid4-app-shell #header-user a,
#grid4-app-shell #header-user button,
#grid4-app-shell #app-menu-list li a {
  font-family: var(--g4-font-family-heading) !important;
  font-weight: var(--g4-font-weight-semibold) !important;
}
/*
#grid4-app-shell #header-user a {
/*  color: var(--text-primary) !important;
}
*/
/* Position app dropdown relative to its container */
#grid4-app-shell #header-user .dropdown {
  position: relative !important;
}

/* Fix app menu dropdown visibility and position */
#grid4-app-shell #app-menu-list {
  position: absolute !important;
  z-index: 9999 !important;
  left: auto !important;
  right: 0 !important;
  top: 100% !important;
  margin-top: 0.3125rem !important;
  background: var(--surface-primary-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--g4-radius-md) !important;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.15) !important;
  min-width: 12.5rem !important;
}

/* Ensure dropdown menu items are visible */
#grid4-app-shell #app-menu-list .dropdown-menu {
  display: block !important;
  position: static !important;
  float: none !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

#grid4-app-shell #app-menu-list li a {
  color: var(--text-primary) !important;
  padding: 0.5rem 1rem !important;
  display: block !important;
  white-space: nowrap !important;
}

#grid4-app-shell #app-menu-list li a:hover {
  background: var(--surface-secondary-bg) !important;
  color: var(--accent-primary) !important;
}

/* ===================================
   4. SIDEBAR NAVIGATION & LOGO
   =================================== */

#grid4-app-shell #navigation {
  position: fixed;
  top: var(--g4-header-height);
  left: 0;
  width: var(--g4-sidebar-width);
  height: calc(100vh - var(--g4-header-height));
  background-color: var(--surface-secondary-bg) !important;
  border-right: 5px solid var(--border-color) !important;
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: background-color var(--g4-transition-normal), border-color var(--g4-transition-normal);
  box-shadow: 0.125rem 0 0.5rem rgba(0, 0, 0, 0.1);
  overflow-x: hidden; /* Prevent horizontal scroll */
  padding-bottom: 0.875rem;
}

/* Custom Logo Injection */
#grid4-app-shell #navigation::before {
  content: '';
  display: block;
  width: 85%;
  height: 6.5rem;
  margin: 2.3125rem auto;
  background-image: url('https://ambitious-coast-0a8b2110f.1.azurestaticapps.net/SmartComm Test Logo.svg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  flex-shrink: 0;
}

#grid4-app-shell #nav-buttons {
  flex: 1 1 0;
  min-height: 0 !important;
  overflow-y: auto;
  padding: 0;
  margin: 0;
  list-style: none;
}

/* Navigation Links */
#grid4-app-shell #nav-buttons li {
  margin: 0;
  padding: 0;
}

#grid4-app-shell #nav-buttons .nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem; /* 12px gap between icon and text */
  padding: 0.5rem .4rem; /* 10px 16px */
  margin: 0.125rem 0.4rem; /* 2px 8px */
  border-radius: var(--g4-radius-sm);
  color: var(--text-secondary) !important;
  font-size: var(--g4-font-size-sm);
  font-family: var(--g4-font-family-heading) !important;
  font-weight: var(--g4-font-weight-semibold);
  letter-spacing: 0.01em;
  text-decoration: none !important;
  transition: all var(--g4-transition-fast);
  position: relative;
  height: auto;
  min-height: 1.5rem; /* 40px */
  white-space: nowrap !important;
}

#grid4-app-shell #nav-buttons .nav-link .fa {
  font-size: 1.25rem; /* 18px - larger icons */
  width: 1.50rem; /* 20px fixed width */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#grid4-app-shell #nav-buttons .nav-link .nav-text {
  display: flex;
  align-items: center;
  line-height: 1.2;
  font-size: var(--g4-font-size-base);
  height: 100%;
  white-space: nowrap !important; /* Prevent text wrapping */
  text-overflow: ellipsis;
  flex: 1;
  text-align: left; /* Ensure left alignment */
  color: var(--text-primary) !important;
  font-weight: 600 !important;

}

#grid4-app-shell #nav-buttons .nav-link:hover {
  background-color: var(--accent-primary);
  color: #ffffff !important;
  transform: translateX(0.25rem);
}

#grid4-app-shell #nav-buttons .nav-link:hover .fa,
#grid4-app-shell #nav-buttons .nav-link:hover .nav-text {
  color: #ffffff !important;
}

#grid4-app-shell #nav-buttons .nav-link-current > a {
  background-color: var(--accent-primary) !important;
  color: #ffffff !important;
  font-weight: 600;
}

#grid4-app-shell #nav-buttons .nav-link-current > a .fa,
#grid4-app-shell #nav-buttons .nav-link-current > a .nav-text {
  color: #ffffff !important;
}

/* Clean up default nav elements */
#grid4-app-shell .nav-button,
#grid4-app-shell .nav-bg-image,
#grid4-app-shell .nav-arrow {
  display: none !important;
}

/* Theme Toggle Button */
#grid4-theme-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-top: 0.75rem !important;
  margin-bottom: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
  align-self: center !important;
  flex-shrink: 0;
  transition: all var(--g4-transition-normal);
}

/* Ensure FontAwesome icons display properly */
#grid4-theme-toggle .fa:before,
#grid4-app-shell .fa:before {
  font-family: 'FontAwesome' !important;
  font-style: normal !important;
  font-weight: normal !important;
  text-decoration: inherit !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}
#grid4-theme-toggle:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  transform: scale(1.1) rotate(15deg);
}

/* Dev Tools Styling */
/* #grid4-dev-tools {
  background: #0099ff !important;
  border-radius: 0.5rem !important;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.3) !important;
  margin: 0.625rem !important;
  overflow: hidden;
}

#grid4-dev-tools-header {
  background: #0099ff !important;
  color: white !important;
  cursor: pointer;
  padding: 0.75rem !important;
  font-weight: 600 !important;
  user-select: none;
}

#grid4-dev-tools-header:hover {
  background: #0088ee !important;
}

#grid4-dev-tools-content {
  background: white !important;
  color: #333 !important;
  max-height: 70vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

#grid4-dev-tools-content::-webkit-scrollbar {
  width: 0.5rem;
}

#grid4-dev-tools-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

#grid4-dev-tools-content::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 0.25rem;
}

#grid4-dev-tools-content::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Ensure inputs and selects in dev tools are always visible */
#grid4-dev-tools input,
#grid4-dev-tools select {
  background: #f5f5f5 !important;
  color: #333 !important;
  border: 1px solid #ddd !important;
}

#grid4-dev-tools button:hover {
  opacity: 0.9;
  transform: translateY(-0.0625rem);
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.2);
} */

/* ===================================
   5. HEADER & TOOLBAR ADJUSTMENTS
   =================================== */

/* Shift user toolbar left to prevent dropdown cutoff */
#grid4-app-shell .user-toolbar {
  margin-right: 3.75rem !important;
}

/* Ensure dropdown has space */
#grid4-app-shell #grid4-admin-dropdown .dropdown-menu {
  right: 0 !important;
  left: auto !important;
}

/* ===================================
   5. SCOPED COMPONENT STYLES
   =================================== */

/* Sub-bar - Hide completely as it provides no utility */
#grid4-app-shell #navigation-subbar {
  display: none !important;
}

/* Panels */
#grid4-app-shell .panel {
  background-color: var(--surface-primary-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--g4-radius-md);
  color: var(--text-primary) !important;
  box-shadow: 0 0.0625rem 0.1875rem var(--shadow-color);
}
#grid4-app-shell .panel-heading {
  background-color: transparent !important;
  border-bottom: 1px solid var(--border-color) !important;
  color: var(--heading-color, var(--text-primary)) !important;
  font-family: var(--g4-font-family-heading) !important;
  font-weight: var(--g4-font-weight-bold);
  letter-spacing: 0.015em;
}

/* Enhanced Tables with Modern Styling */
#grid4-app-shell .table {
  color: var(--text-primary) !important;
  border-collapse: separate !important;
/*  border-spacing: 0 0.3125rem !important; */
}

#grid4-app-shell .table th {
  color: var(--sortable-header-text) !important;
  border-color: var(--border-color) !important;
  background-color: var(--surface-secondary-bg) !important;
  font-family: var(--g4-font-family-heading) !important;
  font-size: 0.75rem;
  font-weight: var(--g4-font-weight-bold);
  letter-spacing: 0.02em;
  /* position: sticky; */
  top: 0;
  z-index: 10;
}

#grid4-app-shell .table td {
  border-color: var(--border-color) !important;
  background-color: var(--surface-primary-bg);
  transition: background-color var(--g4-transition-fast),
              color var(--g4-transition-fast),
              border-color var(--g4-transition-fast);
  vertical-align: middle;
}

/* Modern row hover with a stable surface swap.
   Avoid motion/lift here: the older transform + all-transition combo made
   dense table rows feel twitchy and could amplify flicker on pages that still
   have vendor hover handlers or in-row action controls. */
#grid4-app-shell .table-hover tbody tr:hover,
#grid4-app-shell .table-hover tbody tr:hover > td {
  background-color: var(--table-hover-bg) !important;
  color: var(--table-hover-text) !important;
  transform: none !important;
  box-shadow: none !important;
}

/* Selected/Active rows */
#grid4-app-shell .table tbody tr.selected td,
#grid4-app-shell .table tbody tr.active td {
  background-color: var(--accent-primary) !important;
  color: #ffffff !important;
}

/* First and last cell rounded corners for modern look */
#grid4-app-shell .table tbody tr td:first-child {
  border-radius: var(--g4-radius-md) 0 0 var(--g4-radius-md);
}

#grid4-app-shell .table tbody tr td:last-child {
  border-radius: 0 var(--g4-radius-md) var(--g4-radius-md) 0;
}

/* Fix table container to prevent cutoff */
#grid4-app-shell .table-responsive {
  overflow-x: auto;
  overflow-y: visible;
  margin-bottom: 1.25rem;
  padding-right: 0.625rem;
}

/* Forms - Critical fix for visibility */
#grid4-app-shell .form-control,
#grid4-app-shell input[type="text"],
#grid4-app-shell input[type="password"],
#grid4-app-shell input[type="email"],
#grid4-app-shell input[type="number"],
#grid4-app-shell input[type="tel"],
#grid4-app-shell input[type="url"],
#grid4-app-shell input[type="search"],
#grid4-app-shell select,
#grid4-app-shell textarea {
/*  background-color: var(--surface-primary-bg) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: var(--g4-radius-sm) !important;
  /* padding: 0.375rem 0.625rem !important; */
  font-size: var(--g4-font-size-base) !important;
  font-family: var(--g4-font-family) !important;
  line-height: 1.4 !important; /* Slightly reduced line-height */
  transition: all var(--g4-transition-fast) !important;
  /*height: auto !important; */
  min-width: auto !important;
  min-height: 1.05rem !important;
}

/* Fix icon overlap in input groups
#grid4-app-shell .input-append .add-on,
#grid4-app-shell .input-prepend .add-on {
  padding: 0.25rem 0.5rem !important;
  height: auto !important;
  min-height: 1.75rem !important;
  display: flex !important;
  align-items: center !important;
}
*/

#grid4-app-shell .input-append .add-on, #grid4-app-shell .input-prepend .add-on {
    padding: 0.25rem 0.25rem !important;
    height: auto !important;
    min-height: 1.25rem !important;
    display: inline-block !important;
    /* align-items: center !important; */
}
/* Remove duplicate icons in form fields */
#grid4-app-shell .control-group .fa:not(:first-of-type),
#grid4-app-shell .controls .fa:not(:first-of-type) {
  display: none !important;
}

#grid4-app-shell .form-control:focus,
#grid4-app-shell input:focus,
#grid4-app-shell select:focus,
#grid4-app-shell textarea:focus {
  border-color: var(--accent-primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 0.1875rem rgba(0, 123, 255, 0.15) !important;
}

/* Specific fix for light theme inputs */
#grid4-app-shell.theme-light .form-control,
#grid4-app-shell.theme-light input,
#grid4-app-shell.theme-light select,
#grid4-app-shell.theme-light textarea {
  background-color: #ffffff !important;
  color: #212529 !important;
}

/* Shared toolbar search and filter controls still leak vendor-white in dark mode.
   Keep this scoped to actual form fields so legacy sprite buttons that happen to
   carry `search-query` in their class list do not get their background reset. */
body.theme-dark #grid4-app-shell input.search-query,
body.theme-dark #grid4-app-shell input.ui-autocomplete-input,
body.theme-dark #grid4-app-shell input#domains.ui-autocomplete-input,
body.theme-dark #grid4-app-shell input#choices.ui-autocomplete-input {
  background: var(--surface-primary-bg) !important;
  background-color: var(--surface-primary-bg) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: none !important;
  -webkit-text-fill-color: var(--text-primary) !important;
}

body.theme-dark #grid4-app-shell input.search-query::placeholder,
body.theme-dark #grid4-app-shell input.ui-autocomplete-input::placeholder {
  color: var(--text-muted) !important;
}

/* Home > Domain Quick Launch still inherits a vendor 99% content-box input,
   which makes the field read like it runs into the tile edge. Give it the
   same intentional inset/chrome language as our other search controls. */
body.page-home #grid4-app-shell .home-sidebar .quick-nav-home input#domains {
  display: block !important;
  width: calc(100% - 0.9rem) !important;
  max-width: calc(100% - 0.9rem) !important;
  margin: 0.35rem auto 0.55rem !important;
  box-sizing: border-box !important;
  min-height: 2.25rem !important;
  padding: 0.48rem 0.78rem !important;
  border-radius: 0.8rem !important;
  box-shadow: none !important;
}

body.theme-dark.page-home #grid4-app-shell .home-sidebar .quick-nav-home input#domains {
  background: rgba(15, 19, 24, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: var(--text-primary) !important;
  -webkit-text-fill-color: var(--text-primary) !important;
}

body.theme-dark.page-home #grid4-app-shell .home-sidebar .quick-nav-home input#domains::placeholder {
  color: var(--text-muted) !important;
}

body.theme-light.page-home #grid4-app-shell .home-sidebar .quick-nav-home input#domains {
  background: rgba(248, 251, 254, 0.96) !important;
  border: 1px solid rgba(var(--g4-brand-navy-rgb), 0.18) !important;
  color: var(--text-primary) !important;
  -webkit-text-fill-color: var(--text-primary) !important;
  box-shadow: 0 0.55rem 1.2rem rgba(var(--g4-brand-navy-rgb), 0.08) !important;
}

body.theme-light.page-home #grid4-app-shell .home-sidebar .quick-nav-home input#domains::placeholder {
  color: rgba(var(--g4-brand-navy-rgb), 0.58) !important;
}

body.theme-dark .ui-autocomplete,
body.theme-dark ul.ui-autocomplete {
  background-color: var(--surface-primary-bg) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: 0 0.5rem 1.25rem var(--shadow-color) !important;
}

body.theme-dark .ui-autocomplete .ui-menu-item,
body.theme-dark .ui-autocomplete .ui-menu-item a {
  color: var(--text-primary) !important;
}

body.has-domain-banner #grid4-app-shell #header {
  height: var(--g4-banner-active-offset, var(--g4-banner-header-height));
  align-items: flex-end;
  padding-bottom: 0.35rem;
}

body.has-domain-banner #grid4-app-shell #navigation {
  top: var(--g4-banner-active-offset, var(--g4-banner-header-height));
  height: calc(100vh - var(--g4-banner-active-offset, var(--g4-banner-header-height)));
}

body.has-domain-banner #grid4-app-shell #header-user {
  top: 58% !important;
}

body.has-domain-banner #grid4-app-shell .wrapper {
  padding-top: var(--g4-banner-active-offset, var(--g4-banner-header-height));
}

body.theme-dark .ui-autocomplete .ui-state-hover,
body.theme-dark .ui-autocomplete .ui-state-focus,
body.theme-dark .ui-autocomplete .ui-menu-item a.ui-state-focus,
body.theme-dark .ui-autocomplete .ui-menu-item a:hover {
  background-color: var(--surface-secondary-bg) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

body.theme-dark #grid4-app-shell .action-container select,
body.theme-dark #grid4-app-shell .filters select,
body.theme-dark #grid4-app-shell select:not([multiple]),
body.theme-dark #grid4-app-shell select#stat_type {
  background: var(--surface-primary-bg) !important;
  background-color: var(--surface-primary-bg) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: none !important;
  -webkit-text-fill-color: var(--text-primary) !important;
}

body.theme-dark #grid4-app-shell select option,
body.theme-dark #grid4-app-shell select optgroup {
  background-color: var(--surface-primary-bg) !important;
  color: var(--text-primary) !important;
}

/* Dropdown/select options */
#grid4-app-shell select option {
  background-color: var(--surface-primary-bg) !important;
  color: var(--text-primary) !important;
}

/* Labels */
#grid4-app-shell label,
#grid4-app-shell .control-label {
  color: var(--text-primary) !important;
  font-weight: 500 !important;
  font-size: var(--g4-font-size-base) !important;
  margin-bottom: 0.1rem !important;
  align-content: flex-start !important;
}
/* AA Options modal: fix "Set Custom" label spacing and slider alignment */
#options-basic-content .control-group.fail-setting > .control-label {
    width: 200px;
    text-align: left !important;
}
#options-basic-content .control-group.fail-setting > .controls {
    margin-left: 215px;
}

/* Buttons */
#grid4-app-shell .btn {
  border-radius: var(--g4-radius-md) !important;
  font-weight: 600 !important;
  transition: all 150ms ease !important;
  text-shadow: none !important;
}

#grid4-app-shell .btn-primary {
  background-color: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
  color: #fff !important;
  background-image: none !important;
}
#grid4-app-shell .btn-primary:hover {
  background-color: var(--accent-secondary) !important;
  border-color: var(--accent-secondary) !important;
  transform: translateY(-0.0625rem);
  box-shadow: 0 0.125rem 0.35rem rgba(var(--accent-primary-rgb), 0.24);
}

#grid4-app-shell .btn-default,
#grid4-app-shell .btn-secondary {
  background-color: var(--surface-secondary-bg) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
  background-image: none !important;
}
#grid4-app-shell .btn-default:hover,
#grid4-app-shell .btn-secondary:hover {
  background-color: var(--border-color) !important;
  border-color: var(--text-secondary) !important;
}

/* Links */
#grid4-app-shell a {
  color: var(--accent-primary);
}
#grid4-app-shell a:hover {
  color: var(--accent-secondary);
}

#grid4-app-shell.theme-dark a:hover {
  color: var(--g4-brand-white);
}

/* Headings */
#grid4-app-shell h1,
#grid4-app-shell h2,
#grid4-app-shell h3,
#grid4-app-shell h4,
#grid4-app-shell h5,
#grid4-app-shell h6 {
  color: var(--heading-color, var(--text-primary)) !important;
  font-family: var(--g4-font-family-heading) !important;
  font-weight: var(--g4-font-weight-bold) !important;
  letter-spacing: 0.01em;
  padding: .25rem;
}

/* Alerts */
#grid4-app-shell .alert {
    border-radius: var(--g4-radius-md);
    color: var(--text-primary) !important;
    background-color: rgba(var(--accent-primary-rgb), 0.14) !important;
    font-size: .825rem;
    font-weight: var(--g4-font-weight-semibold);
    border: 1px solid rgba(var(--accent-primary-rgb), 0.28) !important;
    box-shadow: inset 0 0 0 1px rgba(var(--accent-primary-rgb), 0.08);
}

/* Blue Banner Buttons - Special case for masquerade mode */
#grid4-app-shell .ns-masquerade-banner .btn,
#grid4-app-shell .notification-banner .btn,
#grid4-app-shell div[style*="background-color: rgb(91, 192, 222)"] .btn,
#grid4-app-shell .alert-info .btn {
  background-color: var(--g4-brand-navy) !important;
  border-color: var(--g4-brand-navy) !important;
  color: #ffffff !important;
  padding: 0.3125rem 0.5rem !important;
  font-family: var(--g4-font-family-heading) !important;
  font-weight: var(--g4-font-weight-bold) !important;
  letter-spacing: 0.01em;
}

/* Page Refresh Button (recreated in action-container-right) */
#grid4-app-shell .action-container-right #pageRefresh,
#grid4-app-shell #pageRefresh {
  /* Base button styling consistent with theme */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  vertical-align: middle !important;
  width: 30px !important;
  min-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  margin-right: 0 !important;
  background: var(--accent-primary) !important;
  color: #fff !important;
  border: .9px solid var(--accent-primary) !important;
  border-radius: var(--g4-radius-md) !important;
  line-height: 1 !important;
  text-decoration: none !important;
  padding: 0 !important;
  font-weight: 600 !important;
  transition: all 150ms ease !important;
  box-sizing: border-box !important;
}

/* Hover state for refresh button */
#grid4-app-shell .action-container-right #pageRefresh:hover,
#grid4-app-shell #pageRefresh:hover {
  background: var(--accent-secondary) !important;
  border-color: var(--accent-secondary) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 0.125rem 0.5rem rgba(var(--accent-primary-rgb), 0.28) !important;
}

/* Active/pressed state */
#grid4-app-shell .action-container-right #pageRefresh:active,
#grid4-app-shell #pageRefresh:active {
  transform: translateY(0) !important;
  box-shadow: none !important;
}

/* Ensure refresh icon displays correctly */
#grid4-app-shell #pageRefresh .icon-refresh {
  /* Prevent global icon filters from affecting this specific icon */

  position: relative !important;
  top: 0 !important;
  display: inline-block !important;
  margin: 0 !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

/* Dark theme specific adjustments for refresh button */
#grid4-app-shell #pageRefresh .icon-refresh {
  /* Allow icon to inherit button's white text color in dark mode */
  color: white !important;
 filter: invert(1) brightness(2) !important;
}

/* Refresh button positioning - let it inherit container's layout */
#grid4-app-shell .action-container-right > #pageRefresh {
  /* Use inline-block for consistent alignment without forcing float behavior */
  display: inline-flex !important;
}

/* Masquerade Button (recreated in user-edit form-actions) */
#grid4-app-shell #g4-masquerade-action-btn {
  /* Use secondary button styling to not compete with "Save" */
  background-color: var(--surface-secondary-bg) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  padding: 6px 10px !important;
  margin-left: 0.5rem !important; /* Space from Save/Cancel */
  transition: all 150ms ease !important;
  position: relative !important;
  display: inline-block !important;
}

/* Style the nsicon inside the button */
#grid4-app-shell #g4-masquerade-action-btn .nsicon {
  margin-right: 5px !important;
  font-size: 14px !important;
}

/* Ensure nsicon font is loaded and displays correctly */
#grid4-app-shell #g4-masquerade-action-btn .nsicon-masquerade:before {
  content: "\e91f" !important; /* Unicode for masquerade icon */
}

/* Dark theme: Adjust icon color for visibility */
#grid4-app-shell.theme-dark #g4-masquerade-action-btn {
  color: #e9ecef !important;
}

#grid4-app-shell #g4-masquerade-action-btn:hover {
  background-color: var(--border-color) !important;
  border-color: var(--text-secondary) !important;
}

/* Dark theme hover state adjustment */
#grid4-app-shell.theme-dark #g4-masquerade-action-btn:hover {
  background-color: rgba(255, 255, 255, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

/* ===================================
   7. DOMAIN/MASQUERADE BANNER POSITIONING
   =================================== */

/* Vendor renders duplicate empty banner placeholders outside .fixed-container.
   Hide the clones so only the real fixed banner participates visually. */
.fixed-container {
  padding-top: 0.08rem;
  box-sizing: border-box;
}

.mask-bar:empty,
#domain-message:empty {
  display: none !important;
}

/* DO NOT reposition the domain banner - let NetSapiens handle it */
/* Vendor portal.php forces a 40px outer strip and a 970px inner min-width.
   Keep the chrome on the outer alert and the inner container layout-only. */
.fixed-container > #domain-message {
  background: var(--g4-banner-bg) !important;
  border: 1px solid var(--g4-banner-border) !important;
  width: auto !important;
  max-width: min(calc(100% - 1.5rem), 60rem) !important;
  min-height: 40px !important;
  height: auto !important;
  margin: 0.05rem auto 0 !important;
  padding: 0.32rem 0.85rem !important;
  position: relative;
  border-radius: 0.9rem !important;
  box-sizing: border-box !important;
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.22) !important;
}

.fixed-container > #domain-message .domain-message-container {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr) !important;
  align-items: center !important;
  column-gap: 0.75rem !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
  position: relative;
}

.fixed-container > #domain-message .domain-message-buttons {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  margin: 0 !important;
  flex: 0 0 auto !important;
}

.fixed-container > #domain-message .domain-message-buttons:first-child {
  justify-self: start !important;
}

.fixed-container > #domain-message .domain-message-buttons:last-child {
  justify-self: end !important;
}

.fixed-container > #domain-message .domain-message-buttons .btn {
  margin: 0 !important;
  padding: 0 0.95rem !important;
  height: var(--g4-banner-button-height) !important;
  min-height: var(--g4-banner-button-height) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.45rem !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-color: var(--g4-banner-button-bg) !important;
  color: var(--g4-banner-button-text) !important;
  border: 1px solid var(--g4-banner-button-border) !important;
  font-family: var(--g4-font-family-heading) !important;
  font-weight: var(--g4-font-weight-bold) !important;
  letter-spacing: 0.01em;
  text-shadow: none !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 0.55rem 1rem rgba(0, 0, 0, 0.14) !important;
  opacity: 1 !important;
}

.fixed-container > #domain-message .domain-message-buttons .btn .fa,
.fixed-container > #domain-message .domain-message-buttons .btn i {
  color: inherit !important;
}

body.theme-dark .fixed-container > #domain-message .domain-message-buttons:first-child .btn,
body.theme-light .fixed-container > #domain-message .domain-message-buttons:first-child .btn {
  background-color: var(--g4-banner-action-view-bg) !important;
  border-color: var(--g4-banner-action-view-bg) !important;
  color: var(--g4-banner-action-view-text) !important;
}

body.theme-dark .fixed-container > #domain-message .domain-message-buttons:first-child .btn:hover,
body.theme-dark .fixed-container > #domain-message .domain-message-buttons:first-child .btn:focus,
body.theme-light .fixed-container > #domain-message .domain-message-buttons:first-child .btn:hover,
body.theme-light .fixed-container > #domain-message .domain-message-buttons:first-child .btn:focus {
  background-color: var(--g4-banner-action-view-hover-bg) !important;
  border-color: var(--g4-banner-action-view-hover-bg) !important;
  color: var(--g4-banner-action-view-text) !important;
}

body.theme-dark .fixed-container > #domain-message button[data-modal-path*="/domains/edit/"],
body.theme-light .fixed-container > #domain-message button[data-modal-path*="/domains/edit/"] {
  background-color: var(--g4-banner-action-edit-bg) !important;
  border-color: var(--g4-banner-action-edit-bg) !important;
  color: var(--g4-banner-action-edit-text) !important;
}

body.theme-dark .fixed-container > #domain-message button[data-modal-path*="/domains/edit/"]:hover,
body.theme-dark .fixed-container > #domain-message button[data-modal-path*="/domains/edit/"]:focus,
body.theme-light .fixed-container > #domain-message button[data-modal-path*="/domains/edit/"]:hover,
body.theme-light .fixed-container > #domain-message button[data-modal-path*="/domains/edit/"]:focus {
  background-color: var(--g4-banner-action-edit-hover-bg) !important;
  border-color: var(--g4-banner-action-edit-hover-bg) !important;
  color: var(--g4-banner-action-edit-text) !important;
}

body.theme-dark .fixed-container > #domain-message a[href*="/uiconfigs/"],
body.theme-light .fixed-container > #domain-message a[href*="/uiconfigs/"] {
  background-color: var(--g4-banner-action-configs-bg) !important;
  border-color: var(--g4-banner-action-configs-bg) !important;
  color: var(--g4-banner-action-configs-text) !important;
}

body.theme-dark .fixed-container > #domain-message a[href*="/uiconfigs/"]:hover,
body.theme-dark .fixed-container > #domain-message a[href*="/uiconfigs/"]:focus,
body.theme-light .fixed-container > #domain-message a[href*="/uiconfigs/"]:hover,
body.theme-light .fixed-container > #domain-message a[href*="/uiconfigs/"]:focus {
  background-color: var(--g4-banner-action-configs-hover-bg) !important;
  border-color: var(--g4-banner-action-configs-hover-bg) !important;
  color: var(--g4-banner-action-configs-text) !important;
}

.fixed-container > #domain-message .domain-message-text {
  grid-column: 2 !important;
  justify-self: center !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  font-family: var(--g4-font-family-heading) !important;
  font-size: 0.79rem !important;
  font-weight: var(--g4-font-weight-semibold) !important;
  line-height: 1.35 !important;
  letter-spacing: 0.01em !important;
}

.fixed-container > #domain-message .domain-message-text .domain-description,
.fixed-container > #domain-message .domain-message-text .banner-text,
.fixed-container > .mask-bar .domain-message-text .banner-text {
  font-size: inherit !important;
  line-height: inherit !important;
  white-space: normal !important;
}

body.theme-dark .fixed-container > #domain-message,
body.theme-dark .fixed-container > #domain-message .domain-message-container,
body.theme-dark .fixed-container > #domain-message .domain-message-text,
body.theme-dark .fixed-container > #domain-message .domain-message-text .domain-description,
body.theme-dark .fixed-container > #domain-message .domain-message-text .banner-text,
body.theme-dark .fixed-container > #domain-message .domain-message-text .nsicon,
body.theme-dark .fixed-container > #domain-message h5 {
  color: var(--text-primary) !important;
}

body.theme-dark .fixed-container > #domain-message .btn {
  background-color: var(--g4-banner-button-bg) !important;
  color: var(--g4-banner-button-text) !important;
  border: 1px solid var(--g4-banner-button-border) !important;
}

body.theme-dark .fixed-container > #domain-message .btn:hover,
body.theme-dark .fixed-container > #domain-message .btn:focus {
  background-color: var(--g4-banner-button-hover-bg) !important;
  color: #f1f6fd !important;
}

.fixed-container > #domain-message h5 {
  margin: 0 !important;
  font-family: var(--g4-font-family-heading) !important;
  font-size: 0.75rem !important;
  font-weight: var(--g4-font-weight-semibold) !important;
  line-height: 1.35 !important;
}

/* Apply same styling to masquerade bar - match domain-message constraints */
.fixed-container > .mask-bar {
  background: var(--g4-banner-bg) !important;
  color: var(--text-primary) !important;
  width: auto !important;
  max-width: min(calc(100% - 1.5rem), 60rem) !important;
  min-height: 40px !important;
  height: auto !important;
  margin: 0.05rem auto 0 !important;
  padding: 0.32rem 0.85rem !important;
  border: 1px solid var(--g4-banner-border) !important;
  border-radius: 0.9rem !important;
  box-sizing: border-box !important;
  box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.22) !important;
}

.fixed-container > .mask-bar .mask-container {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto) minmax(0, 1fr) !important;
  align-items: center !important;
  column-gap: 0.75rem !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
}

.fixed-container > .mask-bar .domain-message-text,
body.theme-dark .fixed-container > .mask-bar .domain-message-text {
  grid-column: 2 !important;
  justify-self: center !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  text-align: center !important;
  color: var(--text-primary) !important;
  font-family: var(--g4-font-family-heading) !important;
  font-size: 0.79rem !important;
  font-weight: var(--g4-font-weight-semibold) !important;
  line-height: 1.35 !important;
}

.fixed-container > .mask-bar .domain-message-text .banner-text,
body.theme-dark .fixed-container > .mask-bar .domain-message-text .banner-text {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 0 !important;
  font-family: var(--g4-font-family-heading) !important;
  font-size: var(--g4-font-size-xs) !important;
  font-weight: var(--g4-font-weight-semibold) !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  color: inherit !important;
}

.fixed-container > .mask-bar .domain-message-text .nsicon,
body.theme-dark .fixed-container > .mask-bar .domain-message-text .nsicon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  width: 1.125rem !important;
  height: 1.125rem !important;
  font-size: 1.125rem !important;
  line-height: 1 !important;
  color: inherit !important;
}

.fixed-container > .mask-bar .btn {
  margin: 0 !important;
  padding: 0 0.95rem !important;
  height: var(--g4-banner-button-height) !important;
  min-height: var(--g4-banner-button-height) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.45rem !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
  font-size: var(--g4-font-size-sm) !important;
  white-space: nowrap !important;
  position: static !important;
  top: auto !important;
  text-shadow: none !important;
  box-shadow: 0 0.55rem 1rem rgba(0, 0, 0, 0.14) !important;
  background-color: var(--g4-banner-action-masq-bg) !important;
  color: var(--g4-banner-action-masq-text) !important;
  border: 1px solid var(--g4-banner-action-masq-bg) !important;
  border-radius: 0.75rem !important;
  font-family: var(--g4-font-family-heading) !important;
  font-weight: var(--g4-font-weight-bold) !important;
  letter-spacing: 0.01em;
  opacity: 1 !important;
}

body.theme-dark .fixed-container > .mask-bar .btn:hover,
body.theme-dark .fixed-container > .mask-bar .btn:focus {
  background-color: var(--g4-banner-action-masq-hover-bg) !important;
  border-color: var(--g4-banner-action-masq-hover-bg) !important;
  color: var(--g4-banner-action-masq-text) !important;
}

.fixed-container > .mask-bar .btn:hover,
.fixed-container > .mask-bar .btn:focus {
  background-color: var(--g4-banner-action-masq-hover-bg) !important;
  border-color: var(--g4-banner-action-masq-hover-bg) !important;
  color: var(--g4-banner-action-masq-text) !important;
}

.fixed-container > .mask-bar .domain-message-text .nsicon,
.fixed-container > .mask-bar .domain-message-text .banner-text {
  position: static !important;
  top: auto !important;
}

@media (max-width: 1480px) and (min-width: 769px) {
  .fixed-container > #domain-message,
  .fixed-container > .mask-bar {
    max-width: min(calc(100% - 35rem), 50rem) !important;
    padding: 0.24rem 0.65rem !important;
  }

  .fixed-container > #domain-message .domain-message-container,
  .fixed-container > .mask-bar .mask-container {
    column-gap: 0.5rem !important;
  }

  .fixed-container > #domain-message .domain-message-buttons {
    gap: 0.35rem !important;
  }

  .fixed-container > #domain-message .domain-message-buttons .btn,
  .fixed-container > .mask-bar .btn {
    height: var(--g4-banner-button-height-compact) !important;
    min-height: var(--g4-banner-button-height-compact) !important;
    padding: 0 0.72rem !important;
    font-size: 0.68rem !important;
  }

  .fixed-container > #domain-message h5,
  .fixed-container > #domain-message .domain-message-text,
  .fixed-container > #domain-message .domain-message-text .domain-description,
  .fixed-container > #domain-message .domain-message-text .banner-text,
  .fixed-container > .mask-bar .domain-message-text,
  .fixed-container > .mask-bar .domain-message-text .banner-text {
    font-size: 0.75rem !important;
  }
}

@media (max-width: 768px) {
  .fixed-container > #domain-message {
    max-width: min(calc(100% - 1rem), 100%) !important;
  }

  .fixed-container > #domain-message .domain-message-container,
  .fixed-container > .mask-bar .mask-container {
    grid-template-columns: minmax(0, 1fr) !important;
    row-gap: 0.45rem !important;
  }

  .fixed-container > #domain-message .domain-message-buttons,
  .fixed-container > #domain-message .domain-message-text,
  .fixed-container > .mask-bar .domain-message-text {
    grid-column: 1 !important;
    justify-self: center !important;
    flex: 0 0 100% !important;
  }

  .fixed-container > .mask-bar {
    max-width: min(calc(100% - 1rem), 100%) !important;
  }
}

/* Content will get dynamic padding via JavaScript */
#grid4-app-shell #content {
  transition: padding-top 0.3s ease; /* Smooth transition */
}

/* Modals (Themed via JS class injection) */
.modal.g4-themed,
.modal.theme-dark,
.modal.theme-light {
  --modal-bg: var(--surface-primary-bg);
  --modal-header-bg: var(--surface-secondary-bg);
  --modal-text: var(--text-primary);
  --modal-border: var(--border-color);
}

/* Dark theme modal adjustments */
.modal.g4-themed.theme-dark,
.modal.theme-dark,
body.theme-dark .modal {
  --modal-bg: #222;
  --modal-header-bg: #222;
  --modal-text: #e9ecef;
  --modal-border: rgba(255, 255, 255, 0.1);
  background: #222 !important;
}

/* Light theme modal adjustments */
.modal.g4-themed.theme-light,
.modal.theme-light,
body.theme-light .modal {
  --modal-bg: #ffffff;
  --modal-header-bg: #f8f9fa;
  --modal-text: #212529;
  --modal-border: #dee2e6;
}

/* Width-aware modal geometry.
   NetSapiens still ships many manager modals with left: 50% and a hard-coded
   margin-left: -300px. That happens to center 600px modals, but wider/narrower
   modals drift. JS measures the live width and populates these variables. */
.modal.g4-modal-measured,
.modal.g4-modal-measured.in,
.modal.g4-modal-measured.fade.in,
.modal.g4-modal-measured.show {
  right: auto !important;
  position: fixed !important;
  box-sizing: border-box;
  max-width: var(--g4-modal-max-width, calc(100vw - 2rem)) !important;
}

.modal.g4-modal-measured:not(.g4-modal-transform-centered):not(.g4-modal-viewport-fit),
.modal.g4-modal-measured.in:not(.g4-modal-transform-centered):not(.g4-modal-viewport-fit),
.modal.g4-modal-measured.fade.in:not(.g4-modal-transform-centered):not(.g4-modal-viewport-fit),
.modal.g4-modal-measured.show:not(.g4-modal-transform-centered):not(.g4-modal-viewport-fit) {
  left: 50% !important;
  top: 50% !important;
  margin-left: var(--g4-modal-margin-left, -300px) !important;
  margin-top: var(--g4-modal-margin-top, -250px) !important;
}

.modal.g4-modal-viewport-fit,
.modal.g4-modal-viewport-fit.in,
.modal.g4-modal-viewport-fit.fade.in,
.modal.g4-modal-viewport-fit.show {
  top: var(--g4-modal-top, clamp(1rem, 5vh, 3.25rem)) !important;
  margin-top: 0 !important;
  max-height: var(--g4-modal-available-height, 90vh) !important;
}

/* Bootstrap 2 keeps .modal.fade at opacity: 0 until .fade.in wins.
   Our measured/viewport-fit classes bypass the later generic .fade.in rule,
   so they still need an explicit visible state or the backdrop shows without
   the dialog. */
.modal.g4-modal-measured.in,
.modal.g4-modal-measured.fade.in,
.modal.g4-modal-measured.show,
.modal.g4-modal-viewport-fit.in,
.modal.g4-modal-viewport-fit.fade.in,
.modal.g4-modal-viewport-fit.show {
  opacity: 1 !important;
}

.modal.g4-modal-measured.fade,
.modal.g4-modal-measured.fade.in,
.modal.g4-modal-viewport-fit.fade,
.modal.g4-modal-viewport-fit.fade.in {
  -webkit-transition-property: opacity !important;
  -moz-transition-property: opacity !important;
  -o-transition-property: opacity !important;
  transition-property: opacity !important;
}

.modal.g4-modal-viewport-fit .modal-body,
.modal.g4-modal-viewport-fit .modal-body .modal-body-flex-container {
  min-height: 0 !important;
  max-height: var(--g4-modal-body-max-height, calc(90vh - 10rem)) !important;
  overflow-y: auto !important;
}

.modal .modal-footer .btn,
.modal .modal-footer button,
.modal .modal-footer a.btn {
  min-width: 5rem !important;
  min-height: 1.95rem !important;
  height: auto !important;
  padding-left: 0.8rem !important;
  padding-right: 0.8rem !important;
  line-height: 1.25 !important;
  white-space: nowrap !important;
  text-align: center !important;
}

/* Earlier theme-specific scrollbar colors were retired in favor of the unified
   tokenized scrollbar system near the end of the file. Keep this area free of
   color/track/thumb overrides so the final shared rules remain authoritative. */

/* Apply theme styles to all modals based on body theme class */
/* Override basicCSS.php white background on .modal */
body.theme-dark .modal {
  background: #222 !important; /* Dark background for dark theme */
  background-color: #333 !important;
  color: var(--modal-text) !important;
}

/* Override with more specific selectors to beat basicCSS.php */
body.theme-dark .modal.fade,
body.theme-dark .modal.in,
body.theme-dark .modal.fade.in {
  background: #222 !important;
  background-color: #222 !important;
}

/* Ensure light theme modals stay white */
body.theme-light .modal {
  background: white !important;
  background-color: white !important;
}

/* Override NetSapiens basic.css with maximum specificity */
body.theme-dark .modal .modal-content,
body.theme-dark .modal.in .modal-content,
body.theme-dark .modal.fade.in .modal-content,
body.theme-dark div.modal.in .modal-content,
body.theme-dark .modal-dialog .modal-content,
body.theme-dark .modal.in .modal-dialog .modal-content {
  background: #242b3a !important;
  background-color: #242b3a !important;
  color: #e9ecef !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  opacity: 1 !important;
}

body.theme-dark .modal .modal-header,
body.theme-dark .modal .modal-footer {
  background-color: var(--modal-header-bg) !important;
  border-color: var(--modal-border) !important;
  color: var(--modal-text) !important;
}

/* Light theme modals should have solid white background */
body.theme-light .modal .modal-content {
  background-color: #ffffff !important;
  color: #333333 !important;
  border: 1px solid #dee2e6 !important;
  opacity: 1 !important;
}

/* Theme-specific g4-themed modal content */
body.theme-dark .modal.g4-themed .modal-content {
  background-color: var(--modal-bg) !important;
  color: var(--modal-text) !important;
  border: 1px solid var(--modal-border) !important;
}

body.theme-light .modal.g4-themed .modal-content {
  background-color: #ffffff !important;
  color: #333333 !important;
  border: 1px solid #dee2e6 !important;
}
/* Theme-specific g4-themed modal header/footer */
body.theme-dark .modal.g4-themed .modal-header,
body.theme-dark .modal.g4-themed .modal-footer {
  background-color: var(--modal-header-bg) !important;
  border-color: var(--modal-border) !important;
}

body.theme-dark .modal.g4-themed .modal-footer {
  border-top: 0 !important;
  box-shadow: none !important;
  background-image: none !important;
}

body.theme-light .modal.g4-themed .modal-header,
body.theme-light .modal.g4-themed .modal-footer {
  background-color: #f8f9fa !important;
  border-color: #dee2e6 !important;
}
/* Theme-specific text colors */
body.theme-dark .modal.g4-themed .modal-header h3,
body.theme-dark .modal.g4-themed .modal-header h4,
body.theme-dark .modal.g4-themed .modal-header .modal-title {
  color: var(--modal-text) !important;
}

body.theme-light .modal.g4-themed .modal-header h3,
body.theme-light .modal.g4-themed .modal-header h4,
body.theme-light .modal.g4-themed .modal-header .modal-title {
  color: #212529 !important;
}

body.theme-dark .modal.g4-themed .close {
  color: var(--modal-text) !important;
  opacity: 0.6;
}

body.theme-light .modal.g4-themed .close {
  color: #212529 !important;
  opacity: 0.6;
}

.modal.g4-themed .close:hover {
  opacity: 1;
}

body.theme-dark #user-profile #configAuthenticatorBtn {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
}

body.theme-dark #user-profile #configAuthenticatorBtn:hover,
body.theme-dark #user-profile #configAuthenticatorBtn:focus {
  background: rgba(var(--g4-brand-sky-rgb), 0.12) !important;
  border-color: rgba(var(--g4-brand-sky-rgb), 0.28) !important;
}

body.theme-dark #user-profile #configAuthenticatorBtn .buttonText,
body.theme-dark #user-profile #configAuthenticatorBtn .iconBtnText,
body.theme-dark #user-profile #configAuthenticatorBtn .icon {
  color: var(--text-primary) !important;
}
/* Enhanced form elements in modals - Dark theme */
body.theme-dark .modal.g4-themed .form-control,
body.theme-dark .modal.g4-themed input[type="text"],
body.theme-dark .modal.g4-themed input[type="password"],
body.theme-dark .modal.g4-themed input[type="email"],
body.theme-dark .modal.g4-themed input[type="number"],
body.theme-dark .modal.g4-themed input[type="tel"],
body.theme-dark .modal.g4-themed input[type="search"],
body.theme-dark .modal.g4-themed input[type="url"],
body.theme-dark .modal.g4-themed input[type="date"],
body.theme-dark .modal.g4-themed input[type="time"],
body.theme-dark .modal.g4-themed input[type="datetime-local"],
body.theme-dark .modal.g4-themed select,
body.theme-dark .modal.g4-themed textarea {
  background-color: var(--surface-secondary-bg) !important;
  color: var(--modal-text) !important;
  border: 1px solid var(--modal-border) !important;
  padding: 8px 12px !important;
  line-height: 1.5 !important;
  height: auto !important;
/*  min-height: 34px !important; */
}

/* Enhanced form elements in modals - Light theme */
body.theme-light .modal.g4-themed .form-control,
body.theme-light .modal.g4-themed input[type="text"],
body.theme-light .modal.g4-themed input[type="password"],
body.theme-light .modal.g4-themed input[type="email"],
body.theme-light .modal.g4-themed input[type="number"],
body.theme-light .modal.g4-themed input[type="tel"],
body.theme-light .modal.g4-themed input[type="search"],
body.theme-light .modal.g4-themed input[type="url"],
body.theme-light .modal.g4-themed input[type="date"],
body.theme-light .modal.g4-themed input[type="time"],
body.theme-light .modal.g4-themed input[type="datetime-local"],
body.theme-light .modal.g4-themed select,
body.theme-light .modal.g4-themed textarea {
  background-color: #ffffff !important;
  color: #212529 !important;
  border: 1px solid #ced4da !important;
  padding: 8px 12px !important;
  line-height: 1.5 !important;
  height: auto !important;
/*  min-height: 34px !important; */
}

/* Fix select dropdown text cutoff */
/* body.theme-dark .modal.g4-themed select,
body.theme-light .modal.g4-themed select {
  padding-right: 30px !important;
} */

/* Keep text inputs from clipping in tight form layouts */
body.theme-dark .modal.g4-themed input,
body.theme-light .modal.g4-themed input {
  overflow: visible !important;
  text-overflow: ellipsis !important;
}

/* Textareas need real scrolling and resize handles; overflow:visible breaks drag-resize in several portal modals */
body.theme-dark .modal.g4-themed textarea,
body.theme-light .modal.g4-themed textarea {
  overflow: auto !important;
  overflow-x: hidden !important;
  text-overflow: clip !important;
  resize: vertical !important;
}

/* Focus states - Dark theme */
body.theme-dark .modal.g4-themed input:focus,
body.theme-dark .modal.g4-themed textarea:focus,
body.theme-dark .modal.g4-themed select:focus {
  background-color: var(--surface-primary-bg) !important;
  border-color: var(--accent-primary) !important;
  outline: none !important;
  box-shadow: 0 0 0 0.125rem rgba(var(--accent-primary-rgb), 0.25) !important;
}

/* Focus states - Light theme */
body.theme-light .modal.g4-themed input:focus,
body.theme-light .modal.g4-themed textarea:focus,
body.theme-light .modal.g4-themed select:focus {
  background-color: #ffffff !important;
  border-color: #0099ff !important;
  outline: none !important;
  box-shadow: 0 0 0 0.125rem rgba(0, 153, 255, 0.25) !important;
}

/* Keep timeframe specific-date datepair controls aligned inside the live modal.
   The add/edit timeframe flow can render outside #grid4-app-shell, so anchor
   directly to body.page-timeframes + #write-timeframe instead. */
body.page-timeframes #write-timeframe .date-picker-pair,
body.page-timeframes #write-timeframe .specific-date-rows {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

body.page-timeframes #write-timeframe .date-picker-pair {
  display: flex !important;
  flex-direction: column !important;
  padding: 10px !important;
}

body.page-timeframes #write-timeframe .date-picker-pair .time-input-row-sd {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0.35rem !important;
  width: 100% !important;
  max-width: 100% !important;
}

body.page-timeframes #write-timeframe .date-picker-pair .time-input-row-sd > span {
  margin-top: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  flex: 0 0 auto !important;
}

body.page-timeframes #write-timeframe .date-picker-pair .time-input-row-sd > span:empty {
  display: none !important;
}

body.page-timeframes #write-timeframe .date-picker-pair .time-input-row-sd > input {
  min-width: 0 !important;
  box-sizing: border-box !important;
}

body.page-timeframes #write-timeframe .date-picker-pair .time-input-row-sd > .date-of-day {
  width: 112px !important;
  flex: 0 0 112px !important;
}

body.page-timeframes #write-timeframe .date-picker-pair .time-input-row-sd > .time-input-sd {
  width: 92px !important;
  flex: 0 0 92px !important;
}

body.page-timeframes #write-timeframe .date-picker-pair .time-input-row-sd > button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  margin-left: auto !important;
  align-self: center !important;
  width: 30px !important;
  min-width: 30px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  line-height: 1 !important;
  text-align: center !important;
}

body.page-timeframes #write-timeframe .date-picker-pair .time-input-row-sd > button > i {
  margin: 0 !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}
.form-horizontal .controls {
    margin-left: 180px;
    width: auto;
}

body.theme-dark .modal.g4-themed .date-picker-pair {
  background-color: var(--modal-bg) !important;

}
/* Modal labels and help text */
.modal.g4-themed label {
  color: var(--modal-text) !important;
  font-weight: 500;
  background: none !important;
  background-color: transparent !important;
}
/* Removed - see Section 28 for theme-specific help text colors */

/* Fix form group backgrounds in modals */
.modal.g4-themed .form-group,
.modal.g4-themed .form-horizontal .control-group {
  background: none !important;
  background-color: transparent !important;
}

.modal.g4-themed .form-horizontal .control-group > .controls {
  background: none !important;
  background-color: transparent !important;
  box-shadow: none !important;
}

/* Modal form field fixes */
.modal.g4-themed input,
.modal.g4-themed select {
/*  padding: 1px 2px !important; */
  /* line-height: 1.4 !important; */
  /*height: auto !important; */
  min-height: 1rem !important;
}

.modal.g4-themed textarea {
  min-height: 5.25rem !important;
}

/* Legacy TTS/audio modals pair xlarge selects with message textareas.
   Keep the textarea aligned to that same control lane by default, but let the
   user resize it instead of clamping the box to one fixed width forever. */
body.page-autoattendants #audio-modal #text-to-speech #messageText,
body.page-music #write-music #messageText,
body.page-music #music-settings #messageText {
  box-sizing: border-box !important;
  width: 270px !important;
  min-width: 270px !important;
  max-width: 100% !important;
  min-height: 5.25rem !important;
  resize: both !important;
  overflow: auto !important;
  overflow-x: auto !important;
}

body.page-autoattendants #audio-modal .modal-footer > #save_tts_btn.btn.color-primary.span2,
body.page-music #write-music .modal-footer > #save_tts_btn.btn.color-primary.span2,
body.page-music #music-settings .modal-footer > #save_tts_btn.btn.color-primary.span2 {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 5rem !important;
  height: 1.95rem !important;
  min-height: 1.95rem !important;
  line-height: 1.25rem !important;
  padding-left: 0.9rem !important;
  padding-right: 0.9rem !important;
  box-sizing: border-box !important;
  text-align: center !important;
  vertical-align: middle !important;
}

/* The legacy audio modal footer ships multiple Save controls but only one is
   meant to surface for the active branch. Keep vendor placeholders hidden
   until the portal explicitly removes .hide from them. */
body.page-autoattendants #audio-modal .modal-footer > #save-js.hide,
body.page-autoattendants #audio-modal .modal-footer > #save-form.hide,
body.page-music #write-music .modal-footer > #save-js.hide,
body.page-music #write-music .modal-footer > #save-form.hide,
body.page-music #music-settings .modal-footer > #save-js.hide,
body.page-music #music-settings .modal-footer > #save-form.hide {
  display: none !important;
}

/* Call queue SMS settings use legacy .large keyword fields. Keep the
   response textareas on that same right edge instead of inheriting a wide
   modal textarea width. */
body.page-queues #write-queue #initiation_message,
body.page-queues #write-queue #initiation_needed_message,
body.page-queues #write-queue #termination_message,
body.page-queues #write-queue #no_agents_message,
body.page-queues #CallqueueEditForm #initiation_message,
body.page-queues #CallqueueEditForm #initiation_needed_message,
body.page-queues #CallqueueEditForm #termination_message,
body.page-queues #CallqueueEditForm #no_agents_message,
body.page-queues #CallqueueAddForm #initiation_message,
body.page-queues #CallqueueAddForm #initiation_needed_message,
body.page-queues #CallqueueAddForm #termination_message,
body.page-queues #CallqueueAddForm #no_agents_message,
body.page-queues form[action="/portal/callqueues/edit"] #initiation_message,
body.page-queues form[action="/portal/callqueues/edit"] #initiation_needed_message,
body.page-queues form[action="/portal/callqueues/edit"] #termination_message,
body.page-queues form[action="/portal/callqueues/edit"] #no_agents_message,
body.page-queues form[action="/portal/callqueues/add"] #initiation_message,
body.page-queues form[action="/portal/callqueues/add"] #initiation_needed_message,
body.page-queues form[action="/portal/callqueues/add"] #termination_message,
body.page-queues form[action="/portal/callqueues/add"] #no_agents_message {
  box-sizing: border-box !important;
  min-width: 210px !important;
  max-width: 360px !important;
  min-height: 5.25rem !important;
  resize: both !important;
  overflow: auto !important;
}

body.page-queues #write-queue #initiation_keyword,
body.page-queues #write-queue #termination_keyword,
body.page-queues #CallqueueEditForm #initiation_keyword,
body.page-queues #CallqueueEditForm #termination_keyword,
body.page-queues #CallqueueAddForm #initiation_keyword,
body.page-queues #CallqueueAddForm #termination_keyword,
body.page-queues form[action="/portal/callqueues/edit"] #initiation_keyword,
body.page-queues form[action="/portal/callqueues/edit"] #termination_keyword,
body.page-queues form[action="/portal/callqueues/add"] #initiation_keyword,
body.page-queues form[action="/portal/callqueues/add"] #termination_keyword {
  box-sizing: border-box !important;
  width: 210px !important;
  min-width: 210px !important;
  max-width: 210px !important;
}

/* Ensure modal buttons are clickable */
.modal.g4-themed .btn {
  position: relative;
  z-index: 1;
  pointer-events: auto !important;
}

/* Fix modal form labels */
.modal.g4-themed .control-label {
  color: var(--modal-text) !important;
  background: none !important;
  background-color: transparent !important;
}

/* Fix all form labels in modals for dark theme */
.modal.g4-themed.theme-dark .control-label,
.modal.theme-dark .control-label,
body.theme-dark .modal .control-label,
.modal.g4-themed .form-group label,
.modal.g4-themed label.control-label {
  background: none !important;
  background-color: transparent !important;
  color: var(--modal-text) !important;
}

/* Ensure all modal content is interactive */
.modal.g4-themed * {
  pointer-events: auto !important;
}

/* ===================================
   6. HOME PAGE SPECIFIC FIXES
   =================================== */

/* Fix home page panels and widgets */
#grid4-app-shell .home-panel-main,
#grid4-app-shell .omp-home,
#grid4-app-shell .home-content,
#grid4-app-shell .active-panel-home,
#grid4-app-shell .graphs-panel-home,
#grid4-app-shell .stats-panel-home {
  background-color: var(--app-bg) !important;
  color: var(--text-primary) !important;
}

/* Fix widget backgrounds */
#grid4-app-shell .rounded,
#grid4-app-shell .active-panel-home-meetings,
#grid4-app-shell .chart-container {
  background-color: var(--surface-primary-bg) !important;
  /*border: 2px solid  var(--border-color) !important; */
  border-radius: var(--g4-radius-lg) !important;
  padding: .1rem !important;
  margin-bottom: .1rem !important;
  /* margin-right: .15rem !important; */
}

/* Home dashboard cards need a lighter shell than the global glass treatment.
   The generic dark .rounded border is thick enough to create visible corner
   artifacts on the first card rail at desktop widths. */
body.page-home #grid4-app-shell .active-panel-home.rounded,
body.page-home #grid4-app-shell .graphs-panel-home.rounded,
body.page-home #grid4-app-shell .stats-panel-home.rounded,
body.page-home #grid4-app-shell .active-panel-home-meetings {
  border-radius: 12px !important;
  overflow: hidden !important;
}

body.theme-dark.page-home #grid4-app-shell .active-panel-home.rounded,
body.theme-dark.page-home #grid4-app-shell .graphs-panel-home.rounded,
body.theme-dark.page-home #grid4-app-shell .stats-panel-home.rounded,
body.theme-dark.page-home #grid4-app-shell .active-panel-home-meetings {
  background: rgba(var(--surface-primary-rgb), 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.11) !important;
  box-shadow: 0 0.9rem 1.8rem rgba(0, 0, 0, 0.28) !important;
}

body.theme-light.page-home #grid4-app-shell .active-panel-home.rounded,
body.theme-light.page-home #grid4-app-shell .graphs-panel-home.rounded,
body.theme-light.page-home #grid4-app-shell .stats-panel-home.rounded,
body.theme-light.page-home #grid4-app-shell .active-panel-home-meetings {
  background: rgba(var(--surface-primary-rgb), 0.97) !important;
  border: 1px solid rgba(var(--g4-brand-navy-rgb), 0.12) !important;
  box-shadow: 0 0.9rem 1.8rem rgba(var(--g4-brand-navy-rgb), 0.08) !important;
}

#grid4-app-shell .second-chart {
    float: left;
    width: 49%;
}

body.theme-dark #chart_div_AnnotationChart,
body.theme-dark #chart_div_AnnotationChart_borderDiv,
body.theme-dark #chart_div_AnnotationChart_borderDiv > div,
body.theme-dark #chart_div_AnnotationChart_chartContainer,
body.theme-dark #chart_div_AnnotationChart_containerTable,
body.theme-dark #grid4-app-shell #cc-stats-div,
body.theme-dark #grid4-app-shell #modal-graph-div,
body.theme-dark #grid4-app-shell #chart_div2,
body.theme-dark #grid4-app-shell #chart_div3,
body.theme-dark #grid4-app-shell #chart_div4 {
  background: var(--surface-primary-bg) !important;
  background-color: var(--surface-primary-bg) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

body.theme-dark div#chart_div_AnnotationChart_legendContainer,
body.theme-dark #chart_div_AnnotationChart svg text,
body.theme-dark #chart_div_AnnotationChart svg tspan,
body.theme-dark #chart_div svg text,
body.theme-dark #chart_div svg tspan,
body.theme-dark #grid4-app-shell #cc-stats-div svg text,
body.theme-dark #grid4-app-shell #cc-stats-div svg tspan,
body.theme-dark #grid4-app-shell #modal-graph-div svg text,
body.theme-dark #grid4-app-shell #modal-graph-div svg tspan,
body.theme-dark #grid4-app-shell #chart_div2 svg text,
body.theme-dark #grid4-app-shell #chart_div2 svg tspan,
body.theme-dark #grid4-app-shell #chart_div3 svg text,
body.theme-dark #grid4-app-shell #chart_div3 svg tspan,
body.theme-dark #grid4-app-shell #chart_div4 svg text,
body.theme-dark #grid4-app-shell #chart_div4 svg tspan {
  color: var(--text-primary) !important;
  fill: var(--text-primary) !important;
  stroke: none !important;
  stroke-width: 0 !important;
  stroke-opacity: 0 !important;
  paint-order: fill !important;
  filter: none !important;
  text-shadow: none !important;
}

body.theme-dark #chart_div svg rect[fill="#ffffff"],
body.theme-dark #grid4-app-shell #cc-stats-div svg rect[fill="#ffffff"],
body.theme-dark #grid4-app-shell #modal-graph-div svg rect[fill="#ffffff"],
body.theme-dark #grid4-app-shell #chart_div2 svg rect[fill="#ffffff"],
body.theme-dark #grid4-app-shell #chart_div3 svg rect[fill="#ffffff"],
body.theme-dark #grid4-app-shell #chart_div4 svg rect[fill="#ffffff"] {
  fill: var(--surface-primary-bg) !important;
}

body.theme-dark #chart_div svg rect[fill="#ebebeb"],
body.theme-dark #chart_div svg rect[fill="#cccccc"],
body.theme-dark #chart_div svg rect[fill="#ececf7"],
body.theme-dark #chart_div svg rect[fill="#f7f7fc"],
body.theme-dark #chart_div svg rect[fill="#f2f2f2"],
body.theme-dark #chart_div svg rect[fill="#ababab"],
body.theme-dark #grid4-app-shell #cc-stats-div svg rect[fill="#ebebeb"],
body.theme-dark #grid4-app-shell #cc-stats-div svg rect[fill="#cccccc"],
body.theme-dark #grid4-app-shell #cc-stats-div svg rect[fill="#ececf7"],
body.theme-dark #grid4-app-shell #modal-graph-div svg rect[fill="#ebebeb"],
body.theme-dark #grid4-app-shell #modal-graph-div svg rect[fill="#cccccc"],
body.theme-dark #grid4-app-shell #chart_div2 svg rect[fill="#ebebeb"],
body.theme-dark #grid4-app-shell #chart_div2 svg rect[fill="#cccccc"],
body.theme-dark #grid4-app-shell #chart_div3 svg rect[fill="#ebebeb"],
body.theme-dark #grid4-app-shell #chart_div3 svg rect[fill="#cccccc"],
body.theme-dark #grid4-app-shell #chart_div4 svg rect[fill="#ebebeb"],
body.theme-dark #grid4-app-shell #chart_div4 svg rect[fill="#cccccc"],
body.theme-dark #grid4-app-shell #chart_div2 svg rect[fill="#f7f7fc"],
body.theme-dark #grid4-app-shell #chart_div3 svg rect[fill="#f7f7fc"],
body.theme-dark #grid4-app-shell #chart_div4 svg rect[fill="#f7f7fc"],
body.theme-dark #grid4-app-shell #chart_div2 svg rect[fill="#f2f2f2"],
body.theme-dark #grid4-app-shell #chart_div3 svg rect[fill="#f2f2f2"],
body.theme-dark #grid4-app-shell #chart_div4 svg rect[fill="#f2f2f2"],
body.theme-dark #grid4-app-shell #chart_div2 svg rect[fill="#ababab"],
body.theme-dark #grid4-app-shell #chart_div3 svg rect[fill="#ababab"],
body.theme-dark #grid4-app-shell #chart_div4 svg rect[fill="#ababab"] {
  fill: var(--border-color) !important;
}

body.theme-dark #grid4-app-shell .loading-container,
body.theme-dark #grid4-app-shell .loading-container.relative,
body.theme-dark #grid4-app-shell .loading-container.chart_div,
body.theme-dark #grid4-app-shell .loading-container.chart_div2,
body.theme-dark #grid4-app-shell .loading-container.chart_div3,
body.theme-dark #grid4-app-shell .loading-container.chart_div4,
body.theme-dark #grid4-app-shell .loading-lg.chart_div,
body.theme-dark #grid4-app-shell .loading-lg.chart_div2,
body.theme-dark #grid4-app-shell .loading-lg.chart_div3,
body.theme-dark #grid4-app-shell .loading-lg.chart_div4 {
  background: var(--surface-primary-bg) !important;
  background-color: var(--surface-primary-bg) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--g4-radius-lg) !important;
}

body.theme-dark #grid4-app-shell .chart-container,
body.theme-dark #grid4-app-shell #chart_div,
body.theme-dark #grid4-app-shell #cc-stats-div,
body.theme-dark #grid4-app-shell #modal-graph-div {
  transition: none !important;
}

body.theme-dark #grid4-app-shell .loading-spinner > div,
body.theme-dark #grid4-app-shell .la-ball-spin-clockwise > div {
  background-color: var(--accent-primary) !important;
}
/* Fix stats tables */
#grid4-app-shell .stats-table,
#grid4-app-shell .usage-stats-table {
  color: var(--text-primary) !important;
}

#grid4-app-shell .stats-table td,
#grid4-app-shell .usage-stats-table td {
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

#agent-callgraphs-body
 {
    min-height: 475px !important;

 }

/* Fix any remaining text contrast issues */
#grid4-app-shell span,
#grid4-app-shell p,
#grid4-app-shell div {
  /* color: inherit; */
}

/* Ensure all text in light theme is dark */
#grid4-app-shell.theme-light * {
  color: var(--text-primary);
}

/* Light theme specific enhancements */
#grid4-app-shell.theme-light #navigation {
  box-shadow: 0.125rem 0 0.75rem rgba(0, 0, 0, 0.08);
}

#grid4-app-shell.theme-light #header {
  box-shadow: 0 0.125rem 0.75rem rgba(0, 0, 0, 0.08);
}

#grid4-app-shell.theme-light .nav-link:hover {
  background-color: var(--accent-primary);
  color: #ffffff !important;
}

#grid4-app-shell.theme-light .nav-link:hover .fa,
#grid4-app-shell.theme-light .nav-link:hover .nav-text {
  color: #ffffff !important;
}

#grid4-app-shell.theme-light #grid4-theme-toggle {
  border-color: #dee2e6;
  color: #495057;
}

#grid4-app-shell.theme-light #grid4-theme-toggle:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* But preserve specific colors for certain elements */
/* Old (too specific) */
/* #grid4-app-shell a:not(.nav-link):not(.btn):not(.label):not(#LinkPager50):not(#LinkPager25):not(#LinkPager100):not(li.active a) {
  color: var(--accent-primary) !important;
} */

/* New: same behavior, but only 1 ID specificity */
#grid4-app-shell a:not(.nav-link, .btn, .label, [id^="LinkPager"], li.active a) {
  color: var(--accent-primary) !important;
}
/* Fix nav tabs visibility */
#grid4-app-shell .nav-tabs {
  display: flex !important;
  align-items: flex-end !important;
  gap: 0.35rem !important;
  background-color: transparent !important;
  border-bottom: 1px solid var(--border-color) !important;
  margin-bottom: 0.9rem !important;
  padding-bottom: 0.15rem !important;
}

/* Some vendor flows intentionally hide shared tab strips inline (for example the
   Call Center Grid Settings mode). Let those inline-hidden tab rails stay hidden
   instead of forcing them back to flex. */
#grid4-app-shell .nav-tabs[style*="display:none"],
#grid4-app-shell .nav-tabs[style*="display: none"] {
  display: none !important;
}

#grid4-app-shell .nav-tabs > li {
  margin-bottom: 0 !important;
  background: transparent !important;
}

#grid4-app-shell .nav-tabs > li > a {
  color: var(--text-secondary) !important;
  background-color: rgba(var(--surface-secondary-rgb), 0.78) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 0.65rem 0.65rem 0 0 !important;
  padding: 0.62rem 1rem !important;
  margin-right: 0 !important;
  font-family: var(--g4-font-family-heading) !important;
  font-size: 0.84rem !important;
  font-weight: var(--g4-font-weight-semibold) !important;
  letter-spacing: 0.01em !important;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.03) !important;
  transition: all var(--g4-transition-fast) !important;
}

#grid4-app-shell .nav-tabs > li > a:hover {
  background-color: var(--surface-primary-bg) !important;
  border-color: rgba(var(--accent-primary-rgb), 0.3) !important;
  color: var(--text-primary) !important;
}

#grid4-app-shell .nav-tabs > li.active > a,
#grid4-app-shell .nav-tabs > li.active > a:hover,
#grid4-app-shell .nav-tabs > li.active > a:focus {
  color: var(--text-primary) !important;
  background-color: var(--surface-primary-bg) !important;
  border: 1px solid rgba(var(--accent-primary-rgb), 0.34) !important;
  border-bottom-color: var(--surface-primary-bg) !important;
  font-weight: 700 !important;
  box-shadow: 0 0.8rem 1.35rem rgba(var(--accent-primary-rgb), 0.08) !important;
}

/* Shared tabbed modal shell: vendor panes often use ad-hoc margins that leave
   rounded tabs visually disconnected from a square pane body. */
.modal.g4-themed .modal-body > .nav-tabs {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  position: relative !important;
  z-index: 2 !important;
}

.modal.g4-themed .modal-body > .tab-content {
  margin: -1px 0 0 0 !important;
  padding: 1rem !important;
  border: 1px solid var(--modal-border) !important;
  border-radius: 0 0.8rem 0.8rem 0.8rem !important;
  background-color: var(--modal-bg) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03) !important;
  position: relative !important;
  z-index: 1 !important;
}

body.theme-light .modal.g4-themed .modal-body > .tab-content {
  background-color: #fbfcfe !important;
}

/* Fix pagination */
#grid4-app-shell .pagination li > a,
#grid4-app-shell .pagination li > span {
  background-color: var(--surface-primary-bg) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

#grid4-app-shell .pagination li.active > a,
#grid4-app-shell .pagination li.active > span {
  background-color: var(--accent-primary) !important;
  border-color: var(--accent-primary) !important;
  color: #ffffff !important;
}

#grid4-app-shell .pagination li > a:hover {
  background-color: var(--surface-secondary-bg) !important;
  color: var(--accent-primary) !important;
}

/* ===================================
   8. TABLE HEADER FIXES
   =================================== */

/* Fix table headers - remove background per user preference */
#grid4-app-shell .table > thead > tr > th,
#grid4-app-shell table.table > thead > tr > th {
  /*background-color: transparent !important; */
  color: var(--text-primary) !important;
  border-bottom: 1px solid var(--border-color) !important;
  font-weight: 600 !important;
 padding: 5px 5px !important;
  white-space: nowrap;
}

/* Ensure header text and links are visible */
#grid4-app-shell .table > thead > tr > th,
#grid4-app-shell .table > thead > tr > th *,
#grid4-app-shell .table > thead > tr > th a {
  color: var(--text-primary) !important;
}

/* Sortable headers with proper styling */
#grid4-app-shell .table > thead > tr > th > a,
#grid4-app-shell .table > thead > tr > th.sortable > a {
  color: var(--text-primary) !important;
  text-decoration: none !important;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600 !important;
}

#grid4-app-shell .table > thead > tr > th > a:hover {
  color: var(--accent-primary) !important;
  text-decoration: underline !important;
}

/* Hide duplicate icons - NetSapiens adds their own */
#grid4-app-shell .table > thead > tr > th > a > i.fa,
#grid4-app-shell .table > thead > tr > th > a > .fa {
  display: none !important;
}

/* Sort indicators */
#grid4-app-shell .table > thead > tr > th > a.asc::after,
#grid4-app-shell .table > thead > tr > th > a.desc::after {
  font-family: 'FontAwesome';
  font-size: 12px;
  vertical-align: middle;
}

a.asc {
    background: unset;
}
a.desc {
    background: unset;
}

#grid4-app-shell .table > thead > tr > th > a.asc::after {
  content: "\f0d8"; /* fa-caret-up */
}

#grid4-app-shell .table > thead > tr > th > a.desc::after {
  content: "\f0d7"; /* fa-caret-down */
}

/* ===================================
   9. COLOR-PRIMARY BUTTON FIX
   =================================== */

/* Override .color-primary buttons to use theme colors */
#grid4-app-shell .btn.color-primary,
#grid4-app-shell a.btn.color-primary,
#grid4-app-shell input.btn.color-primary,
#grid4-app-shell button.btn.color-primary,
#grid4-app-shell .btn.helpsy.color-primary,
#grid4-app-shell input[type="submit"].btn.color-primary {
  background: var(--accent-primary) !important;
  background-image: none !important;
  background-color: var(--accent-primary) !important;
  color: #ffffff !important;
  font-weight: bold !important;
  border: 1px solid var(--accent-primary) !important;
  text-shadow: none !important;
  box-shadow: none !important;
  transition: all var(--g4-transition-fast) !important;
}

#grid4-app-shell .btn.color-primary:hover,
#grid4-app-shell a.btn.color-primary:hover,
#grid4-app-shell input.btn.color-primary:hover,
#grid4-app-shell button.btn.color-primary:hover {
  background: var(--accent-secondary) !important;
  background-image: none !important;
  border-color: var(--accent-secondary) !important;
  color: #ffffff !important;
  box-shadow: 0 0.125rem 0.25rem var(--shadow-color) !important;
}

#grid4-app-shell .btn.color-primary:active,
#grid4-app-shell .btn.color-primary:focus {
  background: var(--accent-secondary) !important;
  box-shadow: 0 0 0 0.1875rem rgba(var(--accent-primary-rgb), 0.25) !important;
}

/* ===================================
   10. MODERN ENHANCEMENTS
   =================================== */

/* Smooth focus transitions for better UX */
#grid4-app-shell *:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: var(--g4-radius-sm);
}

/* Better table responsiveness */
#grid4-app-shell .table-responsive {
  border-radius: var(--g4-radius-md);
  border: 2px solid var(--border-color);
  overflow: hidden;
}

/* Modern card-like panels with subtle depth */
#grid4-app-shell .panel {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#grid4-app-shell .panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.25rem 0.75rem var(--shadow-color);
}

/* Animated hover states for interactive elements */
#grid4-app-shell .btn,
#grid4-app-shell .nav-link,
#grid4-app-shell .clickable {
  position: relative;
  overflow: hidden;
}

#grid4-app-shell .btn::after,
#grid4-app-shell .nav-link::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 20%;
  background: rgba(255, 255, 255, 0.1);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

#grid4-app-shell .btn:active::after,
#grid4-app-shell .nav-link:active::after {
  width: 300px;
  height: 300px;
}

/* Early generic scrollbar styling retired in favor of the final tokenized
   scrollbar block near the end of the file. */

/* Modern skeleton loading states */
@keyframes skeleton-loading {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

#grid4-app-shell .skeleton-loading {
  background: linear-gradient(90deg,
    var(--surface-secondary-bg) 25%,
    var(--border-color) 50%,
    var(--surface-secondary-bg) 75%
  );
  background-size: 200px 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* ===================================
   10. RESPONSIVE DESIGN
   =================================== */

/* Responsive adjustments */
@media (max-width: 768px) {
  #grid4-app-shell #navigation {
    transform: translateX(-100%);
    transition: transform var(--g4-transition-normal);
  }
  #grid4-app-shell #navigation.mobile-open {
    transform: translateX(0);
  }
  #grid4-app-shell #content {
    margin-left: 0 !important;
  }
}

/* Print styles */
@media print {
  #grid4-app-shell #navigation,
  #grid4-app-shell #header {
    display: none !important;
  }
  #grid4-app-shell #content {
    margin-left: 0 !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  #grid4-app-shell {
    --border-color: currentColor !important;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  #grid4-app-shell * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ===================================
   11. ENHANCED UI ELEMENTS
   =================================== */

/* Glass-morphism effects for panels and modals */
#grid4-app-shell .panel,
#grid4-app-shell .modal-content,
#grid4-app-shell .rounded {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Dark theme glass effect */
#grid4-app-shell.theme-dark .panel,
#grid4-app-shell.theme-dark .modal-content,
#grid4-app-shell.theme-dark .rounded {
  background: rgba(var(--surface-primary-rgb), 0.85) !important;
  border: 4px solid rgba(255, 255, 255, 0.1);
}

/* Light theme glass effect - higher opacity for better readability */
#grid4-app-shell.theme-light .panel,
#grid4-app-shell.theme-light .modal-content,
#grid4-app-shell.theme-light .rounded {
  background: rgba(var(--surface-primary-rgb), 0.95) !important;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Glass effect for dropdown menus */
#grid4-app-shell .dropdown-menu {
  background: rgba(var(--surface-secondary-rgb), 0.95) !important;
  /* backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px); */
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Fix dropdown styling - removed hover activation to match portal default */
/* #grid4-app-shell .dropdown-menu {
  margin-top: -1px !important; /* Remove gap between trigger and menu
} */

#grid4-app-shell .btn-group.open > .dropdown-menu,
#grid4-app-shell .dropdown.open > .dropdown-menu {
  display: block !important;
}

/* Enhanced table styling with spacing */
#grid4-app-shell table.table {
  border-collapse: separate !important;
  border-spacing: unset !important;
  background-color: var(--app-bg) !important;


}

#grid4-app-shell .table tbody tr {
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

#grid4-app-shell .table tbody tr:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Icon sprite integration */
#grid4-app-shell [class^="icon-"]
/* #grid4-app-shell [class*=" icon-"] {
  background-image: url('https://ambitious-coast-0a8b2110f.1.azurestaticapps.net/reference/css/icons/light-glyphicons-halflings.png') !important;
} */

/* Extension number badges */
.extension-badge {
  display: inline-block;
  width: 24px;
  height: 24px;
  background-image: url('https://ambitious-coast-0a8b2110f.1.azurestaticapps.net/reference/css/icons/light-aa-icons.png');
  background-size: 480px 120px;
  vertical-align: middle;
}

.extension-badge-1 { background-position: 0 0; }
.extension-badge-2 { background-position: -24px 0; }
.extension-badge-3 { background-position: -48px 0; }
.extension-badge-4 { background-position: -72px 0; }
.extension-badge-5 { background-position: -96px 0; }
.extension-badge-6 { background-position: -120px 0; }
.extension-badge-7 { background-position: -144px 0; }
.extension-badge-8 { background-position: -168px 0; }
.extension-badge-9 { background-position: -192px 0; }
.extension-badge-0 { background-position: -216px 0; }

/* Smooth rounded corners */
#grid4-app-shell .panel,
#grid4-app-shell .modal-content,
#grid4-app-shell .dropdown-menu,
#grid4-app-shell .btn,
#grid4-app-shell .form-control,
#grid4-app-shell .table tbody tr {
  border-radius: 12px !important;
}

#grid4-app-shell .table tbody tr td:first-child {
  border-radius: 12px 0 0 12px !important;
}

#grid4-app-shell .table tbody tr td:last-child {
  border-radius: 0 12px 12px 0 !important;
}

/* Match table header corners to the rounded row treatment on the manager
   tables Brad flagged, without bleeding into modal or utility tables. */
#grid4-app-shell .users-panel-main .table thead th:first-child,
#grid4-app-shell .domains-panel-main .table thead th:first-child {
  border-top-left-radius: 12px !important;
}

#grid4-app-shell .users-panel-main .table thead th:last-child,
#grid4-app-shell .domains-panel-main .table thead th:last-child {
  border-top-right-radius: 12px !important;
}

/* Manager table polish: calmer hover, steadier action column, and
   header/body edge treatment that matches the rounded row language. */
#grid4-app-shell .users-panel-main .table,
#grid4-app-shell .domains-panel-main .table,
.vmail-panel-main #sort-vmail {
  border-collapse: separate !important;
  border-spacing: 0 0.18rem !important;
}

body.page-domains #grid4-app-shell .domains-panel-main .table {
  min-width: 100% !important;
}

#grid4-app-shell .users-panel-main .table thead th,
#grid4-app-shell .domains-panel-main .table thead th,
#grid4-app-shell .contacts-panel-main #contacts-table thead th,
#grid4-app-shell .inventory-panel-main .table thead th,
#grid4-app-shell .siptrunks-panel-main .table thead th,
#grid4-app-shell .callhistory-panel-main #call-history-table thead th,
#grid4-app-shell .uiconfigs-panel-main .ui-config-table thead th,
.vmail-panel-main #sort-vmail thead th {
  padding: 0.62rem 0.75rem !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  letter-spacing: 0.01em;
  background: var(--surface-secondary-bg) !important;
  border-top: 1px solid var(--border-color) !important;
  border-bottom: 1px solid var(--border-color) !important;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

#grid4-app-shell .users-panel-main .table thead th:first-child,
#grid4-app-shell .domains-panel-main .table thead th:first-child,
#grid4-app-shell .contacts-panel-main #contacts-table thead th:first-child,
#grid4-app-shell .inventory-panel-main .table thead th:first-child,
#grid4-app-shell .siptrunks-panel-main .table thead th:first-child,
#grid4-app-shell .callhistory-panel-main #call-history-table thead th:first-child,
#grid4-app-shell .uiconfigs-panel-main .ui-config-table thead th:first-child,
.vmail-panel-main #sort-vmail thead th:first-child {
  border-radius: 12px 0 0 12px !important;
}

/* Call History keeps a hidden Domain column first, so move the visible left cap to From Name. */
#grid4-app-shell .callhistory-panel-main #call-history-table thead th.domain-header.hide + th {
  border-radius: 12px 0 0 12px !important;
}

#grid4-app-shell .users-panel-main .table thead th:last-child,
#grid4-app-shell .domains-panel-main .table thead th:last-child,
#grid4-app-shell .contacts-panel-main #contacts-table thead th:last-child,
#grid4-app-shell .inventory-panel-main .table thead th:last-child,
#grid4-app-shell .siptrunks-panel-main .table thead th:last-child,
#grid4-app-shell .callhistory-panel-main #call-history-table thead th:last-child,
#grid4-app-shell .uiconfigs-panel-main .ui-config-table thead th:last-child,
.vmail-panel-main #sort-vmail thead th:last-child {
  border-radius: 0 12px 12px 0 !important;
}

#grid4-app-shell .users-panel-main .table tbody tr,
#grid4-app-shell .domains-panel-main .table tbody tr {
  box-shadow: none !important;
  transition: background-color 0.18s ease, color 0.18s ease !important;
}

#grid4-app-shell .users-panel-main .table tbody tr:hover,
#grid4-app-shell .domains-panel-main .table tbody tr:hover {
  transform: none !important;
  box-shadow: none !important;
}

#grid4-app-shell .users-panel-main .table-hover tbody tr:hover td,
#grid4-app-shell .domains-panel-main .table-hover tbody tr:hover td {
  transform: none !important;
}

#grid4-app-shell .users-panel-main .table td,
#grid4-app-shell .domains-panel-main .table td {
  padding: 0.48rem 0.75rem !important;
}

#grid4-app-shell .users-panel-main .table thead th:last-child,
#grid4-app-shell .users-panel-main .table tbody td.action-buttons,
#grid4-app-shell .domains-panel-main .table thead th:last-child,
#grid4-app-shell .domains-panel-main .table tbody td.action-buttons {
  width: 6.75rem !important;
  min-width: 6.75rem !important;
  text-align: right !important;
  padding-left: 0.5rem !important;
  padding-right: 0.75rem !important;
  white-space: nowrap !important;
  overflow: visible !important;
}

body.page-domains #grid4-app-shell .domains-panel-main .table thead th:last-child,
body.page-domains #grid4-app-shell .domains-panel-main .table tbody td.action-buttons {
  width: 7.25rem !important;
  min-width: 7.25rem !important;
}

/* Enhanced form elements */
#grid4-app-shell input[type="checkbox"],
#grid4-app-shell input[type="radio"] {
  accent-color: var(--accent-primary);
  width: .6rem;
  height: .6rem;
  cursor: pointer;
  margin-right: 8px;
}

/* Enhanced select dropdowns */
/* #grid4-app-shell select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px !important;
} */
/*
#grid4-app-shell.theme-dark select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
} */

/* Animated loading states */
@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

#grid4-app-shell .loading {
  position: relative;
  overflow: hidden;
}

#grid4-app-shell .loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(var(--accent-primary-rgb), 0.2) 50%,
    transparent 100%
  );
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Enhanced pagination */
#grid4-app-shell .pagination {
  gap: 4px;
  display: flex;
}

#grid4-app-shell .pagination li {
  margin: 0;
}

#grid4-app-shell .pagination li > a,
#grid4-app-shell .pagination li > span {
  border: none !important;
  border-radius: 8px !important;
  padding: 8px 14px !important;
  font-weight: 500;
  transition: all 0.2s ease;
}

#grid4-app-shell .pagination li:hover > a {
  transform: translateY(-2px);
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* Status indicators */
.status-indicator {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  position: relative;
}

.status-indicator.online {
  background: #28a745;
  box-shadow: 0 0 0 0.1875rem rgba(40, 167, 69, 0.2);
}

.status-indicator.busy {
  background: #dc3545;
  box-shadow: 0 0 0 0.1875rem rgba(220, 53, 69, 0.2);
}

.status-indicator.away {
  background: #ffc107;
  box-shadow: 0 0 0 0.1875rem rgba(255, 193, 7, 0.2);
}

/* Pulse animation for online status */
.status-indicator.online::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: #28a745;
  animation: pulse-glow 2s ease-in-out infinite;
}

/* Gradient-era scrollbar thumb styling retired in favor of the final tokenized
   scrollbar block near the end of the file. */

/* Remove custom tooltip - let browser handle native tooltips */

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===================================
   12. FORM ACTIONS FIX
   =================================== */

/* Fix form-actions/affix-form-actions styling */
#grid4-app-shell .form-actions,
#grid4-app-shell .affix-form-actions {
  background-color: var(--surface-secondary-bg) !important;
  border-top: 1px solid var(--border-color) !important;
  padding: 15px 20px !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  flex-wrap: wrap !important;
}

#grid4-app-shell .form-actions:not(.scroll-to-fixed-fixed),
#grid4-app-shell .affix-form-actions:not(.scroll-to-fixed-fixed) {
  width: 100% !important;
}

/* Let scrollToFixed keep ownership of the affixed bar geometry.
   A prior hard-coded left/right/width contract pushed user edit action bars
   underneath the contacts dock while fixed. */
#grid4-app-shell .affix-form-actions[style*="position: fixed"],
#grid4-app-shell .affix-form-actions[style*="position: absolute"] {
  box-sizing: border-box !important;
  max-width: calc(100% - 2.5rem) !important;
}

/* Fix button styling within form-actions */
#grid4-app-shell .form-actions .btn,
#grid4-app-shell .affix-form-actions .btn {
  margin: 0 !important;
}

#grid4-app-shell .form-actions .back-btn,
#grid4-app-shell .affix-form-actions .back-btn {
  margin-left: auto !important;
}

body.page-users #grid4-app-shell .form-actions.affix-form-actions,
body.page-users #grid4-app-shell .affix-form-actions {
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
}

body.page-users #grid4-app-shell .form-actions.affix-form-actions .back-btn,
body.page-users #grid4-app-shell .affix-form-actions .back-btn {
  float: none !important;
}

/* ===================================
   13. ADDITIONAL BUTTON FIXES
   =================================== */

/* Catch all buttons that might not have color-primary class */
#grid4-app-shell .btn:not(.btn-default):not(.btn-secondary):not(.btn-link):not(.btn-danger):not(.btn-warning):not(.btn-success):not(.btn-info):not(.cancel):not(.back-btn) {
  background: var(--accent-primary) !important;
  background-image: none !important;
  color: #ffffff !important;
  border: 1px solid var(--accent-primary) !important;
  text-shadow: none !important;
}

#grid4-app-shell .btn:not(.btn-default):not(.btn-secondary):not(.btn-link):not(.btn-danger):not(.btn-warning):not(.btn-success):not(.btn-info):not(.cancel):not(.back-btn):hover {
  background: var(--accent-secondary) !important;
  border-color: var(--accent-secondary) !important;
}

/* Specific fixes for Columns and Import buttons */
#grid4-app-shell .btn[value="Columns"],
#grid4-app-shell .btn[value="Import"],
#grid4-app-shell .btn.helpsy,
#grid4-app-shell button.btn:contains("Columns"),
#grid4-app-shell button.btn:contains("Import") {
  background: var(--accent-primary) !important;
  color: #ffffff !important;
  border-color: var(--accent-primary) !important;
}

/* Make the destructive Reset User action stand out */
#grid4-app-shell button#ButtonResetUser.btn.helpsy {
  background: #c43c3c !important;
  border-color: #c43c3c !important;
}

#grid4-app-shell button#ButtonResetUser.btn.helpsy:hover,
#grid4-app-shell button#ButtonResetUser.btn.helpsy:focus {
  background: #a92f2f !important;
  border-color: #a92f2f !important;
}

/* ===================================
   14. THEME SWITCHING SMOOTH TRANSITIONS
   =================================== */

/* Ensure full viewport theme switching */
body,
html {
  background-color: var(--app-bg) !important;
  transition: background-color var(--g4-transition-normal);
}

/* Fix any elements that might extend beyond the shell */
#grid4-app-shell {
  position: relative;
  z-index: auto; /* Changed from 1 to auto to not interfere with modals */
  /*overflow-x: hidden;*/
}

/* Smooth theme transitions */
body[data-theme-transitioning="true"] * {
  transition: background-color 300ms ease, color 300ms ease !important;
}

body[data-theme-transitioning="true"] #chart_div,
body[data-theme-transitioning="true"] #chart_div *,
body[data-theme-transitioning="true"] #cc-stats-div,
body[data-theme-transitioning="true"] #cc-stats-div *,
body[data-theme-transitioning="true"] #modal-graph-div,
body[data-theme-transitioning="true"] #modal-graph-div *,
body[data-theme-transitioning="true"] #chart_div2,
body[data-theme-transitioning="true"] #chart_div2 *,
body[data-theme-transitioning="true"] #chart_div3,
body[data-theme-transitioning="true"] #chart_div3 *,
body[data-theme-transitioning="true"] #chart_div4,
body[data-theme-transitioning="true"] #chart_div4 * {
  transition: none !important;
}

/* ===================================
   15. GLASSMORPHISM ENHANCEMENTS
   =================================== */

/* Glass effect for dropdowns and modals */
#grid4-app-shell .dropdown-menu {
  /* backdrop-filter: blur(12px); */
  /* -webkit-backdrop-filter: blur(12px); */
  background: rgba(var(--surface-primary-rgb), 0.98) !important;
  border: 1px solid rgba(var(--g4-brand-navy-rgb), 0.14) !important;
  box-shadow: 0 0.75rem 1.8rem rgba(var(--g4-brand-navy-rgb), 0.18) !important;
}

#grid4-app-shell.theme-dark .dropdown-menu {
  background: rgba(var(--surface-secondary-rgb), 0.96) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 0.85rem 2rem rgba(0, 0, 0, 0.35) !important;
}

#grid4-app-shell.theme-light .dropdown-menu {
  background: rgba(var(--surface-primary-rgb), 0.99) !important;
  border: 1px solid rgba(var(--g4-brand-navy-rgb), 0.14) !important;
  box-shadow: 0 0.85rem 2rem rgba(var(--g4-brand-navy-rgb), 0.16) !important;
}

/* Modal fixes - use Bootstrap's default positioning */
.modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 1040 !important;
  background-color: #000 !important;
}

.modal-backdrop.fade {
  opacity: 0 !important;
}

.modal-backdrop.in {
  opacity: 0.5 !important;
}

/* Let Bootstrap handle ALL modal positioning and animations */

.modal-content {
  position: relative !important;
  /* Let theme-specific rules handle background color */
  border: 2px solid rgba(0,0,0,.2) !important;
  border-radius: 6px !important;
  outline: 0 !important;
  pointer-events: auto !important;
  box-shadow: 0 0.1875rem 0.5625rem rgba(0,0,0,.5) !important;
  opacity: 1 !important; /* Ensure not transparent */
}

/* Dark theme modal content - High priority override */
body.theme-dark .modal-content,
.theme-dark .modal-content,
.modal.theme-dark .modal-content,
#grid4-app-shell.theme-dark ~ .modal .modal-content {
  background-color: var(--modal-bg) !important;
  border: 2px solid rgba(255,255,255,.2) !important;
  color: #e9ecef !important;
}

/* Light theme modal content - Explicit white background */
body.theme-light .modal-content {
  background-color: #ffffff !important;
  border: 2px solid rgba(0,0,0,.2) !important;
  color: #212529 !important;
}

/* Ensure modal content is not affected by shell styles */
.modal.g4-themed .modal-content,
.modal .modal-content {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  opacity: 1 !important;
  /* Remove forced white background - let theme rules handle it */
}

/* Override any transparent backgrounds on modals - respect theme */
body.theme-light .modal-content[style*="transparent"] {
  background-color: #ffffff !important;
}

body.theme-dark .modal-content[style*="transparent"] {
  background-color: #242b3a !important;
}
/* Force opaque backgrounds on all modal elements */
.modal-dialog,
.modal-content,
.modal-header,
.modal-body,
.modal-footer,
.dash-modal .modal-content,
#grid4-app-shell .modal-content,
body .modal .modal-content {
  opacity: 1 !important;
  background-color: var(--modal-bg) !important;
}

/* Fix modal display - let Bootstrap handle display states */
/* Removed .modal { display: none; } - this was breaking Bootstrap's show/hide mechanism */

/* Ensure modals are visible when shown */
.modal.in {
  display: block !important;
}

/* Removed conflicting fade and positioning rules - handled in Section 23 */

/* Backdrop handled by earlier rules at line 1644 */

/* Ensure modal elements are interactive */
.modal {
  pointer-events: auto !important;
}
.modal .modal-dialog,
.modal .modal-content,
.modal .modal-header,
.modal .modal-body,
.modal .modal-footer {
  pointer-events: auto !important;
}




/* Override any transform issues */
.modal-open .modal {
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

/* Ensure modal scrolling works */
.modal-open {
  overflow: hidden !important;
  padding-right: 0 !important;
}

/* Override any app shell styles that might interfere */
body.modal-open {
  overflow: hidden !important;
}

/* Remove pointer-events manipulation - it breaks modal interaction */
/* Let Bootstrap handle modal stacking naturally */

/* Modal Fix - Remove ALL positioning overrides, let Bootstrap handle it */
/* Only apply theming, no positioning changes */

/* Ensure proper z-index stacking for modals - Bootstrap default*/
/*
.modal-backdrop {
  z-index: 1040 !important;  Bootstrap default
} */

.modal {
  z-index: 1050 !important; /* Bootstrap default */
}

/* Don't modify domain message z-index - let NetSapiens handle it */

/* Let Bootstrap handle modal z-index stacking */

/* Enhanced form-actions with glass effect */
#grid4-app-shell .form-actions,
#grid4-app-shell .affix-form-actions {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(var(--surface-secondary-rgb), 0.8) !important;
}

/* ===================================
   16. CONTEXT-AWARE STYLING
   =================================== */

/* Page-specific enhancements */
body.page-users #grid4-app-shell .table-container,
body.page-domains #grid4-app-shell .table-container,
body.page-inventory #grid4-app-shell .table-container {
  max-width: 100%;
  padding: 0 1px 0.3rem !important;
  overflow-x: auto !important;
  overflow-y: visible !important;
  border: 1px solid rgba(var(--accent-primary-rgb), 0.08) !important;
  border-radius: 1rem !important;
  background: rgba(var(--surface-secondary-rgb), 0.18) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02) !important;
  scrollbar-gutter: stable both-edges;
}

body.page-users #grid4-app-shell .table-container.g4-table-overflowing,
body.page-domains #grid4-app-shell .table-container.g4-table-overflowing,
body.page-inventory #grid4-app-shell .table-container.g4-table-overflowing {
  border-width: 2px !important;
  border-color: rgba(var(--accent-primary-rgb), 0.18) !important;
  background: rgba(var(--surface-secondary-rgb), 0.34) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 0.65rem 1.4rem rgba(0, 0, 0, 0.12) !important;
}

.g4-sticky-table-scrollbar {
  position: fixed;
  left: 0;
  bottom: 0.75rem;
  width: 0;
  height: 1rem;
  display: none;
  overflow-x: auto;
  overflow-y: hidden;
  z-index: 1026;
  border: 1px solid var(--border-color) !important;
  border-radius: 999px;
  background: rgba(var(--surface-secondary-rgb), 0.94) !important;
  box-shadow: 0 0.5rem 1.2rem var(--shadow-color) !important;
  backdrop-filter: blur(10px);
}

.g4-sticky-table-scrollbar.is-visible {
  display: block;
}

.g4-sticky-table-scrollbar__inner {
  height: 1px;
}

.g4-sticky-table-scrollbar {
  scrollbar-width: thin;
  scrollbar-color: var(--g4-scrollbar-thumb) var(--g4-scrollbar-track);
}

.g4-sticky-table-scrollbar::-webkit-scrollbar {
  height: 0.75rem;
}

.g4-sticky-table-scrollbar::-webkit-scrollbar-track {
  background: var(--g4-scrollbar-track) !important;
  border-radius: 999px;
}

.g4-sticky-table-scrollbar::-webkit-scrollbar-thumb {
  background: var(--g4-scrollbar-thumb) !important;
  border-radius: 999px;
}

.g4-sticky-table-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--g4-scrollbar-thumb-hover) !important;
}

body.page-users #grid4-app-shell .action-container-left .input-append {
  display: inline-flex !important;
  align-items: stretch !important;
  max-width: min(100%, 36rem);
  vertical-align: top !important;
}

/* The Users search field keeps a stubborn vendor/browser light paint path in
   dark mode even when normal background/color overrides and inline styles
   report as applied. A scoped invert+hue-rotate on the compact wrapper gives
   the intended dark visual surface without disturbing the surrounding toolbar. */
body.theme-dark.page-users #grid4-app-shell .action-container-left .input-append {
  filter: invert(1) hue-rotate(180deg) !important;
}

body.page-users #grid4-app-shell #choices.search-query {
  width: clamp(17.5rem, 30vw, 33rem) !important;
  min-width: 17.5rem !important;
  min-height: 2.15rem !important;
  padding: 0.38rem 0.72rem !important;
  box-sizing: border-box !important;
}

body.page-users #grid4-app-shell .action-container-left .input-append > .btn {
  min-width: 2.25rem !important;
  min-height: 2.15rem !important;
  padding: 0 0.7rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

body.page-users #grid4-app-shell .action-container-left .input-append > .btn .icon-search {
  margin: 0 !important;
  width: 14px !important;
  height: 14px !important;
  line-height: 14px !important;
  display: inline-block !important;
  color: #ffffff !important;
  filter: brightness(0) invert(1) !important;
}

body.page-users #grid4-app-shell .action-container-right #pageRefresh {
  width: 1.875rem !important;
  min-width: 1.875rem !important;
  height: 1.875rem !important;
  min-height: 1.875rem !important;
  padding: 0 !important;
  margin-right: 0 !important;
  line-height: 1 !important;
  vertical-align: top !important;
}

body.page-users #grid4-app-shell .action-container-right #pageRefresh .icon-refresh {
  line-height: 1 !important;
  vertical-align: middle !important;
}

body.theme-light.page-users #grid4-app-shell .action-container-left,
body.theme-light.page-domains #grid4-app-shell .action-container-left {
  margin-bottom: 0.8rem !important;
}

body.theme-light.page-users #grid4-app-shell .action-container-left .input-append,
body.theme-light.page-domains #grid4-app-shell .action-container-left .input-append {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0 !important;
  padding: 0.18rem !important;
  background: rgba(248, 251, 254, 0.96) !important;
  border: 1px solid rgba(var(--g4-brand-navy-rgb), 0.12) !important;
  border-radius: 0.85rem !important;
  box-shadow: 0 0.65rem 1.4rem rgba(var(--g4-brand-navy-rgb), 0.08) !important;
}

body.theme-light.page-users #grid4-app-shell .action-container-left .search-query,
body.theme-light.page-domains #grid4-app-shell .action-container-left .search-query {
  background: transparent !important;
  border: 0 !important;
  color: var(--text-primary) !important;
  box-shadow: none !important;
  min-height: 2.15rem !important;
}

body.theme-light.page-users #grid4-app-shell .action-container-left .search-query::placeholder,
body.theme-light.page-domains #grid4-app-shell .action-container-left .search-query::placeholder {
  color: var(--text-muted) !important;
}

body.theme-light.page-users #grid4-app-shell .action-container-left .input-append > .btn,
body.theme-light.page-domains #grid4-app-shell .action-container-left .input-append > .btn {
  min-height: 2.15rem !important;
  border-radius: 0.65rem !important;
}

body.theme-light.page-users #grid4-app-shell .action-container-right,
body.theme-light.page-domains #grid4-app-shell .action-container-right,
body.theme-light.page-inventory #grid4-app-shell .action-container-right {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.35rem !important;
  margin-bottom: 0.85rem !important;
}

body.theme-light.page-users #grid4-app-shell .action-container-right .btn-group,
body.theme-light.page-domains #grid4-app-shell .action-container-right .btn-group,
body.theme-light.page-inventory #grid4-app-shell .action-container-right .btn-group {
  margin: 0 !important;
}

body.theme-light.page-users #grid4-app-shell .action-container-right .btn:not(.color-primary):not(.btn-danger),
body.theme-light.page-domains #grid4-app-shell .action-container-right .btn:not(.color-primary):not(.btn-danger),
body.theme-light.page-inventory #grid4-app-shell .action-container-right .btn:not(.color-primary):not(.btn-danger) {
  background: rgba(237, 243, 249, 0.96) !important;
  border-color: rgba(var(--g4-brand-navy-rgb), 0.12) !important;
  color: #38506a !important;
  box-shadow: 0 0.6rem 1.3rem rgba(var(--g4-brand-navy-rgb), 0.08) !important;
}

body.theme-light.page-users #grid4-app-shell #pageRefresh,
body.theme-light.page-domains #grid4-app-shell #pageRefresh,
body.theme-light.page-inventory #grid4-app-shell #pageRefresh {
  background: rgba(var(--g4-brand-sky-rgb), 0.94) !important;
  border-color: rgba(var(--g4-brand-sky-rgb), 0.96) !important;
  color: #ffffff !important;
  box-shadow: 0 0.7rem 1.45rem rgba(var(--g4-brand-sky-rgb), 0.24) !important;
}

body.theme-light.page-users #grid4-app-shell .action-container-right .btn:not(.color-primary):not(.btn-danger):hover,
body.theme-light.page-domains #grid4-app-shell .action-container-right .btn:not(.color-primary):not(.btn-danger):hover,
body.theme-light.page-inventory #grid4-app-shell .action-container-right .btn:not(.color-primary):not(.btn-danger):hover {
  background: rgba(var(--g4-brand-sky-rgb), 0.16) !important;
  border-color: rgba(var(--g4-brand-sky-rgb), 0.28) !important;
  color: #16344d !important;
}

body.theme-light.page-users #grid4-app-shell #pageRefresh:hover,
body.theme-light.page-domains #grid4-app-shell #pageRefresh:hover,
body.theme-light.page-inventory #grid4-app-shell #pageRefresh:hover {
  background: rgba(var(--g4-brand-sky-rgb), 1) !important;
  border-color: rgba(var(--g4-brand-sky-rgb), 1) !important;
  color: #ffffff !important;
  box-shadow: 0 0.85rem 1.6rem rgba(var(--g4-brand-sky-rgb), 0.28) !important;
}

body.theme-light.page-users #grid4-app-shell .action-container-right .btn.color-primary,
body.theme-light.page-domains #grid4-app-shell .action-container-right .btn.color-primary,
body.theme-light.page-inventory #grid4-app-shell .action-container-right .btn.color-primary {
  box-shadow: 0 0.7rem 1.45rem rgba(var(--g4-brand-sky-rgb), 0.22) !important;
}

@media (min-width: 1180px) and (max-width: 1319px) {
  body.page-users #grid4-app-shell .action-container-left .input-append {
    max-width: 23rem;
  }

  body.page-users #grid4-app-shell #choices.search-query {
    width: 20rem !important;
    min-width: 20rem !important;
  }

  body.page-users #grid4-app-shell .action-container-right > * + * {
    margin-left: 0.2rem !important;
  }

  body.page-users #grid4-app-shell .action-container-right .btn-group > .btn + .btn {
    margin-left: 0.2rem !important;
  }

  body.page-users #grid4-app-shell .action-container-right > .btn,
  body.page-users #grid4-app-shell .action-container-right > a.btn,
  body.page-users #grid4-app-shell .action-container-right > div > .btn,
  body.page-users #grid4-app-shell .action-container-right .btn-group > .btn,
  body.page-users #grid4-app-shell .action-container-right #pageRefresh {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
    font-size: 0.78rem !important;
  }
}

@media (min-width: 1320px) and (max-width: 1440px) {
  body.page-users #grid4-app-shell .action-container-left .input-append {
    max-width: 24rem;
  }

  body.page-users #grid4-app-shell #choices.search-query {
    width: 21rem !important;
    min-width: 21rem !important;
  }

  body.page-users #grid4-app-shell .action-container-left .input-append > .btn {
    min-width: 2rem !important;
    padding-left: 0.55rem !important;
    padding-right: 0.55rem !important;
  }

  body.page-users #grid4-app-shell .action-container-right > * + * {
    margin-left: 0.25rem !important;
  }

  body.page-users #grid4-app-shell .action-container-right .btn-group > .btn + .btn {
    margin-left: 0.25rem !important;
  }

  body.page-users #grid4-app-shell .action-container-right > .btn,
  body.page-users #grid4-app-shell .action-container-right > a.btn,
  body.page-users #grid4-app-shell .action-container-right > div > .btn,
  body.page-users #grid4-app-shell .action-container-right .btn-group > .btn,
  body.page-users #grid4-app-shell .action-container-right #pageRefresh {
    padding-left: 0.58rem !important;
    padding-right: 0.58rem !important;
    font-size: 0.8rem !important;
  }
}

body.page-users #grid4-app-shell .users-panel-main,
body.page-domains #grid4-app-shell .domains-panel-main,
body.page-inventory #grid4-app-shell .inventory-panel-main {
  border-radius: 1rem !important;
}

body.theme-light.page-users #grid4-app-shell .users-panel-main,
body.theme-light.page-domains #grid4-app-shell .domains-panel-main,
body.theme-light.page-inventory #grid4-app-shell .inventory-panel-main {
  padding: 0.85rem 0.95rem 1rem !important;
  background: rgba(243, 247, 252, 0.88) !important;
  border: 1px solid rgba(var(--g4-brand-navy-rgb), 0.1) !important;
  border-radius: 1rem !important;
  box-shadow: 0 1rem 2.2rem rgba(var(--g4-brand-navy-rgb), 0.06) !important;
}

body.theme-light.page-users #grid4-app-shell .users-panel-main .table-container,
body.theme-light.page-domains #grid4-app-shell .domains-panel-main .table-container,
body.theme-light.page-inventory #grid4-app-shell .inventory-panel-main .table-container {
  padding-right: 0 !important;
}

body.theme-light.page-users #grid4-app-shell .users-panel-main .table,
body.theme-light.page-domains #grid4-app-shell .domains-panel-main .table,
body.theme-light.page-inventory #grid4-app-shell .inventory-panel-main .table {
  border-spacing: 0 0.28rem !important;
}

body.theme-dark.page-inventory #grid4-app-shell .inventory-panel-main {
  padding: 0.85rem 0.95rem 1rem !important;
  background: rgba(12, 18, 30, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 1rem 2.2rem rgba(0, 0, 0, 0.22) !important;
  /* Keep the dark inventory shell on the same visual rail as light mode.
     After the row-height fix, the remaining drift was the outer panel box. */
  top: 1.5417px !important;
}

body.theme-dark.page-inventory #grid4-app-shell .inventory-panel-main .table-container {
  padding-right: 0 !important;
}

body.theme-dark.page-inventory #grid4-app-shell .inventory-panel-main .table {
  border-spacing: 0 0.28rem !important;
}

/* Global inventory tabs: let the table card itself span the full inventory panel
   width, then keep the bulk-select checkbox column aligned between header and
   body rows. */
body.theme-light.page-inventory #grid4-app-shell .inventory-panel-main,
body.theme-dark.page-inventory #grid4-app-shell .inventory-panel-main {
  padding: 0 !important;
}

body.page-inventory #grid4-app-shell .inventory-panel-main .table-container > .table {
  width: 100% !important;
  min-width: 100% !important;
}

body.page-inventory #grid4-app-shell .inventory-panel-main .table thead th.checkboxes,
body.page-inventory #grid4-app-shell .inventory-panel-main .table tbody td:first-child {
  width: 2.35rem !important;
  min-width: 2.35rem !important;
  padding-left: 0.75rem !important;
  padding-right: 0.5rem !important;
  text-align: left !important;
}

body.page-inventory #grid4-app-shell .inventory-panel-main .table thead th.checkboxes input.inventoryChkBox,
body.page-inventory #grid4-app-shell .inventory-panel-main .table tbody td:first-child input.inventoryChkBox {
  display: block !important;
  margin: 0 !important;
}

body.page-inventory #grid4-app-shell .inventory-panel-main .table thead th.checkboxes input.inventoryChkBox {
  position: relative !important;
  top: -3px !important;
}

body.theme-light.page-users #grid4-app-shell .users-panel-main .table thead th,
body.theme-light.page-domains #grid4-app-shell .domains-panel-main .table thead th,
body.theme-light.page-inventory #grid4-app-shell .inventory-panel-main .table thead th,
body.theme-light #grid4-app-shell .siptrunks-panel-main .table thead th,
body.theme-light.page-callhistory #grid4-app-shell .callhistory-panel-main #call-history-table thead th {
  background: rgba(227, 235, 245, 0.9) !important;
  color: #31435a !important;
  border-bottom: 1px solid rgba(var(--g4-brand-navy-rgb), 0.08) !important;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.45) !important;
}

body.theme-dark.page-inventory #grid4-app-shell .inventory-panel-main .table thead th {
  background: rgba(24, 33, 67, 0.92) !important;
  color: #edf2f8 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.05) !important;
}

body.theme-light.page-users #grid4-app-shell .users-panel-main .table tbody td,
body.theme-light.page-domains #grid4-app-shell .domains-panel-main .table tbody td,
body.theme-light.page-inventory #grid4-app-shell .inventory-panel-main .table tbody td {
  background: rgba(251, 252, 254, 0.96) !important;
  border-top: 1px solid rgba(var(--g4-brand-navy-rgb), 0.05) !important;
  border-bottom: 1px solid rgba(var(--g4-brand-navy-rgb), 0.05) !important;
  color: var(--text-primary) !important;
}

body.theme-dark.page-inventory #grid4-app-shell .inventory-panel-main .table tbody td {
  background: rgba(15, 23, 36, 0.96) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
  color: #edf2f8 !important;
  padding-bottom: 4px !important;
}

body.theme-light.page-users #grid4-app-shell .users-panel-main .table tbody tr:nth-child(even) td,
body.theme-light.page-domains #grid4-app-shell .domains-panel-main .table tbody tr:nth-child(even) td,
body.theme-light.page-inventory #grid4-app-shell .inventory-panel-main .table tbody tr:nth-child(even) td {
  background: rgba(242, 247, 252, 0.96) !important;
}

body.theme-dark.page-inventory #grid4-app-shell .inventory-panel-main .table tbody tr:nth-child(even) td {
  background: rgba(20, 29, 45, 0.96) !important;
}

body.theme-light.page-users #grid4-app-shell .users-panel-main .table-hover tbody tr:hover td,
body.theme-light.page-domains #grid4-app-shell .domains-panel-main .table-hover tbody tr:hover td,
body.theme-light.page-inventory #grid4-app-shell .inventory-panel-main .table-hover tbody tr:hover td {
  background: rgba(var(--g4-brand-sky-rgb), 0.18) !important;
  color: #0f2435 !important;
}

body.theme-dark.page-inventory #grid4-app-shell .inventory-panel-main .table-hover tbody tr:hover td {
  background: rgba(var(--g4-brand-sky-rgb), 0.2) !important;
  color: #ffffff !important;
}

body.theme-light.page-users #grid4-app-shell .users-panel-main .table tbody tr.dropdown-active td,
body.theme-light.page-domains #grid4-app-shell .domains-panel-main .table tbody tr.dropdown-active td {
  background: rgba(var(--g4-brand-sky-rgb), 0.16) !important;
  color: #12283d !important;
}

body.theme-light.page-users #grid4-app-shell .users-panel-main .table-hover tbody tr:hover
  a:not(.btn, .label, .nav-link, [role='button'], [id^='LinkPager']),
body.theme-light.page-domains #grid4-app-shell .domains-panel-main .table-hover tbody tr:hover
  a:not(.btn, .label, .nav-link, [role='button'], [id^='LinkPager']),
body.theme-light.page-inventory #grid4-app-shell .inventory-panel-main .table-hover tbody tr:hover
  a:not(.btn, .label, .nav-link, [role='button'], [id^='LinkPager']) {
  color: #0f2435 !important;
}

body.theme-light #grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu,
body.theme-light #grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu {
  background: rgba(243, 247, 252, 0.98) !important;
  background-color: rgba(243, 247, 252, 0.98) !important;
  border-color: rgba(var(--g4-brand-navy-rgb), 0.12) !important;
  box-shadow: 0 1rem 2rem rgba(var(--g4-brand-navy-rgb), 0.1) !important;
}

body.page-users #grid4-app-shell .profile-panel-main,
body.page-users #grid4-app-shell .admin-panel-main,
body.page-users #grid4-app-shell .voicemail-panel-main {
  max-width: min(78rem, calc(100% - 1.5rem)) !important;
  margin: 0 0 1.5rem !important;
  padding: 1.25rem 1.4rem 1.6rem !important;
  background: var(--surface-primary-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 1rem !important;
  box-shadow: 0 1rem 2.2rem rgba(var(--g4-brand-navy-rgb), 0.08) !important;
}

body.page-users #grid4-app-shell .profile-panel-main legend,
body.page-users #grid4-app-shell .admin-panel-main legend,
body.page-users #grid4-app-shell .voicemail-panel-main legend {
  color: var(--heading-color) !important;
  border-bottom: 1px solid var(--border-color) !important;
  margin-bottom: 1rem !important;
  padding-bottom: 0.6rem !important;
  font-size: var(--g4-font-size-md) !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em !important;
}

body.page-users #grid4-app-shell .profile-panel-main .control-group,
body.page-users #grid4-app-shell .admin-panel-main .control-group,
body.page-users #grid4-app-shell .voicemail-panel-main .control-group {
  margin-bottom: 0.8rem !important;
}

body.page-users #grid4-app-shell .profile-panel-main .control-label,
body.page-users #grid4-app-shell .admin-panel-main .control-label,
body.page-users #grid4-app-shell .voicemail-panel-main .control-label {
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  color: var(--text-secondary) !important;
}

body.page-users #grid4-app-shell .profile-panel-main input:not([type="checkbox"]):not([type="radio"]),
body.page-users #grid4-app-shell .profile-panel-main select,
body.page-users #grid4-app-shell .profile-panel-main textarea,
body.page-users #grid4-app-shell .admin-panel-main input:not([type="checkbox"]):not([type="radio"]),
body.page-users #grid4-app-shell .admin-panel-main select,
body.page-users #grid4-app-shell .admin-panel-main textarea,
body.page-users #grid4-app-shell .voicemail-panel-main input:not([type="checkbox"]):not([type="radio"]),
body.page-users #grid4-app-shell .voicemail-panel-main select,
body.page-users #grid4-app-shell .voicemail-panel-main textarea {
  min-height: 2.1rem !important;
  border-radius: 0.45rem !important;
  box-shadow: none !important;
}

body.theme-light.page-users #grid4-app-shell .profile-panel-main,
body.theme-light.page-users #grid4-app-shell .admin-panel-main,
body.theme-light.page-users #grid4-app-shell .voicemail-panel-main {
  background: rgba(251, 252, 254, 0.98) !important;
  box-shadow: 0 1rem 2.2rem rgba(var(--g4-brand-navy-rgb), 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.65) !important;
}

body.theme-light.page-users #grid4-app-shell .profile-panel-main input:not([type="checkbox"]):not([type="radio"]),
body.theme-light.page-users #grid4-app-shell .profile-panel-main select,
body.theme-light.page-users #grid4-app-shell .profile-panel-main textarea,
body.theme-light.page-users #grid4-app-shell .admin-panel-main input:not([type="checkbox"]):not([type="radio"]),
body.theme-light.page-users #grid4-app-shell .admin-panel-main select,
body.theme-light.page-users #grid4-app-shell .admin-panel-main textarea,
body.theme-light.page-users #grid4-app-shell .voicemail-panel-main input:not([type="checkbox"]):not([type="radio"]),
body.theme-light.page-users #grid4-app-shell .voicemail-panel-main select,
body.theme-light.page-users #grid4-app-shell .voicemail-panel-main textarea {
  background: #ffffff !important;
  border-color: rgba(var(--g4-brand-navy-rgb), 0.16) !important;
  color: var(--text-primary) !important;
}

body.theme-light.page-users #grid4-app-shell .profile-panel-main .control-label,
body.theme-light.page-users #grid4-app-shell .admin-panel-main .control-label,
body.theme-light.page-users #grid4-app-shell .voicemail-panel-main .control-label {
  color: #445369 !important;
}

/* The profile SSO/MFA helpers ship with negative bottom margins on #clientError,
   which causes the red initialization text to tuck under the next control.
   Keep those CTA/error stacks vertical and let the error consume real layout
   space in both themes. */
body.page-users #grid4-app-shell .profile-panel-main .sso-container,
body.page-users #grid4-app-shell .profile-panel-main .mfa-container {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 0.35rem !important;
}

body.page-users #grid4-app-shell .profile-panel-main .ssoBtn,
body.page-users #grid4-app-shell .profile-panel-main .iconBtn {
  height: auto !important;
  min-height: 2rem !important;
  line-height: 1.25 !important;
  margin-bottom: 0 !important;
}

body.page-users #grid4-app-shell .profile-panel-main #clientError {
  display: block !important;
  clear: both !important;
  margin: 0 !important;
  line-height: 1.35 !important;
}

body.theme-light.page-users #grid4-app-shell .nav-tabs {
  border-bottom-color: rgba(var(--g4-brand-navy-rgb), 0.14) !important;
}

body.theme-light.page-users #grid4-app-shell .nav-tabs > li > a {
  background-color: rgba(255, 255, 255, 0.82) !important;
  color: #51627b !important;
  border-color: rgba(var(--g4-brand-navy-rgb), 0.14) !important;
}

body.theme-light.page-users #grid4-app-shell .nav-tabs > li > a:hover {
  background-color: rgba(var(--g4-brand-sky-rgb), 0.12) !important;
  border-color: rgba(var(--g4-brand-sky-rgb), 0.24) !important;
  color: var(--text-primary) !important;
}

body.theme-light.page-users #grid4-app-shell .nav-tabs > li.active > a,
body.theme-light.page-users #grid4-app-shell .nav-tabs > li.active > a:hover,
body.theme-light.page-users #grid4-app-shell .nav-tabs > li.active > a:focus {
  background-color: var(--surface-primary-bg) !important;
  border-color: rgba(var(--g4-brand-sky-rgb), 0.26) !important;
  color: var(--heading-color) !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-defs > div:first-child,
body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-configs > div:first-child {
  display: flex !important;
  align-items: center !important;
  gap: 0.625rem !important;
  flex-wrap: wrap !important;
  padding-bottom: 0 !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-defs form.form-search,
body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-configs form.form-search {
  margin: 0 !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-defs .input-append,
body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-configs .input-append {
  display: inline-flex !important;
  align-items: stretch !important;
  vertical-align: top;
}

body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-defs > div:first-child,
body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-configs > div:first-child {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.625rem !important;
  padding-bottom: 0 !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-defs > div:first-child > div,
body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-configs > div:first-child > div {
  display: inline-flex !important;
  align-items: center !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-defs .form-search,
body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-configs .form-search {
  margin: 0 !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-defs > div:first-child > .btn,
body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-configs > div:first-child > .btn {
  height: 30px !important;
  min-height: 30px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-left .defaultsbox,
body.page-uiconfigs #grid4-app-shell .action-container-left .defaultsbox ul,
body.page-uiconfigs #grid4-app-shell .action-container-left .defaultsbox li,
body.page-uiconfigs #grid4-app-shell .action-container-left .defaultsbox li > a {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-left .defaultsbox li > a {
  height: 30px !important;
  min-height: 30px !important;
  box-sizing: border-box !important;
  border-radius: 0.65rem !important;
  overflow: hidden !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-left .defaultsbox label.checkbox {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  margin: 0 !important;
  height: 100% !important;
  min-height: 30px !important;
  padding: 0 0.7rem !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
  background: transparent !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-left .defaultsbox label.checkbox input[type="checkbox"] {
  margin: 0 !important;
  position: static !important;
}

body.page-uiconfigs #grid4-app-shell #LinkFiltersDefs,
body.page-uiconfigs #grid4-app-shell #LinkFiltersConfigs {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 0.85rem !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-configs .defaultsbox {
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-configs .defaultsbox ul,
body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-configs .defaultsbox li,
body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-configs .defaultsbox li > a {
  display: flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-configs .defaultsbox label.checkbox {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 0.7rem !important;
  white-space: nowrap !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-configs .defaultsbox input[type="checkbox"] {
  position: static !important;
  margin: 0 !important;
}

body.page-uiconfigs #grid4-app-shell #uiconfigs-filter.search-query {
  width: clamp(15rem, 21vw, 23rem) !important;
  min-height: 2rem !important;
  padding: 0.38rem 0.72rem !important;
  box-sizing: border-box !important;
  border-radius: 0.65rem 0 0 0.65rem !important;
}

body.page-uiconfigs #grid4-app-shell #search-btn {
  min-width: 2.25rem !important;
  min-height: 2rem !important;
  padding: 0 0.7rem !important;
  margin-left: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  border-radius: 0 0.65rem 0.65rem 0 !important;
}

body.page-uiconfigs #grid4-app-shell #search-btn .icon-search {
  margin: 0 !important;
  width: 14px !important;
  height: 14px !important;
  line-height: 14px !important;
  display: inline-block !important;
  color: #ffffff !important;
  filter: brightness(0) invert(1) !important;
}

body.page-uiconfigs #grid4-app-shell #pageRefresh {
  min-width: 2.15rem !important;
  min-height: 2rem !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 0.65rem !important;
}

body.page-uiconfigs #grid4-app-shell .uiconfigs-panel-main,
body.page-uiconfigs #grid4-app-shell .uiconfigs-panel-header,
body.page-uiconfigs #grid4-app-shell .uiconfig-detail-box {
  background: var(--surface-primary-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 1rem !important;
  box-shadow: 0 0.9rem 2rem var(--shadow-color) !important;
}

body.page-uiconfigs #grid4-app-shell .uiconfigs-panel-main {
  padding: 0.7rem 0.85rem 1rem !important;
}

body.page-uiconfigs #grid4-app-shell .uiconfig-detail-box {
  padding: 0.5rem 0.55rem 0.85rem !important;
}

body.theme-light.page-uiconfigs #grid4-app-shell .uiconfigs-panel-main,
body.theme-light.page-uiconfigs #grid4-app-shell .uiconfigs-panel-header,
body.theme-light.page-uiconfigs #grid4-app-shell .uiconfig-detail-box {
  background: rgba(243, 247, 252, 0.92) !important;
  border-color: rgba(var(--g4-brand-navy-rgb), 0.1) !important;
  box-shadow: 0 1rem 2.2rem rgba(var(--g4-brand-navy-rgb), 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.72) !important;
}

body.theme-light.page-uiconfigs #grid4-app-shell .uiconfigs-panel-main {
  padding-top: 0.85rem !important;
}

body.page-uiconfigs #grid4-app-shell .ui-config-table {
  width: 100%;
}

body.theme-light.page-uiconfigs #grid4-app-shell .ui-config-table {
  border-spacing: 0 0.22rem !important;
}

body.theme-light.page-uiconfigs #grid4-app-shell .ui-config-table thead th {
  background: rgba(227, 235, 245, 0.9) !important;
  color: #31435a !important;
  border-bottom: 1px solid rgba(var(--g4-brand-navy-rgb), 0.08) !important;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.45) !important;
}

body.theme-light.page-uiconfigs #grid4-app-shell .ui-config-table tbody td {
  background: rgba(251, 252, 254, 0.96) !important;
  border-top: 1px solid rgba(var(--g4-brand-navy-rgb), 0.05) !important;
  border-bottom: 1px solid rgba(var(--g4-brand-navy-rgb), 0.05) !important;
  color: var(--text-primary) !important;
}

body.theme-light.page-uiconfigs #grid4-app-shell .ui-config-table tbody tr:nth-child(even) td {
  background: rgba(242, 247, 252, 0.96) !important;
}

body.theme-light.page-uiconfigs #grid4-app-shell .ui-config-table.table-hover tbody tr:hover td {
  background: rgba(var(--g4-brand-sky-rgb), 0.14) !important;
  color: #0f2435 !important;
}

body.theme-light.page-uiconfigs #grid4-app-shell .ui-config-table.table-hover tbody tr:hover
  a:not(.btn, .label, .nav-link, [role='button'], [id^='LinkPager']) {
  color: #0f2435 !important;
}

body.theme-dark.page-uiconfigs #grid4-app-shell .ui-config-table tbody tr[style*='background-color:#F5F5F5'],
body.theme-dark.page-uiconfigs #grid4-app-shell .ui-config-table tbody tr[style*='background-color: #F5F5F5'],
body.theme-dark.page-uiconfigs #grid4-app-shell .ui-config-table tbody tr[style*='background-color: rgb(245, 245, 245)'] {
  background-color: var(--surface-primary-bg) !important;
}

body.theme-dark.page-uiconfigs #grid4-app-shell .ui-config-table tbody tr[style*='background-color:#F5F5F5'] > td,
body.theme-dark.page-uiconfigs #grid4-app-shell .ui-config-table tbody tr[style*='background-color: #F5F5F5'] > td,
body.theme-dark.page-uiconfigs #grid4-app-shell .ui-config-table tbody tr[style*='background-color: rgb(245, 245, 245)'] > td {
  background-color: var(--surface-primary-bg) !important;
}

#flashContainer .flashMessage.g4-loader-flash-message,
#flashContainer .flashMessage:has(.loader-flash):has(.loading-spinner),
#flashContainer .flashMessage:has(.loader-flash):has(.la-ball-spin-clockwise) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: 0 !important;
  color: var(--text-primary) !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.35rem !important;
}

#flashContainer .flashMessage.g4-loader-flash-message > div:first-child,
#flashContainer .flashMessage:has(.loader-flash):has(.loading-spinner) > div:first-child,
#flashContainer .flashMessage:has(.loader-flash):has(.la-ball-spin-clockwise) > div:first-child {
  float: none !important;
  display: inline-flex !important;
  align-items: center !important;
  margin: 0 !important;
}

#flashContainer .flashMessage.g4-loader-flash-message .loading-spinner,
#flashContainer .flashMessage.g4-loader-flash-message .la-ball-spin-clockwise,
#flashContainer .flashMessage:has(.loader-flash):has(.loading-spinner) .loading-spinner,
#flashContainer .flashMessage:has(.loader-flash):has(.loading-spinner) .la-ball-spin-clockwise,
#flashContainer .flashMessage:has(.loader-flash):has(.la-ball-spin-clockwise) .loading-spinner,
#flashContainer .flashMessage:has(.loader-flash):has(.la-ball-spin-clockwise) .la-ball-spin-clockwise {
  top: 0 !important;
  margin: 0 !important;
}

#flashContainer .flashMessage.g4-loader-flash-message .flashMsgContainer,
#flashContainer .flashMessage:has(.loader-flash):has(.loading-spinner) .flashMsgContainer,
#flashContainer .flashMessage:has(.loader-flash):has(.la-ball-spin-clockwise) .flashMsgContainer {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.25rem !important;
}

body.theme-light.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-configs .search-query,
body.theme-light.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-configs .input-append > .btn,
body.theme-light.page-uiconfigs #grid4-app-shell #pageRefresh {
  box-shadow: 0 0.7rem 1.45rem rgba(var(--g4-brand-navy-rgb), 0.05) !important;
}

body.theme-light.page-uiconfigs #grid4-app-shell .defaultsbox,
body.theme-light.page-uiconfigs #grid4-app-shell .defaultsbox li {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.theme-light.page-uiconfigs #grid4-app-shell .defaultsbox li > a {
  background: rgba(255, 255, 255, 0.8) !important;
  border: 1px solid rgba(var(--g4-brand-navy-rgb), 0.1) !important;
  box-shadow: none !important;
}

body.theme-light.page-uiconfigs #grid4-app-shell .defaultsbox label.checkbox {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 0.7rem !important;
  border-radius: 0 !important;
  background: transparent !important;
  border: 0 !important;
  color: #445369 !important;
}

body.page-uiconfigs #grid4-app-shell .ui-config-table th:nth-child(2),
body.page-uiconfigs #grid4-app-shell .ui-config-table td:nth-child(2) {
  width: 11rem !important;
  min-width: 11rem !important;
  vertical-align: top !important;
}

body.page-uiconfigs #grid4-app-shell .ui-config-table th:last-child,
body.page-uiconfigs #grid4-app-shell .ui-config-table td.action-buttons {
  width: 3rem !important;
  min-width: 3rem !important;
}

body.page-uiconfigs #grid4-app-shell .ui-config-table td:nth-last-child(2) {
  white-space: normal !important;
}

body.page-uiconfigs #grid4-app-shell .ui-config-table td:nth-child(2) .label,
body.page-uiconfigs #grid4-app-shell .ui-config-table td:nth-last-child(2) .label,
body.page-uiconfigs #grid4-app-shell .uiconfig-detail-box .label,
body.page-uiconfigs #grid4-app-shell .action-container-left.uiconfig-configs .label {
  margin: 0 0.35rem 0.35rem 0 !important;
}

#grid4-app-shell .g4-chip {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 1.3rem;
  padding: 0.14rem 0.48rem !important;
  border-radius: 999px !important;
  font-size: 0.68rem !important;
  line-height: 1.1 !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  border: 1px solid transparent !important;
  text-shadow: none !important;
  box-shadow: none !important;
  white-space: nowrap !important;
  vertical-align: middle !important;
}

#grid4-app-shell .g4-chip a {
  color: inherit !important;
  text-decoration: none !important;
}

#grid4-app-shell .g4-chip-empty {
  display: none !important;
}

body.theme-light #grid4-app-shell .g4-user-chip,
body.theme-light #grid4-app-shell .g4-uiconfig-tag-chip {
  background: rgba(var(--g4-brand-navy-rgb), 0.16) !important;
  border-color: rgba(var(--g4-brand-navy-rgb), 0.14) !important;
  color: #31435a !important;
}

body.theme-dark #grid4-app-shell .g4-user-chip,
body.theme-dark #grid4-app-shell .g4-uiconfig-tag-chip {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #e8eef6 !important;
}

body.theme-light #grid4-app-shell .g4-chip-aa {
  background: rgba(var(--g4-brand-sky-rgb), 0.2) !important;
  border-color: rgba(var(--g4-brand-sky-rgb), 0.3) !important;
  color: #1f4f73 !important;
}

body.theme-dark #grid4-app-shell .g4-chip-aa {
  background: rgba(var(--g4-brand-sky-rgb), 0.24) !important;
  border-color: rgba(var(--g4-brand-sky-rgb), 0.32) !important;
  color: #dff2ff !important;
}

body.theme-light #grid4-app-shell .g4-chip-queue {
  background: rgba(47, 101, 166, 0.18) !important;
  border-color: rgba(47, 101, 166, 0.26) !important;
  color: #234571 !important;
}

body.theme-dark #grid4-app-shell .g4-chip-queue {
  background: rgba(63, 124, 196, 0.24) !important;
  border-color: rgba(98, 151, 214, 0.32) !important;
  color: #e7f2ff !important;
}

body.theme-light #grid4-app-shell .g4-chip-site {
  background: rgba(114, 128, 150, 0.18) !important;
  border-color: rgba(114, 128, 150, 0.24) !important;
  color: #43566d !important;
}

body.theme-dark #grid4-app-shell .g4-chip-site {
  background: rgba(155, 168, 186, 0.16) !important;
  border-color: rgba(155, 168, 186, 0.22) !important;
  color: #edf3fb !important;
}

body.theme-light #grid4-app-shell .g4-chip-conference {
  background: rgba(38, 170, 157, 0.18) !important;
  border-color: rgba(38, 170, 157, 0.28) !important;
  color: #17645d !important;
}

body.theme-dark #grid4-app-shell .g4-chip-conference {
  background: rgba(44, 191, 176, 0.2) !important;
  border-color: rgba(66, 205, 191, 0.28) !important;
  color: #dffbf6 !important;
}

body.theme-light #grid4-app-shell .g4-chip-trunk {
  background: rgba(199, 143, 54, 0.18) !important;
  border-color: rgba(199, 143, 54, 0.26) !important;
  color: #785118 !important;
}

body.theme-dark #grid4-app-shell .g4-chip-trunk {
  background: rgba(205, 154, 70, 0.2) !important;
  border-color: rgba(221, 174, 95, 0.28) !important;
  color: #fff2d9 !important;
}

body.theme-light #grid4-app-shell .g4-chip-ringgroup {
  background: rgba(70, 157, 120, 0.18) !important;
  border-color: rgba(70, 157, 120, 0.25) !important;
  color: #285b45 !important;
}

body.theme-dark #grid4-app-shell .g4-chip-ringgroup {
  background: rgba(76, 181, 140, 0.2) !important;
  border-color: rgba(94, 199, 157, 0.28) !important;
  color: #e4faef !important;
}

body.theme-light #grid4-app-shell .g4-chip-status-new {
  background: rgba(57, 168, 110, 0.18) !important;
  border-color: rgba(57, 168, 110, 0.26) !important;
  color: #1d6641 !important;
}

body.theme-dark #grid4-app-shell .g4-chip-status-new {
  background: rgba(61, 184, 121, 0.2) !important;
  border-color: rgba(83, 206, 143, 0.28) !important;
  color: #e6fbef !important;
}

body.theme-light #grid4-app-shell .g4-chip-status-setup {
  background: rgba(82, 180, 250, 0.18) !important;
  border-color: rgba(82, 180, 250, 0.28) !important;
  color: #215272 !important;
}

body.theme-dark #grid4-app-shell .g4-chip-status-setup {
  background: rgba(82, 180, 250, 0.2) !important;
  border-color: rgba(82, 180, 250, 0.3) !important;
  color: #dff3ff !important;
}

body.theme-light #grid4-app-shell .g4-chip-status-password {
  background: rgba(198, 92, 72, 0.16) !important;
  border-color: rgba(198, 92, 72, 0.26) !important;
  color: #7b3024 !important;
}

body.theme-dark #grid4-app-shell .g4-chip-status-password {
  background: rgba(204, 96, 78, 0.18) !important;
  border-color: rgba(214, 117, 100, 0.28) !important;
  color: #ffe8e3 !important;
}

body.theme-light #grid4-app-shell .g4-uiconfig-filter-chip {
  background: rgba(var(--g4-brand-sky-rgb), 0.16) !important;
  border-color: rgba(var(--g4-brand-sky-rgb), 0.28) !important;
  color: #1b425d !important;
}

body.theme-dark #grid4-app-shell .g4-uiconfig-filter-chip {
  background: rgba(var(--g4-brand-sky-rgb), 0.18) !important;
  border-color: rgba(var(--g4-brand-sky-rgb), 0.3) !important;
  color: #e2f3ff !important;
}

body.theme-light #grid4-app-shell .g4-uiconfig-default-chip {
  background: rgba(102, 118, 142, 0.18) !important;
  border-color: rgba(102, 118, 142, 0.24) !important;
  color: #405166 !important;
}

body.theme-dark #grid4-app-shell .g4-uiconfig-default-chip {
  background: rgba(162, 176, 196, 0.16) !important;
  border-color: rgba(162, 176, 196, 0.24) !important;
  color: #eef4fb !important;
}

body.page-domains #grid4-app-shell .panel {
  border-color: var(--accent-primary);
}

body.page-agents #grid4-app-shell .status-indicator {
  animation: pulse 2s infinite;
}

/* ===================================
   17. ENHANCED ANIMATIONS
   =================================== */

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
  100% { transform: scale(1); opacity: 1; }
}

/* Smooth height transitions for collapsibles */
.collapsing {
  transition: height 0.35s ease;
}

/* Button ripple effect */
#grid4-app-shell .btn {
  position: relative;
  overflow: hidden;
}

#grid4-app-shell .btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 20%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

#grid4-app-shell .btn:active::before {
  width: 300px;
  height: 300px;
}

/* ===================================================================
   16. COMPREHENSIVE MODAL THEMING FIX (v5.0.11 - 2025-01-02)
   =================================================================== */

/* CRITICAL: Precise selectors for NetSapiens modal theming
   - Handles both Bootstrap 3 modals and jQuery UI dialogs
   - Respects positioning (let Bootstrap/jQuery UI handle it)
   - Focus on theming only
   - High specificity to override NetSapiens defaults */

/* --- DARK THEME MODAL BACKGROUNDS --- */
/* Bootstrap Modals - Ultra High Specificity */
/* Standard selectors */
body.theme-dark .modal .modal-content,
body.theme-dark .modal-dialog .modal-content,
body.theme-dark .modal.fade .modal-content,
body.theme-dark .modal.fade.in .modal-content,
body.theme-dark .modal.in .modal-content,
/* Modals outside app shell */
#grid4-app-shell.theme-dark ~ .modal .modal-content,
#grid4-app-shell.theme-dark ~ .modal-backdrop ~ .modal .modal-content,
/* Direct child modals */
body.theme-dark > .modal .modal-content,
body.theme-dark > .modal-backdrop ~ .modal .modal-content,
/* Any modal anywhere when body has theme-dark */
body.theme-dark .modal-content {
  background-color: #242b3a !important;
  color: #e9ecef !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.8) !important;
}

/* jQuery UI Dialogs */
body.theme-dark .ui-dialog,
body.theme-dark .ui-dialog-content,
body.theme-dark .ui-widget-content {

  color: #e9ecef !important;
  border-color: rgba(255, 255, 255, 0.1) !important;

  background-color: #222 !important;
  background: unset !important;
  background: #222 !important;
}

/* Modal Headers */
body.theme-dark .modal-header,
body.theme-dark .ui-dialog-titlebar {
  background-color: #1e2736 !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
  color: #e9ecef !important;
}

/* Modal Footers */
body.theme-dark .modal-footer,
body.theme-dark .ui-dialog-buttonpane {
  background-color: #1e2736 !important;
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

/* --- FORM ELEMENTS IN DARK THEME MODALS --- */
/* All input types */
body.theme-dark .modal input[type="text"],
body.theme-dark .modal input[type="email"],
body.theme-dark .modal input[type="password"],
body.theme-dark .modal input[type="number"],
body.theme-dark .modal input[type="tel"],
body.theme-dark .modal input[type="url"],
body.theme-dark .modal input[type="search"],
body.theme-dark .modal input[type="date"],
body.theme-dark .modal input[type="time"],
body.theme-dark .modal input[type="datetime-local"],
body.theme-dark .modal textarea,
body.theme-dark .modal select,
body.theme-dark .ui-dialog input[type="text"],
body.theme-dark .ui-dialog input[type="email"],
body.theme-dark .ui-dialog input[type="password"],
body.theme-dark .ui-dialog input[type="number"],
body.theme-dark .ui-dialog input[type="tel"],
body.theme-dark .ui-dialog textarea,
body.theme-dark .ui-dialog select {
  background-color: #1a2332 !important;
  color: #e9ecef !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Focus states */
body.theme-dark .modal input:focus,
body.theme-dark .modal textarea:focus,
body.theme-dark .modal select:focus,
body.theme-dark .ui-dialog input:focus,
body.theme-dark .ui-dialog textarea:focus,
body.theme-dark .ui-dialog select:focus {
  background-color: #1e2736 !important;
  border-color: #00d4ff !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.2) !important;
}

/* --- LABELS AND TEXT IN DARK THEME --- */
/* Force transparent backgrounds on ALL labels */
body.theme-dark .modal label,
body.theme-dark .modal .control-label,
body.theme-dark .modal .form-label,
body.theme-dark .ui-dialog label,
body.theme-dark .ui-dialog .control-label {
  background-color: transparent !important;
  background: transparent !important;
  color: #b0bec5 !important;
}

/* Radio and checkbox labels */
body.theme-dark .modal .radio label,
body.theme-dark .modal .checkbox label,
body.theme-dark .ui-dialog .radio label,
body.theme-dark .ui-dialog .checkbox label {
  background-color: transparent !important;
  color: #b0bec5 !important;
}

/* Help text and descriptions */
body.theme-dark .modal .help-block,
body.theme-dark .modal .help-inline,
body.theme-dark .modal .form-text,
body.theme-dark .modal small,
body.theme-dark .ui-dialog .help-block,
body.theme-dark .ui-dialog .help-inline {
  color: #78909c !important;
  background-color: transparent !important;
}

/* --- LIGHT THEME MODAL CONSISTENCY --- */
/* Ensure light theme has proper white backgrounds */
body.theme-light .modal .modal-content {
  background-color: #ffffff !important;
  color: #212529 !important;
  border-color: #dee2e6 !important;
}

body.theme-light .modal-header {
  background-color: #f8f9fa !important;
  border-bottom-color: #dee2e6 !important;
}

body.theme-light .modal-footer {
  background-color: #f8f9fa !important;
  border-top-color: #dee2e6 !important;
}

/* --- BUTTON THEMING IN MODALS --- */
/* Dark theme buttons */
/* body.theme-dark .modal .btn-default,
body.theme-dark .modal .btn,
body.theme-dark .ui-dialog .btn {
  background-color: #374151 !important;
  color: #e9ecef !important;
  border-color: #4b5563 !important;
} */

/* body.theme-dark .modal .btn-default:hover,
body.theme-dark .modal .btn:hover {
  background-color: #4b5563 !important;
  border-color: #6b7280 !important;
} */

/* Primary action buttons stay accent color */
body.theme-dark .modal .btn-primary,
body.theme-dark .modal .color-primary {
  background-color: var(--g4-button-primary-bg) !important;
  color: #ffffff !important;
  border-color: var(--g4-button-primary-border) !important;
}

/* --- SPECIAL CASES --- */
/* File upload inputs */
body.theme-dark .modal input[type="file"],
body.theme-dark .ui-dialog input[type="file"] {
  color: #e9ecef !important;
}

/* Disabled form elements */
body.theme-dark .modal input:disabled,
body.theme-dark .modal select:disabled,
body.theme-dark .modal textarea:disabled {
  background-color: #0f1419 !important;
  color: #4b5563 !important;
  opacity: 0.6 !important;
}

/* Tables in modals */
body.theme-dark .modal table,
body.theme-dark .ui-dialog table {
  color: #e9ecef !important;
}

body.theme-dark .modal table th,
body.theme-dark .ui-dialog table th {
  background-color: #1e2736 !important;
  color: #e9ecef !important;
  border-color: rgba(255, 255, 255, 0.81) !important;
}

body.theme-dark .modal table td,
body.theme-dark .ui-dialog table td {
  border-color: rgba(255, 255, 255, 0.81) !important;
}

/* --- OVERRIDE ANY TRANSPARENT BACKGROUNDS --- */
/* Force opaque backgrounds on modal content */
.modal-content,
.ui-dialog {
  opacity: 1 !important;
}

/* Prevent any transparent modal backgrounds */
body.theme-dark .modal-content[style*="transparent"],
body.theme-dark .ui-dialog[style*="transparent"] {
  background-color: #242b3a !important;
}

body.theme-light .modal-content[style*="transparent"] {
  background-color: #ffffff !important;
}

/* --- HIGH SPECIFICITY OVERRIDES FOR PROBLEMATIC ELEMENTS --- */
/* NetSapiens specific modal classes */
body.theme-dark #user-add .modal-content,
body.theme-dark #call-queue-add .modal-content,
body.theme-dark #domain-timeframe-add .modal-content,
body.theme-dark #phone-add .modal-content {
  background-color: #242b3a !important;
}

/* Form groups and fieldsets */
body.theme-dark .modal .form-group,
body.theme-dark .modal fieldset,
body.theme-dark .ui-dialog .form-group {
  background-color: transparent !important;
}

/* Close button in modal header */
body.theme-dark .modal-header .close,
body.theme-dark .ui-dialog-titlebar .ui-dialog-titlebar-close {
  color: #e9ecef !important;
  opacity: 0.7 !important;
  text-shadow: none !important;
}

body.theme-dark .modal-header .close:hover {
  opacity: 1 !important;
}

/* --- FINAL DARK THEME MODAL OVERRIDE (CATCH-ALL) --- */
/* This ensures dark theme applies even if modals are added dynamically */
body.theme-dark .modal .modal-dialog .modal-content,
body.theme-dark .modal.in .modal-dialog .modal-content,
body.theme-dark .modal.fade.in .modal-dialog .modal-content {
  background-color: #242b3a !important;
  color: #e9ecef !important;
}

/* Ensure modal body also gets dark background */
body.theme-dark .modal-body {
  background-color: #242b3a !important;
  color: #e9ecef !important;
}

/* Force dark theme on dynamically added modals */
body.theme-dark .modal {
  color: #e9ecef !important;
}

/* --- ENSURE DARK BACKGROUNDS ACTUALLY APPLY --- */
/* Maximum specificity override for stubborn modals */
html body.theme-dark div.modal div.modal-dialog div.modal-content {
  background-color: #222 !important;
}

/* Target NetSapiens specific modal IDs if they exist */
body.theme-dark #modalContainer .modal-content,
body.theme-dark #modal-container .modal-content,
body.theme-dark [id*="modal"] .modal-content {
  background-color: #222 !important;
}

/* End Modal Theming Fix */

/* ===================================================================
   17. NUCLEAR DARK MODE MODAL OVERRIDE (v5.0.11 - 2025-01-02)
   =================================================================== */

/* CRITICAL: Ultra-aggressive overrides to force dark backgrounds */

/* Override ALL modal backgrounds when body has theme-dark class */
body.theme-dark .modal-content {
  background-color: #222 !important;
  color: #e9ecef !important;
}

/* Target every possible modal structure */
body.theme-dark .modal .modal-dialog .modal-content,
body.theme-dark .modal.fade .modal-dialog .modal-content,
body.theme-dark .modal.fade.in .modal-dialog .modal-content,
body.theme-dark .modal.in .modal-dialog .modal-content,
body.theme-dark > .modal .modal-content,
body.theme-dark > .modal .modal-dialog .modal-content {
  background-color: #222 !important;
  color: #e9ecef !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

/* Override modal body and sections */
body.theme-dark .modal-header,
body.theme-dark .modal-body,
body.theme-dark .modal-footer {
  background-color: var(--modal-bg) !important;
  color: #e9ecef !important;
}

/* Nuclear specificity option */
html body.theme-dark .modal.fade.in .modal-dialog .modal-content {
  background-color: var(--modal-bg) !important;
  color: #e9ecef !important;
}

/* Override any inline styles */
body.theme-dark .modal-content[style] {
  background-color: var(--modal-bg) !important;
  color: #e9ecef !important;
}

/* Target ALL elements inside modal to ensure text is visible */
body.theme-dark .modal-content,
body.theme-dark .modal-content * {
  color: #e9ecef !important;
}

/* Specific overrides for form elements */
body.theme-dark .modal-content label,
body.theme-dark .modal-content .control-label {
  color: #b0bec5 !important;
  background: transparent !important;
}

/* Headers with proper contrast */
body.theme-dark .modal-header {
  background-color: #222 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.theme-dark .modal-header .modal-title {
  color: #ffffff !important;
}

/* Footers with proper styling */
body.theme-dark .modal-footer {
  background-color: #222 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

body.theme-dark .modal hr,
body.theme-dark .modal.g4-themed hr {
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-bottom: 0 !important;
  opacity: 1 !important;
}

/* LIGHT THEME PROTECTION - Ensure light theme stays white */
body.theme-light .modal-content {
  background-color: #ffffff !important;
  color: #212529 !important;
}

/* Only apply white background if body explicitly doesn't have theme-dark AND has theme-light */
body:not(.theme-dark).theme-light .modal-content {
  background-color: #ffffff !important;
  color: #212529 !important;
}

/* End Nuclear Modal Override */

/* ============================================
   SECTION 21: OVERRIDE basicCSS.php .modal white background
   ============================================ */

/* Target .modal element specifically to override basicCSS.php */
html body.theme-dark .modal {
  background: var(--modal-bg) !important;
  background-color: var(--modal-bg) !important;
}

html body.theme-dark div.modal {
  background: var(--modal-bg) !important;
  background-color: var(--modal-bg) !important;
}

/* Use ID selector for higher specificity if needed */
#grid4-app-shell.theme-dark ~ .modal,
body.theme-dark #grid4-app-shell ~ .modal {
  background: var(--modal-bg) !important;
  background-color: var(--modal-bg) !important;
}

/* Attribute selector as last resort */
body.theme-dark [class="modal fade in"],
body.theme-dark [class*="modal"][role="dialog"] {
  background: var(--modal-bg) !important;
  background-color: var(--modal-bg) !important;
}

/* Ensure the modal itself (not content) is properly themed */
body.theme-dark .modal:not(.modal-content) {
  background: var(--modal-bg) !important;
  background-color: var(--modal-bg) !important;
}

/* End basicCSS.php Override */

/* ============================================
   SECTION 22: Fix modal form text colors in dark theme
   ============================================ */

/* Ensure all text in dark theme modals is light */
body.theme-dark .modal,
body.theme-dark .modal-content,
body.theme-dark .modal-header,
body.theme-dark .modal-body,
body.theme-dark .modal-footer {
  color: #e9ecef !important;
}

/* Form labels and text */
body.theme-dark .modal label,
body.theme-dark .modal .control-label,
body.theme-dark .modal .help-block,
body.theme-dark .modal .help-inline,
body.theme-dark .modal p,
body.theme-dark .modal span,
body.theme-dark .modal div {
  color: #e9ecef !important;
}

body.theme-dark .modal span.mini.uneditable-input {
  color: #e9ecef !important;
  background-color: var(--modal-bg) !important;
}

/* Headings in modals */
body.theme-dark .modal h1,
body.theme-dark .modal h2,
body.theme-dark .modal h3,
body.theme-dark .modal h4,
body.theme-dark .modal h5,
body.theme-dark .modal h6 {
  color: #e9ecef !important;
}

/* Bootstrap 2 doesn't use modal-dialog - content goes directly in modal */

/* End modal text fix */

/* ============================================
   SECTION 23: NetSapiens Modal Compatibility Fix
   Based on investigation findings - NetSapiens uses Bootstrap 2 HTML with custom positioning
   ============================================ */

/* Work with NetSapiens' expected modal positioning.
   Keep this as a fallback only; once our JS measures the modal, the
   g4-modal-* classes own the live geometry. */
.modal:not(.g4-modal-measured):not(.g4-modal-viewport-fit) {
  position: fixed !important; /* Override portal.css absolute positioning */
  top: 40% !important; /* Lower from center to accommodate taller modals */
  left: 50% !important;
  z-index: 1050 !important;
  /*width: 600px !important;  NetSapiens expects 600px */
  margin: -200px 0 0 -300px !important; /* Reduced top margin for better centering */
  /* max-height: 60vh !important; /* Reduced to 60% viewport height */
  overflow: visible !important; /* Allow content to be scrollable */
}

/* Ensure modal body is scrollable for long content */
.modal .modal-body {
  max-height: calc(80vh - 9rem) !important; /* Account for header/footer with 60vh - converted from 150px */
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* Adjust positioning for different screen sizes */
@media (max-height: 768px) {
  .modal:not(.g4-modal-measured):not(.g4-modal-viewport-fit) {
    top: 30% !important; /* Higher on smaller screens */
    margin-top: -100px !important;
    max-height: 80vh !important;
  }

  .modal .modal-body {
    max-height: calc(80vh - 9rem) !important; /* Converted from 150px for consistent REM scaling */
  }
}

/* Handle Bootstrap 2's hide class that NetSapiens uses */
.modal.hide {
  display: none;
}

/* Ensure proper display when shown */
.modal.in {
  display: block !important;
}

/* Bootstrap 2 fade states - NetSapiens expects these */
.modal.fade {
  top: -25%;
  opacity: 0;
  -webkit-transition: opacity 0.3s linear, top 0.3s ease-out;
  -moz-transition: opacity 0.3s linear, top 0.3s ease-out;
  -o-transition: opacity 0.3s linear, top 0.3s ease-out;
  transition: opacity 0.3s linear, top 0.3s ease-out;
}

.modal.fade.in:not(.g4-modal-measured):not(.g4-modal-viewport-fit) {
  top: 35% !important; /* Match our fixed positioning */
  opacity: 1;
}

#cdr-scheduling {
  top: 25% !important; /* Deal with the CDR Scheduling modal being too tall */
  opacity: 1;
}

/* Ensure our theme colors still apply */
body.theme-dark .modal {
  background-color: var(--modal-bg) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

body.theme-light .modal {
  background-color: #ffffff !important;
}

/* End NetSapiens Modal Fix */

/* ============================================
   SECTION 24: Modal Dark Mode Footer/Header Fix
   Fixes light backgrounds in dark mode without breaking existing functionality
   ============================================ */

/* Fix modal footer showing light background in dark mode - target correct theme selector */
#grid4-app-shell.theme-dark ~ .modal .modal-footer,
#grid4-app-shell.theme-dark ~ .modal-backdrop ~ .modal .modal-footer,
.theme-dark .modal .modal-footer,
.theme-dark .modal.fade .modal-footer,
.theme-dark .modal.fade.in .modal-footer,
.theme-dark .modal.in .modal-footer {
  background-color: #222 !important;
  background: #222!important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-top-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

/* Also target when modal is inside the shell */
#grid4-app-shell.theme-dark .modal .modal-footer {
  background-color: var(--modal-bg) !important;
  background: var(--modal-bg) !important;

  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-top-color: rgba(255, 255, 255, 0.08) !important;
  box-shadow: none !important;
}

/* Fix modal header text contrast in dark mode */
#grid4-app-shell.theme-dark ~ .modal .modal-header,
#grid4-app-shell.theme-dark ~ .modal-backdrop ~ .modal .modal-header,
#grid4-app-shell.theme-dark .modal .modal-header,
.theme-dark .modal .modal-header {
  background-color: var(--modal-bg) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #e9ecef !important;
}

/* Ensure close button is visible in dark mode */
#grid4-app-shell.theme-dark ~ .modal .modal-header .close,
#grid4-app-shell.theme-dark .modal .modal-header .close,
.theme-dark .modal .modal-header .close {
  color: #e9ecef !important;
  opacity: 0.8;
}

#grid4-app-shell.theme-dark ~ .modal .modal-header .close:hover,
#grid4-app-shell.theme-dark .modal .modal-header .close:hover,
.theme-dark .modal .modal-header .close:hover {
  opacity: 1;
}

/* End Modal Dark Mode Fix */

/* Section 25: Modal Transparency Fix - Fix rendering issues in various browsers */
/*
// * Issue: backdrop-filter with rgba backgrounds causes transparency in some browsers
// * Solution: Remove backdrop-filter and use solid backgrounds for reliable rendering
 */

/* Disable problematic backdrop-filter on all modals */
.modal-content,
.modal .modal-content,
#grid4-app-shell ~ .modal .modal-content {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  /* Ensure fully opaque */
  opacity: 1 !important;
}

/* Dark theme - solid backgrounds for modals */
body.theme-dark .modal-content,
#grid4-app-shell.theme-dark ~ .modal .modal-content,
#grid4-app-shell.theme-dark .modal .modal-content,
.theme-dark .modal-content {
  background: var(--modal-bg) !important;
  background-color: var(--modal-bg) !important;
  /* Remove any transparency */
  opacity: 1 !important;
}

/* Light theme - solid backgrounds for modals */
body.theme-light .modal-content,
#grid4-app-shell.theme-light ~ .modal .modal-content,
#grid4-app-shell.theme-light .modal .modal-content,
.theme-light .modal-content,
.modal-content {
  background: #ffffff !important;
  background-color: #ffffff !important;
  /* Remove any transparency */
  opacity: 1 !important;
}

/* Webkit/Safari specific fixes */
@supports (-webkit-backdrop-filter: blur(10px)) {
  .modal-content {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

/* Firefox specific fixes for older versions */
@-moz-document url-prefix() {
  .modal-content {
    backdrop-filter: none !important;
    opacity: 1 !important;
  }
}

/* Ensure modal body also has solid background */
.modal-body {
  background: transparent !important; /* Inherit from modal-content */
  opacity: 1 !important;
}

#grid4-app-shell.theme-dark ~ .modal .modal-body,
#grid4-app-shell.theme-dark .modal .modal-body {
  background: transparent !important;
}

/* End Modal Transparency Fix */

/* Ensure modal elements are interactive */
.modal {
  pointer-events: auto !important;
}
.modal .modal-dialog,
.modal .modal-content,
.modal .modal-header,
.modal .modal-body,
.modal .modal-footer {
  pointer-events: auto !important;
}

/* Section 26: Dropdown Animation Improvements */
/* Smoother dropdown animations with better timing */
.dropdown-menu {
  display: block !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.33s ease-out;
  transition-timing-function: ease-out;
  pointer-events: none;
}

.dropdown.open > .dropdown-menu,
.btn-group.open > .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
  transition: all 0.35s ease;

  transition-timing-function: ease;



}

.dropdown-submenu > .dropdown-menu {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  transform: translateX(0.5rem);
  pointer-events: none;
}

.dropdown-submenu:hover > .dropdown-menu,
.dropdown-submenu:focus-within > .dropdown-menu {
  display: block !important;
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}

/* Ensure dropdown stays within viewport */
.dropdown-menu {
  max-height: 80vh;
  overflow-y: auto;
}



/* End Dropdown Improvements */

/* ===================================
   8. PAGE-SPECIFIC FIXES
   =================================== */

/* Contacts page header layout and nested filter flyouts */
#grid4-app-shell .contacts-panel-main {
  display: grid;
  grid-template-columns: minmax(18rem, 1fr) auto;
  gap: 0.9rem 1rem;
  align-items: start;
}

#grid4-app-shell .contacts-panel-main > .action-container-left,
#grid4-app-shell .contacts-panel-main > .action-container-right {
  float: none !important;
  width: auto !important;
  margin-bottom: 0 !important;
}

#grid4-app-shell .contacts-panel-main > .action-container-left {
  min-width: 0;
}

#grid4-app-shell .contacts-panel-main > .action-container-left .input-append {
  display: inline-flex !important;
  align-items: stretch !important;
  vertical-align: top !important;
}

#grid4-app-shell .contacts-panel-main > .action-container-left .search-query {
  min-height: 2rem !important;
  height: 2rem !important;
  padding: 0.38rem 0.72rem !important;
  line-height: 1.2 !important;
  box-sizing: border-box !important;
  border-radius: 0.65rem 0 0 0.65rem !important;
}

#grid4-app-shell .contacts-panel-main > .action-container-left .input-append > .btn {
  min-width: 2.25rem !important;
  min-height: 2rem !important;
  height: 2rem !important;
  padding: 0 0.7rem !important;
  margin-left: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  border-radius: 0 0.65rem 0.65rem 0 !important;
}

#grid4-app-shell .contacts-panel-main > .action-container-left .input-append > .btn .icon-search {
  margin: 0 !important;
  width: 14px !important;
  height: 14px !important;
  line-height: 14px !important;
  display: inline-block !important;
  color: #ffffff !important;
  filter: brightness(0) invert(1) !important;
}

#grid4-app-shell .contacts-panel-main > .action-container-right {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0.45rem !important;
  white-space: normal !important;
  font-size: 0 !important;
}

#grid4-app-shell .contacts-panel-main > .action-container-right > .action-container-row {
  display: contents !important;
  margin-top: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
}

#grid4-app-shell .contacts-panel-main > .action-container-right .btn-group {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  margin: 0 !important;
  font-size: 0 !important;
}

#grid4-app-shell .contacts-panel-main > .action-container-right > * + *,
#grid4-app-shell .contacts-panel-main > .action-container-right .btn-group > .btn + .btn {
  margin-left: 0 !important;
}

#grid4-app-shell .contacts-panel-main > .action-container-right > .btn,
#grid4-app-shell .contacts-panel-main > .action-container-right .btn-group > .btn,
#grid4-app-shell .contacts-panel-main > .action-container-right > #pageRefresh {
  margin-top: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
  font-size: 0.9rem !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-right,
body.page-inventory #grid4-app-shell .action-container-right {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  float: right !important;
  width: auto !important;
  white-space: nowrap !important;
  font-size: 0 !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-right > div,
body.page-inventory #grid4-app-shell .action-container-right > div {
  display: inline-flex !important;
  align-items: center !important;
  padding: 0 !important;
  margin-top: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
  font-size: 0 !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-right > * + *,
body.page-inventory #grid4-app-shell .action-container-right > * + * {
  margin-left: 0.5rem !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-right .btn-group > .btn + .btn,
body.page-inventory #grid4-app-shell .action-container-right .btn-group > .btn + .btn {
  margin-left: 0.5rem !important;
}

body.page-uiconfigs #grid4-app-shell .action-container-right > #pageRefresh,
body.page-uiconfigs #grid4-app-shell .action-container-right > .btn,
body.page-uiconfigs #grid4-app-shell .action-container-right > div > .btn,
body.page-uiconfigs #grid4-app-shell .action-container-right .btn-group > .btn,
body.page-inventory #grid4-app-shell .action-container-right > #pageRefresh,
body.page-inventory #grid4-app-shell .action-container-right > .btn,
body.page-inventory #grid4-app-shell .action-container-right > div > .btn,
body.page-inventory #grid4-app-shell .action-container-right .btn-group > .btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-top: 0 !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
  height: 1.875rem !important;
  min-height: 1.875rem !important;
  line-height: 1.25rem !important;
  box-sizing: border-box !important;
  font-size: 0.9rem !important;
}

body.page-uiconfigs #grid4-app-shell #pageRefresh,
body.page-inventory #grid4-app-shell #pageRefresh {
  width: 1.875rem !important;
  min-width: 1.875rem !important;
  height: 1.875rem !important;
  min-height: 1.875rem !important;
  padding: 0 !important;
}

/* Keep true split buttons connected without collapsing real multi-button toolbars. */
body #grid4-app-shell .action-container-right .btn-group > .btn + .btn.dropdown-toggle,
body #grid4-app-shell .btn-group.big-btn-loading > .btn + .dropdown-toggle.big-button-caret,
body #grid4-app-shell #status-offline > .btn + .dropdown-toggle.big-button-caret,
body #grid4-app-shell #status-online > .btn + .dropdown-toggle.big-button-caret {
  margin-left: -1px !important;
}

/* Reports page uses a normal two-button group, not a true split button. Keep the actions separate. */
body.page-queues #grid4-app-shell .reports-toolbar-row .hide.pull-right > .btn-group > .btn,
body.page-queues #grid4-app-shell #modal-body-reports > .btn-group > .btn {
  border-radius: var(--g4-radius-md) !important;
}

body.page-queues #grid4-app-shell .reports-toolbar-row .hide.pull-right > .btn-group > .btn ~ .btn:not(.dropdown-toggle):not(.big-button-caret),
body.page-queues #grid4-app-shell #modal-body-reports > .btn-group > .btn ~ .btn:not(.dropdown-toggle):not(.big-button-caret) {
  margin-left: 0.5rem !important;
}

body.page-queues #grid4-app-shell .modal-header-settings {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
}

body.page-queues #grid4-app-shell .modal-header-settings .pull-right {
  float: none !important;
  margin-left: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 7.5px !important;
}

body.page-queues #grid4-app-shell .modal-header-settings .pull-right > .btn,
body.page-queues #grid4-app-shell .modal-header-settings .pull-right > a.btn {
  margin: 0 !important;
}

body.page-queues #grid4-app-shell #cc-settings-btn-header,
body.page-queues #grid4-app-shell #emailReportsLink {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.page-queues #grid4-app-shell ul.nav.nav-tabs {
  clear: both !important;
  width: 100% !important;
}

body.page-contacts #write-contact #submitGroup > .btn-save.btn-combo-save {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

body.page-contacts #write-contact #submitGroup > .dropdown-toggle {
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  height: 29.25px !important;
  min-height: 29.25px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  margin-left: -1px !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
  font-size: 0 !important;
  line-height: 1 !important;
  overflow: hidden !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

body.page-contacts #write-contact #submitGroup > .dropdown-toggle .caret {
  margin: 0 !important;
}

#grid4-app-shell .contacts-panel-main > .table-container {
  grid-column: 1 / -1;
  min-width: 0;
}

#grid4-app-shell .contacts-panel-main #group-dropdown {
  max-height: none !important;
  overflow: visible !important;
  min-width: 10.75rem;
}

#grid4-app-shell .contacts-panel-main #group-dropdown,
#grid4-app-shell .contacts-panel-main #group-dropdown > .dropdown-submenu > .dropdown-menu {
  transition: none !important;
}

#grid4-app-shell .contacts-panel-main .dropdown-button.btn-group.open > #group-dropdown,
#grid4-app-shell .contacts-panel-main .dropdown-button.btn-group:focus-within > #group-dropdown {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

#grid4-app-shell .contacts-panel-main #group-dropdown > .dropdown-submenu {
  position: relative;
}

#grid4-app-shell .contacts-panel-main #group-dropdown > .dropdown-submenu > .dropdown-menu {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  top: -0.35rem;
  left: calc(100% - 0.2rem);
  min-width: 11rem;
  max-height: min(22rem, 70vh);
  overflow-y: auto !important;
  overflow-x: hidden !important;
  margin-top: 0 !important;
}

#grid4-app-shell .contacts-panel-main #group-dropdown > .dropdown-submenu:hover > .dropdown-menu,
#grid4-app-shell .contacts-panel-main #group-dropdown > .dropdown-submenu:focus-within > .dropdown-menu {
  display: block !important;
  opacity: 1;
  visibility: visible;
}

@media (max-width: 1180px) {
  #grid4-app-shell .contacts-panel-main {
    grid-template-columns: 1fr;
  }

  #grid4-app-shell .contacts-panel-main > .action-container-right {
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
  }
}

/* Auto Attendant Editor Page Fixes */
.page-autoattendants #grid4-app-shell #content {
  /* Fix content alignment specific to Auto Attendant editor */
  padding-top: var(--g4-content-padding) !important;
  margin-top: 0 !important;
}

.page-autoattendants #grid4-app-shell .container-fluid {
  max-width: 100% !important;
  padding: 0 !important;
}

.page-autoattendants #grid4-app-shell .attendant-tier {
  background: var(--surface-primary-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--g4-radius-md) !important;
  padding: 1rem !important;
  margin-bottom: 1rem !important;
}

.page-autoattendants #grid4-app-shell .aa-editor-container {
  display: flex !important;
  flex-direction: column !important;
  gap: 1rem !important;
}

.page-autoattendants #grid4-app-shell .aa-menu-buttons {
  display: flex;
  flex-wrap: wrap !important;
  gap: 0.5rem !important;
  align-items: flex-start !important;
}

body.page-autoattendants #grid4-app-shell .aa-menu-buttons.grid4-aa-visible {
  display: flex !important;
}

body.page-autoattendants #grid4-app-shell .aa-menu-buttons.grid4-aa-hidden {
  display: none !important;
}

/* Auto Attendant specific form elements */
.page-autoattendants #grid4-app-shell input[type="text"],
.page-autoattendants #grid4-app-shell select,
.page-autoattendants #grid4-app-shell textarea {
  background: var(--surface-primary-bg) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
}

/* CRITICAL FIX: Auto Attendant .form-actions conflict
  PROBLEM: A global rule for .form-actions forces all hidden AA configuration
  panels to be visible, breaking the layout.
  SOLUTION: Use page-specific class to restore default hidden behavior
  for the .application-details panels within .attendant-creation container.
 */
.page-autoattendants .attendant-creation .application-details.form-actions {
  display: none !important;
}

/* When JavaScript makes a panel visible by changing its inline style,
 * ensure it displays correctly as a flex container as intended by our skin.
 */
.page-autoattendants .attendant-creation .application-details.form-actions[style*="display: block"],
.page-autoattendants .attendant-creation .application-details.form-actions[style*="display: flex"] {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 1.5rem !important;
  overflow: visible !important;
}

/* Section 27: Button Spacing and Shape Improvements */
/* Standardize button spacing - increased from 5px to 8px */
.btn + .btn,
.btn-group > .btn + .btn,
.btn-toolbar > .btn + .btn,
.btn-toolbar .btn,
.btn-toolbar .btn-group {
margin-left: 4px !important;
}

/* Attendant Console — Numpad spacing fix
   Block global button adjacency margins inside the off-net dialer keypad. */
#numberPad .btn + .btn,
#numberPad .btn-group > .btn + .btn,
.numpad-btn,
.numpad-btn[id^="numPad"],
#grid4-app-shell #numberPad .btn + .btn,
#grid4-app-shell #numberPad .btn-group > .btn + .btn,
#grid4-app-shell #numberPad .numpad-btn,
#grid4-app-shell .numpad-btn[id^="numPad"] {
  margin-left: 0 !important;
}


/* Keep generic buttons aligned with the shared radius token. */
.btn,
.btn-sm,
.btn-lg,
.btn-primary,
.btn-default,
.btn-success,
.btn-info,
.btn-warning,
.btn-danger,
.btn-link,
input[type="button"],
input[type="submit"],
button {
  border-radius: var(--g4-radius-md) !important;
  margin-right: .5rem !important;
}

/* Button groups need special handling */
.btn-group > .btn {
  border-radius: 0 !important; /* No rounding for buttons inside groups */
  margin-left: 0 !important; /* Reset margin for grouped buttons */
  margin-right: 0 !important;
}

/* First and last buttons in group get slight rounding */
.btn-group > .btn:first-child {
  border-top-left-radius: var(--g4-radius-md) !important;
  border-bottom-left-radius: var(--g4-radius-md) !important;
}

.btn-group > .btn:last-child {
  border-top-right-radius: var(--g4-radius-md) !important;
  border-bottom-right-radius: var(--g4-radius-md) !important;
}

/* Spacing between button groups */
.btn-group + .btn-group,
.btn-group + .btn,
.btn + .btn-group {
  margin-left: 0px !important;
}

/* Toolbar spacing */
.btn-toolbar {
  gap: 4px !important; /* Modern browsers */
}

/* Legacy browser fallback for toolbar spacing */
.btn-toolbar > * {
  margin-right: 8px !important;
}

.btn-toolbar > *:last-child {
  margin-right: 0 !important;
}

/* Ensure consistent vertical alignment */
.btn,
.btn-group {
  vertical-align: middle !important;
}


#grid4-app-shell a.dropdown-toggle.btn {
   padding-left: .25rem;
   padding-right: .5rem;

}

.caret
{
    border-top:4px solid white !important;
}

#builder-dropdown
{
  margin-left: -2px !important;
}

body.page-agents #grid4-app-shell #cc-reports-btn + a#builder-dropdown.btn.dropdown-toggle {
  width: 24px !important;
  min-width: 24px !important;
  max-width: 24px !important;
  height: 29.333333px !important;
  min-height: 29.333333px !important;
  margin-left: 0 !important;
  border-left-width: 0 !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

body.page-agents #grid4-app-shell #cc-reports-btn + a#builder-dropdown.btn.dropdown-toggle .caret {
  width: auto !important;
  margin: 0 !important;
}

body.page-inventory #grid4-app-shell .action-container-right .btn-group > a#builder-dropdown.btn.dropdown-toggle {
  width: 26px !important;
  min-width: 26px !important;
  max-width: 26px !important;
  margin-left: -1px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  font-size: 0 !important;
  line-height: 1 !important;
}

body.page-inventory #grid4-app-shell .action-container-right .btn-group > a#builder-dropdown.btn.dropdown-toggle .caret {
  position: static !important;
  right: auto !important;
  margin: 0 !important;
  display: block !important;
}


/* Call Center agent queue buttons are icon-font controls. A broad button polish
   pass was brightening the whole button and leaving the queue glyph looking
   disconnected from its neighboring actions. Restore the vendor NSIcon glyph
   directly and keep the button chrome aligned with adjacent controls. */
button.agent-queues-btn.btn.btn-mini.nsicon.nsicon-queue {
    filter: none !important;
    vertical-align: middle;
    font-family: NSIcon !important;
    line-height: 1 !important;
    text-shadow: none !important;
}

button.agent-queues-btn.btn.btn-mini.nsicon.nsicon-queue::before {
    content: "\e916" !important;
    font-family: NSIcon !important;
    font-size: 15px !important;
    line-height: 1 !important;
    color: currentColor !important;
}

body.page-agents #queuesPerAgentModal .dropdown-menu > li > a {
    transition: background-color 150ms ease, color 150ms ease !important;
}

body.theme-light.page-agents #queuesPerAgentModal .dropdown-menu {
    background: rgba(255, 255, 255, 0.99) !important;
    border: 1px solid rgba(var(--g4-brand-navy-rgb), 0.12) !important;
    box-shadow: 0 0.75rem 1.5rem rgba(var(--g4-brand-navy-rgb), 0.14) !important;
}

body.theme-light.page-agents #queuesPerAgentModal .dropdown-menu > li > a {
    color: var(--text-primary) !important;
    background: transparent !important;
}

body.theme-dark.page-agents #queuesPerAgentModal .dropdown-menu {
    background: var(--surface-primary-bg) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 0.9rem 1.8rem rgba(0, 0, 0, 0.34) !important;
}

body.theme-dark.page-agents #queuesPerAgentModal .dropdown-menu > li > a {
    color: var(--text-primary) !important;
    background: transparent !important;
}
#grid4-app-shell.theme-light i.icon-volume-up {
    filter: brightness(10) !important;
    /* color: unset !important;*/
    vertical-align: middle;

}

#grid4-app-shell.theme-light i.icon-volume-down {
    filter: brightness(10) !important;
    /* color: unset !important;*/
    vertical-align: middle;

}
#grid4-app-shell.theme-light i.icon-graph {
    filter: brightness(10) !important;
    /* color: unset !important;*/
    vertical-align: middle;

}
/* End Button Improvements */

/* Section 28: Modal Text Color Fixes for Dark Theme */
/* Fix h4 headers in modals - maximum specificity */
#grid4-app-shell.theme-dark ~ .modal .modal-header h4,
#grid4-app-shell.theme-dark ~ .modal .modal-body h4,
#grid4-app-shell.theme-dark ~ .modal .modal-content h4,
#grid4-app-shell.theme-dark .modal .modal-header h4,
#grid4-app-shell.theme-dark .modal .modal-body h4,
#grid4-app-shell.theme-dark .modal .modal-content h4,
body.theme-dark .modal h4,
.theme-dark .modal h4,
/* Target all possible modal h4 variations */
.theme-dark .modal-header h4,
.theme-dark .modal-body h4,
.theme-dark .modal-content h4,
#grid4-app-shell.theme-dark ~ .modal h4[class],
#grid4-app-shell.theme-dark .modal h4[class],
/* Override any inline styles or other rules */
#grid4-app-shell.theme-dark ~ .modal h4[style],
#grid4-app-shell.theme-dark .modal h4[style] {
  color: #e9ecef !important;
}

/* Light theme h4 headers */
#grid4-app-shell.theme-light ~ .modal .modal-header h4,
#grid4-app-shell.theme-light ~ .modal .modal-body h4,
#grid4-app-shell.theme-light ~ .modal .modal-content h4,
#grid4-app-shell.theme-light .modal .modal-header h4,
#grid4-app-shell.theme-light .modal .modal-body h4,
#grid4-app-shell.theme-light .modal .modal-content h4,
body.theme-light .modal h4,
.theme-light .modal h4,
.modal h4 {
  color: #333333 !important;
}

/* Fix legend elements in modals - maximum specificity */
#grid4-app-shell.theme-dark ~ .modal .modal-body legend,
#grid4-app-shell.theme-dark ~ .modal .modal-content legend,
#grid4-app-shell.theme-dark ~ .modal fieldset legend,
#grid4-app-shell.theme-dark .modal .modal-body legend,
#grid4-app-shell.theme-dark .modal .modal-content legend,
#grid4-app-shell.theme-dark .modal fieldset legend,
body.theme-dark .modal legend,
.theme-dark .modal legend,
/* Target all possible legend variations */
.theme-dark .modal-body legend,
.theme-dark .modal-content legend,
.theme-dark fieldset legend,
#grid4-app-shell.theme-dark ~ .modal legend[class],
#grid4-app-shell.theme-dark .modal legend[class],
/* Override any inline styles */
#grid4-app-shell.theme-dark ~ .modal legend[style],
#grid4-app-shell.theme-dark .modal legend[style] {
  color: #e9ecef !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}
/* Fix legend elements  */
#grid4-app-shell.theme-dark legend,
#grid4-app-shell.theme-dark legend,
#grid4-app-shell.theme-dark fieldset legend,
#grid4-app-shell.theme-dark legend,
#grid4-app-shell.theme-dark legend,
#grid4-app-shell.theme-dark fieldset legend,
body.theme-dark legend,
.theme-dark  legend,
/* Target all possible legend variations */
.theme-dark  legend,
.theme-dark  legend,
.theme-dark legend,
#grid4-app-shell.theme-dark legend[class],
#grid4-app-shell.theme-dark legend[class],
/* Override any inline styles */
#grid4-app-shell.theme-dark legend[style],
#grid4-app-shell.theme-dark legend[style] {
  color: #e9ecef !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}
/* Light theme legends */
#grid4-app-shell.theme-light ~ .modal .modal-body legend,
#grid4-app-shell.theme-light ~ .modal .modal-content legend,
#grid4-app-shell.theme-light ~ .modal fieldset legend,
#grid4-app-shell.theme-light .modal .modal-body legend,
#grid4-app-shell.theme-light .modal .modal-content legend,
#grid4-app-shell.theme-light .modal fieldset legend,
body.theme-light .modal legend,
.theme-light .modal legend,
.modal legend {
  color: #333333 !important;
  border-bottom-color: #e5e5e5 !important;
}

/* Fix help-block and help-inline text */
#grid4-app-shell.theme-dark ~ .modal .help-block,
#grid4-app-shell.theme-dark ~ .modal .help-inline,
#grid4-app-shell.theme-dark .modal .help-block,
#grid4-app-shell.theme-dark .modal .help-inline,
.theme-dark .modal .help-block,
.theme-dark .modal .help-inline {
  color: #adb5bd !important; /* Muted gray for dark theme */
}

/* Light theme help text */
#grid4-app-shell.theme-light ~ .modal .help-block,
#grid4-app-shell.theme-light ~ .modal .help-inline,
#grid4-app-shell.theme-light .modal .help-block,
#grid4-app-shell.theme-light .modal .help-inline,
.theme-light .modal .help-block,
.theme-light .modal .help-inline,
.modal .help-block,
.modal .help-inline {
  color: #6c757d !important; /* Muted gray for light theme */
}

/* Remove the problematic g4-themed rule that was overriding theme-specific colors */
/* Previously had .modal.g4-themed .help-inline/.help-block rules here but removed to allow theme-specific rules to work */

/* End Modal Text Color Fixes */

/* Section 29: Navigation Icon Fixes */
/* Ensure FontAwesome icons display properly */
#nav-buttons .fa {
  display: inline-block !important;
  margin-right: 5px !important;
  width: 16px !important;
  text-align: center !important;
  font-family: FontAwesome !important;
  vertical-align: middle !important;
}

/* Icon positioning inside nav structure */
#nav-buttons li a .fa {
  position: relative !important;
  top: 0 !important;
}

/* Specific fix for fax icon */
#nav-buttons .fa-fax:before {
  content: "\f1ac" !important; /* FontAwesome 4.7 fax icon */
}

/* Ensure nav-text spans are properly styled */
#nav-buttons .nav-text {
  display: inline !important;
  vertical-align: middle !important;
}

/* Icon visibility */
.nav-button + .fa {
  display: inline-block !important;
}

#grid4-app-shell {
  --g4-radius-sm: 0.20rem !important;
  --g4-radius-md: 0.325rem !important;
  --g4-radius-lg: 0.5rem !important;
}

#grid4-app-shell .btn,
#grid4-app-shell .form-control,
#grid4-app-shell .panel,
#grid4-app-shell .modal-content {
  border-radius: var(--g4-radius-md) !important;
}



/* End Navigation Icon Fixes */
/* ===================================
   PAGE-SPECIFIC FIX: AUTO ATTENDANT EDITOR (v3 - Ultimate Specificity)
   =================================== */

/*
 * PROBLEM: A global rule for `.form-actions` is overriding the display property of the
 * AA panels. Previous fixes failed due to a specificity conflict.
 *
 * SOLUTION: This version uses the highest practical specificity by starting the
 * selector chain from the `body` tag with the page-specific class. This ensures
 * our `display: none` rule wins the specificity battle against the global rule.
 */
body.page-autoattendants #grid4-app-shell .attendant-creation .application-details.form-actions {
  display: none !important;
}

/*
 * This corresponding rule ensures that when the portal's JavaScript adds an inline
 * `style="display: block;"` to show a panel, our override kicks in to correctly
 * display it as a flex container. The attribute selector makes it even more specific.
 */
body.page-autoattendants #grid4-app-shell .attendant-creation .application-details.form-actions[style*="display: block"],
body.page-autoattendants #grid4-app-shell .attendant-creation .application-details.form-actions[style*="display: flex"] {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 1.5rem !important;
  overflow: visible !important;
  /* Brad fix #4: background container for both assigned and unassigned keys */
  background: var(--surface-secondary-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--g4-radius-md) !important;
  padding: 1rem !important;
}

/* The unconfigured-key chooser uses different vendor markup than the configured
   AA detail panels, so it needs its own layout instead of the generic form grid. */
body.page-autoattendants #grid4-app-shell .attendant-creation .application-select.form-actions[style*="display: block"],
body.page-autoattendants #grid4-app-shell .attendant-creation .application-select.form-actions[style*="display: flex"] {
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  gap: 0.875rem !important;
  height: auto !important;
  min-height: auto !important;
  padding: 1rem 1.25rem !important;
}

body.page-autoattendants #grid4-app-shell .attendant-creation .application-select .application-text,
body.page-autoattendants #grid4-app-shell .attendant-creation .application-select .application-choices {
  float: none !important;
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
}

body.page-autoattendants #grid4-app-shell .attendant-creation .application-select .application-text {
  padding-top: 0 !important;
  text-align: left !important;
}

body.page-autoattendants #grid4-app-shell .attendant-creation .application-select .application-choices {
  text-align: left !important;
}

body.page-autoattendants #grid4-app-shell .attendant-creation .application-select .application-choices ul {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: flex-start !important;
  justify-content: flex-start !important;
  gap: 0.75rem !important;
}

body.page-autoattendants #grid4-app-shell .attendant-creation .application-select .application-choices li {
  display: block !important;
}

body.page-autoattendants #grid4-app-shell .attendant-creation .application-select .application-choices a {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 60px !important;
  min-height: 74px !important;
  text-align: center !important;
  line-height: 1.2 !important;
}

/* ===================================================================
   PAGE-SPECIFIC FIX: AUTO ATTENDANT ICONS (v8 - Final Targeted Filter)
   =================================================================== */

/*
 * PROBLEM: A global rule for `[class*=" icon-"]` was forcing the wrong sprite sheet.
 * A separate, stubborn rule was also setting `filter: none;` on these icons,
 * preventing our dark mode theming from applying.
 *
 * SOLUTION: A two-pronged attack.
 * 1. An override targeting `[class*=" icon-"]` specifically to force the correct
 *    `background-image` (`aa-icons.png`) onto the elements.
 * 2. A NEW, separate override targeting the more unique `.app-icon-lg` class
 *    to apply our theme-specific filter. This avoids conflict with the
 *    global `filter: none;` rule.
 */
/* 1. Force the correct background image onto the icon elements */
#grid4-app-shell .page-autoattendants .application-choices [class*=" icon-"] {
  display: block;
  width: 40px;
  height: 40px;
  background-image: url('/portal/img/misc/aa-icons.png') !important;
  background-repeat: no-repeat;
  margin: 0 auto 5px;
}

/* 2. Set the specific background positions for each icon */
#grid4-app-shell .page-autoattendants .application-choices .icon-user { background-position: 0 0; }
#grid4-app-shell .page-autoattendants .application-choices .icon-conference { background-position: -40px 0; }
#grid4-app-shell .page-autoattendants .application-choices .icon-callqueue { background-position: -80px 0; }
#grid4-app-shell .page-autoattendants .application-choices .icon-directory { background-position: -120px 0; }
#grid4-app-shell .page-autoattendants .application-choices .icon-voicemail { background-position: -160px 0; }
#grid4-app-shell .page-autoattendants .application-choices .icon-vmailmanage { background-position: -200px 0; }
#grid4-app-shell .page-autoattendants .application-choices .icon-external { background-position: -240px 0; }
#grid4-app-shell .page-autoattendants .application-choices .icon-message { background-position: -280px 0; }
#grid4-app-shell .page-autoattendants .application-choices .icon-repeat { background-position: -320px 0; }
#grid4-app-shell .page-autoattendants .application-choices .icon-tier { background-position: -360px 0; }
/* 3. Apply the theme-specific filter by targeting the unique `.app-icon-lg` class */
body.page-autoattendants #grid4-app-shell.theme-dark .application-choices .app-icon-lg {
  filter: invert(1) brightness(2.5) contrast(1.5) !important;
}

/* 4. Dark mode follow-up for AA editor sprite controls.
   The intro/manage buttons, inline edit buttons, cog sprite, and dial-pad
   keys still come from legacy sprite sheets, so text color alone does not
   improve their visibility on dark surfaces. */
body.theme-dark.page-autoattendants #grid4-app-shell .attendant-basics a.audio.helpsy.greeting-manage,
body.theme-dark.page-autoattendants #grid4-app-shell .attendant-creation a.audio.helpsy.greeting-manage,
body.theme-dark.page-autoattendants #grid4-app-shell .attendant-creation a.edit.helpsy,
body.theme-dark.page-autoattendants #grid4-app-shell .attendant-creation .tier-options-btn .glyphicon-small-cogwheel {
  filter: none !important;
  opacity: 1 !important;
}

/* Intro greeting add/edit rows need the same left inset used by other modal labels. */
#introgreeting-modal #greetingAddEdit .control-label {
  width: 160px;
  box-sizing: border-box;
  padding-left: 16px;
  text-align: left;
}

html:not([data-grid4-skin="off"]) body.theme-dark.page-autoattendants .dialpad div[class*='key-'] {
  filter: alpha(opacity=88);
  -khtml-opacity: 0.88;
  -moz-opacity: 0.88;
  opacity: 0.88 !important;
}

html:not([data-grid4-skin="off"]) body.theme-dark.page-autoattendants .dialpad div[class*='key-']:hover,
html:not([data-grid4-skin="off"]) body.theme-dark.page-autoattendants .dialpad div[class*='key-'].selected {
  filter: alpha(opacity=100);
  -khtml-opacity: 1;
  -moz-opacity: 1;
  opacity: 1 !important;
}

/* End Auto Attendant Icon Fixes */


/* ===================================================================
   FORM INPUT ADD-ON FIX (Dark Theme)
   =================================================================== */

/*
 * PROBLEM: On the AA page and elsewhere, input add-ons (`.add-on`) and
 * uneditable inputs (`.uneditable-input`) have a light background in dark mode.
 *
 * SOLUTION: Create a specific rule for these elements in dark mode to match
 * the theme's form input styling.
 */
#grid4-app-shell.theme-dark .add-on,
#grid4-app-shell.theme-dark .uneditable-input {
  background-color: var(--surface-secondary-bg) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  text-shadow: none !important;
}


/* ===================================
   SECTION 26A: Dropdown Hitbox Fix (Definitive)
   =================================== */

/*
 * Legacy table action menus do not behave like our modern dropdowns.
 * Opt them out of the global animated dropdown system so they use the
 * normal Bootstrap open/closed model instead of ghost visibility states.
 */
#grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu,
#grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu {
  display: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  transition: none !important;
  pointer-events: auto !important;
  background: var(--surface-secondary-bg) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  margin-top: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34) !important;
  min-width: 10.75rem !important;
  padding: 0 !important;
  overflow: hidden !important;
  background-clip: padding-box !important;
}

#grid4-app-shell .users-panel-main .table .action-buttons .dropdown.g4-dropdown-open-intent > .dropdown-menu,
#grid4-app-shell .domains-panel-main .table .action-buttons .dropdown.g4-dropdown-open-intent > .dropdown-menu {
  display: block !important;
}

/* Contacts tables reuse legacy in-row dropdowns with custom click handlers.
   Give them the same immediate, non-ghost menu surface as Users/Domains, but
   keep this CSS-only so we do not trample the contacts-specific JS paths. */
#grid4-app-shell #contacts-table .action-buttons .dropdown-menu {
  display: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  transition: none !important;
  pointer-events: auto !important;
  background: var(--surface-secondary-bg) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  margin-top: 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34) !important;
  min-width: 9rem !important;
  padding: 0 !important;
  overflow: hidden !important;
  background-clip: padding-box !important;
}

#grid4-app-shell #contacts-table .action-buttons .dropdown.open > .dropdown-menu,
#grid4-app-shell #contacts-table .action-buttons .btn-group.open > .dropdown-menu {
  display: block !important;
}

/*
 * PROBLEM: The dropdown closes when the mouse is over the empty space
 * inside the menu, because the links (<a>) are not full-width, allowing
 * mouse events to pass through to the action buttons in the rows underneath.
 *
 * SOLUTION: This highly specific rule forces the links (<a>) inside the action
 * menu to become block-level elements. This makes them fill the entire width
 * of the dropdown, creating a solid, interactive surface with no "holes" and
 * preventing the underlying row from ever receiving a mouse event while the
 * menu is open.
*/
#grid4-app-shell .table .action-buttons .dropdown,
#grid4-app-shell .table .action-buttons span.dropdown {
  position: relative;
}

#grid4-app-shell .table .action-buttons .dropdown-menu {
  position: absolute !important;
  top: 100% !important;
  margin-top: -1px !important;
  right: -0.45rem !important;
  left: auto !important;
  float: none !important;
  border-top-right-radius: 0 !important;
  z-index: 50010 !important;
}

#grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu > li,
#grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu > li {
  margin: 0 !important;
  background: transparent !important;
}

#grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu > li + li,
#grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu > li + li {
  border-top: 1px solid rgba(var(--g4-brand-navy-rgb), 0.08) !important;
}

#grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu::before,
#grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu::after,
#grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu::before,
#grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu::after {
  display: none !important;
}

#grid4-app-shell .table .action-buttons .dropdown-menu li a {
  display: block !important;
  padding: 4px 40px !important;
  color: var(--table-hover-text) !important;
  text-align: left;
  font-weight: 500 !important;
}

#grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu,
#grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu *,
#grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu,
#grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu * {
  opacity: 1 !important;
  filter: none !important;
}

body.theme-dark #grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu,
body.theme-dark #grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu {
  background: #11161d !important;
  background-color: #11161d !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

body.theme-dark #grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu > li + li,
body.theme-dark #grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu > li + li {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}

body.theme-light #grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu,
body.theme-light #grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12) !important;
}

#grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu > li > a,
#grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu > li > a {
  padding: 0.6rem 1rem !important;
  color: var(--text-primary) !important;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  text-shadow: none !important;
  white-space: nowrap !important;
  opacity: 1 !important;
  filter: none !important;
}

body.theme-dark #grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu > li > a,
body.theme-dark #grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu > li > a {
  color: #f5f7fb !important;
}

body.theme-light #grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu > li > a,
body.theme-light #grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu > li > a {
  color: #18212c !important;
}

#grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu > li:hover > a,
#grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu > li > a:hover,
#grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu > li > a:focus,
#grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu > .active > a,
#grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu > li:hover > a,
#grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu > li > a:hover,
#grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu > li > a:focus,
#grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu > .active > a {
  color: #ffffff !important;
  background: var(--accent-primary) !important;
  background-color: var(--accent-primary) !important;
  background-image: none !important;
  text-decoration: none !important;
  text-shadow: none !important;
  opacity: 1 !important;
}

body.theme-dark #grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu > li:hover > a,
body.theme-dark #grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu > li > a:hover,
body.theme-dark #grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu > li > a:focus,
body.theme-dark #grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu > .active > a,
body.theme-dark #grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu > li:hover > a,
body.theme-dark #grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu > li > a:hover,
body.theme-dark #grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu > li > a:focus,
body.theme-dark #grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu > .active > a,
body.theme-light #grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu > li:hover > a,
body.theme-light #grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu > li > a:hover,
body.theme-light #grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu > li > a:focus,
body.theme-light #grid4-app-shell .users-panel-main .table .action-buttons .dropdown-menu > .active > a,
body.theme-light #grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu > li:hover > a,
body.theme-light #grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu > li > a:hover,
body.theme-light #grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu > li > a:focus,
body.theme-light #grid4-app-shell .domains-panel-main .table .action-buttons .dropdown-menu > .active > a {
  color: #ffffff !important;
}


/* ===================================
   SECTION 26A: Dropdown Event Isolation Fix (Definitive)
   =================================== */

/*
 * When a dropdown is open, our JavaScript adds the 'dropdown-active'
 * class to its parent table row (<tr>). This CSS rule uses that class to
 * elevate the entire row's stacking context with a z-index, effectively
 * shielding all other rows from mouse events and making the dropdown stable.
*/
#grid4-app-shell .table > tbody > tr.dropdown-active {
  position: relative;
  z-index: 20;
  isolation: isolate;
}

#grid4-app-shell .table > tbody > tr.dropdown-active .action-buttons,
#grid4-app-shell .table > tbody > tr.dropdown-active .action-buttons .dropdown {
  position: relative;
  z-index: 50010 !important;
}

#grid4-app-shell .table > tbody > tr.dropdown-active .action-buttons .dropdown-menu {
  position: absolute !important;
  z-index: 50010 !important;
}

#grid4-app-shell .users-panel-main .table tbody tr.dropdown-active td,
#grid4-app-shell .domains-panel-main .table tbody tr.dropdown-active td {
  color: var(--text-primary) !important;
  transform: none !important;
}

body.theme-dark #grid4-app-shell .users-panel-main .table tbody tr.dropdown-active td,
body.theme-dark #grid4-app-shell .domains-panel-main .table tbody tr.dropdown-active td {
  background-color: rgba(var(--g4-brand-sky-rgb), 0.14) !important;
}

body.theme-light #grid4-app-shell .users-panel-main .table tbody tr.dropdown-active td,
body.theme-light #grid4-app-shell .domains-panel-main .table tbody tr.dropdown-active td {
  background-color: rgba(var(--g4-brand-sky-rgb), 0.1) !important;
}

#grid4-app-shell .users-panel-main.g4-table-dropdown-open .table tbody tr:not(.dropdown-active) .action-buttons,
#grid4-app-shell .domains-panel-main.g4-table-dropdown-open .table tbody tr:not(.dropdown-active) .action-buttons {
  pointer-events: none !important;
}

#grid4-app-shell .users-panel-main.g4-table-dropdown-open .table tbody tr:not(.dropdown-active):hover .action-buttons a,
#grid4-app-shell .domains-panel-main.g4-table-dropdown-open .table tbody tr:not(.dropdown-active):hover .action-buttons a {
  opacity: inherit !important;
  filter: none !important;
  transition: none !important;
}

#grid4-app-shell .table > tbody > tr.dropdown-active .action-buttons a,
#grid4-app-shell .table > tbody > tr.dropdown-active .action-buttons .dropdown-menu a,
#grid4-app-shell .table .action-buttons .dropdown.open > a,
#grid4-app-shell .table .action-buttons .dropdown.open .dropdown-menu a {
  filter: none !important;
  opacity: 1 !important;
}

body.theme-dark #grid4-app-shell .action-buttons a,
body.theme-dark #grid4-app-shell td a.add,
body.theme-dark #grid4-app-shell td a.edit,
body.theme-dark #grid4-app-shell td a.delete,
body.theme-dark #grid4-app-shell td a.manage,
body.theme-dark #grid4-app-shell td a.agents {
  opacity: 0.58 !important;
  transition: opacity var(--g4-transition-fast) !important;
}

body.theme-dark #grid4-app-shell .table-hover tbody tr:hover .action-buttons a,
body.theme-dark #grid4-app-shell .table tbody tr.dropdown-active .action-buttons a,
body.theme-dark #grid4-app-shell td a.add:hover,
body.theme-dark #grid4-app-shell td a.edit:hover,
body.theme-dark #grid4-app-shell td a.delete:hover,
body.theme-dark #grid4-app-shell td a.manage:hover,
body.theme-dark #grid4-app-shell td a.agents:hover {
  opacity: 1 !important;
}

body.theme-dark #grid4-app-shell .users-panel-main.g4-table-dropdown-open .table tbody tr:not(.dropdown-active):hover .action-buttons a,
body.theme-dark #grid4-app-shell .domains-panel-main.g4-table-dropdown-open .table tbody tr:not(.dropdown-active):hover .action-buttons a {
  opacity: inherit !important;
  filter: none !important;
}



/* ===================================================================
   PAGE-SPECIFIC FIX: CALL HISTORY QOS POPOVER (v6 - Final)
   =================================================================== */


/*for the fax page in dark mode */
#grid4-app-shell.theme-dark .info-alert-custom {
    background-color: black !important;
}



/*
 * PROBLEM: The popover was unthemed and flickered on page load.
 *
 * SOLUTION:
 * 1. A JS function now re-initializes the popover in the correct `body`
 *    container and dynamically adds theme classes on show.
 * 2. This CSS proactively hides the default, incorrectly placed popover
 *    that is generated inside the table, preventing the flicker.
 * 3. The main styling rules now target the dynamically themed popover
 *    that exists as a child of the body.
 */

/* 1. CRITICAL: Proactively hide the broken popover to prevent flicker. */
/* This targets any qos-popover that is inside a table cell. Our JS-created popover is not. */
#call-history-table .qos-popover {
  display: none !important;
  visibility: hidden !important;
}

/* 2. Main Popover Theming (now targeting the JS-themed element) */
/* Selects the popover when it has our dynamically added theme classes. */
.popover.qos-popover.g4-themed {
  z-index: 10001 !important;
  background: var(--surface-primary-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--g4-radius-md) !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3) !important;
  opacity: 1 !important;
}

/* 3. Popover Inner Structure */
.popover.qos-popover.g4-themed .popover-inner {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  box-shadow: none !important;
}

/* 4. Popover Content & Text Color */
.popover.qos-popover.g4-themed .popover-content {
  color: var(--text-primary) !important;
  padding: 10px 12px !important;
}

/* 5. Arrow Theming */
.popover.qos-popover.g4-themed.right > .arrow {
  border-right-color: var(--border-color) !important;
}
.popover.qos-popover.g4-themed.right > .arrow:after {
  border-right-color: var(--surface-primary-bg) !important;
}

/* 6. Table Theming Inside the Popover */
.popover.qos-popover.g4-themed .table {
  color: var(--text-primary) !important;
  background: transparent !important;
}
.popover.qos-popover.g4-themed .table th {
  color: var(--text-secondary) !important;
  border-bottom: 2px solid var(--border-color) !important;
  font-weight: 700;
}
.popover.qos-popover.g4-themed .table td {
  border-top: 1px solid var(--border-color) !important;
}


/* ===================================================================
   PAGE-SPECIFIC FIX: CALL HISTORY "CALL FLOW" MODAL
   =================================================================== */

/*
 * PROBLEM: The "Call Flow" modal (#cradle-modal) on the Call History page
 * is not fully themed, with inconsistent backgrounds and icons that are
 * not visible in light mode.
 *
 * SOLUTION:
 * 1. Use a high-specificity, page-scoped selector to target the #cradle-modal.
 * 2. Unify the modal's header, body, and footer backgrounds using theme variables.
 * 3. Style the custom `.cradle-timeline` list, including the connecting lines,
 *    icon backgrounds, and text, using theme variables.
 * 4. Apply a CSS `filter: invert(1)` to the timeline icons ONLY in light mode
 *    to change them from white to black for proper visibility.
 */

/* 1. Base Modal Theming */
/* Unify header and footer styling */
body.page-callhistory #grid4-app-shell #cradle-modal .modal-header,
body.page-callhistory #grid4-app-shell #cradle-modal .modal-footer {
  background-color: var(--surface-secondary-bg) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}
.modal-body > .cradle-timeline  {
  background-color: var(--surface-primary-bg) !important;
  /*color: var(--text-primary) !important; */
  border-color: var(--border-color) !important;
}
/* Style the main body to be distinct but themed */
body.page-callhistory #grid4-app-shell #cradle-modal .modal-body {
  background-color: var(--surface-primary-bg) !important;
}

/* Ensure modal title is the correct color */
body.page-callhistory #grid4-app-shell #cradle-modal .modal-header h4 {
  color: var(--text-primary) !important;
}





/* 4. Timeline Icon Styling (Pseudo-element) */
/* This creates the circle behind the icon */
body.page-callhistory #grid4-app-shell #cradle-modal .cradle-timeline .event::before {
  background-color: var(--surface-secondary-bg);
  border: 0px solid var(--border-color);
  color: var(--accent-primary) !important;

  /* The actual phone icon is a background-image set by the portal's default CSS */
}

/* 5. CRITICAL: Icon Theming for Light vs. Dark Mode */
/* In light mode, the default white icons are invisible. This inverts them to black. */
body.page-callhistory #grid4-app-shell.theme-light #cradle-modal .cradle-timeline .event::before {
  /*filter: invert(1); */
  color: var(--text-primary) !important;

}

/* 6. Timeline Text Styling */
/* Main event text */
body.page-callhistory #grid4-app-shell #cradle-modal .cradle-timeline .event p {

  color: var(--text-primary);
  font-weight: 500;
}

/* Timestamp text (+3s, +7s, etc.) */
body.page-callhistory #grid4-app-shell #cradle-modal .cradle-timeline .event .event-ts {
  color: var(--text-secondary);
  font-size: var(--g4-font-size-sm);
}
body.page-callhistory #grid4-app-shell.modal.g4-themed.theme-dark #cradle-modal .cradle-timeline .event::after {
  filter: invert(1);
  color: var(--text-primary) !important;

}
/* ===================================================================
   PAGE-SPECIFIC FIX: ANSWERING RULES "ALLOW / BLOCK" MODAL (v2)
   =================================================================== */

/*
 * PROBLEM: The "Allow / Block" modal on the Answering Rules page uses
 * default Bootstrap `.well` components which are not theme-aware, resulting
 * in bright white boxes and unreadable text in dark mode.
 *
 * SOLUTION (v2):
 * 1. Use the `.page-answerrules` context class to scope all fixes.
 * 2. Override the `.well` element's background to be theme-aware, removing
 *    default borders and shadows.
 * 3. Explicitly set the text color for the section titles and checkbox label.
 * 4. Add a max-height and scrollbar to the number list containers.
 * 5. Resize the "+" buttons to the specified dimensions.
 */

/* 1. Theme the main container "wells" */
body.page-answerrules #grid4-app-shell .well,
body.page-answerrules #content .well {
  background-color: var(--surface-primary-bg) !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* 2. Style the section titles */
body.page-answerrules #grid4-app-shell .allowblock-input h6 {
  color: var(--text-primary) !important;
  font-weight: 600;
  margin-bottom: 8px;
}

/* 3. Make the number list areas scrollable */
body.page-answerrules #grid4-app-shell .allowblock-table {
  min-height: 180px;
  max-height: 180px;
  overflow-y: auto;
 /* Add space for the scrollbar */
}

/* 4. Theme the anonymous block checkbox and label */
body.page-answerrules #grid4-app-shell .allowblock-anon {
  background-color: var(--surface-secondary-bg);
  border: 0px;
}

body.page-answerrules #grid4-app-shell .allowblock-anon label.checkbox {
  color: var(--text-primary) !important;
}

/* 5. Resize the "+" buttons in the input fields */
body.page-answerrules #grid4-app-shell .allowblock-input .btn {
  height: 1.7rem !important;
  width: 1.7rem !important;
  padding: 0 !important; /* Remove padding to allow for icon centering */
  display: inline-flex !important; /* Use flexbox for perfect centering */
  align-items: center;
  justify-content: center;
}

/* 6. Keep the spam-handling row readable and stop the select from truncating
   "Send to Voicemail" in the Allow / Block modal. */
body.page-answerrules #allowblock-lists.modal.g4-themed .spam-input > div {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  flex-wrap: wrap !important;
}

body.page-answerrules #allowblock-lists.modal.g4-themed .spam-input > div > span {
  color: var(--modal-text) !important;
}

body.page-answerrules #allowblock-lists.modal.g4-themed #spam_handling {
  width: 13rem !important;
  min-width: 13rem !important;
  max-width: 100% !important;
}

/* 7. Make allow/block remove controls legible in dark mode and cleaner in light mode. */
body.page-answerrules #grid4-app-shell .allowblock-table td:last-child,
body.page-answerrules #content .allowblock-table td:last-child {
  width: 2.5rem !important;
  text-align: center !important;
}

body.page-answerrules #grid4-app-shell .allowblock-table a.helpsy,
body.page-answerrules #content .allowblock-table a.helpsy {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-decoration: none !important;
  opacity: 1 !important;
}

body.page-answerrules #grid4-app-shell .allowblock-table a.helpsy i.icon-remove,
body.page-answerrules #content .allowblock-table a.helpsy i.icon-remove {
  color: #d14b5a !important;
  filter: none !important;
  opacity: 1 !important;
  margin: 0 !important;
}

body.page-answerrules #grid4-app-shell .allowblock-table a.helpsy:hover,
body.page-answerrules #grid4-app-shell .allowblock-table a.helpsy:focus,
body.page-answerrules #content .allowblock-table a.helpsy:hover,
body.page-answerrules #content .allowblock-table a.helpsy:focus {
  background: transparent !important;
  border-color: transparent !important;
}


/* ===================================================================
   PAGE-SPECIFIC FIX: ANSWERING RULES "BLOCKED NUMBERS" MODAL STYLING
   =================================================================== */

/*
 * PROBLEM: Specific components within the "Allow / Block" modal on the
 * Call History page require theme-aware background colors.
 *
 * SOLUTION: Apply page-scoped, theme-aware background colors to the
 * specified elements using the project's CSS variables.
 */

/* 1. Style the input container background */
body.page-callhistory #grid4-app-shell #allowblock-lists .allowblock-input {
  background-color: var(--app-bg) !important;
}

/* 2. Style the rejected numbers list background */
body.page-callhistory #grid4-app-shell .blocknumbers-modal #rej-list {
  background-color: var(--modal-bg) !important;
}

/* 3. Style the "well" container for the blocked numbers list */
body.page-callhistory #grid4-app-shell #allowblock-lists #block-div .well {
  background-color: var(--modal-bg) !important;
}

body.page-callhistory #grid4-app-shell #allowblock-lists .rej-row-remove a.helpsy {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 1rem !important;
  height: 1rem !important;
  opacity: 1 !important;
  text-decoration: none !important;
}

body.page-callhistory #grid4-app-shell #allowblock-lists .rej-row-remove a.helpsy i.icon-remove {
  background-image: none !important;
  display: inline-block !important;
  width: auto !important;
  height: auto !important;
  text-indent: 0 !important;
  overflow: visible !important;
}

body.page-callhistory #grid4-app-shell #allowblock-lists .rej-row-remove a.helpsy i.icon-remove::before {
  content: '×';
  display: inline-block;
  font-style: normal;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  color: var(--g4-button-danger-bg) !important;
}
/* ===================================================================
   PAGE-SPECIFIC FIX: MESSAGES PAGE CHAT INTERFACE
   =================================================================== */

/*
 * PROBLEM: The chat interface on the Messages page is not theme-aware.
 * Message bubbles and text are unreadable in dark mode due to default
 * light-mode styling from the `.well` class.
 *
 * SOLUTION:
 * 1. Scope all rules within `.conversation-column-left` to ensure they only
 *    apply to this specific chat interface.
 * 2. Theme the main chat box background for better visual structure.
 * 3. Override the `.chat-well` styles to provide distinct, theme-aware
 *    backgrounds for inbound (received) and outbound (sent) messages.
 * 4. Style all text elements using theme variables for readability.
 */

/* 1. Main Chat Container Styling */
#grid4-app-shell .conversation-column-left .chat-box {
  background-color: var(--surface-primary-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--g4-radius-lg) !important;
  padding: .5rem !important;

}

/* 2. General Message Bubble Styling (overrides .well) */
#grid4-app-shell .conversation-column-left .chat-well {
  border-radius: var(--g4-radius-lg) !important;
  border: none !important;
  box-shadow: 0 1px 2px var(--shadow-color) !important;
  padding: 0.5rem 0.75rem !important;
}

/* 3. Inbound (Received) Message Bubbles */
#grid4-app-shell .conversation-column-left .chat-inbound .chat-well {
  background-color: var(--surface-secondary-bg) !important;
}

/* 4. Outbound (Sent) Message Bubbles */
#grid4-app-shell .conversation-column-left .chat-outbound .chat-well {
  background-color: var(--accent-primary) !important;
}

/* 5. Message Text Color */
/* Inbound text should be the primary text color of the theme */
#grid4-app-shell .conversation-column-left .chat-inbound .chat-well p {
  color: var(--text-primary) !important;
  margin: 0;
}

/* Outbound text should be white to contrast with the accent color */
#grid4-app-shell .conversation-column-left .chat-outbound .chat-well p {
  color: #ffffff !important;
  margin: 0;
}

/* 6. Timestamp and User Info Text */
#grid4-app-shell .conversation-column-left .chat-timestamp {
  color: var(--text-muted) !important;
  font-size: var(--g4-font-size-sm) !important;
  font-weight: 500;
}


/*For Timeframe Holiday Picker */
#grid4-app-shell .holiday-picker-container {
    background-color: var(--modal-bg);
}


#grid4-app-shell .accordion-heading {
    background-color: var(--modal-bg);
}


.alert {
  text-shadow: none !important;
}

.alert-info {
  background-color: var(--surface-secondary-bg) !important;

}

#grid4-app-shell a#bulkDeleteBtn.btn.btn-danger, #grid4-app-shell .btn.btn-danger#bulkDeleteBtn { color: #ffffff !important; text-shadow: none !important; }

#grid4-app-shell a#bulkDeleteBtn.btn.btn-danger:hover, #grid4-app-shell a#bulkDeleteBtn.btn.btn-danger:focus, #grid4-app-shell a#bulkDeleteBtn.btn.btn-danger:active { color: #ffffff !important; }

#grid4-app-shell a#bulkDeleteBtn.btn.btn-danger[style*="display"], #grid4-app-shell a#bulkDeleteBtn.btn.btn-danger.hide { color: #ffffff !important; }


.label-warning, .badge-warning {
    color: white !important;
}

.label-success, .badge-success {
    color: white !important;
}

.label.g4-themed.theme-light {
    color: white !important;
}

.label-info, .badge-info {
    background-color: #3a87ad;
    color: white !important;
}

.nsicon.nsicon-phone-extension {
    color: white !important;
}

.tooltip-inner {
    color: white !important;
}


input#device {
    width: 10rem !important;
}

.dropup .caret, .navbar-fixed-bottom .dropdown .caret {
    border-bottom: unset !important;
}

span.badge.badge-information {
    color: white !important;
}

span.badge.table-sentiment-positive {
    color: white !important;
}

span.badge.table-sentiment-negative {
    color: white !important;
}
span.badge.table-sentiment-neutral {
    color: white !important;
}

.pill {
    color: white !important;
}

span.label {
    color: white !important;
}

#grid4-app-shell .nonecreated {
    max-width: 32rem;
    margin: 4rem auto 0 !important;
    padding: 1.25rem 1.5rem !important;
    text-align: center !important;
    color: var(--text-muted) !important;
    background: rgba(var(--surface-secondary-rgb), 0.45) !important;
    border: 1px dashed var(--border-color) !important;
    border-radius: var(--g4-radius-lg) !important;
    box-shadow: 0 0.5rem 1.25rem var(--shadow-color) !important;
}

#grid4-app-shell .nonecreated h3,
#grid4-app-shell .nonecreated h4,
#grid4-app-shell .nonecreated h5 {
    color: inherit !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em;
    margin-bottom: 0 !important;
}

#grid4-app-shell #home-vmail-body .nonecreated,
#grid4-app-shell #home-callhistory-body .nonecreated,
#grid4-app-shell #home-phones-body .nonecreated {
    position: relative !important;
    top: 0 !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    text-align: center !important;
    color: var(--text-muted) !important;
}

#grid4-app-shell #home-vmail-body .nonecreated,
#grid4-app-shell #home-callhistory-body .nonecreated {
    top: 5rem !important;
}

#grid4-app-shell #home-phones-body .nonecreated {
    top: 1.25rem !important;
}

#grid4-app-shell #home-vmail-body .nonecreated h5,
#grid4-app-shell #home-callhistory-body .nonecreated h5,
#grid4-app-shell #home-phones-body .nonecreated p {
    margin: 0 !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}

.dock-contacts #recent-chat-table .contact-extension-td,
.dock-contacts #contacts-table .contact-extension-td {
    position: relative !important;
    width: 4.25rem !important;
    min-width: 4.25rem !important;
    max-width: 4.25rem !important;
    white-space: nowrap !important;
    padding-right: 0.375rem !important;
    overflow: visible !important;
}

.dock-contacts #recent-chat-table .contact-extension,
.dock-contacts #contacts-table .contact-extension {
    display: inline-block !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    vertical-align: middle !important;
}

.dock-contacts #recent-chat-table .contact-buttons,
.dock-contacts #contacts-table .contact-buttons {
    position: absolute !important;
    top: 50% !important;
    right: 0.375rem !important;
    transform: translateY(-50%) !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.125rem !important;
    white-space: nowrap !important;
    z-index: 3 !important;
}

.dock-contacts #recent-chat-table .contact-row:hover .contact-buttons,
.dock-contacts #recent-chat-table .contact-buttons.open,
.dock-contacts #contacts-table .contact-row:hover .contact-buttons,
.dock-contacts #contacts-table .contact-buttons.open {
    display: inline-flex !important;
}

.dock-contacts #recent-chat-table .contact-extension-td .btn,
.dock-contacts #recent-chat-table .contact-extension-td .btn-mini,
.dock-contacts #recent-chat-table .contact-extension-td [id^="videoicon"],
.dock-contacts #contacts-table .contact-extension-td .btn,
.dock-contacts #contacts-table .contact-extension-td .btn-mini,
.dock-contacts #contacts-table .contact-extension-td [id^="videoicon"] {
    width: 1.125rem !important;
    height: 1.125rem !important;
    min-height: 1.125rem !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1 !important;
    border-radius: 0.25rem !important;
    background-image: none !important;
    box-shadow: none !important;
}

.dock-contacts #recent-chat-table .contact-extension-td .btn:not(.hide),
.dock-contacts #recent-chat-table .contact-extension-td .btn-mini:not(.hide),
.dock-contacts #recent-chat-table .contact-extension-td [id^="videoicon"],
.dock-contacts #contacts-table .contact-extension-td .btn:not(.hide),
.dock-contacts #contacts-table .contact-extension-td .btn-mini:not(.hide),
.dock-contacts #contacts-table .contact-extension-td [id^="videoicon"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.dock-contacts #recent-chat-table .contact-extension-td .btn-group,
.dock-contacts #contacts-table .contact-extension-td .btn-group {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    margin-left: 0 !important;
    vertical-align: middle !important;
}

.dock-contacts #recent-chat-table .contact-extension-td .btn.hide,
.dock-contacts #recent-chat-table .contact-extension-td .btn-mini.hide,
.dock-contacts #contacts-table .contact-extension-td .btn.hide,
.dock-contacts #contacts-table .contact-extension-td .btn-mini.hide {
    display: none !important;
}

.dock-contacts #recent-chat-table .contact-buttons > .dropdown-menu,
.dock-contacts #recent-chat-table .contact-buttons .btn-group > .dropdown-menu,
.dock-contacts #contacts-table .contact-buttons > .dropdown-menu,
.dock-contacts #contacts-table .contact-buttons .btn-group > .dropdown-menu {
    display: none !important;
    position: absolute !important;
    top: calc(100% + 0.25rem) !important;
    right: 0 !important;
    left: auto !important;
    margin-top: 0 !important;
}

.dock-contacts #recent-chat-table .contact-buttons.open > .dropdown-menu,
.dock-contacts #recent-chat-table .contact-buttons .btn-group.open > .dropdown-menu,
.dock-contacts #contacts-table .contact-buttons.open > .dropdown-menu,
.dock-contacts #contacts-table .contact-buttons .btn-group.open > .dropdown-menu {
    display: block !important;
}

.dock-contacts #recent-chat-table .contact-extension-td .btn > i,
.dock-contacts #recent-chat-table .contact-extension-td .btn > span,
.dock-contacts #recent-chat-table .contact-extension-td .btn-mini > i,
.dock-contacts #recent-chat-table .contact-extension-td .btn-mini > span,
.dock-contacts #contacts-table .contact-extension-td .btn > i,
.dock-contacts #contacts-table .contact-extension-td .btn > span,
.dock-contacts #contacts-table .contact-extension-td .btn-mini > i,
.dock-contacts #contacts-table .contact-extension-td .btn-mini > span {
    font-size: 0.625rem !important;
    line-height: 1 !important;
}

body.theme-light .dock-contacts div.contact-dock-gravatar.gravatar-img-contact {
    background: linear-gradient(145deg, #e0efff, #c6defe) !important;
    border: 1px solid rgba(12, 74, 110, 0.14) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65) !important;
}

body.theme-light .dock-contacts div.contact-dock-gravatar.gravatar-img-contact p {
    color: #12324a !important;
    font-weight: 700 !important;
}

body.theme-dark .dock-contacts .dock-popup,
body.theme-dark .dock-contacts .dock-body,
body.theme-dark .dock-contacts .dock-row-table,
body.theme-dark .dock-contacts .contact-row-table,
body.theme-dark .dock-contacts .dock-row-table td,
body.theme-dark .dock-contacts .contact-row-table td,
body.theme-dark .dock-contacts .nonecreated-contacts {
    background-color: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

body.theme-dark .dock-contacts .dock-popup {
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.35) !important;
}

body.theme-dark .dock-contacts div.contact-dock-gravatar.gravatar-img-contact {
    background: linear-gradient(145deg, #0d4f77, #194f8a) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

body.theme-dark .dock-contacts div.contact-dock-gravatar.gravatar-img-contact p {
    color: #f8fbff !important;
    font-weight: 700 !important;
    text-shadow: none !important;
}

body.theme-dark .dock-column.dock-contacts .dock-head-button,
body.theme-dark .dock-column.dock-contacts .dock-head-button i,
body.theme-dark .dock-column.dock-contacts .dock-head-button span,
body.theme-dark .dock-column.dock-contacts .dock-head-button::before,
body.theme-dark .dock-column.dock-contacts .dock-head-button::after {
    color: var(--text-primary) !important;
    border-color: transparent !important;
    text-shadow: none !important;
    filter: none !important;
    opacity: 1 !important;
    -webkit-text-fill-color: currentColor !important;
}

body.theme-dark .dock-column.dock-contacts .dock-head-button:hover,
body.theme-dark .dock-column.dock-contacts .dock-head-button:focus {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

body.theme-dark .dock-contacts .dock-head,
body.theme-dark .dock-contacts .dock-header,
body.theme-dark .dock-contacts #contact-groups,
body.theme-dark .dock-contacts #contact-groups.btn {
    background-color: var(--surface-secondary-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

body.theme-dark .dock-contacts .contact-row-table a,
body.theme-dark .dock-contacts .dock-row-table a,
body.theme-dark .dock-contacts .contact-name,
body.theme-dark .dock-contacts .contact-extension,
body.theme-dark .dock-contacts .nonecreated-contacts,
body.theme-dark .dock-contacts .nonecreated-conversations {
    color: var(--text-primary) !important;
}

body.theme-dark .dock-contacts .dock-contacts-header,
body.theme-dark .dock-contacts .dock-contacts-header.top,
body.theme-dark .dock-contacts .contacts-message,
body.theme-dark .dock-contacts .contacts-message2,
body.theme-dark .dock-contacts #contacts-sort-search,
body.theme-dark .dock-contacts #recents-header,
body.theme-dark .dock-contacts .groups-container,
body.theme-dark .dock-contacts .contacts-connection {
    background-color: var(--surface-secondary-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

body.theme-dark .dock-contacts .dock-contacts-header.top h5,
body.theme-dark .dock-contacts #contacts-sort-search .dropdown-label,
body.theme-dark .dock-contacts #contacts-sort-search .dropdown-toggle > a,
body.theme-dark .dock-contacts #recents-header span {
    color: var(--text-primary) !important;
}

body.theme-dark .dock-contacts #message,
body.theme-dark .dock-contacts #contacts-searchbox-input,
body.theme-dark .dock-contacts input[id^="device-text-dock-"] {
    background-color: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: none !important;
}

body.theme-dark .dock-contacts #message::placeholder,
body.theme-dark .dock-contacts #contacts-searchbox-input::placeholder,
body.theme-dark .dock-contacts input[id^="device-text-dock-"]::placeholder {
    color: var(--text-muted) !important;
}

body.theme-dark .dock-contacts #contacts-sort-search .contacts-sort-dropdown > .dropdown-toggle,
body.theme-dark .dock-contacts #contacts-sort-search .contacts-sort-dropdown > .dropdown-toggle > a.dropdown-toggle,
body.theme-dark .dock-contacts #contacts-sort-search #sortby,
body.theme-dark .dock-contacts .contacts-searchbox-icon,
body.theme-dark .dock-contacts .contacts-current-sortby-dock {
    background-color: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

body.theme-dark .dock-contacts #contacts-sort-search .caret {
    border-top-color: var(--text-primary) !important;
    border-bottom-color: var(--text-primary) !important;
}

body.theme-dark .dock-contacts .contacts-current-sortby-dock .nsicon-sort,
body.theme-dark .dock-contacts .contacts-searchbox-icon .iconfont,
body.theme-dark .dock-contacts .contacts-message2-quotes,
body.theme-dark .dock-contacts .contacts-message2-pencil,
body.theme-dark .dock-contacts .contact-status-msg,
body.theme-dark .dock-contacts .contact-recent-msg {
    color: var(--text-muted) !important;
}

body.theme-dark .dock-contacts .contacts-message2-text {
    color: #a2a2a2 !important;
}

body.theme-dark .dock-contacts #group-dropdown,
body.theme-dark .dock-contacts #group-dropdown .dropdown-menu,
body.theme-dark .dock-contacts .contacts-sortby-toggle,
body.theme-dark .dock-contacts .dropdown-menu-phone-select,
body.theme-dark .dock-contacts .btn-group > .dropdown-menu {
    background-color: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.25) !important;
}

body.theme-dark .dock-contacts #group-dropdown li > a,
body.theme-dark .dock-contacts #group-dropdown .dropdown-menu li > a,
body.theme-dark .dock-contacts .contacts-sortby-toggle li > a,
body.theme-dark .dock-contacts .dropdown-menu-phone-select li > a,
body.theme-dark .dock-contacts .btn-group > .dropdown-menu li > a,
body.theme-dark .dock-contacts .btn-group > .dropdown-menu .dropdown-icon-text,
body.theme-dark .dock-contacts .dropdown-menu-phone-option {
    color: var(--text-primary) !important;
}

body.theme-dark .dock-contacts #group-dropdown li > a:hover,
body.theme-dark .dock-contacts #group-dropdown li > a:focus,
body.theme-dark .dock-contacts #group-dropdown .dropdown-menu li > a:hover,
body.theme-dark .dock-contacts #group-dropdown .dropdown-menu li > a:focus,
body.theme-dark .dock-contacts .contacts-sortby-toggle li > a:hover,
body.theme-dark .dock-contacts .contacts-sortby-toggle li > a:focus,
body.theme-dark .dock-contacts .dropdown-menu-phone-select li > a:hover,
body.theme-dark .dock-contacts .dropdown-menu-phone-select li > a:focus,
body.theme-dark .dock-contacts .btn-group > .dropdown-menu li > a:hover,
body.theme-dark .dock-contacts .btn-group > .dropdown-menu li > a:focus {
    background-color: var(--surface-secondary-bg) !important;
    color: var(--text-primary) !important;
}

body.theme-dark .dock-contacts #group-dropdown .divider,
body.theme-dark .dock-contacts .contacts-sortby-toggle .divider,
body.theme-dark .dock-contacts .dropdown-menu-phone-select .divider,
body.theme-dark .dock-contacts .btn-group > .dropdown-menu .divider {
    background-color: transparent !important;
    border-top-color: var(--border-color) !important;
}

body.theme-dark .dock-contacts #group-dropdown .dropdown-submenu > a:after {
    border-left-color: var(--text-muted) !important;
}

body.theme-dark .dock-contacts #group-dropdown .dropdown-submenu:hover > a:after,
body.theme-dark .dock-contacts #group-dropdown .dropdown-submenu:focus > a:after {
    border-left-color: var(--text-primary) !important;
}

body.theme-dark .dock-contacts .dock-contacts-header .btn,
body.theme-dark .dock-contacts .dock-contacts-header .btn-mini,
body.theme-dark .dock-contacts #new-msg,
body.theme-dark .dock-contacts #make-call,
body.theme-dark .dock-contacts .contacts-btn-toggle,
body.theme-dark .dock-contacts .recent-btn-toggle,
body.theme-dark .dock-contacts .transfermode,
body.theme-dark .dock-contacts .chat-btn,
body.theme-dark .dock-contacts .sms-btn,
body.theme-dark .dock-contacts .call-btn,
body.theme-dark .dock-contacts [id^="videoicon"] {
    background-color: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    background-image: none !important;
    filter: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

body.theme-dark .dock-contacts .contacts-btn-toggle.active,
body.theme-dark .dock-contacts .recent-btn-toggle.active {
    background-color: rgba(var(--accent-primary-rgb), 0.85) !important;
    border-color: rgba(var(--accent-primary-rgb), 0.95) !important;
    color: #ffffff !important;
}

body.theme-dark .dock-contacts .groups-container .btn-group-toggle {
    display: flex !important;
    gap: 0.25rem !important;
    width: 100% !important;
}

body.theme-dark .dock-contacts .groups-container .btn-group-toggle > .btn {
    flex: 1 1 0 !important;
    background: var(--surface-primary-bg) !important;
    background-image: none !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border-color) !important;
    filter: none !important;
    opacity: 1 !important;
    -webkit-text-fill-color: currentColor !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

body.theme-dark .dock-contacts .groups-container .btn-group-toggle > .btn:hover,
body.theme-dark .dock-contacts .groups-container .btn-group-toggle > .btn:focus {
    background: var(--surface-secondary-bg) !important;
    background-image: none !important;
    color: var(--text-primary) !important;
    filter: none !important;
    opacity: 1 !important;
    -webkit-text-fill-color: currentColor !important;
}

body.theme-dark .dock-contacts .groups-container .btn-group-toggle > .btn.active,
body.theme-dark .dock-contacts .groups-container .btn-group-toggle > .btn.active:hover,
body.theme-dark .dock-contacts .groups-container .btn-group-toggle > .btn.active:focus {
    background: rgba(var(--accent-primary-rgb), 0.85) !important;
    background-image: none !important;
    border-color: rgba(var(--accent-primary-rgb), 0.95) !important;
    color: #ffffff !important;
    filter: none !important;
    opacity: 1 !important;
    -webkit-text-fill-color: currentColor !important;
}

body.theme-dark .dock-contacts .dock-contacts-header.top #videoicon > span,
body.theme-dark .dock-contacts .dock-contacts-header.top #new-msg > i,
body.theme-dark .dock-contacts .dock-contacts-header.top #make-call > i {
    filter: brightness(0) invert(1) !important;
    opacity: 1 !important;
}

body.theme-dark .dock-contacts #recent-chat-table .contact-extension-td .btn,
body.theme-dark .dock-contacts #recent-chat-table .contact-extension-td .btn-mini,
body.theme-dark .dock-contacts #recent-chat-table .contact-extension-td [id^="videoicon"],
body.theme-dark .dock-contacts #contacts-table .contact-extension-td .btn,
body.theme-dark .dock-contacts #contacts-table .contact-extension-td .btn-mini,
body.theme-dark .dock-contacts #contacts-table .contact-extension-td [id^="videoicon"] {
    background-color: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Contacts dock follow-up:
   - center the header action icons inside their mini buttons
   - keep the sort/search row on a stable single line
   - force placeholder gravatars into a true circle instead of an oval */
body .dock-contacts .dock-contacts-header.top #videoicon,
body .dock-contacts .dock-contacts-header.top #new-msg,
body .dock-contacts .dock-contacts-header.top #make-call {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 1.95rem !important;
    min-width: 1.95rem !important;
    height: 1.55rem !important;
    min-height: 1.55rem !important;
    padding: 0 !important;
    line-height: 1 !important;
}

body .dock-contacts .dock-contacts-header.top #videoicon > span,
body .dock-contacts .dock-contacts-header.top #new-msg > i,
body .dock-contacts .dock-contacts-header.top #make-call > i {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 0.9rem !important;
    height: 0.9rem !important;
    margin: 0 !important;
    line-height: 1 !important;
    position: static !important;
}

body .dock-contacts #contacts-sort-search {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    padding: 0.3rem 0.2rem 0.15rem !important;
}

body .dock-contacts #contacts-sort-search .contacts-sort-dropdown {
    display: flex !important;
    align-items: center !important;
    gap: 0.35rem !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

body .dock-contacts #contacts-sort-search .contacts-sort-dropdown > div[style*="table-cell"] {
    display: block !important;
    width: auto !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

body .dock-contacts #contacts-sort-search .contacts-sort-dropdown > .dropdown-toggle,
body .dock-contacts #contacts-sort-search .contacts-sort-dropdown > .dropdown-toggle > a.dropdown-toggle {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 1.4rem !important;
}

body .dock-contacts #contacts-sort-search #sortby {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 1.85rem !important;
    min-width: 1.85rem !important;
    height: 1.85rem !important;
    min-height: 1.85rem !important;
    margin: 0 !important;
}

body .dock-contacts .contacts-current-sortby-dock .nsicon-sort {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.95rem !important;
    line-height: 1 !important;
    margin: 0 !important;
}

body .dock-contacts #searchbox {
    position: relative !important;
    display: block !important;
    flex: 0 0 15.5625rem !important;
    width: 15.5625rem !important;
    min-width: 15.5625rem !important;
    height: 1.9rem !important;
    min-height: 1.9rem !important;
    margin: 0 0 0 auto !important;
}

body .dock-contacts #searchbox > .searchbox-input {
    top: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    padding-right: 2.25rem !important;
}

body .dock-contacts .contacts-searchbox-icon {
    top: 0 !important;
    right: 0 !important;
    width: 2.25rem !important;
    height: 100% !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body .dock-contacts .contacts-searchbox-icon .iconfont-search {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    margin: 0 !important;
}

body .dock-contacts div.contact-dock-gravatar.gravatar-img-contact {
    width: 2.2rem !important;
    height: 2.2rem !important;
    border-radius: 50% !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body .dock-contacts div.contact-dock-gravatar.gravatar-img-contact img {
    width: 100% !important;
    height: 100% !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: block !important;
}

body .dock-contacts div.contact-dock-gravatar.gravatar-img-contact > p {
    margin: 0 !important;
    line-height: 1 !important;
}

body.theme-dark .dock-contacts #recent-chat-table .contact-extension-td .btn > i,
body.theme-dark .dock-contacts #recent-chat-table .contact-extension-td .btn > span,
body.theme-dark .dock-contacts #recent-chat-table .contact-extension-td .btn-mini > i,
body.theme-dark .dock-contacts #recent-chat-table .contact-extension-td .btn-mini > span,
body.theme-dark .dock-contacts #recent-chat-table .contact-extension-td .btn .nsicon,
body.theme-dark .dock-contacts #recent-chat-table .contact-extension-td .btn-mini .nsicon,
body.theme-dark .dock-contacts #contacts-table .contact-extension-td .btn > i,
body.theme-dark .dock-contacts #contacts-table .contact-extension-td .btn > span,
body.theme-dark .dock-contacts #contacts-table .contact-extension-td .btn-mini > i,
body.theme-dark .dock-contacts #contacts-table .contact-extension-td .btn-mini > span,
body.theme-dark .dock-contacts #contacts-table .contact-extension-td .btn .nsicon,
body.theme-dark .dock-contacts #contacts-table .contact-extension-td .btn-mini .nsicon {
    color: inherit !important;
    opacity: 1 !important;
    text-shadow: none !important;
    filter: brightness(0) invert(1) !important;
}

body.theme-dark .dock-contacts #recent-chat-table .contact-row:hover .contact-buttons .btn:hover,
body.theme-dark .dock-contacts #recent-chat-table .contact-row:hover .contact-buttons .btn:focus,
body.theme-dark .dock-contacts #contacts-table .contact-row:hover .contact-buttons .btn:hover,
body.theme-dark .dock-contacts #contacts-table .contact-row:hover .contact-buttons .btn:focus {
    background-color: var(--surface-secondary-bg) !important;
    background-image: none !important;
    color: var(--text-primary) !important;
}

body.theme-dark .dock-contacts #recent-chat-table .contact-extension-td .btn:hover,
body.theme-dark .dock-contacts #recent-chat-table .contact-extension-td .btn:focus,
body.theme-dark .dock-contacts #recent-chat-table .contact-extension-td .btn-mini:hover,
body.theme-dark .dock-contacts #recent-chat-table .contact-extension-td .btn-mini:focus,
body.theme-dark .dock-contacts #contacts-table .contact-extension-td .btn:hover,
body.theme-dark .dock-contacts #contacts-table .contact-extension-td .btn:focus,
body.theme-dark .dock-contacts #contacts-table .contact-extension-td .btn-mini:hover,
body.theme-dark .dock-contacts #contacts-table .contact-extension-td .btn-mini:focus {
    background-color: rgba(var(--accent-primary-rgb), 0.18) !important;
    border-color: rgba(var(--accent-primary-rgb), 0.45) !important;
}

body.theme-light .dock-column.dock-contacts .scroll-container,
body.theme-dark .dock-column.dock-contacts .scroll-container {
    overflow-x: hidden !important;
    padding-right: 0 !important;
}
/* Dock/chat scrollbar colors now defer to the final tokenized scrollbar block
   near the end of the file. Keep only behavior-oriented overflow adjustments
   here so dock surfaces do not drift from the shared scrollbar language. */

body.theme-dark .dock-column.uc-message-box-column .dock-popup,
body.theme-dark #conversation-new .dock-popup {
    background-color: var(--surface-primary-bg) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.35) !important;
}

body.theme-dark .dock-column.uc-message-box-column .dock-head,
body.theme-dark #conversation-new .dock-head,
body.theme-dark .dock-column.uc-message-box-column .dock-submenu,
body.theme-dark #conversation-new .dock-submenu,
body.theme-dark .dock-column.uc-message-box-column .uc-chat-message-box,
body.theme-dark #conversation-new .uc-chat-message-box,
body.theme-dark .dock-column.uc-message-box-column .sms-chat-footer,
body.theme-dark #conversation-new .sms-chat-footer,
body.theme-dark .dock-column.uc-message-box-column .flex-container-participants,
body.theme-dark #conversation-new .flex-container-participants {
    background-color: var(--surface-secondary-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

body.theme-dark .dock-column.uc-message-box-column .dock-head,
body.theme-dark #conversation-new .dock-head,
body.theme-dark .dock-column.uc-message-box-column .dock-submenu,
body.theme-dark #conversation-new .dock-submenu {
    border-bottom: 1px solid var(--border-color) !important;
}

body.theme-dark .dock-column.uc-message-box-column .dock-head-title,
body.theme-dark .dock-column.uc-message-box-column .dock-head-title span,
body.theme-dark .dock-column.uc-message-box-column .dock-head-title i,
body.theme-dark .dock-column.uc-message-box-column .dock-name,
body.theme-dark #conversation-new .dock-head-title,
body.theme-dark #conversation-new .dock-head-title span,
body.theme-dark #conversation-new .dock-head-title i,
body.theme-dark #conversation-new .dock-name {
    color: var(--text-primary) !important;
}

body.theme-dark .dock-column.uc-message-box-column .dock-head-button,
body.theme-dark .dock-column.uc-message-box-column .dock-head-button i,
body.theme-dark .dock-column.uc-message-box-column .dock-head-button span,
body.theme-dark .dock-column.uc-message-box-column .dock-submenu-button,
body.theme-dark .dock-column.uc-message-box-column .dock-submenu-button i,
body.theme-dark .dock-column.uc-message-box-column .dock-submenu-button span,
body.theme-dark #conversation-new .dock-head-button,
body.theme-dark #conversation-new .dock-head-button i,
body.theme-dark #conversation-new .dock-head-button span,
body.theme-dark #conversation-new .dock-submenu-button,
body.theme-dark #conversation-new .dock-submenu-button i,
body.theme-dark #conversation-new .dock-submenu-button span {
    -webkit-text-fill-color: currentColor !important;
    filter: none !important;
}

body.theme-dark .dock-column.uc-message-box-column .dock-body,
body.theme-dark #conversation-new .dock-body,
body.theme-dark .dock-column.uc-message-box-column .ns-chat,
body.theme-dark #conversation-new .ns-chat,
body.theme-dark .dock-column.uc-message-box-column .chat-box,
body.theme-dark #conversation-new .chat-box,
body.theme-dark .dock-column.uc-message-box-column .chat-messages-container,
body.theme-dark #conversation-new .chat-messages-container,
body.theme-dark .dock-column.uc-message-box-column .chat-messages,
body.theme-dark #conversation-new .chat-messages {
    background-color: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
}

body.theme-dark .dock-column.uc-message-box-column .chat-box,
body.theme-dark #conversation-new .chat-box {
    border-bottom: 1px solid var(--border-color) !important;
}

body.theme-dark .dock-column.uc-message-box-column .chat-row,
body.theme-dark .dock-column.uc-message-box-column .chat-message-row,
body.theme-dark #conversation-new .chat-row,
body.theme-dark #conversation-new .chat-message-row {
    background: transparent !important;
}

body.theme-dark .dock-column.uc-message-box-column .dock-head-button,
body.theme-dark .dock-column.uc-message-box-column .dock-submenu-button,
body.theme-dark #conversation-new .dock-head-button,
body.theme-dark #conversation-new .dock-submenu-button {
    color: var(--text-secondary) !important;
    border-radius: 0.25rem !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

body.theme-dark .dock-column.uc-message-box-column .dock-head-button:hover,
body.theme-dark .dock-column.uc-message-box-column .dock-head-button:focus,
body.theme-dark .dock-column.uc-message-box-column .dock-submenu-button:hover,
body.theme-dark .dock-column.uc-message-box-column .dock-submenu-button:focus,
body.theme-dark #conversation-new .dock-head-button:hover,
body.theme-dark #conversation-new .dock-head-button:focus,
body.theme-dark #conversation-new .dock-submenu-button:hover,
body.theme-dark #conversation-new .dock-submenu-button:focus {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: var(--text-primary) !important;
}

body.theme-dark .dock-column.uc-message-box-column .dock-head-button i,
body.theme-dark .dock-column.uc-message-box-column .dock-head-button span,
body.theme-dark .dock-column.uc-message-box-column .dock-submenu-button i,
body.theme-dark .dock-column.uc-message-box-column .dock-submenu-button span,
body.theme-dark .dock-column.uc-message-box-column .dock-submenu-button a,
body.theme-dark .dock-column.uc-message-box-column .dock-submenu-button a i,
body.theme-dark .dock-column.uc-message-box-column .dock-submenu-button a span,
body.theme-dark #conversation-new .dock-head-button i,
body.theme-dark #conversation-new .dock-head-button span,
body.theme-dark #conversation-new .dock-submenu-button i,
body.theme-dark #conversation-new .dock-submenu-button span,
body.theme-dark #conversation-new .dock-submenu-button a,
body.theme-dark #conversation-new .dock-submenu-button a i,
body.theme-dark #conversation-new .dock-submenu-button a span {
    color: inherit !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

body.theme-dark .dock-column.uc-message-box-column .dropdown-menu,
body.theme-dark .dock-column.uc-message-box-column .name-change-bubble,
body.theme-dark #conversation-new .dropdown-menu,
body.theme-dark #conversation-new .name-change-bubble {
    background-color: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.25) !important;
}

body.theme-dark .dock-column.uc-message-box-column .dropdown-menu li > a,
body.theme-dark .dock-column.uc-message-box-column .dropdown-menu .dropdown-icon-text,
body.theme-dark #conversation-new .dropdown-menu li > a,
body.theme-dark #conversation-new .dropdown-menu .dropdown-icon-text {
    color: var(--text-primary) !important;
}

body.theme-dark .dock-column.uc-message-box-column .dropdown-menu li > a:hover,
body.theme-dark .dock-column.uc-message-box-column .dropdown-menu li > a:focus,
body.theme-dark #conversation-new .dropdown-menu li > a:hover,
body.theme-dark #conversation-new .dropdown-menu li > a:focus {
    background-color: var(--surface-secondary-bg) !important;
    color: var(--text-primary) !important;
}

body.theme-dark .dock-column.uc-message-box-column .message-to-send,
body.theme-dark .dock-column.uc-message-box-column textarea.message-to-send,
body.theme-dark .dock-column.uc-message-box-column .namechange-input,
body.theme-dark .dock-column.uc-message-box-column .selectivity-multiple-input,
body.theme-dark .dock-column.uc-message-box-column .selectivity-multiple-input-container,
body.theme-dark #conversation-new .message-to-send,
body.theme-dark #conversation-new textarea.message-to-send,
body.theme-dark #conversation-new .namechange-input,
body.theme-dark #conversation-new .selectivity-multiple-input,
body.theme-dark #conversation-new .selectivity-multiple-input-container {
    background-color: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    box-shadow: none !important;
}

body.theme-dark .dock-column.uc-message-box-column .message-to-send::placeholder,
body.theme-dark .dock-column.uc-message-box-column .namechange-input::placeholder,
body.theme-dark .dock-column.uc-message-box-column .selectivity-multiple-input::placeholder,
body.theme-dark #conversation-new .message-to-send::placeholder,
body.theme-dark #conversation-new .namechange-input::placeholder,
body.theme-dark #conversation-new .selectivity-multiple-input::placeholder {
    color: var(--text-muted) !important;
}

body.theme-dark .dock-column.uc-message-box-column .chat-inbound .chat-well,
body.theme-dark #conversation-new .chat-inbound .chat-well {
    background-color: var(--surface-secondary-bg) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: none !important;
}

body.theme-dark .dock-column.uc-message-box-column .chat-outbound .chat-well,
body.theme-dark .dock-column.uc-message-box-column .chat-outbound .chat-message-green,
body.theme-dark .dock-column.uc-message-box-column .chat-outbound .chat-type-sms,
body.theme-dark .dock-column.uc-message-box-column .chat-outbound .chat-type-mms,
body.theme-dark #conversation-new .chat-outbound .chat-well,
body.theme-dark #conversation-new .chat-outbound .chat-message-green,
body.theme-dark #conversation-new .chat-outbound .chat-type-sms,
body.theme-dark #conversation-new .chat-outbound .chat-type-mms {
    background-color: rgba(var(--accent-primary-rgb), 0.88) !important;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.55) !important;
}

body.theme-dark .dock-column.uc-message-box-column .chat-inbound .chat-message,
body.theme-dark .dock-column.uc-message-box-column .chat-inbound .chat-well p,
body.theme-dark #conversation-new .chat-inbound .chat-message,
body.theme-dark #conversation-new .chat-inbound .chat-well p {
    color: var(--text-primary) !important;
}

body.theme-dark .dock-column.uc-message-box-column .chat-outbound .chat-message,
body.theme-dark .dock-column.uc-message-box-column .chat-outbound .chat-well p,
body.theme-dark #conversation-new .chat-outbound .chat-message,
body.theme-dark #conversation-new .chat-outbound .chat-well p {
    color: #ffffff !important;
}

body.theme-dark .dock-column.uc-message-box-column .uc-chat-user h3,
body.theme-dark .dock-column.uc-message-box-column .chat-timestamp,
body.theme-dark .dock-column.uc-message-box-column .pending-message-note,
body.theme-dark .dock-column.uc-message-box-column .name-change-message,
body.theme-dark .dock-column.uc-message-box-column .chat-participant-uid-td,
body.theme-dark #conversation-new .uc-chat-user h3,
body.theme-dark #conversation-new .chat-timestamp,
body.theme-dark #conversation-new .pending-message-note,
body.theme-dark #conversation-new .name-change-message,
body.theme-dark #conversation-new .chat-participant-uid-td {
    color: var(--text-muted) !important;
}

body.theme-dark .dock-column.uc-message-box-column .chat-file-upload-stats,
body.theme-dark #conversation-new .chat-file-upload-stats {
    border-top-color: var(--border-color) !important;
    color: var(--text-muted) !important;
}

body.theme-dark .dock-column.uc-message-box-column .dock-chat-footer-alert,
body.theme-dark #conversation-new .dock-chat-footer-alert {
    background-color: rgba(var(--accent-primary-rgb), 0.15) !important;
    border: 1px solid rgba(var(--accent-primary-rgb), 0.35) !important;
    color: var(--text-primary) !important;
}

body.theme-dark .dock-column.uc-message-box-column .smsnumberbar,
body.theme-dark .dock-column.uc-message-box-column .drop-target-message,
body.theme-dark #conversation-new .smsnumberbar,
body.theme-dark #conversation-new .drop-target-message {
    color: var(--text-muted) !important;
}

body.theme-dark .dock-column.uc-message-box-column .smsnumberbar .smsnumber,
body.theme-dark .dock-column.uc-message-box-column .bluetext,
body.theme-dark #conversation-new .smsnumberbar .smsnumber,
body.theme-dark #conversation-new .bluetext {
    color: var(--accent-primary) !important;
}

body.theme-dark .dock-column.uc-message-box-column .smsnumberbar .caret,
body.theme-dark #conversation-new .smsnumberbar .caret {
    border-bottom-color: var(--accent-primary) !important;
}

body.theme-dark .dock-contacts .device-select,
body.theme-dark .dock-contacts .device-select-dock,
body.theme-dark .dock-contacts .dropdown-menu-phone-select {
    background-color: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
    -webkit-text-fill-color: var(--text-primary) !important;
}

body.theme-dark .dock-contacts .device-select option,
body.theme-dark .dock-contacts .device-select-dock option {
    background-color: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
}

body.theme-dark .dock-contacts .dropdown-menu-phone-option small,
body.theme-dark .dock-contacts .muted.table-smaller {
    color: var(--text-secondary) !important;
}

body.theme-dark .dock-contacts .click2callphonedefault {
    accent-color: var(--accent-primary) !important;
}

body.theme-dark .dock-contacts #changePhones {
    color: var(--accent-primary) !important;
}

body.theme-dark .dock-contacts .contacts-connection .close {
    color: var(--text-primary) !important;
    opacity: 0.8 !important;
    text-shadow: none !important;
}
.bootstrap-switch-container {
    /* border: 3px red; */
    background-color: white !important;
}
span.bootstrap-switch-handle-off.bootstrap-switch-default {
    color: red !important;
    font-weight: 600;
}


span#nav-msg-count {
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem .45rem !important;
    top: unset !important;
    right: 10px !important;
}

/* .theme-dark button.close.cancel {
    filter: invert(1) brightness(1) !important;
} */

.form-horizontal .control-label {
    width: unset;
}


.theme-dark .checkmark
 {
   filter: invert(1) brightness(1) !important;
}

.theme-dark i.icon-info-sign {
    filter: invert(1) brightness(1) !important;
}

#grid4-app-shell.theme-dark .icon-calendar {
  filter: invert(1) brightness(2.5) contrast(1.5) !important;
}

h3.popover-title {
    color: var(--text-primary) !important;
}

.popover-title, .popover-content
 {
    background-color: var(--surface-primary-bg) !important;
}

a.btn.btn-medium.btn-danger
{

  color: var(--text-primary) !important;
}

#user-edit > div.form-actions.affix-form-actions.scroll-to-fixed-fixed > div > div.popover-content.text-center > div > a:nth-child(2)
{
color: var(--text-primary) !important;
text-shadow: none !important;
}

#grid4-app-shell input.btn.color-primary.span2.saving.saveBtn,
#grid4-app-shell .btn.color-primary.saving.span2.saveBtn,
html:not([data-grid4-skin="off"]) body .modal input.btn.color-primary.span2.saving.saveBtn,
html:not([data-grid4-skin="off"]) body .modal .btn.color-primary.saving.span2.saveBtn {
    width: auto !important;
    min-width: 7rem !important;
    min-height: 1.95rem !important;
    height: auto !important;
    line-height: 1.25 !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    text-align: center !important;
}
#grid4-app-shell a.label {
    /*background-color: darkviolet !important; */
    color: white !important;
    padding: .2rem;
}

#grid4-app-shell .action-container-left.uiconfig-defs
 {
    float: left !important;
}


/* Fixing icons in the Contacts/Chat Dock */
i.icon-white.icon-minimize {
    filter: unset !important;
}

.icon-share-alt {
    filter: unset !important;
    background-position: -336px -96px;
}

#new-msg > i {
    filter: unset !important;
}

#make-call > i {
    filter: unset !important;
}

/* Fixing the sub nav vm badge text on the Messages page*/
#sub-nav-vm-count {
    color: white !important;
}

#grid4-app-shell.theme-light span#nav-msg-count {
    color: white !important;
}

#grid4-app-shell.theme-dark span#nav-msg-count {
    color: white !important;
}



/* Dropdown items: white text on hover/active */
#grid4-app-shell .dropdown-menu > li > a:hover,
#grid4-app-shell .dropdown-menu > li > a:focus,
#grid4-app-shell .dropdown-menu > li:hover > a,
#grid4-app-shell .dropdown-menu > .active > a {
  color: #fff !important;
}

/* Icons inside dropdown items follow the text color */
#grid4-app-shell .dropdown-menu > li > a .fa,
#grid4-app-shell .dropdown-menu > li > a .iconfont,
#grid4-app-shell .dropdown-menu > li > a [class^="icon-"],
#grid4-app-shell .dropdown-menu > li > a [class*=" icon-"] {
  color: inherit !important;
  filter: none !important; /* beats inline filters from JS, only inside menus */
}


#grid4-app-shell form .control-group.group {
    margin-bottom: .9rem !important;
    margin-top: .5rem !important;
}


/* SIP Trunks › Edit › Header Manipulation — responsive row, no h‑scroll */
#grid4-app-shell .modal #siptrunk-edit-header .control-group .controls {
  overflow-x: hidden; /* safety against tiny rounding overflows */
}

#grid4-app-shell .modal #siptrunk-edit-header .input-prepend.input-append {
  display: flex !important;
  align-items: stretch !important;
  width: 100% !important;
  max-width: 100% !important;
  gap: 0 !important; /* we join the pieces; borders define seams */
}

/* Left box (user) */
#grid4-app-shell .modal #siptrunk-edit-header .split-input-left {
  flex: 0 0 24%;          /* percentage so it scales with modal */
  min-width: 100px;       /* never too tiny */
  margin: 0 !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

/* Middle “@” chip */
#grid4-app-shell .modal #siptrunk-edit-header .input-prepend.input-append > .add-on {
  flex: 0 0 42px;         /* fixed, compact chip */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 32px !important;
  line-height: 32px !important;
  border-left: 0 !important;
  border-right: 0 !important;
}

/* Right box (host) — grows to fill remaining width */
#grid4-app-shell .modal #siptrunk-edit-header .split-input-right {
  flex: 1 1 0 !important;
  min-width: 0 !important;   /* allow shrinking inside flex container */
  width: auto !important;
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

/* Uneditable “Server's IP” variant */
#grid4-app-shell .modal #siptrunk-edit-header .uneditable-input.split-input-right {
  display: flex !important;
  align-items: center !important;
  height: 32px !important;
  line-height: 32px !important;
  padding: 0 10px !important;
}

/* Optional: tiny screens/dev tools narrow widths */
@media (max-width: 640px) {
  #grid4-app-shell .modal #siptrunk-edit-header .split-input-left { flex-basis: 35%; min-width: 90px; }
  #grid4-app-shell .modal #siptrunk-edit-header .input-prepend.input-append > .add-on { flex-basis: 36px; }
}


/* AUTO ATTENDANTS (edit) — side-by-side Prompt | Dial Pad */
body.page-autoattendants #grid4-app-shell .attendant-creation {
  overflow-x: hidden; /* safety */
}

/* Header labels: "Menu Prompt" (left) | "Dial Pad Menu" (right) */
body.page-autoattendants #grid4-app-shell
  .attendant-creation .attendant-header.form-actions {
  display: flex !important;
  justify-content: space-between !important;
  align-items: left !important;
  background: transparent !important;
  border: 0 !important;
  padding: 4px 0 !important;
  padding-bottom: 0.5rem !important;
}
body.page-autoattendants #grid4-app-shell .attendant-creation .attendant-header.form-actions .pull-left,
body.page-autoattendants #grid4-app-shell
  .attendant-creation .attendant-header.form-actions .pull-right {
  float: none !important; /* kill legacy float */
  padding-bottom: 0.5rem !important;
}

/* Main row container: id starts with attendant_tier_ */
body.page-autoattendants #grid4-app-shell .attendant-creation [id^="attendant_tier_"].attendant-tier-options {
  display: flex;
  align-items: flex-start !important;
  gap: 8px !important;
  width: 100% !important;
  max-width: 90% !important;
  padding: 0.2rem !important;
}

body.page-autoattendants #grid4-app-shell .attendant-creation [id^="attendant_tier_"].attendant-tier-options.grid4-aa-visible {
  display: flex !important;
}

body.page-autoattendants #grid4-app-shell .attendant-creation [id^="attendant_tier_"].attendant-tier-options.grid4-aa-hidden,
body.page-autoattendants #grid4-app-shell .attendant-creation [id^="attendant_tier_"].attendant-tier-options.hide,
body.page-autoattendants #grid4-app-shell .attendant-creation [id^="attendant_tier_"].attendant-tier-options[style*="display: none"],
body.page-autoattendants #grid4-app-shell .attendant-creation [id^="attendant_tier_"].attendant-tier-options[style*="display:none"] {
  display: none !important;
}

body.page-autoattendants #grid4-app-shell [id^="aatierdata"].grid4-aa-visible,
body.page-autoattendants #grid4-app-shell [id^="aatierdata"]:not(.grid4-aa-hidden):not(.hide) {
  display: block !important;
}

body.page-autoattendants #grid4-app-shell [id^="aatierdata"].grid4-aa-hidden,
body.page-autoattendants #grid4-app-shell [id^="aatierdata"].hide,
body.page-autoattendants #grid4-app-shell [id^="aatierdata"][style*="display: none"],
body.page-autoattendants #grid4-app-shell [id^="aatierdata"][style*="display:none"] {
  display: none !important;
}

/* Left column = prompt/media area */
body.page-autoattendants #grid4-app-shell
  .attendant-creation [id^="attendant_tier_"].attendant-tier-options > .pull-left {
  float: none !important;
  order: 1 !important;
  flex: 1 1 420px !important;   /* grows/shrinks with modal */
  min-width: 260px !important;  /* don’t crush controls */
}

/* Right column = dial pad */
body.page-autoattendants #grid4-app-shell
  .attendant-creation [id^="attendant_tier_"].attendant-tier-options > .dialpad.pull-right {
  float: none !important;
  order: 2 !important;
  flex: 0 0 auto !important;
  margin-left: auto !important; /* pin to right edge */
  display: inline-block !important;
  max-width: 100% !important;
}

/* Small widths: allow wrapping so nothing overflows */
@media (max-width: 1024px) {
  body.page-autoattendants #grid4-app-shell
    .attendant-creation [id^="attendant_tier_"].attendant-tier-options {
    flex-wrap: wrap !important;
    row-gap: 2rem !important;
  }
  body.page-autoattendants #grid4-app-shell
    .attendant-creation [id^="attendant_tier_"].attendant-tier-options > .dialpad.pull-right {
    margin-left: 0 !important;
    width: 100% !important; /* dial pad drops below on narrow */
  }
}

#grid4-app-shell button#trace-share-btn, button#trace-export-btn {
    margin-bottom: unset !important;
}

/* 1) SIP Flow header sticks to the top (fixes misaligned header on long calls) */
body.page-callhistory #grid4-app-shell .flow-header {
  position: sticky !important;
  top: 0 !important; /* beat inline top values */
  z-index: 5 !important;
}

/* 2) Dark mode: white ladder lines and markers, without touching text */
body.page-callhistory #grid4-app-shell.theme-dark
  .flow-fullscreen-container svg path,
body.page-callhistory #grid4-app-shell.theme-dark
  .flow-fullscreen-container svg circle {
  stroke: #fff !important;
}

/* Only flip dark fills used for shapes (not text) to white */
body.page-callhistory #grid4-app-shell.theme-dark
  .flow-fullscreen-container svg path[fill="#1A1A1A"],
body.page-callhistory #grid4-app-shell.theme-dark
  .flow-fullscreen-container svg rect[fill="#1A1A1A"] {
  fill: #fff !important;
}

/* 3) Keep message-bubble text dark on the white pills */
body.page-callhistory #grid4-app-shell.theme-dark
  .flow-fullscreen-container g[data-msg] text {
  fill: #111 !important; /* or #000 if you prefer */
  font-weight: 600;
}

/* 4) Left-side time scale numbers should be white in dark mode */
body.page-callhistory #grid4-app-shell.theme-dark
  .flow-time text {
  fill: #fff !important;
  opacity: 0.9;
}

body.page-callhistory #grid4-app-shell .svelte-1v18tvj {
     background-color: var(--accent-primary)  !important;
}

span.flow-filter.svelte-6anihf {
    color: white !important;
}

span.sl-sipmethod {
    color: white !important;
}

#grid4-app-shell i.nsicon.nsicon-reply {
    color: white !important;
}

div.flow-time.svelte-tppiux>svg.svelte-tppiux>text.selected.svelte-tppiux.svelte-tppiux {
    fill: white !important;
}


/* ===================================================================
   SECTION: CALENDAR/TIME PICKER ADD-ON FIX (Global)
   - Restore inline icon cell for .input-prepend/.input-append add-ons.
   - Fixes calendar/time icons showing as tall blocks under inputs.
   - Theme-aware background/border; works in light and dark modes.
   - Does not affect SIP Trunk “Header Manipulation” which has a
     more specific rule that still uses flex for its "@" chip.
   =================================================================== */

#grid4-app-shell .input-append > .add-on,
#grid4-app-shell .input-prepend > .add-on {
  /* Revert to inline cell so it sits on the same line as the input */
  display: inline-block !important;              /* beat earlier display:flex */
  vertical-align: middle !important;

  /* Compact sizing to align visually with ~28px inputs */
  padding: 2px 6px !important;
  height: 1.6rem !important;                     /* ~25-26px */
  min-height: 0 !important;                      /* undo the 1.75rem min-height */
  line-height: 1.6rem !important;

  /* Theme-aware surface and border */
  background-color: var(--surface-secondary-bg) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

/* Keep the icon inside small and centered without stretching the cell */
#grid4-app-shell .input-append > .add-on > i[class^="icon-"],
#grid4-app-shell .input-append > .add-on > i[class*=" icon-"],
#grid4-app-shell .input-prepend > .add-on > i[class^="icon-"],
#grid4-app-shell .input-prepend > .add-on > i[class*=" icon-"] {
  display: inline-block !important;
  font-size: 14px !important;
  line-height: 1 !important;
  width: auto !important;
  height: auto !important;
}

/* Optional: tighten seam between input and add-on in Bootstrap 2 groups */
#grid4-app-shell .input-append > .add-on { margin-left: -1px !important; }
#grid4-app-shell .input-prepend > .add-on { margin-right: -1px !important; }



/*presence icons need the default colors restored */
#grid4-app-shell .agent-presence-user-phone.loggedin {
    color: #00A304 !important;
}

#grid4-app-shell .agent-presence-user-phone.loggedout {
    color: #D4D4D4 !important;
}

#grid4-app-shell .agent-presence-user-phone.onphone {
    color: #FF1200 !important;
}



/* Fix the Call Queues container on the call center page and its domain-home sibling */
#home-queues-body,
#omp-active-body {
    min-height: 10rem !important;
    max-height: 30rem !important;
    overflow-y: auto;
    /* max-width: 60rem; */
}

#home-queues-body.g4-empty-state-panel,
#omp-active-body.g4-empty-state-panel,
#omp-active-body-meetings.g4-empty-state-panel {
    min-height: 13.5rem !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    padding-bottom: 1rem !important;
}

#omp-active-body.g4-empty-state-panel > .table-container,
#omp-active-body.g4-empty-state-panel > .table-container.scrollable-small,
#omp-active-body.g4-empty-state-panel > .table-container.with-meetings,
#omp-active-body-meetings.g4-empty-state-panel > .table-container,
#omp-active-body-meetings.g4-empty-state-panel > .table-container.scrollable-small {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
    margin-bottom: 0.85rem !important;
}

#omp-active-body.g4-empty-state-panel > .table-container .active-calls-table,
#omp-active-body-meetings.g4-empty-state-panel > .table-container .active-calls-table {
    margin-bottom: 0 !important;
}

#home-queues-body.g4-empty-state-panel .nonecreated,
#omp-active-body.g4-empty-state-panel .nonecreated {
    position: relative !important;
    top: 0 !important;
    margin: 1.5rem auto 0 !important;
}

#omp-active-body-meetings.g4-empty-state-panel .nonecreated-meeting {
    position: relative !important;
    top: 0 !important;
    margin: 1.5rem auto 0 !important;
}



[class^="icon-"], [class*=" icon-"] {
  /* margin-top: 4px !important; */
  margin-left: 0.2rem !important;


}

#grid4-app-shell i.icon-search {
    height: 1.3rem !important;
    margin-top: unset;
    margin-left: unset;
    width: .9rem !important;
}

/* Links inside a hovered table row should be white for contrast */
#grid4-app-shell .table-hover tbody tr:hover
  a:not(.btn, .label, .nav-link, [role='button'], [id^='LinkPager']) {
  color: #ffffff !important;
  font-weight: 600;
  text-decoration: none;
}
/* Also ensure visibility when the row is selected/active */
#grid4-app-shell .table tbody tr.selected a:not(.btn, .label, .nav-link, [role='button'], [id^='LinkPager']),
#grid4-app-shell .table tbody tr.active a:not(.btn, .label, .nav-link, [role='button'], [id^='LinkPager']) {
  color: #ffffff !important;
  text-decoration: none;
}

/* Optional: a bit brighter on link hover/focus */
#grid4-app-shell .table-hover tbody tr:hover a:not(.btn, .label, .nav-link, [role='button'], [id^='LinkPager']):hover, #grid4-app-shell .table-hover tbody tr:hover a:not(.btn, .label, .nav-link, [role='button'], [id^='LinkPager']):focus {
    color: var(--table-hover-text) !important;
    text-decoration: none !important;
}

#grid4-app-shell span.dropdown-msg-count.badge.badge-important.hide {
    color: white !important;
}

/*fix tooltip value color while in light mode */
#grid4-app-shell.theme-light span.slider-tooltip-value {
    color: white !important;
}

/* ===================================================================
   ATTENDANT SHIELD (Manager CSS neutralized on /portal/attendant only)
   - Activates when <html data-grid4-skin="off"> is present.
   - Restores Bootstrap 3 defaults Attendant relies on.
   - Keep this block at the very end so it wins in the cascade.
   =================================================================== */

/* Restore light page background (Manager dark BG must not bleed) */
html[data-grid4-skin="off"] body,
html[data-grid4-skin="off"] html {
  background: #fff !important;
  background-color: #fff !important;
}

/* Modals: viewport container; remove Manager top/left/margins/transform hacks */
html[data-grid4-skin="off"] .modal {
  position: fixed !important;
  top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important;
  margin: 0 !important;
  transform: none !important;
  overflow: hidden !important;       /* BS3 default */
  z-index: 1050 !important;
}

/* Attendant/BS3 controls display via fade/in/show; keep it visible when active */
html[data-grid4-skin="off"] .modal.in,
html[data-grid4-skin="off"] .modal.show {
  display: block !important;
}

/* Dialog spacing and centering */
html[data-grid4-skin="off"] .modal-dialog {
  margin: 10px auto !important;      /* BS3 default vertical spacing */
}

/* Modal content: solid white; remove Manager glass/opacity overrides */
html[data-grid4-skin="off"] .modal-content {
  background-color: #fff !important;
  color: #333 !important;
  border: 1px solid rgba(0,0,0,.2) !important;
  border-radius: 6px !important;
  box-shadow: 0 3px 9px rgba(0,0,0,.5) !important;
  opacity: 1 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Header/Footer surfaces */
html[data-grid4-skin="off"] .modal-header,
html[data-grid4-skin="off"] .modal-footer {
  background-color: #f8f9fa !important;
  border-color: #e5e5e5 !important;
  color: #333 !important;
}

/* Backdrop: full viewport, 0.5 opacity */
html[data-grid4-skin="off"] .modal-backdrop {
  position: fixed !important;
  top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important;
  width: 100vw !important; height: 100vh !important;
  background-color: #000 !important;
  opacity: 0.5 !important;
  z-index: 1040 !important;
}

/* Dropdowns: undo Manager animation/visibility overrides; use BS3 defaults */
html[data-grid4-skin="off"] .dropdown-menu {
  display: none !important;          /* closed */
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  transition: none !important;
  pointer-events: auto !important;
  position: absolute !important;     /* BS3 default */
}
html[data-grid4-skin="off"] .open > .dropdown-menu,
html[data-grid4-skin="off"] .dropdown.open .dropdown-menu,
html[data-grid4-skin="off"] .btn-group.open .dropdown-menu {
  display: block !important;         /* open */
}

/* Defensive: ensure interactions are not disabled by Manager CSS */
html[data-grid4-skin="off"] .modal,
html[data-grid4-skin="off"] .modal * {
  pointer-events: auto !important;
}

/* Optional: revert caret to inherit if Manager forced white */
html[data-grid4-skin="off"] .caret {
  border-top-color: inherit !important;
}

/* End Attendant Shield */


/* ===================================================================
   ATTENDANT CONSOLE — SAFE MODAL/DROPDOWN OVERRIDES (no JS required)
   Rationale: Attendant page does not load our JS, so html[data-grid4-skin="off"]
   may be missing. These selectors key off the Attendant-only .flex-container
   root to neutralize Manager modal/drawer overrides without touching Manager.
   Keep this block at the very end so it wins the cascade.
   =================================================================== */

/* Viewport modal container + stacking fix */
.flex-container ~ .modal {
  position: fixed !important;
  top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important;
  margin: 0 !important;
  transform: none !important;
  overflow: hidden !important; /* Bootstrap 3 default */
  z-index: 1050 !important;    /* Above backdrop */
}
.flex-container ~ .modal.in,
.flex-container ~ .modal.show { /* BS2/BS3 variations used by Attendant */
  display: block !important;
}
/* Center dialog with Bootstrap spacing */
.flex-container ~ .modal .modal-dialog {
  margin: 10px auto !important;
}
/* Solid, fully interactive content surface */
.flex-container ~ .modal .modal-content {
  background-color: #fff !important;
  color: #333 !important;
  border: 1px solid rgba(0,0,0,.2) !important;
  border-radius: 6px !important;
  box-shadow: 0 3px 9px rgba(0,0,0,.5) !important;
  opacity: 1 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: auto !important;
}
/* Header/Footer surfaces */
.flex-container ~ .modal .modal-header,
.flex-container ~ .modal .modal-footer {
  background-color: #f8f9fa !important;
  border-color: #e5e5e5 !important;
  color: #333 !important;
}
/* Ensure backdrop sits behind modal and covers viewport */
.flex-container ~ .modal-backdrop {
  position: fixed !important;
  top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important;
  width: 100vw !important; height: 100vh !important;
  background-color: #000 !important;
  opacity: 0.5 !important;    /* Bootstrap default */
  z-index: 1040 !important;   /* Below .modal */
}
/* Attendant dropdowns use BS3 defaults; undo Manager animations */
.flex-container ~ .dropdown-menu {
  display: none !important;          /* closed */
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  transition: none !important;
  pointer-events: auto !important;
  position: absolute !important;     /* Bootstrap 3 default */
}
.flex-container ~ .open > .dropdown-menu,
.flex-container ~ .dropdown.open .dropdown-menu,
.flex-container ~ .btn-group.open .dropdown-menu {
  display: block !important;         /* open */
}

/* Extra safety: explicitly scope Attendant modal IDs (no impact on Manager) */
#transfer-options-modal,
#transfer-options-modalOff,
#call-options-modal,
#custom-group-modal {
  z-index: 1050 !important;
}
#transfer-options-modal .modal-content,
#transfer-options-modalOff .modal-content,
#call-options-modal .modal-content,
#custom-group-modal .modal-content {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* ===================================================================
   ATTENDANT CONSOLE — HARD OVERRIDES FOR ATTENDANT MODAL IDS
   Neutralize Manager BS2 modal tweaks (top/opacity) and enforce BS3
   behavior for Attendant-only modals. These IDs exist only on
   /portal/attendant, so Manager pages are unaffected.
   =================================================================== */
#transfer-options-modal,
#transfer-options-modalOff,
#call-options-modal,
#custom-group-modal {
  position: fixed !important;
  top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 1050 !important;  /* above backdrop */
}
/* Ensure visible when shown (BS2/BS3 class variants) */
#transfer-options-modal.in, #transfer-options-modal.show,
#transfer-options-modalOff.in, #transfer-options-modalOff.show,
#call-options-modal.in, #call-options-modal.show,
#custom-group-modal.in, #custom-group-modal.show {
  display: block !important;
}
/* Kill BS2-style vertical animation that pushes modal off center */
#transfer-options-modal.modal.fade,
#transfer-options-modal.modal.fade.in,
#transfer-options-modalOff.modal.fade,
#transfer-options-modalOff.modal.fade.in,
#call-options-modal.modal.fade,
#call-options-modal.modal.fade.in,
#custom-group-modal.modal.fade,
#custom-group-modal.modal.fade.in {
  top: 0 !important;
  opacity: 1 !important; /* Attendant uses BS3; keep fully visible */
}
/* Dialog spacing (center horizontally; let content height decide vertical) */
#transfer-options-modal .modal-dialog,
#transfer-options-modalOff .modal-dialog,
#call-options-modal .modal-dialog,
#custom-group-modal .modal-dialog { margin: 10px auto !important; }
/* Backdrop stacking safety (applies globally; already used by Manager) */
body > .modal-backdrop { z-index: 1040 !important; }


/* ===================================================================
   ATTENDANT CONSOLE — FINAL MODAL FIXES
   Backdrop is inserted as a child of the modal on Attendant pages.
   Ensure dialog/content paint above that backdrop and are fully opaque.
   Do NOT touch Manager globals; scope by Attendant modal IDs only.
   =================================================================== */
#transfer-options-modal .modal-backdrop,
#transfer-options-modalOff .modal-backdrop,
#call-options-modal .modal-backdrop,
#custom-group-modal .modal-backdrop,
#no-numbers-modal .modal-backdrop,
#user-settings .modal-backdrop {
  /* Keep the dimming layer, but place it under the dialog within the
     modal stacking context and let clicks pass through. */
  z-index: 0 !important;
  pointer-events: none !important;
}
#transfer-options-modal .modal-dialog,
#transfer-options-modalOff .modal-dialog,
#call-options-modal .modal-dialog,
#custom-group-modal .modal-dialog,
#no-numbers-modal .modal-dialog,
#user-settings .modal-dialog {
  position: relative !important;
  z-index: 1 !important; /* above the in-modal backdrop */
}
#transfer-options-modal .modal-content,
#transfer-options-modalOff .modal-content,
#call-options-modal .modal-content,
#custom-group-modal .modal-content,
#no-numbers-modal .modal-content,
#user-settings .modal-content,
#transfer-options-modal .modal-header,
#transfer-options-modalOff .modal-header,
#call-options-modal .modal-header,
#custom-group-modal .modal-header,
#no-numbers-modal .modal-header,
#user-settings .modal-header,
#transfer-options-modal .modal-body,
#transfer-options-modalOff .modal-body,
#call-options-modal .modal-body,
#custom-group-modal .modal-body,
#no-numbers-modal .modal-body,
#user-settings .modal-body,
#transfer-options-modal .modal-footer,
#transfer-options-modalOff .modal-footer,
#call-options-modal .modal-footer,
#custom-group-modal .modal-footer,
#no-numbers-modal .modal-footer,
#user-settings .modal-footer {
  background-color: #fff !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}


/* ===================================================================
   ATTENDANT CONSOLE — FINAL MODAL STACKING AND SURFACE FIXES
   - Attendant inserts .modal-backdrop INSIDE each modal container.
   - This creates a child stacking conflict where backdrop (z-index:1040)
     can sit above the dialog (auto), and our Manager glass/transparency
     rules can make modal surfaces transparent.
   - Solution: for Attendant modal IDs only, push backdrop below dialog
     within the same stacking context, and force solid surfaces.
   - Do not alter Manager/global rules. Keep scope to Attendant IDs.
   =================================================================== */
/* Backdrop lives INSIDE the modal in Attendant: keep it behind dialog */
#transfer-options-modal .modal-backdrop,
#transfer-options-modalOff .modal-backdrop,
#call-options-modal .modal-backdrop,
#custom-group-modal .modal-backdrop,
#no-numbers-modal .modal-backdrop,
#user-settings .modal-backdrop,
#offnet-transfer-modal .modal-backdrop {
  position: fixed !important;
  top: 0 !important; right: 0 !important; bottom: 0 !important; left: 0 !important;
  margin: 0 !important;
  background-color: #000 !important;
  opacity: 0.5 !important;      /* Bootstrap default dim */
  z-index: 0 !important;        /* below the dialog inside the same modal */
}
/* Ensure dialog paints above the in-container backdrop */
#transfer-options-modal .modal-dialog,
#transfer-options-modalOff .modal-dialog,
#call-options-modal .modal-dialog,
#custom-group-modal .modal-dialog,
#no-numbers-modal .modal-dialog,
#user-settings .modal-dialog,
#offnet-transfer-modal .modal-dialog {
  position: relative !important;
  z-index: 1 !important;
}
/* Kill transparency leaks: force solid modal surfaces on Attendant */
#transfer-options-modal .modal-content,
#transfer-options-modalOff .modal-content,
#call-options-modal .modal-content,
#custom-group-modal .modal-content,
#no-numbers-modal .modal-content,
#user-settings .modal-content,
#offnet-transfer-modal .modal-content,
#transfer-options-modal .modal-header,
#transfer-options-modalOff .modal-header,
#call-options-modal .modal-header,
#custom-group-modal .modal-header,
#no-numbers-modal .modal-header,
#user-settings .modal-header,
#offnet-transfer-modal .modal-header,
#transfer-options-modal .modal-body,
#transfer-options-modalOff .modal-body,
#call-options-modal .modal-body,
#custom-group-modal .modal-body,
#no-numbers-modal .modal-body,
#user-settings .modal-body,
#offnet-transfer-modal .modal-body,
#transfer-options-modal .modal-footer,
#transfer-options-modalOff .modal-footer,
#call-options-modal .modal-footer,
#custom-group-modal .modal-footer,
#no-numbers-modal .modal-footer,
#user-settings .modal-footer,
#offnet-transfer-modal .modal-footer {
  background-color: #fff !important;
  opacity: 1 !important;
}



div#write-routeprofile {
    height: auto !important;
}

#write-routeprofile .nonecreated {
    margin-top: 1rem !important;
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
}


#grid4-app-shell .tablecolumn .dropdown-menu .dropdown-column > li > .checkbox,
#grid4-app-shell .tablecolumn .dropdown-menu .dropdown-column > li > label.checkbox {
  color: var(--text-primary) !important;
}

#grid4-app-shell .tablecolumn .dropdown-menu .dropdown-column > li > .checkbox:hover,
#grid4-app-shell .tablecolumn .dropdown-menu .dropdown-column > li > label.checkbox:hover {
  color: var(--heading-color) !important;
}

#grid4-app-shell.theme-light .tablecolumn .dropdown-menu .muted,
#grid4-app-shell.theme-light .tablecolumn .dropdown-menu p.muted {
  color: var(--text-secondary) !important;
}

#grid4-app-shell.theme-dark .tablecolumn .dropdown-menu .muted,
#grid4-app-shell.theme-dark .tablecolumn .dropdown-menu p.muted {
  color: var(--text-secondary) !important;
}

#grid4-app-shell.theme-light .alert.alert-info.text-center {
  color:white !important;
  background-color: #555 !important;

}



#grid4-app-shell span#current-folder, span#current-group  {
    color: white !important;
}

.alert-info.text-center > strong {
    color: var(--accent-primary) !important;
}
/*
#grid4-app-shell button.close {
    filter: invert(1) contrast(2) brightness(5.5);
}
*/
#grid4-app-shell.theme-light i.caret {
    border-top: 4px solid var(--accent-primary) !important;
}

#grid4-app-shell p.caption {
    color: var(--primary-text);
    background-color: var(--modal-bg);
}

#grid4-app-shell.theme-light button.close.cancel {
    filter: contrast(2) brightness(-2.5);
}

/* Use theme surface instead of transparency on modal body */
.modal-body { background-color: var(--modal-bg) !important; opacity: 1 !important; }


#grid4-app-shell #cc-settings-btn {
    /* padding-left: 4px !important; */
    gap: 2px !important;
    margin-inline: 5px !important;
}

#grid4-app-shell .btn-group-full {
    width: 98% !important;
    margin: auto !important;
    margin-left: 0px !important;
}

i.nsicon.nsicon-contacts {
    color: white !important;
}

input#add-template
{
   right: unset !important;
   bottom: unset !important;
}

#builder-templates .right-panel .panel-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
    padding-right: 27px !important;
}

#builder-templates .right-panel .panel-content > input[type="text"],
#builder-templates .right-panel .panel-content > select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

#builder-templates .right-panel #add-template.btn-long {
    position: static !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-top: 0.5rem !important;
}

#builder-templates .modal-body {
    display: flex !important;
    align-items: stretch !important;
}

#builder-templates .left-panel,
#builder-templates .right-panel {
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
}

#builder-templates .right-panel {
    float: none !important;
}

#builder-templates .left-panel #edit-copy-del-template-form {
    display: grid !important;
    flex: 1 1 auto !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    grid-template-rows: minmax(0, 1fr) auto !important;
    column-gap: 0.25rem !important;
    row-gap: 0.5rem !important;
    min-height: 0 !important;
}

#builder-templates .left-panel #edit-copy-del-template-form .accordion-group {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    grid-column: 1 / -1 !important;
    grid-row: 1 !important;
    min-height: 0 !important;
    margin-bottom: 0 !important;
}

#builder-templates .left-panel #edit-copy-del-template-form .compound-select-container {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    min-height: 0 !important;
}

#builder-templates .left-panel #template-compound-select {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 17.75rem !important;
    max-height: none !important;
}

#builder-templates .left-panel #edit-copy-del-template-form > div:not(.accordion-group) {
    display: flex !important;
    grid-column: 1 / span 2 !important;
    grid-row: 2 !important;
    gap: 0.25rem !important;
    margin: 0 !important;
}

#builder-templates #copy-template.btn-half,
#builder-templates #delete-template.btn-half {
    flex: 1 1 0 !important;
    width: auto !important;
    margin: 0 !important;
    min-height: 29.3333px !important;
    height: 29.3333px !important;
}

#builder-templates #edit-template.template-action {
    grid-column: 3 !important;
    grid-row: 2 !important;
    width: auto !important;
    max-width: 100% !important;
    min-width: 0 !important;
    justify-self: stretch !important;
    margin-top: 0 !important;
}

#builder-templates #delete-template.btn-danger {
    background-color: var(--g4-button-danger-bg) !important;
    border-color: var(--g4-button-danger-border) !important;
    color: #ffffff !important;
}

#builder-templates #delete-template.btn-danger:hover,
#builder-templates #delete-template.btn-danger:focus {
    background-color: var(--g4-button-danger-hover-bg) !important;
    border-color: var(--g4-button-danger-border) !important;
    color: #ffffff !important;
}

.input-append input, .input-prepend input, .input-append select, .input-prepend select, .input-append .uneditable-input, .input-prepend .uneditable-input {
    position: relative;
    margin-bottom: 0;
    vertical-align: middle !important;
    -webkit-border-radius: 0 4px 4px 0;
    -moz-border-radius: 0 4px 4px 0;
    border-radius: 0 4px 4px 0;
}

.blocknumbers-modal {
    width: fit-content !important;
}

#grid4-app-shell.theme-dark ~ .modal .modal-body,
#grid4-app-shell.theme-dark .modal .modal-body { background-color: var(--modal-bg) !important; }

select#templateApplier {
    font-size: 10px !important;
    max-block-size: min-content ! IMPORTANT;
    MAX-WIDTH: min-content !important;
}

.dropdown-menu.pull-right.form-actions.template-selector
 {
   min-width:fit-content !important;
}

div#config-save-bar {
    max-width: 50% !important;
}
div#left-panel {
    margin-top: 50px !important;
}
input#copy-template, input#delete-template {
    width: unset !important;
}

#grid4-app-shell.theme-dark input.compound-select-filter {
    /* color: #fffefe12 !important; */
    background-color: black !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    font-weight:500 !important;
}

#grid4-app-shell.theme-dark .compound-select-option:hover

 {
  background: var(--accent-primary) !important;
  color: var(--text-primary) !important;
}

div#chart_div_AnnotationChart_legendContainer {
    color: black !important;
}

body.theme-dark ul#ui-id-1
 {
    background-color: black !important;
}

body.theme-dark option
 {
    -webkit-text-fill-color: var(--text-primary) !important;
    background-color: black !important;
}

div#\37 66sy {
    top: 50% !important;
}

span.uneditable-input {
    background: var(--modal-bg) !important;
}

/* ============================================
   SPECIFIC MODAL FIXES (PAGE-SCOPED)
   ============================================ */
/* Center the Fax > Number Permissions modal vertically a bit lower */
body.theme-dark .modal.grid4-number-permissions,
body.theme-light .modal.grid4-number-permissions,
.modal.grid4-number-permissions {
  top: 50% !important;
}

/* Injected Fax Numbers modals already ship with translate(-50%, -50%) centering.
   When our viewport-fit path pins them below the fixed domain banner, keep the
   horizontal centering but drop the vertical translate so they no longer jump
   upward under the banner. */
body.page-faxnumbers .modal.grid4-number-permissions.g4-modal-viewport-fit,
body.page-faxnumbers .modal.grid4-fax-device-modal.g4-modal-viewport-fit,
body.page-faxnumbers .modal.grid4-fax-port-modal.g4-modal-viewport-fit {
  left: 50% !important;
  margin-left: 0 !important;
  transform: translateX(-50%) !important;
}

/* Fax device modal: keep Notes closer to the sibling field width and add height
   instead of letting the shared modal textarea rule stretch it across the lane. */
body.page-faxnumbers .modal.grid4-fax-device-modal textarea[name="notes"] {
  width: 240px !important;
  max-width: 100% !important;
  min-height: 8.25rem !important;
  box-sizing: border-box !important;
}

body.theme-dark .selectivity-multiple-input-container {
    background-color: var(--modal-bg) !important;
}

/* Time Frames modal: fix first/last rows (tr.gray-out) in dark mode */
body.theme-dark.page-timeframes .modal table tr.gray-out,
body.theme-dark.page-timeframes .modal table tr.gray-out td,
body.theme-dark.page-timeframes .modal .timeframe-details tr.gray-out,
body.theme-dark.page-timeframes .modal .timeframe-details tr.gray-out td {
  background-color: var(--surface-secondary-bg) !important;
  color: var(--text-secondary) !important;
}

/* Ensure disabled labels inside gray-out rows are readable */
body.theme-dark.page-timeframes .modal td.opaque-text {
  color: var(--text-secondary) !important;
}


body.theme-dark .modal div .selectivity-result-item {
    background: black !important;
}

body.theme-dark .modal div .selectivity-result-item.highlight

 {
    background-color: #785EF0 !important;
    color: white;
}

input#status-filter-add {
    width: calc(100% - 80px) !important;
}

/*Attendant Console limited customization 

.container-fluid {
  padding-right: unset !important;
   padding-left: unset !important;
    margin-right: auto;
    margin-left: auto;
}

.navbar-collapse.collapse {
    background-color: #52B4FA !important;
    color: white !important;
}

*/
body.page-timeframes #write-timeframe .specific-date-rows {
    width: 100% !important;
}

/* Fix: Dark mode source-code blocks in modals (config file viewer, etc.)
   The nuclear wildcard (body.theme-dark .modal-content *) forces light text,
   but the <pre> keeps its light background from portal CSS.
   Fix all syntax types: .python, .xml, etc. */
body.theme-dark .modal pre.source-code {
    background-color: #1a1a2e !important;
    color: #d4d4d4 !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

body.theme-dark .modal pre.source-code * {
    color: #d4d4d4 !important;
}

/* Fix: Builder config file modal centering.
   The builder JS applies a translateX() transform that mispositions the 980px modal.
   Override with translateX(-50%) for proper viewport centering. */
#builder-config-file.modal {
    transform: translateX(-50%) !important;
    left: 50% !important;
    margin-left: 0 !important;
}

body.theme-dark.page-agents .google-visualization-tooltip,
body.theme-dark.page-stats .google-visualization-tooltip,
body.theme-dark.page-queues .google-visualization-tooltip {
   background-color: var(--surface-secondary-bg) !important;
   color: var(--text-primary) !important;
   border: 1px solid var(--g4-popover-border) !important;
   box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.34) !important;
}

body.theme-dark.page-agents .google-visualization-tooltip *,
body.theme-dark.page-agents .google-visualization-tooltip span,
body.theme-dark.page-agents .google-visualization-tooltip div,
body.theme-dark.page-agents .google-visualization-tooltip td,
body.theme-dark.page-stats .google-visualization-tooltip *,
body.theme-dark.page-stats .google-visualization-tooltip span,
body.theme-dark.page-stats .google-visualization-tooltip div,
body.theme-dark.page-stats .google-visualization-tooltip td,
body.theme-dark.page-queues .google-visualization-tooltip *,
body.theme-dark.page-queues .google-visualization-tooltip span,
body.theme-dark.page-queues .google-visualization-tooltip div,
body.theme-dark.page-queues .google-visualization-tooltip td {
   background: transparent !important;
   color: var(--text-primary) !important;
   text-shadow: none !important;
}

body.theme-dark.page-agents .google-visualization-tooltip path,
body.theme-dark.page-agents .google-visualization-tooltip rect,
body.theme-dark.page-stats .google-visualization-tooltip path,
body.theme-dark.page-stats .google-visualization-tooltip rect,
body.theme-dark.page-queues .google-visualization-tooltip path,
body.theme-dark.page-queues .google-visualization-tooltip rect {
   fill: var(--surface-secondary-bg) !important;
   stroke: var(--g4-popover-border) !important;
}

body.theme-dark.page-agents .google-visualization-tooltip text,
body.theme-dark.page-agents .google-visualization-tooltip tspan,
body.theme-dark.page-stats .google-visualization-tooltip text,
body.theme-dark.page-stats .google-visualization-tooltip tspan,
body.theme-dark.page-queues .google-visualization-tooltip text,
body.theme-dark.page-queues .google-visualization-tooltip tspan {
   fill: var(--text-primary) !important;
   color: var(--text-primary) !important;
   stroke: none !important;
   text-shadow: none !important;
}

.nav-pills>.active>a, .nav-pills>.active>a:hover, .nav-pills>.active>a:focus {
    color: white !important;
    background-color: var(--accent-primary) !important;
}

body.theme-dark a.transcription-controls.transcription-play-comment, body.theme-dark a.transcription-controls.transcription-copy-comment
 {
    filter: invert(1);
}
body.theme-dark .transcription-controls
 {
    filter: invert(1);
}

.queue-slider, .agent-slider, .cc-settings-slider {
    width: 260px;
    margin-top: 9px;
    margin-left: 1rem !important;
}

dl.slider-maxlength-labels.slider-labels,
dl.slider-maxwait-labels.slider-labels {
    margin-left: 1rem !important;
}

input#by_extension {
    margin-left: .1px;

}

#bulkedit-phonenumbers {
    width: 600px;
}

select#ip_control_dd {
    width: fit-content !important;
}

body.theme-dark  .table-striped tbody>tr:nth-child(odd)>td {
    background-color: var(--accent-primary) !important;
}

body.theme-dark  .refresh-icon.py-4 {
    filter: none !important;
}

body.page-fax #grid4-app-shell .refresh-icon.py-4,
body.page-faxnumbers #grid4-app-shell .refresh-icon.py-4 {
    position: relative !important;
    min-width: 30px !important;
    min-height: 30px !important;
    text-shadow: none !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 15px 15px !important;
}

body.theme-dark.page-fax #grid4-app-shell .refresh-icon.py-4,
body.theme-dark.page-faxnumbers #grid4-app-shell .refresh-icon.py-4 {
    background-color: var(--surface-secondary-bg) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23e7ecf3' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 3v4H9'/%3E%3Cpath d='M3 13V9h4'/%3E%3Cpath d='M13 7A5 5 0 0 0 4.5 3.5L3 5'/%3E%3Cpath d='M3 9a5 5 0 0 0 8.5 3.5L13 11'/%3E%3C/svg%3E") !important;
}

body.theme-light.page-fax #grid4-app-shell .refresh-icon.py-4,
body.theme-light.page-faxnumbers #grid4-app-shell .refresh-icon.py-4 {
    background-color: #ffffff !important;
    border-color: rgba(var(--g4-brand-sky-rgb), 0.6) !important;
    color: #1c2143 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%231c2143' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 3v4H9'/%3E%3Cpath d='M3 13V9h4'/%3E%3Cpath d='M13 7A5 5 0 0 0 4.5 3.5L3 5'/%3E%3Cpath d='M3 9a5 5 0 0 0 8.5 3.5L13 11'/%3E%3C/svg%3E") !important;
}

span#language_name_tier_1 {
    width: fit-content !important;
    color: white;
}
span#language_name_tier_2 {
    width: fit-content !important;
    color: white;
}

i.nsicon.nsicon-language {
    color: white;
}

/* ===================================================================
   FULLSCREEN MODE: SIP FLOW DARK THEME FIX
   ===================================================================
 * PROBLEM: When .flow-fullscreen-container enters fullscreen mode via
 * the browser Fullscreen API, the NetSapiens Svelte components have
 * hardcoded white backgrounds that override our dark theme.
 *
 * SOLUTION: Target .flow-fullscreen-container:fullscreen and its
 * children directly. Uses body.theme-dark which persists during
 * fullscreen (synced by JS in grid4-portal-skin-v5.0.11.js).
 *
 * Elements targeted (from diagnostic):
 * - .flow-fullscreen-container: main container (white → dark)
 * - .svelte-y6c6zk: flow header boxes (7 instances, white → dark)
 * - #search.svelte-1l4izdq: search input (white → dark)
 * - SVG paths/circles: stroke color for ladder diagram
 * - .flow-time text: time scale labels
 */

/* 1. Main fullscreen container background */
body.theme-dark .flow-fullscreen-container:fullscreen,
body.theme-dark .flow-fullscreen-container:-webkit-full-screen {
  background-color: var(--surface-primary-bg, #333) !important;
}

/* 2. Flow header boxes (svelte-y6c6zk) - the device name boxes at top */
body.theme-dark .flow-fullscreen-container:fullscreen .svelte-y6c6zk,
body.theme-dark .flow-fullscreen-container:-webkit-full-screen .svelte-y6c6zk {
  background-color: var(--surface-secondary-bg, #181818ed) !important;
  color: var(--text-primary, #e9ecef) !important;
}

/* 3. Search input in fullscreen */
body.theme-dark .flow-fullscreen-container:fullscreen #search.svelte-1l4izdq,
body.theme-dark .flow-fullscreen-container:fullscreen input.svelte-1l4izdq,
body.theme-dark .flow-fullscreen-container:-webkit-full-screen #search.svelte-1l4izdq,
body.theme-dark .flow-fullscreen-container:-webkit-full-screen input.svelte-1l4izdq {
  background-color: var(--surface-secondary-bg, #181818ed) !important;
  color: var(--text-primary, #e9ecef) !important;
  border-color: var(--border-color, rgba(255, 255, 255, 0.1)) !important;
}

/* 4. SVG paths and circles - white strokes for dark mode ladder diagram */
body.theme-dark .flow-fullscreen-container:fullscreen svg path,
body.theme-dark .flow-fullscreen-container:fullscreen svg circle,
body.theme-dark .flow-fullscreen-container:-webkit-full-screen svg path,
body.theme-dark .flow-fullscreen-container:-webkit-full-screen svg circle {
  stroke: #fff !important;
}

/* 5. Dark fills in SVG → white (arrow heads, markers) */
body.theme-dark .flow-fullscreen-container:fullscreen svg path[fill="#1A1A1A"],
body.theme-dark .flow-fullscreen-container:fullscreen svg rect[fill="#1A1A1A"],
body.theme-dark .flow-fullscreen-container:-webkit-full-screen svg path[fill="#1A1A1A"],
body.theme-dark .flow-fullscreen-container:-webkit-full-screen svg rect[fill="#1A1A1A"] {
  fill: #fff !important;
}

/* 6. Time scale text on left side */
body.theme-dark .flow-fullscreen-container:fullscreen .flow-time text,
body.theme-dark .flow-fullscreen-container:-webkit-full-screen .flow-time text {
  fill: #fff !important;
}

/* 7. Selected time text highlight */
body.theme-dark .flow-fullscreen-container:fullscreen .flow-time text.selected,
body.theme-dark .flow-fullscreen-container:-webkit-full-screen .flow-time text.selected {
  fill: #fff !important;
}

/* 8. SIP method labels and filter text */
body.theme-dark .flow-fullscreen-container:fullscreen span.flow-filter,
body.theme-dark .flow-fullscreen-container:fullscreen span.sl-sipmethod,
body.theme-dark .flow-fullscreen-container:-webkit-full-screen span.flow-filter,
body.theme-dark .flow-fullscreen-container:-webkit-full-screen span.sl-sipmethod {
  color: #fff !important;
}

/* 9. Pre/code blocks (SIP message details on right panel) 
body.theme-dark .flow-fullscreen-container:fullscreen pre.box,
body.theme-dark .flow-fullscreen-container:-webkit-full-screen pre.box {
  color: var(--text-primary, #e9ecef) !important;
} */

/* 10. Light mode fullscreen - ensure it stays light (no changes needed) */
body:not(.theme-dark) .flow-fullscreen-container:fullscreen,
body:not(.theme-dark) .flow-fullscreen-container:-webkit-full-screen {
  background-color: #fff !important;
}

/* End Fullscreen SIP Flow Fix */
body.theme-dark .assigned-label, body.theme-dark .assigned-feature {
    color: white !important;
}
#grid4-app-shell.theme-light .dropdown-menu > li > a {
    color: var(--text-primary) !important;
}

/* Fix: DataTables scrollBody duplicate thead black bar on first row hover.
   DataTables keeps a hidden thead copy in scrollBody for column alignment,
   but our skin's !important padding/border rules on th keep it ~11px tall,
   creating a black bar that covers the top of the first data row on hover.
   Collapse it fully by zeroing all box-model properties. */
.dataTables_scrollBody thead th {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-top-width: 0 !important;
    border-bottom-width: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
    height: 0 !important;
}

/* Fix: legacy greeting modals can render their form rows flush against the
   modal edge. Apply the same body padding to both greeting modal variants,
   then left-align the Add Greeting label column so "Message" / "Voice"
   read like the other modal forms instead of hugging the edge. */
#greetings-modal .modal-body,
#introgreeting-modal .modal-body {
    padding: 15px !important;
}

#introgreeting-modal .add-greeting .control-label,
#introgreeting-modal .new-greeting-group > .control-label {
    text-align: left !important;
}

/* ===================================================================
   BRAD-REPORTED FIXES — March 2026
   Issues documented in brad-issues-march2026.md
   =================================================================== */

/* --- Brad Fix #1: AA "Remove" text invisible in dark mode ---
   Bootstrap's .close defaults to color: #000, invisible on dark backgrounds.
   Existing .close rules (lines 1019-1031) only target .modal.g4-themed .close,
   not the AA editor page where <span class='close helpsy'>Remove</span> lives
   inside <div class='remove-app'>. */
body.theme-dark.page-autoattendants .attendant-creation .remove-app .close {
    color: #ff6b6b !important;
    opacity: 0.85 !important;
    text-shadow: none !important;
    font-size: 14px !important;
}
body.theme-dark.page-autoattendants .attendant-creation .remove-app .close:hover {
    color: #ff4444 !important;
    opacity: 1 !important;
}
body.theme-light.page-autoattendants .attendant-creation .remove-app .close {
    color: #dc3545 !important;
    opacity: 0.85 !important;
    text-shadow: none !important;
    font-size: 14px !important;
}
body.theme-light.page-autoattendants .attendant-creation .remove-app .close:hover {
    color: #b02a37 !important;
    opacity: 1 !important;
}

/* --- Brad Fix #8: Add Auto Attendant modal fields too faint in light mode ---
   The modal is already themed, but the default light borders are still too soft.
   Strengthen the field outline and inner contrast without touching dark mode. */
body.theme-light #add-attendant.modal.g4-themed input[type="text"],
body.theme-light #add-attendant.modal.g4-themed select {
    background-color: #ffffff !important;
    border-color: rgba(100, 116, 139, 0.55) !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9), inset 0 1px 2px rgba(15, 23, 42, 0.06) !important;
}

body.theme-light #add-attendant.modal.g4-themed input[type="text"]:focus,
body.theme-light #add-attendant.modal.g4-themed select:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18) !important;
}

/* --- Brad Fix #2: Holiday search icon overlaps text ---
   The holidays partial already renders its own search wrapper, so keep the
   positioning override tightly scoped to the timeframe modal. */
body.page-timeframes #write-timeframe .holiday-search-container {
    position: relative !important;
}
body.page-timeframes #write-timeframe .holiday-search-container .search-icon {
    position: absolute !important;
    left: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 2 !important;
    pointer-events: none !important;
    color: var(--text-secondary) !important;
    font-size: 14px !important;
}
body.page-timeframes #write-timeframe.modal.g4-themed .holiday-search-container input.holiday-search {
    padding-left: 35px !important;
}

/* jQuery timepicker appends its popup to <body>, not inside the modal DOM tree.
   Theme it at the body level so holiday/specific-date time pickers stop falling
   back to a white vendor menu in dark mode. */
body.theme-dark .ui-timepicker-wrapper {
    background: var(--surface-primary-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--g4-radius-md) !important;
    box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.42) !important;
}

body.theme-dark .ui-timepicker-list {
    background: transparent !important;
    color: var(--text-primary) !important;
}

body.theme-dark .ui-timepicker-list li {
    background: transparent !important;
    color: var(--text-primary) !important;
    padding: 0.3rem 0.85rem 0.3rem 0.55rem !important;
}

body.theme-dark .ui-timepicker-list:hover .ui-timepicker-selected,
body.theme-dark li.ui-timepicker-selected,
body.theme-dark .ui-timepicker-list li:hover,
body.theme-dark .ui-timepicker-list .ui-timepicker-selected:hover {
    background: rgba(var(--g4-brand-sky-rgb), 0.92) !important;
    color: #ffffff !important;
}

body.theme-dark .ui-timepicker-duration,
body.theme-dark .ui-timepicker-list:hover .ui-timepicker-duration,
body.theme-dark li.ui-timepicker-selected .ui-timepicker-duration,
body.theme-dark .ui-timepicker-list li:hover .ui-timepicker-duration {
    color: var(--text-muted) !important;
}

body.theme-dark .ui-timepicker-list li.ui-timepicker-disabled,
body.theme-dark .ui-timepicker-list li.ui-timepicker-disabled:hover,
body.theme-dark .ui-timepicker-list li.ui-timepicker-selected.ui-timepicker-disabled {
    background: transparent !important;
    color: var(--text-muted) !important;
}

body.theme-light .ui-timepicker-wrapper {
    background: #f8fbff !important;
    border: 1px solid rgba(var(--g4-brand-navy-rgb), 0.14) !important;
    border-radius: var(--g4-radius-md) !important;
    box-shadow: 0 0.9rem 1.8rem rgba(15, 23, 42, 0.14) !important;
}

body.theme-light .ui-timepicker-list {
    background: transparent !important;
    color: #1f2937 !important;
}

body.theme-light .ui-timepicker-list li {
    background: transparent !important;
    color: #1f2937 !important;
    padding: 0.3rem 0.85rem 0.3rem 0.55rem !important;
}

body.theme-light .ui-timepicker-list:hover .ui-timepicker-selected,
body.theme-light li.ui-timepicker-selected,
body.theme-light .ui-timepicker-list li:hover,
body.theme-light .ui-timepicker-list .ui-timepicker-selected:hover {
    background: rgba(var(--g4-brand-sky-rgb), 0.96) !important;
    color: #ffffff !important;
}

/* --- Brad Fix #3: Email reports multi-select box spacing ---
   The live Email Reports fragment is injected into #view-reports, not an
   #email-report wrapper, so the original rules were never matching. Keep the
   fallback selectors for #email-report in case another queue-report flow still
   mounts that older root. */
#view-reports .control-group.report-email-selector,
#email-report .control-group.report-email-selector {
    margin-bottom: 18px !important;
    min-height: 140px !important;
    overflow: hidden !important; /* ensure the floated label and select height expand the row */
    padding-bottom: 10px !important;
}
#view-reports .report-email-selector .control-label,
#email-report .report-email-selector .control-label {
    width: 170px !important;
    text-align: left !important;
    float: left !important;
    padding-top: 4px !important;
    margin-right: 10px !important;
}
#view-reports .report-email-selector .controls,
#email-report .report-email-selector .controls {
    margin-left: 180px !important;
}
#view-reports .report-email-selector select[multiple],
#email-report .report-email-selector select[multiple] {
    width: 100% !important;
    min-height: 126px !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--g4-radius-sm) !important;
    display: block !important;
}
#view-reports.theme-dark .report-email-selector select[multiple],
body.theme-dark #view-reports .report-email-selector select[multiple],
body.theme-dark #email-report .report-email-selector select[multiple] {
    background-color: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
}
#view-reports.theme-dark .report-email-selector select[multiple] option,
body.theme-dark #view-reports .report-email-selector select[multiple] option,
body.theme-dark #email-report .report-email-selector select[multiple] option {
    background-color: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
    padding: 4px 8px !important;
}
/* Light mode styling for email report selects */
#view-reports.theme-light .report-email-selector select[multiple],
body.theme-light #view-reports .report-email-selector select[multiple],
body.theme-light #email-report .report-email-selector select[multiple] {
    background-color: #fff !important;
    color: #333 !important;
    border-color: #ccc !important;
}
/* Hint text below the third select */
#view-reports #report-email-advanced .help-block,
#email-report #report-email-advanced .help-block {
    clear: both !important;
    margin-top: 8px !important;
}

body.theme-dark.page-queues #grid4-app-shell .reportdate,
body.theme-dark.page-queues #grid4-app-shell .date-field,
body.theme-dark.page-queues #grid4-app-shell .hasDatepicker,
body.theme-dark.page-queues #grid4-app-shell .ccmanagertablesModal {
    background-color: var(--surface-primary-bg) !important;
    background-image: none !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: none !important;
}

body.theme-dark.page-queues #grid4-app-shell .input-append .add-on,
body.theme-dark.page-queues #grid4-app-shell .input-prepend .add-on {
    background-color: var(--surface-secondary-bg) !important;
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
    text-shadow: none !important;
}

body.theme-dark .ui-datepicker {
    background: var(--surface-primary-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    box-shadow: 0 1rem 2.2rem rgba(0, 0, 0, 0.34) !important;
}

body.theme-dark .ui-datepicker .ui-datepicker-header {
    background: var(--surface-secondary-bg) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
}

body.theme-dark .ui-datepicker .ui-datepicker-title,
body.theme-dark .ui-datepicker .ui-datepicker-prev,
body.theme-dark .ui-datepicker .ui-datepicker-next,
body.theme-dark .ui-datepicker .ui-datepicker-prev span,
body.theme-dark .ui-datepicker .ui-datepicker-next span {
    color: var(--text-primary) !important;
    text-shadow: none !important;
}

body.theme-dark .ui-datepicker th {
    color: var(--text-secondary) !important;
}

body.theme-dark .ui-datepicker td a,
body.theme-dark .ui-datepicker td span {
    background: transparent !important;
    color: var(--text-primary) !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
}

body.theme-dark .ui-datepicker td a:hover,
body.theme-dark .ui-datepicker td .ui-state-hover {
    background: rgba(var(--g4-brand-sky-rgb), 0.16) !important;
    color: var(--text-primary) !important;
    border-color: rgba(var(--g4-brand-sky-rgb), 0.28) !important;
}

body.theme-dark .ui-datepicker td .ui-state-active,
body.theme-dark .ui-datepicker td .ui-state-highlight {
    background: rgba(var(--g4-brand-sky-rgb), 0.24) !important;
    color: var(--text-primary) !important;
    border-color: rgba(var(--g4-brand-sky-rgb), 0.36) !important;
}

/* --- Brad Fix #4: AA unassigned key background container ---
   (Applied in-place at lines 3265-3275 — added background, border,
   border-radius, and padding to existing flex visibility rule.) */

/* --- Brad Fix #5: AA Options "Set Custom" left alignment ---
   The .enableDtmf link has class="control-label" which inherits Bootstrap 2's
   text-align: right; float: left; width: 160px. This override removes those
   inherited layout properties so the link reads naturally left-aligned. */
#options-basic-content .control-group.fail-setting .controls a.enableDtmf.control-label {
    float: none !important;
    width: auto !important;
    text-align: left !important;
    padding-top: 0 !important;
    margin-top: 8px !important;
    color: var(--accent-primary) !important;
    cursor: pointer !important;
    display: inline-block;
}

/* --- AA Options: Speech Keywords tab dark mode ---
   The Speech Keywords tab (#options-keywords-content) uses Bootstrap 2 accordion
   components with hardcoded white backgrounds and inline light-mode colors.
   These overrides theme the accordion, keyword chips, inputs, and keypad buttons. */
body.theme-dark #options-keywords-content {
    color: var(--text-primary) !important;
}
body.theme-dark #options-keywords-content .accordion-group {
    background-color: var(--surface-secondary-bg) !important;
    border-color: var(--border-color) !important;
}
body.theme-dark #options-keywords-content .keyword-row:hover {
    background: var(--surface-primary-bg) !important;
}
body.theme-dark #options-keywords-content .keypadBtn {
    background-color: var(--accent-primary) !important;
    color: #fff !important;
}
body.theme-dark #options-keywords-content .btnType {
    color: var(--text-secondary) !important;
}
body.theme-dark #options-keywords-content .accordion-body {
    background-color: var(--surface-secondary-bg) !important;
}
body.theme-dark #options-keywords-content .accordion-body input[type="text"] {
    background-color: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}
body.theme-dark #options-keywords-content .keywordChip {
    color: var(--text-primary) !important;
}
body.theme-dark #options-keywords-content .accordion-toggle {
    color: var(--text-primary) !important;
}

/* --- Brad Fix #6: SNAPbuilder Device Profiles modal dark mode ---
   No dedicated CSS rules existed for the SNAPbuilder profile-select modal.
   It loads via AJAX into a generic .modal container, and its elements
   (#phone-model-select, .compound-select, etc.) inherit default light styles. */
body.theme-dark .modal #phone-model-select,
body.theme-dark .modal #brand-select {
    background-color: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--g4-radius-sm) !important;
}
body.theme-dark .modal #phone-model-select optgroup,
body.theme-dark .modal #brand-select optgroup {
    background-color: var(--surface-secondary-bg) !important;
    color: var(--text-primary) !important;
}
body.theme-dark .modal #phone-model-select option,
body.theme-dark .modal #brand-select option {
    background-color: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
}
body.theme-dark .modal .compound-select-filter {
    background-color: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}
body.theme-dark .modal .compound-select {
    background-color: var(--surface-primary-bg) !important;
    border-color: var(--border-color) !important;
}
body.theme-dark .modal .compound-select-option {
    color: var(--text-primary) !important;
    border-bottom-color: var(--border-color) !important;
}
body.theme-dark .modal .compound-select-option:hover {
    background-color: var(--surface-secondary-bg) !important;
}
body.theme-dark .modal .compound-select-option-secondary-right,
body.theme-dark .modal .compound-select-option-secondary-left {
    color: var(--text-secondary) !important;
}
body.theme-dark .modal .left-panel {
    border-right-color: var(--border-color) !important;
}
body.theme-dark .modal .radio {
    color: var(--text-primary) !important;
}
body.theme-dark .modal #sidecar-model-input {
    background-color: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-color) !important;
}

#builder-profiles #edit-device-profile-form {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    column-gap: 0.5rem !important;
    row-gap: 0.5rem !important;
}

#builder-profiles #edit-device-profile-form > p,
#builder-profiles #edit-device-profile-form > .accordion-group,
#builder-profiles #edit-device-profile-form > input[type="hidden"] {
    grid-column: 1 / -1 !important;
}

#builder-profiles #edit-device-profile,
#builder-profiles #delete-profile {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    float: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

#builder-profiles #delete-profile,
#builder-profiles #delete-profile.btn-danger,
body.theme-light #builder-profiles #delete-profile,
body.theme-dark #builder-profiles #delete-profile {
    background: var(--g4-button-danger-bg) !important;
    border-color: var(--g4-button-danger-bg) !important;
    color: #fff !important;
}

body.page-builder .action-container-right {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex-wrap: nowrap !important;
}

body.page-builder .action-container-right > .dropdown,
body.page-builder .action-container-right > .btn,
body.page-builder .action-container-right > .btn-group {
    flex: 0 0 auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body.page-builder #templates-dropdown,
body.page-builder #directory-btn,
body.page-builder #config-dropdown,
body.page-builder #profile-dropdown {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 1.875rem !important;
    min-height: 1.875rem !important;
    box-sizing: border-box !important;
}

body.page-builder #templates-dropdown {
    justify-content: flex-start !important;
}

body.page-builder #config-dropdown,
body.page-builder #profile-dropdown {
    width: 1.875rem !important;
    min-width: 1.875rem !important;
    padding: 0 !important;
    right: 0 !important;
    text-align: center !important;
}

body.page-builder #config-dropdown .caret,
body.page-builder #profile-dropdown .caret {
    margin: 0 !important;
    position: static !important;
}

body.page-builder .config-kabob {
    right: -8px !important;
    top: 8px !important;
    width: 1.875rem !important;
    height: 1.875rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

body.page-builder .config-kabob .kabob {
    width: 100% !important;
    text-align: center !important;
    line-height: 1 !important;
}

/* The builder page-number menu should use simple show/hide instead of the
   global animated dropdown system; otherwise a hidden ghost Pages menu can sit
   on top of unrelated builder menus. */
body.page-builder #profile-right-panel .page-changer.dropdown-menu.form-actions,
body.page-builder #profile-right-panel .page-selector.dropdown-menu {
    display: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
    pointer-events: auto !important;
}

body.page-builder #profile-right-panel .btn-group.open > .page-changer.dropdown-menu.form-actions {
    display: none !important;
}

body.page-builder #profile-right-panel .btn-group:has(.kabob-dropdown li.dropdown.open) > .page-changer.dropdown-menu.form-actions,
body.page-builder #profile-right-panel .dropdown.open > .page-selector.dropdown-menu,
body.page-builder #profile-right-panel .btn-group.open > .page-selector.dropdown-menu {
    display: flex !important;
}

body.page-builder #profile-right-panel .btn-group.dropdown.pull-right > .btn:not(.dropdown-toggle),
body.page-builder #deviceImageContainerProfileMode .btn-group.dropdown.pull-right > .btn:not(.dropdown-toggle) {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

body.page-builder #profile-right-panel .btn-group.dropdown.pull-right > .btn.dropdown-toggle,
body.page-builder #deviceImageContainerProfileMode .btn-group.dropdown.pull-right > .btn.dropdown-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 1.875rem !important;
    min-width: 1.875rem !important;
    height: 1.875rem !important;
    min-height: 1.875rem !important;
    padding: 0 !important;
    margin-left: -1px !important;
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    box-sizing: border-box !important;
    font-size: 0 !important;
    line-height: 0 !important;
}

body.page-builder #profile-right-panel .btn-group.dropdown.pull-right > .btn.dropdown-toggle .caret,
body.page-builder #deviceImageContainerProfileMode .btn-group.dropdown.pull-right > .btn.dropdown-toggle .caret {
    display: block !important;
    margin: 0 !important;
    position: static !important;
}

body.theme-dark.page-builder #profile-right-panel .btn-id {
    background-color: #d7dee7 !important;
    color: #122030 !important;
}

body.theme-dark.page-builder #profile-right-panel .btn-config.active .btn-id,
body.theme-dark.page-builder #profile-right-panel .btn-config.selected .btn-id,
body.theme-dark.page-builder #profile-right-panel .btn-config.warn .btn-id,
body.theme-dark.page-builder #profile-right-panel .btn-config.danger .btn-id {
    color: #fff !important;
}

body.page-musiconhold .action-container-left form.form-search select {
    height: 30px !important;
    min-height: 30px !important;
    box-sizing: border-box !important;
    vertical-align: middle !important;
}

body.page-musiconhold #hide-system-checkbox .pagination,
body.page-musiconhold .action-container-left .action-container-right .pagination {
    margin: 0 !important;
}

body.page-musiconhold #hide-system-checkbox .pagination ul,
body.page-musiconhold #hide-system-checkbox .pagination li,
body.page-musiconhold #hide-system-checkbox .pagination li > a,
body.page-musiconhold .action-container-left .action-container-right .pagination ul,
body.page-musiconhold .action-container-left .action-container-right .pagination li,
body.page-musiconhold .action-container-left .action-container-right .pagination li > a {
    display: flex !important;
    align-items: center !important;
    height: 30px !important;
    min-height: 30px !important;
    box-sizing: border-box !important;
}

body.page-musiconhold #hide-system-checkbox .pagination li > a,
body.page-musiconhold .action-container-left .action-container-right .pagination li > a {
    padding: 0 0.75rem !important;
}

body.page-musiconhold #hide-system-checkbox label.checkbox,
body.page-musiconhold .action-container-left .action-container-right label.checkbox {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    height: 100% !important;
    margin: 0 !important;
    white-space: nowrap !important;
}

body.page-musiconhold #hide-system-checkbox label.checkbox span,
body.page-musiconhold .action-container-left .action-container-right label.checkbox span {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    background: transparent !important;
    border-radius: 0 !important;
}
/* SNAPbuilder Add button — fix left offset and alignment with dropdowns */
#builder-profiles .right-panel #add-profile.btn-long {
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
    margin-top: 10px !important;
}

/* --- Brad Fix #7: Timeframes days of week field alignment ---
   The template uses .controls-group (with 's') — a custom class distinct from
   Bootstrap's .control-group. The vendor toggles several rows with inline
   display: none, so only force flex layout on rows that are already visible. */
.page-timeframes .modal .controls-group[style*="display: none"] {
    display: none !important;
}
.page-timeframes .modal .controls-group.pt20:not([style*="display: none"]) {
    display: flex !important;
    align-items: center !important;
    margin-bottom: 10px !important;
    gap: 8px !important;
}
.page-timeframes .modal .controls-group.pt20 > .control-label {
    width: 120px !important;
    min-width: 120px !important;
    text-align: right !important;
    padding-right: 10px !important;
    flex-shrink: 0 !important;
}
.page-timeframes .modal .flex-container-day-of-the-week {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex: 1 !important;
}
.page-timeframes .modal .flex-container-day-of-the-week .pl20 {
    padding-left: 0 !important;
}

/* --- Brad Fix #9: Observed Holidays workweek selection not visibly selected ---
   Vendor logic already toggles .selected on the labels, but our broader modal
   label reset washes out the chip treatment. Reapply an explicit pill style. */
body.page-timeframes .modal.g4-themed .workweek-selector {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
}

body.page-timeframes .modal.g4-themed .workweek-selector .workweek-day-label {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 2rem !important;
    height: 2rem !important;
    margin-right: 0 !important;
    border-radius: 999px !important;
    border: 1px solid rgba(148, 163, 184, 0.55) !important;
    background: #f8fafc !important;
    color: #475569 !important;
    font-weight: 600 !important;
    transition: background-color var(--g4-transition-fast), color var(--g4-transition-fast), border-color var(--g4-transition-fast) !important;
}

body.theme-dark.page-timeframes .modal.g4-themed .workweek-selector .workweek-day-label {
    background: rgba(255, 255, 255, 0.06) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    color: var(--text-primary) !important;
}

body.page-timeframes .modal.g4-themed .workweek-selector .workweek-day-label.selected,
body.page-timeframes .modal.g4-themed .workweek-selector input[type="checkbox"]:checked + .workweek-day-label {
    background: var(--accent-primary) !important;
    border-color: var(--accent-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 0 0 1px rgba(var(--accent-primary-rgb), 0.16) !important;
}

/* Keep observed-holiday weekday chips and selects on the same height contract. */
body.page-timeframes #write-timeframe .workweek-observe-day-options .input-prepend {
    display: flex !important;
    align-items: stretch !important;
}

body.page-timeframes #write-timeframe .workweek-observe-day-options .input-prepend .add-on,
body.page-timeframes #write-timeframe .workweek-observe-day-options .input-prepend .holiday-is-on-day-selector {
    height: 32px !important;
    min-height: 32px !important;
    box-sizing: border-box !important;
}

body.page-timeframes #write-timeframe .workweek-observe-day-options .input-prepend .add-on {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 3rem !important;
    min-width: 3rem !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1.2 !important;
    padding-left: 0.4rem !important;
    padding-right: 0.4rem !important;
}

body.page-timeframes #write-timeframe .workweek-observe-day-options .input-prepend .input.select {
    display: flex !important;
    flex: 0 1 18.5rem !important;
    width: 18.5rem !important;
    min-width: 18.5rem !important;
    max-width: 18.5rem !important;
}

body.page-timeframes #write-timeframe .workweek-observe-day-options .input-prepend .holiday-is-on-day-selector {
    width: 18.5rem !important;
    min-width: 18.5rem !important;
    max-width: 18.5rem !important;
    line-height: 1.35 !important;
    padding-top: 0.2rem !important;
    padding-bottom: 0.2rem !important;
}

body.page-timeframes #write-timeframe #recurrence-specific-dates {
    width: 22rem !important;
    min-width: 22rem !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Dark-mode custom timeframes: the view carries a full dark shell, but the
   accordion headings still inherit the vendor light section bars. */
#grid4-app-shell.theme-dark .custom-timeframe-panel {
    background: rgba(9, 16, 26, 0.72) !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
}

#grid4-app-shell.theme-dark .custom-timeframe-panel-title {
    background: rgba(15, 23, 36, 0.96) !important;
    color: rgb(237, 242, 248) !important;
}

#grid4-app-shell.theme-dark .custom-timeframe-panel-title a,
#grid4-app-shell.theme-dark .custom-timeframe-panel-title span {
    color: inherit !important;
}

#grid4-app-shell.theme-dark .divider-line {
    border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

/* Keep the custom timeframe accordion bodies on the active dark surface. */
#grid4-app-shell.theme-dark .custom-timeframes-panel-body {
    background: var(--surface-primary-bg) !important;
    color: var(--text-primary) !important;
}

/* Timeframe edit modal: prevent bottom cutoff on tall content (e.g. Days of Week
   with all 7 days). Bootstrap 2 centres modals with top: 50%; margin-top: -250px
   and JS also applies a dynamic negative margin-top. Our top: 5% requires
   margin-top: 0 to prevent the modal from being pushed above the viewport. */
#write-timeframe.modal {
    top: 5% !important;
    margin-top: 0 !important;
    max-height: 90vh !important;
}
#write-timeframe.modal .modal-body {
    max-height: calc(90vh - 140px) !important;
    overflow-y: auto !important;
}

/* --- Brad Fix #8: AA language dropdown not opening ---
   Root cause: The global animated-dropdown CSS (line 2839) sets ALL .dropdown-menu
   to display: block !important with visibility: hidden & pointer-events: none.
   This creates a phantom element in the DOM that interferes with click targeting
   on the language dropdown toggle — making it finicky (only parts clickable).
   Fix: Opt the language dropdown OUT of the animation system entirely.
   Use simple display: none/block toggling so no ghost element exists when closed. */

/* Part A: Disable animated dropdown — use simple show/hide.
   The outer <span class="btn"> has padding that creates dead zones where clicks
   don't reach the inner <a data-toggle="dropdown">. Negative margins on the <a>
   extend it into the parent's padding so the entire button area is clickable. */
body.page-autoattendants .attendant-creation .language-dropdown {
    position: relative !important;
    overflow: visible !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--g4-button-primary-bg) !important;
    border: 1px solid var(--g4-button-primary-border) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}
/* Disable .btn ripple effect on language dropdown — the ripple ::before/::after
   pseudo-elements grow to 300x300px on :active but overflow: visible lets them
   escape the button, creating a visible gray box that grows while holding click */
body.page-autoattendants .attendant-creation .language-dropdown::before,
body.page-autoattendants .attendant-creation .language-dropdown::after {
    display: none !important;
}
body.page-autoattendants .attendant-creation .language-dropdown .dropdown-toggle {
    display: block !important;
    margin: -4px -12px !important;
    padding: 4px 12px !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
}
body.page-autoattendants #grid4-app-shell .attendant-creation .language-dropdown:hover,
body.page-autoattendants #grid4-app-shell .attendant-creation .language-dropdown:focus-within,
body.page-autoattendants #grid4-app-shell .attendant-creation .language-dropdown.open {
    background: var(--accent-secondary) !important;
    border-color: var(--accent-secondary) !important;
    color: #ffffff !important;
}
body.page-autoattendants .attendant-creation .language-dropdown .dropdown-menu {
    display: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    transition: none !important;
    pointer-events: auto !important;
    z-index: 1050 !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    min-width: max-content !important;
    border-radius: var(--g4-radius-md) !important;
}
body.page-autoattendants .attendant-creation .language-dropdown.open .dropdown-menu {
    display: block !important;
}

/* Part B: Theme-aware styling for the AA editor language dropdown only */
#grid4-app-shell.theme-light .attendant-creation .language-dropdown .dropdown-toggle,
#grid4-app-shell.theme-light .attendant-creation .language-dropdown .dropdown-toggle > span,
#grid4-app-shell.theme-light .attendant-creation .language-dropdown .dropdown-toggle > i.nsicon {
    color: #ffffff !important;
    -webkit-text-fill-color: currentColor !important;
}
#grid4-app-shell.theme-light .attendant-creation .language-dropdown .caret {
    border-top-color: #ffffff !important;
    border-bottom-color: #ffffff !important;
}
#grid4-app-shell.theme-light .attendant-creation .language-dropdown .dropdown-menu {
    background: #ffffff !important;
    border: 1px solid rgba(15, 23, 42, 0.12) !important;
    box-shadow: 0 0.75rem 1.5rem rgba(15, 23, 42, 0.14) !important;
}
#grid4-app-shell.theme-light .attendant-creation .language-dropdown .dropdown-menu li > a {
    color: #1f2937 !important;
}
#grid4-app-shell.theme-light .attendant-creation .language-dropdown .dropdown-menu li > a:hover,
#grid4-app-shell.theme-light .attendant-creation .language-dropdown .dropdown-menu li > a:focus {
    background: rgba(82, 180, 250, 0.12) !important;
    color: #0f172a !important;
}
#grid4-app-shell.theme-light .attendant-creation .language-dropdown .dropdown-menu li.selected > a {
    background: rgba(82, 180, 250, 0.16) !important;
    color: #0f172a !important;
    font-weight: 600 !important;
}
#grid4-app-shell.theme-dark .attendant-creation .language-dropdown .dropdown-toggle,
#grid4-app-shell.theme-dark .attendant-creation .language-dropdown .dropdown-toggle > span,
#grid4-app-shell.theme-dark .attendant-creation .language-dropdown .dropdown-toggle > i.nsicon {
    color: #ffffff !important;
    -webkit-text-fill-color: currentColor !important;
}
#grid4-app-shell.theme-dark .attendant-creation .language-dropdown .caret {
    border-top-color: #ffffff !important;
    border-bottom-color: #ffffff !important;
}
#grid4-app-shell.theme-dark .attendant-creation .language-dropdown .dropdown-menu {
    background: var(--surface-primary-bg) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.35) !important;
}
#grid4-app-shell.theme-dark .attendant-creation .language-dropdown .dropdown-menu li > a {
    color: var(--text-primary) !important;
}
#grid4-app-shell.theme-dark .attendant-creation .language-dropdown .dropdown-menu li > a:hover,
#grid4-app-shell.theme-dark .attendant-creation .language-dropdown .dropdown-menu li > a:focus {
    background: var(--accent-primary) !important;
    color: #fff !important;
}
#grid4-app-shell.theme-dark .attendant-creation .language-dropdown .dropdown-menu li.selected > a {
    background: rgba(var(--accent-primary-rgb), 0.16) !important;
    color: var(--text-primary) !important;
    font-weight: 600 !important;
}

body.page-autoattendants #grid4-app-shell .attendant-creation .tier-options-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: var(--g4-button-primary-bg) !important;
    border: 1px solid var(--g4-button-primary-border) !important;
    color: #ffffff !important;
    box-shadow: none !important;
}

body.page-autoattendants #grid4-app-shell .attendant-creation .tier-options-btn:hover,
body.page-autoattendants #grid4-app-shell .attendant-creation .tier-options-btn:focus {
    background: var(--accent-secondary) !important;
    border-color: var(--accent-secondary) !important;
    color: #ffffff !important;
}

body.page-autoattendants #grid4-app-shell .attendant-creation .tier-options-btn .glyphicon-small-cogwheel {
    filter: brightness(0) invert(1) !important;
    opacity: 1 !important;
}

/* ===================================
   FINAL POLISH: FLAT BUTTON SYSTEM + MODAL SURFACE GUARDS
   =================================== */

:root {
  --g4-scrollbar-track: rgba(148, 163, 184, 0.18);
  --g4-scrollbar-thumb: rgba(100, 116, 139, 0.46);
  --g4-scrollbar-thumb-hover: rgba(71, 85, 105, 0.6);
}

html,
body,
#grid4-app-shell *,
.modal .modal-body,
.modal .modal-body .modal-body-flex-container,
.dock-column.dock-contacts .scroll-container,
.dock-column.uc-message-box-column .chat-messages,
.dock-column.uc-message-box-column .chat-messages-container,
#conversation-new .chat-messages,
#conversation-new .chat-messages-container,
#grid4-app-shell .contacts-panel-main #group-dropdown > .dropdown-submenu > .dropdown-menu {
  scrollbar-width: thin;
  scrollbar-color: var(--g4-scrollbar-thumb) var(--g4-scrollbar-track);
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
#grid4-app-shell *::-webkit-scrollbar,
.modal .modal-body::-webkit-scrollbar,
.modal .modal-body .modal-body-flex-container::-webkit-scrollbar,
.dock-column.dock-contacts .scroll-container::-webkit-scrollbar,
.dock-column.uc-message-box-column .chat-messages::-webkit-scrollbar,
.dock-column.uc-message-box-column .chat-messages-container::-webkit-scrollbar,
#conversation-new .chat-messages::-webkit-scrollbar,
#conversation-new .chat-messages-container::-webkit-scrollbar,
#grid4-app-shell .contacts-panel-main #group-dropdown > .dropdown-submenu > .dropdown-menu::-webkit-scrollbar {
  width: 0.5rem !important;
  height: 0.5rem !important;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
#grid4-app-shell *::-webkit-scrollbar-track,
.modal .modal-body::-webkit-scrollbar-track,
.modal .modal-body .modal-body-flex-container::-webkit-scrollbar-track,
.dock-column.dock-contacts .scroll-container::-webkit-scrollbar-track,
.dock-column.uc-message-box-column .chat-messages::-webkit-scrollbar-track,
.dock-column.uc-message-box-column .chat-messages-container::-webkit-scrollbar-track,
#conversation-new .chat-messages::-webkit-scrollbar-track,
#conversation-new .chat-messages-container::-webkit-scrollbar-track,
#grid4-app-shell .contacts-panel-main #group-dropdown > .dropdown-submenu > .dropdown-menu::-webkit-scrollbar-track {
  background: var(--g4-scrollbar-track) !important;
  border-radius: 999px !important;
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
#grid4-app-shell *::-webkit-scrollbar-thumb,
.modal .modal-body::-webkit-scrollbar-thumb,
.modal .modal-body .modal-body-flex-container::-webkit-scrollbar-thumb,
.dock-column.dock-contacts .scroll-container::-webkit-scrollbar-thumb,
.dock-column.uc-message-box-column .chat-messages::-webkit-scrollbar-thumb,
.dock-column.uc-message-box-column .chat-messages-container::-webkit-scrollbar-thumb,
#conversation-new .chat-messages::-webkit-scrollbar-thumb,
#conversation-new .chat-messages-container::-webkit-scrollbar-thumb,
#grid4-app-shell .contacts-panel-main #group-dropdown > .dropdown-submenu > .dropdown-menu::-webkit-scrollbar-thumb {
  background: var(--g4-scrollbar-thumb) !important;
  border-radius: 999px;
  border: 1px solid transparent !important;
  background-clip: padding-box;
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
#grid4-app-shell *::-webkit-scrollbar-thumb:hover,
.modal .modal-body::-webkit-scrollbar-thumb:hover,
.modal .modal-body .modal-body-flex-container::-webkit-scrollbar-thumb:hover,
.dock-column.dock-contacts .scroll-container::-webkit-scrollbar-thumb:hover,
.dock-column.uc-message-box-column .chat-messages::-webkit-scrollbar-thumb:hover,
.dock-column.uc-message-box-column .chat-messages-container::-webkit-scrollbar-thumb:hover,
#conversation-new .chat-messages::-webkit-scrollbar-thumb:hover,
#conversation-new .chat-messages-container::-webkit-scrollbar-thumb:hover,
#grid4-app-shell .contacts-panel-main #group-dropdown > .dropdown-submenu > .dropdown-menu::-webkit-scrollbar-thumb:hover {
  background: var(--g4-scrollbar-thumb-hover) !important;
}

body.theme-light .dock-contacts div.contact-dock-gravatar.gravatar-img-contact {
  background: rgba(var(--accent-primary-rgb), 0.12) !important;
  border: 1px solid rgba(var(--g4-brand-navy-rgb), 0.12) !important;
  box-shadow: none !important;
}

body.theme-dark .dock-contacts div.contact-dock-gravatar.gravatar-img-contact {
  background: rgba(var(--accent-primary-rgb), 0.2) !important;
  border: 1px solid rgba(var(--accent-primary-rgb), 0.28) !important;
  box-shadow: none !important;
}

#grid4-app-shell .btn,
#grid4-app-shell button:not(.round-button):not(.add):not(.del),
#grid4-app-shell input[type="button"],
#grid4-app-shell input[type="submit"],
html:not([data-grid4-skin="off"]) body .modal .btn,
html:not([data-grid4-skin="off"]) body .modal button:not(.round-button):not(.add):not(.del),
html:not([data-grid4-skin="off"]) body .dock-column .btn,
html:not([data-grid4-skin="off"]) body .dock-column button:not(.round-button):not(.add):not(.del),
.fixed-container > #domain-message .btn,
.fixed-container > .mask-bar .btn {
  background-image: none !important;
  text-shadow: none !important;
  box-shadow: 0 0.3rem 0.8rem rgba(0, 0, 0, 0.1) !important;
  border-radius: 0.375rem !important;
  font-family: var(--g4-font-family-heading) !important;
  font-weight: 600 !important;
  transition: background-color var(--g4-transition-fast), border-color var(--g4-transition-fast), color var(--g4-transition-fast), box-shadow var(--g4-transition-fast), transform var(--g4-transition-fast) !important;
}

/* Preserve vendor sprite buttons such as the user-portal Call Center
   login/logout controls. They are empty <button.round-button> elements whose
   icon only exists via the original background sprite. */
#grid4-app-shell button.round-button,
#grid4-app-shell button.add,
#grid4-app-shell button.del,
html:not([data-grid4-skin="off"]) body .modal button.round-button,
html:not([data-grid4-skin="off"]) body .modal button.add,
html:not([data-grid4-skin="off"]) body .modal button.del,
html:not([data-grid4-skin="off"]) body .dock-column button.round-button,
html:not([data-grid4-skin="off"]) body .dock-column button.add,
html:not([data-grid4-skin="off"]) body .dock-column button.del {
  background-repeat: no-repeat !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin-right: 0 !important;
  width: 20px !important;
  height: 20px !important;
  padding: 0 !important;
  font-family: inherit !important;
  font-weight: 400 !important;
  font-size: 0 !important;
  line-height: 0 !important;
  text-shadow: none !important;
  vertical-align: middle !important;
}

#grid4-app-shell .btn-default,
#grid4-app-shell .btn-secondary,
#grid4-app-shell .btn.cancel,
#grid4-app-shell .back-btn,
html:not([data-grid4-skin="off"]) body .modal .btn-default,
html:not([data-grid4-skin="off"]) body .modal .btn-secondary,
html:not([data-grid4-skin="off"]) body .modal .btn.cancel,
html:not([data-grid4-skin="off"]) body .dock-column .btn-default,
html:not([data-grid4-skin="off"]) body .dock-column .btn-secondary,
html:not([data-grid4-skin="off"]) body .dock-column .btn.cancel {
  background: var(--g4-button-surface) !important;
  border: 1px solid var(--g4-button-surface-border) !important;
  color: var(--text-primary) !important;
}

#grid4-app-shell .btn-default:hover,
#grid4-app-shell .btn-default:focus,
#grid4-app-shell .btn-secondary:hover,
#grid4-app-shell .btn-secondary:focus,
#grid4-app-shell .btn.cancel:hover,
#grid4-app-shell .btn.cancel:focus,
#grid4-app-shell .back-btn:hover,
#grid4-app-shell .back-btn:focus,
html:not([data-grid4-skin="off"]) body .modal .btn-default:hover,
html:not([data-grid4-skin="off"]) body .modal .btn-default:focus,
html:not([data-grid4-skin="off"]) body .modal .btn-secondary:hover,
html:not([data-grid4-skin="off"]) body .modal .btn-secondary:focus,
html:not([data-grid4-skin="off"]) body .modal .btn.cancel:hover,
html:not([data-grid4-skin="off"]) body .modal .btn.cancel:focus,
html:not([data-grid4-skin="off"]) body .dock-column .btn-default:hover,
html:not([data-grid4-skin="off"]) body .dock-column .btn-default:focus,
html:not([data-grid4-skin="off"]) body .dock-column .btn-secondary:hover,
html:not([data-grid4-skin="off"]) body .dock-column .btn-secondary:focus,
html:not([data-grid4-skin="off"]) body .dock-column .btn.cancel:hover,
html:not([data-grid4-skin="off"]) body .dock-column .btn.cancel:focus {
  background: var(--g4-button-surface-hover) !important;
  border-color: var(--g4-button-primary-border) !important;
  color: var(--text-primary) !important;
  background-image: none !important;
}

#grid4-app-shell .btn-primary,
#grid4-app-shell .btn-info,
#grid4-app-shell .btn-success,
#grid4-app-shell .color-primary,
html:not([data-grid4-skin="off"]) body .modal .btn-primary,
html:not([data-grid4-skin="off"]) body .modal .btn-info,
html:not([data-grid4-skin="off"]) body .modal .btn-success,
html:not([data-grid4-skin="off"]) body .modal .color-primary,
html:not([data-grid4-skin="off"]) body .dock-column .btn-primary,
html:not([data-grid4-skin="off"]) body .dock-column .btn-info,
html:not([data-grid4-skin="off"]) body .dock-column .btn-success {
  background: var(--g4-button-primary-bg) !important;
  border: 1px solid var(--g4-button-primary-border) !important;
  color: #ffffff !important;
}

#grid4-app-shell .btn-primary:hover,
#grid4-app-shell .btn-primary:focus,
#grid4-app-shell .btn-info:hover,
#grid4-app-shell .btn-info:focus,
#grid4-app-shell .btn-success:hover,
#grid4-app-shell .btn-success:focus,
#grid4-app-shell .color-primary:hover,
#grid4-app-shell .color-primary:focus,
html:not([data-grid4-skin="off"]) body .modal .btn-primary:hover,
html:not([data-grid4-skin="off"]) body .modal .btn-primary:focus,
html:not([data-grid4-skin="off"]) body .modal .btn-info:hover,
html:not([data-grid4-skin="off"]) body .modal .btn-info:focus,
html:not([data-grid4-skin="off"]) body .modal .btn-success:hover,
html:not([data-grid4-skin="off"]) body .modal .btn-success:focus,
html:not([data-grid4-skin="off"]) body .modal .color-primary:hover,
html:not([data-grid4-skin="off"]) body .modal .color-primary:focus,
html:not([data-grid4-skin="off"]) body .dock-column .btn-primary:hover,
html:not([data-grid4-skin="off"]) body .dock-column .btn-primary:focus,
html:not([data-grid4-skin="off"]) body .dock-column .btn-info:hover,
html:not([data-grid4-skin="off"]) body .dock-column .btn-info:focus,
html:not([data-grid4-skin="off"]) body .dock-column .btn-success:hover,
html:not([data-grid4-skin="off"]) body .dock-column .btn-success:focus {
  background: var(--g4-button-primary-hover-bg) !important;
  border-color: var(--g4-button-primary-hover-bg) !important;
  color: #ffffff !important;
  background-image: none !important;
}

#grid4-app-shell .btn-danger,
#grid4-app-shell button#ButtonResetUser.btn.helpsy,
#grid4-app-shell a#bulkDeleteBtn.btn.btn-danger,
html:not([data-grid4-skin="off"]) body .modal .btn-danger,
html:not([data-grid4-skin="off"]) body .dock-column .btn-danger {
  background: var(--g4-button-danger-bg) !important;
  border: 1px solid var(--g4-button-danger-border) !important;
  color: #ffffff !important;
}

#grid4-app-shell .btn-danger:hover,
#grid4-app-shell .btn-danger:focus,
#grid4-app-shell button#ButtonResetUser.btn.helpsy:hover,
#grid4-app-shell button#ButtonResetUser.btn.helpsy:focus,
#grid4-app-shell a#bulkDeleteBtn.btn.btn-danger:hover,
#grid4-app-shell a#bulkDeleteBtn.btn.btn-danger:focus,
html:not([data-grid4-skin="off"]) body .modal .btn-danger:hover,
html:not([data-grid4-skin="off"]) body .modal .btn-danger:focus,
html:not([data-grid4-skin="off"]) body .dock-column .btn-danger:hover,
html:not([data-grid4-skin="off"]) body .dock-column .btn-danger:focus {
  background: var(--g4-button-danger-hover-bg) !important;
  border-color: var(--g4-button-danger-hover-bg) !important;
  color: #ffffff !important;
}

#grid4-app-shell .btn-warning,
html:not([data-grid4-skin="off"]) body .modal .btn-warning,
html:not([data-grid4-skin="off"]) body .dock-column .btn-warning {
  background: #f4b449 !important;
  border: 1px solid #df9e29 !important;
  color: #1f2937 !important;
}

#grid4-app-shell .btn-warning:hover,
#grid4-app-shell .btn-warning:focus,
html:not([data-grid4-skin="off"]) body .modal .btn-warning:hover,
html:not([data-grid4-skin="off"]) body .modal .btn-warning:focus,
html:not([data-grid4-skin="off"]) body .dock-column .btn-warning:hover,
html:not([data-grid4-skin="off"]) body .dock-column .btn-warning:focus {
  background: #f7c05c !important;
  border-color: #e6ac38 !important;
  color: #1f2937 !important;
}

#grid4-app-shell .btn-link,
html:not([data-grid4-skin="off"]) body .modal .btn-link,
html:not([data-grid4-skin="off"]) body .dock-column .btn-link {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: var(--accent-primary) !important;
}

#grid4-app-shell .btn .fa,
#grid4-app-shell .btn .iconfont,
#grid4-app-shell .btn .nsicon,
#grid4-app-shell .btn svg,
html:not([data-grid4-skin="off"]) body .modal .btn .fa,
html:not([data-grid4-skin="off"]) body .modal .btn .iconfont,
html:not([data-grid4-skin="off"]) body .modal .btn .nsicon,
html:not([data-grid4-skin="off"]) body .modal .btn svg,
html:not([data-grid4-skin="off"]) body .dock-column .btn .fa,
html:not([data-grid4-skin="off"]) body .dock-column .btn .iconfont,
html:not([data-grid4-skin="off"]) body .dock-column .btn .nsicon,
html:not([data-grid4-skin="off"]) body .dock-column .btn svg {
  color: inherit !important;
  fill: currentColor !important;
  text-shadow: none !important;
  opacity: 1 !important;
  -webkit-text-fill-color: currentColor !important;
}

html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body,
html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body > div:not(.control-group):not(.controls-group),
html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body .tab-content,
html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body .tab-pane,
html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body .modal-body-flex-container,
html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body .table-responsive,
html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body [style*="background-color: rgb(255, 255, 255)"],
html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body [style*="background-color:#fff"],
html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body [style*="background: white"],
html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body [style*="background:#fff"] {
  background-color: var(--modal-bg) !important;
  color: var(--modal-text) !important;
  border-color: var(--modal-border) !important;
  opacity: 1 !important;
}

html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body .well,
html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body .panel,
html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body .panel-body,
html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body .accordion-group,
html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body .accordion-inner,
html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body .form-actions {
  background-color: rgba(255, 255, 255, 0.03) !important;
  color: var(--modal-text) !important;
  border-color: var(--modal-border) !important;
}

html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body .table,
html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body .table td,
html:not([data-grid4-skin="off"]) body.theme-dark .modal.g4-themed .modal-body .table th {
  background-color: var(--modal-bg) !important;
  color: var(--modal-text) !important;
  border-color: var(--modal-border) !important;
}

html:not([data-grid4-skin="off"]) body.theme-light .modal.g4-themed .modal-body .well,
html:not([data-grid4-skin="off"]) body.theme-light .modal.g4-themed .modal-body .panel,
html:not([data-grid4-skin="off"]) body.theme-light .modal.g4-themed .modal-body .panel-body,
html:not([data-grid4-skin="off"]) body.theme-light .modal.g4-themed .modal-body .accordion-group,
html:not([data-grid4-skin="off"]) body.theme-light .modal.g4-themed .modal-body .accordion-inner,
html:not([data-grid4-skin="off"]) body.theme-light .modal.g4-themed .modal-body .form-actions {
  background-color: var(--surface-secondary-bg) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

/* Shared legacy modal fix: keep Bootstrap 2 horizontal-form row wrappers
   transparent so the row lane itself does not read like a faux input surface. */
html:not([data-grid4-skin="off"]) body .modal.g4-themed .form-horizontal .control-group,
html:not([data-grid4-skin="off"]) body .modal.g4-themed .form-horizontal .control-group > .controls {
  background: none !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

body.theme-dark .bootstrap-switch-container {
  background-color: var(--surface-primary-bg) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

body.theme-dark span.bootstrap-switch-handle-off.bootstrap-switch-default {
  color: red !important;
  font-weight: 700 !important;
}

body.theme-dark .bootstrap-switch {
  background: var(--surface-secondary-bg) !important;
  border-color: var(--border-color) !important;
  box-shadow: none !important;
  background-image: none !important;
  filter: none !important;
}

body.theme-dark .bootstrap-switch .bootstrap-switch-container {
  background-color: var(--surface-secondary-bg) !important;
  background-image: none !important;
}

body.theme-dark .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,
body.theme-dark .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success {
  background: rgba(var(--accent-primary-rgb), 0.86) !important;
  background-image: none !important;
  color: #eef3fa !important;
  border-color: rgba(var(--accent-primary-rgb), 0.62) !important;
  box-shadow: none !important;
}

body.theme-dark .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default {
  background: rgba(255, 255, 255, 0.06) !important;
  background-image: none !important;
  color: red !important;
  font-weight: 700 !important;
  border-color: var(--border-color) !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

body.theme-dark .bootstrap-switch .bootstrap-switch-label {
  background: rgba(255, 255, 255, 0.06) !important;
  background-image: none !important;
  color: var(--text-secondary) !important;
  border-color: var(--border-color) !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

body.theme-dark .modal .bootstrap-switch .bootstrap-switch-label,
body.theme-dark .ui-dialog .bootstrap-switch .bootstrap-switch-label {
  background: rgba(11, 15, 20, 0.96) !important;
  color: var(--text-secondary) !important;
  border-left: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.theme-dark .modal .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default,
body.theme-dark .ui-dialog .bootstrap-switch .bootstrap-switch-handle-off.bootstrap-switch-default {
  background: rgba(255, 255, 255, 0.05) !important;
  color: red !important;
  font-weight: 700 !important;
}

body.page-inventory .modal[id^="import-"] .modal-footer > a.btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  height: 29.25px !important;
  min-height: 29.25px !important;
  line-height: 17.5px !important;
  vertical-align: middle !important;
}

body.page-callhistory #allowblock-lists.modal .modal-footer > a.btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  height: 29.25px !important;
  min-height: 29.25px !important;
  line-height: 17.5px !important;
  vertical-align: middle !important;
}

/* Late follow-up for the user-portal Allow / Block flow:
   the standalone route renders the modal body/footer directly under #content
   instead of inside #allowblock-lists.modal, so repeat the cleanup here after
   the broader modal/button systems have finished. */
body.page-answerrules #content > .modal-body .allowblock-table,
body.page-answerrules #allowblock-lists.modal .allowblock-table {
  min-height: 180px !important;
  max-height: 180px !important;
  overflow-y: auto !important;
}

body.page-answerrules #content > .modal-body .well,
body.page-answerrules #allowblock-lists.modal .well {
  background-color: var(--surface-primary-bg) !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.page-answerrules #content > .modal-body .allowblock-anon,
body.page-answerrules #allowblock-lists.modal .allowblock-anon {
  background-color: var(--surface-secondary-bg) !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.page-answerrules #content > .modal-body .allowblock-table td:last-child,
body.page-answerrules #allowblock-lists.modal .allowblock-table td:last-child {
  width: 2.5rem !important;
  text-align: center !important;
}

body.page-answerrules #content > .modal-body .allowblock-table a.helpsy,
body.page-answerrules #allowblock-lists.modal .allowblock-table a.helpsy {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  text-decoration: none !important;
  opacity: 1 !important;
}

body.page-answerrules #content > .modal-body .allowblock-table a.helpsy:hover,
body.page-answerrules #content > .modal-body .allowblock-table a.helpsy:focus,
body.page-answerrules #allowblock-lists.modal .allowblock-table a.helpsy:hover,
body.page-answerrules #allowblock-lists.modal .allowblock-table a.helpsy:focus {
  background: transparent !important;
  border-color: transparent !important;
}

body.page-answerrules #content > .modal-body .allowblock-table a.helpsy i.icon-remove,
body.page-answerrules #allowblock-lists.modal .allowblock-table a.helpsy i.icon-remove {
  color: #d14b5a !important;
  filter: none !important;
  opacity: 1 !important;
  margin: 0 !important;
  text-shadow: none !important;
}

/* Inventory add/edit legacy forms mix 211px, 220px, and 250px control widths
   within the same field lane. Normalize the primary text/select/textarea
   controls to one width without touching checkboxes, radios, or switches. */
body.page-inventory form[action*="/portal/inventory/add/phonenumber"] .control-group .controls input[type="text"],
body.page-inventory form[action*="/portal/inventory/edit/phonenumber"] .control-group .controls input[type="text"],
body.page-inventory form[action*="/portal/inventory/add/phonenumber"] .control-group .controls select,
body.page-inventory form[action*="/portal/inventory/edit/phonenumber"] .control-group .controls select,
body.page-inventory form[action*="/portal/inventory/add/smsnumber"] .control-group .controls input[type="text"],
body.page-inventory form[action*="/portal/inventory/edit/smsnumber"] .control-group .controls input[type="text"],
body.page-inventory form[action*="/portal/inventory/add/smsnumber"] .control-group .controls select,
body.page-inventory form[action*="/portal/inventory/edit/smsnumber"] .control-group .controls select,
body.page-inventory #add-phone-form .control-group .controls input[type="text"],
body.page-inventory form[action*="/portal/inventory/edit/phone"] .control-group .controls input[type="text"],
body.page-inventory #add-phone-form .control-group .controls select,
body.page-inventory form[action*="/portal/inventory/edit/phone"] .control-group .controls select {
  box-sizing: border-box !important;
  width: 250px !important;
  min-width: 250px !important;
  max-width: 250px !important;
}

/* Inventory edit forms do not consistently keep the legacy Bootstrap .controls
   wrapper around the primary field lane, so mirror the same width contract one
   level up for edit routes only. */
body.page-inventory form[action*="/portal/inventory/edit/phonenumber"] .control-group input[type="text"],
body.page-inventory form[action*="/portal/inventory/edit/phonenumber"] .control-group select,
body.page-inventory form[action*="/portal/inventory/edit/phonenumber"] .control-group textarea:not(#notes),
body.page-inventory form[action*="/portal/inventory/edit/smsnumber"] .control-group input[type="text"],
body.page-inventory form[action*="/portal/inventory/edit/smsnumber"] .control-group select,
body.page-inventory form[action*="/portal/inventory/edit/smsnumber"] .control-group textarea,
body.page-inventory form[action*="/portal/inventory/edit/phone"] .control-group input[type="text"],
body.page-inventory form[action*="/portal/inventory/edit/phone"] .control-group select,
body.page-inventory form[action*="/portal/inventory/edit/phone"] .control-group textarea:not([id$="Notes"]):not([id$="Overrides"]) {
  box-sizing: border-box !important;
  width: 250px !important;
  min-width: 250px !important;
  max-width: 250px !important;
}

body.page-inventory form[action*="/portal/inventory/add/phone"] .control-group .controls textarea[id$="Notes"],
body.page-inventory form[action*="/portal/inventory/add/phone"] .control-group .controls textarea[id$="Overrides"],
body.page-inventory #add-phone-form .control-group .controls textarea[id$="Notes"],
body.page-inventory #add-phone-form .control-group .controls textarea[id$="Overrides"],
body.page-inventory form[action*="/portal/inventory/edit/phone"] .control-group .controls textarea[id$="Notes"],
body.page-inventory form[action*="/portal/inventory/edit/phone"] .control-group .controls textarea[id$="Overrides"],
body.page-inventory form[action*="/portal/inventory/add/phonenumber"] .control-group .controls textarea#notes,
body.page-inventory form[action*="/portal/inventory/edit/phonenumber"] .control-group textarea#notes,
body.page-inventory #bulkedit-phones textarea#notes {
  box-sizing: border-box !important;
  min-width: 250px !important;
  min-height: 5.25rem !important;
  max-height: none !important;
  max-width: 480px !important;
  resize: both !important;
  overflow: auto !important;
  overflow-y: auto !important;
}

body.page-inventory form[action*="/portal/inventory/add/phonenumber"] .input-append > input[type="text"],
body.page-inventory form[action*="/portal/inventory/edit/phonenumber"] .input-append > input[type="text"] {
  height: 1.95rem !important;
  min-height: 1.95rem !important;
  box-sizing: border-box !important;
}

body.page-inventory #add-phonenumber textarea#notes,
body.page-inventory #edit-number textarea#notes {
  box-sizing: border-box !important;
  min-width: 250px !important;
  max-width: 480px !important;
}

body.page-inventory #add-phonenumber .input-append > input[type="text"],
body.page-inventory #edit-number .input-append > input[type="text"] {
  height: 1.95rem !important;
  min-height: 1.95rem !important;
  box-sizing: border-box !important;
}

body.page-inventory form[action*="/portal/inventory/add/phonenumber"] .input-append > .add-on,
body.page-inventory form[action*="/portal/inventory/edit/phonenumber"] .input-append > .add-on {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 1.95rem !important;
  min-height: 1.95rem !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

body.page-inventory #add-phonenumber .input-append > .add-on,
body.page-inventory #edit-number .input-append > .add-on {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  min-width: 30px !important;
  height: 1.95rem !important;
  min-height: 1.95rem !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

body.page-inventory #bulkedit-phones .modal-footer .btn-group.dropup > .btn,
body.page-inventory #edit-phone .modal-footer .btn-group.dropup > .btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 1.95rem !important;
  min-height: 1.95rem !important;
  line-height: 1.25rem !important;
  box-sizing: border-box !important;
}

body.page-inventory #bulkedit-phones .modal-footer .btn-group.dropup > .btn + .btn,
body.page-inventory #edit-phone .modal-footer .btn-group.dropup > .btn + .btn {
  margin-left: -1px !important;
}

body.page-inventory #bulkedit-phones .modal-footer .btn-group.dropup > .btn:first-child,
body.page-inventory #edit-phone .modal-footer .btn-group.dropup > .btn:first-child {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
}

body.page-inventory #bulkedit-phones .modal-footer .btn-group.dropup > .btn:last-of-type,
body.page-inventory #edit-phone .modal-footer .btn-group.dropup > .btn:last-of-type {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
}

body.page-inventory #bulkedit-phones .modal-footer #bulkEditPhonesFormSubmitCombo,
body.page-inventory #edit-phone .modal-footer #editPhonesFormSubmitCombo {
  width: 2rem !important;
  min-width: 2rem !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

body.page-inventory #add-phone .modal-footer,
body.page-inventory #edit-phone .modal-footer,
body.page-inventory #add-phonenumber .modal-footer,
body.page-inventory #edit-number .modal-footer,
body.page-inventory #bulkedit-phones .modal-footer,
body.page-queues #write-queue .modal-footer,
body.page-music #write-music .modal-footer,
body.page-music #music-settings .modal-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 0.45rem !important;
  padding-right: 2.75rem !important;
}

body.page-inventory #add-phone .modal-footer > *,
body.page-inventory #edit-phone .modal-footer > *,
body.page-inventory #add-phonenumber .modal-footer > *,
body.page-inventory #edit-number .modal-footer > *,
body.page-inventory #bulkedit-phones .modal-footer > *,
body.page-queues #write-queue .modal-footer > *,
body.page-music #write-music .modal-footer > *,
body.page-music #music-settings .modal-footer > * {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

body.theme-dark .modal .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,
body.theme-dark .modal .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success,
body.theme-dark .ui-dialog .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-primary,
body.theme-dark .ui-dialog .bootstrap-switch .bootstrap-switch-handle-on.bootstrap-switch-success {
  background: rgba(var(--accent-primary-rgb), 0.88) !important;
  color: #eef4fb !important;
}

body.theme-light .popover .popover-title,
body.theme-light .popover .popover-content {
  background-color: rgba(243, 247, 252, 0.98) !important;
}

body.theme-light .popover .popover-content.text-center .btn-group .btn.btn-medium:not(.btn-danger) {
  background: rgba(231, 238, 246, 0.96) !important;
  background-image: none !important;
  border: 1px solid rgba(var(--g4-brand-navy-rgb), 0.12) !important;
  color: #31465e !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

body.theme-light .popover .popover-content.text-center .btn-group .btn.btn-medium.btn-danger {
  background: var(--g4-button-danger-bg) !important;
  background-image: none !important;
  border: 1px solid var(--g4-button-danger-border) !important;
  color: #ffffff !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

body.theme-light .popover .popover-content.text-center .btn-group .btn.btn-medium:not(.btn-danger):hover,
body.theme-light .popover .popover-content.text-center .btn-group .btn.btn-medium:not(.btn-danger):focus {
  background: rgba(var(--g4-brand-sky-rgb), 0.18) !important;
  border-color: rgba(var(--g4-brand-sky-rgb), 0.28) !important;
  color: #17344c !important;
}

body.theme-dark #grid4-app-shell .btn[disabled],
body.theme-dark #grid4-app-shell .btn.disabled,
body.theme-dark #grid4-app-shell button[disabled],
body.theme-dark #grid4-app-shell input[type="button"][disabled],
body.theme-dark #grid4-app-shell input[type="submit"][disabled],
body.theme-dark .fixed-container > #domain-message .btn[disabled],
body.theme-dark .fixed-container > #domain-message .btn.disabled,
body.theme-dark .fixed-container > .mask-bar .btn[disabled],
body.theme-dark .fixed-container > .mask-bar .btn.disabled {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: rgba(223, 232, 245, 0.58) !important;
  box-shadow: none !important;
  opacity: 1 !important;
}

body.theme-dark .page-home .chart-container,
body.theme-dark .page-home #omp-callgraphs-body,
body.theme-dark .page-home #chart_div,
body.theme-dark .page-home #chart_div_AnnotationChart,
body.theme-dark .page-home #chart_div_AnnotationChart_borderDiv,
body.theme-dark .page-home #chart_div_AnnotationChart_borderDiv > div,
body.theme-dark .page-home #chart_div_AnnotationChart_chartContainer,
body.theme-dark .page-home #chart_div_AnnotationChart_containerTable,
body.theme-dark .page-home .graphs-panel-home .loading-container,
body.theme-dark .page-home .graphs-panel-home .loading-container.relative,
body.theme-dark .page-home #omp-callgraphs-body .loading-container,
body.theme-dark .page-home #omp-callgraphs-body .loading-container.relative,
body.theme-dark .page-home .stats-panel-home .loading-container,
body.theme-dark .page-home .stats-panel-home .loading-container.relative,
body.theme-dark .page-home #omp-usage-stats .loading-container,
body.theme-dark .page-home #omp-usage-stats .loading-container.relative {
  background-color: var(--surface-primary-bg) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

body.theme-dark .page-home #chart_div .google-visualization-atl,
body.theme-dark .page-home #chart_div .google-visualization-atl .border {
  background-color: transparent !important;
  border-color: var(--border-color) !important;
}

body.page-home #chart_div,
body.page-home #chart_div > div,
body.page-home #chart_div_AnnotationChart,
body.page-home #chart_div_AnnotationChart_borderDiv,
body.page-home #chart_div_AnnotationChart_borderDiv > div,
body.page-home #chart_div_AnnotationChart_chartContainer,
body.page-home #chart_div_AnnotationChart_containerTable {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  padding: 0 !important;
}

body.page-home #chart_div[data-g4-chart-state="pending"] svg,
body.page-home #chart_div[data-g4-chart-state="pending"] .google-visualization-atl,
body.page-home #chart_div[data-g4-chart-state="pending"] .chartControls,
body.page-home #chart_div[data-g4-chart-state="pending"] .rangeControl,
body.page-home #chart_div_AnnotationChart_borderDiv[data-g4-chart-state="pending"] svg,
body.page-home #chart_div_AnnotationChart_borderDiv[data-g4-chart-state="pending"] .google-visualization-atl,
body.page-home #chart_div_AnnotationChart_borderDiv[data-g4-chart-state="pending"] .chartControls,
body.page-home #chart_div_AnnotationChart_borderDiv[data-g4-chart-state="pending"] .rangeControl,
body.page-agents #cc-stats-div[data-g4-chart-state="pending"] svg,
body.page-agents #cc-stats-div[data-g4-chart-state="pending"] .google-visualization-atl,
body.page-agents #modal-graph-div[data-g4-chart-state="pending"] svg,
body.page-agents #modal-graph-div[data-g4-chart-state="pending"] .google-visualization-atl,
body.page-stats #chart_div2[data-g4-chart-state="pending"] svg,
body.page-stats #chart_div2[data-g4-chart-state="pending"] .google-visualization-atl,
body.page-stats #chart_div3[data-g4-chart-state="pending"] svg,
body.page-stats #chart_div3[data-g4-chart-state="pending"] .google-visualization-atl,
body.page-stats #chart_div4[data-g4-chart-state="pending"] svg,
body.page-stats #chart_div4[data-g4-chart-state="pending"] .google-visualization-atl {
  opacity: 0 !important;
}

body.theme-dark .popover,
body.theme-dark .popover .popover-inner,
body.theme-dark .popover .popover-title,
body.theme-dark .popover .popover-content {
  background-color: var(--g4-popover-bg) !important;
  color: var(--g4-popover-text) !important;
  border-color: var(--g4-popover-border) !important;
  text-shadow: none !important;
}

body.theme-dark .popover {
  border: 1px solid var(--g4-popover-border) !important;
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.42) !important;
}

body.theme-dark .popover .popover-title {
  border-bottom: 1px solid var(--g4-popover-border) !important;
}

body.theme-dark .popover.left > .arrow {
  border-left-color: var(--g4-popover-border) !important;
}

body.theme-dark .popover.left > .arrow:after {
  border-left-color: var(--g4-popover-bg) !important;
}

body.theme-dark .popover.right > .arrow {
  border-right-color: var(--g4-popover-border) !important;
}

body.theme-dark .popover.right > .arrow:after {
  border-right-color: var(--g4-popover-bg) !important;
}

body.theme-dark .popover.top > .arrow {
  border-top-color: var(--g4-popover-border) !important;
}

body.theme-dark .popover.top > .arrow:after {
  border-top-color: var(--g4-popover-bg) !important;
}

body.theme-dark .popover.bottom > .arrow {
  border-bottom-color: var(--g4-popover-border) !important;
}

body.theme-dark .popover.bottom > .arrow:after {
  border-bottom-color: var(--g4-popover-bg) !important;
}

body.theme-light .popover,
body.theme-light .popover .popover-inner,
body.theme-light .popover .popover-title,
body.theme-light .popover .popover-content {
  background-color: var(--g4-popover-bg) !important;
  color: var(--g4-popover-text) !important;
  border-color: var(--g4-popover-border) !important;
  text-shadow: none !important;
}

body.theme-light .popover {
  border: 1px solid var(--g4-popover-border) !important;
  box-shadow: 0 1rem 2rem rgba(var(--g4-brand-navy-rgb), 0.14) !important;
}

body.theme-light .popover.left > .arrow {
  border-left-color: var(--g4-popover-border) !important;
}

body.theme-light .popover.left > .arrow:after {
  border-left-color: var(--g4-popover-bg) !important;
}

body.theme-light .popover.right > .arrow {
  border-right-color: var(--g4-popover-border) !important;
}

body.theme-light .popover.right > .arrow:after {
  border-right-color: var(--g4-popover-bg) !important;
}

body.theme-light .popover.top > .arrow {
  border-top-color: var(--g4-popover-border) !important;
}

body.theme-light .popover.top > .arrow:after {
  border-top-color: var(--g4-popover-bg) !important;
}

body.theme-light .popover.bottom > .arrow {
  border-bottom-color: var(--g4-popover-border) !important;
}

body.theme-light .popover.bottom > .arrow:after {
  border-bottom-color: var(--g4-popover-bg) !important;
}

body.theme-dark .stats-panel-home .label-popover,
body.theme-dark .stats-panel-home .label-popover .icon-info-sign,
body.theme-dark .stats-panel-home .home-refresh,
body.theme-dark .stats-panel-home .home-refresh .icon-refresh {
  color: var(--text-primary) !important;
  text-shadow: none !important;
}

body.theme-dark .stats-panel-home .label-popover .icon-info-sign,
body.theme-dark .stats-panel-home .home-refresh .icon-refresh {
  opacity: 0.82 !important;
  filter: invert(1) brightness(1.35) contrast(1.05) !important;
}

body.theme-dark .tooltip {
  opacity: 1 !important;
}

body.theme-dark .tooltip-inner {
  background-color: var(--g4-popover-bg) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--g4-popover-border) !important;
  box-shadow: 0 1rem 2rem rgba(0, 0, 0, 0.34) !important;
  text-shadow: none !important;
}

body.theme-dark .tooltip.top .tooltip-arrow {
  border-top-color: var(--g4-popover-bg) !important;
}

body.theme-dark .tooltip.right .tooltip-arrow {
  border-right-color: var(--g4-popover-bg) !important;
}

body.theme-dark .tooltip.left .tooltip-arrow {
  border-left-color: var(--g4-popover-bg) !important;
}

body.theme-dark .tooltip.bottom .tooltip-arrow {
  border-bottom-color: var(--g4-popover-bg) !important;
}

body.theme-dark.page-musiconhold #grid4-app-shell .table-hover tbody tr:hover,
body.theme-dark.page-musiconhold #grid4-app-shell .table-hover tbody tr:hover > td {
  background-color: var(--table-hover-bg) !important;
  color: var(--table-hover-text) !important;
}

body.theme-dark.page-musiconhold #grid4-app-shell .music-row,
body.theme-dark.page-musiconhold #grid4-app-shell .music-row > td {
  background-color: var(--surface-primary-bg) !important;
  color: var(--text-primary) !important;
}

body.theme-dark.page-musiconhold #grid4-app-shell .music-row[style*='background-color'],
body.theme-dark.page-musiconhold #grid4-app-shell .music-row[style*='background-color'] > td {
  background: var(--surface-primary-bg) !important;
  background-color: var(--surface-primary-bg) !important;
}

body.theme-dark.page-agents #grid4-app-shell #agents-searchbox-input,
body.theme-dark.page-agents #grid4-app-shell .agents-searchbox > .searchbox-input,
body.theme-dark.page-agents #grid4-app-shell .agents-searchbox.searchbox-open > .searchbox-input {
  background: var(--surface-primary-bg) !important;
  background-color: var(--surface-primary-bg) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: none !important;
}

body.theme-dark.page-agents #grid4-app-shell #agents-searchbox-input::placeholder {
  color: var(--text-muted) !important;
}

body.theme-dark.page-builder #grid4-app-shell .btn-config {
  color: var(--text-primary) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  background-color: transparent !important;
}

body.theme-dark.page-builder #grid4-app-shell .btn-config.selected {
  background-color: rgba(24, 30, 40, 0.94) !important;
  border-color: rgba(var(--g4-brand-sky-rgb), 0.28) !important;
  box-shadow: inset 0 0 0 1px rgba(var(--g4-brand-sky-rgb), 0.16) !important;
}

body.theme-dark.page-builder #grid4-app-shell .btn-config.selected .btn-id {
  box-shadow: 0 0 0 1px rgba(var(--g4-brand-sky-rgb), 0.34) !important;
}

body.theme-dark.page-builder #grid4-app-shell .btn-config .assigned-label,
body.theme-dark.page-builder #grid4-app-shell .btn-config .assigned-feature,
body.theme-dark.page-builder #grid4-app-shell .btn-config .btn-detail,
body.theme-dark.page-builder #grid4-app-shell .btn-config .btn-label {
  color: var(--text-secondary) !important;
}

body.theme-dark.page-builder #grid4-app-shell .btn-config select,
body.theme-dark.page-builder #grid4-app-shell .btn-config input,
body.theme-dark.page-builder #grid4-app-shell .btn-config input[disabled],
body.theme-dark.page-builder #grid4-app-shell .btn-config input[readonly] {
  background-color: var(--surface-primary-bg) !important;
  background-image: none !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  box-shadow: none !important;
  -webkit-text-fill-color: var(--text-primary) !important;
}

body.theme-dark.page-builder #grid4-app-shell .btn-config input[disabled],
body.theme-dark.page-builder #grid4-app-shell .btn-config input[readonly] {
  background-color: rgba(23, 28, 34, 0.92) !important;
  color: var(--text-secondary) !important;
  -webkit-text-fill-color: var(--text-secondary) !important;
}

body.theme-dark #grid4-app-shell input[disabled],
body.theme-dark #grid4-app-shell input[readonly],
body.theme-dark #grid4-app-shell select[disabled],
body.theme-dark #grid4-app-shell select[readonly],
body.theme-dark #grid4-app-shell textarea[disabled],
body.theme-dark #grid4-app-shell textarea[readonly],
body.theme-dark #grid4-app-shell .uneditable-input,
body.theme-dark #grid4-app-shell span.uneditable-input {
  background-color: var(--surface-secondary-bg) !important;
  background-image: none !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border-color) !important;
  -webkit-text-fill-color: var(--text-secondary) !important;
  box-shadow: none !important;
  opacity: 1 !important;
}

body.theme-dark #grid4-app-shell input[disabled]::placeholder,
body.theme-dark #grid4-app-shell input[readonly]::placeholder,
body.theme-dark #grid4-app-shell textarea[disabled]::placeholder,
body.theme-dark #grid4-app-shell textarea[readonly]::placeholder {
  color: var(--text-muted) !important;
}

/* Monday 2026-03-30 reopen follow-ups */

body .dock-contacts #contacts-sort-search {
  flex-wrap: nowrap !important;
  overflow: visible !important;
  position: relative !important;
  z-index: 7 !important;
}

body .dock-contacts .dock-contacts-header.top {
  position: relative !important;
  z-index: 6 !important;
}

body .dock-column.dock-contacts .scroll-container {
  position: relative !important;
  z-index: 1 !important;
}

body .dock-column.dock-contacts .scroll-container.hide-conversation-dropdown {
  position: absolute !important;
  top: -9999px !important;
  left: -9999px !important;
  z-index: auto !important;
}

body .dock-contacts #contacts-sort-search .contacts-sort-dropdown {
  flex: 0 0 auto !important;
  min-width: max-content !important;
  gap: 0.15rem !important;
  position: relative !important;
  z-index: 8 !important;
}

body .dock-contacts #contacts-sort-search .contacts-sort-dropdown > div[style*="table-cell"] {
  display: block !important;
  width: auto !important;
  flex: 0 0 auto !important;
  min-width: max-content !important;
  max-width: none !important;
}

body .dock-contacts #contacts-sort-search .contacts-sort-dropdown > div[style*="table-cell"] > .dropdown-toggle {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  min-width: max-content !important;
  overflow: visible !important;
}

body .dock-contacts #contacts-sort-search .contacts-sort-dropdown > div[style*="table-cell"] > .dropdown-toggle > a.dropdown-toggle {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  min-height: 1.75rem !important;
}

body .dock-contacts #contacts-sort-search .contacts-sort-dropdown > .dropdown-toggle,
body .dock-contacts #contacts-sort-search .contacts-sort-dropdown > .dropdown-toggle > a.dropdown-toggle,
body .dock-contacts #contacts-sort-search #sortby {
  flex: 0 0 auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 1.75rem !important;
}

body .dock-contacts #contacts-sort-search #sortby {
  position: relative !important;
  width: 1.85rem !important;
  min-width: 1.85rem !important;
  margin-left: 0 !important;
  padding: 0 !important;
}

body .dock-contacts #contacts-sort-search .contacts-sort-dropdown > div[style*="table-cell"] > .dropdown-toggle > ul#group-dropdown {
  top: calc(100% + 0.2rem) !important;
  left: 0 !important;
  min-width: 10.75rem !important;
  max-height: none !important;
  overflow: visible !important;
}

body .dock-contacts #contacts-sort-search,
body .dock-contacts #contacts-sort-search .contacts-sort-dropdown,
body .dock-contacts #contacts-sort-search .contacts-sort-dropdown > div[style*="table-cell"] {
  overflow: visible !important;
}

body .dock-contacts #contacts-sort-search .contacts-sort-dropdown > div[style*="table-cell"] > .dropdown-toggle > ul#group-dropdown,
body .dock-contacts #contacts-sort-search .contacts-sort-dropdown > div[style*="table-cell"] > .dropdown-toggle > ul#group-dropdown > .dropdown-submenu > .dropdown-menu {
  transition: none !important;
}

body .dock-contacts #contacts-sort-search .contacts-sort-dropdown > div[style*="table-cell"] > .dropdown-toggle > ul#group-dropdown > .dropdown-submenu {
  position: relative !important;
}

body .dock-contacts #contacts-sort-search .contacts-sort-dropdown > div[style*="table-cell"] > .dropdown-toggle > ul#group-dropdown > .dropdown-submenu > .dropdown-menu {
  display: none !important;
  top: -0.35rem !important;
  left: calc(100% - 0.2rem) !important;
  min-width: 11rem !important;
  max-height: min(22rem, 70vh) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  margin-top: 0 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transform: translateX(0.35rem) !important;
  pointer-events: none !important;
  z-index: 1201 !important;
}

body .dock-contacts #contacts-sort-search .contacts-sort-dropdown > div[style*="table-cell"] > .dropdown-toggle > ul#group-dropdown > .dropdown-submenu:hover > .dropdown-menu,
body .dock-contacts #contacts-sort-search .contacts-sort-dropdown > div[style*="table-cell"] > .dropdown-toggle > ul#group-dropdown > .dropdown-submenu:focus-within > .dropdown-menu {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(0) !important;
  pointer-events: auto !important;
}

body .dock-contacts #contacts-sort-search .contacts-sort-dropdown > div[style*="table-cell"] > .dropdown-toggle.dropdown.open > ul#group-dropdown,
body .dock-contacts #contacts-sort-search .contacts-sort-dropdown > div[style*="table-cell"] > .dropdown-toggle.g4-dock-filter-open > ul#group-dropdown {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
  pointer-events: auto !important;
}

body .dock-contacts #contacts-sort-search .contacts-current-sortby-dock {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
}

body .dock-contacts #contacts-sort-search .contacts-current-sortby-dock .nsicon-sort {
  position: static !important;
  top: auto !important;
  left: auto !important;
  line-height: 1 !important;
  transform: none !important;
}

body .dock-contacts #group-dropdown,
body .dock-contacts #group-dropdown .dropdown-menu,
body .dock-contacts .contacts-sortby-toggle {
  z-index: 1200 !important;
}

body.theme-dark .dock-contacts #contacts-sort-search .contacts-sort-dropdown > .dropdown-toggle > a,
body.theme-dark .dock-contacts #contacts-sort-search #sortby,
body.theme-dark .dock-contacts #contacts-sort-search .contacts-current-sortby-dock .nsicon-sort,
body.theme-dark .dock-contacts #contacts-sort-search .contacts-searchbox-icon,
body.theme-dark .dock-contacts #contacts-sort-search .contacts-searchbox-icon .iconfont-search {
  color: #ffffff !important;
}

body.theme-dark .dock-contacts #contacts-sort-search #current-group,
body.theme-dark .dock-contacts #contacts-sort-search .contacts-sort-dropdown > .dropdown-toggle > a.dropdown-toggle,
body.theme-dark .dock-contacts #contacts-sort-search .contacts-sort-dropdown > .dropdown-toggle > a.dropdown-toggle .caret {
  color: #ffffff !important;
  -webkit-text-fill-color: currentColor !important;
}

body.theme-dark .dock-contacts #contacts-sort-search .contacts-sort-dropdown > div[style*="table-cell"] > .dropdown-toggle > a.dropdown-toggle,
body.theme-dark .dock-contacts #contacts-sort-search .contacts-sort-dropdown > div[style*="table-cell"] > .dropdown-toggle > a.dropdown-toggle .caret {
  color: #ffffff !important;
  -webkit-text-fill-color: currentColor !important;
}

body.theme-dark .dock-contacts #contacts-sort-search .caret {
  border-top-color: #ffffff !important;
}

body.theme-light .dock-contacts #contacts-sort-search .contacts-sort-dropdown > .dropdown-toggle > a,
body.theme-light .dock-contacts #contacts-sort-search #sortby,
body.theme-light .dock-contacts #contacts-sort-search .contacts-current-sortby-dock .nsicon-sort,
body.theme-light .dock-contacts #contacts-sort-search .contacts-searchbox-icon,
body.theme-light .dock-contacts #contacts-sort-search .contacts-searchbox-icon .iconfont-search {
  color: var(--g4-brand-navy) !important;
}

body.theme-light .dock-contacts #contacts-sort-search #current-group,
body.theme-light .dock-contacts #contacts-sort-search .contacts-sort-dropdown > .dropdown-toggle > a.dropdown-toggle,
body.theme-light .dock-contacts #contacts-sort-search .contacts-sort-dropdown > .dropdown-toggle > a.dropdown-toggle .caret {
  color: var(--g4-brand-navy) !important;
  -webkit-text-fill-color: currentColor !important;
}

body.theme-light .dock-contacts #contacts-sort-search .contacts-sort-dropdown > div[style*="table-cell"] > .dropdown-toggle > a.dropdown-toggle,
body.theme-light .dock-contacts #contacts-sort-search .contacts-sort-dropdown > div[style*="table-cell"] > .dropdown-toggle > a.dropdown-toggle .caret {
  color: var(--g4-brand-navy) !important;
  -webkit-text-fill-color: currentColor !important;
}

body.theme-light .dock-contacts #contacts-sort-search .caret {
  border-top-color: var(--g4-brand-navy) !important;
}

body.theme-light .dock-column.dock-contacts .dock-popup {
  border: 2px solid rgba(28, 33, 67, 0.22) !important;
  box-shadow: 0 0.95rem 2.1rem rgba(18, 32, 48, 0.16) !important;
}

body.theme-dark .dock-column.dock-contacts .dock-popup {
  border: 2px solid rgba(82, 180, 250, 0.3) !important;
  box-shadow: 0 0.95rem 2.1rem rgba(0, 0, 0, 0.42) !important;
}

body .dock-contacts div.contact-dock-gravatar,
body .dock-contacts div.contact-dock-gravatar.gravatar-img-contact,
body .dock-contacts div.contact-dock-gravatar.gravatar-img-recent {
  width: 2.2rem !important;
  min-width: 2.2rem !important;
  max-width: 2.2rem !important;
  height: 2.2rem !important;
  min-height: 2.2rem !important;
  max-height: 2.2rem !important;
  padding: 0 !important;
  flex: 0 0 2.2rem !important;
  box-sizing: border-box !important;
  border-radius: 50% !important;
  overflow: hidden !important;
  display: inline-block !important;
  position: relative !important;
  vertical-align: middle !important;
}

body .dock-contacts div.contact-dock-gravatar p {
  position: absolute !important;
  inset: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 1 !important;
}

body .dock-contacts div.contact-dock-gravatar i {
  line-height: 1 !important;
}

body .dock-contacts img.contact-dock-gravatar,
body .dock-contacts div.contact-dock-gravatar img {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  min-width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
  margin: 0 !important;
  opacity: 1 !important;
  z-index: 2 !important;
}

body .dock-contacts div.contact-dock-gravatar img:not([src]),
body .dock-contacts div.contact-dock-gravatar img[src=""] {
  display: none !important;
}

body .dock-contacts #searchbox {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

body .dock-contacts #searchbox > .searchbox-input {
  box-sizing: border-box !important;
}

body.page-users #grid4-app-shell #vm-fwd-list > li {
  display: flex !important;
  align-items: center !important;
  gap: 0 !important;
  font-size: 0 !important;
  line-height: 0 !important;
}

body.page-users #grid4-app-shell #vm-fwd-list > li > input.search-query {
  margin-bottom: 0 !important;
  font-size: 14px !important;
  line-height: 20px !important;
}

body.page-users #grid4-app-shell #vm-fwd-list > li > a.add.helpsy,
body.page-users #grid4-app-shell #vm-fwd-list > li > a.del.helpsy {
  align-self: center !important;
  flex: 0 0 auto !important;
  width: 20px !important;
  min-width: 20px !important;
  height: 20px !important;
  min-height: 20px !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  margin-left: 3px !important;
  padding: 0 !important;
  vertical-align: middle !important;
}

body.page-answerrules #content > .modal-body .allowblock-input .input-append > .btn,
body.page-answerrules #allowblock-lists.modal .allowblock-input .input-append > .btn {
  width: 1.7rem !important;
  min-width: 1.7rem !important;
  height: 1.7rem !important;
  min-height: 1.7rem !important;
  padding: 0 !important;
  margin-left: -1px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

body.page-answerrules #content > .modal-body .allowblock-input .input-append > .btn > i,
body.page-answerrules #allowblock-lists.modal .allowblock-input .input-append > .btn > i {
  display: block !important;
  margin: 0 !important;
  line-height: 1 !important;
}

body.page-answerrules #content > .modal-body .allowblock-input .input-append > .btn > i::before,
body.page-answerrules #allowblock-lists.modal .allowblock-input .input-append > .btn > i::before {
  display: block !important;
  line-height: 1 !important;
}

body.page-answerrules #content > .modal-body .allowblock-table a.helpsy,
body.page-answerrules #allowblock-lists.modal .allowblock-table a.helpsy,
body.page-answerrules #content > .modal-body .allowblock-table a.helpsy:hover,
body.page-answerrules #allowblock-lists.modal .allowblock-table a.helpsy:hover,
body.page-answerrules #content > .modal-body .allowblock-table a.helpsy:focus,
body.page-answerrules #allowblock-lists.modal .allowblock-table a.helpsy:focus {
  color: #d14b5a !important;
  -webkit-text-fill-color: #d14b5a !important;
}

body.page-answerrules #content > .modal-body .allowblock-table a.helpsy i.icon-remove,
body.page-answerrules #allowblock-lists.modal .allowblock-table a.helpsy i.icon-remove,
body.page-answerrules #content > .modal-body .allowblock-table a.helpsy i.icon-remove::before,
body.page-answerrules #allowblock-lists.modal .allowblock-table a.helpsy i.icon-remove::before {
  color: #d14b5a !important;
  -webkit-text-fill-color: #d14b5a !important;
  filter: none !important;
  opacity: 1 !important;
}

body.theme-dark.page-answerrules #content > .modal-body .allowblock-table tbody tr:hover > td,
body.theme-dark.page-answerrules #allowblock-lists.modal .allowblock-table tbody tr:hover > td {
  background-color: rgba(var(--accent-primary-rgb), 0.14) !important;
  color: var(--text-primary) !important;
}

body.theme-dark.page-answerrules #content > .modal-body .allowblock-table tbody tr:hover > td a:not(.helpsy),
body.theme-dark.page-answerrules #content > .modal-body .allowblock-table tbody tr:hover > td span,
body.theme-dark.page-answerrules #allowblock-lists.modal .allowblock-table tbody tr:hover > td a:not(.helpsy),
body.theme-dark.page-answerrules #allowblock-lists.modal .allowblock-table tbody tr:hover > td span {
  color: inherit !important;
}

#builder-launcher .modal-body {
  display: flex !important;
  align-items: stretch !important;
  gap: 1.25rem !important;
}

#builder-launcher .left-panel,
#builder-launcher .right-panel {
  display: flex !important;
  flex: 1 1 0 !important;
  flex-direction: column !important;
  box-sizing: border-box !important;
}

#builder-launcher .left-panel {
  width: auto !important;
  margin-right: 0 !important;
  padding-right: 1rem !important;
}

#builder-launcher .right-panel {
  width: auto !important;
  float: none !important;
  padding-left: 0 !important;
}

#builder-launcher .panel-content {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  gap: 0.75rem !important;
  padding-left: 1.5rem !important;
  padding-right: 1.5rem !important;
  padding-bottom: 0 !important;
  box-sizing: border-box !important;
}

#builder-launcher .panel-content > div {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  gap: 0.5rem !important;
  margin-bottom: 0 !important;
}

#builder-launcher .panel-content .control-group {
  margin-bottom: 0 !important;
}

#builder-launcher .panel-content input[type="text"],
#builder-launcher .panel-content select {
  width: 100% !important;
  max-width: 100% !important;
  margin-bottom: 0 !important;
  box-sizing: border-box !important;
}

#builder-launcher .panel-content a.pull-right {
  float: none !important;
  align-self: flex-end !important;
  margin-top: 0.25rem !important;
  padding: 0 !important;
}

#builder-launcher #edit-config,
#builder-launcher #edit-profile,
#builder-launcher #edit-template {
  display: block !important;
  width: 13.75rem !important;
  max-width: 100% !important;
  margin-top: auto !important;
  margin-right: 0 !important;
  align-self: flex-start !important;
}
