/* Global panel density. No browser zoom or transform scaling. */
.panel-density-compact {
  --sidebar-width: 204px;
  --sidebar-collapsed-width: 52px;
  font-size: 12.5px;
}

html.panel-density-compact,
body.panel-density-compact,
body.platform-console-shell,
body.platform-console-shell.panel-density-compact {
  --sidebar-width: 204px;
  --sidebar-collapsed-width: 52px;
}

html.shell-booting .sidebar,
html:not(.shell-ready) .sidebar {
  width: var(--sidebar-width) !important;
  min-width: var(--sidebar-width) !important;
  max-width: var(--sidebar-width) !important;
  transition: none !important;
}

html.shell-booting .content-shell,
html:not(.shell-ready) .content-shell {
  margin-left: var(--sidebar-width) !important;
  transition: none !important;
}

html.shell-booting .sidebar__brand,
html:not(.shell-branding-ready) .sidebar__brand {
  min-height: 54px;
}

html.shell-booting .sidebar__logo,
html:not(.shell-branding-ready) .sidebar__logo {
  visibility: hidden !important;
}

html.shell-branding-ready .sidebar__logo {
  visibility: visible;
}

.panel-density-compact body {
  line-height: 1.32;
}

body.panel-density-compact {
  --sidebar-width: 204px;
  --sidebar-collapsed-width: 52px;
  font-size: 12.5px;
  line-height: 1.32;
}

.panel-density-compact .content-shell,
.panel-density-compact .page-content {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.panel-density-compact .content-shell {
  margin-left: var(--sidebar-width) !important;
  transition: none !important;
}

body.sidebar-collapsed.panel-density-compact .content-shell,
.panel-density-compact body.sidebar-collapsed .content-shell {
  margin-left: var(--sidebar-collapsed-width) !important;
}

.panel-density-compact .page-content {
  padding-top: 0.55rem !important;
  padding-right: 0.9rem !important;
  padding-left: 0.9rem !important;
  padding-bottom: 4.25rem;
  overflow-x: clip;
}

.panel-density-compact .topbar {
  min-height: 48px !important;
  padding: 0.35rem 0.85rem !important;
  gap: 0.55rem;
}

.panel-density-compact .topbar h1 {
  font-size: clamp(1.25rem, 1.55vw, 1.65rem) !important;
  letter-spacing: 0;
}

.panel-density-compact .topbar__toggle {
  width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  border-radius: 10px !important;
}

.panel-density-compact .topbar-density-toggle {
  width: 38px !important;
  min-width: 38px !important;
  padding-inline: 0 !important;
  justify-content: center;
}

.panel-density-compact .topbar-density-toggle span:not(.material-symbols-rounded) {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.panel-density-compact #clientDensityToggle {
  position: relative;
  width: 38px !important;
  min-width: 38px !important;
  padding-inline: 0 !important;
  overflow: hidden;
  color: transparent !important;
}

.panel-density-compact #clientDensityToggle::before {
  content: "density_small";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #1e40af;
  font-family: "Material Symbols Rounded";
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1;
}

.panel-density-compact .eyebrow,
.panel-density-compact .section-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

.panel-density-compact .sidebar {
  width: var(--sidebar-width) !important;
  min-width: var(--sidebar-width) !important;
  max-width: var(--sidebar-width) !important;
  transition-property: transform !important;
}

body.sidebar-collapsed.panel-density-compact .sidebar,
.panel-density-compact body.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width) !important;
  min-width: var(--sidebar-collapsed-width) !important;
  max-width: var(--sidebar-collapsed-width) !important;
}

.panel-density-compact .sidebar__brand,
.panel-density-compact .sidebar__profile,
.panel-density-compact .sidebar__footer {
  padding-top: 0.42rem !important;
  padding-bottom: 0.42rem !important;
}

.panel-density-compact .sidebar__brand {
  min-height: 54px;
}

.panel-density-compact .sidebar__logo--full {
  width: 150px;
  max-width: 150px;
  height: auto;
  max-height: 44px;
  aspect-ratio: 150 / 44;
  object-fit: contain;
}

.panel-density-compact .sidebar__logo--compact {
  width: 30px;
  height: 30px;
  max-width: 30px;
  max-height: 30px;
  aspect-ratio: 1;
  object-fit: contain;
}

.panel-density-compact .sidebar__profile {
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 0.5rem;
}

