/* Final visual authority: flat EMQX-inspired operations console. */
:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-rgb: 255, 255, 255;
  --surface-solid: #ffffff;
  --surface-soft: #f0f3f7;
  --text: #1e293b;
  --text-rgb: 30, 41, 59;
  --muted: #64748b;
  --line: #d9e2ec;
  --line-rgb: 217, 226, 236;
  --primary: #0478b2;
  --primary-rgb: 4, 120, 178;
  --primary-strong: #035e8c;
  --primary-strong-rgb: 3, 94, 140;
  --accent: #1677ff;
  --accent-rgb: 22, 119, 255;
  --accent-soft: #e8f1ff;
  --success: #00a870;
  --warning: #d99000;
  --danger: #d64545;
  --radius-xl: 10px;
  --radius-lg: 8px;
  --radius-md: 6px;
  --radius-sm: 4px;
  --ui-panel-radius: 8px;
  --ui-control-radius: 6px;
  --shadow: none;
  --shadow-soft: none;
  --tag-shadow: none;
  --ui-shadow: none;
  --ui-panel-shadow: none;
  --app-panel-shadow: none;
  --app-panel-shadow-hover: none;
  --app-shell-shadow: none;
}

body:not(.auth-page),
body.auth-page main {
  background: #f5f7fa !important;
}

body :where(.topbar, .footer) {
  background: #ffffff !important;
  border-color: #d9e2ec !important;
  box-shadow: none !important;
}

body.app-standard #main-content,
body.admin-page.app-standard #main-content {
  background: #f5f7fa !important;
}

body.app-standard #main-content > .section {
  padding-block: 20px 32px;
}

body.app-standard #main-content > .section > .container {
  max-width: 1760px;
}

body:not(.inventory-map-body) #main-content :where(
  .card, .panel, .solution-explorer-shell, .solution-filter-panel,
  .solution-group-section, .global-search-panel, .global-search-results,
  .global-search-hero, .global-section-card, .business-app-card,
  .user-space-panel, .notifications-page, .notification-inbox-item,
  .support-filter-panel, .support-command-bar, .support-action-board,
  .support-bulk-form, .admin-main-panel, .admin-overview-section,
  .admin-overview-metric, .admin-overview-alert-row, .admin-filters,
  .admin-list-header, .admin-form-block, .admin-detail-panel,
  .admin-detail-copy-card, .admin-ticket-queue, .phd-browser-panel,
  .infra-browser-panel, .status-page-panel, .login-page-shell,
  .login-page-header, .login-page-panel, .service-ops-section,
  .gateway-detail-section, .alarm-list-section) {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

body.app-standard #main-content :where(
  .section-head, .admin-list-header, .admin-overview-head,
  .solution-catalog-header, .request-form-header, .request-success-header,
  .support-form-header, .support-success-header, .report-form-header,
  .report-preview-header, .user-requests-header, .user-tickets-header,
  .user-notifications-header, .my-alarm-history-header, .phd-browser-head,
  .phd-record-head, .infra-browser-head, .service-ops-head, .lorawan-header,
  .gateway-detail-header) {
  align-items: end;
  border-bottom: 1px solid #d9e2ec !important;
  margin-bottom: 18px !important;
  padding-bottom: 14px;
}

body.app-standard #main-content :where(
  .solution-filter-panel, .catalog-filter-panel, .global-search-panel,
  .my-tickets-filters, .admin-filters, .admin-filter-panel,
  .phd-browser-filters, .infra-browser-filters, .lorawan-filter-form,
  .inventory-device-filter-panel, .alarm-filter-panel) {
  padding: 16px !important;
}

body.app-standard #main-content :where(
  .solution-filter-stats > *, .user-requests-summary > *,
  .my-tickets-summary > *, .user-notifications-summary > *,
  .admin-overview-metrics > *, .phd-browser-metrics > *,
  .infra-browser-status > *, .lorawan-overview > *,
  .service-ops-metrics > *, .gateway-detail-metrics > *,
  .alarm-summary-grid > *) {
  background: #f8fafc !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}

body:not(.auth-page) :where(.btn, button.btn) {
  border-radius: 6px !important;
  box-shadow: none !important;
  font-weight: 700;
}

body:not(.auth-page) :where(.btn-primary, button.btn-primary) {
  background: #0478b2 !important;
  border-color: #0478b2 !important;
  color: #ffffff !important;
}

body:not(.auth-page) :where(.btn-primary, button.btn-primary):hover,
body:not(.auth-page) :where(.btn-primary, button.btn-primary):focus-visible {
  background: #035e8c !important;
  border-color: #035e8c !important;
}

body:not(.auth-page) :where(.btn-outline, .btn-secondary) {
  background: #ffffff !important;
  border-color: #c7d4e0 !important;
  color: #334155 !important;
}

body:not(.auth-page) #main-content :where(input, select, textarea) {
  background: #ffffff !important;
  border: 1px solid #c7d4e0 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}

body:not(.auth-page) #main-content :where(input, select, textarea):focus {
  border-color: #1677ff !important;
  box-shadow: 0 0 0 2px #e8f1ff !important;
}

body:not(.auth-page) #main-content :where(.table-wrap, .table-responsive, .table-wrapper) {
  background: #ffffff !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

body:not(.auth-page) #main-content :where(.table-simple, .admin-table) th {
  background: #f0f3f7 !important;
  border-bottom: 1px solid #d9e2ec !important;
  color: #475569 !important;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body:not(.auth-page) #main-content :where(.table-simple, .admin-table) td {
  border-bottom: 1px solid #edf1f5 !important;
}

body:not(.auth-page) #main-content :where(.table-simple, .admin-table) tbody tr:hover,
body:not(.auth-page) #main-content :where(.item-card, .business-app-card, .global-result-card, .search-result-card, .notification-inbox-item, .simple-list-item, .admin-overview-alert-row):hover {
  background: #f8fafc !important;
  box-shadow: none !important;
  transform: none !important;
}

body:not(.auth-page) #main-content :where(.badge, .status-badge, .pill, .chip) {
  border-radius: 4px !important;
  box-shadow: none !important;
}

body:not(.auth-page) #main-content :where(.badge.primary, .badge-success, .is-ok) {
  background: #e8f4fa !important;
  border-color: #0478b2 !important;
  color: #035e8c !important;
}

body:not(.auth-page) #main-content :where(.badge.info, .badge.is-info, .is-info) {
  background: #e8f1ff !important;
  border-color: #1677ff !important;
  color: #0958c7 !important;
}

body:not(.auth-page) :where(.account-panel, .notification-panel, .app-modal) {
  background: #ffffff !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

body:not(.auth-page) .notification-item.unread,
body:not(.auth-page) .flash-stack .flash.success {
  background: #edf9f4 !important;
  border-left: 3px solid #0478b2 !important;
}

body:not(.auth-page) .flash-stack .flash {
  background: #ffffff !important;
  border: 1px solid #d9e2ec !important;
  border-left: 3px solid #1677ff !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}

body:not(.auth-page) .flash-stack .flash.success {
  background: #edf9f4 !important;
  border-left-color: #0478b2 !important;
}

body:not(.auth-page) .flash-stack .flash.error {
  background: #fef2f2 !important;
  border-left-color: #d64545 !important;
}

body.app-standard #main-content :where(.empty-state, .no-results, .not-found-state) {
  background: #f8fafc !important;
  border: 1px dashed #c7d4e0 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

body.app-standard #main-content :where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid #1677ff;
  outline-offset: 2px;
}

@media (max-width: 920px) {
  body.app-sidebar-page .topbar .brand {
    display: inline-flex;
  }

  body.app-sidebar-page .app-topbar-breadcrumbs {
    display: none;
  }
}

@media (max-width: 760px) {
  body.app-standard #main-content > .section {
    padding-block: 14px 24px;
  }

  body.app-standard #main-content :where(.solution-filter-panel, .catalog-filter-panel,
    .global-search-panel, .my-tickets-filters, .admin-filters, .admin-filter-panel,
    .phd-browser-filters, .infra-browser-filters, .lorawan-filter-form,
    .inventory-device-filter-panel, .alarm-filter-panel) {
    padding: 12px !important;
  }
}

/* Detalle TAG Explorer: ficha de lectura con foco en el dato y el contexto. */
body #main-content .phd-record-page {
  max-width: 1180px;
}

body #main-content .phd-detail-back {
  color: #0b648c;
  display: inline-flex;
  font-size: .78rem;
  font-weight: 750;
  margin-bottom: -6px;
  text-decoration: none;
}

body #main-content .phd-detail-back:hover { text-decoration: underline; }

body #main-content .phd-record-head {
  align-items: stretch;
  background: #fff;
  border: 1px solid #dfe8ee;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(16, 55, 80, .06);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(210px, 265px) auto;
  padding: 26px 28px;
}

body #main-content .phd-record-head > div:first-child { min-width: 0; }
body #main-content .phd-record-head h1 { color: #173b52; font-size: clamp(1.55rem, 3vw, 2.2rem); }
body #main-content .phd-record-head p { max-width: 680px; }
body #main-content .phd-record-head > .btn { align-self: start; }

body #main-content .phd-record-hero-value {
  align-self: center;
  background: linear-gradient(145deg, #edf9f5, #f7fcfb);
  border: 1px solid #bce5d8;
  border-radius: 14px;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 16px 18px;
}

body #main-content .phd-record-hero-value span {
  color: #397b6d;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

body #main-content .phd-record-hero-value strong {
  color: #087965;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(1.25rem, 2.6vw, 1.85rem);
  line-height: 1.15;
  overflow-wrap: anywhere;
}

body #main-content .phd-record-hero-value small { color: #5f8279; font-size: .72rem; }

body #main-content .phd-record-metrics {
  background: #fff;
  border: 1px solid #dfe8ee;
  border-radius: 13px;
  box-shadow: 0 4px 14px rgba(16, 55, 80, .035);
  overflow: hidden;
}

body #main-content .phd-record-metrics > div { border-left: 1px solid #e5edf2; padding: 16px 18px; }
body #main-content .phd-record-metrics > div:first-child { border-left: 0; }
body #main-content .phd-record-metrics strong { color: #214b63; }

body #main-content .phd-record-grid { gap: 18px; }
body #main-content .phd-record-section {
  background: #fff;
  border: 1px solid #dfe8ee;
  border-radius: 13px;
  box-shadow: 0 4px 14px rgba(16, 55, 80, .035);
  padding: 18px;
}

body #main-content .phd-record-section-head { border-bottom: 1px solid #edf2f5; padding-bottom: 12px; }
body #main-content .phd-record-section-head h2 { color: #1c4861; font-size: .98rem; }
body #main-content .phd-record-facts,
body #main-content .phd-record-properties { border: 0; }
body #main-content .phd-record-facts > div,
body #main-content .phd-record-properties > div { padding-inline: 0; }

body #main-content .phd-record-properties { gap: 9px; }
body #main-content .phd-record-properties > div {
  background: #f7fafc;
  border: 1px solid #e5edf2 !important;
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 11px 12px;
}
body #main-content .phd-record-properties dd { color: #31566a; font-size: .78rem; text-align: left; }

body #main-content .phd-record-technical {
  background: #fff;
  border: 1px solid #dfe8ee;
  border-radius: 13px;
  box-shadow: 0 4px 14px rgba(16, 55, 80, .035);
  padding-inline: 18px;
}
body #main-content .phd-record-technical > summary { min-height: 58px; }

@media (max-width: 900px) {
  body #main-content .phd-record-head { grid-template-columns: minmax(0, 1fr) minmax(190px, .7fr); }
  body #main-content .phd-record-head > .btn { grid-column: 1 / -1; justify-self: start; }
}

@media (max-width: 620px) {
  body #main-content .phd-record-head { border-radius: 13px; display: flex; flex-direction: column; padding: 19px; }
  body #main-content .phd-record-hero-value { width: 100%; }
  body #main-content .phd-record-metrics > div { border-left: 0; }
  body #main-content .phd-record-section { padding: 14px; }
}

.phd-record-topic {
  align-items: center;
  background: #f7fafc;
  border: 1px solid #d9e2ec;
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 14px;
  max-width: 100%;
  padding: 9px 12px;
}

.phd-record-topic span {
  color: #64748b;
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.phd-record-topic code {
  color: #0f4c81;
  font-size: .78rem;
  overflow-wrap: anywhere;
}

.phd-record-metric-value strong {
  color: #0f766e;
  font-size: clamp(1.05rem, 2.4vw, 1.45rem);
  overflow-wrap: anywhere;
}

.phd-record-properties > div,
.phd-record-properties dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  body #main-content .phd-browser-table-wrap {
    overflow: visible !important;
  }

  body #main-content .phd-browser-table {
    border-collapse: separate;
    border-spacing: 0 10px;
    display: block;
    table-layout: auto;
  }

  body #main-content .phd-browser-table thead {
    display: none;
  }

  body #main-content .phd-browser-table tbody,
  body #main-content .phd-browser-table tr,
  body #main-content .phd-browser-table td {
    display: block;
    width: 100% !important;
  }

  body #main-content .phd-browser-table tr {
    background: #fff;
    border: 1px solid #d9e2ec;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .04);
    padding: 4px 12px;
  }

  body #main-content .phd-browser-table td {
    align-items: start;
    border-bottom: 1px solid #edf1f5 !important;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(90px, 34%) minmax(0, 1fr);
    padding: 10px 0 !important;
    text-align: left;
  }

  body #main-content .phd-browser-table td:last-child {
    border-bottom: 0 !important;
  }

  body #main-content .phd-browser-table td::before {
    color: #64748b;
    content: attr(data-label);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
  }

  body #main-content .phd-browser-table .phd-browser-updated {
    padding-right: 36px !important;
  }

  .phd-record-topic {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }
}

/* Lista de Infraestructura con lectura por tarjetas, como TAG Explorer. */
body #main-content .infra-host-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

body #main-content .infra-host-card {
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 10px;
  min-width: 0;
  overflow: visible;
  padding: 16px;
}

body #main-content .infra-host-card:hover {
  border-color: #9bcfba;
  box-shadow: 0 5px 16px rgba(23, 59, 53, .07);
}

body #main-content .infra-host-card-main {
  align-items: flex-start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  min-width: 0;
}

body #main-content .infra-host-card-identity {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  min-width: 0;
}

body #main-content .infra-host-select {
  padding-top: 5px;
}

body #main-content .infra-host-status-dot {
  background: #94a3b8;
  border: 4px solid #e2e8f0;
  border-radius: 50%;
  flex: 0 0 16px;
  height: 16px;
  margin-top: 5px;
  width: 16px;
}

body #main-content .infra-host-status-dot.is-online { background: #00a878; border-color: #c7efdc; }
body #main-content .infra-host-status-dot.is-warning { background: #d97706; border-color: #fce7b2; }
body #main-content .infra-host-status-dot.is-offline { background: #c2413b; border-color: #f5d0cd; }

body #main-content .infra-host-card-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}

body #main-content .infra-host-card h4 {
  font-size: 1.08rem;
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
}

body #main-content .infra-host-card h4 a {
  color: #173b35;
  text-decoration: none;
}

body #main-content .infra-host-card h4 a:hover,
body #main-content .infra-host-card h4 a:focus-visible {
  color: #087a5a;
  text-decoration: underline;
}

body #main-content .infra-host-card p {
  color: #627b75;
  font-size: .82rem;
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}

body #main-content .infra-host-card-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

body #main-content .infra-host-card-actions .btn {
  white-space: nowrap;
}

body #main-content .infra-host-card-metrics {
  border-top: 1px solid #e6edf2;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(125px, 1fr));
  margin-top: 16px;
  padding-top: 14px;
}

body #main-content .infra-host-card-metrics > div {
  border-left: 1px solid #e6edf2;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding-left: 12px;
}

body #main-content .infra-host-card-metrics > div:first-child {
  border-left: 0;
  padding-left: 0;
}

body #main-content .infra-host-card-metrics span:first-child {
  color: #71858a;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

body #main-content .infra-host-card-metrics strong {
  color: #173b35;
  font-size: .94rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

body #main-content .infra-host-card-metrics small {
  color: #71858a;
  overflow-wrap: anywhere;
}

body #main-content .infra-card-disk .infra-disk-bar {
  margin-top: 3px;
}

@media (max-width: 900px) {
  body #main-content .infra-host-card-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body #main-content .infra-host-card-metrics > div:nth-child(odd) {
    border-left: 0;
    padding-left: 0;
  }
}

@media (max-width: 600px) {
  body #main-content .infra-host-card-main {
    flex-direction: column;
  }

  body #main-content .infra-host-card-actions {
    padding-left: 26px;
    width: calc(100% - 26px);
  }

  body #main-content .infra-host-card-actions .btn {
    flex: 1;
  }

  body #main-content .infra-host-card-metrics {
    grid-template-columns: 1fr;
  }

  body #main-content .infra-host-card-metrics > div,
  body #main-content .infra-host-card-metrics > div:nth-child(odd) {
    border-left: 0;
    border-top: 1px solid #e6edf2;
    padding-left: 0;
    padding-top: 10px;
  }

  body #main-content .infra-host-card-metrics > div:first-child {
    border-top: 0;
    padding-top: 0;
  }
}

/* Cobertura LoRaWAN: entidades en tarjetas legibles, sin tablas comprimidas. */
body #main-content .lorawan-entity-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

body #main-content .lorawan-entity-card {
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 9px;
  min-width: 0;
  padding: 14px 16px;
}

body #main-content .lorawan-entity-card:hover {
  border-color: #9bcfba;
  box-shadow: 0 4px 14px rgba(23, 59, 53, .06);
}

body #main-content .lorawan-entity-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
}

body #main-content .lorawan-entity-kicker {
  color: #087a5a;
  display: block;
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

body #main-content .lorawan-entity-head h4 {
  color: #173b35;
  font-size: 1rem;
  line-height: 1.25;
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

body #main-content .lorawan-entity-head p {
  color: #71858a;
  font-size: .78rem;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

body #main-content .lorawan-entity-metrics {
  border-top: 1px solid #e6edf2;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
  padding-top: 11px;
}

body #main-content .lorawan-entity-metrics > div {
  border-left: 1px solid #e6edf2;
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-left: 11px;
}

body #main-content .lorawan-entity-metrics > div:first-child {
  border-left: 0;
  padding-left: 0;
}

body #main-content .lorawan-entity-metrics span {
  color: #71858a;
  font-size: .66rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

body #main-content .lorawan-entity-metrics strong {
  color: #173b35;
  font-size: .95rem;
  overflow-wrap: anywhere;
}

body #main-content .lorawan-entity-metrics small {
  color: #71858a;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  body #main-content .lorawan-entity-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body #main-content .lorawan-entity-metrics > div:nth-child(odd) {
    border-left: 0;
    padding-left: 0;
  }
}

@media (max-width: 460px) {
  body #main-content .lorawan-entity-head {
    flex-direction: column;
  }

  body #main-content .lorawan-entity-head > .badge {
    align-self: flex-start;
  }

  body #main-content .lorawan-entity-metrics {
    grid-template-columns: 1fr;
  }

  body #main-content .lorawan-entity-metrics > div,
  body #main-content .lorawan-entity-metrics > div:nth-child(odd) {
    border-left: 0;
    border-top: 1px solid #e6edf2;
    padding-left: 0;
    padding-top: 8px;
  }

  body #main-content .lorawan-entity-metrics > div:first-child {
    border-top: 0;
    padding-top: 0;
  }
}

/* Las tablas se adaptan al ancho disponible; el contenido se reparte dentro
   de las celdas para evitar scroll horizontal y columnas apelmazadas. */
body #main-content :where(.table-wrap, .table-responsive, .table-wrapper,
  .admin-list-table, .admin-demand-table, .infra-browser-table-wrap,
  .admin-device-table-wrap, .phd-table-wrapper) {
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden !important;
  overscroll-behavior-inline: auto;
}

body #main-content :where(.table-wrap, .table-responsive, .table-wrapper,
  .admin-list-table, .admin-demand-table, .infra-browser-table-wrap,
  .admin-device-table-wrap, .phd-table-wrapper) table {
  width: 100% !important;
  max-width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
}

