:root {
  color-scheme: light;
  --bg: #f3f5fa;
  --sidebar: #ffffff;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eef1f7;
  --line: #d9deea;
  --line-soft: #e7eaf1;
  --text: #171b28;
  --muted: #687086;
  --muted-2: #959cad;
  --accent: #4d5bd4;
  --accent-bright: #4654cb;
  --accent-soft: rgba(77, 91, 212, 0.09);
  --violet: #7857b8;
  --cyan: #16859a;
  --green: #16855e;
  --amber: #a66a11;
  --red: #c93d52;
  --shadow: 0 12px 32px rgba(38, 48, 74, 0.07);
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.45;
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
svg { fill: currentColor; }

.admin-body { min-height: 100vh; }
.app-sidebar {
  position: fixed;
  z-index: 50;
  inset: 0 auto 0 0;
  width: 232px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line-soft);
  padding: 24px 18px;
  background: var(--sidebar);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 7px 38px;
}
.sidebar-logo {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  box-shadow: none;
}
.sidebar-brand strong,
.sidebar-brand small { display: block; }
.sidebar-brand strong { font-size: 0.94rem; }
.sidebar-brand small { margin-top: 2px; color: var(--muted-2); font-size: 0.63rem; }
.sidebar-nav { display: grid; gap: 5px; }
.sidebar-label {
  margin: 0 10px 8px;
  color: var(--muted-2);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.sidebar-label-secondary { margin-top: 24px; }
.sidebar-nav a {
  position: relative;
  display: flex;
  min-height: 43px;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  transition: 150ms ease;
}
.sidebar-nav a::before {
  position: absolute;
  left: -19px;
  width: 3px;
  height: 20px;
  border-radius: 0 3px 3px 0;
  background: transparent;
  content: "";
}
.sidebar-nav a:hover { background: var(--surface-2); color: var(--text); }
.sidebar-nav a.is-active {
  border-color: rgba(77, 91, 212, 0.16);
  background: var(--accent-soft);
  color: var(--accent);
}
.sidebar-nav a.is-active::before { background: var(--accent); }
.sidebar-nav svg { width: 17px; height: 17px; flex: 0 0 auto; }
.sidebar-foot {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line-soft);
  margin-top: auto;
  padding: 18px 7px 0;
}
.system-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.67rem;
}
.system-indicator i,
.status-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(39, 200, 129, 0.08);
}
.sidebar-foot form { margin: 0; }
.sidebar-foot button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 8px 0;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
  font-size: 0.72rem;
}
.sidebar-foot button:hover { color: var(--red); }
.sidebar-foot svg { width: 16px; height: 16px; }

.app-workspace { min-height: 100vh; margin-left: 232px; }
.workspace-topbar {
  position: sticky;
  z-index: 40;
  top: 0;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line-soft);
  padding: 0 34px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
}
.menu-toggle {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
}
.menu-toggle span { display: block; width: 16px; height: 1px; margin: 4px auto; background: var(--text); }
.workspace-status { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.72rem; }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.topbar-actions > a { color: var(--muted); font-size: 0.7rem; }
.topbar-actions > a:hover { color: var(--text); }
.topbar-avatar {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.7rem;
  font-weight: 700;
}
.workspace-content { width: min(1440px, 100%); margin: 0 auto; padding: 38px 34px 72px; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 9px; font-size: clamp(1.9rem, 3vw, 2.7rem); line-height: 1.05; letter-spacing: -0.04em; }
h2 { margin: 0; font-size: 0.96rem; letter-spacing: -0.015em; }
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.dashboard-heading { margin-bottom: 25px; }
.compact-heading { align-items: center; }
.eyebrow, .surface-kicker, .section-index {
  margin: 0 0 8px;
  color: var(--accent-bright);
  font-size: 0.59rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}
