:root {
  color-scheme: light;
  --navy-950: #0d141a;
  --navy-900: #111b2e;
  --navy-800: #17223b;
  --navy-700: #253451;
  --navy-500: #5f6c80;
  --blue-700: #175ca9;
  --blue-600: #2475d1;
  --blue-500: #408de4;
  --blue-100: #dfeeff;
  --blue-050: #f3f8ff;
  --ice: #f6f9fd;
  --white: #ffffff;
  --line: #e2e8f0;
  --line-strong: #d2dbe7;
  --muted: #68768a;
  --green: #21885d;
  --green-bg: #e7f7ef;
  --amber: #a95e13;
  --amber-bg: #fff3df;
  --red: #af3f37;
  --red-bg: #fdeceb;
  --purple: #6855b5;
  --purple-bg: #f0edff;
  --shadow-sm: 0 1px 2px rgba(13, 20, 26, 0.05);
  --shadow-md: 0 12px 34px rgba(23, 34, 59, 0.09);
  --shadow-lg: 0 28px 70px rgba(23, 34, 59, 0.18);
  --radius-sm: 8px;
  --radius-md: 13px;
  --radius-lg: 20px;
  --sidebar-width: 258px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--ice);
}

body {
  margin: 0;
  color: var(--navy-800);
  background:
    radial-gradient(circle at 92% 0%, rgba(36, 117, 209, 0.06), transparent 28rem),
    var(--ice);
  font-family: Montserrat, Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(36, 117, 209, 0.28);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  color: var(--white);
  background: var(--navy-950);
  border-radius: var(--radius-sm);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 24px 16px 16px;
  color: #d8e1ef;
  background:
    linear-gradient(150deg, rgba(64, 141, 228, 0.09), transparent 35%),
    var(--navy-950);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  color: var(--white);
  background: linear-gradient(145deg, var(--blue-500), var(--blue-700));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 11px;
  box-shadow: 0 8px 22px rgba(36, 117, 209, 0.3);
  font-size: 19px;
  font-weight: 800;
}

.brand-mark::after {
  position: absolute;
  right: -7px;
  bottom: -8px;
  width: 24px;
  height: 24px;
  content: "";
  border: 5px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
}

.brand-lockup p {
  margin: 0;
}

.brand-name {
  color: var(--white);
  font-size: 15px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.brand-product {
  color: #8fa0b9;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.environment-pill {
  display: flex;
  width: fit-content;
  align-items: center;
  gap: 7px;
  margin: 22px 8px 8px;
  padding: 6px 9px;
  color: #aab8ca;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #4bd197;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(75, 209, 151, 0.12);
}

.nav-sections {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 20px;
  margin-top: 12px;
}

.nav-section {
  display: grid;
  gap: 4px;
}

.portal-section {
  margin-top: auto;
}

.nav-label {
  margin: 0 12px 5px;
  color: #6f8099;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  color: #aebbd0;
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}

.nav-item:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.06);
}

.nav-item:active {
  transform: translateY(1px);
}

.nav-item.active {
  color: var(--white);
  background: linear-gradient(90deg, rgba(36, 117, 209, 0.27), rgba(36, 117, 209, 0.08));
  box-shadow: inset 2px 0 var(--blue-500);
}

.nav-icon,
.button [data-icon],
.icon-button [data-icon],
.inline-icon {
  display: inline-grid;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  place-items: center;
}

.nav-icon svg,
.button svg,
.icon-button svg,
.inline-icon svg {
  width: 100%;
  height: 100%;
}

.nav-count {
  min-width: 21px;
  margin-left: auto;
  padding: 2px 6px;
  color: #a6cfff;
  background: rgba(36, 117, 209, 0.17);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  text-align: center;
}

.nav-count.warning {
  color: #ffca92;
  background: rgba(193, 68, 14, 0.18);
}

.external-arrow {
  margin-left: auto;
  color: #6f8099;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  padding: 14px 7px 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-copy {
  display: grid;
  min-width: 0;
  flex: 1;
}

.sidebar-user-copy strong {
  overflow: hidden;
  color: #edf3fb;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-copy span {
  color: #75869e;
  font-size: 10px;
}

.avatar {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--blue-700);
  background: var(--blue-100);
  border: 1px solid #c9e1fc;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
}

.avatar.small {
  width: 31px;
  height: 31px;
  color: #cde4ff;
  background: rgba(36, 117, 209, 0.22);
  border-color: rgba(64, 141, 228, 0.25);
  border-radius: 9px;
  font-size: 10px;
}

