:root {
  color-scheme: dark;
  --bg: #050806;
  --bg-soft: #080d0a;
  --surface: #0d1310;
  --surface-2: #111a15;
  --surface-3: #17221b;
  --surface-hover: #1b2920;
  --glass: rgba(8, 13, 10, 0.82);
  --text: #f5f8f5;
  --text-soft: #c5cec8;
  --muted: #839087;
  --faint: #5f6c63;
  --line: rgba(207, 232, 214, 0.12);
  --line-strong: rgba(207, 232, 214, 0.2);
  --green: #39f58b;
  --green-2: #00cf69;
  --green-soft: rgba(57, 245, 139, 0.1);
  --green-line: rgba(57, 245, 139, 0.28);
  --blue: #6ba8ff;
  --amber: #ffb84a;
  --red: #ff6b73;
  --purple: #a68bff;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.18);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --sidebar-width: 272px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    Inter, "Segoe UI", sans-serif;
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f5f2;
  --bg-soft: #eaf0ec;
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --surface-3: #edf3ef;
  --surface-hover: #e7efe9;
  --glass: rgba(248, 251, 249, 0.88);
  --text: #0a110d;
  --text-soft: #34423a;
  --muted: #68766e;
  --faint: #89958d;
  --line: rgba(16, 43, 27, 0.1);
  --line-strong: rgba(16, 43, 27, 0.18);
  --green: #00bd5e;
  --green-2: #00a953;
  --green-soft: rgba(0, 189, 94, 0.09);
  --green-line: rgba(0, 173, 83, 0.24);
  --shadow: 0 24px 60px rgba(36, 62, 44, 0.12);
  --shadow-soft: 0 10px 30px rgba(36, 62, 44, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 78% -20%, rgba(25, 197, 101, 0.1), transparent 38rem),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

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

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3,
strong {
  letter-spacing: -0.02em;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(145deg, var(--green), var(--green-2));
  box-shadow: 0 10px 28px rgba(0, 225, 111, 0.18);
  color: #021008;
  font-size: 21px;
  font-weight: 800;
}

.eyebrow {
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

[hidden] {
  display: none !important;
}

.login-screen {
  position: fixed;
  z-index: 100;
  display: grid;
  min-height: 100dvh;
  width: 100%;
  place-items: center;
  overflow: hidden;
  padding: 28px;
  background:
    radial-gradient(circle at 50% 105%, rgba(0, 230, 112, 0.26), transparent 38rem),
    #040705;
}

.login-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(37, 245, 133, 0.14);
  filter: blur(100px);
}

.login-card {
  position: relative;
  width: min(100%, 470px);
  padding: 42px;
  border: 1px solid rgba(151, 255, 195, 0.15);
  border-radius: 30px;
  background: rgba(10, 16, 12, 0.88);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(24px);
}

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

.login-brand div {
  display: grid;
}

.login-brand strong {
  font-size: 20px;
}

.login-brand span:not(.brand-mark) {
  color: var(--muted);
}

.login-copy h1 {
  margin-top: 10px;
  font-size: clamp(32px, 7vw, 46px);
  line-height: 1.02;
}

.login-copy p {
  margin-top: 16px;
  color: var(--text-soft);
  font-size: 16px;
}

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

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

.field > span,
.compact-field > span {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.field input,
.field select,
.compact-field input,
.compact-field select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  outline: none;
  background: var(--surface-2);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field input,
.field select {
  min-height: 50px;
  padding: 0 15px;
  border-radius: 14px;
}

.compact-field input,
.compact-field select {
  min-height: 40px;
  padding: 0 32px 0 12px;
  border-radius: 12px;
}

.field input:focus,
.field select:focus,
.compact-field input:focus,
.compact-field select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.button,
.icon-button,
.nav-item,
.logout-button,
.subtabs button,
.segmented button,
.theme-choice button {
  border: 0;
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 720;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

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

.button.primary {
  background: linear-gradient(135deg, var(--green), var(--green-2));
  box-shadow: 0 10px 26px rgba(0, 220, 107, 0.12);
  color: #021008;
}

.button.ghost {
  border-color: var(--line-strong);
  background: var(--surface);
}

.button.ghost:hover {
  border-color: var(--green-line);
  background: var(--surface-hover);
}

.button.danger {
  border-color: rgba(255, 107, 115, 0.28);
  background: rgba(255, 107, 115, 0.09);
  color: var(--red);
}

.button.wide {
  width: 100%;
}

.button.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.login-note {
  min-height: 21px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 13px;
}

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

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

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 24px 18px 18px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(57, 245, 139, 0.035), transparent 22%),
    #070b08;
  color: #f2f7f3;
}

body[data-theme="light"] .sidebar {
  background: #0a0e0b;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand .brand-mark {
  width: 39px;
  height: 39px;
  border-radius: 12px;
  font-size: 18px;
}

.sidebar-brand strong {
  font-size: 24px;
}

.sidebar-brand strong span {
  color: var(--green);
}

.icon-button {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text-soft);
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.icon-button:hover {
  border-color: var(--green-line);
  background: var(--surface-hover);
  color: var(--text);
}

.sidebar-close,
.mobile-menu {
  display: none;
}

.company-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 26px 4px 22px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.055);
}