.page-subtitle { margin: 0; color: var(--muted); font-size: 0.8rem; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--muted); font-size: 0.72rem; }
.back-link:hover { color: var(--text); }
.heading-actions { display: flex; align-items: center; gap: 9px; }

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 9px 15px;
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 750;
  transition: 140ms ease;
}
.button:disabled { cursor: not-allowed; opacity: 0.45; }
.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
  box-shadow: 0 7px 18px rgba(77, 91, 212, 0.16);
}
.button.primary:hover { background: #3f4dc4; transform: translateY(-1px); }
.button.secondary { border-color: var(--line); background: var(--surface); color: var(--text); }
.button.secondary:hover { border-color: #aeb5c6; background: var(--surface-2); }
.button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button.danger { border-color: rgba(201, 61, 82, 0.34); background: rgba(201, 61, 82, 0.07); color: var(--red); }
.full { width: 100%; }
.text-action {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-bright);
  cursor: pointer;
  font-size: 0.67rem;
  font-weight: 700;
}
.danger-text { color: var(--red); }

.surface, .panel, .card {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  padding: 22px;
  box-shadow: var(--shadow);
}
.surface-heading, .panel-heading, .section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}
.surface-heading h2, .panel-heading h2 { font-size: 1rem; }
.surface-heading p { margin: 6px 0 0; color: var(--muted-2); font-size: 0.68rem; }
.surface-count, .counter, .chart-period {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0 9px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.65rem;
}