body #main-content :where(.table-wrap, .table-responsive, .table-wrapper,
  .admin-list-table, .admin-demand-table, .infra-browser-table-wrap,
  .admin-device-table-wrap, .phd-table-wrapper) :is(th, td) {
  max-width: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal !important;
  word-break: normal;
}

body #main-content :where(.table-wrap, .table-responsive, .table-wrapper,
  .admin-list-table, .admin-demand-table, .infra-browser-table-wrap,
  .admin-device-table-wrap, .phd-table-wrapper) :is(button, .btn, .actions,
  .table-actions) {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Autoridad cromática final EMQX para toda la aplicación. */
:root {
  --bg: #f5f7fa !important;
  --surface: #ffffff !important;
  --surface-soft: #eef2f7 !important;
  --surface-muted: #e7edf4 !important;
  --text: #1f2937 !important;
  --muted: #64748b !important;
  --line: #d9e2ec !important;
  --primary: #0478b2 !important;
  --primary-strong: #035e8c !important;
  --accent: #00b3a4 !important;
  --success: #20b486 !important;
  --warning: #d99a2b !important;
  --danger: #d95c5c !important;
}

html[data-theme="dark"] {
  --bg: #101821 !important;
  --surface: #172331 !important;
  --surface-soft: #1e2d3d !important;
  --surface-muted: #26384b !important;
  --text: #e7edf4 !important;
  --muted: #aab7c7 !important;
  --line: #304256 !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar {
  background: #17202c !important;
  border-right: 1px solid #2a3748 !important;
  box-shadow: 8px 0 24px rgba(15, 23, 42, .08) !important;
  color: #b8c3d1 !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-brand,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-nav,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-footer,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-section,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-panel {
  background: transparent !important;
  border-color: #2a3748 !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-logo-copy strong,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-user-copy strong {
  color: #ffffff !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-logo-copy small,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-user-copy small,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-footer {
  color: #9eacbc !important;
}

html[data-theme="light"] body.app-sidebar-page :where(.app-sidebar-link, .app-sidebar-section > summary) {
  background: transparent !important;
  color: #b8c3d1 !important;
}

html[data-theme="light"] body.app-sidebar-page :where(.app-sidebar-link:hover,
  .app-sidebar-link:focus-visible, .app-sidebar-section > summary:hover,
  .app-sidebar-section > summary:focus-visible) {
  background: #253449 !important;
  color: #ffffff !important;
}

html[data-theme="light"] body.app-sidebar-page :where(.app-sidebar-link.active,
  .app-sidebar-section[open] > summary) {
  background: #253449 !important;
  box-shadow: inset 3px 0 0 #0478b2 !important;
  color: #ffffff !important;
}

html[data-theme="light"] body.app-sidebar-page :where(.app-sidebar-icon, .app-sidebar-chevron) {
  color: #8fa3ba !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-panel a { color: #9eacbc !important; }
html[data-theme="light"] body.app-sidebar-page .app-sidebar-panel a:hover,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-panel a.active {
  background: #202d3d !important;
  color: #ffffff !important;
}

html[data-theme="light"] body.app-sidebar-page .topbar,
html[data-theme="light"] body.app-sidebar-page .topbar-inner {
  background: #ffffff !important;
  border-color: #d9e2ec !important;
}

html[data-theme="light"] body.app-sidebar-page .topbar-global-search button,
body :where(.btn-primary, button.btn-primary, a.btn-primary) {
  background: #0478b2 !important;
  border-color: #0478b2 !important;
  color: #ffffff !important;
}

html[data-theme="light"] body.app-sidebar-page .topbar-global-search button:hover,
html[data-theme="light"] body.app-sidebar-page .topbar-global-search button:focus-visible,
body :where(.btn-primary, button.btn-primary, a.btn-primary):hover,
body :where(.btn-primary, button.btn-primary, a.btn-primary):focus-visible {
  background: #035e8c !important;
  border-color: #035e8c !important;
  color: #ffffff !important;
}

body :where(.badge.primary, .badge-info, .status-pill.info, .is-info) {
  background: #e8f4fa !important;
  border-color: #bedeef !important;
  color: #035e8c !important;
}

body :where(.badge.success, .badge-success, .status-pill.success, .is-ok) {
  background: #e5f7f0 !important;
  border-color: #bcebd9 !important;
  color: #14795a !important;
}

body :where(input, select, textarea):focus {
  border-color: #0478b2 !important;
  box-shadow: 0 0 0 3px rgba(4, 120, 178, .16) !important;
}

html[data-theme="dark"] body.app-sidebar-page .app-sidebar {
  background: #111923 !important;
  border-right-color: #26384b !important;
}

/* Capa final de identidad EMQX: debe permanecer al final de la cascada. */
:root {
  --bg: #f5f7fa !important;
  --surface: #ffffff !important;
  --surface-soft: #eef2f7 !important;
  --surface-muted: #e7edf4 !important;
  --text: #1f2937 !important;
  --muted: #64748b !important;
  --line: #d9e2ec !important;
  --primary: #0478b2 !important;
  --primary-strong: #035e8c !important;
  --accent: #00b3a4 !important;
  --success: #20b486 !important;
  --warning: #d99a2b !important;
  --danger: #d95c5c !important;
}

html[data-theme="dark"] {
  --bg: #101821 !important;
  --surface: #172331 !important;
  --surface-soft: #1e2d3d !important;
  --surface-muted: #26384b !important;
  --text: #e7edf4 !important;
  --muted: #aab7c7 !important;
  --line: #304256 !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar {
  background: #17202c !important;
  border-right: 1px solid #2a3748 !important;
  box-shadow: 8px 0 24px rgba(15, 23, 42, .08) !important;
  color: #b8c3d1 !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-brand,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-nav,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-footer,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-section,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-panel {
  background: transparent !important;
  border-color: #2a3748 !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-logo-copy strong,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-user-copy strong {
  color: #ffffff !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-logo-copy small,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-user-copy small,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-footer {
  color: #9eacbc !important;
}

html[data-theme="light"] body.app-sidebar-page :where(.app-sidebar-link, .app-sidebar-section > summary) {
  background: transparent !important;
  color: #b8c3d1 !important;
}

html[data-theme="light"] body.app-sidebar-page :where(.app-sidebar-link:hover,
  .app-sidebar-link:focus-visible, .app-sidebar-section > summary:hover,
  .app-sidebar-section > summary:focus-visible) {
  background: #253449 !important;
  color: #ffffff !important;
}

html[data-theme="light"] body.app-sidebar-page :where(.app-sidebar-link.active,
  .app-sidebar-section[open] > summary) {
  background: #253449 !important;
  box-shadow: inset 3px 0 0 #0478b2 !important;
  color: #ffffff !important;
}

html[data-theme="light"] body.app-sidebar-page :where(.app-sidebar-icon, .app-sidebar-chevron) {
  color: #8fa3ba !important;
}

html[data-theme="light"] body.app-sidebar-page :where(.app-sidebar-link:hover .app-sidebar-icon,
  .app-sidebar-link.active .app-sidebar-icon,
  .app-sidebar-section > summary:hover .app-sidebar-icon,
  .app-sidebar-section[open] > summary .app-sidebar-icon) {
  color: #0478b2 !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-panel a { color: #9eacbc !important; }
html[data-theme="light"] body.app-sidebar-page .app-sidebar-panel a:hover,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-panel a.active {
  background: #202d3d !important;
  color: #ffffff !important;
}

html[data-theme="light"] body.app-sidebar-page .topbar,
html[data-theme="light"] body.app-sidebar-page .topbar-inner {
  background: #ffffff !important;
  border-color: #d9e2ec !important;
}

html[data-theme="light"] body.app-sidebar-page .topbar-global-search button,
body :where(.btn-primary, button.btn-primary, a.btn-primary) {
  background: #0478b2 !important;
  border-color: #0478b2 !important;
  color: #ffffff !important;
}

html[data-theme="light"] body.app-sidebar-page .topbar-global-search button:hover,
html[data-theme="light"] body.app-sidebar-page .topbar-global-search button:focus-visible,
body :where(.btn-primary, button.btn-primary, a.btn-primary):hover,
body :where(.btn-primary, button.btn-primary, a.btn-primary):focus-visible {
  background: #035e8c !important;
  border-color: #035e8c !important;
  color: #ffffff !important;
}

body :where(.badge.primary, .badge-info, .status-pill.info, .is-info) {
  background: #e8f4fa !important;
  border-color: #bedeef !important;
  color: #035e8c !important;
}

body :where(.badge.success, .badge-success, .status-pill.success, .is-ok) {
  background: #e5f7f0 !important;
  border-color: #bcebd9 !important;
  color: #14795a !important;
}

body :where(input, select, textarea):focus {
  border-color: #0478b2 !important;
  box-shadow: 0 0 0 3px rgba(4, 120, 178, .16) !important;
}

html[data-theme="dark"] body.app-sidebar-page .app-sidebar {
  background: #111923 !important;
  border-right-color: #26384b !important;
}

/* Paleta final EMQX: navegación azul pizarra, superficies neutras y azul
   para acciones. El verde queda reservado a estados de salud/éxito. */
:root {
  --bg: #f5f7fa !important;
  --surface: #ffffff !important;
  --surface-soft: #eef2f7 !important;
  --surface-muted: #e7edf4 !important;
  --text: #1f2937 !important;
  --text-rgb: 31, 41, 55 !important;
  --muted: #64748b !important;
  --line: #d9e2ec !important;
  --line-rgb: 217, 226, 236 !important;
  --primary: #0478b2 !important;
  --primary-rgb: 4, 120, 178 !important;
  --primary-strong: #035e8c !important;
  --primary-strong-rgb: 47, 111, 214 !important;
  --accent: #00b3a4 !important;
  --accent-rgb: 0, 179, 164 !important;
  --success: #20b486 !important;
  --warning: #d99a2b !important;
  --danger: #d95c5c !important;
}

html[data-theme="dark"] {
  --bg: #101821 !important;
  --surface: #172331 !important;
  --surface-soft: #1e2d3d !important;
  --surface-muted: #26384b !important;
  --text: #e7edf4 !important;
  --muted: #aab7c7 !important;
  --line: #304256 !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar,
html[data-theme="light"] body.app-sidebar-page.app-sidebar-collapsed .app-sidebar {
  background: #17202c !important;
  border-right: 1px solid #2a3748 !important;
  box-shadow: 8px 0 24px rgba(15, 23, 42, .08) !important;
  color: #b8c3d1 !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-brand,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-nav,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-footer,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-section,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-panel {
  background: transparent !important;
  border-color: #2a3748 !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-logo-copy strong,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-user-copy strong {
  color: #ffffff !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-logo-copy small,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-user-copy small,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-user-copy,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-footer {
  color: #9eacbc !important;
}

html[data-theme="light"] body.app-sidebar-page :where(.app-sidebar-link, .app-sidebar-section > summary) {
  background: transparent !important;
  color: #b8c3d1 !important;
}

html[data-theme="light"] body.app-sidebar-page :where(.app-sidebar-link:hover,
  .app-sidebar-link:focus-visible, .app-sidebar-section > summary:hover,
  .app-sidebar-section > summary:focus-visible) {
  background: #253449 !important;
  color: #ffffff !important;
}

html[data-theme="light"] body.app-sidebar-page :where(.app-sidebar-link.active,
  .app-sidebar-section[open] > summary) {
  background: #253449 !important;
  box-shadow: inset 3px 0 0 #0478b2 !important;
  color: #ffffff !important;
}

html[data-theme="light"] body.app-sidebar-page :where(.app-sidebar-icon,
  .app-sidebar-chevron) { color: #8fa3ba !important; }

html[data-theme="light"] body.app-sidebar-page :where(.app-sidebar-link:hover .app-sidebar-icon,
  .app-sidebar-link.active .app-sidebar-icon,
  .app-sidebar-section > summary:hover .app-sidebar-icon,
  .app-sidebar-section[open] > summary .app-sidebar-icon) {
  color: #0478b2 !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-panel a { color: #9eacbc !important; }
html[data-theme="light"] body.app-sidebar-page .app-sidebar-panel a:hover,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-panel a.active {
  background: #202d3d !important;
  color: #ffffff !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-toggle,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-user-avatar {
  background: #253449 !important;
  border-color: #3a4b61 !important;
  color: #d9e2ec !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-logout-form .app-sidebar-link:hover {
  background: rgba(217, 92, 92, .14) !important;
  color: #ffb4b4 !important;
}

html[data-theme="light"] body.app-sidebar-page .topbar,
html[data-theme="light"] body.app-sidebar-page .topbar-inner {
  background: #ffffff !important;
  border-color: #d9e2ec !important;
}

html[data-theme="light"] body.app-sidebar-page .topbar-global-search button {
  background: #0478b2 !important;
  color: #ffffff !important;
}

html[data-theme="light"] body.app-sidebar-page .topbar-global-search button:hover,
html[data-theme="light"] body.app-sidebar-page .topbar-global-search button:focus-visible {
  background: #035e8c !important;
}

body :where(.btn-primary, button.btn-primary, a.btn-primary) {
  background: #0478b2 !important;
  border-color: #0478b2 !important;
  color: #ffffff !important;
}

body :where(.btn-primary, button.btn-primary, a.btn-primary):hover,
body :where(.btn-primary, button.btn-primary, a.btn-primary):focus-visible {
  background: #035e8c !important;
  border-color: #035e8c !important;
  color: #ffffff !important;
}

body :where(.badge.primary, .badge-info, .status-pill.info, .is-info) {
  background: #e8f4fa !important;
  border-color: #bedeef !important;
  color: #035e8c !important;
}

body :where(.badge.success, .badge-success, .status-pill.success, .is-ok) {
  background: #e5f7f0 !important;
  border-color: #bcebd9 !important;
  color: #14795a !important;
}

body :where(input, select, textarea):focus {
  border-color: #0478b2 !important;
  box-shadow: 0 0 0 3px rgba(4, 120, 178, .16) !important;
}

html[data-theme="dark"] body.app-sidebar-page .app-sidebar {
  background: #111923 !important;
  border-right-color: #26384b !important;
}

html[data-theme="dark"] body.app-sidebar-page .topbar,
html[data-theme="dark"] body.app-sidebar-page .topbar-inner {
  background: #172331 !important;
  border-color: #304256 !important;
}

/* Detalle de Infraestructura: misma jerarquía visual que TAG Explorer. */
body #main-content .service-ops-page {
  gap: 18px;
}

body #main-content .service-ops-back {
  align-items: center;
  color: #087a5a;
  display: inline-flex;
  font-size: .84rem;
  font-weight: 800;
  gap: 6px;
  justify-self: start;
  text-decoration: none;
  width: fit-content;
}

body #main-content .service-ops-back:hover,
body #main-content .service-ops-back:focus-visible {
  color: #005e46;
  text-decoration: underline;
}

body #main-content .service-ops-head {
  align-items: stretch;
  background: #fff !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 10px !important;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 230px) auto;
  margin: 0 !important;
  padding: 20px !important;
}

body #main-content .service-ops-head h1 {
  color: #173b35;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
}

body #main-content .service-ops-hero-status {
  align-content: center;
  background: #eefaf5;
  border: 1px solid #bfe8d5;
  border-radius: 9px;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 14px 16px;
}

body #main-content .service-ops-hero-status span {
  color: #5f8279;
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

body #main-content .service-ops-hero-status strong {
  color: #087a5a;
  font-size: 1.25rem;
  overflow-wrap: anywhere;
}

body #main-content .service-ops-hero-status strong.is-offline,
body #main-content .service-ops-hero-status strong.is-unknown {
  color: #b42318;
}

body #main-content .service-ops-hero-status strong.is-warning {
  color: #a15c00;
}

body #main-content .service-ops-hero-status small {
  color: #5f8279;
  overflow-wrap: anywhere;
}

body #main-content .service-ops-metrics {
  background: #fff !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 10px;
  gap: 0;
  overflow: hidden;
}

body #main-content .service-ops-metrics > div {
  border-left: 1px solid #d9e2ec;
  padding: 15px 16px;
}

body #main-content .service-ops-metrics > div:first-child {
  border-left: 0;
}

body #main-content .service-ops-metrics strong {
  color: #173b35;
}

body #main-content .service-ops-grid {
  gap: 16px;
}

body #main-content .service-ops-section {
  background: #fff !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 10px !important;
  padding: 18px !important;
}

body #main-content .service-ops-section-head {
  border-bottom: 1px solid #e6edf2;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

body #main-content .service-ops-section-head h2 {
  color: #173b35;
  font-size: 1.05rem;
}

body #main-content .service-ops-disk-list,
body #main-content .service-ops-process-list,
body #main-content .service-ops-gateway-list {
  border: 0;
  gap: 8px;
}

body #main-content .service-ops-disk-list > div,
body #main-content .service-ops-process-list > div,
body #main-content .service-ops-gateway-list > div {
  background: #f8fafc;
  border: 1px solid #e6edf2;
  border-radius: 8px;
  min-width: 0;
}

body #main-content .service-ops-disk-list > div + div,
body #main-content .service-ops-process-list > div + div,
body #main-content .service-ops-gateway-list > div + div {
  border-top: 1px solid #e6edf2;
}

body #main-content .service-ops-history {
  min-width: 0;
}

body #main-content .service-ops-history .device-history-chart {
  border: 1px solid #e6edf2;
  border-radius: 8px;
  overflow: hidden;
}

@media (max-width: 900px) {
  body #main-content .service-ops-head {
    grid-template-columns: minmax(0, 1fr) minmax(170px, .65fr);
  }

  body #main-content .service-ops-head > .service-ops-admin-menu {
    grid-column: 1 / -1;
    justify-self: start;
  }

  body #main-content .service-ops-metrics > div:first-child {
    border-left: 0;
  }
}

@media (max-width: 620px) {
  body #main-content .service-ops-head {
    grid-template-columns: 1fr;
  }

  body #main-content .service-ops-hero-status,
  body #main-content .service-ops-head > .service-ops-admin-menu {
    width: 100%;
  }

  body #main-content .service-ops-metrics {
    grid-template-columns: 1fr 1fr;
  }

  body #main-content .service-ops-metrics > div {
    border-left: 0;
    border-top: 1px solid #d9e2ec;
  }

  body #main-content .service-ops-metrics > div:nth-child(-n + 2) {
    border-top: 0;
  }
}


/* Final spacing and button authority. */
:root {
  --ui-space-xs: 6px;
  --ui-space-sm: 10px;
  --ui-space-md: 14px;
  --ui-space-lg: 18px;
  --ui-space-xl: 24px;
  --ui-button-height: 40px;
  --ui-button-height-sm: 32px;
}

html[data-theme="light"] body :where(a.btn, button.btn) {
  align-items: center;
  border: 1px solid transparent !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  box-sizing: border-box;
  cursor: pointer;
  display: inline-flex;
  font-family: inherit;
  font-size: 0.82rem !important;
  font-weight: 650 !important;
  gap: 7px;
  justify-content: center;
  line-height: 1 !important;
  min-height: var(--ui-button-height) !important;
  padding: 0 14px !important;
  text-align: center;
  text-decoration: none;
  transform: none !important;
  vertical-align: middle;
  white-space: nowrap;
}

html[data-theme="light"] body :where(a.btn-primary, button.btn-primary) {
  background: #0478b2 !important;
  border-color: #0478b2 !important;
  color: #ffffff !important;
}

html[data-theme="light"] body :where(a.btn-primary, button.btn-primary):hover,
html[data-theme="light"] body :where(a.btn-primary, button.btn-primary):focus-visible {
  background: #035e8c !important;
  border-color: #035e8c !important;
  color: #ffffff !important;
}

html[data-theme="light"] body :where(a.btn-outline, button.btn-outline) {
  background: #ffffff !important;
  border-color: #c7d4e0 !important;
  color: #334155 !important;
}

html[data-theme="light"] body :where(a.btn-outline, button.btn-outline):hover,
html[data-theme="light"] body :where(a.btn-outline, button.btn-outline):focus-visible {
  background: #f0f3f7 !important;
  border-color: #94a3b8 !important;
  color: #1e293b !important;
}