.company-avatar,
.user-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
}

.company-chip div,
.health-card div,
.user-chip div {
  display: grid;
  min-width: 0;
}

.company-chip strong,
.health-card strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.company-chip span:not(.company-avatar):not(.status-dot),
.health-card span {
  color: #8e9a92;
  font-size: 11px;
}

.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(57, 245, 139, 0.1);
}

.company-chip > .status-dot {
  margin-left: auto;
}

.main-nav {
  overflow-y: auto;
  padding: 0 4px 20px;
  scrollbar-width: none;
}

.nav-label {
  display: block;
  margin: 18px 12px 7px;
  color: #66736a;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nav-item {
  display: grid;
  width: 100%;
  min-height: 46px;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: #a7b1aa;
  text-align: left;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
}

.nav-item.active {
  border-color: rgba(57, 245, 139, 0.13);
  background: linear-gradient(90deg, rgba(57, 245, 139, 0.14), rgba(57, 245, 139, 0.045));
  color: var(--green);
}

.nav-item span {
  color: inherit;
  font-size: 13px;
  font-weight: 650;
}

.nav-item small {
  min-width: 24px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #bcc5bf;
  font-size: 9px;
  font-weight: 800;
  text-align: center;
}

.nav-item.active small {
  background: var(--green);
  color: #051009;
}

.sidebar-foot {
  margin-top: auto;
}

.health-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.logout-button {
  width: 100%;
  margin-top: 8px;
  padding: 10px;
  background: transparent;
  color: #78847c;
  font-size: 12px;
}

.logout-button:hover {
  color: #fff;
}

.sidebar-backdrop {
  display: none;
}

.main-content {
  min-height: 100dvh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 30px;
  border-bottom: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(130%);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title h1 {
  margin-top: 2px;
  font-size: 25px;
  line-height: 1.12;
}

.topbar-title p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.topbar-actions,
.user-chip,
.live-chip {
  display: flex;
  align-items: center;
}

.topbar-actions {
  gap: 10px;
}

.live-chip {
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--green-line);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.live-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.button-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 17px;
  padding: 1px 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
}

.theme-light-icon {
  display: none;
}

body[data-theme="light"] .theme-dark-icon {
  display: none;
}

body[data-theme="light"] .theme-light-icon {
  display: block;
}

.user-chip {
  gap: 9px;
  margin-left: 3px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.user-chip strong {
  max-width: 145px;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip span:not(.user-avatar) {
  color: var(--muted);
  font-size: 10px;
}

.filter-bar {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 20px 30px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.filter-heading {
  display: grid;
  min-width: 150px;
  margin-right: 4px;
}

.filter-heading > span {
  font-size: 13px;
  font-weight: 730;
}

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

.filter-bar .compact-field {
  min-width: 140px;
  flex: 1;
}

.custom-dates {
  display: flex;
  flex: 1.35;
  gap: 8px;
}

.custom-dates .compact-field {
  min-width: 120px;
}

.filter-action {
  white-space: nowrap;
}

.loading-bar {
  position: fixed;
  z-index: 60;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  height: 2px;
  overflow: hidden;
}

.loading-bar span {
  display: block;
  width: 35%;
  height: 100%;
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
  animation: loading 1s ease-in-out infinite;
}

@keyframes loading {
  from { transform: translateX(-120%); }
  to { transform: translateX(390%); }
}

.view {
  display: none;
  padding: 28px 30px 56px;
}

.view.active {
  display: block;
  animation: view-in 220ms ease both;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 34px 2px 16px;
}

.section-heading:first-child {
  margin-top: 0;
}

.section-heading h2 {
  margin-top: 4px;
  font-size: 22px;
}

.section-heading p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.section-index {
  display: inline-block;
  margin-bottom: 5px;
  color: var(--green);
  font-size: 11px;
  font-weight: 780;
  letter-spacing: 0.14em;
}

.updated-at,
.data-caption,
.drag-hint {
  color: var(--muted);
  font-size: 11px;
}

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

.metrics-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
  position: relative;
  min-height: 154px;
  overflow: visible;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: var(--green-line);
  background: var(--surface-2);
}

.metric-card:has(.metric-help[open]) {
  z-index: 20;
}

.metric-card-hit {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  cursor: pointer;
}

.metric-card-hit:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
}

.metric-card::after {
  position: absolute;
  top: -34px;
  right: -32px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--metric-color, var(--green));
  content: "";
  filter: blur(48px);
  opacity: 0.1;
  pointer-events: none;
}