.avatar.warm {
  color: #a65a18;
  background: #fff0dd;
  border-color: #f3d6b2;
}

.avatar.green {
  color: var(--green);
  background: var(--green-bg);
  border-color: #c8ead9;
}

.avatar.purple {
  color: var(--purple);
  background: var(--purple-bg);
  border-color: #ded7ff;
}

.icon-button {
  display: inline-grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.07);
}

.main-panel {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: 28px clamp(24px, 4vw, 58px) 56px;
}

.topbar {
  display: flex;
  max-width: 1480px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0 auto 28px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--blue-600);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: var(--navy-900);
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 760;
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar-actions,
.row-actions,
.card-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.card-actions {
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 720;
  letter-spacing: -0.005em;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0);
}

.button.primary {
  color: var(--white);
  background: linear-gradient(145deg, var(--blue-600), var(--blue-700));
  box-shadow: 0 7px 18px rgba(36, 117, 209, 0.2);
}

.button.primary:hover {
  box-shadow: 0 10px 24px rgba(36, 117, 209, 0.27);
}

.button.secondary {
  color: var(--navy-700);
  background: rgba(255, 255, 255, 0.8);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.button.ghost {
  color: var(--blue-700);
  background: var(--blue-050);
  border-color: #d5e7fb;
}

.button.danger-ghost {
  color: var(--red);
  background: var(--red-bg);
  border-color: #f7d0cd;
}

.button.compact {
  min-height: 38px;
  padding: 8px 12px;
}

.button.mini {
  min-height: 31px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 10px;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
}

.loading-state {
  display: grid;
  min-height: 55vh;
  place-items: center;
  align-content: center;
  color: var(--muted);
}

.loading-mark {
  width: 34px;
  height: 34px;
  border: 3px solid var(--blue-100);
  border-top-color: var(--blue-600);
  border-radius: 50%;
  animation: rotate 900ms linear infinite;
}

@keyframes rotate {
  to { transform: rotate(360deg); }
}

.view-container {
  max-width: 1480px;
  margin: 0 auto;
  animation: fade-up 280ms ease both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.metric-card,
.panel,
.affiliate-card,
.integration-card,
.portal-card {
  background: rgba(255, 255, 255, 0.91);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.metric-card {
  position: relative;
  min-height: 134px;
  overflow: hidden;
  padding: 19px;
  border-radius: var(--radius-md);
}

.metric-card::after {
  position: absolute;
  right: -28px;
  bottom: -40px;
  width: 95px;
  height: 95px;
  content: "";
  background: var(--metric-glow, rgba(36, 117, 209, 0.08));
  border-radius: 50%;
}

.metric-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.metric-label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
}

.metric-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  color: var(--blue-600);
  background: var(--blue-050);
  border: 1px solid #dceafa;
  border-radius: 9px;
}

.metric-icon svg {
  width: 16px;
  height: 16px;
}

.metric-value {
  position: relative;
  z-index: 1;
  margin: 15px 0 5px;
  color: var(--navy-900);
  font-size: 27px;
  font-weight: 780;
  letter-spacing: -0.035em;
  line-height: 1;
}

.metric-change {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--green);
  font-size: 10px;
  font-weight: 680;
}