.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.metric-grid-simple { grid-template-columns: repeat(3, 1fr); }
.metric-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: center;
  gap: 13px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px;
  background: var(--surface);
}
.metric-card::after {
  position: absolute;
  inset: auto -25px -50px auto;
  width: 105px;
  height: 105px;
  border-radius: 50%;
  background: var(--metric-glow);
  filter: blur(14px);
  opacity: 0.14;
  content: "";
}
.metric-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--metric-border);
  border-radius: 10px;
  background: var(--metric-bg);
  color: var(--metric-color);
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}
.metric-card small, .metric-card strong { display: block; }
.metric-card small { color: var(--muted); font-size: 0.65rem; }
.metric-card strong { margin-top: 2px; font-size: 1.55rem; letter-spacing: -0.04em; }
.metric-card em { grid-column: 2; margin-top: -7px; color: var(--muted-2); font-size: 0.61rem; font-style: normal; }
.accent-indigo { --metric-color: #4654cb; --metric-bg: #f0f1ff; --metric-border: #d6dafc; --metric-glow: #6c7cff; }
.accent-violet { --metric-color: #7857b8; --metric-bg: #f5f0fc; --metric-border: #e2d7f3; --metric-glow: #b06cff; }
.accent-cyan { --metric-color: #16859a; --metric-bg: #eef9fb; --metric-border: #cdebef; --metric-glow: #32c5df; }
.accent-green { --metric-color: #16855e; --metric-bg: #edf9f4; --metric-border: #cceadd; --metric-glow: #27c881; }
.accent-red { --metric-color: #c93d52; --metric-bg: #fff1f3; --metric-border: #f1ccd2; --metric-glow: #ff5d72; }

.analytics-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(280px, 0.65fr); gap: 18px; margin-bottom: 18px; }
.chart-surface { min-width: 0; }
.organization-chart-surface { margin-bottom: 18px; }
.organization-line-chart { min-height: 220px; }
.line-chart { min-height: 250px; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid-line { stroke: #2a2d3e; stroke-width: 1; }
.chart-axis-label { fill: #60647a; font-size: 10px; }
.chart-area { fill: url("#none"); fill: rgba(108, 124, 255, 0.1); }
.chart-line { fill: none; stroke: #7181ff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 3; filter: drop-shadow(0 5px 8px rgba(108,124,255,.28)); }
.chart-dot { fill: #11131f; stroke: #8d99ff; stroke-width: 3; }
.delivery-surface { display: flex; flex-direction: column; }
.donut-chart { display: grid; place-items: center; gap: 24px; margin: auto 0; }
.donut-ring {
  position: relative;
  display: grid;
  width: 150px;
  height: 150px;
  place-items: center;
  border-radius: 50%;
}
.donut-ring::after {
  position: absolute;
  inset: 17px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  content: "";
}
.donut-ring > span { position: relative; z-index: 1; text-align: center; }
.donut-ring strong, .donut-ring small { display: block; }
.donut-ring strong { font-size: 1.6rem; }
.donut-ring small { color: var(--muted-2); font-size: 0.58rem; }
.donut-legend { display: grid; width: 100%; gap: 9px; }
.donut-legend > div { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; font-size: 0.67rem; }
.donut-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--legend-color); }
.donut-legend span { color: var(--muted); }

.dashboard-content-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.62fr); gap: 18px; margin-bottom: 18px; }
.dashboard-side-stack { display: grid; gap: 18px; }
.dark-search, .search-form {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 14px;
}
.dark-search input { padding-left: 38px; }
.dark-search > a { align-self: center; color: var(--muted); font-size: 0.64rem; }
.search-icon {
  position: absolute;
  z-index: 2;
  top: 13px;
  left: 13px;
  width: 12px;
  height: 12px;
  border: 1px solid #777c91;
  border-radius: 50%;
}
.search-icon::after { position: absolute; right: -4px; bottom: -3px; width: 5px; height: 1px; rotate: 45deg; background: #777c91; content: ""; }
.organization-list, .people-list, .lead-table, .recipient-list, .membership-list, .person-delivery-list, .target-list { border-top: 1px solid var(--line); }
.organization-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 64px 64px 10px;
  align-items: center;
  gap: 13px;
  min-height: 65px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  transition: 130ms ease;
}
.organization-row:hover { margin-inline: -8px; padding-inline: 8px; background: var(--accent-soft); }
.organization-avatar, .person-avatar, .bot-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #d7dbef;
  border-radius: 9px;
  background: #f1f2ff;
  color: var(--accent);
  font-size: 0.61rem;
  font-weight: 800;
}
.organization-info { min-width: 0; }
.organization-info strong, .organization-info small,
.organization-stat strong, .organization-stat small { display: block; }
.organization-info strong { font-size: 0.76rem; }
.organization-info small { overflow: hidden; margin-top: 3px; color: var(--muted-2); font-size: 0.62rem; text-overflow: ellipsis; white-space: nowrap; }
.organization-stat { text-align: right; }
.organization-stat strong { font-size: 0.72rem; }
.organization-stat small { color: var(--muted-2); font-size: 0.55rem; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #c3c8d3; }
.status-dot.online { background: var(--green); box-shadow: 0 0 0 4px rgba(39,200,129,.08); }
.bot-profile { display: flex; align-items: center; gap: 12px; border-block: 1px solid var(--line); padding: 15px 0; }
.bot-profile strong, .bot-profile a { display: block; }
.bot-profile strong { font-size: 0.76rem; }
.bot-profile a { margin-top: 3px; color: var(--muted); font-size: 0.65rem; }
.settings-disclosure { margin-top: 14px; color: var(--muted); font-size: 0.66rem; }
.settings-disclosure summary { cursor: pointer; }
.settings-disclosure[open] summary { margin-bottom: 12px; }
.bar-chart { display: grid; gap: 12px; }
.bar-chart-row { display: grid; grid-template-columns: 88px minmax(80px, 1fr) 24px; align-items: center; gap: 9px; font-size: 0.62rem; }
.bar-chart-row > span:first-child { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.bar-chart-track { height: 7px; overflow: hidden; border-radius: 5px; background: #292c3c; }
.bar-chart-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6979ff, #b06cff); }
.bar-chart-row strong { font-size: 0.65rem; text-align: right; }

.bottom-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.62fr); gap: 18px; }
.lead-table-head, .lead-table-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(120px, .9fr) 120px 100px;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 5px;
}
.lead-table-head { color: var(--muted-2); font-size: 0.55rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.lead-table-row { color: var(--text); font-size: 0.69rem; }
.lead-table-row:hover { background: var(--accent-soft); }
.lead-table-row strong, .lead-table-row small { display: block; }
.lead-table-row small { margin-top: 2px; color: var(--muted-2); }
.status-label {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 7px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.58rem;
  font-weight: 750;
  white-space: nowrap;
}
.status-success { border-color: #b9dfd0; background: #edf9f4; color: var(--green); }
.status-danger { border-color: #efc4cb; background: #fff1f3; color: var(--red); }
.status-warning { border-color: #ead5ac; background: #fff8e9; color: var(--amber); }
.status-muted { color: var(--muted); }
.broadcast-options { display: flex; gap: 18px; }

input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-top: 6px;
  padding: 10px 12px;
  outline: 0;
  background: var(--surface);
  color: var(--text);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(77,91,212,.09); }
textarea { resize: vertical; }
label { display: block; color: var(--text); font-size: 0.69rem; font-weight: 650; }
label small { display: block; margin-top: 5px; color: var(--muted); font-weight: 400; }
.choice { display: flex; align-items: center; gap: 7px; color: var(--muted); font-weight: 500; }
.choice input { width: auto; margin: 0; accent-color: var(--accent); }
.stack { display: grid; gap: 13px; }
.stack.compact { gap: 9px; }
.checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.alert { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 16px; padding: 11px 13px; background: var(--surface); font-size: 0.7rem; }
.alert.success { border-color: #b9dfd0; background: #edf9f4; color: var(--green); }
.alert.error { border-color: #efc4cb; background: #fff1f3; color: var(--red); }
.empty-state { padding: 36px 14px; color: var(--muted-2); text-align: center; }
.empty-state strong { display: block; color: var(--text); }
.empty-state p { margin: 5px 0 0; font-size: 0.68rem; }
.empty-state.compact { padding: 18px 8px; }
.pagination {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 14px;
}
.pagination-summary { color: var(--muted-2); font-size: .61rem; }
.pagination-pages { display: flex; align-items: center; gap: 5px; }
.pagination-pages > a,
.pagination-arrow,
.pagination-gap {
  display: inline-grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--muted);
  font-size: .64rem;
}
.pagination-pages > a:hover { border-color: var(--line); background: var(--surface-2); color: var(--text); }
.pagination-pages > a.is-active {
  border-color: rgba(77,91,212,.3);
  background: var(--accent-soft);
  color: var(--accent);
}
.pagination-arrow { border-color: var(--line) !important; background: var(--surface-2); }
.pagination-arrow.is-disabled { opacity: .35; }
.pagination-gap { min-width: 20px; color: var(--muted-2); }

/* Detail pages */
.organization-metrics, .metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.organization-metrics article, .metrics article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 15px;
  background: var(--surface);
}
.organization-metrics span, .metrics span { display: block; color: var(--muted-2); font-size: 0.58rem; letter-spacing: .06em; text-transform: uppercase; }
.organization-metrics strong, .metrics strong { display: block; overflow: hidden; margin-top: 6px; font-size: 1rem; text-overflow: ellipsis; white-space: nowrap; }
.insight-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.insight-strip article { border: 1px solid var(--line); border-radius: 10px; padding: 15px; background: var(--surface); }
.insight-strip span, .insight-strip strong, .insight-strip small { display: block; }
.insight-strip span { color: var(--muted-2); font-size: .57rem; text-transform: uppercase; }
.insight-strip strong { margin: 6px 0 3px; }
.insight-strip small { color: var(--muted); font-size: .62rem; }
.text-success { color: var(--green); }
.text-muted, .muted, .panel-note { color: var(--muted); }
.organization-grid, .detail-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, .7fr); gap: 18px; margin-bottom: 18px; }
.integration-panel pre, pre {
  overflow: auto;
  max-height: 390px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 15px;
  background: #f7f8fc;
  color: #2e3548;
  font-size: .66rem;
  line-height: 1.55;
}
.endpoint { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; margin: 16px 0 10px; background: var(--surface-2); }
.endpoint span { align-self: stretch; display: grid; place-items: center; padding: 0 11px; background: var(--accent); color: white; font-size: .58rem; font-weight: 800; }
.endpoint code { overflow-x: auto; padding: 11px; color: #353c50; font-size: .65rem; white-space: nowrap; }
.docs-link-button { margin-bottom: 10px; }
.invite-link { display: block; overflow-wrap: anywhere; border: 1px solid var(--line); border-radius: 7px; margin-top: 8px; padding: 9px; background: var(--surface-2); color: var(--muted); font-size: .59rem; }
.recipient-list { margin-top: 15px; }
.recipient-row { display: grid; grid-template-columns: 28px minmax(0,1fr) auto; align-items: center; min-height: 58px; border-bottom: 1px solid var(--line-soft); }
.recipient-row.is-disabled { opacity: .5; }
.recipient-index { color: var(--muted-2); font-size: .58rem; }
.recipient-main strong, .recipient-main small { display: block; }
.recipient-main strong { font-size: .72rem; }
.recipient-main small { margin-top: 3px; color: var(--muted-2); font-size: .6rem; }
.panel-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.history-panel, .organization-settings { margin-bottom: 18px; }
.organization-history .lead-table-head,
.organization-history .lead-table-row { grid-template-columns: minmax(150px,1.2fr) minmax(120px,.9fr) 100px 120px 120px; }
.settings-form { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 12px; }
.danger-zone { display: grid; grid-template-columns: 1fr minmax(280px,.8fr); gap: 24px; border-top: 1px solid rgba(255,93,114,.2); margin-top: 25px; padding-top: 22px; }
.danger-zone strong { color: var(--red); }
.danger-zone p { margin: 5px 0 0; color: var(--muted); font-size: .67rem; }
.danger-zone form { display: grid; gap: 8px; }
.lead-fields { margin: 0; }
.lead-fields > div { display: grid; grid-template-columns: 140px minmax(0,1fr); border-top: 1px solid var(--line); padding: 12px 0; }
.lead-fields dt { color: var(--muted); font-size: .65rem; }
.lead-fields dd { margin: 0; overflow-wrap: anywhere; font-size: .72rem; }
.target-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line-soft); padding: 12px 0; }
.target-row strong, .target-row small { display: block; }
.target-row strong { font-size: .7rem; }
.target-row small { color: var(--muted); font-size: .59rem; }
.target-error { border-left: 2px solid var(--red); padding-left: 9px; color: var(--red); font-size: .62rem; }

/* People */
.people-metrics { grid-template-columns: repeat(2, minmax(0, 220px)); }
.people-metric-grid { max-width: 560px; grid-template-columns: repeat(2, 1fr); }
.person-row { display: grid; grid-template-columns: 42px minmax(170px,.8fr) minmax(240px,1.4fr) 65px; align-items: center; gap: 13px; border-bottom: 1px solid var(--line-soft); padding: 12px 4px; color: var(--text); }
.person-row:hover { background: var(--accent-soft); }
.person-main strong, .person-main small, .person-meta strong, .person-meta small { display: block; }
.person-main strong { font-size: .72rem; }
.person-main small, .person-meta small { color: var(--muted-2); font-size: .6rem; }
.person-organizations { display: flex; flex-wrap: wrap; gap: 5px; }
.person-organizations > span { border: 1px solid rgba(77,91,212,.2); border-radius: 5px; padding: 3px 6px; background: var(--accent-soft); color: var(--accent); font-size: .58rem; }
.person-organizations > span.is-muted { border-color: var(--line); color: var(--muted); }
.person-meta { text-align: right; }
.membership-row, .person-delivery-list > a, .person-delivery-list > div { display: flex; min-height: 61px; align-items: center; justify-content: space-between; gap: 13px; border-bottom: 1px solid var(--line-soft); padding: 10px 3px; }
.membership-row strong, .membership-row small, .person-delivery-list strong, .person-delivery-list small { display: block; }
.membership-row strong, .person-delivery-list strong { font-size: .7rem; }
.membership-row small, .person-delivery-list small { margin-top: 3px; color: var(--muted); font-size: .59rem; }
.membership-actions { display: flex; align-items: center; gap: 9px; }

/* Auth */
.auth-body { min-height: 100vh; background: radial-gradient(circle at 60% 20%, rgba(77,91,212,.09), transparent 32%), var(--bg); }
.auth-layout { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px,100%); padding: 32px; }
.auth-card::before { display: block; width: 38px; height: 4px; border-radius: 4px; margin-bottom: 24px; background: linear-gradient(90deg,var(--accent),var(--violet)); content:""; }
.auth-card h1 { font-size: 1.7rem; }
.narrow { max-width: 760px; }
.form-surface { padding: 28px; }
.form-badge, .page-chip {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid rgba(108,124,255,.28);
  border-radius: 7px;
  padding: 0 9px;
  background: rgba(108,124,255,.08);
  color: var(--accent);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .06em;
}
.form-footnote { margin: 0; font-size: .64rem; text-align: center; }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .analytics-grid, .dashboard-content-grid, .bottom-grid, .organization-grid, .detail-grid { grid-template-columns: 1fr; }
  .delivery-surface { min-height: 320px; }
}
@media (max-width: 800px) {
  .app-sidebar { translate: -100% 0; transition: translate 180ms ease; }
  .sidebar-open .app-sidebar { translate: 0 0; }
  .app-workspace { margin-left: 0; }
  .menu-toggle { display: block; }
  .workspace-topbar { padding: 0 18px; }
  .workspace-content { padding: 28px 18px 60px; }
  .organization-metrics, .metrics, .insight-strip { grid-template-columns: 1fr 1fr; }
  .settings-form, .danger-zone { grid-template-columns: 1fr; }
  .person-row { grid-template-columns: 42px 1fr auto; }
  .person-organizations { grid-column: 2 / -1; }
}
@media (max-width: 560px) {
  .workspace-status span:last-child { display: none; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .page-heading .button { width: 100%; }
  .heading-actions { width: 100%; flex-wrap: wrap; }
  .metric-grid, .organization-metrics, .metrics, .insight-strip, .people-metrics { grid-template-columns: 1fr; }
  .organization-row { grid-template-columns: 38px 1fr 9px; padding: 8px 0; }
  .organization-stat { display: none; }
  .lead-table-head { display: none; }
  .lead-table-row, .organization-history .lead-table-row { grid-template-columns: 1fr auto; gap: 5px 10px; }
  .lead-table-row > span:nth-child(2), .lead-table-row > span:nth-child(3) { color: var(--muted); }
  .checkbox-grid, .panel-actions, .search-form { grid-template-columns: 1fr; }
  .person-row { grid-template-columns: 38px 1fr; }
  .person-organizations, .person-meta { grid-column: 2; text-align: left; }
  .membership-row { align-items: flex-start; flex-direction: column; }
  .membership-actions { width: 100%; justify-content: space-between; }
  .lead-fields > div { grid-template-columns: 1fr; gap: 4px; }
  .pagination { align-items: flex-start; flex-direction: column; }
  .pagination-pages { max-width: 100%; overflow-x: auto; padding-bottom: 3px; }
}

/* Angular visual language */
.sidebar-logo,
.sidebar-nav a,
.menu-toggle,
.topbar-avatar,
.button,
.surface,
.panel,
.card,
.surface-count,
.counter,
.chart-period,
.metric-card,
.metric-icon,
.organization-avatar,
.person-avatar,
.bot-avatar,
.status-label,
input,
textarea,
select,
.alert,
.organization-metrics article,
.metrics article,
.insight-strip article,
pre,
.endpoint,
.invite-link,
.form-badge,
.page-chip,
.pagination-pages > a,
.pagination-arrow {
  border-radius: 2px;
}
.metric-card::after { display: none; }
.surface, .panel, .card { box-shadow: var(--shadow); }