.metric-card .metric-top,
.metric-card .metric-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.metric-card .metric-label {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 670;
}

.metric-card .metric-context {
  color: var(--faint);
  font-size: 10px;
}

.metric-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.metric-help {
  position: relative;
  z-index: 4;
  pointer-events: auto;
}

.metric-help summary {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-soft);
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
}

.metric-help summary::-webkit-details-marker {
  display: none;
}

.metric-help summary:hover,
.metric-help[open] summary {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green);
}

.metric-help p {
  position: absolute;
  z-index: 30;
  top: 28px;
  right: 0;
  width: min(286px, calc(100vw - 54px));
  padding: 12px 13px;
  border: 1px solid var(--green-line);
  border-radius: 12px;
  background: var(--surface-elevated, var(--surface-2));
  box-shadow: var(--shadow);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.5;
  text-align: left;
}

.metric-card .metric-value {
  position: relative;
  z-index: 2;
  display: block;
  margin: 20px 0 15px;
  font-size: clamp(32px, 3vw, 45px);
  font-weight: 760;
  letter-spacing: -0.055em;
  line-height: 0.92;
  pointer-events: none;
}

.metric-card .metric-foot {
  color: var(--muted);
  font-size: 11px;
}

.metric-card .metric-signal {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 9px;
  font-weight: 760;
}

.metric-card.warning .metric-signal {
  background: rgba(255, 184, 74, 0.1);
  color: var(--amber);
}

.metric-card.danger .metric-signal {
  background: rgba(255, 107, 115, 0.1);
  color: var(--red);
}

.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 12px;
}

.commercial-split {
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
}

.panel {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h3 {
  font-size: 16px;
}

.panel-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.funnel-list {
  display: grid;
  gap: 14px;
}

.funnel-row {
  display: grid;
  width: 100%;
  grid-template-columns: 150px minmax(120px, 1fr) 90px;
  align-items: center;
  gap: 14px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.funnel-label {
  display: grid;
}

.funnel-label strong {
  font-size: 12px;
}

.funnel-label span,
.funnel-value span {
  color: var(--muted);
  font-size: 10px;
}

.funnel-track,
.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.funnel-track span,
.bar-track span {
  display: block;
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-2), var(--green));
}

.funnel-value {
  display: grid;
  text-align: right;
}

.funnel-value strong {
  font-size: 13px;
}

.segmented {
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
}

.segmented button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.segmented button.active {
  background: var(--text);
  color: var(--bg);
}

.column-chart {
  display: flex;
  min-height: 230px;
  align-items: end;
  gap: 6px;
  padding: 18px 0 8px;
  border-bottom: 1px solid var(--line);
}

.chart-column {
  display: grid;
  min-width: 0;
  height: 200px;
  flex: 1;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.chart-column i {
  position: relative;
  display: block;
  width: 100%;
  min-height: 4px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, var(--green), var(--green-2));
  opacity: 0.72;
  transition: opacity 150ms ease, filter 150ms ease;
}

.chart-column:hover i,
.chart-column.active i {
  filter: drop-shadow(0 0 8px rgba(57, 245, 139, 0.4));
  opacity: 1;
}

