:root {
  color-scheme: light;
  --brand-orange: #ff6600;
  --brand-orange-dark: oklch(56% 0.19 44);
  --brand-orange-soft: oklch(95% 0.045 52);
  --ink-950: oklch(18% 0.012 48);
  --ink-900: oklch(23% 0.012 48);
  --ink-750: oklch(39% 0.011 48);
  --ink-600: oklch(50% 0.01 48);
  --ink-450: oklch(64% 0.009 48);
  --line-strong: oklch(79% 0.012 48);
  --line: oklch(88% 0.009 48);
  --surface-muted: oklch(96.5% 0.006 48);
  --surface: oklch(99% 0.004 48);
  --canvas: oklch(97.6% 0.007 48);
  --danger: oklch(48% 0.205 27);
  --danger-dark: oklch(37% 0.16 27);
  --danger-soft: oklch(94% 0.035 27);
  --success: oklch(47% 0.12 151);
  --success-soft: oklch(95% 0.035 151);
  --warning: oklch(60% 0.15 70);
  --warning-soft: oklch(95% 0.04 75);
  --focus: oklch(58% 0.2 44 / 0.38);

  --font-display: "Klavika CH Medium Italic", "DIN Condensed", "Avenir Next Condensed", "Bahnschrift Condensed", sans-serif;
  --font-body: "Klavika CH Regular Italic", "Avenir Next", "Segoe UI", sans-serif;
  --font-ui: "Avenir Next", "Segoe UI", sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.5rem;

  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  --radius-sm: 0.5rem;
  --radius-md: 0.875rem;
  --radius-lg: 1.25rem;
  --shadow-float: 0 1rem 2.5rem oklch(25% 0.02 48 / 0.1);
  --sidebar-width: 15.5rem;
  --topbar-height: 4.5rem;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 20rem;
  background: var(--canvas);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink-900);
  background:
    linear-gradient(135deg, transparent 0 66%, oklch(94% 0.014 48 / 0.55) 66% 66.15%, transparent 66.15%),
    var(--canvas);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

/* Rotina diária gravável */
.routine-page-head {
  align-items: flex-end;
}

.routine-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 20rem);
  gap: var(--space-lg);
  align-items: center;
  margin-bottom: var(--space-lg);
  padding: var(--space-lg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.routine-status-copy,
.routine-status-copy > span,
.routine-complete-actions,
.routine-rule,
.live-team-person,
.live-attention-head {
  display: flex;
  align-items: center;
}

.routine-status-copy {
  gap: var(--space-md);
}

.routine-status-copy > span {
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 2.75rem;
  justify-content: center;
  border-radius: 50%;
  background: var(--brand-orange-soft);
  color: var(--brand-orange-dark);
  font: 700 var(--text-lg) var(--font-ui);
}

.routine-status-copy b,
.routine-status-copy p,
.routine-complete-actions b,
.routine-complete-actions p,
.routine-rule b,
.routine-rule p {
  display: block;
  margin: 0;
}

.routine-status-copy p,
.routine-complete-actions p,
.routine-rule p {
  margin-top: var(--space-2xs);
  color: var(--ink-600);
  font-size: var(--text-sm);
}

.routine-progress > span {
  display: block;
  height: 0.6rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.routine-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-orange);
  transition: width 240ms var(--ease-out);
}

.routine-progress b {
  display: block;
  margin-top: var(--space-xs);
  color: var(--ink-750);
  font: 700 var(--text-sm) var(--font-ui);
  text-align: right;
}

.routine-error {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  border: 1px solid var(--danger);
  border-radius: var(--radius-md);
  background: var(--danger-soft);
}

.routine-error > span {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  place-items: center;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  font-weight: 800;
}

.routine-error > div {
  min-width: 0;
  flex: 1;
}

.routine-error b,
.routine-error p {
  display: block;
  margin: 0;
}

.routine-error p {
  margin-top: var(--space-2xs);
  color: var(--danger-dark);
  font-size: var(--text-sm);
}

.routine-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(17rem, 0.65fr);
  gap: var(--space-lg);
  align-items: start;
}

.routine-list-panel,
.routine-next-steps,
.live-supervision {
  padding: var(--space-lg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.routine-side {
  display: grid;
  gap: var(--space-md);
}

.routine-rule {
  gap: var(--space-sm);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--success-soft);
}

.routine-rule > span {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  place-items: center;
  border-radius: 50%;
  background: var(--success);
  color: white;
  font-weight: 800;
}

.routine-empty,
.routine-side-empty,
.live-supervision-loading {
  padding: var(--space-xl);
  color: var(--ink-600);
  text-align: center;
}

.routine-empty > span {
  display: block;
  color: var(--brand-orange);
  font-size: 2rem;
}

.routine-empty h2,
.routine-empty p {
  margin: var(--space-xs) 0 0;
}

.routine-empty p {
  max-width: 35rem;
  margin-inline: auto;
  font-size: var(--text-sm);
}

.routine-client-list {
  display: grid;
  gap: var(--space-sm);
}

.routine-client-card {
  padding: var(--space-md);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.routine-client-card.is-completed {
  border-color: oklch(80% 0.07 151);
  background: var(--success-soft);
}

.routine-client-head {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  justify-content: space-between;
}

.routine-client-number {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
  place-items: center;
  border-radius: 0.65rem;
  background: var(--ink-950);
  color: white;
  font: 700 var(--text-sm) var(--font-ui);
}

.routine-client-copy {
  min-width: 0;
  flex: 1;
}

.routine-client-copy b,
.routine-client-copy small {
  display: block;
}

.routine-client-copy small {
  margin-top: var(--space-2xs);
  color: var(--ink-600);
}

.routine-priority {
  display: flex;
  flex: 0 0 auto;
  gap: var(--space-xs);
  align-items: center;
}

.routine-queue {
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: var(--brand-orange-soft);
  color: var(--brand-orange-dark);
  font: 700 var(--text-xs) var(--font-ui);
  white-space: nowrap;
}

.routine-queue.is-declining,
.routine-queue.is-cold,
.routine-queue.is-cold_old {
  background: var(--danger-soft);
  color: var(--danger-dark);
}

.routine-score {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0.2rem;
  align-items: baseline;
  min-width: 5.7rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.7rem;
  background: var(--surface);
  color: var(--ink-750);
}

.routine-score b {
  color: var(--ink-950);
  font-size: var(--text-lg);
  line-height: 1;
}

.routine-score small {
  font: 700 0.65rem var(--font-ui);
  text-transform: uppercase;
}

.routine-score.is-high {
  border-color: oklch(75% 0.09 27);
  background: var(--danger-soft);
  color: var(--danger-dark);
}

.routine-score.is-high b {
  color: var(--danger-dark);
}

.routine-score.is-medium {
  border-color: oklch(80% 0.09 75);
  background: var(--warning-soft);
}

.routine-insights {
  display: grid;
  gap: var(--space-xs);
  margin: var(--space-md) 0 0;
  padding: 0;
  counter-reset: routine-insight;
  list-style: none;
}

.routine-insights li {
  display: grid;
  grid-template-columns: 1.45rem minmax(0, 1fr);
  gap: var(--space-xs);
  align-items: start;
  color: var(--ink-750);
  font-size: var(--text-sm);
}

.routine-insights li::before {
  display: grid;
  width: 1.45rem;
  height: 1.45rem;
  place-items: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink-750);
  content: counter(routine-insight);
  counter-increment: routine-insight;
  font: 700 var(--text-xs) var(--font-ui);
}

.routine-score-details {
  margin-top: var(--space-sm);
  color: var(--ink-600);
  font-size: var(--text-xs);
}

.routine-score-details summary {
  width: fit-content;
  cursor: pointer;
  color: var(--ink-750);
  font-weight: 700;
}

.routine-score-details p,
.routine-analysis-missing {
  margin: var(--space-xs) 0 0;
}

.routine-complete-badge {
  color: var(--success);
  font: 700 var(--text-xs) var(--font-ui);
}

.routine-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.routine-action {
  min-height: 2.65rem;
  padding: 0.62rem 0.78rem;
  border: 1px solid var(--line-strong);
  border-radius: 0.7rem;
  background: var(--surface);
  color: var(--ink-900);
  font: 700 var(--text-xs) var(--font-ui);
}

.routine-action:hover,
.routine-action:focus-visible {
  border-color: var(--brand-orange);
  background: var(--brand-orange-soft);
}

.routine-action.feedback-action {
  margin-left: auto;
  color: var(--brand-orange-dark);
}

.routine-activity-result {
  margin: var(--space-sm) 0 0;
  color: var(--success);
  font-size: var(--text-sm);
}

.routine-complete-actions {
  justify-content: space-between;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--brand-orange-soft);
}

.routine-task {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--line);
}

.routine-task:last-child {
  border-bottom: 0;
}

.routine-task b,
.routine-task small {
  display: block;
}

.routine-task small {
  margin-top: var(--space-2xs);
  color: var(--ink-600);
}

.routine-dialog {
  width: min(34rem, calc(100% - 2rem));
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink-950);
  box-shadow: var(--shadow-float);
}

.routine-dialog::backdrop {
  background: oklch(12% 0.01 48 / 0.72);
}

.routine-dialog form {
  display: grid;
  gap: var(--space-md);
  padding: var(--space-xl);
}

.dialog-head {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  justify-content: space-between;
}

.dialog-head h2,
.dialog-head p {
  margin: 0;
}

.dialog-head > div > p:last-child {
  margin-top: var(--space-2xs);
  color: var(--ink-600);
  font-size: var(--text-sm);
}

.dialog-close {
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--ink-900);
  font-size: var(--text-lg);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
}

.dialog-error {
  margin: 0;
  color: var(--danger-dark);
  font-size: var(--text-sm);
}

.live-supervision {
  margin-bottom: var(--space-xl);
}

