/*
 * Diaphanum internal portal visual system.
 * Loaded after page-level styles and scoped to authenticated screens so this
 * layer cannot alter the public site or any application/API behaviour.
 */

body.portal-authenticated {
  --dx-bg: #f5f6f8;
  --dx-surface: #ffffff;
  --dx-line: #eff0f2;
  --dx-border: rgba(29, 31, 32, 0.14);
  --dx-ink: #1d1f20;
  --dx-ink-2: rgba(29, 31, 32, 0.62);
  --dx-ink-3: rgba(29, 31, 32, 0.48);
  --dx-ink-label: rgba(29, 31, 32, 0.68);
  --dx-accent-100: #eef6ff;
  --dx-accent-300: #b5d9fd;
  --dx-accent-400: #94bce3;
  --dx-accent-500: #749dc4;
  --dx-accent: #5980a6;
  --dx-accent-600: #597ea3;
  --dx-accent-700: #416180;
  --dx-accent-800: #2c455d;
  --dx-accent-900: #1d2d3d;
  --dx-signal: #f2ca30;
  --dx-pos: #2f6b3a;
  --dx-pos-bg: #eaf3ea;
  --dx-neg: #8c3126;
  --dx-neg-bg: #f6ebe9;
  --dx-font-h: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --dx-font-b: "Barlow", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --dx-r-card: 16px;
  --dx-r-inner: 12px;
  --dx-r-chip: 10px;
  --dx-r-pill: 999px;
  --dx-r-bar: 10px;
  --dx-sh-card: 0 2px 10px rgba(29, 45, 61, 0.07);
  --dx-sh-raise: 0 8px 22px rgba(29, 45, 61, 0.28);
  --dx-sh-logo: 0 4px 14px rgba(0, 0, 0, 0.22);
  --dx-commandbar-height: 68px;

  /* Map legacy tokens so charts and existing components join the same ramp. */
  --bg: var(--dx-bg);
  --surface: var(--dx-surface);
  --surface-2: #fafbfc;
  --surface-3: var(--dx-line);
  --line: var(--dx-line);
  --line-strong: var(--dx-border);
  --ink: var(--dx-ink);
  --ink-2: var(--dx-ink-2);
  --ink-3: var(--dx-ink-3);
  --ink-4: rgba(29, 31, 32, 0.36);
  --accent: var(--dx-accent);
  --accent-strong: var(--dx-accent-800);
  --accent-soft: var(--dx-accent-100);
  --wash: var(--dx-accent-100);
  --shadow-card: var(--dx-sh-card);
  --up: var(--dx-pos);
  --down: var(--dx-neg);

  margin: 0;
  background: var(--dx-bg);
  color: var(--dx-ink);
  font: 400 15px/1.55 var(--dx-font-b);
  letter-spacing: 0;
}

body.portal-authenticated *,
body.portal-authenticated *::before,
body.portal-authenticated *::after {
  box-sizing: border-box;
}

body.portal-authenticated :where(h1, h2, h3, h4, h5, h6) {
  margin-top: 0;
  font-family: var(--dx-font-h);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.015em;
}

body.portal-authenticated :where(button, input, select, textarea) {
  font-family: var(--dx-font-b);
}

body.portal-authenticated :where(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--dx-accent);
  outline-offset: 2px;
}

body.portal-authenticated .dx-app {
  display: block;
  min-width: 0;
  min-height: 100vh;
  max-width: none;
  margin: 0;
  overflow: visible;
  background: var(--dx-bg);
}

/* Compact command bar with the logo, navigation and account on one row. */
body.portal-authenticated .sidebar.dx-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "brand navigation account";
  gap: 12px;
  align-items: center;
  width: 100%;
  height: var(--dx-commandbar-height);
  padding: 10px 20px;
  overflow: visible;
  border: 0;
  color: #fff;
  background: linear-gradient(180deg, #24374a 0%, var(--dx-accent-900) 100%);
  box-shadow: 0 8px 24px rgba(29, 45, 61, 0.18);
}

body.portal-authenticated .sidebar .brand.dx-logo-plate {
  grid-area: brand;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: max-content;
  min-height: 40px;
  margin: 0;
  padding: 7px 13px;
  border-radius: var(--dx-r-inner);
  background: #fff;
  box-shadow: var(--dx-sh-logo);
}

body.portal-authenticated .sidebar .brand-logo {
  display: block;
  width: auto;
  height: 25px;
  object-fit: contain;
}

body.portal-authenticated .sidebar .brand-logo.brand-logo-horizontal {
  width: auto;
  height: 28px;
}

body.portal-authenticated .sidebar .brand-mark {
  color: var(--dx-accent-900);
  font-size: 23px;
  line-height: 1;
}

body.portal-authenticated .sidebar .workspace.dx-org {
  grid-area: organization;
  align-self: center;
  display: flex;
  min-width: 0;
  min-height: 40px;
  margin: 0;
  padding: 5px 10px 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--dx-r-pill);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

body.portal-authenticated .sidebar .workspace .ws-avatar.dx-chip {
  width: 28px;
  height: 28px;
  border-radius: var(--dx-r-chip);
  color: var(--dx-accent-900);
  background: var(--dx-accent-100);
  font: 600 11px/1 var(--dx-font-h);
}

body.portal-authenticated .sidebar .workspace .ws-name,
body.portal-authenticated .sidebar .workspace .ws-tier {
  color: #fff;
}