.chart-column span {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-detail {
  min-height: 20px;
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 11px;
}

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

.mini-metric {
  min-height: 116px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.mini-metric span {
  color: var(--muted);
  font-size: 11px;
}

.mini-metric strong {
  display: block;
  margin-top: 13px;
  font-size: 27px;
  line-height: 1;
}

.mini-metric small {
  display: block;
  margin-top: 9px;
  color: var(--faint);
  font-size: 10px;
}

.peak-chart {
  display: grid;
  min-height: 190px;
  grid-template-columns: repeat(12, 1fr);
  align-items: end;
  gap: 7px;
  padding-top: 18px;
}

.peak-column {
  display: grid;
  height: 170px;
  grid-template-rows: 1fr auto;
  align-items: end;
  gap: 8px;
}

.peak-column i {
  display: block;
  min-height: 4px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, var(--green), rgba(0, 207, 105, 0.28));
}

.peak-column span {
  color: var(--muted);
  font-size: 8px;
  text-align: center;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.donut-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: center;
  gap: 24px;
  min-height: 220px;
}

.donut {
  display: grid;
  width: 172px;
  height: 172px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--green) 0 100%);
}

.donut::before {
  grid-area: 1 / 1;
  width: 116px;
  height: 116px;
  border-radius: 50%;
  background: var(--surface);
  content: "";
}

.donut > div {
  z-index: 1;
  display: grid;
  grid-area: 1 / 1;
  text-align: center;
}

.donut strong {
  font-size: 28px;
}

.donut span {
  color: var(--muted);
  font-size: 10px;
}

.legend-list,
.legend-row {
  display: grid;
  gap: 11px;
}

.legend-item {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 9px;
  color: var(--text-soft);
  font-size: 11px;
}

.legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--legend-color);
}

.legend-item strong {
  font-size: 11px;
}

.stacked-bar {
  display: flex;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.stacked-bar span {
  min-width: 0;
}

.legend-row {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 14px;
}

.table-panel {
  padding: 4px 18px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  padding: 15px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

td {
  color: var(--text-soft);
  font-size: 12px;
}

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

tbody tr {
  transition: background 120ms ease;
}

tbody tr:hover {
  background: var(--green-soft);
}

.table-person {
  display: grid;
}

.table-person strong {
  color: var(--text);
  font-size: 12px;
}

.table-person span {
  color: var(--muted);
  font-size: 10px;
}

.rank-badge {
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-3);
  font-size: 10px;
  font-weight: 800;
}

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

.insight-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--green-line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, var(--green-soft), transparent 65%),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.insight-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(var(--green), var(--green-2));
  content: "";
}

.insight-top,
.insight-meta,
.insight-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.insight-top span,
.maturity-badge {
  padding: 5px 8px;
  border: 1px solid var(--green-line);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 9px;
  font-weight: 730;
}

.insight-top strong {
  color: var(--red);
  font-size: 10px;
}

.insight-card h3 {
  margin-top: 14px;
  font-size: 18px;
}

.insight-card > p {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 12px;
}

.insight-meta {
  margin: 16px 0;
  padding: 12px 0;
  border-block: 1px solid var(--line);
}

.insight-meta div {
  display: grid;
  gap: 3px;
}

.insight-meta span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.insight-meta strong {
  font-size: 12px;
}

.insight-action {
  align-items: flex-end;
}

.insight-action p {
  max-width: 75%;
  color: var(--text-soft);
  font-size: 11px;
}

.opportunity-hero {
  position: relative;
  display: grid;
  min-height: 300px;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 30px;
  overflow: hidden;
  padding: 34px;
  border: 1px solid var(--green-line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 90% 20%, rgba(57, 245, 139, 0.18), transparent 24rem),
    linear-gradient(135deg, #0a120d, #0c1c12);
  box-shadow: var(--shadow);
  color: #f6faf7;
}

.opportunity-hero::after {
  position: absolute;
  right: -80px;
  bottom: -160px;
  width: 380px;
  height: 380px;
  border: 1px solid rgba(57, 245, 139, 0.13);
  border-radius: 50%;
  content: "";
}

.opportunity-hero-copy {
  position: relative;
  z-index: 1;
}

.opportunity-hero h2 {
  max-width: 720px;
  margin-top: 18px;
  font-size: clamp(28px, 4vw, 43px);
  line-height: 1.05;
}

.opportunity-hero-copy > p {
  max-width: 700px;
  margin-top: 14px;
  color: #a9b8ae;
}

.maturity-progress {
  max-width: 620px;
  margin-top: 44px;
}

.maturity-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  color: #a9b8ae;
  font-size: 11px;
}