html[data-theme="light"] body :where(a.btn-secondary, button.btn-secondary) {
  background: #f0f3f7 !important;
  border-color: #d9e2ec !important;
  color: #334155 !important;
}

html[data-theme="light"] body :where(a.btn-secondary, button.btn-secondary):hover,
html[data-theme="light"] body :where(a.btn-secondary, button.btn-secondary):focus-visible {
  background: #e2e8f0 !important;
  border-color: #c7d4e0 !important;
  color: #1e293b !important;
}

html[data-theme="light"] body :where(a.btn-danger, button.btn-danger, .danger-button, button.danger) {
  background: #d64545 !important;
  border-color: #d64545 !important;
  color: #ffffff !important;
}

html[data-theme="light"] body :where(a.btn-danger, button.btn-danger, .danger-button, button.danger):hover,
html[data-theme="light"] body :where(a.btn-danger, button.btn-danger, .danger-button, button.danger):focus-visible {
  background: #b4232d !important;
  border-color: #b4232d !important;
  color: #ffffff !important;
}

html[data-theme="light"] body :where(a.btn-sm, button.btn-sm) {
  font-size: 0.76rem !important;
  min-height: var(--ui-button-height-sm) !important;
  padding: 0 10px !important;
}

html[data-theme="light"] body :where(.full-width-action, a.btn.full-width-action, button.btn.full-width-action) {
  width: 100%;
}

html[data-theme="light"] body :where(a.btn, button.btn):disabled,
html[data-theme="light"] body :where(a.btn, button.btn)[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none;
}

html[data-theme="light"] body #main-content .text-button {
  background: transparent !important;
  border: 0 !important;
  border-radius: 4px;
  color: #1677ff !important;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  min-height: 32px;
  padding: 5px 8px;
}

html[data-theme="light"] body #main-content .text-button:hover,
html[data-theme="light"] body #main-content .text-button:focus-visible {
  background: #e8f1ff !important;
  color: #0958c7 !important;
}

html[data-theme="light"] body.app-standard #main-content > .section {
  padding-block: 20px 32px !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content :where(
  .card, .panel, .admin-form-block, .admin-detail-panel,
  .solution-group-section, .service-ops-section, .gateway-detail-section,
  .ticket-conversation-card, .user-space-panel, .notifications-page
) {
  padding: var(--ui-space-lg) !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content :where(
  .section-head, .page-header, .admin-list-header, .admin-overview-head,
  .user-tickets-header, .user-requests-header, .user-notifications-header,
  .my-alarm-history-header, .phd-browser-head, .service-ops-head,
  .gateway-detail-header
) {
  margin-bottom: var(--ui-space-lg) !important;
  padding-bottom: var(--ui-space-md) !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content :where(
  .section-head, .page-header, .admin-list-header, .admin-overview-head,
  .user-tickets-header, .user-requests-header, .user-notifications-header,
  .my-alarm-history-header, .phd-browser-head, .service-ops-head,
  .gateway-detail-header
) :where(h1, h2, h3, p) {
  margin-top: 0;
}

html[data-theme="light"] body.app-sidebar-page #main-content :where(
  .section-head, .page-header, .admin-list-header, .admin-overview-head,
  .user-tickets-header, .user-requests-header, .user-notifications-header,
  .my-alarm-history-header, .phd-browser-head, .service-ops-head,
  .gateway-detail-header
) p:last-child {
  margin-bottom: 0;
}

html[data-theme="light"] body.app-sidebar-page #main-content :where(
  .row-actions, .form-actions, .filters-actions, .admin-list-actions,
  .ticket-form-actions, .stack-actions, .support-success-actions,
  .request-success-actions, .business-app-card-actions,
  .notification-secondary-actions
) {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px !important;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .form-actions, .ticket-form-actions, .stack-actions,
  .support-success-actions, .request-success-actions
) {
  margin-top: var(--ui-space-lg) !important;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .row-actions, .filters-actions, .admin-list-actions,
  .business-app-card-actions, .notification-secondary-actions
) {
  margin-top: var(--ui-space-sm);
}

html[data-theme="light"] body.app-standard #main-content :where(
  .form-grid, .admin-form-grid, .ticket-form-grid, .request-form-grid,
  .alarm-builder-grid, .alarm-recipient-form-grid
) {
  gap: var(--ui-space-md) !important;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .field, .form-field, .admin-field
) {
  gap: var(--ui-space-xs) !important;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .catalog-grid, .business-app-grid, .related-grid, .admin-card-grid,
  .dashboard-grid, .global-search-grid
) {
  gap: 12px !important;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .solution-filter-stats > *, .user-requests-summary > *,
  .my-tickets-summary > *, .user-notifications-summary > *,
  .admin-overview-metrics > *, .phd-browser-metrics > *,
  .infra-browser-status > *, .lorawan-overview > *,
  .service-ops-metrics > *, .gateway-detail-metrics > *,
  .alarm-summary-grid > *
) {
  padding: 14px !important;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .table-wrap, .table-responsive, .table-wrapper,
  .admin-list-table, .infra-browser-table-wrap
) {
  margin-top: var(--ui-space-md);
}

html[data-theme="light"] body.app-standard #main-content :where(.mt-6) { margin-top: 6px !important; }
html[data-theme="light"] body.app-standard #main-content :where(.mt-8) { margin-top: 8px !important; }
html[data-theme="light"] body.app-standard #main-content :where(.mt-10) { margin-top: 10px !important; }
html[data-theme="light"] body.app-standard #main-content :where(.mt-12) { margin-top: 12px !important; }
html[data-theme="light"] body.app-standard #main-content :where(.mt-14) { margin-top: 14px !important; }
html[data-theme="light"] body.app-standard #main-content :where(.mt-16) { margin-top: 16px !important; }
html[data-theme="light"] body.app-standard #main-content :where(.mt-18) { margin-top: 18px !important; }
html[data-theme="light"] body.app-standard #main-content :where(.mt-20) { margin-top: 20px !important; }
html[data-theme="light"] body.app-standard #main-content :where(.mb-0) { margin-bottom: 0 !important; }
html[data-theme="light"] body.app-standard #main-content :where(.mb-10) { margin-bottom: 10px !important; }
html[data-theme="light"] body.app-standard #main-content :where(.mb-12) { margin-bottom: 12px !important; }
html[data-theme="light"] body.app-standard #main-content :where(.mb-14) { margin-bottom: 14px !important; }
html[data-theme="light"] body.app-standard #main-content :where(.mb-18) { margin-bottom: 18px !important; }

@media (max-width: 760px) {
  html[data-theme="light"] body :where(a.btn, button.btn) {
    min-height: 40px !important;
    padding-inline: 12px !important;
  }

  html[data-theme="light"] body.app-standard #main-content > .section {
    padding-block: 14px 24px !important;
  }

  html[data-theme="light"] body.app-standard #main-content :where(
    .card, .panel, .admin-form-block, .admin-detail-panel,
    .solution-group-section, .service-ops-section, .gateway-detail-section,
    .ticket-conversation-card, .user-space-panel, .notifications-page
  ) {
    padding: 12px !important;
  }

  html[data-theme="light"] body.app-standard #main-content :where(
    .section-head, .page-header, .admin-list-header, .admin-overview-head,
    .user-tickets-header, .user-requests-header, .user-notifications-header,
    .my-alarm-history-header, .phd-browser-head, .service-ops-head,
    .gateway-detail-header
  ) {
    margin-bottom: 14px !important;
    padding-bottom: 12px !important;
  }
}

html[data-theme="light"] body #main-content :where(.table-wrap, .table-responsive,
  .table-wrapper, .admin-list-table, .infra-browser-table-wrap) table {
  border-collapse: separate;
  border-spacing: 0;
}

html[data-theme="light"] body #main-content :where(.table-simple, .admin-table) thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

html[data-theme="light"] body #main-content :where(.table-simple, .admin-table) tbody tr:last-child td {
  border-bottom: 0 !important;
}

html[data-theme="light"] body #main-content :where(.table-simple, .admin-table) td:last-child .row-actions {
  flex-wrap: nowrap;
  justify-content: flex-end;
}

html[data-theme="light"] body .media-picker-modal-backdrop,
html[data-theme="light"] body .app-modal-backdrop {
  background: rgba(15, 23, 42, 0.42) !important;
  backdrop-filter: none !important;
}

html[data-theme="light"] body .media-picker-modal {
  background: #ffffff !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  max-height: min(760px, calc(100dvh - 32px));
  padding: 18px !important;
  width: min(920px, calc(100vw - 32px));
}

html[data-theme="light"] body .media-picker-modal-head {
  align-items: flex-start;
  border-bottom: 1px solid #e6edf3;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
}

html[data-theme="light"] body .media-picker-close {
  align-items: center;
  background: #ffffff !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 5px !important;
  color: #64748b !important;
  display: inline-flex;
  flex: 0 0 auto;
  height: 34px;
  justify-content: center;
  width: 34px;
}

html[data-theme="light"] body .media-picker-close:hover {
  background: #fef0f0 !important;
  border-color: #e8a2a2 !important;
  color: #b4232d !important;
}

html[data-theme="light"] body .media-picker-toolbar {
  align-items: center;
  border-bottom: 1px solid #e6edf3;
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 14px;
}

html[data-theme="light"] body .media-picker-toolbar input {
  flex: 1 1 260px;
  min-width: 0;
}

html[data-theme="light"] body .media-picker-grid {
  display: grid;
  gap: 8px !important;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  overflow-y: auto;
  padding: 1px;
}

html[data-theme="light"] body .media-picker-option {
  align-items: center;
  background: #ffffff !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  color: #334155 !important;
  display: grid;
  gap: 10px;
  grid-template-columns: 54px minmax(0, 1fr);
  min-height: 70px;
  padding: 8px !important;
  text-align: left;
  transform: none !important;
}

html[data-theme="light"] body .media-picker-option:hover {
  background: #f8fafc !important;
  border-color: #8ad8b5 !important;
}

html[data-theme="light"] body .media-picker-option.is-selected {
  background: #e8f4fa !important;
  border-color: #0478b2 !important;
  color: #007a52 !important;
}

html[data-theme="light"] body .media-picker-option-thumb {
  background-color: #f0f3f7;
  border: 1px solid #d9e2ec;
  border-radius: 4px;
  height: 52px;
  width: 54px;
}

@media (max-width: 620px) {
  html[data-theme="light"] body .media-picker-modal {
    max-height: calc(100dvh - 16px);
    padding: 12px !important;
    width: calc(100vw - 16px);
  }

  html[data-theme="light"] body .media-picker-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  html[data-theme="light"] body .media-picker-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Typography and spacing scale for dense operational work. */
:root {
  --control-height: 40px;
  --ui-control-height: 40px;
  --gutter: clamp(16px, 2vw, 32px);
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --space-6: 32px;
}

body {
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

body.app-standard #main-content :where(h1, h2, h3, h4) {
  color: #1e293b;
  font-family: "IBM Plex Sans", "Avenir Next", "Segoe UI", sans-serif;
  font-weight: 650;
  letter-spacing: -0.018em;
}

body.app-standard #main-content h1 {
  font-size: clamp(1.75rem, 2.3vw, 2.25rem);
  line-height: 1.15;
}

body.app-standard #main-content h2 {
  font-size: clamp(1.35rem, 1.8vw, 1.7rem);
  line-height: 1.2;
}

body.app-standard #main-content h3 {
  font-size: 1.05rem;
  line-height: 1.3;
}

body.app-standard #main-content h4 {
  font-size: 0.92rem;
  line-height: 1.35;
}

body.app-standard #main-content :where(p, li, td, dd) {
  line-height: 1.52;
}

body.app-standard #main-content :where(.muted, small, .eyebrow, .badge, .chip) {
  font-size: 0.78rem;
}

body.app-standard #main-content :where(.eyebrow, .admin-overview-eyebrow,
  .business-app-kicker, .status-page-kicker) {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.app-standard #main-content :where(.card, .panel, .admin-form-block,
  .admin-detail-panel, .solution-group-section, .service-ops-section,
  .gateway-detail-section, .ticket-conversation-card) {
  padding: 18px;
}

body.app-standard #main-content :where(.catalog-grid, .business-app-grid,
  .related-grid, .admin-overview-metrics, .profile-account-strip,
  .solution-filter-stats, .user-requests-summary, .my-tickets-summary,
  .user-notifications-summary, .phd-browser-metrics, .infra-browser-status,
  .lorawan-overview, .service-ops-metrics, .gateway-detail-metrics) {
  gap: 12px;
}

body.app-standard #main-content :where(.form-grid, .admin-form-grid,
  .ticket-form-grid, .request-form-grid) {
  gap: 16px;
}

body.app-standard #main-content :where(.field, .form-field) {
  gap: 6px;
}

body.app-standard #main-content :where(.field, .form-field) > label {
  color: #475569;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

body.app-standard #main-content :where(input, select, textarea) {
  font: inherit;
  min-height: 40px;
  padding: 8px 10px;
}

body.app-standard #main-content textarea {
  min-height: 96px;
}

body.app-standard #main-content :where(.btn, button.btn) {
  font-size: 0.86rem;
  line-height: 1.2;
  min-height: 40px;
  padding: 9px 13px;
}

body.app-standard #main-content :where(.table-simple, .admin-table) th {
  padding: 10px 14px;
}

body.app-standard #main-content :where(.table-simple, .admin-table) td {
  padding: 12px 14px;
}

body.app-standard #main-content :where(.meta-row, .item-footer, .detail-actions,
  .card-actions, .row-actions, .form-actions, .filters-actions) {
  margin-top: 12px;
}

body.app-standard #main-content :where(.solution-filter-panel, .catalog-filter-panel,
  .global-search-panel, .my-tickets-filters, .admin-filters, .admin-filter-panel,
  .phd-browser-filters, .infra-browser-filters, .lorawan-filter-form,
  .inventory-device-filter-panel, .alarm-filter-panel) {
  gap: 12px;
}

@media (max-width: 760px) {
  body {
    font-size: 14px;
  }

  body.app-standard #main-content h1 {
    font-size: 1.6rem;
  }

  body.app-standard #main-content h2 {
    font-size: 1.3rem;
  }

  body.app-standard #main-content :where(.card, .panel, .admin-form-block,
    .admin-detail-panel, .solution-group-section, .service-ops-section,
    .gateway-detail-section, .ticket-conversation-card) {
    padding: 14px;
  }

  body.app-standard #main-content :where(.table-simple, .admin-table) th,
  body.app-standard #main-content :where(.table-simple, .admin-table) td {
    padding: 10px 12px;
  }
}

/* Detailed records, alarms, documentation and reports. */
body.app-standard #main-content :where(
  .solution-hero-card, .solution-detail-page-v2 > .container > .card,
  .detail-section-card, .catalog-detail-section, .document-viewer-card,
  .report-preview-main, .report-form-shell, .ticket-conversation-card,
  .ticket-form-block, .ticket-attachment-item, .timeline-item,
  .alarm-groups-card, .alarm-groups-toolbar, .alarm-group-card,
  .alarm-group-panel, .alarm-groups-panel, .alarm-message-block,
  .alarm-delivery-preview, .personal-alarm-assistant, .alarm-preview) {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

body.app-standard #main-content :where(.facts, .specs, .detail-facts,
  .gateway-detail-facts, .device-detail-facts) > * {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 4px !important;
}

body.app-standard #main-content :where(.ticket-thread, .timeline-list,
  .diagnostic-log-list) {
  border-left: 1px solid #d9e2ec;
  padding-left: 16px;
}

body.app-standard #main-content :where(.ticket-thread-item, .timeline-item,
  .diagnostic-log-entry) {
  position: relative;
}

body.app-standard #main-content :where(.ticket-thread-item, .timeline-item,
  .diagnostic-log-entry)::before {
  background: #0478b2;
  border: 2px solid #ffffff;
  border-radius: 50%;
  content: "";
  height: 8px;
  left: -22px;
  position: absolute;
  top: 16px;
  width: 8px;
}

body.app-standard #main-content :where(.ticket-thread-bubble, .ticket-thread-bubble.is-team,
  .ticket-thread-bubble.is-user, .panel-soft, .admin-detail-copy-card) {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}

body.app-standard #main-content :where(.alarm-tabs, .alarm-tab-shell,
  .alarm-tab-panel, .alarm-choice-grid, .personal-alarm-template-grid) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.app-standard #main-content :where(.alarm-tab-link, .personal-alarm-type-strip button,
  .alarm-choice, .alarm-list-check, .personal-alarm-template) {
  background: #ffffff !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}

body.app-standard #main-content :where(.alarm-tab-link.is-active,
  .personal-alarm-type-strip button.is-selected, .alarm-choice:has(input:checked),
  .alarm-list-check:has(input:checked), .personal-alarm-template.is-selected) {
  background: #edf9f4 !important;
  border-color: #0478b2 !important;
  box-shadow: none !important;
}

body.app-standard #main-content :where(.alarm-severity-info td:first-child,
  .alarm-severity-warning td:first-child, .alarm-severity-critical td:first-child) {
  border-left-width: 3px !important;
}

body.app-standard #main-content .alarm-severity-info td:first-child {
  border-left-color: #1677ff !important;
}

body.app-standard #main-content .alarm-severity-warning td:first-child {
  border-left-color: #d99000 !important;
}

body.app-standard #main-content .alarm-severity-critical td:first-child {
  border-left-color: #d64545 !important;
}

body.app-standard #main-content :where(.document-card, .document-folder-card,
  .report-card, .asset-report-card) .item-media {
  background: #f0f3f7 !important;
  border-bottom: 1px solid #d9e2ec;
}

body.app-standard #main-content :where(.document-card, .document-folder-card,
  .report-card, .asset-report-card) .item-footer {
  border-top: 1px solid #edf1f5;
}

@media (max-width: 760px) {
  body.app-standard #main-content :where(.ticket-thread, .timeline-list,
    .diagnostic-log-list) {
    padding-left: 14px;
  }
}

/* White navigation shell and final component polish. */
body.app-sidebar-page {
  --app-sidebar-width: 256px;
  --app-sidebar-collapsed-width: 68px;
}

body :where(.app-sidebar, .admin-sidebar) {
  background: #ffffff !important;
  background-image: none !important;
  border-color: #d9e2ec !important;
  box-shadow: none !important;
  color: #475569 !important;
}

body.app-sidebar-page .app-sidebar {
  padding: 0 8px;
}

body.app-sidebar-page .app-sidebar-brand,
body.admin-page .admin-sidebar-head {
  border-bottom: 1px solid #e6edf3 !important;
  min-height: 64px;
  padding: 12px 6px !important;
}

body.app-sidebar-page .app-sidebar-logo-mark,
body.admin-page .admin-sidebar-mark {
  background: #0478b2 !important;
  border: 0 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  color: #ffffff !important;
}

body.app-sidebar-page .app-sidebar-logo-copy strong,
body.admin-page .admin-sidebar-head strong {
  color: #1e293b !important;
  font-size: 0.9rem;
  font-weight: 700;
}

body.app-sidebar-page .app-sidebar-logo-copy small,
body.admin-page .admin-sidebar-head span {
  color: #64748b !important;
  font-size: 0.72rem;
}

body.app-sidebar-page .app-sidebar-toggle {
  border-radius: 5px;
  color: #64748b;
}

body.app-sidebar-page .app-sidebar-toggle:hover,
body.app-sidebar-page .app-sidebar-toggle:focus-visible {
  background: #f0f3f7 !important;
  color: #035e8c !important;
  transform: none !important;
}

body.app-sidebar-page .app-sidebar-nav,
body.admin-page .admin-nav {
  gap: 3px;
  padding: 8px 2px 14px;
}

body :where(.app-sidebar-link, .app-sidebar-section > summary,
  .admin-nav-direct, .admin-nav-summary) {
  background: transparent !important;
  border: 0 !important;
  border-radius: 5px !important;
  box-shadow: none !important;
  color: #475569 !important;
  font-size: 0.84rem;
  font-weight: 600;
  min-height: 38px;
  padding-block: 7px;
}