.live-team-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.live-summary-card {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.live-summary-card span,
.live-summary-card b,
.live-summary-card small {
  display: block;
}

.live-summary-card span,
.live-summary-card small {
  color: var(--ink-600);
  font-size: var(--text-xs);
}

.live-summary-card b {
  margin: var(--space-xs) 0;
  font: 800 var(--text-xl) var(--font-display);
}

.live-supervision-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(18rem, 0.9fr);
  gap: var(--space-lg);
}

.live-team-list,
.live-attention-list {
  display: grid;
  gap: var(--space-sm);
}

.live-team-row,
.live-attention-card {
  padding: var(--space-md);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.live-team-row.is-late,
.live-attention-card.is-critical {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.live-team-person {
  gap: var(--space-sm);
}

.live-team-person > span:first-child {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  border-radius: 50%;
  background: var(--ink-950);
  color: white;
  font: 700 var(--text-xs) var(--font-ui);
}

.live-team-person > span:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.live-team-person b,
.live-team-person small {
  display: block;
}

.live-team-person small {
  color: var(--ink-600);
}

.live-team-progress {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-sm);
  align-items: center;
  margin-top: var(--space-sm);
}

.live-team-progress > span {
  height: 0.5rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.live-team-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand-orange);
}

.live-attention-head {
  gap: var(--space-sm);
  justify-content: space-between;
}

.live-attention-card p {
  margin: var(--space-xs) 0 var(--space-sm);
  color: var(--ink-600);
  font-size: var(--text-sm);
}

.live-attention-tag {
  color: var(--danger-dark);
  font: 700 var(--text-xs) var(--font-ui);
  text-transform: uppercase;
}

@media (max-width: 70rem) {
  .routine-layout,
  .live-supervision-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 48rem) {
  .routine-status,
  .live-team-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .routine-status-copy {
    grid-column: 1 / -1;
  }

  .routine-progress {
    grid-column: 1 / -1;
  }

  .routine-client-head,
  .routine-complete-actions,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .routine-priority {
    grid-column: 2;
    width: 100%;
    justify-content: space-between;
  }

  .routine-client-head {
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr);
  }

  .routine-complete-badge {
    grid-column: 2;
  }

  .routine-action,
  .routine-action.feedback-action,
  .dialog-actions button {
    width: 100%;
    margin-left: 0;
  }

  .routine-dialog form {
    padding: var(--space-lg);
  }
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

button,
select {
  min-height: 2.75rem;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 0.1875rem solid var(--focus);
  outline-offset: 0.1875rem;
}

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: var(--space-md);
  left: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  color: var(--surface);
  background: var(--ink-950);
  border-radius: var(--radius-sm);
  transform: translateY(-180%);
  transition: transform 180ms var(--ease-out);
}

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

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

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 200;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  min-height: 100vh;
  flex-direction: column;
  gap: var(--space-xl);
  padding: var(--space-xl) var(--space-md) var(--space-lg);
  color: oklch(94% 0.008 48);
  background: var(--ink-950);
}

.sidebar::after {
  position: absolute;
  right: 0;
  bottom: 8%;
  width: 9rem;
  height: 17rem;
  content: "";
  background:
    linear-gradient(135deg, transparent 44%, oklch(65% 0.17 44 / 0.18) 44% 45%, transparent 45% 55%, oklch(65% 0.17 44 / 0.12) 55% 56%, transparent 56%);
  pointer-events: none;
}

.brand-lockup {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin: calc(var(--space-xl) * -1) calc(var(--space-md) * -1) 0;
  padding: var(--space-lg) var(--space-lg) var(--space-md);
  background: oklch(98% 0.006 48);
}

.brand-lockup img {
  display: block;
  width: min(100%, 11.75rem);
  height: auto;
  margin-inline: auto;
}

.brand-lockup span {
  color: var(--ink-750);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-style: italic;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-align: center;
}