.maturity-progress strong {
  color: var(--green);
}

.progress-track {
  height: 7px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-2), var(--green));
  box-shadow: 0 0 16px rgba(57, 245, 139, 0.42);
  transition: width 500ms ease;
}

.opportunity-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  align-content: center;
}

.opportunity-stat {
  min-height: 105px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(8px);
}

.opportunity-stat span {
  color: #95a49a;
  font-size: 10px;
}

.opportunity-stat strong {
  display: block;
  margin-top: 13px;
  font-size: 28px;
}

.subtabs {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  margin-top: 18px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  scrollbar-width: none;
}

.subtabs button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.subtabs button.active {
  background: var(--text);
  color: var(--bg);
}

.opportunity-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 28px 2px 16px;
}

.opportunity-toolbar h2 {
  font-size: 22px;
}

.opportunity-toolbar p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.toolbar-fields {
  display: flex;
  gap: 8px;
}

.toolbar-fields .compact-field {
  min-width: 180px;
}

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

.opportunity-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.opportunity-card h3 {
  margin-top: 12px;
  font-size: 20px;
}

.opportunity-card .evidence {
  margin-top: 9px;
  color: var(--text-soft);
  font-size: 12px;
}

.opportunity-card .evidence strong {
  color: var(--text);
}

.opportunity-side {
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
}

.opportunity-side span {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.opportunity-side strong {
  font-size: 13px;
}

.measurement {
  margin-top: 14px;
  padding: 13px 15px;
  border-left: 2px solid var(--green);
  background: var(--green-soft);
  color: var(--text-soft);
  font-size: 11px;
}

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

.discovery-card {
  display: grid;
  min-height: 215px;
  align-content: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0, rgba(57, 245, 139, 0.08), transparent 45%),
    var(--surface);
  box-shadow: var(--shadow-soft);
}

.discovery-card-top,
.discovery-card-foot,
.plan-step-meta,
.plan-step-results {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.discovery-card-top > strong {
  color: var(--green);
  font-size: 10px;
}

.discovery-card h3 {
  margin-top: 22px;
  font-size: 19px;
}

.discovery-card > p {
  margin-top: 9px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.55;
}

.discovery-card-foot {
  align-self: end;
  margin-top: 22px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
}

.improvement-plan {
  display: grid;
  gap: 10px;
}

.plan-step {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 19px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.plan-step-number {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--green-line);
  border-radius: 13px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.plan-step-copy {
  min-width: 0;
}

.plan-step-meta {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.plan-step-meta strong {
  color: var(--green);
}

.plan-step h3 {
  margin-top: 7px;
  font-size: 16px;
}

.plan-step-copy > p {
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.5;
}

.plan-step-results {
  justify-content: flex-start;
  margin-top: 11px;
}

.plan-step-results > span {
  display: grid;
  max-width: 340px;
  gap: 2px;
}

.plan-step-results small {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.plan-step-results strong {
  color: var(--text-soft);
  font-size: 10px;
}

.conversation-layout {
  display: grid;
  min-height: calc(100dvh - 240px);
  grid-template-columns: 300px minmax(440px, 1fr) 330px;
  gap: 12px;
}

.conversation-list-panel,
.conversation-panel,
.audit-panel {
  min-height: 660px;
}

.conversation-list-panel {
  padding: 0;
}

.conversation-list-panel .panel-head {
  display: block;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.conversation-scope {
  margin-top: 14px;
}

.conversation-scope button {
  flex: 1;
}

.conversation-scope button span {
  min-width: 17px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--surface-3);
  color: inherit;
  font-size: 8px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--muted);
}

.search-box input {
  width: 100%;
  height: 37px;
  border: 0;
  outline: 0;
  background: transparent;
}

.lead-list {
  display: grid;
  gap: 6px;
  max-height: 660px;
  overflow-y: auto;
  padding: 8px;
}

.lead-item {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.lead-item:hover,
.lead-item.active {
  border-color: var(--green-line);
  background: var(--green-soft);
}

.lead-item.excluded {
  border-color: rgba(255, 184, 74, 0.1);
}

.lead-item.excluded:hover,
.lead-item.excluded.active {
  border-color: rgba(255, 184, 74, 0.32);
  background: rgba(255, 184, 74, 0.07);
}

.excluded-mark {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 184, 74, 0.1);
  color: var(--amber);
  font-size: 8px;
  font-weight: 760;
  text-transform: uppercase;
}

.lead-item-top,
.lead-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lead-item strong {
  font-size: 12px;
}

.lead-item p {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.lead-item-foot span {
  color: var(--faint);
  font-size: 9px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 680;
}

.temperature-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
}

.temperature-dot.quente { background: var(--red); }
.temperature-dot.morna { background: var(--amber); }
.temperature-dot.fria { background: var(--blue); }

.conversation-panel {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

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

.conversation-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.conversation-head select {
  min-height: 36px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 11px;
}

.message-thread {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 22px;
  background:
    radial-gradient(circle at 40% 0, var(--green-soft), transparent 24rem),
    var(--surface-2);
}

.message {
  max-width: 78%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 15px 15px 15px 4px;
  background: var(--surface);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.08);
}

.message.out {
  align-self: flex-end;
  border-color: var(--green-line);
  border-radius: 15px 15px 4px 15px;
  background: var(--green-soft);
}

.message p {
  font-size: 12px;
  white-space: pre-wrap;
}

.message time {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
  text-align: right;
}

.window-banner {
  margin: 12px 16px 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 10px;
  font-weight: 650;
}

.window-banner.closed {
  background: rgba(255, 184, 74, 0.1);
  color: var(--amber);
}

.exclusion-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 12px 16px 0;
  padding: 12px;
  border: 1px solid rgba(255, 184, 74, 0.22);
  border-radius: 12px;
  background: rgba(255, 184, 74, 0.07);
}

.exclusion-banner strong {
  color: var(--amber);
  font-size: 11px;
}

.exclusion-banner p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.status-pill.excluded {
  background: rgba(255, 184, 74, 0.1);
  color: var(--amber);
}

.composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
}

.composer textarea {
  min-height: 70px;
  resize: vertical;
  padding: 12px;
  border-radius: 12px;
}

.composer .button {
  min-width: 92px;
  align-self: end;
}

.conversation-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 16px 14px;
}