.metric-change.neutral {
  color: var(--muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(300px, 0.8fr);
  gap: 14px;
  margin-top: 14px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
}

.panel {
  min-width: 0;
  border-radius: var(--radius-md);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 19px;
  border-bottom: 1px solid var(--line);
}

.panel-header.no-border {
  padding-bottom: 8px;
  border-bottom: 0;
}

.panel-title-wrap {
  min-width: 0;
}

.panel-title {
  margin: 0;
  color: var(--navy-900);
  font-size: 13px;
  font-weight: 760;
  letter-spacing: -0.015em;
}

.panel-description {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.panel-body {
  padding: 18px 19px;
}

.chart-wrap {
  position: relative;
  height: 230px;
  padding: 18px 8px 0;
}

.chart-grid-lines {
  position: absolute;
  inset: 18px 8px 31px;
  display: grid;
  grid-template-rows: repeat(4, 1fr);
}

.chart-grid-lines span {
  border-top: 1px dashed #e6ebf2;
}

.bar-chart {
  position: absolute;
  inset: 18px 8px 0;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  gap: 12px;
}

.bar-group {
  display: grid;
  min-width: 24px;
  flex: 1;
  grid-template-rows: 1fr 27px;
  gap: 7px;
}

.bars {
  display: flex;
  height: 100%;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.negative-value-marker {
  align-self: flex-end;
  margin-bottom: -2px;
  color: var(--red);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.error-text {
  color: var(--red);
}

.bar {
  width: min(18px, 38%);
  min-height: 4px;
  background: linear-gradient(180deg, var(--blue-500), var(--blue-700));
  border-radius: 5px 5px 2px 2px;
  transition: height 500ms cubic-bezier(.2,.8,.2,1);
}

.bar.commission {
  background: #b8d8fb;
}

.height-0 { height: 0; }
.height-10 { height: 10%; }
.height-20 { height: 20%; }
.height-30 { height: 30%; }
.height-40 { height: 40%; }
.height-50 { height: 50%; }
.height-60 { height: 60%; }
.height-70 { height: 70%; }
.height-80 { height: 80%; }
.height-90 { height: 90%; }
.height-100 { height: 100%; }

.bar-label {
  align-self: end;
  color: #8995a6;
  font-size: 9px;
  font-weight: 620;
  text-align: center;
  white-space: nowrap;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 9px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  background: var(--blue-600);
  border-radius: 2px;
}

.legend-dot.light {
  background: #b8d8fb;
}

.health-card {
  padding: 19px;
  color: var(--white);
  background:
    radial-gradient(circle at 95% 10%, rgba(64, 141, 228, 0.28), transparent 8rem),
    linear-gradient(145deg, var(--navy-800), var(--navy-950));
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: 0 16px 32px rgba(13, 20, 26, 0.13);
}

.health-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.health-heading h3 {
  margin: 0;
  font-size: 13px;
}

.healthy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  color: #bff3db;
  background: rgba(75, 209, 151, 0.12);
  border: 1px solid rgba(75, 209, 151, 0.18);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.health-domain {
  margin: 22px 0 3px;
  font-size: 18px;
  font-weight: 740;
  letter-spacing: -0.02em;
}

.health-meta {
  margin: 0;
  color: #93a5bd;
  font-size: 10px;
}

.health-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 22px;
}

.health-stat {
  padding: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
}

.health-stat strong,
.health-stat span {
  display: block;
}

.health-stat strong {
  color: #f1f6fd;
  font-size: 12px;
}

.health-stat span {
  margin-top: 2px;
  color: #8295af;
  font-size: 8px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.feed-list {
  display: grid;
}

.feed-item {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: start;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.feed-item:first-child {
  padding-top: 3px;
}

.feed-item:last-child {
  padding-bottom: 2px;
  border-bottom: 0;
}

.feed-dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  background: var(--blue-500);
  border: 2px solid var(--blue-100);
  border-radius: 50%;
}

.feed-dot.success {
  background: var(--green);
  border-color: #ccebdd;
}

.feed-dot.warning {
  background: var(--amber);
  border-color: #f8dbb8;
}

.feed-copy strong,
.feed-copy span {
  display: block;
}

.feed-copy strong {
  color: var(--navy-800);
  font-size: 10px;
}

.feed-copy span,
.feed-time {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

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

.pagination-controls {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 10px 15px;
  border-top: 1px solid var(--line);
}

.pagination-controls:empty {
  display: none;
}

.pagination-controls p {
  margin: 0 auto 0 0;
  font-size: 10px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  color: #7d8999;
  background: #fbfcfe;
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.data-table td {
  color: #40506a;
  font-size: 10px;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover td {
  background: #fbfdff;
}

.identity-cell {
  display: flex;
  min-width: 210px;
  align-items: center;
  gap: 10px;
}

.identity-copy {
  display: grid;
}

.identity-copy strong {
  color: var(--navy-800);
  font-size: 10px;
}

.identity-copy span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.status-badge,
.severity-badge,
.evidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 780;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.status-badge.active,
.status-badge.enabled,
.status-badge.approved,
.status-badge.paid,
.status-badge.resolved {
  color: var(--green);
  background: var(--green-bg);
}

.status-badge.pending,
.status-badge.pending_approval,
.status-badge.payable,
.status-badge.processing,
.status-badge.scheduled,
.status-badge.invite_only {
  color: var(--blue-700);
  background: var(--blue-050);
}

.status-badge.suspended,
.status-badge.rejected,
.status-badge.terminated,
.status-badge.failed,
.status-badge.reversed,
.status-badge.cure_requested {
  color: var(--red);
  background: var(--red-bg);
}

.status-badge.open {
  color: var(--amber);
  background: var(--amber-bg);
}

.status-badge::before {
  width: 5px;
  height: 5px;
  content: "";
  background: currentColor;
  border-radius: 50%;
}

.severity-badge.high {
  color: var(--red);
  background: var(--red-bg);
}

.severity-badge.medium {
  color: var(--amber);
  background: var(--amber-bg);
}

.severity-badge.low {
  color: var(--blue-700);
  background: var(--blue-050);
}

.evidence-badge {
  color: var(--purple);
  background: var(--purple-bg);
  text-transform: none;
}

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

.segmented {
  display: inline-flex;
  padding: 3px;
  background: #eaf0f7;
  border-radius: 9px;
}

.segment {
  min-height: 30px;
  padding: 5px 10px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.segment.active {
  color: var(--navy-800);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.search-field {
  position: relative;
  width: min(280px, 100%);
}

.search-field input {
  width: 100%;
  height: 38px;
  padding: 8px 12px 8px 35px;
  color: var(--navy-800);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}

.search-field svg {
  position: absolute;
  top: 11px;
  left: 11px;
  width: 15px;
  color: #8a96a7;
}

.affiliate-grid,
.integration-grid,
.link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.affiliate-card,
.integration-card,
.portal-card {
  padding: 18px;
  border-radius: var(--radius-md);
}

.affiliate-card-top,
.link-card-top,
.integration-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.affiliate-name {
  margin: 13px 0 2px;
  color: var(--navy-900);
  font-size: 13px;
  font-weight: 760;
}

.affiliate-channel,
.small-muted {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 17px 0;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.mini-metric strong,
.mini-metric span {
  display: block;
}

.mini-metric strong {
  color: var(--navy-800);
  font-size: 12px;
}

.mini-metric span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 680;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.link-card {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.link-card-top {
  padding: 18px;
}

.link-symbol,
.integration-symbol,
.feature-symbol {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--blue-700);
  background: var(--blue-050);
  border: 1px solid #d8e9fb;
  border-radius: 11px;
}

.link-symbol svg,
.integration-symbol svg,
.feature-symbol svg {
  width: 19px;
  height: 19px;
}

.link-label {
  margin: 15px 0 3px;
  color: var(--navy-900);
  font-size: 12px;
  font-weight: 750;
}

.link-url {
  display: block;
  overflow: hidden;
  margin-top: 12px;
  padding: 9px 10px;
  color: var(--blue-700);
  background: var(--blue-050);
  border: 1px solid #d8e8fb;
  border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
}

.affiliate-code {
  color: var(--navy-700);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.04em;
}

.link-footer {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  padding: 12px 18px;
  background: #fbfcfe;
  border-top: 1px solid var(--line);
}

.link-footer > .link-stat + .link-stat {
  padding-left: 15px;
  border-left: 1px solid var(--line);
}

.link-footer .link-management {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  padding: 10px 0 0;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  border-left: 0;
}

.link-footer .link-management .row-actions {
  display: flex;
}

.link-footer strong,
.link-footer span {
  display: block;
}

.link-footer strong {
  color: var(--navy-800);
  font-size: 12px;
}

.link-footer span {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 14px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.summary-item {
  padding: 17px 18px;
  background: var(--white);
}

.summary-item span,
.summary-item strong {
  display: block;
}

.summary-item span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 680;
  text-transform: uppercase;
}

.summary-item strong {
  margin-top: 5px;
  color: var(--navy-900);
  font-size: 18px;
  font-weight: 770;
}

.compliance-list {
  display: grid;
  gap: 12px;
}

.compliance-case {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 17px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.case-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--amber);
  background: var(--amber-bg);
  border-radius: 10px;
}

.case-icon.high {
  color: var(--red);
  background: var(--red-bg);
}

.case-icon svg {
  width: 18px;
}

.case-copy h3 {
  margin: 0;
  color: var(--navy-900);
  font-size: 12px;
}

.case-copy p {
  max-width: 720px;
  margin: 5px 0 10px;
  color: var(--muted);
  font-size: 10px;
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  color: #7c899a;
  font-size: 8px;
  font-weight: 650;
  text-transform: uppercase;
}

.integration-card {
  min-height: 190px;
}

.integration-card h3 {
  margin: 15px 0 4px;
  color: var(--navy-900);
  font-size: 13px;
}

.integration-card p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
}

.connection-list {
  display: grid;
  gap: 9px;
  margin-top: 17px;
}

.connection-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.connection-row strong {
  color: var(--navy-700);
  font-size: 9px;
}

.empty-state {
  display: grid;
  min-height: 240px;
  place-items: center;
  align-content: center;
  padding: 30px;
  text-align: center;
}

.empty-state .feature-symbol {
  margin-bottom: 13px;
}

.empty-state h3 {
  margin: 0;
  font-size: 13px;
}

.empty-state p {
  max-width: 360px;
  margin: 6px 0 16px;
  color: var(--muted);
  font-size: 10px;
}

.portal-wrap {
  overflow: hidden;
  background: #edf5ff;
  border: 1px solid #d8e8fa;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 19px 22px;
  color: var(--white);
  background:
    radial-gradient(circle at 88% 0%, rgba(64, 141, 228, 0.35), transparent 16rem),
    var(--navy-900);
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.portal-brand strong,
.portal-brand span {
  display: block;
}

.portal-brand strong {
  font-size: 12px;
}

.portal-brand span {
  color: #9badc3;
  font-size: 9px;
}

.portal-user {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 10px;
  font-weight: 650;
}

.portal-content {
  padding: clamp(20px, 3vw, 34px);
}

.portal-welcome {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.portal-welcome h2 {
  margin: 0;
  color: var(--navy-900);
  font-size: 24px;
  letter-spacing: -0.035em;
}

.portal-welcome p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.portal-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.portal-card {
  padding: 16px;
}

.portal-card span,
.portal-card strong {
  display: block;
}

.portal-card span {
  color: var(--muted);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.portal-card strong {
  margin-top: 8px;
  color: var(--navy-900);
  font-size: 20px;
  letter-spacing: -0.03em;
}

.portal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.7fr);
  gap: 12px;
  margin-top: 12px;
}

.referral-hero {
  padding: 19px;
  color: var(--white);
  background: linear-gradient(145deg, var(--blue-600), var(--blue-700));
  border-radius: var(--radius-md);
  box-shadow: 0 13px 28px rgba(36, 117, 209, 0.2);
}

.referral-hero h3 {
  margin: 0;
  font-size: 14px;
}

.referral-hero p {
  margin: 4px 0 17px;
  color: #d4e8ff;
  font-size: 9px;
}

.referral-copy-row {
  display: flex;
  gap: 8px;
}

.referral-copy-value {
  overflow: hidden;
  flex: 1;
  padding: 10px 12px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checklist {
  display: grid;
  gap: 10px;
}

.checklist-item {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 9px;
  align-items: center;
  color: var(--navy-700);
  font-size: 9px;
  font-weight: 630;
}

.check {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: var(--green);
  background: var(--green-bg);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 900;
}

.modal-layer:empty {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(9, 15, 25, 0.55);
  backdrop-filter: blur(5px);
  animation: fade-in 180ms ease both;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: min(540px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modal-in 220ms ease both;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  padding: 21px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0;
  color: var(--navy-900);
  font-size: 18px;
  letter-spacing: -0.025em;
}

.modal-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 9px;
}

.close-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--muted);
  background: #f3f6fa;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 18px;
}

.modal-body {
  padding: 20px 22px 22px;
}

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

.field {
  display: grid;
  gap: 6px;
}

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

.field label,
.field-label {
  color: var(--navy-700);
  font-size: 9px;
  font-weight: 740;
  letter-spacing: 0.02em;
}

.field input,
.field select {
  width: 100%;
  height: 40px;
  padding: 8px 10px;
  color: var(--navy-800);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
}

.choice span {
  display: grid;
  min-height: 39px;
  place-items: center;
  color: var(--muted);
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.choice input:checked + span {
  color: var(--blue-700);
  background: var(--blue-050);
  border-color: #acd0f7;
  box-shadow: 0 0 0 2px rgba(36, 117, 209, 0.08);
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 8px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 21px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 100;
  display: grid;
  width: min(360px, calc(100vw - 44px));
  gap: 8px;
}

.toast {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  color: var(--white);
  background: var(--navy-900);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 220ms ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.toast-symbol {
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: #bff3db;
  background: rgba(75, 209, 151, 0.12);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
}

.toast strong,
.toast span {
  display: block;
}

.toast strong {
  font-size: 10px;
}

.toast span {
  margin-top: 2px;
  color: #a7b7ca;
  font-size: 8px;
}

.text-positive {
  color: var(--green) !important;
}

.text-warning {
  color: var(--amber) !important;
}

.text-danger {
  color: var(--red) !important;
}

.text-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.text-right {
  text-align: right !important;
}

.margin-top-8 { margin-top: 8px; }
.margin-top-12 { margin-top: 12px; }
.margin-top-14 { margin-top: 14px; }
.flex-spacer { margin-left: auto; }
.grid-wide { grid-column: 1 / -1; }
.min-width-zero { min-width: 0; }
.summary-detail { font-size: 14px !important; }
.connected-pill { color: var(--green); background: var(--green-bg); }
.full-width-button { width: 100%; margin-top: 18px; }

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

  .affiliate-grid,
  .integration-grid,
  .link-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 780px) {
  :root {
    --sidebar-width: 0px;
  }

  .sidebar {
    inset: auto 10px 10px;
    width: auto;
    height: 64px;
    flex-direction: row;
    align-items: center;
    padding: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 16px 50px rgba(13, 20, 26, 0.28);
  }

  .brand-lockup,
  .environment-pill,
  .nav-label,
  .sidebar-footer,
  .portal-section,
  .nav-section:nth-child(2) {
    display: none;
  }

  .nav-sections,
  .nav-section {
    display: flex;
    width: 100%;
    flex-direction: row;
    gap: 3px;
    margin: 0;
  }

  .nav-item {
    min-height: 49px;
    flex: 1;
    justify-content: center;
    gap: 0;
    padding: 8px;
    font-size: 0;
  }

  .nav-item.active {
    box-shadow: inset 0 -2px var(--blue-500);
  }

  .nav-count {
    position: absolute;
    margin: -29px 0 0 25px;
    font-size: 8px;
  }

  .main-panel {
    margin: 0;
    padding: 21px 15px 95px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-actions .secondary {
    display: none;
  }

  .button.compact {
    min-height: 36px;
  }

  .metric-grid,
  .affiliate-grid,
  .integration-grid,
  .link-grid,
  .portal-metrics {
    grid-template-columns: 1fr;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .toolbar,
  .portal-welcome {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    width: 100%;
  }

  .compliance-case {
    grid-template-columns: auto 1fr;
  }

  .compliance-case .row-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }
}

@media (max-width: 520px) {
  .topbar {
    gap: 12px;
  }

  .topbar-actions .button span:not([data-icon]) {
    display: none;
  }

  .metric-card {
    min-height: 118px;
  }

  .health-stats,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .field.full {
    grid-column: auto;
  }

  .data-table th,
  .data-table td {
    padding: 11px 12px;
  }

  .portal-header {
    padding: 15px;
  }

  .portal-user span {
    display: none;
  }
}

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

/* Production authentication and state layer */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

textarea {
  font: inherit;
}

textarea:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid rgba(36, 117, 209, 0.3);
  outline-offset: 2px;
}

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  align-content: center;
  gap: 18px;
  color: var(--muted);
  background:
    radial-gradient(circle at 70% 15%, rgba(64, 141, 228, 0.12), transparent 30rem),
    var(--ice);
}

.boot-screen p {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
}

.brand-mark.large {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  font-size: 24px;
}

.login-screen {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 0.9fr) minmax(400px, 1.1fr);
  background: var(--white);
}

.login-card {
  display: flex;
  width: min(470px, calc(100% - 48px));
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
  padding: 50px 0;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 64px;
}

.brand-name.dark {
  color: var(--navy-900);
}

.brand-product.dark {
  color: var(--muted);
}

.login-heading h1 {
  font-size: clamp(28px, 4vw, 38px);
}

.login-heading > p:last-child {
  max-width: 430px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.login-form {
  display: grid;
  gap: 18px;
  margin-top: 34px;
}

.login-help {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.login-context {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  margin: 18px;
  padding: clamp(42px, 6vw, 84px);
  color: var(--white);
  background:
    radial-gradient(circle at 86% 10%, rgba(64, 141, 228, 0.4), transparent 24rem),
    radial-gradient(circle at 15% 80%, rgba(36, 117, 209, 0.18), transparent 28rem),
    linear-gradient(145deg, var(--navy-800), var(--navy-950));
  border-radius: 24px;
}

.login-context::before,
.login-context::after {
  position: absolute;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.login-context::before {
  top: -170px;
  right: -160px;
  width: 480px;
  height: 480px;
}

.login-context::after {
  top: -85px;
  right: -70px;
  width: 300px;
  height: 300px;
}

.context-content {
  position: relative;
  z-index: 1;
  max-width: 650px;
}

.context-kicker {
  color: #91c7ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.context-content h2 {
  max-width: 620px;
  margin: 14px 0 34px;
  font-size: clamp(32px, 5vw, 58px);
  font-weight: 730;
  letter-spacing: -0.045em;
  line-height: 1.03;
}

.context-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.context-points span {
  padding: 9px 12px;
  color: #d8e8fa;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
}

.password-input-wrap,
.input-suffix {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap input {
  padding-right: 68px;
}

.input-action {
  position: absolute;
  right: 5px;
  min-width: 54px;
  min-height: 34px;
  color: var(--blue-700);
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 750;
}

.input-action:hover {
  background: var(--blue-050);
}

.input-suffix input {
  padding-right: 38px;
}

.input-suffix > span:last-child {
  position: absolute;
  right: 13px;
  color: var(--muted);
  font-size: 12px;
}

.field > span:first-child,
.field > label,
.field-label {
  color: var(--navy-700);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: 0.005em;
}

.field em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 550;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--navy-800);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
}

.field textarea {
  min-height: 120px;
  resize: vertical;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #b7c4d4;
}

.field small {
  color: var(--muted);
  font-size: 10px;
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled {
  color: #7c8999;
  background: #f2f5f9;
}

.checkbox-field {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  color: var(--navy-700);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

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

.checkbox-field input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--blue-600);
}

.form-message {
  padding: 11px 12px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 620;
}

.error-message {
  color: #8f302a;
  background: var(--red-bg);
  border: 1px solid #f3cbc8;
}

.full-width {
  width: 100%;
}

.button,
.button.compact,
.button.mini,
.segment,
.icon-button,
.close-button {
  min-height: 40px;
}

.icon-button,
.close-button {
  width: 40px;
  height: 40px;
}

.button.danger {
  color: var(--white);
  background: var(--red);
  box-shadow: 0 7px 18px rgba(175, 63, 55, 0.2);
}

.button[aria-busy="true"] {
  cursor: wait;
}

.nav-item {
  min-height: 44px;
}

.topbar-copy {
  min-width: 0;
}

.dashboard-state {
  max-width: 1480px;
  min-height: 55vh;
  margin: 0 auto;
}

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

.skeleton-card,
.skeleton-panel {
  position: relative;
  display: block;
  overflow: hidden;
  background: #e9eff6;
  border: 1px solid #e1e8f0;
  border-radius: var(--radius-md);
}

.skeleton-card {
  height: 134px;
}

.skeleton-panel {
  height: 330px;
  margin-top: 14px;
}

.skeleton-card::after,
.skeleton-panel::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.7), transparent 70%);
  transform: translateX(-100%);
  animation: skeleton-sweep 1.4s ease-in-out infinite;
}

@keyframes skeleton-sweep {
  to { transform: translateX(100%); }
}

.metric-note {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.search-field input {
  height: 44px;
  min-height: 44px;
}

.search-field svg {
  top: 14px;
}

.panel-title {
  font-size: 14px;
}

.panel-description,
.small-muted,
.affiliate-channel,
.health-meta,
.case-copy p,
.integration-card p {
  font-size: 11px;
}

.data-table td {
  font-size: 12px;
}

.data-table th,
.case-meta,
.connection-row,
.connection-row strong {
  font-size: 10px;
}

.health-pill {
  display: inline-flex;
  max-width: 190px;
  min-height: 28px;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  color: #d4dfec;
  background: rgba(212, 223, 236, 0.1);
  border: 1px solid rgba(212, 223, 236, 0.16);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.health-pill.recently_seen {
  color: #bff3db;
  background: rgba(75, 209, 151, 0.12);
  border-color: rgba(75, 209, 151, 0.18);
}

.health-pill.stale,
.health-pill.awaiting_first_contact {
  color: #ffd1a1;
  background: rgba(169, 94, 19, 0.16);
  border-color: rgba(255, 209, 161, 0.2);
}

.health-pill.disabled {
  color: #e4e9f0;
  background: rgba(112, 128, 148, 0.16);
  border-color: rgba(170, 184, 202, 0.2);
}

.health-pill .status-dot {
  background: currentColor;
  box-shadow: none;
}

.health-pill.light {
  color: var(--muted);
  background: var(--ice);
  border-color: var(--line);
}

.health-pill.light.recently_seen {
  color: var(--green);
  background: var(--green-bg);
  border-color: #c8ead9;
}

.health-pill.light.stale,
.health-pill.light.awaiting_first_contact {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: #f1d7b3;
}

.health-pill.light.disabled {
  color: var(--muted);
  background: #eef2f7;
  border-color: var(--line);
}

.empty-state h2,
.empty-state h3 {
  margin: 0;
  color: var(--navy-900);
  font-size: 15px;
}

.empty-state p {
  font-size: 12px;
}

.chart-wrap > .empty-state {
  min-height: 200px;
}

.table-subtext {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.commission-review-reason {
  max-width: 260px;
  color: var(--navy-700);
  overflow-wrap: anywhere;
  white-space: normal;
}

.commission-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.policy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.policy-grid strong {
  color: var(--navy-900);
  font-size: 12px;
}

.policy-grid p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.referral-hero h2 {
  margin: 0;
  font-size: 15px;
}

.referral-copy-row {
  align-items: center;
  margin-top: 9px;
}

.referral-copy-row code {
  display: block;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  padding: 11px 12px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 9px;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.referral-hero .button.secondary {
  background: var(--white);
}

.check.muted {
  color: var(--muted);
  background: #eef2f6;
}

.confirmation-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.confirmation-summary > div {
  display: grid;
  gap: 2px;
}

.confirmation-summary strong {
  color: var(--navy-900);
  font-size: 13px;
}

.confirmation-summary span:last-child {
  color: var(--muted);
  font-size: 11px;
}

.finding-summary,
.control-callout {
  margin-bottom: 16px;
  padding: 14px;
  background: var(--blue-050);
  border: 1px solid #d8e8fb;
  border-radius: 11px;
}

.finding-summary strong {
  color: var(--navy-900);
  font-size: 12px;
}

.finding-summary p,
.control-callout p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.control-callout {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: center;
  margin: 0;
}

.control-callout > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  color: var(--blue-700);
  background: var(--white);
  border-radius: 8px;
}

.control-callout svg {
  width: 15px;
}

.control-callout p {
  margin: 0;
}

.modal-form-error {
  margin-bottom: 16px;
}

.modal-open {
  overflow: hidden;
}

.clipboard-fallback {
  position: fixed;
  left: -9999px;
}

.toast.error .toast-symbol {
  color: #ffc7c2;
  background: rgba(255, 116, 105, 0.15);
}

.toast > span:last-child > span {
  font-size: 10px;
}

@media (max-width: 1180px) {
  .login-screen {
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  }

  .context-content h2 {
    font-size: 40px;
  }

  .skeleton-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .login-screen {
    display: block;
  }

  .login-card {
    min-height: 100vh;
  }

  .login-context {
    display: none;
  }

  .sidebar {
    inset: auto 8px 8px;
    width: auto;
    height: 68px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 7px;
    border-radius: 16px;
  }

  .brand-lockup,
  .environment-pill,
  .nav-label,
  .sidebar-footer {
    display: none;
  }

  .nav-sections {
    display: flex;
    width: max-content;
    min-width: 100%;
    flex-direction: row;
    gap: 3px;
    margin: 0;
  }

  .nav-section,
  .nav-section:nth-child(2),
  .portal-section {
    display: flex;
    width: auto;
    flex-direction: row;
    gap: 3px;
    margin: 0;
  }

  .nav-item {
    position: relative;
    width: 58px;
    min-height: 52px;
    flex: 0 0 58px;
    justify-content: center;
    gap: 0;
    padding: 8px;
    font-size: 0;
  }

  .nav-count {
    position: absolute;
    top: 2px;
    right: 3px;
    margin: 0;
    font-size: 8px;
  }

  .main-panel {
    margin-left: 0;
    padding: 21px 15px 95px;
  }

  .policy-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .login-card {
    width: min(100% - 32px, 470px);
    padding: 32px 0;
  }

  .login-brand {
    margin-bottom: 42px;
  }

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

  .topbar-actions {
    justify-content: flex-start;
  }

  .skeleton-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .field.full {
    grid-column: auto;
  }

  .modal-backdrop {
    padding: 10px;
    align-items: end;
  }

  .modal {
    width: 100%;
    max-height: calc(100vh - 20px);
    border-radius: 18px 18px 12px 12px;
  }

  .modal-header,
  .modal-body {
    padding-right: 17px;
    padding-left: 17px;
  }

  .referral-copy-row {
    align-items: stretch;
    flex-direction: column;
  }

  .referral-copy-row .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-card::after,
  .skeleton-panel::after {
    animation: none;
  }
}
