:root {
  --admin-blue: #003148;
  --admin-blue-dark: #0b1720;
  --admin-sidebar-bg: #102330;
  --admin-blue-soft: #e8f3ef;
  --admin-border: #c3cec7;
  --admin-text: #111b16;
  --admin-muted: #5d6962;
  --admin-bg: #ffffff;
  --admin-success: #2f9e44;
  --admin-warning: #b7791f;
  --danger: #c9482b;
  --admin-danger: var(--danger);
  --admin-radius: 4px;
  --admin-button-height: 34px;
  --admin-button-font-size: 14px;
  --admin-button-min-width: 64px;
  --admin-button-padding-x: 10px;
  --admin-control-arrow-padding-x: 22px;
  --admin-shadow: 0 18px 45px rgba(0, 59, 84, 0.08);
  --admin-zoom: 0.94;
  --admin-sidebar-width: 176px;
  --admin-fixed-header-height: 50px;
  --admin-page-side-gap: 24px;
  --admin-page-scroll-end-gap: 24px;
  --admin-min-content-width: 1180px;
  --admin-min-page-width: 1400px;
  --admin-horizontal-rounding-guard: 24px;
  --admin-layout-viewport-width: calc((100vw - var(--admin-horizontal-rounding-guard)) / var(--admin-zoom));
  --admin-shell-width: calc(var(--admin-layout-viewport-width) - var(--admin-sidebar-width) - (var(--admin-page-side-gap) * 2));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  min-height: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  overflow-y: hidden;
  overscroll-behavior: none;
  scrollbar-gutter: stable;
}

html.admin-page-fits-viewport-y {
  overflow-y: clip;
}

html.admin-page-overflow-measuring-y {
  overflow-y: clip;
}

html.admin-page-fits-viewport-y body {
  height: calc((100vh / var(--admin-zoom)) - var(--admin-fixed-header-height));
  min-height: calc((100vh / var(--admin-zoom)) - var(--admin-fixed-header-height));
  overflow-y: clip;
}

html.admin-page-overflow-measuring-y body {
  overflow-y: clip;
}

html.admin-page-fits-viewport-y .admin-main {
  min-height: 0;
}

html.portal-modal-open,
html.portal-modal-open body {
  overflow: hidden;
}

html:not([data-pryzenta-admin-ready="true"])::before {
  background: #ffffff;
  content: "";
  height: 100vh;
  left: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10000;
}

body.admin-loading::before {
  background: #ffffff;
  content: "";
  height: 100vh;
  left: 0;
  pointer-events: none;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 10000;
}

@keyframes pryzentaAdminLoadingPulse {
  0%,
  100% {
    opacity: 0.32;
  }
  50% {
    opacity: 1;
  }
}

body {
  margin: 0;
  height: calc(100vh / var(--admin-zoom));
  min-height: calc(100vh / var(--admin-zoom));
  color: var(--admin-text);
  background: var(--admin-bg);
  min-width: 0;
  overflow-x: hidden;
  overflow-x: clip;
  overflow-y: auto;
  zoom: var(--admin-zoom);
}

body.portal-login-page {
  background: #ffffff;
  min-width: 0;
  overflow: hidden;
}

body.portal-login-page .admin-shell {
  display: none;
}