.conversation-tools .exclude-action {
  margin-left: auto;
}

.excluded-readonly {
  margin: 0 16px 16px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
}

.excluded-readonly strong {
  font-size: 11px;
}

.excluded-readonly p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.excluded-audit .empty-icon {
  border-color: rgba(255, 184, 74, 0.24);
  background: rgba(255, 184, 74, 0.08);
  color: var(--amber);
}

.audit-panel {
  padding: 20px;
}

.audit-value {
  display: grid;
  gap: 7px;
  margin: 8px 0 14px;
  padding: 18px;
  border: 1px solid var(--green-line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0, rgba(57, 245, 139, 0.13), transparent 45%),
    var(--green-soft);
}

.audit-value span,
.audit-score-row span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audit-value strong {
  color: var(--green);
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.audit-value small {
  color: var(--text-soft);
  font-size: 10px;
  line-height: 1.45;
}

.audit-score-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  margin-bottom: 6px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.audit-score-row > div {
  display: grid;
  gap: 3px;
}

.audit-score-row > div > strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.audit-score-row > div > strong small {
  color: var(--muted);
  font-size: 10px;
}

.audit-score-row p {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.audit-block {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.audit-block span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.audit-block p {
  margin-top: 5px;
  color: var(--text-soft);
  font-size: 11px;
}

.audit-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.copy-button {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  gap: 5px;
  padding: 0 9px;
  border: 1px solid var(--green-line);
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 9px;
  font-weight: 750;
}

.copy-button .icon {
  width: 13px;
  height: 13px;
}

.audit-followup > p {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--text);
  line-height: 1.5;
}

.audit-followup > small {
  display: block;
  margin-top: 7px;
  color: var(--faint);
  font-size: 9px;
}

.empty-state {
  display: grid;
  max-width: 380px;
  margin: auto;
  place-items: center;
  padding: 28px;
  text-align: center;
}

.empty-state h3 {
  margin-top: 15px;
}

.empty-state p {
  margin: 7px 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.empty-icon {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 1px solid var(--green-line);
  border-radius: 16px;
  background: var(--green-soft);
  color: var(--green);
}

.task-list {
  display: grid;
  gap: 9px;
}

.task-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.task-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green);
}

.task-card h3 {
  font-size: 13px;
}

.task-card p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.task-actions {
  display: flex;
  gap: 7px;
}

.identity-card {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 12px;
}

.identity-avatar {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: #021008;
  font-size: 19px;
  font-weight: 800;
}

.identity-card p {
  color: var(--muted);
  font-size: 11px;
}

.identity-card .status-pill {
  margin-left: auto;
}

.diagnosis-card {
  min-height: 260px;
  border-color: var(--green-line);
  background:
    radial-gradient(circle at 100% 0, rgba(57, 245, 139, 0.12), transparent 22rem),
    var(--surface);
}

.diagnosis-brand {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--green);
  color: #031009;
  font-weight: 800;
}