body :where(.app-sidebar-link:hover, .app-sidebar-section > summary:hover,
  .admin-nav-direct:hover, .admin-nav-summary:hover) {
  background: #f0f3f7 !important;
  color: #1e293b !important;
  transform: none !important;
}

body :where(.app-sidebar-link.active, .app-sidebar-section[open] > summary,
  .admin-nav-direct.active, .admin-nav-group[open] > summary) {
  background: #e8f4fa !important;
  box-shadow: inset 3px 0 0 #0478b2 !important;
  color: #035e8c !important;
}

body.app-sidebar-page :where(.app-sidebar-icon, .app-sidebar-chevron),
body.admin-page :where(.admin-nav-icon, .admin-nav-chevron) {
  color: currentColor !important;
}

body.app-sidebar-page :where(.app-sidebar-link:hover .app-sidebar-icon,
  .app-sidebar-link.active .app-sidebar-icon,
  .app-sidebar-section > summary:hover .app-sidebar-icon,
  .app-sidebar-section[open] > summary .app-sidebar-icon) {
  transform: none !important;
}

body.app-sidebar-page .app-sidebar-panel,
body.admin-page .admin-nav-panel {
  border-left: 1px solid #d9e2ec !important;
  gap: 2px;
}

body.app-sidebar-page .app-sidebar-panel a,
body.admin-page .admin-nav-panel a {
  background: transparent !important;
  border: 0 !important;
  border-radius: 4px !important;
  color: #64748b !important;
  font-size: 0.8rem;
  padding: 7px 9px !important;
}

body.app-sidebar-page .app-sidebar-panel a:hover,
body.admin-page .admin-nav-panel a:hover {
  background: #f0f3f7 !important;
  color: #1e293b !important;
}

body.app-sidebar-page .app-sidebar-panel a.active,
body.admin-page .admin-nav-panel a.active {
  background: #e8f4fa !important;
  color: #035e8c !important;
  font-weight: 700;
}

body.admin-page .admin-nav-section-label {
  color: #94a3b8 !important;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  margin: 10px 8px 4px;
  text-transform: uppercase;
}

body.app-sidebar-page .app-sidebar-footer {
  border-top: 1px solid #e6edf3;
  padding: 8px 2px 10px;
}

body.app-sidebar-page .topbar {
  min-height: 58px;
}

body.app-sidebar-page .topbar-inner {
  min-height: 58px;
}

body.app-sidebar-page .app-topbar-breadcrumbs {
  color: #64748b;
  font-size: 0.78rem;
}

body.auth-page :where(.login-page-header, .login-page-panel) {
  padding: 22px !important;
}

body.auth-page :where(input, select, textarea) {
  background: #ffffff !important;
  border: 1px solid #c7d4e0 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  min-height: 40px;
  padding: 8px 10px;
}

body.auth-page :where(.btn-primary, button.btn-primary) {
  background: #0478b2 !important;
  border-color: #0478b2 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  color: #ffffff !important;
  min-height: 40px;
}

@media (max-width: 760px) {
  body.app-sidebar-page {
    --app-sidebar-collapsed-width: 64px;
  }

  body.auth-page :where(.login-page-header, .login-page-panel) {
    padding: 16px !important;
  }
}

/* Semantic colors remain consistent across every legacy status class. */
body :where(.badge, .status-badge, .status-pill) {
  background: #f0f3f7 !important;
  border: 1px solid #c7d4e0 !important;
  color: #475569 !important;
}

body :where(.badge.primary, .badge.success, .badge-success, .status-pill.success,
  .status-pill.is-success, .badge.is-ok, .status-pill.is-ok) {
  background: #e8f4fa !important;
  border-color: #8ad8b5 !important;
  color: #007a52 !important;
}

body :where(.badge.warning, .badge.is-warning, .status-pill.warning,
  .status-pill.is-warning) {
  background: #fff7e6 !important;
  border-color: #efc46b !important;
  color: #8a5b00 !important;
}

body :where(.badge-danger, .badge.is-danger, .status-pill.is-danger,
  .status-pill.is-error, .mqtt-test-status-pill.is-error) {
  background: #fef0f0 !important;
  border-color: #e8a2a2 !important;
  color: #b4232d !important;
}

body :where(.badge.is-muted, .status-pill.is-muted) {
  background: #f0f3f7 !important;
  border-color: #d9e2ec !important;
  color: #64748b !important;
}

body :where(.service-ops-notice, .gateway-detail-notice, .surface-note) {
  border-left: 3px solid #1677ff !important;
}

body :where(.service-ops-notice.is-warning, .gateway-detail-notice.is-warning) {
  background: #fffaf0 !important;
  border-left-color: #d99000 !important;
}

body :where(.service-ops-notice.is-danger, .surface-note--danger) {
  background: #fef5f5 !important;
  border-left-color: #d64545 !important;
}

body :where(.btn-danger, .danger-button, button.danger) {
  background: #d64545 !important;
  border-color: #d64545 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  color: #ffffff !important;
}

body :where(.btn-danger, .danger-button, button.danger):hover,
body :where(.btn-danger, .danger-button, button.danger):focus-visible {
  background: #b4232d !important;
  border-color: #b4232d !important;
}

body .notification-delete-button {
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 4px !important;
  color: #94a3b8 !important;
}

body .notification-delete-button:hover,
body .notification-delete-button:focus-visible {
  background: #fef0f0 !important;
  border-color: #e8a2a2 !important;
  color: #b4232d !important;
}

/* Responsive contracts for every page family. */
body:not(.inventory-map-body) {
  max-width: 100%;
  overflow-x: clip;
}

body #main-content,
body #main-content > *,
body #main-content .container,
body #main-content :where(.card, .panel, .admin-main-panel, .user-space-panel) {
  min-width: 0;
}

body #main-content :where(img, video, canvas) {
  max-width: 100%;
}

body #main-content :where(.table-wrap, .table-responsive, .table-wrapper,
  .admin-list-table, .admin-demand-table, .infra-browser-table-wrap) {
  max-width: 100%;
  overflow-x: auto !important;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

body #main-content :where(.table-wrap, .table-responsive, .table-wrapper) table {
  width: 100%;
}

@media (max-width: 1200px) {
  body.app-standard #main-content :where(.catalog-grid, .business-app-grid,
    .related-grid, .admin-card-grid, .dashboard-grid) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  body.app-standard #main-content :where(.admin-overview-metrics,
    .solution-filter-stats, .user-requests-summary, .my-tickets-summary,
    .user-notifications-summary, .profile-account-strip, .phd-browser-metrics,
    .infra-browser-status, .lorawan-overview, .service-ops-metrics,
    .gateway-detail-metrics, .alarm-summary-grid) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 980px) {
  body.app-standard #main-content :where(.catalog-grid, .business-app-grid,
    .related-grid, .admin-card-grid, .dashboard-grid,
    .admin-overview-metrics, .solution-filter-stats, .user-requests-summary,
    .my-tickets-summary, .user-notifications-summary, .profile-account-strip,
    .phd-browser-metrics, .infra-browser-status, .lorawan-overview,
    .service-ops-metrics, .gateway-detail-metrics, .alarm-summary-grid) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.app-standard #main-content :where(.admin-overview-columns,
    .profile-content-grid-v3, .service-ops-grid, .admin-detail-grid,
    .alarm-workspace, .alarm-destinations-layout, .alarm-builder-grid,
    .alarm-ops-grid) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.app-standard #main-content :where(.solution-filter-form,
    .global-search-form, .my-tickets-filters, .admin-filters,
    .phd-browser-filters, .infra-browser-filters, .lorawan-filter-form,
    .alarm-filter-panel) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 760px) {
  body.app-standard #main-content :where(.catalog-grid, .business-app-grid,
    .related-grid, .admin-card-grid, .dashboard-grid) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.app-standard #main-content :where(.solution-filter-form,
    .global-search-form, .my-tickets-filters, .admin-filters,
    .phd-browser-filters, .infra-browser-filters, .lorawan-filter-form,
    .alarm-filter-panel, .form-grid, .admin-form-grid, .ticket-form-grid,
    .request-form-grid) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.app-standard #main-content :where(.row-actions, .form-actions,
    .filters-actions, .admin-list-actions, .ticket-form-actions) {
    align-items: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  body.app-standard #main-content :where(.row-actions, .form-actions,
    .filters-actions, .admin-list-actions, .ticket-form-actions) > :where(.btn, button, a) {
    justify-content: center;
    min-width: 0;
    width: 100%;
  }

  body.app-standard #main-content :where(.section-head, .admin-list-header,
    .admin-overview-head, .user-tickets-header, .user-notifications-header,
    .service-ops-head, .gateway-detail-header) > :where(.row-actions,
    .form-actions, .admin-list-actions) {
    margin-top: 4px;
  }
}

@media (max-width: 520px) {
  body.app-standard #main-content :where(.admin-overview-metrics,
    .solution-filter-stats, .user-requests-summary, .my-tickets-summary,
    .user-notifications-summary, .profile-account-strip, .phd-browser-metrics,
    .infra-browser-status, .lorawan-overview, .service-ops-metrics,
    .gateway-detail-metrics, .alarm-summary-grid) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.app-standard #main-content :where(.row-actions, .form-actions,
    .filters-actions, .admin-list-actions, .ticket-form-actions) {
    grid-template-columns: minmax(0, 1fr);
  }

  body.app-standard #main-content :where(.card, .panel, .admin-form-block,
    .admin-detail-panel, .solution-group-section, .service-ops-section,
    .gateway-detail-section, .ticket-conversation-card) {
    border-left-width: 1px !important;
    border-right-width: 1px !important;
    padding: 12px !important;
  }
}

/* Retire decorative effects from the previous visual system. */
body:not(.inventory-map-body) #main-content :where(
  div, section, article, aside, header, footer, form, nav, ul, ol, li,
  table, thead, tbody, tr, th, td, fieldset, details, summary
),
body :where(
  .topbar, .footer, .app-sidebar, .admin-sidebar, .account-panel,
  .notification-panel, .app-modal, .media-picker-modal, .flash
) {
  background-image: none !important;
}

body:not(.inventory-map-body) #main-content :where(
  .card, .panel, .item-card, .business-app-card, .global-result-card,
  .search-result-card, .document-card, .document-folder-card, .report-card,
  .asset-report-card, .profile-account-card, .profile-progress-card,
  .support-form-overview, .support-form-section, .admin-form-block,
  .admin-detail-panel, .admin-main-panel, .status-page-panel,
  .service-ops-section, .gateway-detail-section, .alarm-list-section,
  .notification-inbox-item, .admin-overview-metric, .admin-overview-alert-row
),
body :where(
  .topbar, .footer, .app-sidebar, .admin-sidebar, .account-panel,
  .notification-panel, .app-modal, .media-picker-modal, .flash
) {
  box-shadow: none !important;
  transform: none;
}

body:not(.inventory-map-body) #main-content :where(
  .card, .panel, .item-card, .business-app-card, .global-result-card,
  .search-result-card, .document-card, .document-folder-card, .report-card,
  .asset-report-card, .profile-account-card, .profile-progress-card,
  .support-form-overview, .support-form-section, .admin-form-block,
  .admin-detail-panel, .admin-main-panel, .status-page-panel,
  .service-ops-section, .gateway-detail-section, .alarm-list-section,
  .notification-inbox-item, .admin-overview-metric, .admin-overview-alert-row
):hover {
  box-shadow: none !important;
  transform: none !important;
}

body:not(.inventory-map-body) #main-content :where(
  .section-head, .page-head, .admin-overview-head, .admin-list-header,
  .item-card, .business-app-card, .global-result-card, .search-result-card
)::before,
body:not(.inventory-map-body) #main-content :where(
  .section-head, .page-head, .admin-overview-head, .admin-list-header,
  .item-card, .business-app-card, .global-result-card, .search-result-card
)::after {
  background-image: none !important;
  box-shadow: none !important;
}

/* Leaflet's layer switcher is functional artwork, not visual decoration. */
body .inventory-leaflet-map .leaflet-control-layers-toggle,
body .leaflet-device-map .leaflet-control-layers-toggle {
  background-image: url("../vendor/leaflet/images/layers.png") !important;
}

@media (min-resolution: 2dppx) {
  body .inventory-leaflet-map .leaflet-control-layers-toggle,
  body .leaflet-device-map .leaflet-control-layers-toggle {
    background-image: url("../vendor/leaflet/images/layers-2x.png") !important;
  }
}

/* Specificity firewall for legacy sidebar rules that still use !important. */
html[data-theme="light"] body.app-sidebar-page .app-sidebar,
html[data-theme="light"] body.app-sidebar-page.app-sidebar-collapsed .app-sidebar,
html[data-theme="light"] body.admin-page .admin-shell > .admin-sidebar,
html[data-theme="light"] body.admin-page.app-standard .admin-sidebar {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  border-color: #d9e2ec !important;
  box-shadow: none !important;
  color: #475569 !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar::before,
html[data-theme="light"] body.app-sidebar-page .app-sidebar::after,
html[data-theme="light"] body.admin-page .admin-sidebar::before,
html[data-theme="light"] body.admin-page .admin-sidebar::after {
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-brand,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-nav,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-footer,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-section,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-panel,
html[data-theme="light"] body.admin-page .admin-sidebar-head,
html[data-theme="light"] body.admin-page .admin-nav,
html[data-theme="light"] body.admin-page .admin-nav-group,
html[data-theme="light"] body.admin-page .admin-nav-panel {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body.admin-page .admin-sidebar-head {
  border-bottom-color: #e6edf3 !important;
}

html[data-theme="light"] body.admin-page .admin-sidebar-head strong,
html[data-theme="light"] body.admin-page .admin-nav-title {
  color: #1e293b !important;
}

html[data-theme="light"] body.admin-page .admin-sidebar-head span,
html[data-theme="light"] body.admin-page .admin-nav-section-label,
html[data-theme="light"] body.admin-page .admin-nav-chevron {
  color: #64748b !important;
}

html[data-theme="light"] body.admin-page .admin-sidebar-mark {
  background: #0478b2 !important;
  color: #ffffff !important;
}

html[data-theme="light"] body.admin-page :where(.admin-nav-summary, .admin-nav-direct),
html[data-theme="light"] body.admin-page .admin-nav a {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  color: #475569 !important;
}

html[data-theme="light"] body.admin-page .admin-nav-icon {
  background: transparent !important;
  color: currentColor !important;
}

html[data-theme="light"] body.admin-page :where(.admin-nav-summary, .admin-nav-direct):hover,
html[data-theme="light"] body.admin-page .admin-nav a:hover {
  background: #f0f3f7 !important;
  color: #1e293b !important;
}

html[data-theme="light"] body.admin-page .admin-nav-group[open] > .admin-nav-summary,
html[data-theme="light"] body.admin-page :where(.admin-nav-direct.active, .admin-nav a.active) {
  background: #e8f4fa !important;
  color: #035e8c !important;
}

/* Shared controls: one density and one interaction language across all views. */
body #main-content .pagination {
  align-items: center !important;
  background: #ffffff !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 8px !important;
  color: #64748b !important;
  display: flex;
  gap: 12px !important;
  justify-content: space-between;
  margin-top: 16px;
  padding: 10px 12px !important;
}

body #main-content .pagination .pages {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px !important;
}

body #main-content .pagination :where(a, button, span.current) {
  align-items: center;
  background: #ffffff !important;
  border: 1px solid #c7d4e0 !important;
  border-radius: 5px !important;
  box-shadow: none !important;
  color: #475569 !important;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 650;
  height: 34px !important;
  justify-content: center;
  min-width: 34px !important;
  padding: 0 10px !important;
  transform: none !important;
}

body #main-content .pagination :where(a, button):hover,
body #main-content .pagination :where(a, button):focus-visible {
  background: #f0f3f7 !important;
  border-color: #94a3b8 !important;
  color: #1e293b !important;
}

body #main-content .pagination span.current {
  background: #0478b2 !important;
  border-color: #0478b2 !important;
  color: #ffffff !important;
}

body #main-content :where(.tabs, .alarm-tabs, .view-toggle, .admin-subnav,
  .solution-group-nav, .lorawan-section-nav) {
  align-items: center;
  background: #f0f3f7 !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  display: flex;
  flex-wrap: wrap;
  gap: 3px !important;
  padding: 3px !important;
}

body #main-content :where(.tabs, .alarm-tabs, .view-toggle, .admin-subnav,
  .solution-group-nav, .lorawan-section-nav) :where(a, button) {
  background: transparent !important;
  border: 0 !important;
  border-radius: 4px !important;
  box-shadow: none !important;
  color: #64748b !important;
  font-size: 0.8rem;
  font-weight: 650;
  min-height: 34px;
  padding: 6px 11px !important;
  transform: none !important;
}

body #main-content :where(.tabs, .alarm-tabs, .view-toggle, .admin-subnav,
  .solution-group-nav, .lorawan-section-nav) :where(a, button):hover {
  background: #ffffff !important;
  color: #1e293b !important;
}

body #main-content :where(.tabs, .alarm-tabs, .view-toggle, .admin-subnav,
  .solution-group-nav, .lorawan-section-nav) :where(.active, .is-active, [aria-current="page"]) {
  background: #ffffff !important;
  box-shadow: inset 0 -2px 0 #0478b2 !important;
  color: #035e8c !important;
}

body.app-standard #main-content :where(.solution-group-toolbar, .table-toolbar,
  .admin-toolbar, .support-table-toolbar, .inventory-toolbar, .alarm-toolbar,
  .media-library-toolbar, .bulk-toolbar) {
  align-items: center;
  border-bottom: 1px solid #e6edf3;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px !important;
  justify-content: space-between;
  margin-bottom: 14px !important;
  padding-bottom: 12px !important;
}

body #main-content :where(label, .field-label) {
  color: #334155;
  font-size: 0.8rem;
  font-weight: 650;
}

body #main-content :where(.field-help, .form-help, .help-text, .field-hint) {
  color: #64748b !important;
  font-size: 0.76rem;
  line-height: 1.45;
}

body #main-content :where(input[type="checkbox"], input[type="radio"]) {
  accent-color: #0478b2;
}

body.app-standard #main-content :where(.empty-state, .no-results, .not-found-state) {
  align-items: flex-start;
  color: #64748b !important;
  gap: 8px;
  justify-content: center;
  min-height: 96px;
  padding: 20px !important;
  text-align: left;
}

body.app-standard #main-content .admin-config-status-banner {
  align-items: flex-start !important;
  justify-content: flex-start;
  min-height: 0;
  text-align: left !important;
}

/* Header menus use the same flat surface contract as page content. */
html[data-theme="light"] body .topbar {
  background: #ffffff !important;
  background-image: none !important;
  border-bottom: 1px solid #d9e2ec !important;
  box-shadow: none !important;
}

html[data-theme="light"] body :where(.topbar-menu-toggle, .notification-trigger) {
  background: #ffffff !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  color: #475569 !important;
  transform: none !important;
}

html[data-theme="light"] body :where(.topbar-menu-toggle, .notification-trigger):hover,
html[data-theme="light"] body :where(.topbar-menu-toggle, .notification-trigger):focus-visible {
  background: #f0f3f7 !important;
  border-color: #c7d4e0 !important;
  color: #035e8c !important;
}

html[data-theme="light"] body :where(.account-panel, .notification-panel,
  .nav-menu-panel, .nav-menu-subpanel) {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  color: #475569 !important;
}

html[data-theme="light"] body :where(.account-panel, .notification-panel) :where(a, button) {
  border-radius: 4px !important;
}

html[data-theme="light"] body .notification-item {
  border-bottom: 1px solid #edf1f5 !important;
}

html[data-theme="light"] body .notification-item:hover,
html[data-theme="light"] body .account-panel-links a:hover {
  background: #f0f3f7 !important;
  color: #1e293b !important;
}