body.portal-authenticated .sidebar .workspace .ws-name {
  font-family: var(--dx-font-h);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

body.portal-authenticated .sidebar .workspace .ws-context,
body.portal-authenticated .sidebar .workspace .ws-env,
body.portal-authenticated .sidebar .workspace .chev {
  color: rgba(255, 255, 255, 0.62);
}

body.portal-authenticated .sidebar > .nav.dx-nav {
  grid-area: navigation;
  display: grid;
  grid-template-columns: minmax(0, max-content) auto;
  justify-content: center;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  margin: 0;
  padding: 0 0 1px;
  overflow: visible;
  white-space: nowrap;
}

body.portal-authenticated .sidebar .dx-nav-track {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

body.portal-authenticated .sidebar .dx-nav-track::-webkit-scrollbar {
  display: none;
}

body.portal-authenticated .sidebar > .nav.dx-nav > .nav-label,
body.portal-authenticated .sidebar .dx-nav-track > .nav-label {
  display: none;
}

body.portal-authenticated .sidebar .dx-nav-track > a,
body.portal-authenticated .sidebar .nav-disclosure-summary {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  height: 32px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: var(--dx-r-pill);
  color: rgba(255, 255, 255, 0.72);
  background: transparent;
  box-shadow: none;
  font: 600 16px/1 var(--dx-font-h);
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

body.portal-authenticated .sidebar .dx-nav-track > a:hover,
body.portal-authenticated .sidebar .nav-disclosure-summary:hover,
body.portal-authenticated .sidebar .nav-disclosure-summary:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

body.portal-authenticated .sidebar .dx-nav-track > a.active,
body.portal-authenticated .sidebar .dx-nav-track > a[aria-current="page"],
body.portal-authenticated .sidebar .nav-disclosure.is-active > .nav-disclosure-summary {
  color: var(--dx-accent-900);
  background: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
}

body.portal-authenticated .sidebar .nav-icon,
body.portal-authenticated .sidebar .nav a .ic {
  color: currentColor;
  font-family: var(--dx-font-b);
}

body.portal-authenticated .sidebar .nav-disclosure {
  position: relative;
  flex: 0 0 auto;
}

body.portal-authenticated .sidebar .nav-disclosure-count {
  border-color: rgba(255, 255, 255, 0.2);
  color: currentColor;
  background: rgba(255, 255, 255, 0.08);
}

body.portal-authenticated .sidebar .nav-disclosure.is-active .nav-disclosure-count {
  border-color: var(--dx-line);
  color: var(--dx-accent-800);
  background: var(--dx-accent-100);
}

body.portal-authenticated .sidebar .nav-submenu {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  left: auto;
  z-index: 120;
  display: grid;
  width: 280px;
  max-width: calc(100vw - 24px);
  max-height: min(64vh, 520px);
  margin: 0;
  padding: 8px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--dx-r-inner);
  background: var(--dx-accent-900);
  box-shadow: var(--dx-sh-raise);
}

body.portal-authenticated .sidebar .nav-submenu-label {
  padding: 10px 9px 5px;
  color: rgba(255, 255, 255, 0.46);
  font: 600 10px/1 var(--dx-font-h);
  letter-spacing: 0.14em;
}

body.portal-authenticated .sidebar .nav-submenu a {
  height: auto;
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.75);
  font: 500 14px/1.2 var(--dx-font-b);
  text-transform: none;
  white-space: normal;
}

body.portal-authenticated .sidebar .nav-submenu a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

body.portal-authenticated .sidebar .nav-submenu a.active {
  color: var(--dx-accent-900);
  background: #fff;
  box-shadow: none;
}

body.portal-authenticated .sidebar .sidebar-foot {
  grid-area: account;
  align-self: center;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

body.portal-authenticated .sidebar .secondary-nav {
  display: flex;
  flex-direction: row;
  gap: 3px;
  margin: 0;
}

body.portal-authenticated .sidebar .secondary-nav a {
  width: 32px;
  height: 32px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.66);
  background: rgba(255, 255, 255, 0.07);
}

body.portal-authenticated .sidebar .secondary-nav .nav-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.portal-authenticated .sidebar .me {
  min-width: 0;
  max-width: 260px;
  padding: 4px 5px 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--dx-r-pill);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

body.portal-authenticated .sidebar .me .avatar.dx-avatar {
  width: 29px;
  height: 29px;
  color: var(--dx-accent-900);
  background: #fff;
  font: 600 11px/1 var(--dx-font-h);
}

body.portal-authenticated .sidebar .me-name {
  color: #fff;
  font: 600 12px/1.1 var(--dx-font-h);
  letter-spacing: 0.02em;
}

body.portal-authenticated .sidebar .me-mail {
  color: rgba(255, 255, 255, 0.58);
}

body.portal-authenticated .sidebar .sidebar-logout button {
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.72);
}