body,
button,
input,
select,
textarea,
table,
dialog {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-kerning: normal;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea,
table,
dialog {
  font-family: inherit;
}

button,
.primary-button,
.secondary-button,
.danger-button,
.text-button,
.portal-tab,
.portal-section-collapse-button,
.portal-file-picker-button,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select,
textarea {
  box-sizing: border-box;
  max-width: 100%;
  min-width: 0;
}

button,
.primary-button,
.secondary-button,
.danger-button,
.text-button,
.portal-tab,
.portal-section-collapse-button,
.portal-file-picker-button,
select {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

button *,
.primary-button *,
.secondary-button *,
.danger-button *,
.text-button *,
.portal-tab *,
.portal-section-collapse-button *,
.portal-file-picker-button * {
  min-width: 0;
}

[hidden] {
  display: none !important;
}

button:disabled,
.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.text-button:disabled,
.portal-tab:disabled,
.portal-section-collapse-button:disabled,
.portal-file-picker-button:disabled {
  background: #f7f9f6;
  border-color: var(--admin-border);
  box-shadow: none;
  color: #9aa5a0;
  cursor: default;
  opacity: 1;
  pointer-events: none;
  transform: none;
}

button:disabled:hover,
.primary-button:disabled:hover,
.secondary-button:disabled:hover,
.danger-button:disabled:hover,
.text-button:disabled:hover,
.portal-tab:disabled:hover,
.portal-section-collapse-button:disabled:hover,
.portal-file-picker-button:disabled:hover {
  background: #f7f9f6;
  border-color: var(--admin-border);
  color: #9aa5a0;
  transform: none;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):disabled,
select:disabled,
textarea:disabled,
input:not([type="checkbox"]):not([type="radio"]):not([type="file"])[readonly],
textarea[readonly] {
  background: #f7f9f6;
  color: var(--admin-muted);
  cursor: default;
  opacity: 1;
}

.admin-loading > :not(script) {
  visibility: hidden;
}

.admin-shell {
  min-height: calc(100vh / var(--admin-zoom));
  min-width: 0;
}

.admin-sidebar {
  bottom: 0;
  display: flex;
  flex-direction: column;
  left: 0;
  padding: 0 10px 18px;
  position: fixed;
  top: var(--admin-fixed-header-height);
  width: var(--admin-sidebar-width);
  z-index: 90;
  color: #ffffff;
  background: var(--admin-sidebar-bg);
}

.admin-brand {
  display: flex;
  align-items: center;
  border: 0;
  cursor: pointer;
  gap: 10px;
  height: var(--admin-fixed-header-height);
  left: 0;
  padding: 0 8px;
  position: fixed;
  top: 0;
  width: var(--admin-sidebar-width);
  z-index: 100;
}

.admin-brand:hover,
.admin-brand:focus,
.admin-brand:active {
  background: var(--admin-blue-dark);
  color: #ffffff;
  outline: none;
}

.admin-brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: #ffffff;
  background: var(--admin-blue);
  font-size: 18px;
  font-weight: 400;
}

.admin-brand-name {
  display: block;
  color: #ffffff;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.05;
}

.admin-brand-subtitle {
  color: rgba(255, 255, 255, 0.78);
  display: block;
  font-size: 9px;
  font-weight: 400;
  line-height: 1.05;
  margin: 3px 0 0 -1px;
  text-align: left;
}

.admin-nav {
  display: grid;
  gap: 5px;
  margin-top: 20px;
}

.admin-side-powered {
  color: rgba(255, 255, 255, 0.72);
  display: block;
  font-size: 10px;
  font-weight: 400;
  line-height: 1.2;
  margin-top: auto;
  overflow: hidden;
  padding: 8px 0 2px;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
  width: 100%;
}

.admin-nav-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: var(--admin-radius);
  color: #ffffff;
  background: transparent;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.15;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.admin-nav-icon {
  display: flex;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.admin-nav-icon svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-nav-label {
  display: block;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  overflow-wrap: normal;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.admin-nav-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.admin-nav-item:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

.admin-nav-item.active {
  color: #ffffff;
  background: var(--admin-blue);
  border-color: var(--admin-blue);
}

.admin-nav-item.active:hover {
  color: #ffffff;
  background: var(--admin-blue);
  border-color: var(--admin-blue);
}

.admin-fixed-header {
  align-items: center;
  background: var(--admin-blue-dark);
  box-shadow: 0 6px 18px rgba(0, 49, 72, 0.16);
  display: flex;
  gap: 10px;
  height: var(--admin-fixed-header-height);
  justify-content: flex-end;
  left: 0;
  padding: 0 24px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 80;
}

.admin-header-profile-logo {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 50%;
  box-sizing: border-box;
  cursor: pointer;
  display: inline-flex;
  height: 34px;
  justify-content: center;
  overflow: visible;
  padding: 0;
  width: 34px;
}

.admin-header-profile-logo:focus-visible {
  outline: 0;
}

.admin-header-profile-logo img,
.admin-header-profile-logo .portal-profile-default-avatar {
  border-radius: 50%;
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.admin-profile-menu {
  background: #ffffff;
  border: 1px solid #cbd7d2;
  border-radius: var(--admin-radius);
  box-shadow: 0 18px 42px rgba(11, 23, 32, 0.18);
  color: var(--admin-text);
  padding: 16px;
  position: fixed;
  right: 12px;
  top: calc(var(--admin-fixed-header-height) + 8px);
  width: min(360px, calc(100vw - 32px));
  z-index: 120;
}

.admin-profile-summary {
  align-items: center;
  display: flex;
  gap: 12px;
  min-width: 0;
}

.admin-profile-avatar {
  border-radius: 50%;
  flex: 0 0 56px;
  height: 56px;
  overflow: hidden;
  width: 56px;
}

.admin-profile-avatar img,
.admin-profile-avatar .portal-profile-default-avatar {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.admin-profile-copy {
  min-width: 0;
}

.admin-profile-name {
  color: var(--admin-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-profile-email {
  color: var(--admin-muted);
  font-size: 14px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-profile-actions {
  align-items: center;
  border-top: 1px solid var(--admin-line);
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
}

.admin-profile-link,
.admin-profile-signout {
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 0;
}

.admin-profile-link {
  color: var(--admin-blue);
}

.admin-profile-signout {
  color: var(--admin-danger);
}

.admin-main {
  min-height: calc((100vh / var(--admin-zoom)) - var(--admin-fixed-header-height) - 14px);
  min-width: 0;
  width: max(0px, var(--admin-shell-width));
  max-width: none;
  margin: var(--admin-fixed-header-height) var(--admin-page-side-gap) 0 calc(var(--admin-sidebar-width) + var(--admin-page-side-gap));
  position: relative;
  padding: 20px 0 var(--admin-page-scroll-end-gap);
}

.admin-topbar {
  position: absolute;
  top: calc(var(--admin-fixed-header-height) + 56px);
  right: 0;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  pointer-events: none;
}

.portal-heading-copy {
  display: none;
}

.admin-topbar:not(.dashboard-mode) .portal-heading-copy {
  display: none !important;
}

.admin-topbar.dashboard-mode {
  position: static;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 20px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--admin-border);
  pointer-events: auto;
}

.admin-topbar.dashboard-mode .portal-heading-copy {
  display: block;
}

.admin-topbar h1 {
  margin: 0;
  color: var(--admin-text);
  font-size: 20px;
  line-height: 1.15;
}

.admin-topbar p {
  margin: 6px 0 0;
  color: var(--admin-muted);
  font-size: 13px;
}

.primary-button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: var(--admin-button-min-width);
  height: var(--admin-button-height);
  min-height: var(--admin-button-height);
  padding: 0 var(--admin-button-padding-x);
  border: 1px solid var(--admin-blue);
  border-radius: var(--admin-radius);
  color: #ffffff;
  background: var(--admin-blue);
  font-size: var(--admin-button-font-size);
  font-weight: 400;
  line-height: normal;
  text-align: center;
  cursor: pointer;
}

.danger-button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: var(--admin-button-min-width);
  height: var(--admin-button-height);
  min-height: var(--admin-button-height);
  padding: 0 var(--admin-button-padding-x);
  border: 1px solid var(--admin-danger);
  border-radius: var(--admin-radius);
  color: #ffffff;
  background: var(--admin-danger);
  font-size: var(--admin-button-font-size);
  font-weight: 400;
  line-height: normal;
  text-align: center;
  cursor: pointer;
}

.secondary-button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: var(--admin-button-min-width);
  height: var(--admin-button-height);
  min-height: var(--admin-button-height);
  padding: 0 var(--admin-button-padding-x);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  color: var(--admin-blue);
  background: #ffffff;
  font-size: var(--admin-button-font-size);
  font-weight: 400;
  line-height: normal;
  text-align: center;
  cursor: pointer;
}

.secondary-button:hover {
  background: var(--admin-blue-soft);
}

.primary-button:is([id*="cancel" i], [id*="close" i], [data-action*="cancel" i], [data-action*="close" i]),
.secondary-button:is([id*="cancel" i], [id*="close" i], [data-action*="cancel" i], [data-action*="close" i]) {
  color: var(--admin-blue);
  background: #ffffff;
  border-color: var(--admin-border);
}

.primary-button:is([id*="cancel" i], [id*="close" i], [data-action*="cancel" i], [data-action*="close" i]):hover,
.secondary-button:is([id*="cancel" i], [id*="close" i], [data-action*="cancel" i], [data-action*="close" i]):hover {
  background: var(--admin-blue-soft);
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled {
  border-color: var(--admin-border);
  color: #9aa5a0;
  background: #f7f9f6;
  cursor: default;
}

.primary-button:disabled:hover,
.secondary-button:disabled:hover,
.danger-button:disabled:hover {
  background: #f7f9f6;
}

.topbar-actions,
.form-actions,
.inline-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
}

.topbar-actions {
  pointer-events: auto;
}

.admin-environment-control {
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 6px;
  box-sizing: border-box;
  color: #ffffff;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 400;
  height: 34px;
  justify-content: center;
  min-width: 86px;
  padding: 0 28px 0 12px;
  position: relative;
  width: fit-content;
  -webkit-tap-highlight-color: transparent;
}

.admin-environment-control[hidden] {
  display: none;
}

.admin-environment-text {
  display: block;
  line-height: 1;
  min-width: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.admin-environment-control::after {
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #ffffff;
  content: "";
  height: 0;
  pointer-events: none;
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
}

.admin-environment-select {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  height: 100%;
  inset: 0;
  opacity: 0;
  position: absolute;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

.admin-environment-select:focus,
.admin-environment-select:focus-visible {
  background-color: transparent;
  box-shadow: none;
  outline: 0;
}

.admin-environment-select:disabled {
  opacity: 0.86;
}

.admin-environment-select option {
  color: var(--admin-primary);
}

.form-actions,
.inline-actions {
  align-items: center;
}

.admin-modal .form-actions {
  justify-content: flex-start;
}

.refresh-action {
  align-items: flex-end;
  display: inline-grid;
  gap: 8px;
  justify-items: end;
}

.refresh-meta {
  color: var(--admin-muted);
  font-size: 12px;
  line-height: 1.2;
  min-height: 15px;
  white-space: nowrap;
}

.refresh-meta.error {
  color: var(--admin-danger);
}

.status-message {
  min-height: 20px;
  margin-bottom: 12px;
  color: var(--admin-muted);
  font-size: 13px;
}

.status-message:empty {
  display: none;
}

.status-message.error {
  color: var(--admin-danger);
}

.admin-environment-banner {
  background: #fff8e1;
  border: 1px solid #d69e2e;
  border-radius: 4px;
  color: #68450b;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 12px;
  padding: 10px 12px;
}

.admin-environment-banner:empty {
  display: none;
}

body[data-admin-environment="dev"] .admin-fixed-header {
  box-shadow: inset 0 -3px 0 #d69e2e;
}

body[data-admin-environment="live"] .admin-fixed-header {
  box-shadow: inset 0 -3px 0 #2f9e44;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric-card {
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: #ffffff;
  box-shadow: var(--admin-shadow);
}

.metric-label {
  display: block;
  color: var(--admin-muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  color: var(--admin-blue);
  font-size: 24px;
  line-height: 1;
}

.admin-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.admin-content-grid.users-mode {
  grid-template-columns: 1fr;
}

.admin-content-grid.dashboard-mode {
  grid-template-columns: 1fr;
}

.admin-content-grid.flat-mode .admin-panel {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.admin-content-grid.flat-mode .panel-header {
  display: none;
}

.admin-content-grid.flat-mode .admin-table-wrap {
  overflow: visible;
}

.admin-content-grid.portal-side-content-loading {
  align-items: stretch;
  display: flex;
  min-height: calc((100vh / var(--admin-zoom)) - var(--admin-fixed-header-height) - 40px - var(--admin-page-scroll-end-gap));
}

.admin-content-grid.portal-side-content-loading .admin-panel {
  display: flex;
  flex: 1 1 auto;
  min-height: calc((100vh / var(--admin-zoom)) - var(--admin-fixed-header-height) - 40px - var(--admin-page-scroll-end-gap));
}

.admin-content-grid.portal-side-content-loading .panel-header {
  display: none;
}

.admin-content-grid.portal-side-content-loading .admin-table-wrap {
  align-items: center;
  display: flex;
  flex: 1 1 auto;
  justify-content: center;
  min-height: 0;
  overflow: hidden;
}

.portal-side-loading-surface {
  align-items: center;
  background: #ffffff;
  display: grid;
  flex: 1 1 auto;
  justify-content: center;
  min-height: 100%;
  place-items: center;
  width: 100%;
}

.portal-side-loading-state {
  align-items: flex-end;
  display: inline-flex;
  gap: 8px;
  height: 34px;
  justify-content: center;
  width: auto;
}

.portal-side-loading-state span {
  animation: portalSideLoadingBars 0.95s ease-in-out infinite;
  background: var(--admin-blue);
  border-radius: 3px 3px 0 0;
  display: block;
  height: 16px;
  opacity: 0.65;
  width: 8px;
}

.portal-side-loading-state span:nth-child(2) {
  animation-delay: 0.12s;
}

.portal-side-loading-state span:nth-child(3) {
  animation-delay: 0.24s;
}

.portal-side-loading-state span:nth-child(4) {
  animation-delay: 0.36s;
}

@keyframes portalSideLoadingBars {
  0%,
  100% {
    opacity: 0.45;
    transform: scaleY(0.55);
  }

  50% {
    opacity: 0.95;
    transform: scaleY(1.55);
  }
}

.admin-panel {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: #ffffff;
  box-shadow: var(--admin-shadow);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--admin-border);
}

.panel-header h2 {
  margin: 0;
  color: var(--admin-blue);
  font-size: 16px;
}

.panel-meta {
  color: var(--admin-muted);
  font-size: 13px;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table-box {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  max-width: 100%;
  overflow: hidden;
  width: 100%;
}

.admin-table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  color: var(--admin-blue);
  font-size: 13px;
  table-layout: fixed;
}

.admin-table th,
.admin-table td {
  border-right: 1px solid var(--admin-border);
  box-sizing: border-box;
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  white-space: normal;
  word-break: normal;
}

.admin-table th:last-child,
.admin-table td:last-child {
  border-right: 0;
}

.admin-table th {
  color: var(--admin-blue);
  background: #f7f9f6;
  font-size: 13px;
  font-weight: 700;
}

.admin-table td {
  border-top: 1px solid var(--admin-border);
  color: var(--admin-blue);
  font-size: 14px;
  font-weight: 400;
  max-width: 0;
  overflow-wrap: anywhere;
}

.admin-table tr:hover {
  background: transparent;
}

.portal-subscriptions-table-box {
  overflow-x: auto;
  overflow-y: hidden;
}

.portal-customers-table-box {
  overflow-x: auto;
  overflow-y: hidden;
}

.portal-subscriptions-table {
  min-width: 2840px;
  table-layout: fixed;
  width: 2840px;
}

.portal-customers-table {
  min-width: 1480px;
  table-layout: fixed;
  width: 1480px;
}

.portal-subscriptions-table th,
.portal-subscriptions-table td,
.portal-customers-table th,
.portal-customers-table td {
  max-width: none;
  overflow-wrap: normal;
  word-break: normal;
}

.portal-subscriptions-table th:nth-child(n+2),
.portal-subscriptions-table td:nth-child(n+2) {
  white-space: nowrap;
}

.portal-customers-table th:nth-child(1),
.portal-customers-table td:nth-child(1) {
  width: 350px;
}

.portal-customers-table th:nth-child(2),
.portal-customers-table td:nth-child(2) {
  width: 190px;
}

.portal-customers-table th:nth-child(3),
.portal-customers-table td:nth-child(3),
.portal-customers-table th:nth-child(4),
.portal-customers-table td:nth-child(4),
.portal-customers-table th:nth-child(5),
.portal-customers-table td:nth-child(5),
.portal-customers-table th:nth-child(6),
.portal-customers-table td:nth-child(6) {
  width: 140px;
}

.portal-customers-table th:nth-child(7),
.portal-customers-table td:nth-child(7) {
  width: 220px;
}

.portal-customers-table th:nth-child(8),
.portal-customers-table td:nth-child(8) {
  width: 210px;
}

.portal-subscriptions-table th:nth-child(1),
.portal-subscriptions-table td:nth-child(1) {
  width: 330px;
}

.portal-subscriptions-table th:nth-child(2),
.portal-subscriptions-table td:nth-child(2) {
  width: 190px;
}

.portal-subscriptions-table th:nth-child(3),
.portal-subscriptions-table td:nth-child(3) {
  width: 180px;
}

.portal-subscriptions-table th:nth-child(4),
.portal-subscriptions-table td:nth-child(4) {
  width: 210px;
}

.portal-subscriptions-table th:nth-child(5),
.portal-subscriptions-table td:nth-child(5) {
  width: 210px;
}

.portal-subscriptions-table th:nth-child(6),
.portal-subscriptions-table td:nth-child(6) {
  width: 190px;
}

.portal-subscriptions-table th:nth-child(7),
.portal-subscriptions-table td:nth-child(7) {
  width: 220px;
}

.portal-subscriptions-table th:nth-child(8),
.portal-subscriptions-table td:nth-child(8) {
  width: 220px;
}

.portal-subscriptions-table th:nth-child(9),
.portal-subscriptions-table td:nth-child(9) {
  width: 160px;
}

.portal-subscriptions-table th:nth-child(10),
.portal-subscriptions-table td:nth-child(10) {
  width: 190px;
}

.portal-subscriptions-table th:nth-child(11),
.portal-subscriptions-table td:nth-child(11) {
  width: 170px;
}

.portal-subscriptions-table th:nth-child(12),
.portal-subscriptions-table td:nth-child(12) {
  width: 180px;
}

.portal-subscriptions-table th:nth-child(13),
.portal-subscriptions-table td:nth-child(13) {
  width: 200px;
}

.portal-subscriptions-table th:nth-child(14),
.portal-subscriptions-table td:nth-child(14) {
  width: 180px;
}

.portal-subscriptions-table th:nth-child(15),
.portal-subscriptions-table td:nth-child(15) {
  width: 130px;
}

.portal-connections-table-box {
  overflow-x: auto;
  overflow-y: hidden;
}

.portal-connections-table {
  min-width: 2320px;
  table-layout: fixed;
  width: 2320px;
}

.portal-connections-table th,
.portal-connections-table td {
  max-width: none;
  overflow-wrap: normal;
  word-break: normal;
}

.portal-connections-table th:nth-child(1),
.portal-connections-table td:nth-child(1) {
  width: 320px;
}

.portal-connections-table th:nth-child(2),
.portal-connections-table td:nth-child(2) {
  width: 250px;
}

.portal-connections-table th:nth-child(3),
.portal-connections-table td:nth-child(3) {
  width: 190px;
}

.portal-connections-table th:nth-child(4),
.portal-connections-table td:nth-child(4),
.portal-connections-table th:nth-child(5),
.portal-connections-table td:nth-child(5) {
  width: 160px;
}

.portal-connections-table th:nth-child(6),
.portal-connections-table td:nth-child(6),
.portal-connections-table th:nth-child(7),
.portal-connections-table td:nth-child(7) {
  width: 190px;
}

.portal-connections-table th:nth-child(8),
.portal-connections-table td:nth-child(8),
.portal-connections-table th:nth-child(9),
.portal-connections-table td:nth-child(9),
.portal-connections-table th:nth-child(10),
.portal-connections-table td:nth-child(10),
.portal-connections-table th:nth-child(11),
.portal-connections-table td:nth-child(11) {
  width: 150px;
}

.portal-connections-table th:nth-child(12),
.portal-connections-table td:nth-child(12) {
  width: 160px;
}

.portal-connections-table th:nth-child(13),
.portal-connections-table td:nth-child(13) {
  width: 240px;
}

.portal-connections-table th:nth-child(14),
.portal-connections-table td:nth-child(14) {
  width: 150px;
}

.portal-connections-table th:not(:first-child),
.portal-connections-table td:not(:first-child),
.portal-subscriptions-table th:not(:first-child),
.portal-subscriptions-table td:not(:first-child) {
  white-space: nowrap;
}

.customer-name {
  color: var(--admin-blue);
  font-weight: 700;
}

.customer-subtext {
  margin-top: 4px;
  color: var(--admin-muted);
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--admin-muted);
  background: #eef2ef;
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.connection-status-pill,
.connection-sync-status-pill {
  justify-content: center;
  min-width: 64px;
}

.portal-connections-table .connection-status-pill,
.portal-connections-table .connection-sync-status-pill {
  min-width: 54px;
  padding-left: 10px;
  padding-right: 10px;
}

.portal-company-users-table-box {
  overflow-x: auto;
  overflow-y: hidden;
}

.portal-company-users-table {
  min-width: 1120px;
  table-layout: fixed;
  width: 100%;
}

.portal-company-users-table th,
.portal-company-users-table td {
  max-width: none;
}

.portal-company-users-table th:nth-child(1),
.portal-company-users-table td:nth-child(1) {
  text-align: center;
  width: 56px;
}

.portal-company-users-table th:nth-child(2),
.portal-company-users-table td:nth-child(2) {
  width: 330px;
}

.portal-company-users-table th:nth-child(3),
.portal-company-users-table td:nth-child(3) {
  width: auto;
}

.portal-company-users-table th:nth-child(4),
.portal-company-users-table td:nth-child(4) {
  width: 220px;
}

.portal-company-users-table th:nth-child(5),
.portal-company-users-table td:nth-child(5) {
  width: 220px;
}

.portal-company-users-table td:nth-child(5) {
  align-items: center;
  display: flex;
  gap: 12px;
}

.portal-company-users-row-number {
  text-align: center;
}

.portal-reset-password-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.portal-reset-password-message {
  flex: 0 1 auto;
}

.portal-company-user-membership {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 28px;
}

.portal-company-user-membership + .portal-company-user-membership {
  margin-top: 8px;
}

.portal-company-user-company {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pill.user-status-pill {
  font-weight: 400;
  justify-content: center;
  min-width: 58px;
}

.pill.user-status-pill.active {
  background: #eaf7ee;
  color: var(--admin-success);
}

.pill.user-status-pill.inactive {
  background: #fff0ed;
  color: var(--admin-danger);
}

.connection-sync-status-pill.warning {
  background: #eef2ef;
  color: #2f6f91;
}

.pill.success {
  color: var(--admin-success);
  background: #e7f5ef;
}

.pill.warning {
  color: var(--admin-warning);
  background: #fff5db;
}

.pill.danger {
  color: var(--admin-danger);
  background: #fff0ed;
}

.pill.portal-user-status-pill {
  justify-content: center;
  min-width: 64px;
}

.empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  color: var(--admin-muted);
  text-align: center;
}

.portal-page-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--admin-text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  margin: 0 0 14px;
}

.portal-page-title-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  align-items: center;
  justify-content: center;
  color: var(--admin-blue);
}

.portal-page-title > span:not(.portal-page-title-icon) {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
}

.portal-page-title-icon svg {
  display: block;
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.portal-settings-page {
  display: grid;
  gap: 0;
}

.portal-environment-context {
  align-items: center;
  display: flex;
  gap: 10px;
  min-height: 34px;
  margin: 0 0 12px;
  padding: 6px 10px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: #ffffff;
  color: var(--admin-muted);
  font-size: 14px;
}

.portal-environment-context.dev {
  border-color: #e4b14b;
  background: #fff8e8;
  color: #6f4a05;
}

.portal-environment-context.global {
  border-color: #b9c9cf;
  background: #f7fafb;
}

.portal-environment-context-label {
  min-width: 54px;
  color: var(--admin-blue);
  font-weight: 700;
}

.portal-environment-context.dev .portal-environment-context-label {
  color: #8a5a00;
}

.portal-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.portal-tab {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: var(--admin-button-min-width);
  min-height: 32px;
  padding: 0 var(--admin-button-padding-x);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  color: var(--admin-muted);
  background: #ffffff;
  font-size: var(--admin-button-font-size);
  font-weight: 400;
  line-height: normal;
  text-align: center;
  cursor: pointer;
}

.portal-tab.active {
  border-color: var(--admin-blue);
  color: #ffffff;
  background: var(--admin-blue);
}

.portal-settings-divider {
  height: 1px;
  margin-bottom: 14px;
  background: var(--admin-border);
}

.portal-documentation-view {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: #ffffff;
  overflow: hidden;
}

.portal-documentation-meta {
  align-items: center;
  border-bottom: 1px solid var(--admin-border);
  color: var(--admin-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 12px;
}

.portal-documentation-content {
  max-height: calc((100vh / var(--admin-zoom)) - var(--admin-fixed-header-height) - 220px);
  min-height: 360px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px 16px 24px;
}

.portal-documentation-content h2,
.portal-documentation-content h3,
.portal-documentation-content h4,
.portal-documentation-content h5 {
  color: var(--admin-blue);
  line-height: 1.25;
  margin: 18px 0 8px;
}

.portal-documentation-content h2:first-child,
.portal-documentation-content h3:first-child,
.portal-documentation-content h4:first-child,
.portal-documentation-content h5:first-child {
  margin-top: 0;
}

.portal-documentation-content h2 {
  font-size: 20px;
}

.portal-documentation-content h3 {
  font-size: 17px;
}

.portal-documentation-content h4,
.portal-documentation-content h5 {
  font-size: 15px;
}

.portal-documentation-content p,
.portal-documentation-content li,
.portal-documentation-content pre {
  color: var(--admin-text);
  font-size: 14px;
  line-height: 1.5;
}

.portal-documentation-content p {
  margin: 0 0 8px;
}

.portal-documentation-content ul {
  margin: 0 0 10px 20px;
  padding: 0;
}

.portal-documentation-content pre {
  background: #f7f9f6;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  overflow: auto;
  padding: 10px;
  white-space: pre-wrap;
}

.portal-testing-panel {
  display: grid;
  gap: 12px;
}

.portal-testing-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.portal-testing-summary {
  color: var(--admin-blue);
  font-size: 14px;
  font-weight: 700;
}

.portal-testing-meta {
  color: var(--admin-muted);
  font-size: 13px;
  margin-top: 4px;
  min-height: 18px;
}

.portal-testing-empty {
  min-height: 120px;
}

.portal-testing-module {
  display: grid;
  gap: 8px;
}

.portal-testing-module h3 {
  color: var(--admin-blue);
  font-size: 16px;
  line-height: 1.25;
  margin: 8px 0 0;
}

.portal-testing-module .admin-table-box {
  overflow-x: auto;
  overflow-y: hidden;
}

.portal-testing-table {
  min-width: 1220px;
  table-layout: fixed;
  width: max(100%, 1220px);
}

.portal-testing-table th:nth-child(1),
.portal-testing-table td:nth-child(1) {
  width: 170px;
}

.portal-testing-table th:nth-child(2),
.portal-testing-table td:nth-child(2) {
  width: 280px;
}

.portal-testing-table th:nth-child(3),
.portal-testing-table td:nth-child(3) {
  width: 410px;
}

.portal-testing-table th:nth-child(4),
.portal-testing-table td:nth-child(4) {
  width: 110px;
}

.portal-testing-table th:nth-child(5),
.portal-testing-table td:nth-child(5) {
  width: 250px;
}

.portal-testing-table th,
.portal-testing-table td {
  max-width: none;
  overflow-wrap: normal;
  white-space: normal;
}

.portal-testing-cell {
  line-height: 1.35;
  overflow-wrap: normal;
  width: 100%;
  white-space: normal;
}

.portal-testing-table td:nth-child(5) .portal-testing-cell {
  overflow-wrap: anywhere;
}

.portal-testing-message,
.portal-testing-message .portal-testing-cell {
  color: var(--admin-danger);
}

.portal-testing-message {
  font-size: 13px;
  line-height: 1.35;
}

.portal-testing-actions {
  align-items: center;
  display: flex;
  justify-content: flex-end;
}

.portal-landing-page-editor {
  display: grid;
  gap: 14px;
}

.portal-landing-seo-form {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 980px;
}

.portal-landing-seo-strength {
  display: grid;
  gap: 12px;
  max-width: 980px;
}

.portal-landing-seo-score {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 14px;
}

.portal-landing-seo-score > div:first-child {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.portal-landing-seo-score strong {
  color: #c2410c;
  font-size: 22px;
}

.portal-landing-seo-score.medium strong { color: #a16207; }
.portal-landing-seo-score.strong strong { color: #15803d; }

.portal-landing-seo-score-track {
  background: #e5e7eb;
  border-radius: 999px;
  height: 8px;
  margin-top: 10px;
  overflow: hidden;
}

.portal-landing-seo-score-track span {
  background: #c2410c;
  display: block;
  height: 100%;
  transition: width 0.2s ease;
}

.portal-landing-seo-score.medium .portal-landing-seo-score-track span { background: #ca8a04; }
.portal-landing-seo-score.strong .portal-landing-seo-score-track span { background: #16a34a; }

.portal-landing-seo-checks {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-landing-seo-checks > div {
  align-items: center;
  display: flex;
  gap: 8px;
}

.portal-landing-seo-checks .passed { color: #15803d; }
.portal-landing-seo-checks .pending { color: #6b7280; }

.portal-landing-seo-wide {
  grid-column: 1 / -1;
}

.portal-toggle-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

@media (max-width: 720px) {
  .portal-landing-seo-form { grid-template-columns: 1fr; }
  .portal-landing-seo-wide { grid-column: auto; }
  .portal-landing-seo-checks { grid-template-columns: 1fr; }
}

.portal-landing-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.portal-landing-preview-link {
  display: inline-flex;
  text-decoration: none;
}

.portal-landing-section-list {
  display: grid;
  gap: 12px;
}

.portal-landing-section-card {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 14px;
  position: relative;
  transition: border-color 0.15s ease, opacity 0.15s ease;
}

.portal-landing-section-card.dragging {
  opacity: 0.55;
}

.portal-landing-section-card.drag-over-before::before,
.portal-landing-section-card.drag-over-after::after {
  background: var(--admin-blue);
  border-radius: 999px;
  content: "";
  height: 3px;
  left: 12px;
  position: absolute;
  right: 12px;
  z-index: 2;
}

.portal-landing-section-card.drag-over-before::before {
  top: -8px;
}

.portal-landing-section-card.drag-over-after::after {
  bottom: -8px;
}

.portal-landing-section-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.portal-landing-section-card.collapsed .portal-landing-section-header {
  margin-bottom: 0;
}

.portal-landing-section-card.collapsed .portal-landing-section-body {
  display: none;
}

.portal-landing-section-title {
  align-items: center;
  display: flex;
  gap: 8px;
}

.portal-section-collapse-button {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  color: var(--admin-blue);
  cursor: pointer;
  display: inline-flex;
  font-size: var(--admin-button-font-size);
  font-weight: 400;
  gap: 12px;
  height: 34px;
  justify-content: center;
  line-height: normal;
  min-width: 112px;
  padding: 0 12px;
  text-align: center;
  white-space: nowrap;
}

.portal-section-collapse-button svg {
  display: block;
  flex: 0 0 auto;
  height: 16px;
  width: 16px;
}

.portal-section-collapse-button path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.portal-landing-section-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

.portal-landing-control {
  align-items: flex-start;
  display: grid;
  gap: 4px;
}

.portal-landing-control span {
  color: var(--admin-blue);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.portal-landing-control select,
.portal-landing-orientation-select {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  color: var(--admin-text);
  font: inherit;
  font-size: 14px;
  height: 34px;
  padding: 0 var(--admin-control-arrow-padding-x) 0 10px;
}

.portal-landing-color-control input[type="color"] {
  appearance: none;
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  cursor: pointer;
  height: 34px;
  padding: 4px;
  width: 48px;
}

.portal-landing-color-control input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.portal-landing-color-control input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 3px;
}

.portal-landing-drag-handle {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--admin-muted);
  cursor: grab;
  display: inline-flex;
  font: inherit;
  font-size: 18px;
  height: 28px;
  justify-content: center;
  line-height: 1;
  padding: 0 4px;
}

.portal-landing-drag-handle:active {
  cursor: grabbing;
}

.portal-landing-section-header h3 {
  color: var(--admin-blue);
  font-size: 15px;
  line-height: 1.2;
  margin: 0;
}

.portal-landing-section-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-landing-text-field {
  grid-column: 1 / -1;
}

.portal-landing-text-field textarea {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  color: var(--admin-text);
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  min-height: 96px;
  padding: 10px;
  resize: vertical;
}

.portal-landing-text-field textarea:focus {
  border-color: var(--admin-blue);
  box-shadow: 0 0 0 3px rgba(0, 49, 72, 0.12);
  outline: 0;
}

.portal-landing-image-editor {
  align-items: flex-start;
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  grid-template-columns: 208px minmax(0, 1fr);
}

.portal-landing-footer-editor {
  align-items: start;
  display: grid;
  gap: 0;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
}

.portal-landing-footer-controls {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 14px;
}

.portal-landing-footer-control-grid,
.portal-landing-footer-columns {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.portal-landing-footer-columns {
  grid-template-columns: 1fr;
}

.portal-landing-footer-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
}

.portal-landing-footer-logo-editor,
.portal-landing-footer-rich,
.portal-landing-footer-rows {
  display: grid;
  gap: 10px;
}

.portal-landing-footer-label {
  color: var(--admin-blue);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.portal-landing-footer-rich-toolbar {
  align-items: center;
  background: #f4f7f8;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius) var(--admin-radius) 0 0;
  display: flex;
  gap: 2px;
  min-height: 36px;
  padding: 4px 6px;
}

.portal-landing-footer-rich-toolbar button {
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: var(--admin-text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  min-height: 26px;
  padding: 3px 8px;
}

.portal-landing-footer-rich-toolbar button:hover {
  background: #e9eef1;
}

.portal-landing-footer-rich-editor {
  border: 1px solid var(--admin-border);
  border-radius: 0 0 var(--admin-radius) var(--admin-radius);
  color: var(--admin-text);
  font-size: 14px;
  line-height: 1.45;
  min-height: 104px;
  overflow: auto;
  padding: 12px;
}

.portal-landing-footer-rich-editor:focus {
  border-color: var(--admin-blue);
  box-shadow: 0 0 0 3px rgba(0, 49, 72, 0.12);
  outline: 0;
}

.portal-landing-footer-row {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 24px minmax(132px, 0.9fr) minmax(220px, 1.4fr) minmax(96px, 0.55fr) auto 34px;
  min-width: 0;
  position: relative;
}

.portal-landing-footer-row.dragging {
  opacity: 0.55;
}

.portal-landing-footer-row.drag-over-before::before,
.portal-landing-footer-row.drag-over-after::after {
  background: var(--admin-blue);
  border-radius: 999px;
  content: "";
  height: 2px;
  left: 0;
  position: absolute;
  right: 0;
}

.portal-landing-footer-row.drag-over-before::before {
  top: -5px;
}

.portal-landing-footer-row.drag-over-after::after {
  bottom: -5px;
}

.portal-landing-footer-row input,
.portal-landing-footer-row select,
.portal-landing-control input[type="number"],
.portal-landing-footer-copyright input {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  color: var(--admin-text);
  font: inherit;
  font-size: 14px;
  min-width: 0;
  min-height: 34px;
  padding: 0 10px;
  width: 100%;
}

.portal-landing-footer-row .icon-button {
  justify-self: end;
}

.portal-landing-footer-row .portal-landing-footer-check {
  justify-self: start;
}

.portal-landing-footer-check {
  align-items: center;
  color: var(--admin-text);
  display: inline-flex;
  font-size: 13px;
  gap: 6px;
  min-height: 34px;
  white-space: nowrap;
}

.portal-landing-footer-full-width {
  align-self: end;
}

.portal-landing-footer-preview-panel {
  border-left: 1px solid var(--admin-border);
  display: grid;
  align-self: stretch;
  gap: 12px;
  min-width: 0;
  padding: 14px 14px 14px 18px;
}

.portal-landing-footer-preview-panel h4 {
  color: var(--admin-blue);
  font-size: 12px;
  line-height: 1.2;
  margin: 0;
}

.portal-landing-footer-preview {
  background: var(--portal-footer-bg, #061a3a);
  border-radius: 0;
  box-sizing: border-box;
  color: var(--portal-footer-text, #ffffff);
  font-family: var(--admin-font-family);
  font-size: var(--portal-footer-font-size, 14px);
  min-height: 210px;
  padding: var(--portal-footer-padding-top, 48px) var(--portal-footer-padding-right, 24px) var(--portal-footer-padding-bottom, 48px) var(--portal-footer-padding-left, 24px);
  text-align: var(--portal-footer-align, center);
  width: 100%;
}

.portal-landing-footer-preview-inner {
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: var(--portal-footer-max-width, 1100px);
}

.portal-landing-footer-preview-logo {
  justify-self: var(--portal-footer-logo-align, center);
}

.portal-landing-footer-preview-logo img {
  display: block;
  height: auto;
  max-height: var(--portal-footer-logo-size, 64px);
  max-width: var(--portal-footer-logo-size, 64px);
  object-fit: contain;
}

.portal-landing-footer-preview-links,
.portal-landing-footer-preview-socials {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.portal-landing-footer-preview a {
  color: var(--portal-footer-link, #ffffff);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.portal-landing-footer-preview a:hover {
  color: var(--portal-footer-link-hover, #ffffff);
}

.portal-landing-footer-social-icon {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  color: var(--portal-footer-bg, #061a3a);
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  height: 22px;
  justify-content: center;
  width: 22px;
}

.portal-landing-footer-social-icon svg {
  display: block;
  height: 14px;
  width: 14px;
}

.portal-landing-footer-preview-description {
  line-height: 1.55;
}

.portal-landing-footer-preview-description h1,
.portal-landing-footer-preview-description h2,
.portal-landing-footer-preview-description h3 {
  font-size: var(--portal-footer-heading-size, 18px);
  margin: 0 0 8px;
}

.portal-landing-footer-preview-copyright {
  opacity: 0.78;
}

.portal-landing-image-preview {
  align-items: center;
  background: #f7f9f6;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-sizing: border-box;
  color: var(--admin-muted);
  display: flex;
  flex: 0 0 208px;
  height: 116.8px;
  justify-content: center;
  max-width: 100%;
  overflow: hidden;
  padding: 10px;
  width: 208px;
}

.portal-landing-image-preview img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.portal-landing-image-preview.has-image {
  background: #ffffff;
  padding: 0;
}

.portal-upload-frame-hint {
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  margin-bottom: 4px;
}

.portal-user-list {
  display: grid;
  gap: 10px;
  padding: 0;
}

.portal-users-toolbar {
  align-items: center;
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.portal-profile-form {
  display: grid;
  gap: 14px;
  max-width: 760px;
}

.portal-profile-logo-upload {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: flex-start;
}

.portal-profile-logo-preview {
  align-items: center;
  background: #f7f9f6;
  border: 0;
  border-radius: 50%;
  display: flex;
  flex: 0 0 auto;
  height: 74px;
  justify-content: center;
  overflow: hidden;
  width: 74px;
}

.portal-profile-logo-preview.has-logo {
  background: #ffffff;
}

.portal-profile-logo-preview img,
.portal-profile-default-avatar {
  display: block;
  height: 100%;
  width: 100%;
}

.portal-profile-logo-preview img {
  object-fit: cover;
}

.portal-uploads-form {
  max-width: 560px;
}

.portal-email-config-form {
  max-width: 820px;
}

.portal-email-configuration-form,
.portal-email-notifications-form,
.portal-ai-configuration-form {
  max-width: none;
  width: 100%;
}

.portal-email-notifications-form {
  gap: 18px;
}

.portal-notification-message-field textarea {
  min-height: 210px;
  resize: vertical;
}

.portal-notification-actions {
  align-items: flex-start;
  flex-wrap: wrap;
}

.portal-notification-send-status {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.35;
  min-height: 36px;
}

.portal-notification-status-details {
  color: inherit;
  font-size: 12px;
  font-weight: 400;
  max-width: 520px;
}

.portal-ai-config-subtabs {
  margin-bottom: 12px;
}

.portal-ai-config-subtabs .portal-tab {
  flex: 0 0 auto;
}

.portal-ai-rules-form {
  max-width: 980px;
}

.portal-ai-rule-section-title {
  color: var(--admin-muted);
  font-size: 13px;
  line-height: 1.3;
}

.portal-ai-rules-list {
  display: grid;
  gap: 5px;
}

.portal-ai-rule-row {
  color: var(--admin-muted);
  display: block;
  font-size: 13px;
  line-height: 1.3;
  padding: 0;
}

.portal-invoicing-configuration-form,
.portal-invoicing-mapping-form {
  max-width: none;
  width: 100%;
}

.portal-invoicing-config-grid {
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 12px;
}

.portal-invoicing-module {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  display: grid;
  gap: 10px;
  padding: 12px;
}

.portal-invoicing-module + .portal-invoicing-module {
  margin-top: 12px;
}

.portal-invoicing-module-header {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.portal-invoicing-trigger {
  color: var(--admin-muted);
  font-size: 13px;
}

.portal-invoicing-mapping-table-box {
  overflow-x: auto;
}

.portal-invoicing-mapping-table {
  min-width: 980px;
  table-layout: fixed;
}

.portal-invoicing-mapping-table input[type="text"] {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-sizing: border-box;
  color: var(--admin-text);
  font: inherit;
  min-height: 32px;
  padding: 6px 8px;
  width: 100%;
}

.portal-phone-default-control {
  display: grid;
  grid-template-columns: minmax(82px, 0.28fr) minmax(0, 1fr);
  width: 100%;
}

.portal-phone-default-control select,
.portal-phone-default-control input[type="tel"] {
  background-color: #ffffff;
  border: 1px solid var(--admin-border);
  box-sizing: border-box;
  color: var(--admin-text);
  font: inherit;
  min-height: 32px;
  min-width: 0;
  padding: 6px 8px;
}

.portal-phone-default-control select {
  border-radius: var(--admin-radius) 0 0 var(--admin-radius);
  font-weight: 400;
}

.portal-phone-default-control input[type="tel"] {
  border-left: 0;
  border-radius: 0 var(--admin-radius) var(--admin-radius) 0;
}

.portal-phone-default-control select:focus,
.portal-phone-default-control input[type="tel"]:focus {
  border-color: var(--admin-blue);
  box-shadow: 0 0 0 1px var(--admin-blue);
  outline: 0;
  position: relative;
  z-index: 1;
}

.portal-invoicing-mapping-table th:nth-child(1),
.portal-invoicing-mapping-table td:nth-child(1) {
  width: 31%;
}

.portal-invoicing-mapping-table th:nth-child(2),
.portal-invoicing-mapping-table td:nth-child(2) {
  width: 31%;
}

.portal-invoicing-mapping-table th:nth-child(3),
.portal-invoicing-mapping-table td:nth-child(3) {
  width: 28%;
}

.portal-invoicing-mapping-table th:nth-child(4),
.portal-invoicing-mapping-table td:nth-child(4) {
  text-align: center;
  width: 90px;
}

.portal-invoicing-required-cell {
  vertical-align: middle;
}

.portal-invoicing-source-field {
  background: #f7f9f6;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-sizing: border-box;
  color: var(--admin-muted);
  display: block;
  min-height: 32px;
  padding: 7px 8px;
  width: 100%;
}

.portal-email-config-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.portal-email-config-grid.portal-invoicing-config-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portal-enterprise-context-panel {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.portal-enterprise-context-panel h3 {
  color: var(--admin-blue);
  font-size: 16px;
  line-height: 1.2;
  margin: 0 0 5px;
}

.portal-enterprise-context-panel p {
  color: var(--admin-muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.portal-enterprise-context-metrics {
  display: grid;
  flex: 0 0 min(390px, 45%);
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-enterprise-context-metrics span {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  color: var(--admin-muted);
  font-size: 11px;
  line-height: 1.25;
  min-width: 0;
  padding: 8px;
}

.portal-enterprise-context-metrics strong {
  color: var(--admin-blue);
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-advanced-settings {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  color: var(--admin-muted);
  font-size: 13px;
  line-height: 1.45;
  padding: 10px 12px;
}

.portal-advanced-settings summary {
  color: var(--admin-blue);
  cursor: pointer;
  font-weight: 700;
}

.portal-advanced-settings p {
  margin: 8px 0 0;
}

.portal-email-status-row {
  align-items: center;
  display: flex;
  gap: 10px;
}

.portal-ai-enabled-status-row {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  width: 100%;
}

.portal-ai-last-generated {
  color: var(--admin-muted);
  font-size: 13px;
  line-height: 1.3;
  text-align: right;
}

.portal-email-status-label {
  color: var(--admin-blue);
  font-size: 13px;
  font-weight: 700;
}

.portal-ai-enabled-row {
  align-items: center;
  color: var(--admin-text);
  display: inline-flex;
  font-size: 14px;
  gap: 8px;
  width: fit-content;
}

.portal-upload-label {
  margin-bottom: -4px;
}

.portal-favicon-logo-preview {
  border-radius: var(--admin-radius);
}

.portal-profile-controls {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.upload-requirements {
  color: #6f7a74;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.2;
}

.portal-file-row {
  align-items: center;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  display: inline-flex;
  gap: 6px;
  min-height: var(--admin-button-height);
  max-width: 100%;
  padding: 3px 8px;
  width: fit-content;
}

.portal-file-picker-button {
  align-items: center;
  background: #f7f9f6;
  border: 1px solid var(--admin-border);
  border-radius: calc(var(--admin-radius) - 2px);
  color: var(--admin-text);
  cursor: pointer;
  display: inline-flex;
  font-size: var(--admin-button-font-size);
  font-weight: 400;
  justify-content: center;
  min-height: calc(var(--admin-button-height) - 4px);
  padding: 0 var(--admin-button-padding-x);
  white-space: nowrap;
}

.portal-file-name-text {
  color: var(--admin-text);
  font-size: var(--admin-button-font-size);
  font-weight: 400;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
  white-space: nowrap;
}

.portal-file-row input[type="file"] {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  padding: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.portal-profile-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-profile-actions {
  align-items: center;
  display: flex;
  gap: 12px;
}

.portal-profile-message {
  color: var(--admin-success);
  font-size: 13px;
}

.portal-profile-message.error {
  color: var(--admin-danger);
}

.portal-profile-message.success {
  color: var(--admin-success);
}

.portal-profile-message.saving-message {
  color: var(--admin-muted);
}

.portal-save-message-dots {
  display: inline-flex;
  margin-left: 2px;
}

.admin-sync-status-dots {
  color: inherit;
}

.portal-save-message-dots span {
  animation: portal-save-message-dot-pulse 1s ease-in-out infinite;
}

.portal-save-message-dots span:nth-child(2) {
  animation-delay: 0.16s;
}

.portal-save-message-dots span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes portal-save-message-dot-pulse {
  0%,
  70%,
  100% {
    opacity: 0.35;
  }
  35% {
    opacity: 1;
  }
}

.portal-login-actions,
.portal-login-reset-actions {
  align-items: center;
}

.portal-login-actions .portal-profile-message,
.portal-login-reset-actions .portal-profile-message {
  align-items: center;
  display: inline-flex;
  font-weight: 400;
  line-height: 1.2;
  margin-left: 4px;
  min-height: var(--admin-button-height);
}

.portal-profile-crop-modal {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 340px;
  padding: 18px;
  width: 340px;
}

.portal-profile-crop-stage {
  align-items: center;
  background: #f7f9f6;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  cursor: grab;
  display: flex;
  height: 280px;
  justify-content: center;
  overflow: hidden;
  position: relative;
  touch-action: none;
  user-select: none;
  width: 100%;
}

.portal-profile-crop-stage:active {
  cursor: grabbing;
}

.portal-profile-crop-image {
  left: 50%;
  max-width: none;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform-origin: center;
  user-select: none;
}

.portal-profile-crop-frame {
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow:
    0 0 0 999px rgba(255, 255, 255, 0.48),
    0 0 0 1px rgba(0, 49, 72, 0.14);
  height: 220px;
  pointer-events: none;
  position: absolute;
  width: 220px;
}

.portal-square-crop-frame {
  border: 2px solid #ffffff;
  border-radius: var(--admin-radius);
  box-shadow:
    0 0 0 999px rgba(255, 255, 255, 0.72),
    0 0 0 1px rgba(0, 49, 72, 0.14);
}

.portal-landing-crop-frame {
  border: 2px solid #ffffff;
  border-radius: var(--admin-radius);
  box-shadow:
    0 0 0 999px rgba(255, 255, 255, 0.72),
    0 0 0 1px rgba(0, 49, 72, 0.14);
  height: 140px;
  width: 248px;
}

.portal-profile-crop-controls {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
}

.portal-profile-crop-controls input[type="range"] {
  accent-color: var(--admin-blue);
  width: 100%;
}

.portal-profile-zoom-button {
  font-size: 16px;
  height: 32px;
  min-height: 32px;
  min-width: 32px;
  padding: 0;
  width: 32px;
}

.portal-profile-crop-actions {
  justify-content: flex-end;
  margin-top: 0;
}

.portal-user-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 80px;
  padding: 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: #ffffff;
}

.portal-user-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.portal-user-avatar {
  display: grid;
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
}

.portal-user-avatar img,
.portal-user-avatar .portal-profile-default-avatar {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.portal-user-name {
  color: var(--admin-blue);
  font-size: 13px;
  font-weight: 700;
  line-height: normal;
}

.portal-user-email {
  margin-top: 2px;
  color: var(--admin-muted);
  font-size: 13px;
}

.portal-user-role {
  margin-top: 2px;
  color: var(--admin-muted);
  font-size: 13px;
}

.portal-user-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.portal-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
}

.portal-dashboard-overview {
  align-items: center;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 0 12px;
  padding: 14px 16px;
}

.portal-dashboard-overview h3 {
  color: var(--admin-blue);
  font-size: 17px;
  line-height: 1.2;
  margin: 0 0 4px;
}

.portal-dashboard-overview p {
  color: var(--admin-muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.portal-dashboard-health,
.portal-dashboard-status {
  align-items: center;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  color: var(--admin-blue);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 700;
  min-height: 26px;
  padding: 4px 8px;
  white-space: nowrap;
}

.portal-dashboard-health.success {
  border-color: rgba(47, 158, 68, 0.45);
  color: var(--admin-success);
}

.portal-dashboard-health.warning,
.portal-dashboard-widget.warning .portal-dashboard-status {
  border-color: rgba(183, 121, 31, 0.45);
  color: var(--admin-warning);
}

.portal-dashboard-widget {
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: #ffffff;
}

.portal-dashboard-widget.warning {
  border-color: rgba(183, 121, 31, 0.48);
}

.portal-dashboard-widget-heading {
  align-items: flex-start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
}

.portal-dashboard-widget h3 {
  margin: 0 0 10px;
  color: var(--admin-blue);
  font-size: 14px;
}

.portal-dashboard-widget p {
  margin: 0;
  color: var(--admin-muted);
  font-size: 13px;
  line-height: 1.45;
}

.portal-dashboard-value {
  margin-top: 14px;
  color: var(--admin-blue);
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.portal-dashboard-detail,
.portal-dashboard-action {
  color: var(--admin-muted);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 8px;
}

.portal-dashboard-action {
  color: var(--admin-blue);
  font-weight: 700;
}

.text-button {
  align-items: center;
  border: 0;
  color: var(--admin-blue);
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: var(--admin-button-font-size);
  font-weight: 400;
  justify-content: center;
  line-height: normal;
  text-align: center;
}

.text-button.danger {
  color: var(--admin-blue);
}

.customer-name-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.customer-provisioning-pill {
  flex: 0 0 auto;
}

.portal-customer-actions {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.portal-customer-actions .text-button,
.portal-customer-actions .muted-text {
  line-height: 1.2;
  max-width: 170px;
  overflow-wrap: normal;
  text-align: left;
  white-space: normal;
  word-break: normal;
}

.text-button:disabled {
  color: #9aa39e;
  cursor: default;
}

.portal-confirmation-message {
  color: var(--admin-muted);
  font-size: 13px;
  line-height: 1.35;
  margin: 0 0 16px;
}

.portal-confirmation-actions {
  justify-content: flex-start;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: calc(var(--admin-fixed-header-height) + 24px) 24px 24px calc(var(--admin-sidebar-width) + 24px);
  background: rgba(7, 16, 24, 0.42);
  z-index: 30000;
}

.modal-overlay.hidden {
  display: none;
}

.admin-modal {
  width: calc(100vw - 32px);
  max-width: 420px;
  max-height: min(780px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  background: #ffffff;
  box-shadow: var(--admin-shadow);
  padding: 18px;
}

.admin-modal-wide {
  display: flex;
  flex-direction: column;
  width: min(1250px, 88vw);
  max-width: min(1250px, calc(100vw - 32px));
  max-height: min(760px, 88vh);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 8px;
}

.modal-header h2 {
  margin: 0;
  color: var(--admin-blue);
  font-size: 16px;
  line-height: 1.25;
}

.icon-button {
  align-items: center;
  display: inline-flex;
  height: var(--admin-button-height);
  justify-content: center;
  min-width: var(--admin-button-min-width);
  padding: 0 var(--admin-button-padding-x);
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  color: var(--admin-blue);
  background: #ffffff;
  font-size: var(--admin-button-font-size);
  font-weight: 400;
  line-height: normal;
  cursor: pointer;
}

.icon-button:hover {
  background: var(--admin-blue-soft);
}

.admin-form {
  display: grid;
  gap: 14px;
}

.admin-modal-body {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding-right: 4px;
}

.admin-modal-box {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 14px;
}

.admin-modal-form-box {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  display: grid;
  gap: 14px;
  padding: 14px;
}

.admin-modal-box h3 {
  margin: 0 0 12px;
  color: var(--admin-blue);
  font-size: 14px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 0;
  padding: 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
}

.admin-modal-box .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 0;
  padding: 0;
  border: 0;
}

.admin-modal-form-box .form-grid {
  border: 0;
  padding: 0;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-field span {
  color: var(--admin-blue);
  font-size: 13px;
  font-weight: 700;
}

.form-field.field-error span {
  color: var(--admin-danger);
}

.form-field input,
.form-field select {
  width: 100%;
  height: var(--admin-button-height);
  min-height: var(--admin-button-height);
  padding: 0 10px;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  color: var(--admin-text);
  background: #ffffff;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.35;
}

.form-field.field-error input,
.form-field.field-error select,
.form-field.field-error textarea {
  border-color: var(--admin-danger);
}

.form-field.field-error input:focus,
.form-field.field-error select:focus,
.form-field.field-error textarea:focus {
  border-color: var(--admin-danger);
  box-shadow: 0 0 0 3px rgba(198, 78, 57, 0.14);
}

.form-field select,
.portal-landing-control select,
.portal-landing-orientation-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='8' viewBox='0 0 14 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0h14L7 8z' fill='%23111b16'/%3E%3C/svg%3E");
  background-position: calc(100% - 8px) 50%;
  background-repeat: no-repeat;
  background-size: 14px 8px;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
  padding-right: var(--admin-control-arrow-padding-x);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-field input:focus,
.form-field select:focus {
  border-color: var(--admin-blue);
  box-shadow: 0 0 0 3px rgba(0, 49, 72, 0.12);
  outline: 0;
}

.form-field input:disabled,
.form-field select:disabled {
  background: #f7f9f6;
  color: #6b7771;
  cursor: default;
}

select:not(:disabled),
.form-field select:not(:disabled),
.portal-landing-control select:not(:disabled),
.portal-landing-orientation-select:not(:disabled) {
  cursor: pointer;
}

.app-select-menu {
  background: #ffffff;
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  box-shadow: 0 10px 28px rgba(0, 49, 72, 0.14);
  color: var(--admin-text);
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: min(320px, calc(100vh - 24px));
  min-width: 0;
  overflow: hidden;
  padding: 0;
  position: absolute;
  z-index: 31000;
}

.app-select-menu[hidden] {
  display: none;
}

.app-select-search {
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid var(--admin-border);
  border-radius: 0;
  color: var(--app-select-color, var(--admin-text));
  flex: 0 0 auto;
  font: inherit;
  font-size: var(--app-select-font-size, 14px);
  font-weight: var(--app-select-font-weight, 400);
  height: var(--admin-button-height);
  min-height: var(--admin-button-height);
  padding: 0 10px;
  width: 100%;
}

.app-select-search:focus {
  border-bottom-color: var(--admin-blue);
  box-shadow: none;
  outline: 0;
}

.app-select-search::placeholder {
  color: #9aa39e;
  opacity: 1;
}

.app-select-options {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
  overflow: auto;
}

.app-select-option {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: var(--admin-radius);
  color: var(--app-select-color, var(--admin-text));
  cursor: pointer;
  display: block;
  font: inherit;
  font-size: var(--app-select-font-size, 14px);
  font-weight: var(--app-select-font-weight, 400);
  min-height: var(--admin-button-height);
  padding: 0 var(--admin-control-arrow-padding-x) 0 var(--app-select-option-padding-left, 10px);
  position: relative;
  text-align: left;
  width: 100%;
}

.app-select-menu.compact .app-select-option {
  display: block;
  padding-left: var(--app-select-option-padding-left, 4px);
  padding-right: var(--admin-control-arrow-padding-x);
  position: relative;
}

.app-select-menu.field-aligned .app-select-option,
.app-select-menu.compact.field-aligned .app-select-option {
  padding-left: var(--app-select-option-padding-left, 10px);
}

.app-select-menu.admin-environment-menu .app-select-option,
.app-select-menu.admin-environment-menu.compact.field-aligned .app-select-option {
  padding-left: 12px;
  padding-right: 28px;
  text-align: center;
}

.app-select-menu.admin-environment-menu .app-select-option-check {
  right: 10px;
}

.app-select-option:hover,
.app-select-option.active {
  background: #f2f5f3;
}

.app-select-option.selected {
  background: #eef3f0;
}

.app-select-option-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-select-option-check {
  color: var(--admin-blue);
  font-weight: 700;
  line-height: 1;
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
}

.app-select-empty {
  color: var(--app-select-color, var(--admin-muted));
  font: inherit;
  font-size: var(--app-select-font-size, 14px);
  font-weight: var(--app-select-font-weight, 400);
  padding: 8px 10px;
}

.form-error {
  align-items: center;
  color: var(--admin-danger);
  display: inline-flex;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.2;
  margin-left: 4px;
  min-height: var(--admin-button-height);
}

.admin-modal-form-box .form-error:empty {
  display: none;
}

.admin-modal-form-box .form-actions {
  margin-top: 0;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-content-grid {
    grid-template-columns: 1fr;
  }

  .portal-dashboard-grid {
    grid-template-columns: 1fr;
  }

  .portal-dashboard-overview,
  .portal-enterprise-context-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .portal-enterprise-context-metrics {
    flex-basis: auto;
    grid-template-columns: 1fr;
  }

  .portal-landing-section-grid,
  .portal-landing-image-editor {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1380px) {
  .portal-landing-footer-editor {
    grid-template-columns: 1fr;
  }

  .portal-landing-footer-preview-panel {
    border-left: 0;
    border-top: 1px solid var(--admin-border);
    padding: 14px;
  }
}

@media (max-width: 1180px) {
  .portal-landing-footer-layout,
  .portal-landing-footer-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .portal-landing-footer-row {
    align-items: stretch;
    grid-template-columns: 24px minmax(0, 1fr) 34px;
  }

  .portal-landing-footer-row > :nth-child(3),
  .portal-landing-footer-row > :nth-child(4),
  .portal-landing-footer-row > :nth-child(5) {
    grid-column: 2 / -1;
  }

  .portal-landing-footer-row > :last-child {
    grid-column: 3;
    grid-row: 1;
  }
}

.portal-login-overlay {
  align-items: center;
  background: #ffffff;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  z-index: 11000;
}

.portal-login-modal {
  max-width: 420px;
  width: min(420px, calc(100vw - 48px));
}

.portal-login-form-shell {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  display: grid;
  gap: 14px;
  padding: 14px;
}

.portal-login-form-shell input {
  font-weight: 400;
}

.portal-login-password-field {
  display: block;
  position: relative;
}

.portal-login-password-field input {
  padding-right: 42px;
  width: 100%;
}

.portal-login-password-toggle {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: rgba(0, 49, 72, 0.72);
  cursor: pointer;
  display: inline-flex;
  height: 30px;
  justify-content: center;
  padding: 0;
  position: absolute;
  right: 3px;
  top: 2px;
  touch-action: manipulation;
  width: 34px;
}

.portal-login-password-toggle:hover,
.portal-login-password-toggle:focus-visible {
  background: rgba(0, 49, 72, 0.08);
  color: var(--admin-blue);
  outline: none;
}

.portal-login-password-toggle svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

.portal-login-form-shell .form-actions {
  justify-content: flex-start;
}

.portal-forgot-password-button {
  align-self: flex-start;
  background: transparent;
  border: 0;
  color: var(--admin-blue);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 14px;
  font-weight: 400;
  justify-self: flex-start;
  margin-top: -4px;
  padding: 0;
  text-align: left;
  width: fit-content;
}

@media (hover: none) and (pointer: coarse) {
  :root {
    --admin-zoom: 1;
    --admin-sidebar-width: 72px;
    --admin-page-side-gap: 12px;
    --admin-min-content-width: 0px;
    --admin-min-page-width: 0px;
    --admin-button-font-size: 16px;
  }

  html {
    min-width: 0;
    overflow-x: hidden;
    width: 100%;
  }

  html.admin-page-fits-viewport-y,
  html.admin-page-fits-viewport-y body {
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
  }

  body {
    min-height: 100vh;
    min-width: 0;
    overflow-x: hidden;
    width: 100%;
    zoom: 1;
  }

  .admin-shell {
    min-height: 100vh;
    min-width: 0;
    width: 100%;
  }

  .admin-sidebar {
    padding: 12px 8px 14px;
    width: var(--admin-sidebar-width);
  }

  .admin-brand {
    justify-content: center;
    padding: 0;
    width: var(--admin-sidebar-width);
  }

  .admin-brand-name,
  .admin-brand-subtitle,
  .admin-nav-label,
  .admin-side-powered {
    display: none;
  }

  .admin-nav-item {
    justify-content: center;
    min-height: 42px;
    padding: 0;
  }

  .admin-fixed-header {
    gap: 8px;
    padding: 0 12px;
  }

  .admin-main {
    margin: var(--admin-fixed-header-height) var(--admin-page-side-gap) 0 calc(var(--admin-sidebar-width) + var(--admin-page-side-gap));
    min-height: calc(100vh - var(--admin-fixed-header-height));
    min-width: 0;
    padding-top: 14px;
    width: calc(100vw - var(--admin-sidebar-width) - (var(--admin-page-side-gap) * 2));
  }

  .admin-topbar.dashboard-mode {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .admin-content-grid,
  .portal-dashboard-grid,
  .portal-landing-section-grid,
  .portal-landing-image-editor {
    grid-template-columns: 1fr;
  }

  .admin-table-wrap,
  .portal-section-body,
  .portal-subtabs,
  .portal-tab-panel {
    max-width: 100%;
    overflow-x: auto;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  select,
  textarea,
  .primary-button,
  .secondary-button,
  .danger-button,
  .text-button,
  .app-select-button,
  .app-select-search {
    font-size: 16px;
  }

  .admin-profile-menu,
  .app-select-menu {
    max-width: calc(100vw - 20px);
  }

.admin-modal,
  .portal-login-modal {
    max-height: calc(100dvh - 32px);
    overflow: auto;
    width: min(680px, calc(100vw - 24px));
  }
}

.portal-diagnostics-toolbar {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 0 0 16px;
}

.portal-operations-map {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  margin: 0 0 16px;
}

.portal-operations-map article,
.portal-enterprise-context-panel {
  border: 1px solid var(--admin-border);
  border-radius: var(--admin-radius);
  padding: 12px 14px;
}

.portal-operations-map strong {
  color: var(--admin-blue);
  display: block;
  font-size: 13px;
  line-height: 1.25;
  margin: 0 0 5px;
}

.portal-operations-map span {
  color: var(--admin-muted);
  display: block;
  font-size: 12px;
  line-height: 1.4;
}

.portal-diagnostics-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin: 0 0 18px;
}

.portal-diagnostics-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.portal-diagnostics-callout {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--body-text);
  margin: 0 0 16px;
  padding: 12px 14px;
}

.portal-diagnostics-callout.warning {
  border-color: #e0b647;
}

.portal-diagnostics-card {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 14px 16px;
}

.portal-diagnostics-card.warning {
  border-color: #e0b647;
}

.portal-diagnostics-card.critical {
  border-color: #d4513b;
}

.portal-diagnostics-card span {
  color: var(--muted-text);
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
}

.portal-diagnostics-card strong {
  color: var(--admin-blue);
  display: block;
  font-size: 21px;
  line-height: 1.2;
}

.portal-diagnostics-metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin: 0 0 16px;
}

.portal-diagnostics-metric-card {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px 14px;
}

.portal-diagnostics-metric-card span {
  color: var(--muted-text);
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
}

.portal-diagnostics-metric-card strong {
  color: var(--admin-blue);
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.portal-diagnostics-quick-filters {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.portal-diagnostics-quick-filters .compact {
  padding: 6px 10px;
}

.portal-diagnostics-section {
  border-top: 1px solid var(--border-color);
  padding: 18px 0;
}

.portal-diagnostics-section h3 {
  color: var(--admin-blue);
  font-size: 19px;
  margin: 0 0 12px;
}

.portal-diagnostics-subtitle {
  color: var(--admin-blue);
  font-size: 16px;
  margin: 16px 0 10px;
}

.portal-diagnostics-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin: 0 0 12px;
}

.portal-diagnostics-summary span,
.portal-diagnostics-empty {
  color: var(--muted-text);
  font-size: 16px;
}

.portal-diagnostics-table-wrap {
  max-height: min(560px, calc(100dvh - 260px));
  max-width: 100%;
  overflow: auto;
  overscroll-behavior-x: contain;
}

.portal-diagnostics-table {
  width: max-content;
  min-width: 3600px;
  table-layout: auto;
}

.portal-diagnostics-failures-table {
  min-width: 3000px;
}

.portal-diagnostics-skipped-table {
  min-width: 2800px;
}

.portal-diagnostics-timeline-table {
  min-width: 3000px;
}

.portal-diagnostics-table th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.portal-diagnostics-table th,
.portal-diagnostics-table td {
  min-width: 170px;
  max-width: 520px;
  overflow-wrap: break-word;
  vertical-align: top;
  white-space: normal;
  word-break: normal;
}

.portal-diagnostics-failures-table th,
.portal-diagnostics-failures-table td {
  min-width: 180px;
  max-width: 560px;
}

.portal-diagnostics-table .portal-diagnostics-message-column {
  min-width: 380px;
  width: 380px;
  max-width: 620px;
}

.portal-diagnostics-table .portal-diagnostics-details-column {
  min-width: 480px;
  width: 480px;
  max-width: 760px;
}

.portal-diagnostics-row-warning td {
  background: #fff8e5;
}

.portal-diagnostics-row-critical td {
  background: #fff0ec;
}

.portal-diagnostics-search {
  margin: 0 0 12px;
  max-width: 420px;
}

.portal-diagnostics-maintenance {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin: 0 0 12px;
}

.portal-diagnostics-maintenance label {
  color: var(--admin-blue);
  display: grid;
  font-weight: 700;
  gap: 6px;
}

.portal-diagnostics-maintenance input {
  width: 100%;
}

.portal-diagnostics-filters {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin: 0 0 16px;
  padding: 14px;
}

.portal-diagnostics-filters label {
  color: var(--admin-blue);
  display: grid;
  font-size: 14px;
  font-weight: 700;
  gap: 6px;
  min-width: 0;
}

.portal-diagnostics-filters input,
.portal-diagnostics-filters select {
  min-width: 0;
  width: 100%;
}

.portal-diagnostics-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.portal-diagnostics-copy {
  display: inline-flex;
  font-size: 14px;
  margin-left: 8px;
  padding: 0;
}

.portal-diagnostics-detail-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.portal-diagnostics-detail-actions .portal-diagnostics-copy {
  margin-left: 0;
}

.portal-diagnostics-details-view {
  display: grid;
  gap: 14px;
}

.portal-diagnostics-details-section {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
}

.portal-diagnostics-details-section h3 {
  color: var(--admin-blue);
  font-size: 16px;
  margin: 0 0 10px;
}

.portal-diagnostics-details-section dl {
  display: grid;
  gap: 8px 14px;
  grid-template-columns: minmax(140px, max-content) minmax(0, 1fr);
  margin: 0;
}

.portal-diagnostics-details-section dt {
  color: var(--admin-blue);
  font-weight: 700;
}

.portal-diagnostics-details-section dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.portal-diagnostics-details-section pre {
  background: #f7fafb;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  margin: 0;
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

.mobile-landscape-overlay[hidden] {
  display: none !important;
}

.mobile-landscape-overlay {
  align-items: center;
  background: rgba(0, 49, 72, 0.96);
  color: #ffffff;
  display: none;
  inset: 0;
  justify-content: center;
  padding: 24px;
  pointer-events: auto;
  position: fixed;
  text-align: center;
  touch-action: none;
  z-index: 40000;
}

.mobile-landscape-message {
  align-items: center;
  display: flex;
  flex-direction: column;
  max-width: 360px;
}

.mobile-landscape-icon {
  color: #d9eef6;
  display: block;
  height: 76px;
  margin: 0 auto 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 4;
  width: 76px;
}

.mobile-landscape-message strong {
  display: block;
  font-size: 20px;
  line-height: 1.35;
}