@media (max-width: 900px) {
  html[data-theme="light"] body.app-sidebar-page .topbar .nav,
  html[data-theme="light"] body .topbar .nav {
    background: #ffffff !important;
    background-image: none !important;
    border-left: 1px solid #d9e2ec !important;
    box-shadow: none !important;
    color: #475569 !important;
  }

  html[data-theme="light"] body .topbar .nav :where(a, button, summary) {
    background: transparent !important;
    border: 0 !important;
    border-radius: 5px !important;
    box-shadow: none !important;
    color: #475569 !important;
    min-height: 40px;
    transform: none !important;
  }

  html[data-theme="light"] body .topbar .nav :where(a, button, summary):hover,
  html[data-theme="light"] body .topbar .nav :where(a.active, summary.active) {
    background: #f0f3f7 !important;
    color: #035e8c !important;
  }

  body #main-content .pagination {
    align-items: stretch !important;
    flex-direction: column;
  }

  body #main-content .pagination .pages {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(38px, 1fr)) !important;
    width: 100%;
  }
}

@media (max-width: 560px) {
  html[data-theme="light"] body :where(.account-panel, .notification-panel) {
    max-width: calc(100vw - 24px) !important;
    right: 0 !important;
    width: min(360px, calc(100vw - 24px)) !important;
  }

  body.app-standard #main-content :where(.solution-group-toolbar, .table-toolbar,
    .admin-toolbar, .support-table-toolbar, .inventory-toolbar, .alarm-toolbar,
    .media-library-toolbar, .bulk-toolbar) {
    align-items: stretch;
    flex-direction: column;
  }
}

/* Authenticated home behaves like an app dashboard, not a locked landing page. */
html[data-theme="light"] body.home-page.app-sidebar-page {
  height: auto !important;
  min-height: 100dvh;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

html[data-theme="light"] body.home-page.app-sidebar-page main {
  height: auto !important;
  min-height: calc(100dvh - 58px) !important;
  overflow: visible !important;
  padding: 20px 0 32px !important;
}

html[data-theme="light"] body.home-page .hero.hero-fullheight {
  display: block !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
}

/* Shared application grammar. Solution and catalog views opt out in base.html. */
html[data-theme="light"] body.ui-unified-page.app-standard #main-content {
  --unified-border: #d9e2ec;
  --unified-border-soft: #e8edf2;
  --unified-radius: 6px;
  --unified-surface: #ffffff;
  --unified-surface-soft: #f8fafc;
  --unified-space: 16px;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content > .section {
  padding-block: 18px 32px !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content > .section > .container {
  width: min(calc(100% - 32px), 1760px);
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
  .admin-main-panel,
  .user-space-panel,
  .notifications-page,
  .solution-explorer-shell,
  .alarm-explorer-shell,
  .support-explorer-shell
) {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  min-width: 0;
  padding: 0 !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
  .admin-main-panel,
  .user-space-panel,
  .notifications-page,
  .solution-explorer-shell,
  .alarm-explorer-shell,
  .support-explorer-shell,
  .admin-list-page,
  .admin-edit-page,
  .admin-detail-shell
) {
  gap: var(--unified-space) !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
  .admin-form-block,
  .admin-detail-panel,
  .admin-detail-copy-card,
  .profile-section-panel,
  .request-form-panel,
  .support-request-form-panel,
  .detail-section-card,
  .alarm-groups-panel,
  .alarm-group-panel,
  .lorawan-panel,
  .service-ops-section,
  .gateway-detail-section,
  .phd-browser-panel,
  .infra-browser-panel,
  .support-action-board,
  .ticket-conversation-card
) {
  background: var(--unified-surface) !important;
  background-image: none !important;
  border: 1px solid var(--unified-border) !important;
  border-radius: var(--unified-radius) !important;
  box-shadow: none !important;
  padding: var(--unified-space) !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
  .admin-list-header,
  .admin-overview-head,
  .section-head.page-header,
  .user-notifications-header,
  .user-requests-header,
  .user-tickets-header,
  .my-alarm-history-header,
  .service-ops-head,
  .gateway-detail-header,
  .phd-record-head
) {
  border: 0 !important;
  margin: 0 0 12px !important;
  min-height: 36px;
  padding: 0 !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
  .admin-overview-section-head,
  .solution-group-head,
  .alarm-list-head,
  .lorawan-panel-head,
  .profile-section-head,
  .device-section-head
) {
  align-items: center;
  border: 0 !important;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin: 0 0 12px !important;
  padding: 0 !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
  form.admin-filters,
  form.admin-filter-panel,
  form.my-tickets-filters,
  form.user-space-filters,
  form.alarm-filter-panel,
  form.infra-browser-filters,
  form.phd-browser-filters,
  form.lorawan-filter-form
) {
  align-items: end;
  background: var(--unified-surface) !important;
  background-image: none !important;
  border: 1px solid var(--unified-border) !important;
  border-radius: var(--unified-radius) !important;
  box-shadow: none !important;
  column-gap: 12px !important;
  margin: 0 0 var(--unified-space) !important;
  padding: 14px !important;
  row-gap: 10px !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
  .solution-filter-panel,
  .support-filter-panel,
  .inventory-filter-panel,
  .alarm-overview-panel
) {
  background: var(--unified-surface) !important;
  background-image: none !important;
  border: 1px solid var(--unified-border) !important;
  border-radius: var(--unified-radius) !important;
  box-shadow: none !important;
  margin-bottom: var(--unified-space) !important;
  padding: 14px !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
  form.admin-filters,
  form.admin-filter-panel,
  form.my-tickets-filters,
  form.user-space-filters,
  form.alarm-filter-panel,
  form.infra-browser-filters,
  form.phd-browser-filters,
  form.lorawan-filter-form
) :where(input, select, textarea) {
  margin: 0 !important;
  min-height: 40px !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
  .admin-overview-metric,
  .solution-filter-stats > *,
  .user-requests-summary > *,
  .my-requests-summary > *,
  .my-tickets-summary > *,
  .user-notifications-summary > *,
  .phd-browser-metrics > *,
  .infra-browser-status > *,
  .lorawan-overview > *,
  .service-ops-metrics > *,
  .gateway-detail-metrics > *,
  .alarm-summary-grid > *
) {
  align-content: center;
  background: var(--unified-surface) !important;
  border: 1px solid var(--unified-border) !important;
  border-radius: var(--unified-radius) !important;
  box-shadow: none !important;
  min-height: 82px;
  padding: 13px 14px !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
  .table-wrap,
  .table-responsive,
  .table-wrapper,
  .infra-browser-table-wrap
) {
  border: 1px solid var(--unified-border) !important;
  border-radius: var(--unified-radius) !important;
  box-shadow: none !important;
  margin: 0 !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
  .table-simple,
  .admin-table,
  .service-monitor-table
) thead th {
  background: var(--unified-surface-soft) !important;
  border-bottom: 1px solid var(--unified-border) !important;
  height: 40px;
  padding: 9px 12px !important;
  white-space: nowrap;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
  .table-simple,
  .admin-table,
  .service-monitor-table
) tbody td {
  border-bottom: 1px solid var(--unified-border-soft) !important;
  padding: 10px 12px !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
  .table-simple,
  .admin-table,
  .service-monitor-table
) :where(th, td):last-child {
  width: 1%;
  white-space: nowrap;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
  .table-simple,
  .admin-table,
  .service-monitor-table
) .row-actions {
  flex-wrap: nowrap !important;
  gap: 6px !important;
  justify-content: flex-end;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
  .table-simple,
  .admin-table,
  .service-monitor-table
) .row-actions :where(.btn, button) {
  min-height: 30px !important;
  padding-inline: 9px !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
  .form-actions,
  .ticket-form-actions,
  .stack-actions,
  .support-success-actions,
  .request-success-actions
) {
  align-items: center;
  border-top: 1px solid var(--unified-border-soft);
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-top: var(--unified-space) !important;
  padding-top: 14px;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
  .empty-state,
  .no-results,
  .not-found-state,
  .alarm-empty-state,
  .global-search-empty,
  .map-zones-empty
) {
  background: var(--unified-surface-soft) !important;
  border: 1px dashed #c7d4e0 !important;
  border-radius: var(--unified-radius) !important;
  min-height: 104px;
  padding: 24px !important;
}

@media (max-width: 760px) {
  html[data-theme="light"] body.ui-unified-page.app-standard #main-content > .section {
    padding-block: 12px 24px !important;
  }

  html[data-theme="light"] body.ui-unified-page.app-standard #main-content > .section > .container {
    width: min(calc(100% - 20px), 1760px);
  }

  html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
    .admin-form-block,
    .admin-detail-panel,
    .admin-detail-copy-card,
    .profile-section-panel,
    .request-form-panel,
    .support-request-form-panel,
    .detail-section-card,
    .alarm-groups-panel,
    .alarm-group-panel,
    .lorawan-panel,
    .service-ops-section,
    .gateway-detail-section,
    .phd-browser-panel,
    .infra-browser-panel,
    .support-action-board,
    .ticket-conversation-card
  ) {
    padding: 12px !important;
  }

  html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
    .form-actions,
    .ticket-form-actions,
    .stack-actions,
    .support-success-actions,
    .request-success-actions
  ) > :where(.btn, button, a) {
    flex: 1 1 100%;
    justify-content: center;
  }
}

html[data-theme="light"] body.home-page .hero.hero-fullheight .container {
  display: block !important;
  height: auto !important;
}

html[data-theme="light"] body.home-page .hero-surface {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  display: block !important;
  min-height: 0 !important;
}

html[data-theme="light"] body.home-page .hero-grid {
  min-height: 0 !important;
  padding: clamp(28px, 4vw, 52px) !important;
}

html[data-theme="light"] body.home-page.app-sidebar-page .hero h1 {
  color: #1e293b !important;
  font-size: clamp(2rem, 3.3vw, 3.35rem) !important;
  letter-spacing: -0.035em !important;
  line-height: 1.04 !important;
  max-width: 17ch !important;
}

html[data-theme="light"] body.home-page .hero p {
  color: #64748b !important;
  font-weight: 500 !important;
  max-width: 62ch;
}

html[data-theme="light"] body.home-page .home-workspace-section {
  padding: 22px 0 0 !important;
}

html[data-theme="light"] body.home-page .home-workspace-head {
  align-items: end;
  border-bottom: 1px solid #d9e2ec;
  margin-bottom: 14px !important;
  padding-bottom: 12px;
}

html[data-theme="light"] body.home-page .home-quick-grid {
  display: grid;
  gap: 10px !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

html[data-theme="light"] body.home-page .home-quick-card {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  color: #334155 !important;
  min-height: 132px;
  padding: 16px !important;
  transform: none !important;
}

html[data-theme="light"] body.home-page .home-quick-card:hover,
html[data-theme="light"] body.home-page .home-quick-card:focus-visible {
  background: #f8fafc !important;
  border-color: #8ad8b5 !important;
  color: #035e8c !important;
}

html[data-theme="light"] body.home-page .home-quick-index {
  color: #00a870 !important;
  font-size: 0.72rem;
  font-weight: 750;
}

html[data-theme="light"] body.home-page .home-quick-arrow {
  color: #00a870 !important;
}

/* Remove residual generated gradients while preserving inline media previews. */
html[data-theme="light"] body:not(.inventory-map-body) #main-content *:not([style*="background-image"]),
html[data-theme="light"] body:not(.inventory-map-body) #main-content *:not([style*="background-image"])::before,
html[data-theme="light"] body:not(.inventory-map-body) #main-content *:not([style*="background-image"])::after {
  background-image: none !important;
}

html[data-theme="light"] body #main-content :where(a, button, summary) {
  box-shadow: none !important;
}

/* Restore the one functional CSS image removed by the flat reset. */
html[data-theme="light"] body .inventory-leaflet-map .leaflet-control-layers-toggle,
html[data-theme="light"] body .leaflet-device-map .leaflet-control-layers-toggle {
  background-image: url("../vendor/leaflet/images/layers.png") !important;
}

@media (min-resolution: 2dppx) {
  html[data-theme="light"] body .inventory-leaflet-map .leaflet-control-layers-toggle,
  html[data-theme="light"] body .leaflet-device-map .leaflet-control-layers-toggle {
    background-image: url("../vendor/leaflet/images/layers-2x.png") !important;
  }
}

@media (max-width: 1050px) {
  html[data-theme="light"] body.home-page .home-quick-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  html[data-theme="light"] body.home-page.app-sidebar-page main {
    padding: 12px 0 24px !important;
  }

  html[data-theme="light"] body.home-page .hero-grid {
    padding: 22px 18px !important;
  }

  html[data-theme="light"] body.home-page.app-sidebar-page .hero h1 {
    font-size: clamp(1.75rem, 9vw, 2.35rem) !important;
  }

  html[data-theme="light"] body.home-page .home-quick-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-theme="light"] body.home-page .home-quick-card {
    min-height: 108px;
  }
}

/* Specialized views inherit the same surface contract as the main catalog. */
html[data-theme="light"] body:not(.inventory-map-body) #main-content :where(
  .admin-demand-panel, .admin-detail-hero, .admin-detail-highlight-card,
  .admin-detail-panel-emphasis, .admin-detail-summary, .admin-device-panel,
  .alarm-overview-panel, .alarm-group-card, .alarm-groups-card,
  .asset-action-panel, .detail-panel, .detail-summary-card, .device-360-card,
  .device-alarm-rule-card, .device-detail-hero, .device-highlight-card,
  .device-measure-card, .device-qr-panel, .device-ticket-card, .filters-card,
  .inventory-filter-panel, .lorawan-control-panel, .lorawan-map-panel,
  .lorawan-risk-panel, .map-zones-level-card, .map-zones-panel,
  .map-zones-summary-card, .master-data-panel, .master-data-view-card,
  .media-inline-edit-panel, .mqtt-explorer-panel, .mqtt-sync-errors-panel,
  .my-ticket-card, .profile-panel-v3, .profile-section-panel,
  .request-form-panel, .selected-solution-card, .sensor-flow-panel,
  .support-quick-card, .system-alerts-card, .system-command-card,
  .system-runbook-card, .ticket-attachments-panel
) {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .admin-demand-panel, .admin-detail-hero, .admin-detail-highlight-card,
  .admin-detail-panel-emphasis, .admin-detail-summary, .alarm-overview-panel,
  .alarm-group-card, .alarm-groups-card, .asset-action-panel, .detail-panel,
  .detail-summary-card, .device-360-card, .device-alarm-rule-card,
  .device-highlight-card, .device-measure-card, .device-qr-panel,
  .device-ticket-card, .filters-card, .inventory-filter-panel,
  .lorawan-control-panel, .lorawan-map-panel, .lorawan-risk-panel,
  .map-zones-level-card, .map-zones-panel, .map-zones-summary-card,
  .master-data-panel, .master-data-view-card, .media-inline-edit-panel,
  .mqtt-explorer-panel, .mqtt-sync-errors-panel, .profile-panel-v3,
  .profile-section-panel, .request-form-panel, .selected-solution-card,
  .sensor-flow-panel, .support-quick-card, .system-alerts-card,
  .system-command-card, .system-runbook-card, .ticket-attachments-panel
) {
  padding: 16px !important;
}

html[data-theme="light"] body #main-content :where(
  .alarm-groups-summary, .alarm-summary-grid-inline, .global-search-summary,
  .inventory-scope-summary, .lorawan-actions-summary, .map-zones-summary-grid,
  .master-data-summary-strip, .media-picker-summary, .my-requests-summary,
  .request-success-summary, .support-success-summary
) {
  background: #f8fafc !important;
  background-image: none !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #main-content :where(
  .alarm-empty-state, .global-search-empty, .map-zones-empty,
  .master-data-empty, .my-requests-empty, .my-tickets-empty,
  .system-alerts-empty
) {
  background: #f8fafc !important;
  border: 1px dashed #c7d4e0 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  color: #64748b !important;
  min-height: 96px;
  padding: 20px !important;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .admin-detail-toolbar, .alarm-bulk-toolbar, .alarm-groups-toolbar,
  .alarm-list-toolbar, .device-history-toolbar, .infra-result-toolbar,
  .inventory-tree-toolbar, .master-data-detail-toolbar, .media-picker-toolbar,
  .my-tickets-toolbar, .pdf-viewer-toolbar
) {
  align-items: center;
  background: transparent !important;
  border-bottom: 1px solid #e6edf3 !important;
  box-shadow: none !important;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px !important;
  justify-content: space-between;
  margin-bottom: 14px !important;
  padding: 0 0 12px !important;
}

html[data-theme="light"] body #main-content :where(
  .phd-record-notice, .lorawan-location-notice
) {
  background: #fffaf0 !important;
  border: 1px solid #efc46b !important;
  border-left: 3px solid #d99000 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  color: #7a5200 !important;
}

html[data-theme="light"] body #main-content .phd-record-notice.is-danger {
  background: #fef5f5 !important;
  border-color: #e8a2a2 !important;
  border-left-color: #d64545 !important;
  color: #b4232d !important;
}

@media (max-width: 1100px) {
  body.app-standard #main-content :where(
    .alarm-groups-layout, .device-detail-layout, .master-data-layout,
    .admin-detail-layout, .support-form-layout
  ) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.app-standard #main-content :where(
    .alarm-groups-sidebar, .detail-sidebar-stack
  ) {
    order: 0;
    position: static !important;
    top: auto !important;
  }
}

@media (max-width: 760px) {
  html[data-theme="light"] body.app-standard #main-content :where(
    .admin-demand-panel, .admin-detail-hero, .admin-detail-highlight-card,
    .admin-detail-panel-emphasis, .admin-detail-summary, .alarm-overview-panel,
    .alarm-group-card, .alarm-groups-card, .asset-action-panel, .detail-panel,
    .detail-summary-card, .device-360-card, .device-alarm-rule-card,
    .device-highlight-card, .device-measure-card, .device-qr-panel,
    .device-ticket-card, .filters-card, .inventory-filter-panel,
    .lorawan-control-panel, .lorawan-map-panel, .lorawan-risk-panel,
    .map-zones-level-card, .map-zones-panel, .map-zones-summary-card,
    .master-data-panel, .master-data-view-card, .media-inline-edit-panel,
    .mqtt-explorer-panel, .mqtt-sync-errors-panel, .profile-panel-v3,
    .profile-section-panel, .request-form-panel, .selected-solution-card,
    .sensor-flow-panel, .support-quick-card, .system-alerts-card,
    .system-command-card, .system-runbook-card, .ticket-attachments-panel
  ) {
    border-radius: 6px !important;
    padding: 12px !important;
  }

  html[data-theme="light"] body.app-standard #main-content :where(
    .admin-detail-toolbar, .alarm-bulk-toolbar, .alarm-groups-toolbar,
    .alarm-list-toolbar, .device-history-toolbar, .infra-result-toolbar,
    .inventory-tree-toolbar, .master-data-detail-toolbar, .media-picker-toolbar,
    .my-tickets-toolbar, .pdf-viewer-toolbar
  ) {
    align-items: stretch;
    flex-direction: column;
  }
}

body #main-content :where(.tabs, .alarm-tabs, .view-toggle, .admin-subnav,
  .solution-group-nav, .lorawan-section-nav) :where(.active, .is-active, [aria-current="page"]) {
  border-bottom: 2px solid #0478b2 !important;
  color: #035e8c !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-user {
  align-items: center;
  display: grid;
  gap: 9px;
  grid-template-columns: 32px minmax(0, 1fr);
  margin-bottom: 6px;
  min-height: 42px;
  padding: 5px 8px;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-user-avatar {
  align-items: center;
  background: #e8f4fa;
  border: 1px solid #8ad8b5;
  border-radius: 6px;
  color: #035e8c;
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 750;
  height: 32px;
  justify-content: center;
  width: 32px;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-user-copy {
  display: grid;
  line-height: 1.25;
  min-width: 0;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-user-copy strong,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-user-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-user-copy strong {
  color: #334155;
  font-size: 0.78rem;
  font-weight: 700;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-user-copy small {
  color: #64748b;
  font-size: 0.68rem;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-logout-form .app-sidebar-link {
  color: #64748b !important;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-logout-form .app-sidebar-link:hover {
  background: #fef0f0 !important;
  color: #b4232d !important;
}

body.app-sidebar-page.app-sidebar-collapsed .app-sidebar-user {
  display: flex;
  justify-content: center;
  padding-inline: 0;
}

body.app-sidebar-page.app-sidebar-collapsed .app-sidebar-user-copy {
  display: none;
}

html[data-theme="light"] body.app-standard #main-content .page-header {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  justify-content: space-between;
  width: 100%;
}

html[data-theme="light"] body.app-standard #main-content .page-header > :first-child {
  max-width: 78ch;
  min-width: 0;
}

html[data-theme="light"] body.app-standard #main-content .page-header :where(h1, h2) {
  margin-bottom: 0;
}

html[data-theme="light"] body.app-standard #main-content .page-header p {
  margin: 4px 0 0;
}

html[data-theme="light"] body.app-standard #main-content .page-header .row-actions {
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  html[data-theme="light"] body.app-standard #main-content .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  html[data-theme="light"] body.app-standard #main-content .page-header .row-actions {
    width: 100%;
  }
}