.diagnosis-card h3 {
  margin-top: 24px;
}

.diagnosis-card p {
  margin-top: 12px;
  color: var(--text-soft);
  line-height: 1.65;
}

.horizontal-bars {
  display: grid;
  gap: 15px;
}

.horizontal-row {
  display: grid;
  gap: 7px;
}

.horizontal-row > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
}

.horizontal-row span {
  color: var(--muted);
}

.abc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.abc-card {
  min-height: 150px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
}

.abc-card .abc-letter {
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 800;
}

.abc-card strong {
  display: block;
  margin-top: 16px;
  font-size: 18px;
}

.abc-card span {
  color: var(--muted);
  font-size: 10px;
}

.kanban-board {
  display: flex;
  gap: 11px;
  overflow-x: auto;
  padding-bottom: 16px;
}

.kanban-column {
  width: 285px;
  min-width: 285px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--surface-2);
}

.kanban-column.drag-over {
  border-color: var(--green);
  background: var(--green-soft);
}

.kanban-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 6px 13px;
}

.kanban-column-head h3 {
  font-size: 12px;
}

.kanban-column-head span {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.kanban-cards {
  display: grid;
  min-height: 130px;
  gap: 8px;
}

.kanban-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.09);
  cursor: grab;
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card h4 {
  margin: 0;
  font-size: 12px;
}

.kanban-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.kanban-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--text-soft);
  font-size: 10px;
}

.losses-split {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
}

.status-pill {
  display: inline-flex;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-soft);
  font-size: 9px;
  font-weight: 750;
}

.status-pill.success {
  border-color: var(--green-line);
  background: var(--green-soft);
  color: var(--green);
}

.status-pill.warning {
  border-color: rgba(255, 184, 74, 0.26);
  background: rgba(255, 184, 74, 0.09);
  color: var(--amber);
}

.status-pill.danger {
  border-color: rgba(255, 107, 115, 0.25);
  background: rgba(255, 107, 115, 0.08);
  color: var(--red);
}

.alert-list {
  display: grid;
  gap: 8px;
}

.alert-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
}

.alert-item strong {
  font-size: 11px;
}

.alert-item p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

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

.settings-card {
  padding: 22px;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  border-top: 1px solid var(--line);
}

.setting-row > span {
  display: grid;
}

.setting-row strong {
  font-size: 12px;
}

.setting-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.setting-row input {
  width: 100px;
  min-height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: 0;
  background: var(--surface-2);
}

.privacy-note {
  padding: 15px;
  border: 1px solid var(--green-line);
  border-radius: 13px;
  background: var(--green-soft);
}

.privacy-note strong {
  font-size: 12px;
}

.privacy-note p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.theme-choice {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.theme-choice button {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  text-align: left;
}

.theme-choice button.active {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.theme-preview {
  display: block;
  height: 80px;
  margin-bottom: 9px;
  border-radius: 9px;
  background: #080b09;
  box-shadow: inset 18px 0 #121a15, inset 0 14px rgba(255, 255, 255, 0.04);
}

.theme-preview.light {
  background: #f4f6f4;
  box-shadow: inset 18px 0 #151a16, inset 0 14px rgba(20, 30, 23, 0.05);
}

.settings-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

.modal {
  width: min(92vw, 560px);
  max-height: 88dvh;
  overflow: auto;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.55);
  color: var(--text);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(8px);
}

.wide-modal {
  width: min(94vw, 1000px);
}

.modal-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px;
  border-bottom: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(18px);
}

.modal-head h2 {
  margin-top: 4px;
  font-size: 21px;
}

.modal-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.modal-content {
  padding: 20px;
}