body.portal-authenticated .sidebar .sidebar-logout button:hover {
  border-color: rgba(255, 255, 255, 0.18);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Context toolbar and page frame. */
body.portal-authenticated .main {
  width: 100%;
  min-width: 0;
  min-height: calc(100vh - var(--dx-commandbar-height));
  color: var(--dx-ink);
  background: transparent;
}

body.portal-authenticated .main > .topbar {
  position: relative;
  top: auto;
  z-index: 10;
  min-height: 56px;
  padding: 11px max(26px, calc((100vw - 1380px) / 2));
  border: 0;
  border-bottom: 1px solid var(--dx-line);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: none;
  backdrop-filter: blur(14px);
}

body.portal-authenticated .crumbs {
  color: var(--dx-ink-3);
  font-size: 12px;
}

body.portal-authenticated .crumbs .sep {
  color: rgba(29, 31, 32, 0.25);
}

body.portal-authenticated .crumbs .here {
  color: var(--dx-accent-800);
  font-weight: 500;
}

body.portal-authenticated .pill {
  min-height: 34px;
  height: auto;
  border: 1px solid var(--dx-border);
  border-radius: var(--dx-r-pill);
  color: var(--dx-ink-2);
  background: var(--dx-surface);
  box-shadow: 0 1px 3px rgba(29, 45, 61, 0.05);
  font-size: 12px;
}

body.portal-authenticated .pill.primary {
  border: 0;
  color: #fff;
  background: var(--dx-accent-800);
  box-shadow: 0 6px 16px rgba(44, 69, 93, 0.2);
}

body.portal-authenticated .main > .topbar .pill input {
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.portal-authenticated .main > .topbar .pill:focus-within {
  border-color: var(--dx-accent);
  outline: 2px solid color-mix(in srgb, var(--dx-accent) 22%, transparent);
  outline-offset: 2px;
}

body.portal-authenticated .page-head,
body.portal-authenticated .notifications-head,
body.portal-authenticated .risk-head,
body.portal-authenticated .lawyer-network-head,
body.portal-authenticated .shared-address-head {
  width: min(100%, 1380px);
  margin-right: auto;
  margin-left: auto;
  padding: 22px 26px 18px;
}

body.portal-authenticated .page-title,
body.portal-authenticated .notifications-head h1,
body.portal-authenticated .risk-head h1,
body.portal-authenticated .lawyer-network-head h1,
body.portal-authenticated .shared-address-head h1,
body.portal-authenticated .municipal-hero h1,
body.portal-authenticated .direct-purchase-detail-hero h1 {
  margin: 0 0 7px;
  color: var(--dx-ink);
  font: 600 clamp(29px, 3vw, 36px)/1.05 var(--dx-font-h);
  letter-spacing: -0.02em;
}

body.portal-authenticated .page-title::after {
  display: none;
  content: none;
}

body.portal-authenticated .page-sub,
body.portal-authenticated .notifications-head p,
body.portal-authenticated .risk-head p,
body.portal-authenticated .lawyer-network-head p,
body.portal-authenticated .shared-address-head p {
  max-width: 78ch;
  color: var(--dx-ink-2);
  font-size: 12px;
  line-height: 1.5;
}

body.portal-authenticated .content,
body.portal-authenticated .notifications-page > :where(.notifications-metrics, .notifications-toolbar, .notifications-feed, .notifications-empty, .notifications-message, .notifications-error, .notifications-pagination),
body.portal-authenticated .journalism-risk-page > :not(.topbar),
body.portal-authenticated .lawyer-network-page > :not(.topbar),
body.portal-authenticated .shared-address-page > :not(.topbar) {
  width: min(calc(100% - 52px), 1380px);
  margin-right: auto;
  margin-left: auto;
}

body.portal-authenticated .content {
  padding: 8px 0 30px;
  gap: 16px;
}

body.portal-authenticated .analytics-date-filter-bar {
  position: sticky;
  top: var(--dx-commandbar-height);
  z-index: 80;
  min-height: 50px;
  padding: 8px max(26px, calc((100vw - 1380px) / 2));
  border: 0;
  border-bottom: 1px solid var(--dx-line);
  background: rgba(245, 246, 248, 0.92);
  box-shadow: 0 8px 18px rgba(29, 45, 61, 0.05);
  backdrop-filter: blur(16px);
}

body.portal-authenticated .analytics-date-filter-bar__title,
body.portal-authenticated .analytics-date-filter__field,
body.portal-authenticated .entity-eyebrow,
body.portal-authenticated :where(.notifications-kicker, .risk-kicker, .lawyer-network-kicker, .shared-address-kicker, .municipal-kicker, .concursos-kicker),
body.portal-authenticated label > span {
  color: var(--dx-ink-label);
  font: 600 10.5px/1.15 var(--dx-font-h);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body.portal-authenticated .analytics-access-scope {
  border-left-color: var(--dx-border);
  color: var(--dx-ink-3);
}

body.portal-authenticated .analytics-access-scope strong {
  color: var(--dx-accent-800);
}

body.portal-authenticated .analytics-date-filter__panel {
  border: 0;
  border-radius: var(--dx-r-card);
  background: var(--dx-surface);
  box-shadow: var(--dx-sh-raise);
}

/* Dashboard top-area scale. The data region below the date controls is unchanged. */
body.portal-authenticated .app-dashboard {
  --dx-commandbar-height: 68px;
}

body.portal-authenticated .app-dashboard .sidebar .workspace.dx-org {
  min-height: 52px;
  padding: 7px 13px 7px 9px;
}

body.portal-authenticated .app-dashboard .sidebar .workspace .ws-avatar.dx-chip {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

body.portal-authenticated .app-dashboard .sidebar .workspace .ws-name {
  font-size: 14px;
}

body.portal-authenticated .app-dashboard .sidebar > .nav.dx-nav {
  min-height: 42px;
}

body.portal-authenticated .app-dashboard .sidebar .dx-nav-track > a,
body.portal-authenticated .app-dashboard .sidebar .nav-disclosure-summary {
  height: 40px;
  padding: 0 15px;
  font-size: calc(0.875rem + 2px);
}

body.portal-authenticated .app-dashboard .sidebar .secondary-nav a {
  width: 38px;
  height: 38px;
}

body.portal-authenticated .app-dashboard .sidebar .me {
  padding: 6px 8px;
}

body.portal-authenticated .app-dashboard .sidebar .me .avatar.dx-avatar {
  width: 34px;
  height: 34px;
  font-size: 12px;
}

body.portal-authenticated .app-dashboard .page-title {
  font-size: clamp(41px, 4.2vw, 50px);
}

body.portal-authenticated .app-dashboard .analytics-date-filter-bar {
  min-height: 64px;
  padding-top: 11px;
  padding-bottom: 11px;
}

body.portal-authenticated .app-dashboard .analytics-date-filter,
body.portal-authenticated .app-dashboard .analytics-date-filter__summary {
  gap: 12px;
}

body.portal-authenticated .app-dashboard .analytics-date-filter__summary {
  min-width: 0;
}

body.portal-authenticated .app-dashboard .analytics-date-filter__summary .seg {
  flex: 0 0 auto;
  height: 40px;
  padding: 3px;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: var(--dx-r-pill);
  scrollbar-width: none;
}

body.portal-authenticated .app-dashboard .analytics-date-filter__summary .seg::-webkit-scrollbar {
  display: none;
}

body.portal-authenticated .app-dashboard .analytics-date-filter__summary .seg button {
  min-width: 48px;
  min-height: 32px;
  padding: 0 14px;
  border-radius: var(--dx-r-pill);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

body.portal-authenticated .app-dashboard .analytics-date-filter__summary .seg button[data-scope="custom"] {
  min-width: 116px;
}

body.portal-authenticated .app-dashboard .analytics-date-filter__summary .seg button.on {
  box-shadow: inset 0 0 0 1px rgba(65, 97, 128, 0.18);
}

body.portal-authenticated .app-dashboard .analytics-date-filter__label {
  flex: 0 1 auto;
  min-height: 40px;
  padding-right: 14px;
  padding-left: 14px;
}

body.portal-authenticated .app-dashboard .analytics-access-scope {
  font-size: 12px;
}

/* Surfaces and card hierarchy. */
body.portal-authenticated :where(.card, .kpi-card, .chart-card, .score-card),
body.portal-authenticated :where(.notifications-toolbar, .notification-card),
body.portal-authenticated :where(.risk-table-panel, .risk-detail-panel, .lawyer-network-panel, .shared-address-ranking, .shared-address-companies),
body.portal-authenticated :where(.municipal-panel, .municipal-directory, .municipal-story-card),
body.portal-authenticated :where(.concursos-section, .concursos-health-strip) {
  border-color: transparent;
  border-radius: var(--dx-r-card);
  background: var(--dx-surface);
  box-shadow: var(--dx-sh-card);
}

body.portal-authenticated .card {
  padding: 18px 20px;
}

body.portal-authenticated :where(.conversation-shell, .direct-purchases-analysis-table, .direct-purchases-card, .direct-purchase-primary-summary, .direct-purchase-disclosure, .supplier-registry-overview, .supplier-registry-section).card {
  padding: 0;
}

body.portal-authenticated :where(.card-head, .table-header, .section-head, .direct-purchases-section-head, .direct-purchases-chart-panel header, .direct-purchases-analysis-table-head, .risk-panel-head, .lawyer-panel-head, .shared-address-panel-head, .concursos-section-head) h2,
body.portal-authenticated :where(.card-head, .table-header, .section-head, .direct-purchases-section-head, .direct-purchases-chart-panel header, .direct-purchases-analysis-table-head, .risk-panel-head, .lawyer-panel-head, .shared-address-panel-head, .concursos-section-head) h3,
body.portal-authenticated .card-title {
  color: var(--dx-ink);
  font: 600 19px/1.15 var(--dx-font-h);
  letter-spacing: -0.01em;
  text-transform: none;
}

body.portal-authenticated :where(.table-header, .direct-purchases-section-head, .direct-purchases-chart-panel header, .direct-purchases-analysis-table-head, .risk-panel-head, .lawyer-panel-head, .shared-address-panel-head, .concursos-section-head) p,
body.portal-authenticated :where(.table-header, .direct-purchases-chart-panel header, .direct-purchases-analysis-table-head, .risk-panel-head, .lawyer-panel-head, .shared-address-panel-head, .concursos-section-head) > span,
body.portal-authenticated .card-head small {
  color: var(--dx-ink-3);
  font-size: 11.5px;
  line-height: 1.45;
}

body.portal-authenticated .entities-entity-head {
  border: 0;
  border-radius: var(--dx-r-card);
  background: linear-gradient(135deg, var(--dx-accent-800), var(--dx-accent-900));
  box-shadow: var(--dx-sh-raise);
}

body.portal-authenticated .entities-entity-head :where(h2, p) {
  color: #fff;
}

body.portal-authenticated .entities-entity-head p {
  opacity: 0.68;
}

body.portal-authenticated .entity-head-icon {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--dx-r-chip);
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

body.portal-authenticated .entities-entity-head .entity-action {
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

body.portal-authenticated .entities-entity-head .entity-action:hover {
  background: rgba(255, 255, 255, 0.16);
}

/* KPI groups: labels first, data dominant. */
body.portal-authenticated :where(.dashboard-kpis, .entities-kpis, .direct-purchases-kpis, .notifications-metrics, .concursos-summary-grid) {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.portal-authenticated .entities-kpis {
  padding: 0;
}

body.portal-authenticated :where(.dashboard-kpis .kpi-card, .entities-kpis .kpi-card, .direct-purchases-kpis article, .notifications-metrics article, .concursos-summary-grid article),
body.portal-authenticated :where(.score-card, .direct-purchases-quality-strip article, .direct-purchase-metrics article, .concursos-inline-metrics article) {
  min-width: 0;
  padding: 18px 20px;
  border: 0;
  border-radius: var(--dx-r-card);
  background: var(--dx-surface);
  box-shadow: var(--dx-sh-card);
}

body.portal-authenticated :where(.dashboard-kpis .kpi-card, .entities-kpis .kpi-card, .direct-purchases-kpis article, .notifications-metrics article, .concursos-summary-grid article) + :where(.kpi-card, article) {
  border: 0;
}

body.portal-authenticated :where(.kpi-card, .score-card, .direct-purchases-kpis article, .direct-purchases-quality-strip article, .notifications-metrics article, .concursos-summary-grid article, .concursos-inline-metrics article) span,
body.portal-authenticated .kpi-card > span {
  display: block;
  margin: 0 0 9px;
  color: var(--dx-ink-label);
  font: 600 10.5px/1.25 var(--dx-font-h);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body.portal-authenticated :where(.kpi-card, .score-card, .direct-purchases-kpis article, .notifications-metrics article, .concursos-summary-grid article, .concursos-inline-metrics article) > strong,
body.portal-authenticated .kpi-card strong {
  display: block;
  overflow: hidden;
  color: var(--dx-ink);
  font: 600 clamp(26px, 2.8vw, 38px)/1 var(--dx-font-h);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
}

body.portal-authenticated .direct-purchases-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.portal-authenticated .direct-purchases-quality-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

body.portal-authenticated .direct-purchases-quality-strip article {
  border-left: 4px solid var(--dx-signal);
}

body.portal-authenticated .notifications-metrics {
  overflow: visible;
  margin-top: 0;
  margin-bottom: 0;
}

body.portal-authenticated .notifications-metrics .notifications-metric-unread {
  border-left: 4px solid var(--dx-signal);
  background: var(--dx-surface);
}

body.portal-authenticated .notifications-metric-unread strong {
  color: var(--dx-accent-900);
}

body.portal-authenticated .commercial-directory-page {
  --commercial-ink: var(--dx-ink);
  --commercial-muted: var(--dx-ink-2);
  --commercial-line: var(--dx-line);
  --commercial-accent: var(--dx-accent-800);
  --commercial-soft: var(--dx-accent-100);
  background: transparent;
}

body.portal-authenticated .commercial-directory-head {
  width: min(100%, 1380px);
  margin: 0 auto;
  padding: 22px 26px 18px;
}

body.portal-authenticated .commercial-directory-head h1 {
  max-width: 26ch;
  margin: 7px 0;
  color: var(--dx-ink);
  font: 600 clamp(29px, 3vw, 36px)/1.05 var(--dx-font-h);
  letter-spacing: -0.02em;
}

body.portal-authenticated .commercial-directory-head p {
  color: var(--dx-ink-2);
  font-size: 12px;
  line-height: 1.5;
}

body.portal-authenticated :where(.commercial-directory-kicker, .commercial-directory-label, .commercial-directory-results-head > div > span) {
  color: var(--dx-ink-3);
  font: 600 10.5px/1.15 var(--dx-font-h);
  letter-spacing: 0.12em;
}

body.portal-authenticated :where(.commercial-directory-metrics, .commercial-directory-filters, .commercial-directory-results, .commercial-directory-empty, .commercial-directory-alert) {
  width: min(calc(100% - 52px), 1380px);
  margin-right: auto;
  margin-left: auto;
}

body.portal-authenticated .commercial-directory-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  overflow: visible;
  border: 0;
  background: transparent;
}

body.portal-authenticated .commercial-directory-metrics article {
  padding: 18px 20px;
  border-radius: var(--dx-r-card);
  background: var(--dx-surface);
  box-shadow: var(--dx-sh-card);
}

body.portal-authenticated .commercial-directory-metrics span {
  margin: 0 0 9px;
  color: var(--dx-ink-label);
  font: 600 10.5px/1.25 var(--dx-font-h);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

body.portal-authenticated .commercial-directory-metrics strong {
  color: var(--dx-ink);
  font: 600 clamp(26px, 2.8vw, 38px)/1 var(--dx-font-h);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

body.portal-authenticated .commercial-directory-filters {
  margin-top: 18px;
  margin-bottom: 20px;
  border: 0;
  border-radius: var(--dx-r-card);
  box-shadow: var(--dx-sh-card);
}

body.portal-authenticated .commercial-directory-results {
  border: 0;
  border-radius: var(--dx-r-card);
  box-shadow: var(--dx-sh-card);
}

body.portal-authenticated .commercial-directory-card {
  border-top-color: var(--dx-line);
}

body.portal-authenticated .commercial-directory-statuses span {
  color: var(--dx-accent-800);
  background: var(--dx-accent-100);
}

body.portal-authenticated :where(.commercial-directory-export, .commercial-directory-filters button, .commercial-directory-pagination a) {
  border-radius: var(--dx-r-pill);
  font: 600 12.5px/1 var(--dx-font-h);
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

/* Filters and controls. */
body.portal-authenticated :where(.seg, .entities-tabs, .notifications-tabs) {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 0;
  border-radius: var(--dx-r-pill);
  background: var(--dx-surface);
  box-shadow: 0 1px 3px rgba(29, 45, 61, 0.1);
}

body.portal-authenticated :where(.seg button, .entities-tabs button, .notifications-tabs a) {
  height: 32px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--dx-r-pill);
  color: var(--dx-ink-2);
  background: transparent;
  box-shadow: none;
  font: 600 12px/1 var(--dx-font-h);
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

body.portal-authenticated :where(.seg button.on, .entities-tabs button.active, .notifications-tabs a.active) {
  color: #fff;
  background: var(--dx-accent-800);
  box-shadow: none;
}

body.portal-authenticated .entities-subnav {
  width: min(calc(100% - 52px), 1380px);
  margin: 0 auto;
  padding: 0 0 8px;
  overflow-x: auto;
}

body.portal-authenticated .entities-subnav :where(a, span) {
  height: 32px;
  border-color: var(--dx-border);
  border-radius: var(--dx-r-pill);
  background: var(--dx-surface);
  font: 600 12px/1 var(--dx-font-h);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.portal-authenticated .entities-subnav .active {
  border-color: var(--dx-accent-800);
  color: #fff;
  background: var(--dx-accent-800);
}

body.portal-authenticated .main :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--dx-border);
  border-radius: var(--dx-r-inner);
  color: var(--dx-ink);
  background: var(--dx-surface);
  box-shadow: inset 0 1px 1px rgba(29, 45, 61, 0.02);
  font-size: 13px;
}

body.portal-authenticated .main :where(input, textarea)::placeholder {
  color: rgba(29, 31, 32, 0.56);
}

body.portal-authenticated .main :where(input:not([type="checkbox"]):not([type="radio"]), select, textarea):focus {
  border-color: var(--dx-accent);
  outline: 2px solid color-mix(in srgb, var(--dx-accent) 20%, transparent);
  outline-offset: 0;
}

body.portal-authenticated :where(.comparison-filters, .direct-purchases-dashboard-filters, .direct-purchases-filters, .risk-filters, .lawyer-network-filters, .shared-address-filters, .municipal-filters) {
  border-color: transparent;
  border-radius: var(--dx-r-card);
  background: var(--dx-surface);
}

body.portal-authenticated :where(.btn, .btn-primary, .btn-secondary, .entity-action, .notifications-refresh, .notifications-search button, .alerts-action-button, .risk-filters button, .risk-filters > a, .risk-pagination a, .lawyer-network-filters button, .lawyer-network-filters > a, .shared-address-filters button, .shared-address-filters > a, .municipal-filters button, .municipal-filters > a, .direct-purchases-pagination a, .direct-purchase-detail-actions a) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 17px;
  border-radius: var(--dx-r-pill);
  font: 600 12.5px/1 var(--dx-font-h);
  letter-spacing: 0.045em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}

body.portal-authenticated :where(.btn-primary, .analytics-date-filter__apply, .notifications-refresh, .notifications-search button, .risk-filters button, .lawyer-network-filters button, .shared-address-filters button, .municipal-filters button, .alerts-action-button) {
  border: 1px solid var(--dx-accent-800);
  color: #fff;
  background: var(--dx-accent-800);
  box-shadow: 0 6px 16px rgba(44, 69, 93, 0.2);
}

body.portal-authenticated :where(.btn-primary, .analytics-date-filter__apply, .notifications-refresh, .notifications-search button, .risk-filters button, .lawyer-network-filters button, .shared-address-filters button, .municipal-filters button, .alerts-action-button):hover {
  border-color: var(--dx-accent-700);
  color: #fff;
  background: var(--dx-accent-700);
}

body.portal-authenticated :where(.btn-secondary, .entity-action, .risk-filters > a, .lawyer-network-filters > a, .shared-address-filters > a, .municipal-filters > a, .direct-purchases-pagination a) {
  border: 1px solid var(--dx-border);
  color: var(--dx-accent-800);
  background: var(--dx-surface);
  box-shadow: none;
}

/* Tables and dense data. */
body.portal-authenticated :where(.table-wrap, .direct-purchases-table-wrap, .risk-table-wrap, .lawyer-table-wrap, .shared-address-table-wrap, .municipal-table-wrap, .concursos-table-wrap) {
  width: 100%;
  overflow: auto;
  border-radius: var(--dx-r-inner);
  scrollbar-color: var(--dx-accent-300) transparent;
  scrollbar-width: thin;
}

body.portal-authenticated :where(table, .table-aurelius, .risk-table, .lawyer-table, .shared-address-table, .municipal-table) {
  width: 100%;
  border-collapse: collapse;
  color: var(--dx-ink);
  font: 400 12.5px/1.4 var(--dx-font-b);
}

body.portal-authenticated :where(table, .table-aurelius, .risk-table, .lawyer-table, .shared-address-table, .municipal-table) thead th {
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid var(--dx-border);
  color: var(--dx-ink-label);
  background: #fafbfc;
  font: 600 10.5px/1.2 var(--dx-font-h);
  letter-spacing: 0.09em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

body.portal-authenticated :where(table, .table-aurelius, .risk-table, .lawyer-table, .shared-address-table, .municipal-table) tbody td {
  padding: 12px 13px;
  border: 0;
  border-bottom: 1px solid var(--dx-line);
  vertical-align: middle;
  overflow-wrap: anywhere;
}

body.portal-authenticated :where(table, .table-aurelius, .risk-table, .lawyer-table, .shared-address-table, .municipal-table) tbody tr:last-child td {
  border-bottom: 0;
}

body.portal-authenticated :where(table, .table-aurelius, .risk-table, .lawyer-table, .shared-address-table, .municipal-table) tbody tr:hover {
  background: #fafbfc;
}

body.portal-authenticated :where(.text-right, .is-number, .dx-money),
body.portal-authenticated td[data-type="number"],
body.portal-authenticated th[data-type="number"] {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

body.portal-authenticated :where(.mono, code, .suppliers-provider-nit) {
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

body.portal-authenticated .truncate {
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Adjudications: keep identifiers and money readable while titles use controlled space. */
body.portal-authenticated .app-purchase .purchase-filters {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

body.portal-authenticated .app-purchase .purchase-filter-code,
body.portal-authenticated .app-purchase .purchase-filter-method {
  grid-column: span 2;
}

body.portal-authenticated .app-purchase .purchase-filter-actions {
  grid-column: span 2;
  justify-content: flex-start;
}

body.portal-authenticated .app-purchase .purchase-filter-note {
  align-self: center;
  grid-column: span 2;
  margin: 0;
  color: var(--dx-ink-muted);
  font-size: 11.5px;
  line-height: 1.4;
}

body.portal-authenticated .app-purchase .purchase-table-wrap {
  overflow-x: auto;
}

body.portal-authenticated .app-purchase .purchase-table {
  min-width: 1240px;
  table-layout: fixed;
}

body.portal-authenticated .app-purchase :where(.purchase-col-date, .purchase-cell-date) {
  width: 102px;
  white-space: nowrap;
}

body.portal-authenticated .app-purchase :where(.purchase-col-ocid, .purchase-cell-ocid) {
  width: 224px;
  white-space: nowrap;
}

body.portal-authenticated .app-purchase :where(.purchase-col-code, .purchase-cell-code) {
  width: 112px;
  white-space: nowrap;
}

body.portal-authenticated .app-purchase :where(.purchase-col-buyer, .purchase-cell-buyer) {
  width: 210px;
}

body.portal-authenticated .app-purchase :where(.purchase-col-title, .purchase-cell-title) {
  width: 260px;
}

body.portal-authenticated .app-purchase :where(.purchase-col-supplier, .purchase-cell-supplier) {
  width: 190px;
}

body.portal-authenticated .app-purchase :where(.purchase-col-amount, .purchase-cell-amount) {
  width: 142px;
  white-space: nowrap;
}

body.portal-authenticated .app-purchase :where(.purchase-cell-ocid, .purchase-cell-code) .link-ocid,
body.portal-authenticated .app-purchase .purchase-amount {
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

body.portal-authenticated .app-purchase .purchase-title {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.4;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

body.portal-authenticated .app-purchase :where(.purchase-cell-buyer .link-ocid, .purchase-supplier) {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.portal-authenticated .app-purchase .dt-container {
  min-width: 0;
}

@media (max-width: 1024px) {
  body.portal-authenticated .app-purchase .purchase-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body.portal-authenticated .app-purchase .purchase-filters {
    grid-template-columns: 1fr;
  }

  body.portal-authenticated .app-purchase :where(.purchase-filter-code, .purchase-filter-method, .purchase-filter-actions, .purchase-filter-note) {
    grid-column: auto;
  }
}

body.portal-authenticated .concursos-cell-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
}

body.portal-authenticated :where(.link-ocid, .detail-link, .risk-primary-link, .risk-detail-link, .shared-address-detail-link, .lawyer-detail-link) {
  color: var(--dx-accent-800);
  text-decoration-color: color-mix(in srgb, var(--dx-accent) 42%, transparent);
  text-underline-offset: 3px;
}

body.portal-authenticated .dt-container :where(.dt-search input, .dt-length select) {
  min-height: 36px;
  border-color: var(--dx-border) !important;
  border-radius: var(--dx-r-inner) !important;
}

body.portal-authenticated .dt-paging button {
  min-width: 34px;
  min-height: 34px;
  border: 0 !important;
  border-radius: var(--dx-r-pill) !important;
  color: var(--dx-ink-2) !important;
  background: var(--dx-surface) !important;
}

body.portal-authenticated .dt-paging button.current {
  color: #fff !important;
  background: var(--dx-accent-800) !important;
}

/* Charts, ranks and visual data containers. */
body.portal-authenticated :where(.chart-card, .direct-purchases-chart-panel) {
  min-width: 0;
  overflow: hidden;
}

body.portal-authenticated :where(.chart, .direct-purchases-chart, .concursos-chart, .conversation-chart-canvas) {
  border-radius: var(--dx-r-inner);
  background: linear-gradient(180deg, rgba(238, 246, 255, 0.35), rgba(255, 255, 255, 0) 46%);
}

body.portal-authenticated .grid-line {
  stroke: #eceef1;
}

body.portal-authenticated .axis-tick {
  fill: var(--dx-ink-3);
  font-family: var(--dx-font-b);
  font-size: 10.5px;
}

body.portal-authenticated .bar > span,
body.portal-authenticated .concentration-bar > span,
body.portal-authenticated .shared-address-bar > span {
  border-radius: var(--dx-r-bar);
  background: linear-gradient(90deg, var(--dx-accent), var(--dx-accent-700));
}

/* Risk and integrity use the single institutional signal colour. */
body.portal-authenticated .journalism-risk-page,
body.portal-authenticated .direct-purchases-dashboard {
  --risk-accent: #9a7610;
  --risk-accent-soft: #fff8d9;
  --risk-accent-line: #ecd36f;
}

body.portal-authenticated :where(.risk-explainer, .direct-purchases-analysis-table:first-of-type) {
  border: 0;
}

body.portal-authenticated .risk-explainer {
  color: #fff;
  background: linear-gradient(160deg, var(--dx-accent-800), var(--dx-accent-900));
  box-shadow: var(--dx-sh-raise);
}

body.portal-authenticated .risk-explainer :where(h2, strong) {
  color: #fff;
}

body.portal-authenticated .risk-explainer :where(p, span) {
  color: rgba(255, 255, 255, 0.64);
}

body.portal-authenticated :where(.direct-purchases-risk-score, .risk-status, .risk-method, .notification-new) {
  border-color: color-mix(in srgb, var(--dx-signal) 62%, var(--dx-border));
  border-radius: var(--dx-r-pill);
  color: var(--dx-accent-900);
  background: color-mix(in srgb, var(--dx-signal) 28%, #fff);
}

body.portal-authenticated .notifications-sync-pill {
  border-color: var(--dx-border);
  color: var(--dx-accent-800);
  background: var(--dx-accent-100);
}

body.portal-authenticated .notification-card.is-unread {
  border-left: 4px solid var(--dx-signal);
  background: linear-gradient(90deg, rgba(242, 202, 48, 0.08), #fff 34%);
}

body.portal-authenticated .notification-state {
  background: transparent;
}

body.portal-authenticated .notification-card.is-unread .notification-state {
  background: var(--dx-signal);
}

body.portal-authenticated .alerts-inbox-layout {
  gap: 16px;
}

body.portal-authenticated .alerts-inbox-card {
  border-color: transparent;
  border-radius: var(--dx-r-inner);
  background: #fafbfc;
}

body.portal-authenticated .alerts-inbox-card.is-selected {
  border-color: var(--dx-accent-400);
  background: var(--dx-accent-100);
  box-shadow: inset 3px 0 0 var(--dx-accent-700);
}

body.portal-authenticated .alerts-inbox-card.is-unread {
  border-left: 4px solid var(--dx-signal);
}

body.portal-authenticated :where(.alerts-summary-block, .alerts-detail-block) {
  border-color: var(--dx-line);
  border-radius: var(--dx-r-inner);
  background: #fafbfc;
}

body.portal-authenticated :where(.alerts-summary-block, .alerts-detail-block) > span,
body.portal-authenticated .alerts-detail-kicker {
  color: var(--dx-ink-3);
  font: 600 10.5px/1.15 var(--dx-font-h);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.portal-authenticated :where(.municipal-page, .lawyer-network-page, .shared-address-page, .journalism-risk-page) {
  background: transparent;
}

body.portal-authenticated :where(.lawyer-network-page, .shared-address-page) {
  --lawyer-accent: var(--dx-accent-800);
  --lawyer-accent-soft: var(--dx-accent-100);
  --shared-address-accent: var(--dx-accent-800);
  --shared-address-accent-soft: var(--dx-accent-100);
}

body.portal-authenticated .municipal-page {
  --municipal-accent: var(--dx-accent);
  --municipal-accent-strong: var(--dx-accent-800);
  --municipal-accent-soft: var(--dx-accent-100);
}

body.portal-authenticated .municipal-page > :not(.topbar) {
  width: min(calc(100% - 52px), 1380px);
  margin-right: auto;
  margin-left: auto;
}

body.portal-authenticated :where(.risk-head, .lawyer-network-head, .shared-address-head) {
  border: 0;
  border-radius: 0;
}

body.portal-authenticated :where(.risk-window-note, .lawyer-network-summary, .shared-address-summary) strong {
  color: var(--dx-ink);
  font: 600 32px/1 var(--dx-font-h);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

body.portal-authenticated :where(.risk-metric-strip, .lawyer-network-metrics, .shared-address-metrics) {
  gap: 12px;
  border: 0;
  background: transparent;
}

body.portal-authenticated .risk-metric-strip > div {
  padding: 16px 18px;
  border: 0;
  border-left: 4px solid var(--dx-signal);
  border-radius: var(--dx-r-card);
  background: var(--dx-surface);
  box-shadow: var(--dx-sh-card);
}

body.portal-authenticated .risk-metric-strip span {
  color: var(--dx-ink-3);
  font: 600 10.5px/1.2 var(--dx-font-h);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.portal-authenticated .risk-metric-strip strong {
  color: var(--dx-ink);
  font: 600 26px/1 var(--dx-font-h);
  font-variant-numeric: tabular-nums;
}

body.portal-authenticated :where(.risk-filters, .lawyer-network-filters, .shared-address-filters, .municipal-filters) {
  margin-top: 14px;
  margin-bottom: 16px;
  padding: 16px;
  border: 0;
  box-shadow: var(--dx-sh-card);
}

body.portal-authenticated .municipal-hero {
  min-height: 0;
  margin-top: 20px;
  padding: 24px;
  border: 0;
  border-radius: var(--dx-r-card);
  background: var(--dx-surface);
  box-shadow: var(--dx-sh-card);
}

body.portal-authenticated .municipal-hero-copy > p {
  color: var(--dx-ink-2);
  font-size: 12.5px;
  line-height: 1.55;
}

body.portal-authenticated :where(.municipal-primary-action, .municipal-secondary-action, .municipal-pagination a, .municipal-text-link) {
  border-radius: var(--dx-r-pill);
  font-family: var(--dx-font-h);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

body.portal-authenticated .municipal-primary-action {
  background: var(--dx-accent-800);
}

body.portal-authenticated :where(.reports-category, .reports-article-link, .conversation-suggestion, .users-list button) {
  border-radius: var(--dx-r-inner);
}

body.portal-authenticated .conversation-bubble.assistant {
  border-radius: var(--dx-r-card) var(--dx-r-card) var(--dx-r-card) 5px;
  background: var(--dx-surface);
  box-shadow: var(--dx-sh-card);
}

body.portal-authenticated .conversation-bubble.user {
  border-radius: var(--dx-r-card) var(--dx-r-card) 5px var(--dx-r-card);
  color: #fff;
  background: var(--dx-accent-800);
}

body.portal-authenticated .conversation-composer {
  border-color: transparent;
  border-radius: var(--dx-r-card);
  background: var(--dx-surface);
  box-shadow: var(--dx-sh-card);
}

/* Loading, empty and error states. */
body.portal-authenticated .kpi-loading {
  position: relative;
  color: transparent !important;
  background: linear-gradient(90deg, var(--dx-line), #fafbfc, var(--dx-line));
  background-size: 220% 100%;
  border-radius: 7px;
  animation: dx-skeleton 1.5s ease-in-out infinite;
}

body.portal-authenticated :where(.entity-empty-panel, .notifications-empty, .alerts-empty-state, .risk-empty, .risk-placeholder, .conversation-chart-empty, .municipal-empty, .shared-address-empty, .supplier-panel-empty, .supplier-registry-empty, .direct-purchases-message) {
  min-height: 150px;
  padding: 28px;
  border: 1px dashed var(--dx-border);
  border-radius: var(--dx-r-card);
  color: var(--dx-ink-3);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: none;
  text-align: center;
}

body.portal-authenticated :where(.notifications-error, .alerts-error, .risk-alert, .direct-purchases-message.is-error, .is-error) {
  border: 1px solid color-mix(in srgb, var(--dx-neg) 24%, transparent);
  border-radius: var(--dx-r-inner);
  color: var(--dx-neg);
  background: var(--dx-neg-bg);
  box-shadow: none;
}

body.portal-authenticated :where(.notifications-message, .alerts-status.is-success) {
  border: 1px solid color-mix(in srgb, var(--dx-pos) 22%, transparent);
  border-radius: var(--dx-r-inner);
  color: var(--dx-pos);
  background: var(--dx-pos-bg);
}

/* Deep-detail layouts keep their information density while joining the system. */
body.portal-authenticated .direct-purchase-primary-amount {
  background: linear-gradient(145deg, var(--dx-accent-100), #fff);
}

body.portal-authenticated .direct-purchase-primary-amount > strong,
body.portal-authenticated .direct-purchases-total strong,
body.portal-authenticated .direct-purchase-metrics strong,
body.portal-authenticated .notification-facts strong,
body.portal-authenticated .supplier-registry-counts strong {
  color: var(--dx-ink);
  font-family: var(--dx-font-h);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

body.portal-authenticated :where(.direct-purchase-panel dl > div, .supplier-record-list > div, .notification-facts > div) {
  border-bottom-color: var(--dx-line);
}

/* The scraper monitor is internal too, despite having no shared navigation partial. */
body.portal-authenticated .app-concursos-standalone {
  background: var(--dx-bg);
}

body.portal-authenticated .app-concursos-standalone .concursos-shell {
  width: min(calc(100% - 52px), 1380px);
  padding: 30px 0 48px;
  gap: 18px;
}

body.portal-authenticated .app-concursos-standalone .concursos-header {
  padding: 22px 24px;
  border: 0;
  border-radius: var(--dx-r-card);
  color: #fff;
  background: linear-gradient(160deg, var(--dx-accent-800), var(--dx-accent-900));
  box-shadow: var(--dx-sh-raise);
}

body.portal-authenticated .app-concursos-standalone .concursos-header :where(h1, p, a) {
  color: #fff;
}

body.portal-authenticated .app-concursos-standalone .concursos-header h1 {
  margin: 7px 0;
  font: 600 clamp(30px, 4vw, 42px)/1 var(--dx-font-h);
  letter-spacing: -0.02em;
}

body.portal-authenticated .app-concursos-standalone .concursos-header p,
body.portal-authenticated .app-concursos-standalone .concursos-header-meta > * {
  color: rgba(255, 255, 255, 0.65);
}

body.portal-authenticated .app-concursos-standalone .concursos-inline-metrics,
body.portal-authenticated .app-concursos-standalone .concursos-summary-grid {
  gap: 16px;
}

body.portal-authenticated .app-concursos-standalone .concursos-section {
  padding: 18px 20px;
}

body.portal-authenticated .app-concursos-standalone .concursos-section-head h3 {
  margin-top: 4px;
  font: 600 19px/1.15 var(--dx-font-h);
  letter-spacing: -0.01em;
}

@keyframes dx-skeleton {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

@media (max-width: 1180px) {
  body.portal-authenticated .sidebar.dx-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 10px;
    padding-right: 18px;
    padding-left: 18px;
  }

  body.portal-authenticated .sidebar .me-meta,
  body.portal-authenticated .sidebar .secondary-nav {
    display: none;
  }
}

@media (max-width: 1100px) {
  body.portal-authenticated :where(.dashboard-kpis, .entities-kpis, .notifications-metrics, .concursos-summary-grid, .concursos-inline-metrics),
  body.portal-authenticated .commercial-directory-metrics,
  body.portal-authenticated .direct-purchases-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.portal-authenticated .risk-metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.portal-authenticated .direct-purchases-quality-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.portal-authenticated :where(.chart-grid, .direct-purchases-chart-grid, .entities-risk-grid, .concursos-chart-grid, .concursos-detail-grid) {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 900px) {
  body.portal-authenticated {
    --dx-commandbar-height: 68px;
  }

  body.portal-authenticated .sidebar.dx-topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "brand navigation account";
    gap: 7px 10px;
    padding-right: 16px;
    padding-left: 16px;
  }

  body.portal-authenticated .sidebar .workspace.dx-org {
    max-width: 260px;
  }

  body.portal-authenticated .sidebar .me-meta,
  body.portal-authenticated .sidebar .secondary-nav {
    display: none;
  }

  body.portal-authenticated .main > .topbar,
  body.portal-authenticated .analytics-date-filter-bar {
    padding-right: 20px;
    padding-left: 20px;
  }

  body.portal-authenticated .page-head,
  body.portal-authenticated .notifications-head,
  body.portal-authenticated .risk-head,
  body.portal-authenticated .lawyer-network-head,
  body.portal-authenticated .shared-address-head {
    width: 100%;
    padding-right: 20px;
    padding-left: 20px;
  }

  body.portal-authenticated .content,
  body.portal-authenticated .entities-subnav,
  body.portal-authenticated .notifications-page > :where(.notifications-metrics, .notifications-toolbar, .notifications-feed, .notifications-empty, .notifications-message, .notifications-error, .notifications-pagination),
  body.portal-authenticated .journalism-risk-page > :not(.topbar),
  body.portal-authenticated .lawyer-network-page > :not(.topbar),
  body.portal-authenticated .shared-address-page > :not(.topbar),
  body.portal-authenticated .municipal-page > :not(.topbar),
  body.portal-authenticated :where(.commercial-directory-head, .commercial-directory-metrics, .commercial-directory-filters, .commercial-directory-results, .commercial-directory-empty, .commercial-directory-alert),
  body.portal-authenticated .app-concursos-standalone .concursos-shell {
    width: calc(100% - 40px);
  }

  body.portal-authenticated .notifications-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  body.portal-authenticated .app-dashboard {
    --dx-commandbar-height: 68px;
  }

  body.portal-authenticated .app-dashboard .analytics-date-filter__summary .seg {
    max-width: 100%;
  }
}

@media (max-width: 680px) {
  body.portal-authenticated {
    --dx-commandbar-height: 68px;
  }

  body.portal-authenticated .sidebar .workspace.dx-org {
    display: none;
  }

  body.portal-authenticated .sidebar .brand.dx-logo-plate {
    min-height: 36px;
    padding: 6px 10px;
  }

  body.portal-authenticated .sidebar .brand-logo {
    height: 22px;
  }

  body.portal-authenticated .sidebar .brand-mark {
    font-size: 20px;
  }

  body.portal-authenticated .main > .topbar {
    gap: 8px;
    padding: 9px 14px;
  }

  body.portal-authenticated .main > .topbar .crumbs > :not(.here) {
    display: none;
  }

  body.portal-authenticated .main > .topbar .pill[style*="width:280px"] {
    width: min(58vw, 280px) !important;
  }

  body.portal-authenticated .page-head,
  body.portal-authenticated .notifications-head,
  body.portal-authenticated .risk-head,
  body.portal-authenticated .lawyer-network-head,
  body.portal-authenticated .shared-address-head {
    align-items: flex-start;
    flex-direction: column;
    width: 100%;
    padding: 18px 14px 14px;
  }

  body.portal-authenticated .content,
  body.portal-authenticated .entities-subnav,
  body.portal-authenticated .notifications-page > :where(.notifications-metrics, .notifications-toolbar, .notifications-feed, .notifications-empty, .notifications-message, .notifications-error, .notifications-pagination),
  body.portal-authenticated .journalism-risk-page > :not(.topbar),
  body.portal-authenticated .lawyer-network-page > :not(.topbar),
  body.portal-authenticated .shared-address-page > :not(.topbar),
  body.portal-authenticated .municipal-page > :not(.topbar),
  body.portal-authenticated :where(.commercial-directory-head, .commercial-directory-metrics, .commercial-directory-filters, .commercial-directory-results, .commercial-directory-empty, .commercial-directory-alert),
  body.portal-authenticated .app-concursos-standalone .concursos-shell {
    width: calc(100% - 28px);
  }

  body.portal-authenticated :where(.dashboard-kpis, .entities-kpis, .direct-purchases-kpis, .direct-purchases-quality-strip, .notifications-metrics, .concursos-summary-grid, .concursos-inline-metrics) {
    grid-template-columns: minmax(0, 1fr);
  }

  body.portal-authenticated :where(.commercial-directory-metrics, .risk-metric-strip) {
    grid-template-columns: minmax(0, 1fr);
  }

  body.portal-authenticated :where(.direct-purchase-detail-grid, .direct-purchase-metrics, .supplier-registry-two-column, .users-layout, .notifications-search) {
    grid-template-columns: minmax(0, 1fr);
  }

  body.portal-authenticated .notifications-search {
    align-items: stretch;
    flex-direction: column;
    margin-left: 0;
  }

  body.portal-authenticated .notifications-search input {
    width: 100%;
    min-width: 0;
  }

  body.portal-authenticated .app-dashboard {
    --dx-commandbar-height: 68px;
  }

  body.portal-authenticated .app-dashboard .sidebar .dx-nav-track > a,
  body.portal-authenticated .app-dashboard .sidebar .nav-disclosure-summary {
    height: 36px;
    padding: 0 12px;
    font-size: calc(0.8125rem + 2px);
  }

  body.portal-authenticated .app-dashboard .page-title {
    font-size: 40px;
  }

  body.portal-authenticated .app-dashboard .analytics-date-filter-bar {
    min-height: 60px;
    padding: 9px 14px;
  }

  body.portal-authenticated .app-dashboard .analytics-date-filter__summary .seg {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.portal-authenticated *,
  body.portal-authenticated *::before,
  body.portal-authenticated *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.site-wordmark { display: inline-block; font-family: inherit; font-size: 30px; font-weight: 650; letter-spacing: -.045em; color: inherit; line-height: 1.2; }

/* Unified account selector and symbol-only Diaphanum brand. */
body.portal-authenticated .sidebar .brand.dx-logo-plate:has(.brand-logo-symbol) {
  width: 48px;
  min-height: 44px;
  padding: 4px;
  justify-content: center;
}
body.portal-authenticated .sidebar .brand-logo.brand-logo-symbol {
  width: 34px;
  height: 36px;
  overflow: hidden;
}
body.portal-authenticated .sidebar .sidebar-foot { justify-self: end; max-width: 100%; }
body.portal-authenticated .sidebar .dx-account { position: relative; min-width: 0; }
body.portal-authenticated .sidebar .dx-account-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(440px, calc(100vw - 100px));
  min-height: 44px;
  padding: 5px 12px 5px 6px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: var(--dx-r-pill);
  color: #fff;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
  list-style: none;
}
body.portal-authenticated .sidebar .dx-account-summary::-webkit-details-marker { display: none; }
body.portal-authenticated .sidebar .dx-account-summary:hover,
body.portal-authenticated .sidebar .dx-account[open] > summary { background: rgba(255, 255, 255, .14); }
body.portal-authenticated .sidebar .dx-account-summary:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
body.portal-authenticated .sidebar .dx-account-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  color: var(--dx-accent-900);
  font: 600 13px/1 var(--dx-font-h);
}
body.portal-authenticated .sidebar .dx-account-meta { display: grid; gap: 3px; min-width: 0; }
body.portal-authenticated .sidebar .dx-account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 14px/1.15 var(--dx-font-h);
}
body.portal-authenticated .sidebar .dx-account-context {
  display: flex;
  flex-wrap: wrap;
  gap: 0 5px;
  color: rgba(255, 255, 255, .85);
  font: 400 12px/1.25 var(--dx-font-b);
}
body.portal-authenticated .sidebar .dx-account-chevron { flex: 0 0 14px; }
body.portal-authenticated .sidebar .dx-account[open] .dx-account-chevron { transform: rotate(180deg); }
body.portal-authenticated .sidebar .dx-account-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 2;
  width: min(340px, calc(100vw - 24px));
  padding: 16px;
  border: 1px solid var(--dx-border);
  border-radius: var(--dx-r-inner);
  color: var(--dx-ink);
  background: #fff;
  box-shadow: var(--dx-sh-raise);
  font: 400 14px/1.4 var(--dx-font-b);
  overflow-wrap: anywhere;
}
body.portal-authenticated .sidebar .dx-account-identity { display: grid; gap: 3px; }
body.portal-authenticated .sidebar .dx-account-identity > span { color: #526273; }
body.portal-authenticated .sidebar .dx-account-details { display: grid; gap: 10px; margin: 16px 0; }
body.portal-authenticated .sidebar .dx-account-details div { display: grid; gap: 2px; }
body.portal-authenticated .sidebar .dx-account-details dt { color: #526273; font-size: 12px; }
body.portal-authenticated .sidebar .dx-account-details dd { margin: 0; font-weight: 600; }
body.portal-authenticated .sidebar .dx-account-action {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  color: var(--dx-accent-900);
  background: var(--dx-accent-100);
  font: 600 14px/1.3 var(--dx-font-b);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
body.portal-authenticated .sidebar .dx-account-panel form { margin: 6px 0 0; }
body.portal-authenticated .sidebar .dx-account-action:hover { background: #dce8f1; }
body.portal-authenticated .sidebar .dx-account-action:focus-visible { outline: 2px solid var(--dx-accent-700); outline-offset: 2px; }
/* Desktop navigation retains horizontal scrolling when an account has many modules. */
body.portal-authenticated .sidebar .dx-nav-toggle { display: none; }
body.portal-authenticated .sidebar > .nav.dx-nav { min-width: 0; }
body.portal-authenticated .sidebar .dx-nav-track { gap: 3px; }
body.portal-authenticated .sidebar .dx-nav-track > a,
body.portal-authenticated .app-dashboard .sidebar .dx-nav-track > a {
  padding-right: 8px;
  padding-left: 8px;
}
@media (max-width: 1360px) {
  body.portal-authenticated .sidebar.dx-topbar {
    grid-template-columns: auto auto minmax(0, 1fr);
    grid-template-areas: "brand toggle account";
    gap: 10px;
    padding: 10px 16px;
  }
  body.portal-authenticated .sidebar .dx-nav-toggle {
    grid-area: toggle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    height: 44px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 10px;
    color: #fff;
    background: transparent;
    font: 600 16px/1 var(--dx-font-h);
    cursor: pointer;
  }
  body.portal-authenticated .sidebar .dx-nav-toggle[aria-expanded="true"],
  body.portal-authenticated .sidebar .dx-nav-toggle:hover { background: rgba(255, 255, 255, .14); }
  body.portal-authenticated .sidebar .dx-nav-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
  body.portal-authenticated .sidebar > .nav.dx-nav {
    position: absolute;
    top: 100%;
    left: 12px;
    right: 12px;
    display: none;
    max-height: calc(100dvh - var(--dx-commandbar-height) - 20px);
    padding: 10px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 12px;
    background: var(--dx-accent-900);
    box-shadow: var(--dx-sh-raise);
    white-space: normal;
  }
  body.portal-authenticated .sidebar.is-nav-open > .nav.dx-nav { display: block; }
  body.portal-authenticated .sidebar .dx-nav-track { display: grid; gap: 4px; overflow: visible; }
  body.portal-authenticated .sidebar .dx-nav-track > a,
  body.portal-authenticated .app-dashboard .sidebar .dx-nav-track > a,
  body.portal-authenticated .sidebar .nav-disclosure-summary {
    width: 100%;
    min-height: 44px;
    height: auto;
    padding: 11px 12px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.3;
    white-space: normal;
  }
  body.portal-authenticated .sidebar .nav-submenu {
    position: static;
    width: 100%;
    max-width: none;
    max-height: none;
    box-shadow: none;
  }
  body.portal-authenticated .sidebar .dx-account[open] { z-index: 1; }
}
@media (max-width: 480px) {
  body.portal-authenticated,
  body.portal-authenticated .app-dashboard { --dx-commandbar-height: 76px; }
  body.portal-authenticated .sidebar.dx-topbar { gap: 8px; padding: 8px 12px; }
  body.portal-authenticated .sidebar .brand.dx-logo-plate:has(.brand-logo-symbol) { width: 40px; }
  body.portal-authenticated .sidebar .dx-account-summary {
    gap: 6px;
    max-width: calc(100vw - 134px);
    padding: 5px 9px;
    border-radius: 12px;
  }
  body.portal-authenticated .sidebar .dx-account-avatar { display: none; }
  body.portal-authenticated .sidebar .dx-account-context { display: grid; font-size: 11px; line-height: 1.2; }
  body.portal-authenticated .sidebar .dx-account-context > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.portal-authenticated .sidebar .dx-account-context > [aria-hidden] { display: none; }
}