/* Public, status and completion screens share the application shell. */
html[data-theme="light"] body.auth-page #main-content {
  align-items: center;
  display: flex;
  min-height: calc(100dvh - 58px);
  padding: 28px 0;
}

html[data-theme="light"] body.auth-page .header-actions > .btn-primary {
  display: none !important;
}

html[data-theme="light"] body.auth-page .login-page {
  width: 100%;
}

html[data-theme="light"] body.auth-page .login-page-shell {
  align-items: stretch;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  max-width: 900px;
}

html[data-theme="light"] body.auth-page :where(.login-page-header, .login-page-panel) {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 8px !important;
  box-shadow: none !important;
}

html[data-theme="light"] body.auth-page .login-page-header {
  align-content: space-between;
  border-top: 3px solid #0478b2 !important;
  display: grid;
  gap: 24px;
}

html[data-theme="light"] body.auth-page .login-page-header > div > span {
  color: #00a870;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

html[data-theme="light"] body.auth-page .login-page-header h1 {
  color: #1e293b !important;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.04em;
  margin: 8px 0 10px;
}

html[data-theme="light"] body.auth-page .login-page-header p,
html[data-theme="light"] body.auth-page .login-page-panel-head p {
  color: #64748b !important;
  margin: 0;
}

html[data-theme="light"] body.auth-page .login-page-panel {
  align-content: center;
  display: grid;
  gap: 18px;
}

html[data-theme="light"] body.auth-page .login-page-panel-head {
  border-bottom: 1px solid #e6edf3;
  padding-bottom: 14px;
}

html[data-theme="light"] body.auth-page .login-page-panel-head h2 {
  color: #1e293b;
  font-size: 1.4rem;
  margin: 0 0 4px;
}

html[data-theme="light"] body.auth-page .login-page-panel form {
  display: grid;
  gap: 14px;
}

html[data-theme="light"] body.auth-page .login-page-panel .field {
  display: grid;
  gap: 6px;
}

html[data-theme="light"] body.auth-page .login-page-panel label {
  color: #334155;
  font-size: 0.8rem;
  font-weight: 650;
}

html[data-theme="light"] body :where(.status-page, .coming-soon-page) {
  align-items: center;
  display: flex;
  min-height: calc(100dvh - 120px);
}

html[data-theme="light"] body :where(.status-page-panel, .coming-soon-shell) {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #d9e2ec !important;
  border-top: 3px solid #0478b2 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  max-width: 760px;
  padding: clamp(22px, 4vw, 38px) !important;
}

html[data-theme="light"] body :where(.status-page-panel, .coming-soon-shell) :where(h1, h2) {
  color: #1e293b !important;
  font-size: clamp(1.75rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
  margin: 8px 0 10px;
}

html[data-theme="light"] body .status-page-kicker {
  color: #00a870 !important;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .support-success-header, .request-success-header
) {
  align-items: flex-end;
  background: #ffffff !important;
  border: 1px solid #d9e2ec !important;
  border-top: 3px solid #0478b2 !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 18px !important;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .support-success-header, .request-success-header
) h1 {
  font-size: clamp(1.65rem, 2.5vw, 2.1rem);
  margin: 3px 0;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .support-success-summary, .request-success-summary
) {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .support-success-summary, .request-success-summary
) > div {
  border-left: 1px solid #e6edf3;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .support-success-summary, .request-success-summary
) > div:first-child {
  border-left: 0;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .support-success-actions, .request-success-actions
) {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

html[data-theme="light"] body.business-app-embed-page #main-content {
  height: calc(100dvh - 58px);
  min-height: 420px;
  overflow: hidden;
}

html[data-theme="light"] body.business-app-embed-page .business-app-embed-shell,
html[data-theme="light"] body.business-app-embed-page .business-app-embed-frame {
  border: 0;
  display: block;
  height: 100%;
  width: 100%;
}

@media (max-width: 760px) {
  html[data-theme="light"] body.auth-page #main-content {
    align-items: flex-start;
    padding: 14px 0 24px;
  }

  html[data-theme="light"] body.auth-page .login-page-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-theme="light"] body.auth-page .login-page-header {
    gap: 14px;
  }

  html[data-theme="light"] body :where(.status-page, .coming-soon-page) {
    align-items: flex-start;
    min-height: 0;
  }

  html[data-theme="light"] body.app-standard #main-content :where(
    .support-success-header, .request-success-header
  ) {
    align-items: flex-start;
    flex-direction: column;
  }

  html[data-theme="light"] body.app-standard #main-content :where(
    .support-success-summary, .request-success-summary
  ) {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-theme="light"] body.app-standard #main-content :where(
    .support-success-summary, .request-success-summary
  ) > div {
    border-left: 0;
    border-top: 1px solid #e6edf3;
  }

  html[data-theme="light"] body.app-standard #main-content :where(
    .support-success-summary, .request-success-summary
  ) > div:first-child {
    border-top: 0;
  }
}

/* Cascade lock: spacing and controls must win over every legacy module. */
html[data-theme="light"] body.app-standard #main-content :where(a.btn, button.btn),
html[data-theme="light"] body.auth-page #main-content :where(a.btn, button.btn) {
  font-size: 0.82rem !important;
  font-weight: 650 !important;
  line-height: 1 !important;
  min-height: var(--ui-button-height) !important;
  padding: 0 14px !important;
}

html[data-theme="light"] body.app-standard #main-content :where(a.btn-sm, button.btn-sm),
html[data-theme="light"] body.auth-page #main-content :where(a.btn-sm, button.btn-sm) {
  font-size: 0.76rem !important;
  min-height: var(--ui-button-height-sm) !important;
  padding: 0 10px !important;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .card, .panel, .admin-form-block, .admin-detail-panel,
  .solution-group-section, .service-ops-section, .gateway-detail-section,
  .ticket-conversation-card, .user-space-panel, .notifications-page
) {
  padding: var(--ui-space-lg) !important;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .row-actions, .form-actions, .filters-actions, .admin-list-actions,
  .ticket-form-actions, .stack-actions, .support-success-actions,
  .request-success-actions, .business-app-card-actions,
  .notification-secondary-actions
) {
  gap: 8px !important;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .form-actions, .ticket-form-actions, .stack-actions,
  .support-success-actions, .request-success-actions
) {
  margin-top: var(--ui-space-lg) !important;
}

@media (max-width: 760px) {
  html[data-theme="light"] body.app-standard #main-content :where(a.btn, button.btn),
  html[data-theme="light"] body.auth-page #main-content :where(a.btn, button.btn) {
    min-height: 40px !important;
    padding-inline: 12px !important;
  }

  html[data-theme="light"] body.app-standard #main-content :where(
    .card, .panel, .admin-form-block, .admin-detail-panel,
    .solution-group-section, .service-ops-section, .gateway-detail-section,
    .ticket-conversation-card, .user-space-panel, .notifications-page
  ) {
    padding: 12px !important;
  }
}
/* Final typography authority: readable density without legacy micro-text. */
html[data-theme="light"] body.app-standard #main-content {
  color: #334155;
  font-size: 0.9375rem;
  line-height: 1.52;
}

html[data-theme="light"] body.app-standard #main-content .app-page-header {
  align-items: flex-end;
  border-bottom: 1px solid #d9e2ec;
  display: flex;
  justify-content: space-between;
  margin: 0;
  min-height: 76px;
  padding: 4px 0 16px;
}

html[data-theme="light"] body.app-standard #main-content .app-page-header > div {
  max-width: 760px;
}

html[data-theme="light"] body.app-standard #main-content .app-page-header h1 {
  color: #1e293b;
  font-size: clamp(1.55rem, 2vw, 1.9rem);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 3px 0 0;
}

html[data-theme="light"] body.app-standard #main-content .app-page-header p {
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 6px 0 0;
}

html[data-theme="light"] body.app-standard #main-content :where(h2, h3, h4) {
  color: #1e293b;
}

html[data-theme="light"] body.app-standard #main-content h2 {
  font-size: clamp(1.25rem, 1.5vw, 1.5rem);
  line-height: 1.24;
}

html[data-theme="light"] body.app-standard #main-content h3 {
  font-size: 1.05rem;
  line-height: 1.32;
}

html[data-theme="light"] body.app-standard #main-content h4 {
  font-size: 0.94rem;
  line-height: 1.4;
}

html[data-theme="light"] body.app-standard #main-content :where(p, li, td, dd) {
  color: #475569;
  line-height: 1.55;
}

html[data-theme="light"] body.app-standard #main-content :where(label, .field > span, .form-label, .table-simple th) {
  color: #475569;
  font-size: 0.78rem;
  font-weight: 650;
  line-height: 1.35;
}

html[data-theme="light"] body.app-standard #main-content :where(
  small, .muted, .helper-text, .field-help, .meta-row, .alarm-meta-line
) {
  color: #64748b;
  font-size: 0.76rem !important;
  line-height: 1.45;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .eyebrow, .admin-overview-eyebrow, .business-app-kicker, .status-page-kicker,
  .badge, .chip, .status-pill, .service-status-pill
) {
  font-size: 0.72rem !important;
  line-height: 1.25;
}

html[data-theme="light"] body.app-standard #main-content .table-simple :where(td, th) {
  padding-block: 11px;
  padding-inline: 12px;
}

html[data-theme="light"] body.app-sidebar-page :where(.app-sidebar-link, .app-sidebar-section > summary) {
  font-size: 0.84rem !important;
  line-height: 1.3;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-panel a,
html[data-theme="light"] body.admin-page .admin-nav-panel a {
  font-size: 0.8rem !important;
  line-height: 1.35;
}

html[data-theme="light"] body.admin-page .admin-nav-section-label,
html[data-theme="light"] body.app-sidebar-page .app-sidebar-user-copy small {
  font-size: 0.7rem !important;
  line-height: 1.35;
}

html[data-theme="light"] body.app-sidebar-page .app-sidebar-user-copy strong {
  font-size: 0.8rem;
}

@media (max-width: 760px) {
  html[data-theme="light"] body.app-standard #main-content .app-page-header {
    align-items: flex-start;
    min-height: 0;
    padding-bottom: 12px;
  }

  html[data-theme="light"] body.app-standard #main-content .app-page-header h1 {
    font-size: 1.45rem;
  }

  html[data-theme="light"] body.app-standard #main-content .app-page-header p {
    font-size: 0.84rem;
  }

  html[data-theme="light"] body.app-standard #main-content .table-simple :where(td, th) {
    padding-block: 10px;
    padding-inline: 10px;
  }
}

/* Operational finishing pass: compact rhythm for every content family. */
html[data-theme="light"] body.app-standard #main-content :where(
  .solution-explorer-shell, .alarm-explorer-shell, .support-explorer-shell,
  .admin-main-panel, .admin-list-page, .admin-form-page
) {
  gap: 16px;
}

html[data-theme="light"] body.app-standard #main-content :where(.field, .form-field) {
  gap: 6px;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .scope-hint, .alarm-recipient-helper, .field-help, .form-help,
  .inventory-form-hint, .support-form-hint, [data-select-search-summary]
) {
  background: #f8fafc;
  border-left: 2px solid #8ad8b5;
  border-radius: 0 4px 4px 0;
  color: #64748b;
  display: block;
  font-size: 0.76rem !important;
  line-height: 1.45;
  margin: 0;
  padding: 8px 10px;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .empty-state, .no-results, .not-found-state, .alarm-empty-state,
  .global-search-empty, .map-zones-empty
) {
  align-items: center;
  background: #f8fafc !important;
  border: 1px dashed #c7d4e0 !important;
  border-radius: 6px !important;
  color: #64748b !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.5;
  min-height: 88px;
  padding: 22px !important;
  text-align: center;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .table-wrap, .table-responsive, .table-wrapper, .infra-browser-table-wrap
) {
  background: #ffffff;
  border: 1px solid #d9e2ec !important;
  border-radius: 6px !important;
  overflow-x: auto;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .table-simple, .admin-table, .service-monitor-table
) {
  border-collapse: collapse;
  margin: 0;
  width: 100%;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .table-simple, .admin-table, .service-monitor-table
) thead th {
  background: #f8fafc !important;
  border-bottom: 1px solid #c7d4e0 !important;
  color: #475569 !important;
  font-size: 0.72rem !important;
  font-weight: 750 !important;
  letter-spacing: 0.025em;
  line-height: 1.3;
  padding: 10px 12px !important;
  text-transform: uppercase;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .table-simple, .admin-table, .service-monitor-table
) tbody td {
  border-bottom: 1px solid #edf1f5 !important;
  font-size: 0.82rem;
  padding: 11px 12px !important;
  vertical-align: middle;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .table-simple, .admin-table, .service-monitor-table
) tbody tr:last-child td {
  border-bottom: 0 !important;
}

html[data-theme="light"] body.app-standard #main-content .pagination {
  align-items: center;
  background: transparent !important;
  border: 0 !important;
  color: #64748b;
  display: flex;
  flex-wrap: wrap;
  font-size: 0.78rem;
  gap: 6px;
  justify-content: space-between;
  margin-top: 16px;
  padding: 0 !important;
}

html[data-theme="light"] body.app-standard #main-content .pagination :where(a, button, span.current) {
  align-items: center;
  background: #ffffff !important;
  border: 1px solid #c7d4e0 !important;
  border-radius: 5px !important;
  color: #475569 !important;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 650;
  justify-content: center;
  min-height: 34px;
  min-width: 34px;
  padding: 0 10px !important;
}

html[data-theme="light"] body.app-standard #main-content .pagination :where(a, button):hover,
html[data-theme="light"] body.app-standard #main-content .pagination :where(a, button):focus-visible,
html[data-theme="light"] body.app-standard #main-content .pagination span.current {
  background: #e8f4fa !important;
  border-color: #8ad8b5 !important;
  color: #035e8c !important;
}

html[data-theme="light"] body.app-standard #main-content :where(input, select, textarea)::placeholder {
  color: #94a3b8;
  opacity: 1;
}

@media (max-width: 760px) {
  html[data-theme="light"] body.app-standard #main-content :where(
    .solution-explorer-shell, .alarm-explorer-shell, .support-explorer-shell,
    .admin-main-panel, .admin-list-page, .admin-form-page
  ) {
    gap: 12px;
  }

  html[data-theme="light"] body.app-standard #main-content :where(
    .empty-state, .no-results, .not-found-state, .alarm-empty-state,
    .global-search-empty, .map-zones-empty
  ) {
    min-height: 72px;
    padding: 16px !important;
  }

  html[data-theme="light"] body.app-standard #main-content .pagination {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* Explorer surface reset: wrappers are layout, only real panels receive a surface. */
html[data-theme="light"] body.app-standard #main-content :where(
  .solution-explorer-shell, .alarm-explorer-shell, .support-explorer-shell,
  .solution-groups, .solution-groups-expanded
) {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

html[data-theme="light"] body.app-standard #main-content .solution-explorer-shell {
  display: grid;
  gap: 16px !important;
}

html[data-theme="light"] body.app-standard #main-content .app-page-header {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid #d9e2ec !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  min-height: 0 !important;
  padding: 0 0 14px !important;
}

html[data-theme="light"] body.app-standard #main-content .solution-filter-panel {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  display: grid;
  gap: 14px !important;
  margin: 0 !important;
  padding: 16px !important;
}

html[data-theme="light"] body.app-standard #main-content :where(
  .solution-filter-form, .solution-filter-meta
) {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

html[data-theme="light"] body.app-standard #main-content .solution-filter-form {
  align-items: end;
  column-gap: 14px !important;
  row-gap: 12px !important;
}

html[data-theme="light"] body.app-standard #main-content .solution-filter-actions {
  align-items: center;
  margin: 0 !important;
}

html[data-theme="light"] body.app-standard #main-content .solution-filter-stats-compact {
  align-items: stretch;
  display: flex !important;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 8px !important;
  margin: 0 !important;
}

html[data-theme="light"] body.app-standard #main-content .solution-filter-stats-compact > article {
  align-items: baseline;
  background: #f8fafc !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 5px !important;
  display: inline-flex;
  gap: 7px;
  min-height: 38px;
  padding: 9px 12px !important;
}

html[data-theme="light"] body.app-standard #main-content .solution-filter-stats-compact > article :where(span, strong) {
  line-height: 1.2;
  margin: 0;
}

html[data-theme="light"] body.app-standard #main-content .solution-groups {
  display: grid;
  gap: 14px !important;
}

html[data-theme="light"] body.app-standard #main-content .solution-group-toolbar {
  align-items: center;
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  display: flex;
  gap: 10px !important;
  justify-content: space-between;
  margin: 0 !important;
  padding: 8px !important;
}

html[data-theme="light"] body.app-standard #main-content .solution-group-nav {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  gap: 2px !important;
  margin: 0 !important;
  padding: 0 !important;
}

html[data-theme="light"] body.app-standard #main-content .solution-group-nav > a {
  border-radius: 4px !important;
  min-height: 34px;
  padding: 6px 10px !important;
}

html[data-theme="light"] body.app-standard #main-content .solution-group-nav > a:hover,
html[data-theme="light"] body.app-standard #main-content .solution-group-nav > a:focus-visible {
  background: #f0f3f7 !important;
}

html[data-theme="light"] body.app-standard #main-content .solution-group-section {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  gap: 14px !important;
  margin: 0 !important;
  padding: 16px !important;
}

html[data-theme="light"] body.app-standard #main-content .solution-group-head {
  align-items: center;
  border-bottom: 1px solid #e6edf3;
  gap: 12px;
  margin: 0;
  padding: 0 0 10px !important;
}

html[data-theme="light"] body.app-standard #main-content .solution-group-head :where(h2, h3, p) {
  margin: 0 !important;
}

@media (max-width: 980px) {
  html[data-theme="light"] body.app-standard #main-content .solution-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  html[data-theme="light"] body.app-standard #main-content .solution-filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  html[data-theme="light"] body.app-standard #main-content .solution-explorer-shell,
  html[data-theme="light"] body.app-standard #main-content .solution-groups {
    gap: 12px !important;
  }

  html[data-theme="light"] body.app-standard #main-content .solution-filter-panel,
  html[data-theme="light"] body.app-standard #main-content .solution-group-section {
    padding: 12px !important;
  }

  html[data-theme="light"] body.app-standard #main-content .solution-filter-form {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html[data-theme="light"] body.app-standard #main-content .solution-filter-actions {
    grid-column: auto;
  }

  html[data-theme="light"] body.app-standard #main-content .solution-group-toolbar {
    align-items: stretch;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    padding: 8px !important;
  }

  html[data-theme="light"] body.app-standard #main-content .solution-group-toolbar .row-actions,
  html[data-theme="light"] body.app-standard #main-content .solution-group-toolbar .btn {
    width: 100%;
  }
}

/* Admin layout reset: the main column and its heading are not nested cards. */
html[data-theme="light"] body.admin-page #main-content .admin-main-panel {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  min-width: 0;
  padding: 0 !important;
}

html[data-theme="light"] body.admin-page #main-content :where(
  .admin-list-header, .admin-overview-head, .admin-main-panel > .section-head
) {
  align-items: flex-end;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-bottom: 1px solid #d9e2ec !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 0 16px !important;
  padding: 0 0 14px !important;
}

html[data-theme="light"] body.admin-page #main-content :where(
  .admin-list-header, .admin-overview-head, .admin-main-panel > .section-head
) :where(h1, h2, h3, p) {
  margin-bottom: 0 !important;
}