.nav-list {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.nav-item {
  display: grid;
  grid-template-columns: 1.75rem 1fr auto;
  gap: var(--space-sm);
  align-items: center;
  width: 100%;
  min-height: 3.25rem;
  padding: var(--space-sm);
  color: oklch(76% 0.018 48);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, transform 160ms var(--ease-out);
}

.nav-item:hover {
  color: var(--surface);
  background: oklch(30% 0.016 48);
  transform: translateX(0.125rem);
}

.nav-item.is-active {
  color: var(--surface);
  background: oklch(31% 0.028 48);
  border-color: oklch(48% 0.06 48 / 0.48);
}

.nav-item.is-active .nav-marker {
  color: var(--brand-orange);
}

.nav-item b {
  display: grid;
  min-width: 1.6rem;
  min-height: 1.6rem;
  place-items: center;
  padding-inline: 0.35rem;
  color: oklch(88% 0.018 48);
  background: oklch(39% 0.025 48);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.nav-item .risk-count {
  color: oklch(98% 0.01 27);
  background: var(--danger);
}

.nav-marker {
  color: oklch(56% 0.018 48);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.sidebar-foot {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  margin-top: auto;
  padding: var(--space-md) var(--space-sm) 0;
  color: oklch(65% 0.018 48);
  border-top: 1px solid oklch(82% 0.02 48 / 0.18);
}

.sidebar-foot p {
  margin: 0;
  font-size: var(--text-xs);
}

.environment-label {
  color: var(--brand-orange);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.12em;
}

.workspace {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 180;
  top: 0;
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) clamp(1rem, 3vw, 3rem);
  background: oklch(98.8% 0.004 48 / 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(1rem);
}

.prototype-flag {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  color: var(--ink-750);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.09em;
}

.flag-dot {
  width: 0.55rem;
  height: 0.55rem;
  background: var(--warning);
  border: 0.16rem solid var(--warning-soft);
  border-radius: 50%;
  box-sizing: content-box;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.sync-state,
.profile-button {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 2.75rem;
  padding: var(--space-xs) var(--space-sm);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.logout-button {
  min-height: 2.5rem;
  padding: var(--space-xs) var(--space-sm);
  color: var(--ink-750);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 800;
  cursor: pointer;
}

.logout-button:hover {
  color: var(--danger-dark);
  background: var(--danger-soft);
  border-color: var(--danger);
}

.login-body {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(1rem, 4vw, 4rem);
  background:
    linear-gradient(135deg, transparent 0 57%, oklch(40% 0.03 48 / 0.12) 57% 57.15%, transparent 57.15%),
    var(--ink-950);
}

.login-shell {
  display: grid;
  width: min(100%, 68rem);
  grid-template-columns: minmax(20rem, 1fr) minmax(20rem, 0.8fr);
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid oklch(90% 0.01 48 / 0.22);
  border-radius: var(--radius-lg);
  box-shadow: 0 2rem 5rem oklch(10% 0.02 48 / 0.35);
}

.login-card {
  padding: clamp(2rem, 5vw, 4.5rem);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.login-brand img {
  width: 10rem;
  height: auto;
}

.login-brand span {
  padding-left: var(--space-md);
  color: var(--ink-600);
  border-left: 1px solid var(--line-strong);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.12em;
}

.login-copy h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
}

.login-copy > p:last-child,
.login-footnote {
  color: var(--ink-600);
}

.login-alert {
  margin: var(--space-lg) 0;
  padding: var(--space-md);
  color: var(--danger-dark);
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
}

.login-alert p {
  margin: var(--space-2xs) 0 0;
}

.login-form {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-xl);
}

.login-form label {
  display: grid;
  gap: var(--space-xs);
  color: var(--ink-750);
  font-size: var(--text-sm);
  font-weight: 800;
}

.login-form input {
  width: 100%;
  min-height: 3rem;
  padding: var(--space-sm) var(--space-md);
  color: var(--ink-950);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.login-form .primary-button {
  width: 100%;
  margin-top: var(--space-sm);
}

.login-footnote {
  margin: var(--space-xl) 0 0;
  font-size: var(--text-xs);
}

.login-context {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(2rem, 5vw, 4.5rem);
  color: oklch(92% 0.01 48);
  background:
    linear-gradient(145deg, transparent 0 55%, oklch(65% 0.18 44 / 0.18) 55% 56%, transparent 56%),
    var(--ink-900);
}

.login-context > span {
  color: var(--brand-orange);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.14em;
}

.login-context h2 {
  margin: var(--space-md) 0;
  color: var(--surface);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}

.login-context p {
  color: oklch(78% 0.012 48);
}

.login-context ul {
  display: grid;
  gap: var(--space-sm);
  padding: 0;
  margin: var(--space-xl) 0 0;
  list-style: none;
}

.login-context li {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding-top: var(--space-sm);
  border-top: 1px solid oklch(90% 0.01 48 / 0.14);
}

.login-context li b {
  color: var(--brand-orange);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 48rem) {
  .login-body {
    place-items: start center;
    padding: 0;
    background: var(--surface);
  }

  .login-shell {
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-context {
    min-height: 20rem;
  }
}

.sync-state:hover,
.profile-button:hover {
  background: var(--surface-muted);
  border-color: var(--line);
}

.sync-state > span:last-child,
.profile-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
}

.sync-state b,
.profile-copy b {
  font-size: var(--text-sm);
}

.sync-state small,
.profile-copy small {
  color: var(--ink-600);
  font-size: var(--text-xs);
}

.sync-indicator {
  width: 0.65rem;
  height: 0.65rem;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 0.22rem var(--success-soft);
}

.sync-state.is-unavailable .sync-indicator {
  background: var(--danger);
  box-shadow: 0 0 0 0.22rem var(--danger-soft);
}

.sync-state.is-unavailable b {
  color: var(--danger);
}

.profile-button > span:first-child {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  color: var(--surface);
  background: var(--ink-900);
  border-radius: 50%;
  font-size: var(--text-sm);
  font-weight: 800;
}

main {
  width: min(100%, 96rem);
  margin-inline: auto;
  padding: clamp(1.5rem, 4vw, 4rem) clamp(1rem, 3vw, 3rem) calc(var(--space-3xl) + env(safe-area-inset-bottom));
}

.view {
  animation: view-in 360ms var(--ease-out) both;
}

.view[hidden] {
  display: none;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(0.5rem); }
  to { opacity: 1; transform: translateY(0); }
}

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

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.compact-head {
  align-items: center;
}

.page-head > div:first-child {
  max-width: 58rem;
}

.eyebrow {
  margin: 0 0 var(--space-sm);
  color: var(--brand-orange-dark);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0.13em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  color: var(--ink-950);
  font-family: var(--font-display);
  font-style: italic;
}

h1 {
  margin-bottom: var(--space-sm);
  font-size: var(--text-2xl);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

h2 {
  margin-bottom: 0;
  font-size: var(--text-lg);
  line-height: 1.15;
}

.page-lead {
  max-width: 64ch;
  margin-bottom: 0;
  color: var(--ink-600);
  font-size: var(--text-lg);
  line-height: 1.45;
}

.page-lead strong {
  color: var(--danger-dark);
}

.primary-button,
.secondary-button,
.danger-button,
.text-button,
.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 800;
  cursor: pointer;
  transition: transform 150ms var(--ease-out), background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.primary-button {
  padding: var(--space-sm) var(--space-lg);
  color: var(--surface);
  background: var(--brand-orange);
  border: 1px solid var(--brand-orange);
  box-shadow: 0 0.45rem 1rem oklch(57% 0.19 44 / 0.18);
}

.primary-button:hover:not(:disabled) {
  background: var(--brand-orange-dark);
  border-color: var(--brand-orange-dark);
  transform: translateY(-0.125rem);
}

.secondary-button {
  padding: var(--space-sm) var(--space-lg);
  color: var(--ink-900);
  background: var(--surface);
  border: 1px solid var(--line-strong);
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--ink-600);
  transform: translateY(-0.125rem);
}

.danger-button {
  padding: var(--space-sm) var(--space-lg);
  color: var(--surface);
  background: var(--danger);
  border: 1px solid var(--danger);
}

.danger-button:hover:not(:disabled) {
  background: var(--danger-dark);
  border-color: var(--danger-dark);
  transform: translateY(-0.125rem);
}

.text-button,
.back-button {
  padding: var(--space-xs) 0;
  color: var(--brand-orange-dark);
  background: transparent;
  border: 0;
}

.text-button:hover,
.back-button:hover {
  color: var(--ink-950);
}

.back-button {
  margin-bottom: var(--space-xl);
}

.priority-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(17rem, 0.7fr);
  gap: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.risk-board,
.daily-pulse,
.validation-panel,
.workload-panel,
.decision-section,
.evidence-section,
.score-section,
.fact-section,
.history-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.risk-board,
.validation-panel,
.workload-panel,
.decision-section,
.evidence-section,
.score-section,
.fact-section,
.history-section {
  padding: var(--space-xl);
}

.risk-board {
  border-color: oklch(82% 0.065 27);
  background: linear-gradient(145deg, var(--surface) 0 68%, var(--danger-soft) 100%);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.section-heading-line {
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--line);
}

.section-heading .eyebrow {
  margin-bottom: var(--space-xs);
}

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

.risk-total {
  padding: 0.38rem 0.65rem;
  color: var(--surface);
  background: var(--danger);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 800;
}

.risk-list,
.action-list,
.validation-list,
.workload-list,
.evidence-list {
  display: flex;
  flex-direction: column;
}

.risk-item {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr) auto 1.5rem;
  gap: var(--space-md);
  align-items: center;
  width: 100%;
  min-height: 4.75rem;
  padding: var(--space-md) 0;
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid oklch(86% 0.035 27);
  cursor: pointer;
}

.risk-item:first-child {
  border-top: 0;
}

.risk-item:hover .row-arrow,
.action-row:hover .row-arrow,
.validation-row:hover .row-arrow,
.opportunity-row:hover .row-arrow {
  color: var(--brand-orange-dark);
  transform: translateX(0.2rem);
}

.risk-symbol {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  color: var(--surface);
  background: var(--danger);
  border-radius: 50%;
  font-weight: 900;
}

.risk-content,
.action-copy,
.workload-copy,
.opportunity-name {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-2xs);
}

.risk-content b,
.action-copy b,
.opportunity-name b {
  overflow: hidden;
  color: var(--ink-950);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-content span,
.action-copy small,
.workload-copy small,
.opportunity-name small {
  overflow: hidden;
  color: var(--ink-600);
  font-size: var(--text-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.risk-meta {
  color: var(--danger-dark);
  font-size: var(--text-sm);
  font-weight: 800;
  white-space: nowrap;
}

.row-arrow {
  color: var(--ink-450);
  font-size: var(--text-lg);
  transition: color 150ms ease, transform 150ms var(--ease-out);
}

.daily-pulse {
  position: relative;
  overflow: hidden;
  padding: var(--space-xl);
  color: oklch(92% 0.01 48);
  background: var(--ink-900);
  border-color: var(--ink-900);
}

.daily-pulse::before {
  position: absolute;
  inset: auto -3rem -4rem auto;
  width: 12rem;
  height: 12rem;
  content: "";
  background: var(--brand-orange);
  clip-path: polygon(48% 0, 100% 28%, 76% 100%, 0 82%, 12% 24%);
  opacity: 0.11;
  transform: rotate(-12deg);
}

.daily-pulse .eyebrow {
  color: var(--brand-orange);
}

.daily-pulse h2 {
  color: var(--surface);
  font-size: var(--text-xl);
}

.daily-pulse p {
  position: relative;
  margin-bottom: var(--space-xl);
  color: oklch(76% 0.015 48);
  font-size: var(--text-sm);
}

.daily-pulse p strong {
  color: var(--surface);
}

.pulse-track {
  height: 0.42rem;
  margin: var(--space-lg) 0 var(--space-md);
  overflow: hidden;
  background: oklch(42% 0.018 48);
  border-radius: 999px;
}

.pulse-track span {
  display: block;
  width: var(--progress);
  height: 100%;
  background: var(--brand-orange);
  border-radius: inherit;
}

.pulse-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin: 0;
  padding-top: var(--space-md);
  border-top: 1px solid oklch(82% 0.02 48 / 0.18);
}

.pulse-stats div {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.pulse-stats dt {
  color: oklch(67% 0.018 48);
  font-size: var(--text-xs);
}

.pulse-stats dd {
  margin: 0;
  color: var(--surface);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  font-weight: 800;
}

.today-queue {
  padding-top: var(--space-md);
}

.action-row {
  display: grid;
  grid-template-columns: 4.25rem 6.5rem minmax(14rem, 1fr) auto 1.5rem;
  gap: var(--space-md);
  align-items: center;
  width: 100%;
  min-height: 5rem;
  padding: var(--space-sm) 0;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.time-block {
  display: flex;
  flex-direction: column;
  font-variant-numeric: tabular-nums;
}

.time-block b {
  color: var(--ink-950);
}

.time-block small {
  color: var(--ink-600);
  font-size: var(--text-xs);
}

.queue-badge,
.aethos-badge,
.evidence-status,
.prototype-inline {
  display: inline-flex;
  width: fit-content;
  min-height: 1.75rem;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.045em;
  line-height: 1.15;
  text-align: center;
}

.queue-new {
  color: var(--brand-orange-dark);
  background: var(--brand-orange-soft);
}

.queue-cold {
  color: oklch(40% 0.07 250);
  background: oklch(94% 0.035 250);
}

.queue-falling {
  color: oklch(40% 0.09 70);
  background: var(--warning-soft);
}

.aethos-badge {
  letter-spacing: 0;
  white-space: nowrap;
}

.aethos-badge.is-blocked,
.aethos-badge.is-risk {
  color: var(--danger-dark);
  background: var(--danger-soft);
}

.aethos-badge.is-current {
  color: oklch(36% 0.1 151);
  background: var(--success-soft);
}

.supervision-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: var(--space-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.strip-stat {
  display: flex;
  min-height: 6.5rem;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  border-right: 1px solid var(--line);
}

.strip-stat:last-child {
  border-right: 0;
}

.strip-stat > span {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--brand-orange-dark);
  background: var(--brand-orange-soft);
  border-radius: 50%;
  font-weight: 900;
}

.strip-stat div {
  display: flex;
  flex-direction: column;
}

.strip-stat b {
  color: var(--ink-950);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  font-variant-numeric: tabular-nums;
}

.strip-stat small {
  color: var(--ink-600);
}

.danger-stat {
  background: var(--danger-soft);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}

.danger-stat > span {
  color: var(--surface);
  background: var(--danger);
}

.danger-stat b,
.danger-stat small {
  color: var(--danger-dark);
}

.supervision-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(20rem, 0.85fr);
  gap: var(--space-xl);
}

.validation-row {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr) auto 1.5rem;
  gap: var(--space-md);
  align-items: center;
  min-height: 4.75rem;
  padding: var(--space-sm) 0;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.validation-row:last-child {
  border-bottom: 0;
}

.validation-row > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.validation-row > span:nth-child(2) small {
  color: var(--ink-600);
  font-size: var(--text-sm);
}

.score-ring {
  display: grid;
  width: 2.65rem;
  height: 2.65rem;
  place-items: center;
  border: 0.16rem solid;
  border-radius: 50%;
  font-size: var(--text-sm);
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.high-score {
  color: var(--brand-orange-dark);
  border-color: var(--brand-orange);
}

.medium-score {
  color: var(--ink-750);
  border-color: var(--line-strong);
}

.period-note,
.evidence-count {
  color: var(--ink-600);
  font-size: var(--text-xs);
  white-space: nowrap;
}

.workload-row {
  display: grid;
  grid-template-columns: 2.5rem minmax(8rem, 1fr) minmax(5rem, 0.8fr) 2.5rem;
  gap: var(--space-sm);
  align-items: center;
  min-height: 4.25rem;
  border-bottom: 1px solid var(--line);
}

.workload-row:last-child {
  border-bottom: 0;
}

.avatar {
  display: grid;
  width: 2.35rem;
  height: 2.35rem;
  place-items: center;
  border-radius: 50%;
  font-size: var(--text-xs);
  font-weight: 850;
}

.avatar-orange { color: var(--surface); background: var(--brand-orange); }
.avatar-dark { color: var(--surface); background: var(--ink-900); }
.avatar-gray { color: var(--ink-900); background: var(--line); }
.avatar-outline { color: var(--ink-900); background: var(--surface); border: 1px solid var(--line-strong); }

.workload-meter {
  height: 0.38rem;
  overflow: hidden;
  background: var(--surface-muted);
  border-radius: 999px;
}

.workload-meter i {
  display: block;
  width: var(--load);
  height: 100%;
  background: var(--brand-orange);
  border-radius: inherit;
}

.workload-row:nth-child(2) .workload-meter i {
  background: var(--danger);
}

.workload-row > strong {
  text-align: right;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.contact-metrics {
  margin-top: var(--space-xl);
  padding: var(--space-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.metrics-explainer {
  max-width: 70ch;
  margin: 0 0 var(--space-lg);
  color: var(--ink-600);
  font-size: var(--text-sm);
}

.metrics-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.metrics-row {
  display: grid;
  grid-template-columns: minmax(11rem, 1.2fr) repeat(5, minmax(5rem, 0.55fr)) minmax(8rem, 0.8fr);
  gap: var(--space-sm);
  align-items: center;
  min-height: 4.25rem;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.metrics-row:last-child {
  border-bottom: 0;
}

.metrics-head {
  min-height: 3rem;
  color: var(--ink-600);
  background: var(--surface-muted);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.metric-seller {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.metric-seller .avatar {
  flex: 0 0 auto;
  font-style: normal;
}

.metric-seller b {
  color: var(--ink-950);
}

.metric-status {
  display: inline-flex;
  width: fit-content;
  min-height: 1.75rem;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 800;
  white-space: nowrap;
}

.metric-status.on-track {
  color: oklch(36% 0.1 151);
  background: var(--success-soft);
}

.metric-status.at-risk {
  color: var(--danger-dark);
  background: var(--danger-soft);
}

.metric-status.attention {
  color: oklch(40% 0.09 70);
  background: var(--warning-soft);
}

.decision-dock {
  margin-top: var(--space-xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--line);
}

.decision-dock-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.decision-dock-head .eyebrow {
  margin-bottom: var(--space-xs);
}

.decision-dock-head h3 {
  margin: 0;
  color: var(--ink-950);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
}

.decision-dock-head > span {
  padding: 0.35rem 0.6rem;
  color: var(--ink-750);
  background: var(--surface-muted);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 800;
  white-space: nowrap;
}

.decision-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
}

.decision-card {
  display: flex;
  min-height: 13rem;
  flex-direction: column;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.decision-card.is-critical {
  background: var(--danger-soft);
  border-color: oklch(82% 0.065 27);
}

.decision-signal {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.decision-signal span {
  display: grid;
  width: 1.9rem;
  height: 1.9rem;
  place-items: center;
  color: var(--brand-orange-dark);
  background: var(--brand-orange-soft);
  border-radius: 50%;
  font-weight: 900;
}

.is-critical .decision-signal span {
  color: var(--surface);
  background: var(--danger);
}

.decision-signal b {
  color: var(--ink-950);
}

.decision-card p {
  margin: 0;
  color: var(--ink-750);
  font-size: var(--text-sm);
}

.decision-card.is-critical p,
.decision-card.is-critical p strong {
  color: var(--danger-dark);
}

.decision-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-top: auto;
}

.compact-action {
  min-height: 2.5rem;
  padding: var(--space-xs) var(--space-md);
}

.decision-footnote {
  margin: var(--space-md) 0 0;
  color: var(--ink-600);
  font-size: var(--text-xs);
}

.queue-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  overflow-x: auto;
  padding-bottom: var(--space-xs);
  scrollbar-width: thin;
}

.queue-tab {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-md);
  color: var(--ink-600);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.queue-tab b {
  display: grid;
  min-width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  padding-inline: 0.3rem;
  color: var(--ink-750);
  background: var(--surface-muted);
  border-radius: 999px;
  font-size: var(--text-xs);
}

.queue-tab:hover {
  color: var(--ink-950);
  border-color: var(--line);
}

.queue-tab.is-active {
  color: var(--surface);
  background: var(--ink-900);
}

.queue-tab.is-active b {
  color: var(--ink-950);
  background: var(--brand-orange);
}

.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.search-field {
  display: flex;
  width: min(100%, 30rem);
  min-height: 2.85rem;
  align-items: center;
  gap: var(--space-sm);
  padding-inline: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}

.search-field:focus-within {
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 0.2rem var(--focus);
}

.search-field input {
  width: 100%;
  min-width: 0;
  min-height: 2.6rem;
  color: var(--ink-950);
  background: transparent;
  border: 0;
  outline: 0;
}

.search-field input::placeholder {
  color: var(--ink-600);
  opacity: 1;
}

.list-summary {
  color: var(--ink-600);
  font-size: var(--text-sm);
  white-space: nowrap;
}

.list-summary strong {
  color: var(--ink-950);
  font-variant-numeric: tabular-nums;
}

.opportunity-table {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.table-row {
  display: grid;
  grid-template-columns: minmax(14rem, 1.5fr) 6.8rem 3.5rem minmax(8.5rem, 0.9fr) minmax(9rem, 0.9fr) minmax(7rem, 0.8fr) 1.5rem;
  gap: var(--space-md);
  align-items: center;
  width: 100%;
  min-height: 4.75rem;
  padding: var(--space-sm) var(--space-lg);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.table-head {
  min-height: 3.25rem;
  color: var(--ink-600);
  background: var(--surface-muted);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.opportunity-row {
  cursor: pointer;
  transition: background 150ms ease;
}

.opportunity-row:hover {
  background: var(--brand-orange-soft);
}

.opportunity-row:last-of-type {
  border-bottom: 0;
}

.table-score {
  color: var(--ink-950);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  font-variant-numeric: tabular-nums;
}

.seller-cell,
.deadline-cell {
  color: var(--ink-750);
  font-size: var(--text-sm);
}

.risk-seller,
.deadline-cell.is-late {
  color: var(--danger-dark);
  font-weight: 800;
}

.empty-state {
  display: grid;
  min-height: 18rem;
  place-items: center;
  align-content: center;
  gap: var(--space-xs);
  padding: var(--space-xl);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-state > span {
  color: var(--brand-orange-dark);
  font-size: var(--text-2xl);
}

.empty-state p {
  max-width: 34ch;
  margin-bottom: 0;
  color: var(--ink-600);
}

.detail-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

.prototype-inline {
  color: var(--ink-750);
  background: var(--surface-muted);
  border: 1px solid var(--line);
}

.detail-title-block h1 {
  margin-bottom: var(--space-xs);
}

.detail-title-block > p {
  margin: 0;
  color: var(--ink-600);
}

.score-block {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: var(--space-sm);
  align-items: end;
  padding: var(--space-md) var(--space-lg);
  background: var(--brand-orange-soft);
  border: 1px solid oklch(84% 0.08 52);
  border-radius: var(--radius-md);
}

.score-block span,
.score-block small {
  color: var(--brand-orange-dark);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.score-block strong {
  grid-row: span 2;
  color: var(--brand-orange-dark);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-style: italic;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}

.aethos-gate {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) auto;
  gap: var(--space-lg);
  align-items: center;
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
}

.aethos-gate.is-stale {
  background: var(--danger-soft);
  border: 1px solid oklch(78% 0.09 27);
}

.aethos-gate.is-checking {
  background: var(--warning-soft);
  border: 1px solid oklch(82% 0.08 75);
}

.aethos-gate.is-current {
  background: var(--success-soft);
  border: 1px solid oklch(80% 0.07 151);
}

.gate-icon {
  display: grid;
  width: 3.1rem;
  height: 3.1rem;
  place-items: center;
  color: var(--surface);
  background: var(--danger);
  border-radius: 50%;
  font-size: var(--text-lg);
  font-weight: 900;
}

.is-checking .gate-icon {
  color: var(--ink-950);
  background: var(--warning);
  animation: spin 900ms linear infinite;
}

.is-current .gate-icon {
  background: var(--success);
}

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

.gate-copy .eyebrow {
  margin-bottom: var(--space-2xs);
}

.gate-copy h2 {
  margin-bottom: var(--space-2xs);
}

.gate-copy p:last-child {
  margin-bottom: 0;
  color: var(--ink-750);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(19rem, 0.7fr);
  gap: var(--space-xl);
  align-items: start;
}

.detail-main,
.detail-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.decision-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.field-readonly,
.select-field {
  display: flex;
  min-height: 6.5rem;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.field-readonly > span,
.select-field > span {
  color: var(--ink-600);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field-readonly strong {
  color: var(--ink-950);
}

.field-readonly small {
  color: var(--danger-dark);
}

.field-readonly small.is-safe-copy {
  color: var(--success);
}

.select-field select {
  width: 100%;
  color: var(--ink-950);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding-inline: var(--space-sm);
}

.decision-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.decision-actions p {
  flex-basis: 100%;
  margin-bottom: 0;
  color: var(--ink-600);
  font-size: var(--text-sm);
}

.evidence-row {
  display: grid;
  grid-template-columns: 6.9rem minmax(0, 1fr) auto;
  gap: var(--space-md);
  align-items: start;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--line);
}

.evidence-row:last-child {
  border-bottom: 0;
}

.evidence-row > div b {
  color: var(--ink-950);
}

.evidence-row > div p {
  margin: var(--space-2xs) 0 0;
  color: var(--ink-600);
  font-size: var(--text-sm);
}

.evidence-row > small {
  color: var(--ink-600);
  font-size: var(--text-xs);
  text-align: right;
}

.evidence-status {
  letter-spacing: 0;
}

.evidence-status.confirmed {
  color: oklch(36% 0.1 151);
  background: var(--success-soft);
}

.evidence-status.inferred {
  color: oklch(40% 0.09 70);
  background: var(--warning-soft);
}

.score-breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.score-breakdown > div {
  display: grid;
  grid-template-columns: minmax(10rem, 0.8fr) minmax(8rem, 1fr) 3.5rem;
  gap: var(--space-md);
  align-items: center;
}

.score-breakdown span {
  color: var(--ink-750);
  font-size: var(--text-sm);
}

.score-breakdown i {
  height: 0.48rem;
  overflow: hidden;
  background: var(--surface-muted);
  border-radius: 999px;
}

.score-breakdown i b {
  display: block;
  width: var(--score);
  height: 100%;
  background: var(--brand-orange);
  border-radius: inherit;
}

.score-breakdown strong {
  color: var(--ink-950);
  text-align: right;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.facts-list {
  display: flex;
  flex-direction: column;
  margin: var(--space-lg) 0 0;
}

.facts-list div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--line);
}

.facts-list div:last-child {
  border-bottom: 0;
}

.facts-list dt {
  color: var(--ink-600);
  font-size: var(--text-sm);
}

.facts-list dd {
  margin: 0;
  color: var(--ink-950);
  font-size: var(--text-sm);
  font-weight: 700;
  text-align: right;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  position: relative;
  display: grid;
  grid-template-columns: 5.7rem 1fr;
  column-gap: var(--space-sm);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--line);
}

.timeline li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.timeline time {
  grid-row: span 2;
  color: var(--ink-600);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
}

.timeline b {
  color: var(--ink-950);
  font-size: var(--text-sm);
}

.timeline p {
  margin: var(--space-2xs) 0 0;
  color: var(--ink-600);
  font-size: var(--text-sm);
}

.timeline-risk b,
.timeline-risk time,
.timeline-risk p {
  color: var(--danger-dark);
}

.safety-note {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-lg);
  background: var(--ink-900);
  border-radius: var(--radius-lg);
  color: oklch(80% 0.015 48);
}

.safety-note > span {
  color: var(--brand-orange);
  font-size: var(--text-lg);
}

.safety-note b {
  display: block;
  color: var(--surface);
}

.safety-note p {
  margin: var(--space-xs) 0 0;
  font-size: var(--text-sm);
}

.toast {
  position: fixed;
  z-index: 500;
  right: var(--space-lg);
  bottom: var(--space-lg);
  display: flex;
  width: min(24rem, calc(100vw - 2rem));
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  color: var(--surface);
  background: var(--ink-900);
  border: 1px solid oklch(44% 0.03 48);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  animation: toast-in 280ms var(--ease-out) both;
}

.toast[hidden] {
  display: none;
}

.toast > span {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  color: var(--surface);
  background: var(--success);
  border-radius: 50%;
}

.toast[data-tone="attention"] > span {
  color: var(--surface);
  background: var(--danger);
}

.toast p {
  display: flex;
  flex-direction: column;
  margin: 0;
}

.toast small {
  color: oklch(75% 0.015 48);
}

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

@media (max-width: 76rem) {
  .priority-layout,
  .supervision-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .daily-pulse {
    min-height: 17rem;
  }

  .table-row {
    grid-template-columns: minmax(12rem, 1.4fr) 6.8rem 3.5rem minmax(8rem, 0.8fr) minmax(8rem, 0.8fr) 1.5rem;
  }

  .table-row > *:nth-child(6) {
    display: none;
  }
}

@media (max-width: 62rem) {
  :root {
    --sidebar-width: 5.25rem;
  }

  .brand-lockup {
    align-items: center;
    padding: var(--space-md) var(--space-xs) var(--space-sm);
  }

  .brand-lockup img {
    width: 4.25rem;
  }

  .brand-lockup span,
  .nav-item > span:nth-child(2),
  .sidebar-foot p,
  .environment-label {
    display: none;
  }

  .nav-item {
    grid-template-columns: 1fr;
    place-items: center;
  }

  .nav-item b {
    position: absolute;
    transform: translate(1.15rem, -0.85rem) scale(0.82);
  }

  .nav-marker {
    font-size: var(--text-sm);
  }

  .supervision-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .strip-stat:nth-child(2) {
    border-right: 0;
  }

  .strip-stat:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .danger-stat {
    border-radius: var(--radius-lg) 0 0 0;
  }

  .opportunity-table {
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  .table-head {
    display: none;
  }

  .opportunity-row {
    position: relative;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name score"
      "queue queue"
      "aethos aethos"
      "seller arrow";
    gap: var(--space-sm);
    min-height: auto;
    margin-bottom: var(--space-md);
    padding: var(--space-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
  }

  .opportunity-row > *:nth-child(1) { grid-area: name; }
  .opportunity-row > *:nth-child(2) { grid-area: queue; }
  .opportunity-row > *:nth-child(3) { grid-area: score; }
  .opportunity-row > *:nth-child(4) { grid-area: aethos; }
  .opportunity-row > *:nth-child(5) { grid-area: seller; }
  .opportunity-row > *:nth-child(6) { display: none; }
  .opportunity-row > *:nth-child(7) { grid-area: arrow; justify-self: end; }

  .metrics-table {
    overflow: visible;
    border: 0;
  }

  .metrics-head {
    display: none;
  }

  .metrics-row:not(.metrics-head) {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-md);
    padding: var(--space-md);
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
  }

  .metrics-row:not(.metrics-head) > span:not(.metric-seller):not(:last-child)::before {
    display: block;
    margin-bottom: var(--space-2xs);
    color: var(--ink-600);
    content: attr(data-label);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    text-transform: uppercase;
  }

  .metric-seller,
  .metrics-row:not(.metrics-head) > span:last-child {
    grid-column: 1 / -1;
  }

  .decision-cards {
    grid-template-columns: 1fr;
  }

  .decision-card {
    min-height: auto;
  }
}

@media (max-width: 46rem) {
  :root {
    --sidebar-width: 0rem;
    --topbar-height: 4rem;
    --text-2xl: 2rem;
  }

  body {
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom));
  }

  .app-shell {
    display: block;
  }

  .workspace {
    grid-column: auto;
  }

  .sidebar {
    inset: auto 0 0;
    width: auto;
    min-height: 0;
    height: calc(4.5rem + env(safe-area-inset-bottom));
    padding: var(--space-xs) var(--space-xs) env(safe-area-inset-bottom);
    background: var(--ink-950);
  }

  .sidebar::after,
  .brand-lockup,
  .sidebar-foot {
    display: none;
  }

  .nav-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 100%;
    gap: var(--space-2xs);
  }

  .nav-item {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 3.5rem;
    flex-direction: column;
    gap: 0;
    justify-content: center;
    padding: var(--space-2xs);
    text-align: center;
  }

  .nav-item > span:nth-child(2) {
    display: block;
    overflow: hidden;
    max-width: 100%;
    font-size: 0.66rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-marker {
    font-size: 0.68rem;
  }

  .nav-item b {
    top: -0.15rem;
    right: 0.2rem;
    min-width: 1.25rem;
    min-height: 1.25rem;
    transform: none;
    font-size: 0.6rem;
  }

  .topbar {
    padding-inline: var(--space-md);
  }

  .sync-state {
    min-height: 2.5rem;
    padding-inline: var(--space-xs);
  }

  .sync-state > span:last-child,
  .profile-copy {
    display: none;
  }

  .profile-button {
    min-height: 2.5rem;
    padding: 0;
  }

  .profile-button > span:first-child {
    width: 2.1rem;
    height: 2.1rem;
  }

  main {
    padding: var(--space-xl) var(--space-md) var(--space-2xl);
  }

  .page-head,
  .detail-head {
    align-items: stretch;
    flex-direction: column;
    margin-bottom: var(--space-xl);
  }

  .page-head .primary-button,
  .page-head .secondary-button {
    width: 100%;
  }

  .page-lead {
    font-size: var(--text-base);
  }

  .risk-board,
  .validation-panel,
  .workload-panel,
  .decision-section,
  .evidence-section,
  .score-section,
  .fact-section,
  .history-section,
  .daily-pulse {
    padding: var(--space-lg);
  }

  .contact-metrics {
    padding: var(--space-lg);
  }

  .decision-dock-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .risk-item {
    grid-template-columns: 2.25rem minmax(0, 1fr) 1.25rem;
  }

  .risk-meta {
    grid-column: 2;
    grid-row: 2;
  }

  .risk-item .row-arrow {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .section-heading {
    align-items: flex-start;
  }

  .action-row {
    grid-template-columns: 3.75rem minmax(0, 1fr) 1.25rem;
    grid-template-areas:
      "time copy arrow"
      "queue aethos arrow";
    gap: var(--space-xs) var(--space-sm);
    padding: var(--space-md) 0;
  }

  .action-row .time-block { grid-area: time; }
  .action-row .queue-badge { grid-area: queue; }
  .action-row .action-copy { grid-area: copy; }
  .action-row .aethos-badge { grid-area: aethos; }
  .action-row .row-arrow { grid-area: arrow; }

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

  .strip-stat,
  .strip-stat:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .strip-stat:last-child {
    border-bottom: 0;
  }

  .danger-stat {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .validation-row {
    grid-template-columns: 2.75rem minmax(0, 1fr) 1.25rem;
  }

  .validation-row .aethos-badge {
    grid-column: 2;
  }

  .validation-row .row-arrow {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .workload-row {
    grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
  }

  .workload-meter {
    grid-column: 2 / -1;
  }

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

  .search-field {
    width: 100%;
  }

  .detail-grid,
  .decision-fields {
    grid-template-columns: 1fr;
  }

  .score-block {
    align-self: flex-start;
  }

  .aethos-gate {
    grid-template-columns: 2.75rem 1fr;
    gap: var(--space-md);
  }

  .gate-icon {
    width: 2.6rem;
    height: 2.6rem;
  }

  .aethos-gate .danger-button,
  .aethos-gate .secondary-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .decision-actions .primary-button,
  .decision-actions .secondary-button {
    width: 100%;
  }

  .evidence-row {
    grid-template-columns: 1fr;
  }

  .evidence-row > small {
    text-align: left;
  }

  .score-breakdown > div {
    grid-template-columns: 1fr 3.5rem;
  }

  .score-breakdown i {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .score-breakdown strong {
    grid-column: 2;
    grid-row: 1;
  }

  .toast {
    right: var(--space-md);
    bottom: calc(5.25rem + env(safe-area-inset-bottom));
  }
}

/* Follow-up real: fotografia sanitizada e somente leitura do Aethos. */
.prototype-flag.is-real {
  color: oklch(35% 0.08 152);
  background: oklch(94% 0.035 152);
}

.prototype-flag.is-real .flag-dot {
  background: oklch(55% 0.15 152);
}

.real-followup-head {
  align-items: flex-end;
}

.real-data-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid oklch(72% 0.08 152);
  border-radius: 999px;
  color: oklch(35% 0.08 152);
  background: oklch(96% 0.025 152);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.snapshot-note {
  margin: var(--space-sm) 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.followup-loading,
.followup-error {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-xl);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.followup-loading > span {
  width: 1.5rem;
  height: 1.5rem;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  border-top-color: var(--brand-orange);
  border-radius: 50%;
  animation: followup-spin 0.8s linear infinite;
}

.followup-loading p,
.followup-error p {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
}

.followup-error {
  border-color: oklch(74% 0.12 28);
  color: var(--danger);
}

.followup-error > span {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-weight: 900;
}

.followup-error > div {
  flex: 1;
}

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

.real-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: var(--space-xl);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.real-kpi-strip > div {
  min-width: 0;
  padding: var(--space-lg) var(--space-xl);
  border-right: 1px solid var(--line);
}

.real-kpi-strip > div:last-child {
  border-right: 0;
}

.real-kpi-strip span,
.real-kpi-strip small {
  display: block;
  color: var(--text-muted);
  font-size: 0.72rem;
}

.real-kpi-strip b {
  display: block;
  margin: 0.32rem 0 0.2rem;
  font-size: clamp(1.2rem, 2vw, 1.85rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
}

.real-followup-filters {
  margin-bottom: var(--space-xl);
}

.seller-scorecards,
.relationship-panel,
.real-client-section {
  padding: var(--space-xl);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.seller-card-list {
  display: grid;
  grid-auto-columns: minmax(13.5rem, 1fr);
  grid-auto-flow: column;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  overflow-x: auto;
  padding-bottom: var(--space-xs);
}

.seller-scorecard {
  min-height: 9.5rem;
  padding: var(--space-lg);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
}

.seller-scorecard:hover,
.seller-scorecard:focus-visible {
  border-color: var(--brand-orange);
}

.seller-scorecard.is-selected {
  color: oklch(98% 0.006 48);
  border-color: oklch(30% 0.015 48);
  background: oklch(25% 0.015 48);
}

.seller-scorecard > span,
.seller-scorecard strong,
.seller-scorecard > small,
.seller-scorecard em {
  display: block;
}

.seller-scorecard strong {
  margin: var(--space-md) 0 var(--space-2xs);
  font-size: 1.3rem;
  font-variant-numeric: tabular-nums;
}

.seller-scorecard small,
.seller-scorecard em {
  color: var(--text-muted);
  font-size: 0.7rem;
  font-style: normal;
}

.seller-scorecard.is-selected small,
.seller-scorecard.is-selected em {
  color: oklch(82% 0.01 48);
}

.seller-scorecard em {
  margin-top: var(--space-sm);
  font-weight: 700;
}

.seller-scorecard em.is-down {
  color: var(--danger);
}

.seller-scorecard em.is-up {
  color: oklch(48% 0.12 152);
}

.seller-role {
  margin-top: 0.15rem;
  color: var(--brand-orange) !important;
  font-weight: 800;
  text-transform: uppercase;
}

.real-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: var(--space-xl);
  margin-block: var(--space-xl);
}

.real-weekly-panel {
  min-width: 0;
}

.real-weekly-chart {
  display: grid;
  grid-template-columns: repeat(5, minmax(3.5rem, 1fr));
  gap: var(--space-sm);
  min-height: 15rem;
  margin-top: var(--space-xl);
}

.real-weekly-chart > div {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--space-sm);
  min-width: 0;
  text-align: center;
}

.real-weekly-chart b {
  overflow: hidden;
  font-size: 0.72rem;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.real-weekly-chart span {
  display: flex;
  min-height: 9rem;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid var(--line);
  background: oklch(97% 0.006 48);
}

.real-weekly-chart i {
  width: min(2.1rem, 64%);
  min-height: 0;
  background: var(--brand-orange);
}

.real-weekly-chart small {
  color: var(--text-muted);
  font-size: 0.65rem;
}

.relationship-matrix {
  display: grid;
  gap: var(--space-md);
  margin-top: var(--space-lg);
  max-height: 23rem;
  overflow: auto;
}

.relationship-row {
  display: grid;
  grid-template-columns: minmax(8rem, 0.34fr) minmax(0, 1fr);
  gap: var(--space-md);
  align-items: start;
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--line);
}

.relationship-row:last-child {
  border-bottom: 0;
}

.relationship-row > b {
  padding-top: var(--space-sm);
  font-size: 0.82rem;
}

.relationship-row > b small {
  display: block;
  margin-top: 0.15rem;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
}

.relationship-row > div {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.relation-chip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.1rem var(--space-md);
  min-width: 10.5rem;
  padding: var(--space-sm) var(--space-md);
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  color: var(--text);
  cursor: pointer;
}

.relation-chip span {
  grid-column: 1 / -1;
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
}

.relation-chip strong {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.relation-chip small {
  grid-column: 1 / -1;
  color: var(--text-muted);
  font-size: 0.65rem;
}

.relation-chip:hover,
.relation-chip:focus-visible {
  border-color: var(--brand-orange);
}

.real-client-table {
  margin-top: var(--space-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.real-client-row {
  display: grid;
  grid-template-columns: minmax(13rem, 1.5fr) minmax(9rem, 1fr) minmax(9rem, 1fr) minmax(8.5rem, 0.9fr) minmax(7rem, 0.75fr) minmax(7rem, 0.75fr) 1.5rem;
  gap: var(--space-md);
  width: 100%;
  min-width: 66rem;
  align-items: center;
  padding: var(--space-md) var(--space-lg);
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

button.real-client-row {
  cursor: pointer;
}

button.real-client-row:hover,
button.real-client-row:focus-visible,
button.real-client-row[aria-expanded="true"] {
  background: var(--surface-muted);
}

.real-client-head {
  color: var(--text-muted);
  background: var(--surface-muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.real-client-entry:last-child .real-client-row {
  border-bottom: 0;
}

.real-client-row b,
.real-client-row small {
  display: block;
}

.real-client-row b {
  overflow: hidden;
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.real-client-row small {
  margin-top: 0.18rem;
  color: var(--text-muted);
  font-size: 0.66rem;
}

.relation-badge {
  display: inline-flex;
  padding: 0.28rem 0.48rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-muted);
  font-size: 0.65rem;
  font-style: normal;
  font-weight: 800;
}

.relation-supervisor_support,
.relation-cross,
.relation-unassigned {
  color: oklch(46% 0.13 54);
  border-color: oklch(78% 0.1 64);
  background: oklch(96% 0.035 72);
}

.relation-own {
  color: oklch(38% 0.09 152);
  border-color: oklch(78% 0.07 152);
  background: oklch(96% 0.025 152);
}

.relation-multiple_owner {
  color: var(--danger);
  border-color: oklch(74% 0.12 28);
  background: oklch(96% 0.035 28);
}

.real-client-detail {
  display: grid;
  grid-template-columns: repeat(2, minmax(9rem, 0.3fr)) minmax(16rem, 1fr);
  gap: var(--space-xl);
  padding: var(--space-lg) calc(var(--space-lg) * 2);
  border-bottom: 1px solid var(--line);
  background: oklch(98% 0.006 48);
}

.real-client-detail span,
.real-client-detail b {
  display: block;
}

.real-client-detail span {
  color: var(--text-muted);
  font-size: 0.67rem;
}

.real-client-detail b {
  margin-top: 0.2rem;
  font-size: 0.78rem;
}

.real-client-detail p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
}

@media (max-width: 76rem) {
  .real-analysis-grid {
    grid-template-columns: 1fr;
  }

  .real-client-table {
    overflow-x: auto;
  }
}

@media (max-width: 62rem) {
  .real-kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .real-kpi-strip > div:nth-child(2) {
    border-right: 0;
  }

  .real-kpi-strip > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .real-client-head {
    display: none;
  }

  .real-client-table {
    overflow: visible;
    border: 0;
  }

  .real-client-entry {
    margin-bottom: var(--space-md);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
  }

  .real-client-row {
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: var(--space-md);
    padding: var(--space-lg);
  }

  .real-client-row > span:not(:first-child):not(:last-child) {
    grid-column: 1;
  }

  .real-client-row > .row-arrow {
    grid-column: 2;
    grid-row: 1 / span 4;
  }

  .real-client-detail {
    grid-template-columns: 1fr;
    padding: var(--space-lg);
  }
}

@media (max-width: 46rem) {
  .real-followup-head {
    align-items: flex-start;
  }

  .followup-error {
    align-items: flex-start;
    flex-wrap: wrap;
  }

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

  .real-kpi-strip > div,
  .real-kpi-strip > div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .real-kpi-strip > div:last-child {
    border-bottom: 0;
  }

  .seller-scorecards,
  .relationship-panel,
  .real-client-section {
    padding: var(--space-lg);
  }

  .relationship-row {
    grid-template-columns: 1fr;
  }

  .relationship-row > div {
    display: grid;
    grid-template-columns: 1fr;
  }

  .relation-chip {
    width: 100%;
  }

  .real-weekly-chart {
    gap: var(--space-2xs);
    overflow-x: auto;
  }

  .real-weekly-chart > div {
    min-width: 3.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .followup-loading > span {
    animation: none;
  }
}

@media (pointer: coarse) {
  button,
  select,
  .queue-tab {
    min-height: 3rem;
  }
}

/* Redesenho do fluxo comercial: entrada, continuidade e performance. */
.access-scope {
  display: inline-flex;
  min-height: 2rem;
  align-items: center;
  gap: var(--space-xs);
  padding: 0 var(--space-sm);
  color: var(--ink-750);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.06em;
}

.access-scope > span,
.heading-access > span {
  color: var(--brand-orange-dark);
}

.nav-item-private::after {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  color: var(--brand-orange);
  content: "◆";
  font-size: 0.42rem;
}

.flow-overview {
  margin-bottom: var(--space-2xl);
  padding: var(--space-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.flow-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: var(--space-lg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.flow-lane {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: var(--space-md);
  align-items: center;
  min-height: 8.5rem;
  padding: var(--space-lg);
  text-align: left;
  background: var(--surface);
  border: 0;
  border-right: 1px solid var(--line);
  cursor: pointer;
  transition: background 160ms ease, transform 160ms var(--ease-out);
}

.flow-lane:last-child {
  border-right: 0;
}

.flow-lane:hover {
  background: var(--brand-orange-soft);
}

.lane-intake {
  background: oklch(96.5% 0.018 48);
}

.lane-number {
  color: var(--brand-orange-dark);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  font-weight: 800;
}

.lane-copy,
.lane-total {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.lane-copy b,
.lane-total strong {
  color: var(--ink-950);
}

.lane-copy small,
.lane-total small {
  margin-top: var(--space-2xs);
  color: var(--ink-600);
  line-height: 1.35;
}

.lane-total {
  text-align: right;
  white-space: nowrap;
}

.lane-total strong {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-style: italic;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.overview-priority {
  margin-bottom: 0;
}

.heading-access {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.heading-access .eyebrow {
  margin: 0;
}

.heading-access > span {
  padding: 0.28rem 0.55rem;
  background: var(--brand-orange-soft);
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.06em;
}

.permission-note {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  color: var(--ink-750);
  background: oklch(96.5% 0.018 48);
  border: 1px solid oklch(84% 0.045 48);
  border-radius: var(--radius-md);
}

.permission-note > span {
  color: var(--brand-orange-dark);
}

.permission-note b {
  color: var(--ink-950);
}

.permission-note p {
  max-width: 76ch;
  margin: var(--space-2xs) 0 0;
  font-size: var(--text-sm);
}

.process-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: var(--space-xl);
  overflow: hidden;
  background: var(--ink-900);
  border-radius: var(--radius-lg);
}

.process-strip > div {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: var(--space-sm);
  padding: var(--space-lg);
  border-right: 1px solid oklch(42% 0.015 48);
}

.process-strip > div:last-child {
  border-right: 0;
}

.process-strip span {
  grid-row: 1 / span 2;
  color: var(--brand-orange);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-style: italic;
  font-weight: 800;
}

.process-strip b {
  color: var(--surface);
}

.process-strip small {
  margin-top: var(--space-2xs);
  color: oklch(78% 0.015 48);
}

.intake-table .table-row {
  grid-template-columns: minmax(15rem, 1.5fr) 3.5rem 6rem minmax(8rem, 0.9fr) minmax(8rem, 0.9fr) minmax(7rem, 0.8fr) 1.5rem;
}

.signal-count,
.stage-badge,
.locked-label {
  display: inline-flex;
  width: fit-content;
  min-height: 1.75rem;
  align-items: center;
  padding: 0.25rem 0.55rem;
  color: var(--ink-750);
  background: var(--surface-muted);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 800;
  white-space: nowrap;
}

.stage-badge.is-active {
  color: var(--brand-orange-dark);
  background: var(--brand-orange-soft);
}

.stage-badge.is-ready {
  color: oklch(36% 0.1 151);
  background: var(--success-soft);
}

.filter-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(9rem, 0.75fr)) minmax(14rem, 1.3fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--ink-900);
  border-radius: var(--radius-lg);
}

.filter-rail label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-xs);
}

.filter-rail label > span {
  color: oklch(76% 0.014 48);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.filter-rail select,
.filter-rail input {
  width: 100%;
  min-width: 0;
  min-height: 2.75rem;
  padding: 0 var(--space-sm);
  color: var(--surface);
  background: oklch(28% 0.014 48);
  border: 1px solid oklch(43% 0.014 48);
  border-radius: var(--radius-sm);
}

.filter-rail input::placeholder {
  color: oklch(70% 0.012 48);
  opacity: 1;
}

.followup-strip {
  margin-bottom: var(--space-xl);
}

.followup-queue {
  padding: var(--space-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.followup-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.followup-row {
  display: grid;
  grid-template-columns: minmax(14rem, 1.5fr) minmax(8rem, 0.8fr) minmax(8rem, 0.8fr) minmax(7rem, 0.7fr) minmax(9rem, 0.9fr) 1.5rem;
  gap: var(--space-md);
  align-items: center;
  width: 100%;
  min-height: 4.75rem;
  padding: var(--space-sm) var(--space-lg);
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.followup-head {
  min-height: 3.25rem;
  color: var(--ink-600);
  background: var(--surface-muted);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.client-row {
  cursor: pointer;
  transition: background 150ms ease;
}

.client-row:hover,
.performance-row:hover {
  background: var(--brand-orange-soft);
}

.client-row:last-of-type {
  border-bottom: 0;
}

.next-step {
  color: var(--ink-950);
  font-size: var(--text-sm);
}

.performance-filters {
  grid-template-columns: repeat(3, minmax(10rem, 1fr));
}

.performance-scoreboard {
  display: grid;
  grid-template-columns: minmax(15rem, 0.7fr) minmax(0, 2fr);
  gap: var(--space-xl);
  align-items: stretch;
  margin-bottom: var(--space-xl);
  padding: var(--space-xl);
  color: var(--surface);
  background: var(--ink-900);
  border-radius: var(--radius-lg);
}

.scoreboard-lead {
  align-self: center;
  padding-right: var(--space-lg);
}

.scoreboard-lead .eyebrow {
  color: var(--brand-orange);
}

.scoreboard-lead h2,
.scoreboard-lead p {
  color: var(--surface);
}

.scoreboard-lead p:last-child {
  max-width: 34ch;
  margin: var(--space-sm) 0 0;
  color: oklch(78% 0.014 48);
  font-size: var(--text-sm);
}

.scoreboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  border: 1px solid oklch(42% 0.015 48);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.scoreboard-metrics > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-xs);
  justify-content: space-between;
  padding: var(--space-lg);
  border-right: 1px solid oklch(42% 0.015 48);
}

.scoreboard-metrics > div:last-child {
  border-right: 0;
}

.scoreboard-metrics dt {
  color: oklch(76% 0.014 48);
  font-size: var(--text-xs);
  font-weight: 800;
}

.scoreboard-metrics dd {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-xs);
  margin: 0;
}

.scoreboard-metrics strong {
  color: var(--surface);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-style: italic;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.scoreboard-metrics small {
  color: oklch(72% 0.014 48);
  line-height: 1.35;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(20rem, 0.8fr);
  gap: var(--space-xl);
}

.trend-panel,
.funnel-panel,
.purchase-journey,
.next-best-action,
.items-panel,
.activity-panel {
  padding: var(--space-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.weekly-chart {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  height: 17rem;
  align-items: end;
  margin-top: var(--space-xl);
  padding: var(--space-lg) var(--space-lg) 0;
  border-bottom: 1px solid var(--line-strong);
}

.weekly-chart > div {
  display: grid;
  height: 100%;
  grid-template-rows: 1fr auto;
  gap: var(--space-sm);
  align-items: end;
  text-align: center;
}

.weekly-chart span {
  position: relative;
  display: block;
  width: min(4.5rem, 80%);
  height: var(--bar);
  justify-self: center;
  background: var(--brand-orange);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.weekly-chart i {
  position: absolute;
  top: -1.8rem;
  left: 50%;
  color: var(--ink-950);
  font-style: normal;
  font-weight: 850;
  transform: translateX(-50%);
}

.weekly-chart small {
  color: var(--ink-600);
  font-weight: 700;
}

.funnel-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-top: var(--space-lg);
}

.funnel-list button {
  display: grid;
  grid-template-columns: minmax(7rem, 1fr) 2.5rem;
  gap: var(--space-xs);
  align-items: center;
  padding: var(--space-xs) 0;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.funnel-list b {
  color: var(--ink-950);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.funnel-list i {
  grid-column: 1 / -1;
  width: var(--funnel);
  height: 0.55rem;
  background: var(--brand-orange);
  border-radius: 999px;
  transition: width 240ms var(--ease-out);
}

.performance-row {
  width: 100%;
  color: var(--ink-750);
  text-align: left;
  background: var(--surface);
  border-top: 0;
  border-right: 0;
  border-left: 0;
  cursor: pointer;
}

.small-risk {
  width: 2.5rem;
  height: 2.5rem;
}

.handoff-progress {
  display: grid;
  grid-template-columns: auto minmax(2rem, 1fr) auto minmax(2rem, 1fr) auto;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-xl);
  padding: var(--space-md) var(--space-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.handoff-progress > div {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: var(--space-sm);
  align-items: center;
  opacity: 0.55;
}

.handoff-progress > div.is-current,
.handoff-progress > div.is-complete {
  opacity: 1;
}

.handoff-progress > div > span {
  grid-row: 1 / span 2;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  color: var(--ink-750);
  background: var(--surface-muted);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  font-weight: 850;
}

.handoff-progress > div.is-current > span {
  color: var(--surface);
  background: var(--brand-orange);
  border-color: var(--brand-orange);
}

.handoff-progress > div.is-complete > span {
  color: var(--surface);
  background: var(--success);
  border-color: var(--success);
}

.handoff-progress b {
  color: var(--ink-950);
  font-size: var(--text-sm);
}

.handoff-progress small {
  color: var(--ink-600);
}

.handoff-progress > i {
  height: 1px;
  background: var(--line-strong);
}

.section-intro {
  max-width: 68ch;
  margin: 0 0 var(--space-lg);
  color: var(--ink-600);
  font-size: var(--text-sm);
}

.contact-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.text-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-md);
  background: var(--surface-muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.text-field > span {
  color: var(--ink-600);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.text-field textarea {
  width: 100%;
  resize: vertical;
  padding: var(--space-sm);
  color: var(--ink-950);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font: inherit;
}

.form-wide {
  grid-column: 1 / -1;
}

.handoff-section {
  transition: opacity 180ms ease;
}

.handoff-section.is-locked {
  opacity: 0.68;
}

.locked-label {
  color: var(--danger-dark);
  background: var(--danger-soft);
}

.customer-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-bottom: var(--space-xl);
  overflow: hidden;
  background: var(--ink-900);
  border-radius: var(--radius-lg);
}

.customer-summary > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-lg);
  border-right: 1px solid oklch(42% 0.015 48);
}

.customer-summary > div:last-child {
  border-right: 0;
}

.customer-summary span,
.customer-summary small {
  color: oklch(76% 0.014 48);
  font-size: var(--text-xs);
}

.customer-summary strong {
  color: var(--surface);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-style: italic;
  font-variant-numeric: tabular-nums;
}

.customer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(18rem, 0.65fr);
  gap: var(--space-xl);
  align-items: stretch;
  margin-bottom: var(--space-xl);
}

.chart-context {
  margin: var(--space-md) 0 var(--space-lg);
  color: var(--ink-600);
  font-size: var(--text-sm);
}

.chart-context span {
  color: var(--ink-950);
  font-weight: 800;
}

.purchase-chart {
  display: grid;
  grid-template-columns: repeat(6, minmax(3.5rem, 1fr));
  gap: var(--space-sm);
  height: 18rem;
  align-items: end;
  padding: var(--space-lg) var(--space-sm) 0;
  border-bottom: 1px solid var(--line-strong);
}

.purchase-chart button {
  display: grid;
  height: 100%;
  grid-template-rows: 1fr auto;
  gap: var(--space-sm);
  align-items: end;
  padding: 0;
  color: var(--ink-600);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.purchase-chart button > span {
  position: relative;
  display: block;
  width: 72%;
  height: var(--bar);
  justify-self: center;
  background: oklch(72% 0.12 48);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: background 160ms ease, transform 160ms var(--ease-out);
}

.purchase-chart button:hover > span,
.purchase-chart button.is-active > span {
  background: var(--brand-orange);
  transform: scaleX(1.05);
}

.purchase-chart button.is-active small {
  color: var(--ink-950);
  font-weight: 850;
}

.purchase-chart i {
  position: absolute;
  top: -1.65rem;
  left: 50%;
  color: var(--ink-750);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
  transform: translateX(-50%);
}

.purchase-chart small {
  font-weight: 700;
}

.trend-insight {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-xl);
  padding: var(--space-md);
  color: var(--danger-dark);
  background: var(--danger-soft);
  border: 1px solid oklch(84% 0.055 27);
  border-radius: var(--radius-md);
}

.trend-insight > span {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: 0 0 auto;
  place-items: center;
  color: var(--surface);
  background: var(--danger);
  border-radius: 50%;
  font-weight: 900;
}

.trend-insight p {
  margin: 0;
  font-size: var(--text-sm);
}

.next-best-action {
  display: flex;
  flex-direction: column;
  color: var(--surface);
  background: var(--ink-900);
  border-color: var(--ink-900);
}

.next-best-action .eyebrow {
  color: var(--brand-orange);
}

.next-best-action h2,
.next-best-action p,
.next-best-action dd {
  color: var(--surface);
}

.next-best-action > p:not(.eyebrow) {
  color: oklch(78% 0.014 48);
  font-size: var(--text-sm);
}

.next-best-action dl {
  margin: auto 0 var(--space-lg);
}

.next-best-action dl div {
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid oklch(42% 0.015 48);
}

.next-best-action dt {
  color: oklch(72% 0.014 48);
  font-size: var(--text-sm);
}

.next-best-action dd {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 800;
  text-align: right;
}

.customer-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(20rem, 0.65fr);
  gap: var(--space-xl);
  align-items: start;
}

.items-table {
  margin-top: var(--space-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.items-row {
  display: grid;
  grid-template-columns: minmax(12rem, 1.4fr) repeat(3, minmax(6rem, 0.6fr));
  gap: var(--space-md);
  align-items: center;
  min-height: 4.25rem;
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--line);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.items-row:last-of-type {
  border-bottom: 0;
}

.items-head {
  min-height: 3rem;
  color: var(--ink-600);
  background: var(--surface-muted);
  font-size: var(--text-xs);
  font-weight: 800;
  text-transform: uppercase;
}

.items-row > span:first-child {
  display: flex;
  flex-direction: column;
}

.items-row small {
  color: var(--ink-600);
}

.items-empty {
  padding: var(--space-xl);
  color: var(--ink-600);
  text-align: center;
}

.activity-panel .timeline {
  margin-top: var(--space-lg);
}

@media (max-width: 76rem) {
  .flow-lanes,
  .performance-scoreboard,
  .analytics-grid,
  .customer-grid,
  .customer-lower-grid {
    grid-template-columns: 1fr;
  }

  .flow-lane {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .flow-lane:last-child {
    border-bottom: 0;
  }

  .scoreboard-lead {
    padding-right: 0;
  }

  .intake-table .table-row {
    grid-template-columns: minmax(12rem, 1.4fr) 3.5rem 6rem minmax(8rem, 0.8fr) minmax(8rem, 0.8fr) 1.5rem;
  }

  .intake-table .table-row > *:nth-child(6) {
    display: none;
  }
}

@media (max-width: 62rem) {
  .access-scope {
    display: none;
  }

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

  .scoreboard-metrics,
  .customer-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scoreboard-metrics > div:nth-child(2),
  .customer-summary > div:nth-child(2) {
    border-right: 0;
  }

  .scoreboard-metrics > div:nth-child(-n + 2),
  .customer-summary > div:nth-child(-n + 2) {
    border-bottom: 1px solid oklch(42% 0.015 48);
  }

  .followup-table {
    overflow: visible;
    border: 0;
  }

  .followup-head {
    display: none;
  }

  .followup-row.client-row {
    grid-template-columns: 1fr auto;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding: var(--space-lg);
    background: var(--surface-muted);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
  }

  .followup-row.client-row > *:first-child {
    grid-column: 1;
  }

  .followup-row.client-row > *:nth-child(2),
  .followup-row.client-row > *:nth-child(3),
  .followup-row.client-row > *:nth-child(4),
  .followup-row.client-row > *:nth-child(5) {
    grid-column: 1;
  }

  .followup-row.client-row > *:last-child {
    grid-column: 2;
    grid-row: 1 / span 3;
  }
}

@media (max-width: 46rem) {
  .nav-list {
    grid-template-columns: repeat(6, 1fr);
  }

  .nav-item > span:nth-child(2) {
    font-size: 0.55rem;
  }

  .nav-item b {
    right: 0.05rem;
  }

  .flow-overview,
  .followup-queue,
  .trend-panel,
  .funnel-panel,
  .purchase-journey,
  .next-best-action,
  .items-panel,
  .activity-panel,
  .performance-scoreboard {
    padding: var(--space-lg);
  }

  .flow-lane {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 7rem;
    padding: var(--space-md);
  }

  .flow-lane .lane-total {
    grid-column: 2;
    align-items: flex-start;
    text-align: left;
  }

  .flow-lane .row-arrow {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .permission-note {
    padding: var(--space-md);
  }

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

  .process-strip > div {
    border-right: 0;
    border-bottom: 1px solid oklch(42% 0.015 48);
  }

  .process-strip > div:last-child {
    border-bottom: 0;
  }

  .filter-rail,
  .performance-filters {
    grid-template-columns: 1fr;
  }

  .scoreboard-metrics,
  .customer-summary {
    grid-template-columns: 1fr;
  }

  .scoreboard-metrics > div,
  .scoreboard-metrics > div:nth-child(2),
  .customer-summary > div,
  .customer-summary > div:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid oklch(42% 0.015 48);
  }

  .scoreboard-metrics > div:last-child,
  .customer-summary > div:last-child {
    border-bottom: 0;
  }

  .weekly-chart {
    height: 14rem;
    padding-inline: 0;
  }

  .handoff-progress {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .handoff-progress > i {
    width: 1px;
    height: 1rem;
    margin-left: 1.1rem;
  }

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

  .form-wide {
    grid-column: 1;
  }

  .purchase-chart {
    gap: var(--space-2xs);
    height: 14rem;
    padding-inline: 0;
  }

  .purchase-chart i {
    font-size: 0.6rem;
  }

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

  .items-row {
    min-width: 38rem;
  }
}
.routine-client-card.is-linked-client { outline: 3px solid #ad4311; outline-offset: 3px; }