.panel-density-compact .sidebar__avatar {
  width: 30px;
  height: 30px;
  font-size: 0.72rem;
}

.panel-density-compact .nav-item,
.panel-density-compact .nav-group__button,
.panel-density-compact .nav-subitem,
.panel-density-compact .nav-subgroup__button {
  min-height: 32px !important;
  padding: 0.32rem 0.48rem !important;
  gap: 0.42rem;
}

.panel-density-compact .nav-item__icon,
.panel-density-compact .nav-subitem__icon {
  width: 26px !important;
  height: 26px !important;
  font-size: 1rem !important;
}

.panel-density-compact .button,
.panel-density-compact button,
.panel-density-compact input,
.panel-density-compact select,
.panel-density-compact textarea {
  font-size: 0.84rem;
}

.panel-density-compact .button {
  min-height: 32px !important;
  padding: 0.42rem 0.65rem !important;
  border-radius: 9px;
}

.panel-density-compact .card,
.panel-density-compact .panel-card,
.panel-density-compact .metric-card,
.panel-density-compact .table-card {
  padding: 0.68rem !important;
  border-radius: 10px;
}

.panel-density-compact .field,
.panel-density-compact label.field {
  gap: 0.3rem;
}

.panel-density-compact .field span,
.panel-density-compact label > span {
  font-size: 0.72rem;
}

.panel-density-compact input,
.panel-density-compact select {
  min-height: 34px !important;
  padding: 0.42rem 0.58rem !important;
  border-radius: 8px;
}

.panel-density-compact textarea {
  padding: 0.55rem 0.65rem !important;
  border-radius: 8px;
}

.panel-density-compact table th,
.panel-density-compact table td {
  padding: 0.48rem 0.6rem;
}