html[data-theme="light"] body.admin-page #main-content .admin-main-panel > :last-child {
  margin-bottom: 0 !important;
}

@media (max-width: 760px) {
  html[data-theme="light"] body.admin-page #main-content :where(
    .admin-list-header, .admin-overview-head, .admin-main-panel > .section-head
  ) {
    align-items: stretch;
    display: grid;
    gap: 10px;
    margin-bottom: 12px !important;
    padding-bottom: 12px !important;
  }
}
/* Breadcrumb-first page hierarchy: the canonical title lives in the topbar. */
html[data-theme="light"] body.app-sidebar-page .topbar-inner > .app-topbar-breadcrumbs {
  align-items: center;
  align-self: stretch;
  display: flex !important;
  flex-wrap: nowrap;
  gap: 0;
  grid-column: 1;
  grid-row: 1;
  color: #64748b;
  min-height: 58px;
  overflow: hidden;
  padding: 0;
}

html[data-theme="light"] body.app-sidebar-page .app-topbar-breadcrumbs :where(a, span) {
  flex: 0 1 auto;
  font-size: 0.78rem;
  line-height: 1.3;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html[data-theme="light"] body.app-sidebar-page .app-topbar-breadcrumbs a {
  color: #64748b;
}

html[data-theme="light"] body.app-sidebar-page .app-topbar-breadcrumbs a:hover,
html[data-theme="light"] body.app-sidebar-page .app-topbar-breadcrumbs a:focus-visible {
  color: #035e8c;
}

html[data-theme="light"] body.app-sidebar-page .app-topbar-breadcrumbs a::after {
  content: none !important;
}

html[data-theme="light"] body.app-sidebar-page .app-topbar-breadcrumbs > * + *::before {
  color: #94a3b8;
  content: "/";
  margin: 0 9px;
}

html[data-theme="light"] body.app-sidebar-page .app-topbar-breadcrumbs [aria-current="page"] {
  color: #1e293b;
  font-weight: 700;
}

html[data-theme="light"] body.app-sidebar-page #main-content :where(
  .app-page-header, .admin-list-header, .admin-overview-head,
  .section-head.page-header, .user-notifications-header,
  .user-requests-header, .user-tickets-header, .my-alarm-history-header,
  .support-form-header, .request-form-header, .report-form-header,
  .report-preview-header, .support-success-header, .request-success-header,
  .service-ops-head, .gateway-detail-header, .phd-record-head,
  .solution-catalog-header, .admin-ticket-queue-header,
  .mqtt-retention-header
) {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  gap: 10px !important;
  justify-content: flex-end;
  margin: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content :where(
  .app-page-header, .admin-list-header, .admin-overview-head,
  .section-head.page-header, .user-notifications-header,
  .user-requests-header, .user-tickets-header, .my-alarm-history-header,
  .support-form-header, .request-form-header, .report-form-header,
  .report-preview-header, .support-success-header, .request-success-header,
  .service-ops-head, .gateway-detail-header, .phd-record-head,
  .solution-catalog-header, .admin-ticket-queue-header,
  .mqtt-retention-header
) :where(h1, h2) {
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  white-space: nowrap !important;
  width: 1px !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content :where(
  .app-page-header, .admin-list-header, .admin-overview-head,
  .section-head.page-header, .user-notifications-header,
  .user-requests-header, .user-tickets-header, .my-alarm-history-header,
  .support-form-header, .request-form-header, .report-form-header,
  .report-preview-header, .support-success-header, .request-success-header,
  .solution-catalog-header, .admin-ticket-queue-header,
  .mqtt-retention-header
) > div:first-child > :where(p, .eyebrow, [class*="kicker"]) {
  display: none !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content :where(
  .service-ops-head, .gateway-detail-header, .phd-record-head
) :where(p, [class*="eyebrow"], [class*="kicker"]) {
  display: none !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content :where(
  .admin-list-header, .admin-overview-head, .section-head.page-header,
  .user-notifications-header, .user-requests-header, .user-tickets-header,
  .my-alarm-history-header, .support-form-header, .request-form-header,
  .report-form-header, .report-preview-header, .support-success-header,
  .request-success-header, .service-ops-head, .gateway-detail-header,
  .phd-record-head, .solution-catalog-header, .admin-ticket-queue-header,
  .mqtt-retention-header
):has(.btn, button, details, .row-actions, .chips, [class*="actions"], [class*="health"]) {
  margin-bottom: 12px !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content .global-search-hero > div:first-child {
  display: none !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content .global-search-hero {
  padding: 14px !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content .breadcrumb-duplicate-title {
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  white-space: nowrap !important;
  width: 1px !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content .breadcrumb-title-toolbar {
  justify-content: flex-end !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content :where(
  .detail-summary-card > div:has(> .detail-title),
  .device-detail-head > div:first-child
) {
  display: none !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content :where(
  .solution-hero-card > .detail-title,
  .solution-hero-card > .solution-detail-eyebrow,
  .admin-detail-hero-copy > h2,
  .admin-detail-hero-copy > .admin-detail-hero-kicker,
  .pdf-viewer-toolbar h2
) {
  display: none !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content .pdf-viewer-toolbar > div:first-child > p {
  display: none !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content .admin-detail-hero {
  padding-top: 14px !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content .admin-detail-hero-copy > p {
  margin: 0 !important;
}

html[data-theme="light"] body.app-sidebar-page .topbar-inner > .header-actions {
  grid-column: 2;
  justify-self: end;
}

@media (max-width: 900px) {
  html[data-theme="light"] body.app-sidebar-page .topbar-inner > .header-actions {
    grid-column: 3;
    grid-row: 1;
  }

  html[data-theme="light"] body.app-sidebar-page .topbar-inner > .app-topbar-breadcrumbs {
    border-top: 1px solid #e6edf3;
    grid-column: 1 / -1;
    grid-row: 2;
    min-height: 36px;
    padding: 7px 0 6px;
  }

  html[data-theme="light"] body.app-sidebar-page .topbar .nav {
    grid-row: 3 !important;
  }
}

@media (max-width: 760px) {
  html[data-theme="light"] body.app-sidebar-page .app-topbar-breadcrumbs :where(a, span) {
    font-size: 0.74rem;
  }

  html[data-theme="light"] body.app-sidebar-page .app-topbar-breadcrumbs > * + *::before {
    margin-inline: 7px;
  }
}

/* Inventory workspace reset: remove the legacy cyan and decorative panel skin. */
html[data-theme="light"] body.inventory-device-body,
html[data-theme="light"] body.inventory-device-body #main-content,
html[data-theme="light"] body.inventory-device-body #main-content > .inventory-device-page {
  background: #f4f6f8 !important;
  background-image: none !important;
}

html[data-theme="light"] body.inventory-map-body #main-content > .inventory-device-page {
  padding: 12px 0 20px !important;
}

html[data-theme="light"] body.inventory-device-body #main-content :where(
  .inventory-device-filter-panel,
  .inventory-map-filter-panel
) {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}

html[data-theme="light"] body.inventory-device-body #main-content :where(
  .inventory-device-filter-panel,
  .inventory-map-filter-panel
)::before,
html[data-theme="light"] body.inventory-device-body #main-content :where(
  .inventory-device-filter-panel,
  .inventory-map-filter-panel
)::after {
  content: none !important;
  display: none !important;
}

html[data-theme="light"] body.inventory-device-body #main-content .inventory-device-filter-panel,
html[data-theme="light"] body.inventory-map-body #main-content .inventory-map-filter-panel {
  padding: 14px 16px !important;
}

html[data-theme="light"] body.inventory-device-body #main-content .inventory-device-filter-form {
  align-items: end;
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  gap: 10px 12px !important;
  margin: 0 !important;
  padding: 0 !important;
}

html[data-theme="light"] body.inventory-map-body #main-content .inventory-map-filter-panel > .inventory-filter-panel__body > .section-head {
  display: none !important;
}

html[data-theme="light"] body.inventory-map-body #main-content .inventory-map-filter-panel .admin-filters {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

html[data-theme="light"] body.inventory-device-body #main-content .inventory-device-filter-form .field > label {
  color: #475569 !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  margin-bottom: 5px !important;
}

html[data-theme="light"] body.inventory-device-body #main-content .inventory-device-filter-form :where(input, select),
html[data-theme="light"] body.inventory-map-body #main-content .inventory-map-filter-panel .admin-filters :where(input, select),
html[data-theme="light"] body.inventory-device-body #main-content .inventory-device-filter-actions .btn {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 5px !important;
  box-shadow: none !important;
  color: #334155 !important;
  font-size: 0.82rem !important;
  min-height: 40px !important;
}

html[data-theme="light"] body.inventory-device-body #main-content .inventory-device-filter-form :where(input, select):hover,
html[data-theme="light"] body.inventory-map-body #main-content .inventory-map-filter-panel .admin-filters :where(input, select):hover {
  border-color: #94a3b8 !important;
}

html[data-theme="light"] body.inventory-device-body #main-content .inventory-device-filter-form :where(input, select):focus-visible,
html[data-theme="light"] body.inventory-map-body #main-content .inventory-map-filter-panel .admin-filters :where(input, select):focus-visible {
  border-color: #035e8c !important;
  box-shadow: 0 0 0 2px rgba(3, 94, 140, 0.12) !important;
  outline: 0 !important;
}

html[data-theme="light"] body.inventory-device-body #main-content :where(
  .inventory-device-view-nav,
  .inventory-map-meta-row .view-toggle
) {
  align-items: stretch !important;
  align-self: end !important;
  background: transparent !important;
  border: 0 !important;
  border-left: 1px solid #d9e2ec !important;
  border-radius: 0 !important;
  display: flex !important;
  gap: 2px !important;
  min-height: 40px;
  padding: 0 0 0 12px !important;
}

html[data-theme="light"] body.inventory-device-body #main-content :where(
  .inventory-device-view-nav,
  .inventory-map-meta-row .view-toggle
) > a {
  align-items: center;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  color: #64748b !important;
  display: inline-flex;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  min-height: 40px !important;
  padding: 8px 10px 6px !important;
}

html[data-theme="light"] body.inventory-device-body #main-content :where(
  .inventory-device-view-nav,
  .inventory-map-meta-row .view-toggle
) > a:hover,
html[data-theme="light"] body.inventory-device-body #main-content :where(
  .inventory-device-view-nav,
  .inventory-map-meta-row .view-toggle
) > a:focus-visible {
  color: #1e293b !important;
}

html[data-theme="light"] body.inventory-device-body #main-content :where(
  .inventory-device-view-nav,
  .inventory-map-meta-row .view-toggle
) > a.active {
  border-bottom-color: #0478b2 !important;
  color: #035e8c !important;
}

html[data-theme="light"] body.inventory-map-body #main-content :where(
  .inventory-map-shell,
  .inventory-map-layout,
  .inventory-map-main-stage
) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html[data-theme="light"] body.inventory-map-body #main-content .inventory-map-canvas {
  background: #ffffff !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  overflow: hidden;
}

@media (max-width: 1100px) {
  html[data-theme="light"] body.inventory-device-body #main-content :where(
    .inventory-device-view-nav,
    .inventory-map-meta-row .view-toggle
  ) {
    border-left: 0 !important;
    border-top: 1px solid #d9e2ec !important;
    grid-column: 1 / -1;
    padding: 8px 0 0 !important;
  }
}

@media (max-width: 760px) {
  html[data-theme="light"] body.inventory-device-body #main-content .inventory-device-filter-panel,
  html[data-theme="light"] body.inventory-map-body #main-content .inventory-map-filter-panel {
    border-radius: 6px !important;
    padding: 12px !important;
  }

  html[data-theme="light"] body.inventory-device-body #main-content :where(
    .inventory-device-view-nav,
    .inventory-map-meta-row .view-toggle
  ) {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  html[data-theme="light"] body.inventory-device-body #main-content :where(
    .inventory-device-view-nav,
    .inventory-map-meta-row .view-toggle
  ) > a {
    justify-content: center;
  }
}

/* Global search belongs to the application chrome, not to a standalone entry page. */
html[data-theme="light"] body.app-sidebar-page .topbar-inner {
  grid-template-columns: minmax(120px, 1fr) auto auto !important;
}

html[data-theme="light"] body.app-sidebar-page .topbar-inner > .app-topbar-breadcrumbs {
  grid-column: 1;
  min-width: 0;
}

html[data-theme="light"] body.app-sidebar-page .topbar-inner > .topbar-global-search {
  align-items: center;
  align-self: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  display: grid;
  gap: 0;
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: 36px minmax(160px, 1fr) auto;
  height: 40px;
  margin: 0;
  overflow: hidden;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  width: clamp(300px, 34vw, 560px);
}

html[data-theme="light"] body.app-sidebar-page .topbar-inner > .topbar-global-search:focus-within {
  border-color: #035e8c;
  box-shadow: 0 0 0 2px rgba(3, 94, 140, 0.12);
}

html[data-theme="light"] body.app-sidebar-page .topbar-global-search-icon {
  color: #035e8c;
  display: grid;
  place-items: center;
}

html[data-theme="light"] body.app-sidebar-page .topbar-global-search :where(.topbar-global-search-icon svg, button svg) {
  fill: none;
  height: 16px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 16px;
}

html[data-theme="light"] body.app-sidebar-page .topbar-global-search input[type="search"] {
  appearance: none;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #1e293b !important;
  font: inherit;
  font-size: 0.78rem;
  height: 38px;
  min-height: 38px !important;
  min-width: 0;
  outline: 0 !important;
  padding: 0 8px 0 0 !important;
  width: 100%;
}

html[data-theme="light"] body.app-sidebar-page .topbar-global-search input[type="search"]::placeholder {
  color: #94a3b8;
  opacity: 1;
}

html[data-theme="light"] body.app-sidebar-page .topbar-global-search button {
  align-items: center;
  align-self: stretch;
  background: #0478b2 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #ffffff !important;
  cursor: pointer;
  display: inline-flex;
  font-size: 0.76rem;
  font-weight: 700;
  gap: 6px;
  justify-content: center;
  min-height: 38px !important;
  padding: 0 13px !important;
}

html[data-theme="light"] body.app-sidebar-page .topbar-global-search button:hover,
html[data-theme="light"] body.app-sidebar-page .topbar-global-search button:focus-visible {
  background: #009f69 !important;
}

html[data-theme="light"] body.app-sidebar-page .topbar-inner > .header-actions {
  grid-column: 3 !important;
  grid-row: 1;
}

@media (max-width: 1180px) and (min-width: 901px) {
  html[data-theme="light"] body.app-sidebar-page .topbar-inner > .topbar-global-search {
    width: clamp(260px, 31vw, 360px);
  }
}

@media (max-width: 900px) {
  html[data-theme="light"] body.app-sidebar-page .topbar-inner {
    grid-template-columns: minmax(0, 1fr) auto auto !important;
  }

  html[data-theme="light"] body.app-sidebar-page .topbar-inner > .topbar-global-search {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  html[data-theme="light"] body.app-sidebar-page .topbar-inner > .app-topbar-breadcrumbs {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  html[data-theme="light"] body.app-sidebar-page .topbar .nav {
    grid-row: 4 !important;
  }
}

@media (max-width: 520px) {
  html[data-theme="light"] body.app-sidebar-page .topbar-global-search button {
    padding-inline: 11px !important;
  }

  html[data-theme="light"] body.app-sidebar-page .topbar-global-search button span {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }
}

/* One neutral workspace canvas across every authenticated view. */
html[data-theme="light"] body.app-sidebar-page {
  --app-workspace-background: #f5f7fa;
  background: var(--app-workspace-background) !important;
  background-color: var(--app-workspace-background) !important;
  background-image: none !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content {
  background: var(--app-workspace-background) !important;
  background-color: var(--app-workspace-background) !important;
  background-image: none !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content > :where(
  .section,
  .hero,
  .auth-layout,
  .employee-device-management-page,
  .admin-device-management-page,
  .inventory-device-page,
  .business-apps-section
) {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
}

html[data-theme="light"] body.inventory-device-body,
html[data-theme="light"] body.inventory-device-body #main-content,
html[data-theme="light"] body.inventory-device-body #main-content > .inventory-device-page {
  background: var(--app-workspace-background) !important;
  background-color: var(--app-workspace-background) !important;
  background-image: none !important;
}

/* Infrastructure overview: one operational bar, not a row of nested cards. */
html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-overview {
  gap: 16px !important;
  padding: 16px 18px !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status {
  align-items: stretch !important;
  border-bottom: 1px solid #e2e8f0;
  display: grid !important;
  gap: 0 !important;
  grid-template-columns: minmax(190px, 1.35fr) repeat(3, minmax(110px, 0.65fr));
  margin: 0 !important;
  padding: 0 0 14px !important;
  width: 100%;
}

html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status > article {
  align-content: center;
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-right: 1px solid #e2e8f0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: grid !important;
  gap: 4px !important;
  min-height: 46px;
  padding: 2px 18px !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status > article:first-child {
  padding-left: 0 !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status > article:last-child {
  border-right: 0 !important;
  padding-right: 0 !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status > article > span {
  color: #64748b !important;
  font-size: 0.67rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.045em;
  line-height: 1.2;
  text-transform: uppercase;
}

html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status > article > strong {
  color: #1e293b !important;
  font-size: 1rem !important;
  font-variant-numeric: tabular-nums;
  font-weight: 750 !important;
  line-height: 1.2;
}

html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status .infra-browser-state > strong {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status .infra-browser-state > strong::before {
  background: #00a870;
  border-radius: 50%;
  content: "";
  flex: 0 0 8px;
  height: 8px;
  width: 8px;
}

html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status.is-warning .infra-browser-state > strong {
  color: #a15c00 !important;
}

html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status.is-warning .infra-browser-state > strong::before {
  background: #d99000;
}

html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-filters {
  column-gap: 12px !important;
  row-gap: 10px !important;
}

@media (max-width: 900px) {
  html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status > article,
  html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status > article:first-child,
  html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status > article:last-child {
    border-bottom: 1px solid #e2e8f0 !important;
    border-right: 1px solid #e2e8f0 !important;
    padding: 10px 12px !important;
  }

  html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status > article:nth-child(even) {
    border-right: 0 !important;
  }

  html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status > article:nth-last-child(-n + 2) {
    border-bottom: 0 !important;
  }
}

@media (max-width: 520px) {
  html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status {
    grid-template-columns: minmax(0, 1fr);
  }

  html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status > article,
  html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status > article:first-child,
  html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status > article:last-child,
  html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status > article:nth-child(even),
  html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status > article:nth-last-child(-n + 2) {
    border-bottom: 1px solid #e2e8f0 !important;
    border-right: 0 !important;
    padding: 10px 0 !important;
  }

  html[data-theme="light"] body.app-sidebar-page #main-content .infra-browser-status > article:last-child {
    border-bottom: 0 !important;
  }
}

/* Table actions stay legible; dense document actions use icon controls. */
html[data-theme="light"] body.app-sidebar-page #main-content :where(
  td .row-actions,
  td .table-actions,
  td .phd-actions-cell,
  td [class*="actions"]
) :where(a, button, .btn) {
  hyphens: none !important;
  overflow-wrap: normal !important;
  white-space: nowrap !important;
  word-break: keep-all !important;
}

html[data-theme="light"] body.admin-page #main-content .admin-documents-page .table-simple {
  min-width: 1180px !important;
}

html[data-theme="light"] body.admin-page #main-content .admin-documents-page .table-simple :where(
  th:nth-child(6),
  td:nth-child(6)
) {
  min-width: 172px !important;
  width: 172px !important;
}

html[data-theme="light"] body.admin-page #main-content .admin-documents-page .table-actions-heading {
  text-align: right;
}

html[data-theme="light"] body.admin-page #main-content .admin-documents-page .table-actions-cell {
  vertical-align: middle !important;
}

html[data-theme="light"] body.admin-page #main-content .admin-documents-page .table-icon-actions {
  align-items: center;
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  justify-content: flex-end;
  min-width: 148px;
}

html[data-theme="light"] body.admin-page #main-content .admin-documents-page .table-icon-actions form {
  display: contents;
  margin: 0;
}