.form-grid {
  display: grid;
  gap: 13px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.toast {
  position: fixed;
  z-index: 120;
  right: 24px;
  bottom: 24px;
  max-width: 380px;
  padding: 12px 15px;
  border: 1px solid var(--green-line);
  border-radius: 13px;
  background: #102319;
  box-shadow: var(--shadow);
  color: #dffbea;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast.error {
  border-color: rgba(255, 107, 115, 0.35);
  background: #2b1215;
  color: #ffdadd;
}

@media (max-width: 1280px) {
  :root {
    --sidebar-width: 244px;
  }

  .conversation-layout {
    grid-template-columns: 270px minmax(420px, 1fr);
  }

  .audit-panel {
    grid-column: 1 / -1;
    min-height: 260px;
  }

  .filter-heading {
    display: none;
  }

  .filter-bar {
    flex-wrap: wrap;
  }

  .filter-bar .compact-field {
    min-width: 170px;
  }
}

@media (max-width: 1040px) {
  .sidebar {
    width: 272px;
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  body.sidebar-open .sidebar {
    transform: none;
  }

  .sidebar-close,
  .mobile-menu {
    display: grid;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 29;
    inset: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.56);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
  }

  body.sidebar-open .sidebar-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .main-content {
    margin-left: 0;
  }

  .loading-bar {
    left: 0;
  }

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

  .dashboard-split,
  .commercial-split,
  .losses-split {
    grid-template-columns: 1fr;
  }

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

  .opportunity-hero {
    grid-template-columns: 1fr;
  }

  .conversation-layout {
    grid-template-columns: 260px minmax(400px, 1fr);
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 72px;
    padding: 10px 16px;
  }

  .topbar-title .eyebrow,
  .topbar-title p,
  .live-chip,
  .user-chip div,
  #notificationButton {
    display: none;
  }

  .topbar-title h1 {
    font-size: 20px;
  }

  .user-chip {
    padding-left: 0;
    border-left: 0;
  }

  .filter-bar {
    margin: 12px 14px 0;
    padding: 11px;
  }

  .filter-bar .compact-field,
  .custom-dates {
    min-width: calc(50% - 6px);
    flex: 1 1 calc(50% - 6px);
  }

  .custom-dates {
    flex-wrap: wrap;
  }

  .filter-action {
    flex: 1;
  }

  .view {
    padding: 22px 14px 44px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    margin-top: 28px;
  }

  .section-heading h2 {
    font-size: 20px;
  }

  .metrics-grid,
  .metrics-grid.compact,
  .mini-metrics,
  .insight-grid {
    grid-template-columns: 1fr;
  }

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

  .metric-card .metric-value {
    font-size: 39px;
  }

  .funnel-row {
    grid-template-columns: 115px minmax(80px, 1fr) 65px;
    gap: 9px;
  }

  .panel {
    padding: 16px;
  }

  .panel-head {
    flex-direction: column;
  }

  .column-chart {
    overflow-x: auto;
  }

  .chart-column {
    min-width: 30px;
  }

  .peak-chart {
    overflow-x: auto;
  }

  .peak-column {
    min-width: 22px;
  }

  .donut-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .legend-list {
    width: 100%;
  }

  .opportunity-hero {
    min-height: 0;
    padding: 25px 20px;
  }

  .opportunity-hero h2 {
    font-size: 29px;
  }

  .opportunity-stats {
    grid-template-columns: 1fr 1fr;
  }

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

  .toolbar-fields {
    flex-direction: column;
  }

  .toolbar-fields .compact-field {
    min-width: 0;
  }

  .opportunity-card {
    grid-template-columns: 1fr;
    padding: 18px;
  }

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

  .plan-step {
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: start;
    padding: 17px;
  }

  .plan-step > .button {
    grid-column: 2;
    justify-self: start;
  }

  .plan-step-results {
    align-items: flex-start;
    flex-direction: column;
  }

  .conversation-layout {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .conversation-list-panel,
  .conversation-panel,
  .audit-panel {
    min-height: 500px;
  }

  .lead-list {
    max-height: 360px;
  }

  .exclusion-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .conversation-tools .exclude-action {
    margin-left: 0;
  }

  .task-card {
    grid-template-columns: 38px 1fr;
  }

  .task-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .individual-split {
    grid-template-columns: 1fr;
  }

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

  .setting-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .setting-row input {
    width: 100%;
  }

  .login-card {
    padding: 30px 24px;
  }

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

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