.panel-density-compact .table-card,
.panel-density-compact .table-wrap,
.panel-density-compact .router-page,
.panel-density-compact .router-card,
.panel-density-compact .router-import-card,
.panel-density-compact .router-import-shell,
.panel-density-compact .plans-page,
.panel-density-compact .plans-shell {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.panel-density-compact .table-wrap,
.panel-density-compact .router-table-wrap,
.panel-density-compact .router-import-table-wrap,
.panel-density-compact .plans-table-wrap {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}

.panel-density-compact .router-card .table-wrap {
  min-height: 940px;
}

.panel-density-compact .router-page__chips,
.panel-density-compact .router-toolbar,
.panel-density-compact .router-toolbar__left,
.panel-density-compact .router-toolbar__right,
.panel-density-compact .router-import-toolbar,
.panel-density-compact .router-import-toolbar__group,
.panel-density-compact .router-bulk-bar,
.panel-density-compact .plans-toolbar,
.panel-density-compact .plans-filters {
  max-width: 100%;
  min-width: 0;
  flex-wrap: wrap;
}

.panel-density-compact .router-toolbar__search,
.panel-density-compact .router-import-toolbar .field,
.panel-density-compact .plans-toolbar .field,
.panel-density-compact .plans-filters .field {
  min-width: min(100%, 280px);
}

.panel-density-compact .router-table,
.panel-density-compact .router-import-table,
.panel-density-compact .plans-table,
.panel-density-compact .data-table--wide {
  width: 100%;
  max-width: 100%;
}

.panel-density-compact .router-toolbar__label,
.panel-density-compact .router-square-action {
  display: none !important;
}

.panel-density-compact .toolbar,
.panel-density-compact .filters,
.panel-density-compact .actions-row {
  gap: 0.5rem;
  padding: 0.55rem 0;
}

.panel-density-compact .platform-logo-manager,
.panel-density-compact .brand-logo-manager {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 12px;
  background: rgba(248, 250, 252, 0.86);
}

.panel-density-compact .platform-logo-manager__preview,
.panel-density-compact .brand-logo-preview {
  display: grid;
  place-items: center;
  min-height: 64px;
  padding: 0.5rem;
  border-radius: 10px;
  background: #0f172a;
}

.panel-density-compact .platform-logo-manager__preview img,
.panel-density-compact .brand-logo-preview img {
  max-width: 136px;
  max-height: 52px;
  object-fit: contain;
}

.panel-density-compact .platform-logo-manager__content,
.panel-density-compact .brand-logo-controls {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

.panel-density-compact .platform-logo-manager__actions,
.panel-density-compact .brand-logo-controls .button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.panel-density-compact .platform-logo-manager__status,
.panel-density-compact .brand-logo-status {
  color: #475569;
  font-size: 0.78rem;
}

.panel-density-compact .platform-support-tenant-banner {
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  z-index: 2147482500;
  margin: 0;
  padding: 0.32rem 0.75rem;
  border-bottom: 1px solid rgba(37, 99, 235, 0.28);
  background: #dbeafe;
  color: #1e3a8a;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-align: center;
  pointer-events: none;
}

@media (max-width: 980px) {
  html.panel-density-compact,
  body.panel-density-compact,
  body.platform-console-shell,
  body.platform-console-shell.panel-density-compact {
    --mobile-header-height: 46px;
    --mobile-content-padding: 0.72rem;
    --mobile-card-padding: 0.72rem;
    --mobile-button-height: 38px;
    --mobile-input-height: 38px;
    --mobile-drawer-width: min(92vw, 340px);
  }

  html.shell-booting .content-shell,
  html:not(.shell-ready) .content-shell,
  .panel-density-compact .content-shell,
  body.sidebar-collapsed.panel-density-compact .content-shell,
  .panel-density-compact body.sidebar-collapsed .content-shell {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    transform: none !important;
    transition: none !important;
  }

  html.shell-booting .sidebar,
  html:not(.shell-ready) .sidebar,
  .panel-density-compact .sidebar {
    width: var(--mobile-drawer-width) !important;
    min-width: 0 !important;
    max-width: var(--mobile-drawer-width) !important;
    transform: translateX(-104%) !important;
    z-index: 80 !important;
    pointer-events: auto;
    transition-property: transform !important;
    transition-duration: 180ms !important;
    transition-timing-function: ease !important;
  }

  body.panel-nav-open.panel-density-compact .sidebar,
  .panel-density-compact body.panel-nav-open .sidebar {
    transform: translateX(0) !important;
    z-index: 80 !important;
    pointer-events: auto;
  }

  body.panel-nav-open.panel-density-compact::before,
  .panel-density-compact body.panel-nav-open::before {
    z-index: 45;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: none;
  }

  body.panel-density-compact {
    overflow-x: clip;
  }

  .panel-density-compact .topbar {
    min-height: var(--mobile-header-height) !important;
    padding: 0.28rem 0.58rem !important;
    gap: 0.38rem;
    flex-wrap: wrap;
  }

  .panel-density-compact .topbar__headline {
    flex: 1 1 min(100%, 210px);
    min-width: 0;
    width: auto !important;
  }

  .panel-density-compact .topbar__headline .eyebrow {
    font-size: 0.62rem;
    line-height: 1.05;
  }

  .panel-density-compact .topbar h1 {
    max-width: 100%;
    font-size: clamp(1rem, 5vw, 1.24rem) !important;
    line-height: 1.05;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .panel-density-compact .topbar__actions {
    flex: 1 0 100%;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 0.1rem;
  }

  .panel-density-compact .topbar__actions .button-row,
  .panel-density-compact .topbar__actions > * {
    max-width: 100%;
    min-width: 0;
    flex-wrap: nowrap;
  }

  .panel-density-compact .topbar__actions .button,
  .panel-density-compact .topbar__actions button,
  .panel-density-compact .topbar__actions .invoice-topbar-button {
    min-height: 34px !important;
    white-space: nowrap;
  }

  .panel-density-compact .topbar__toggle,
  .panel-density-compact .topbar-notification-button {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
  }

  .panel-density-compact .page-content {
    width: 100%;
    max-width: 100vw;
    padding: 0.62rem var(--mobile-content-padding) 4.5rem !important;
    overflow-x: clip;
  }

  .panel-density-compact .hero-banner,
  .panel-density-compact .dashboard-hero,
  .panel-density-compact .router-page__hero,
  .panel-density-compact .table-card,
  .panel-density-compact .panel-card,
  .panel-density-compact .metric-card,
  .panel-density-compact .card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: var(--mobile-card-padding) !important;
    border-radius: 16px;
  }

  .panel-density-compact .hero-banner h1,
  .panel-density-compact .dashboard-hero h1,
  .panel-density-compact .router-page__hero h1,
  .panel-density-compact .table-card h2,
  .panel-density-compact .panel-card h2 {
    font-size: clamp(1.2rem, 6vw, 1.55rem);
    line-height: 1.08;
  }

  .panel-density-compact .stats-grid,
  .panel-density-compact .dashboard-grid,
  .panel-density-compact .module-grid,
  .panel-density-compact .device-grid,
  .panel-density-compact .router-grid,
  .panel-density-compact .router-form-grid,
  .panel-density-compact .form-grid,
  .panel-density-compact .field-grid,
  .panel-density-compact .plans-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .panel-density-compact .button,
  .panel-density-compact button {
    min-height: var(--mobile-button-height) !important;
    max-width: 100%;
  }

  .panel-density-compact input,
  .panel-density-compact select {
    min-height: var(--mobile-input-height) !important;
    max-width: 100%;
  }

  .panel-density-compact textarea {
    max-width: 100%;
  }

  .panel-density-compact .toolbar,
  .panel-density-compact .wispro-toolbar,
  .panel-density-compact .router-toolbar,
  .panel-density-compact .router-import-toolbar,
  .panel-density-compact .plans-toolbar,
  .panel-density-compact .plans-filters,
  .panel-density-compact .billing-topbar-actions {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.42rem;
  }

  .panel-density-compact .toolbar .field,
  .panel-density-compact .wispro-toolbar .field,
  .panel-density-compact .router-toolbar .field,
  .panel-density-compact .router-import-toolbar .field,
  .panel-density-compact .plans-toolbar .field,
  .panel-density-compact .plans-filters .field {
    width: 100%;
    min-width: 0;
  }

  .panel-density-compact .table-wrap,
  .panel-density-compact .router-table-wrap,
  .panel-density-compact .router-import-table-wrap,
  .panel-density-compact .plans-table-wrap,
  .panel-density-compact .wispro-table-wrap {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
  }

  .panel-density-compact .router-card .table-wrap {
    min-height: 520px;
  }

  .panel-density-compact table {
    max-width: 100%;
  }

  .panel-density-compact .module-table--mobile-cards,
  .panel-density-compact .data-table.module-table--mobile-cards,
  .panel-density-compact table.module-table--mobile-cards {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    table-layout: auto !important;
    border-spacing: 0 !important;
  }

  .panel-density-compact .module-table--mobile-cards thead {
    display: none !important;
  }

  .panel-density-compact .module-table--mobile-cards tbody {
    display: grid !important;
    width: 100% !important;
    gap: 0.64rem !important;
  }

  .panel-density-compact .module-table--mobile-cards tbody tr {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0.42rem !important;
    padding: 0.7rem !important;
    box-sizing: border-box !important;
  }

  .panel-density-compact .module-table--mobile-cards tbody td {
    display: grid !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    grid-template-columns: minmax(82px, 0.42fr) minmax(0, 1fr);
    gap: 0.45rem !important;
    align-items: start;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .panel-density-compact .module-table--mobile-cards tbody td::before {
    min-width: 0;
    color: #64748b;
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .panel-density-compact .module-table--mobile-cards .button-row,
  .panel-density-compact .module-table--mobile-cards .table-actions {
    width: 100%;
    min-width: 0;
    flex-wrap: wrap;
  }

  .panel-density-compact .drawer,
  .panel-density-compact .drawer.modal-sheet {
    width: calc(100vw - 0.9rem) !important;
    max-width: calc(100vw - 0.9rem) !important;
    max-height: calc(100vh - 0.9rem) !important;
  }

  .panel-density-compact .platform-support-tenant-banner {
    left: 0;
    padding-inline: 0.5rem;
  }

  .panel-density-compact .platform-logo-manager,
  .panel-density-compact .brand-logo-manager {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .panel-density-compact {
    font-size: 12px;
  }

  .panel-density-compact .page-content {
    padding-left: 0.58rem !important;
    padding-right: 0.58rem !important;
  }

  .panel-density-compact .topbar {
    padding-inline: 0.5rem !important;
  }

  .panel-density-compact .sidebar__brand {
    min-height: 50px;
  }

  .panel-density-compact .sidebar__logo--full {
    width: 138px;
    max-width: 138px;
    max-height: 40px;
  }

  .panel-density-compact .table-card,
  .panel-density-compact .panel-card,
  .panel-density-compact .metric-card,
  .panel-density-compact .card {
    border-radius: 14px;
  }
}