html[data-theme="light"] body.admin-page #main-content .admin-documents-page .table-icon-action {
  align-items: center;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 5px !important;
  box-shadow: none !important;
  color: #475569 !important;
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 32px;
  height: 32px;
  justify-content: center;
  margin: 0 !important;
  min-height: 32px !important;
  padding: 0 !important;
  width: 32px !important;
}

html[data-theme="light"] body.admin-page #main-content .admin-documents-page .table-icon-action svg {
  fill: none;
  height: 15px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
  width: 15px;
}

html[data-theme="light"] body.admin-page #main-content .admin-documents-page .table-icon-action:hover,
html[data-theme="light"] body.admin-page #main-content .admin-documents-page .table-icon-action:focus-visible {
  background: #f0f3f7 !important;
  border-color: #94a3b8 !important;
  color: #035e8c !important;
}

html[data-theme="light"] body.admin-page #main-content .admin-documents-page .table-icon-action.is-danger:hover,
html[data-theme="light"] body.admin-page #main-content .admin-documents-page .table-icon-action.is-danger:focus-visible {
  background: #fef2f2 !important;
  border-color: #efb4b4 !important;
  color: #c53030 !important;
}

/* Breadcrumb owns the page title: remove empty legacy heading separators. */
html[data-theme="light"] body.app-sidebar-page #main-content header.app-page-header {
  border: 0 !important;
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
}

/* KPI groups are layout grids, not framed sections. Cards provide the boundary. */
html[data-theme="light"] body.app-sidebar-page #main-content :where(
  .admin-overview-metrics,
  .solution-filter-stats,
  .user-requests-summary,
  .my-requests-summary,
  .my-tickets-summary,
  .user-notifications-summary,
  .phd-browser-metrics,
  .infra-browser-status,
  .lorawan-overview,
  .service-ops-metrics,
  .gateway-detail-metrics,
  .alarm-summary-grid,
  .alarm-summary-grid-inline,
  .global-search-summary
) {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  box-shadow: none !important;
  overflow: visible;
}

html[data-theme="light"] body.app-sidebar-page #main-content :where(
  .admin-list-header,
  .admin-overview-head,
  .section-head.page-header,
  .user-notifications-header,
  .user-requests-header,
  .user-tickets-header,
  .my-alarm-history-header,
  .support-form-header,
  .request-form-header,
  .report-form-header,
  .report-preview-header,
  .support-success-header,
  .request-success-header,
  .solution-catalog-header,
  .admin-ticket-queue-header,
  .mqtt-retention-header
):not(:has(:where(
  .btn,
  button,
  details,
  form,
  .badge,
  .chips,
  .inventory-scope-summary,
  [class*="health"],
  [class*="status"]
))) {
  border: 0 !important;
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
}

/* Forms use one surface; headings and spacing define their internal sections. */
html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
  .admin-edit-page > form:not(.admin-filters),
  .admin-edit-page > .ticket-form-grid,
  .admin-main-panel > form.admin-form-grid
) {
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  display: grid;
  gap: 20px !important;
  margin: 0 !important;
  padding: 18px !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content .support-form-overview {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content .support-form-stats {
  border: 0 !important;
  border-radius: 0 !important;
  gap: 12px !important;
  overflow: visible !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content .support-form-stats > article {
  background: #ffffff !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 6px !important;
  min-height: 76px;
  padding: 12px 14px !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content .support-form-section {
  background: #ffffff !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  padding: 18px !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content form :where(
  .admin-form-block,
  .ticket-form-block
) {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content form :where(
  .admin-form-block,
  .ticket-form-block
):hover,
html[data-theme="light"] body.ui-unified-page.app-standard #main-content form :where(
  .admin-form-block,
  .ticket-form-block
):focus-within {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  transform: none !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content form :where(
  .admin-form-block,
  .ticket-form-block
) > :where(h2, h3, h4):first-child {
  color: #1e293b !important;
  font-size: 0.94rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
  line-height: 1.35;
  margin: 0 0 12px !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content form :where(
  .admin-form-block,
  .ticket-form-block
) > :where(p, .ticket-form-help) {
  margin: -5px 0 12px !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content form :where(
  .specs,
  .form-grid,
  .admin-form-grid
) {
  gap: 14px !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content form :where(
  .specs,
  .form-grid,
  .admin-form-grid
) > .field,
html[data-theme="light"] body.ui-unified-page.app-standard #main-content form .field {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: grid;
  gap: 6px !important;
  margin: 0 !important;
  min-width: 0;
  padding: 0 !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content form .field > label,
html[data-theme="light"] body.ui-unified-page.app-standard #main-content form label:not(.btn) {
  background: transparent !important;
  border: 0 !important;
  color: #475569 !important;
  font-size: 0.76rem !important;
  font-weight: 650 !important;
  line-height: 1.35;
  margin: 0 !important;
  padding: 0 !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content form :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
  select
) {
  background: #ffffff !important;
  border: 1px solid #c7d4e0 !important;
  border-radius: 5px !important;
  box-shadow: none !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 8px 10px !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content form textarea {
  background: #ffffff !important;
  border: 1px solid #c7d4e0 !important;
  border-radius: 5px !important;
  box-shadow: none !important;
  min-height: 104px !important;
  padding: 9px 10px !important;
  resize: vertical;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content form :where(
  input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"]),
  select,
  textarea
):focus-visible {
  border-color: #00a86b !important;
  box-shadow: 0 0 0 2px #dff7ed !important;
  outline: 0;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content form :where(
  input[readonly],
  input:disabled,
  select:disabled,
  textarea:disabled
) {
  background: #f3f6f8 !important;
  color: #64748b !important;
  cursor: not-allowed;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content form .field > small {
  background: transparent !important;
  border: 0 !important;
  color: #64748b !important;
  font-size: 0.72rem !important;
  line-height: 1.4;
  margin: 0 !important;
  padding: 0 !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content form .ticket-form-actions {
  border-top: 0;
  margin: 0 !important;
  padding-top: 4px !important;
}

@media (max-width: 760px) {
  html[data-theme="light"] body.ui-unified-page.app-standard #main-content :where(
    .admin-edit-page > form:not(.admin-filters),
    .admin-edit-page > .ticket-form-grid,
    .admin-main-panel > form.admin-form-grid,
    .support-form-section
  ) {
    gap: 16px !important;
    padding: 12px !important;
  }

  html[data-theme="light"] body.ui-unified-page.app-standard #main-content .support-form-stats {
    gap: 8px !important;
  }
}

/* TAG Explorer follows the same filter, metrics and results hierarchy. */
html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page :where(
  .solution-filter-panel,
  .inventory-filter-panel,
  .inventory-filter-panel__body,
  .phd-browser-results,
  .phd-browser-results > .solution-group-section
) {
  background: transparent !important;
  background-image: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page .phd-browser-filters,
html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page .inventory-filter-panel form.admin-filters {
  background: #ffffff !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  margin: 0 0 12px !important;
  padding: 14px !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page .solution-filter-meta {
  margin: 0 !important;
  padding: 0 !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page .phd-browser-metrics {
  gap: 12px !important;
  margin: 0 !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page .phd-browser-metrics > article {
  background: #ffffff !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 6px !important;
  min-height: 78px;
  padding: 12px 14px !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page .phd-browser-results-head {
  align-items: end;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  display: flex;
  justify-content: space-between;
  margin: 0 0 10px !important;
  min-height: 38px;
  padding: 0 !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page .phd-browser-results-head :where(h2, p) {
  margin: 0 !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page .phd-browser-results-head h2 {
  font-size: 1.08rem !important;
  font-weight: 700;
  line-height: 1.3;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page .phd-browser-results-head p {
  color: #64748b !important;
  font-size: 0.76rem !important;
  line-height: 1.4;
  margin-top: 2px !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page .phd-browser-table-wrap,
html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page .phd-table-wrapper {
  background: #ffffff !important;
  border: 1px solid #d9e2ec !important;
  border-radius: 6px !important;
  box-shadow: none !important;
  margin: 0 !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page :where(
  .phd-browser-table,
  .phd-table
) tbody tr {
  background: #ffffff !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page :where(
  .phd-browser-table,
  .phd-table
) tbody tr:hover td {
  background: #f7faf9 !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page .phd-browser-updated .badge {
  border-radius: 4px !important;
  min-height: 24px;
  padding: 4px 8px !important;
}

html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page .inventory-meta-row {
  background: transparent !important;
  border: 0 !important;
  color: #64748b;
  margin: 0 0 10px !important;
  padding: 0 !important;
}

@media (max-width: 760px) {
  html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page .phd-browser-filters,
  html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page .inventory-filter-panel form.admin-filters {
    padding: 12px !important;
  }

  html[data-theme="light"] body.ui-unified-page.app-standard #main-content .phd-explorer-page .phd-browser-results-head {
    align-items: start;
    display: grid;
    gap: 6px;
  }
}

@media (max-width: 760px) {
  body #main-content .phd-browser-table-wrap { overflow: visible !important; }
  body #main-content .phd-browser-table { border-collapse: separate; border-spacing: 0 10px; display: block; table-layout: auto; }
  body #main-content .phd-browser-table thead { display: none; }
  body #main-content .phd-browser-table tbody,
  body #main-content .phd-browser-table tr,
  body #main-content .phd-browser-table td { display: block; width: 100% !important; }
  body #main-content .phd-browser-table tr {
    background: #fff; border: 1px solid #d9e2ec; border-radius: 10px;
    box-shadow: 0 3px 12px rgba(15, 23, 42, .04); padding: 4px 12px;
  }
  body #main-content .phd-browser-table td {
    align-items: start; border-bottom: 1px solid #edf1f5 !important;
    display: grid; gap: 8px; grid-template-columns: minmax(90px, 34%) minmax(0, 1fr);
    padding: 10px 0 !important; text-align: left;
  }
  body #main-content .phd-browser-table td:last-child { border-bottom: 0 !important; }
  body #main-content .phd-browser-table td::before {
    color: #64748b; content: attr(data-label); font-size: .7rem; font-weight: 800;
    letter-spacing: .05em; text-transform: uppercase;
  }
  body #main-content .phd-browser-table .phd-browser-updated { padding-right: 36px !important; }
  body #main-content .phd-record-topic { align-items: flex-start; flex-direction: column; gap: 5px; }
}

@media (min-width: 761px) {
  body #main-content .phd-browser-table {
    border-spacing: 0 7px;
    display: block;
  }

  body #main-content .phd-browser-table thead,
  body #main-content .phd-browser-table tbody,
  body #main-content .phd-browser-table tr {
    display: grid;
    grid-template-columns: minmax(190px, 1.35fr) minmax(180px, 1.45fr)
      minmax(130px, .95fr) minmax(105px, .8fr) minmax(155px, 1fr);
    width: 100%;
  }

  body #main-content .phd-browser-table thead tr {
    align-items: center;
    background: #eef3f7;
    border-radius: 8px;
    min-height: 38px;
  }

  body #main-content .phd-browser-table tbody tr {
    align-items: stretch;
    background: #fff;
    border: 1px solid #e5ebf0;
    border-radius: 10px;
    box-shadow: 0 2px 9px rgba(15, 54, 86, .035);
    margin-bottom: 7px;
    overflow: hidden;
  }

  body #main-content .phd-browser-table th,
  body #main-content .phd-browser-table td {
    border: 0 !important;
    max-width: none;
    min-width: 0;
    width: auto !important;
  }

  body #main-content .phd-browser-table th {
    padding: 10px 14px !important;
  }

  body #main-content .phd-browser-table tbody td {
    padding: 13px 14px !important;
  }

  body #main-content .phd-browser-table tbody tr:hover {
    border-color: #b9d1df;
    box-shadow: 0 7px 18px rgba(15, 54, 86, .08);
    transform: translateY(-1px);
  }

  body #main-content .phd-browser-table tbody td:first-child,
  body #main-content .phd-browser-table tbody td:last-child,
  body #main-content .phd-browser-table th:first-child,
  body #main-content .phd-browser-table th:last-child {
    border-radius: 0;
  }
}

/* Listado de TAG: fichas legibles para nombres OPC UA y valores largos. */
body #main-content .phd-tag-list {
  display: grid;
  gap: 8px;
}

body #main-content .phd-tag-card {
  align-items: center;
  background: #fff;
  border: 1px solid #e2e9ef;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(20, 55, 80, .035);
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(190px, 1.35fr) minmax(180px, 1.45fr)
    minmax(130px, .95fr) minmax(105px, .8fr) minmax(155px, 1fr);
  min-width: 0;
  padding: 14px 16px;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

body #main-content .phd-tag-card:hover {
  border-color: #b8d0df;
  box-shadow: 0 8px 20px rgba(20, 55, 80, .09);
  transform: translateY(-1px);
}

body #main-content .phd-tag-card > div { min-width: 0; }
body #main-content .phd-tag-card > div > span:first-child {
  color: #7b8996;
  display: block;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

body #main-content .phd-tag-card-identity a {
  color: #075f89;
  display: block;
  font-size: .94rem;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-decoration: none;
}

body #main-content .phd-tag-card-identity a:hover { text-decoration: underline; }
body #main-content .phd-tag-card-identity .phd-tag-card-kicker { color: #159477; }
body #main-content .phd-tag-card code {
  color: #8a98a5;
  display: block;
  font-size: .67rem;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

body #main-content .phd-tag-card-context strong,
body #main-content .phd-tag-card-type strong,
body #main-content .phd-tag-card-updated small {
  color: #344654;
  display: block;
  font-size: .78rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

body #main-content .phd-tag-card-context small,
body #main-content .phd-tag-card-type small {
  color: #8493a0;
  display: block;
  font-size: .7rem;
  margin-top: 4px;
}

body #main-content .phd-tag-card-value strong {
  color: #087f6d;
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .94rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

body #main-content .phd-tag-card-type strong { align-items: center; display: flex; gap: 7px; }
body #main-content .phd-tag-card-type i {
  background: #6d91a8;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 7px;
  height: 7px;
  width: 7px;
}

body #main-content .phd-tag-card-updated > strong { display: inline-block; }
body #main-content .phd-tag-card-updated small { color: #7b8996; font-size: .7rem; margin-top: 5px; }
body #main-content .phd-tag-card-updated a {
  color: #075f89;
  display: inline-flex;
  font-size: .72rem;
  font-weight: 750;
  gap: 6px;
  margin-top: 7px;
  text-decoration: none;
}
body #main-content .phd-tag-card-updated a:hover { text-decoration: underline; }
body #main-content .phd-tag-card-updated a b { font-size: .95rem; line-height: .7; }

@media (max-width: 1100px) and (min-width: 761px) {
  body #main-content .phd-tag-card {
    gap: 12px;
    grid-template-columns: minmax(170px, 1.2fr) minmax(150px, 1.3fr)
      minmax(120px, .9fr) minmax(100px, .8fr);
  }
  body #main-content .phd-tag-card-updated { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  body #main-content .phd-tag-card {
    align-items: start;
    display: grid;
    gap: 13px;
    grid-template-columns: 1fr 1fr;
    padding: 15px;
  }
  body #main-content .phd-tag-card-identity,
  body #main-content .phd-tag-card-context,
  body #main-content .phd-tag-card-updated { grid-column: 1 / -1; }
  body #main-content .phd-tag-card-context,
  body #main-content .phd-tag-card-value,
  body #main-content .phd-tag-card-type,
  body #main-content .phd-tag-card-updated { border-top: 1px solid #edf1f5; padding-top: 11px; }
}

/* TAG Explorer: listado visual de activos, con jerarquía y separación por fila. */
body #main-content .phd-browser-table-wrap {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

body #main-content .phd-browser-table {
  border-collapse: separate;
  border-spacing: 0 8px;
  table-layout: fixed;
}

body #main-content .phd-browser-table th {
  background: #eef3f7 !important;
  border: 0 !important;
  color: #526273 !important;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .08em;
  padding: 10px 14px;
  text-transform: uppercase;
}

body #main-content .phd-browser-table th:first-child { border-radius: 8px 0 0 8px; }
body #main-content .phd-browser-table th:last-child { border-radius: 0 8px 8px 0; }
body #main-content .phd-browser-table th:nth-child(1) { width: 23%; }
body #main-content .phd-browser-table th:nth-child(2) { width: 28%; }
body #main-content .phd-browser-table th:nth-child(3) { width: 17%; }
body #main-content .phd-browser-table th:nth-child(4) { width: 14%; }
body #main-content .phd-browser-table th:nth-child(5) { width: 18%; }

body #main-content .phd-browser-table tbody td {
  background: #fff !important;
  border-bottom: 1px solid #e5ebf0 !important;
  border-top: 1px solid #e5ebf0 !important;
  padding: 14px !important;
  transition: background .16s ease, box-shadow .16s ease, transform .16s ease;
}

body #main-content .phd-browser-table tbody td:first-child {
  border-left: 1px solid #e5ebf0 !important;
  border-radius: 10px 0 0 10px;
}

body #main-content .phd-browser-table tbody td:last-child {
  border-right: 1px solid #e5ebf0 !important;
  border-radius: 0 10px 10px 0;
}

body #main-content .phd-browser-table tbody tr:hover td {
  background: #fbfdff !important;
  box-shadow: 0 7px 18px rgba(15, 54, 86, .08);
}

body #main-content .phd-browser-table tbody tr:hover td:first-child { transform: translateX(2px); }
body #main-content .phd-browser-table .phd-browser-tag a {
  color: #0b5f88;
  font-size: .93rem;
  letter-spacing: -.01em;
}

body #main-content .phd-browser-table .phd-browser-tag small {
  color: #8795a3;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .68rem;
}

body #main-content .phd-browser-table .phd-browser-context strong {
  color: #263746;
  font-size: .82rem;
  font-weight: 650;
}

body #main-content .phd-browser-table .phd-browser-value-text {
  color: #0b806f;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9rem;
  font-weight: 750;
}

body #main-content .phd-browser-table .phd-browser-type {
  align-items: center;
  color: #526273;
  display: inline-flex;
  font-size: .76rem;
  gap: 7px;
}

body #main-content .phd-browser-table .phd-browser-type-dot {
  background: #6b8eaa;
  border-radius: 50%;
  display: inline-block;
  height: 7px;
  width: 7px;
}

body #main-content .phd-browser-table .phd-browser-updated .badge {
  font-size: .67rem;
  letter-spacing: .02em;
  padding: 5px 8px !important;
}

@media (max-width: 760px) {
  body #main-content .phd-browser-table tbody tr:hover td:first-child { transform: none; }
  body #main-content .phd-browser-table tbody td { padding: 10px 0 !important; }
  body #main-content .phd-browser-table tbody td:first-child,
  body #main-content .phd-browser-table tbody td:last-child {
    border-left: 0 !important;
    border-radius: 0;
    border-right: 0 !important;
  }
}

/* Autoridad final: las tablas se adaptan al ancho disponible sin scroll
   horizontal y el contenido largo se reparte dentro de cada celda. */
body #main-content :where(.table-wrap, .table-responsive, .table-wrapper,
  .admin-list-table, .admin-demand-table, .infra-browser-table-wrap,
  .admin-device-table-wrap, .phd-table-wrapper) {
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden !important;
  overscroll-behavior-inline: auto;
}

body #main-content :where(.table-wrap, .table-responsive, .table-wrapper,
  .admin-list-table, .admin-demand-table, .infra-browser-table-wrap,
  .admin-device-table-wrap, .phd-table-wrapper) table {
  width: 100% !important;
  max-width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
}

body #main-content :where(.table-wrap, .table-responsive, .table-wrapper,
  .admin-list-table, .admin-demand-table, .infra-browser-table-wrap,
  .admin-device-table-wrap, .phd-table-wrapper) :is(th, td) {
  max-width: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal !important;
  word-break: normal;
}

body #main-content :where(.table-wrap, .table-responsive, .table-wrapper,
  .admin-list-table, .admin-demand-table, .infra-browser-table-wrap,
  .admin-device-table-wrap, .phd-table-wrapper) :is(button, .btn, .actions,
  .table-actions) {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
