:root {
  --bg: #f7f8fc;
  --bg-soft: #f1f4fb;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --panel-muted: #f8f9fd;
  --line: #dde3ef;
  --line-soft: #edf0f7;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #667085;
  --dim: #98a2b3;
  --amber: #f59e0b;
  --green: #22c55e;
  --cyan: #0ea5e9;
  --red: #ef4444;
  --violet: #6d5dfc;
  --orange: #fb923c;
  --radius: 16px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "Geist", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
}

body::before {
  content: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background: linear-gradient(180deg, #fbfcff 0%, #f5f7fc 100%);
}

body.auth-body {
  min-height: 100dvh;
}

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

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

.auth-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.auth-card {
  width: min(100%, 520px);
  padding: 26px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  font-size: 16px;
  font-weight: 520;
  letter-spacing: 0.08em;
}

.auth-intro {
  margin-bottom: 20px;
}

.auth-intro h1 {
  margin: 0;
  font-size: 38px;
  line-height: 0.98;
  letter-spacing: 0;
  font-weight: 560;
}

.auth-intro p:not(.kicker) {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel-muted);
}

.auth-tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 11px;
  color: var(--muted);
  font-weight: 500;
}

.auth-tabs a.is-active {
  color: var(--text);
  background: var(--panel);
  box-shadow: inset 0 0 0 1px rgb(109 93 252 / 0.16);
}

.auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 14px 0;
  color: var(--dim);
  font-size: 12px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
}

.auth-form {
  gap: 12px;
}

.auth-name-grid {
  gap: 12px;
  align-items: start;
}

.auth-form .field {
  position: relative;
  min-height: 71px;
  align-content: start;
}

.auth-form .field > span {
  display: block;
  min-height: 21px;
  line-height: 21px;
}

.auth-form .input {
  height: 42px;
  min-height: 42px;
  line-height: 42px;
}

.auth-form .field > :not(span):not(label):not(input):not(select):not(textarea):not(.input):not(.select):not(.textarea) {
  position: absolute !important;
  right: 13px;
  bottom: 9px;
  z-index: 2;
  margin: 0 !important;
}

.auth-note {
  margin: 0;
  font-size: 13px;
}

.auth-submit {
  width: 100%;
  margin-top: 2px;
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 28px 18px 18px;
  border-right: 1px solid var(--line-soft);
  background: rgb(255 255 255 / 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin: 0 2px 32px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-mark {
  width: 22px;
  height: 25px;
  position: relative;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border-style: solid;
}

.brand-mark::before {
  width: 19px;
  height: 19px;
  border: 3px solid var(--violet);
  border-top: 0;
  transform: rotate(45deg) translateY(-2px);
  border-radius: 2px;
}

.brand-mark::after {
  width: 7px;
  height: 7px;
  border: 2px solid var(--violet);
  border-top: 0;
  border-left: 0;
  left: 7px;
  top: 6px;
  transform: rotate(45deg);
}

.nav-stack {
  display: grid;
  gap: 10px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
}

.nav-link svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.9;
}

.nav-link.is-active,
.nav-link:hover {
  background: #eeeaff;
  color: var(--violet);
}

.nav-link.is-active {
  box-shadow: inset 0 0 0 1px rgb(109 93 252 / 0.08);
}

.side-card {
  margin-top: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 32px rgb(15 23 42 / 0.05);
}

.side-card strong {
  display: block;
  font-weight: 540;
  margin-bottom: 4px;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line-soft);
  background: rgb(255 255 255 / 0.86);
  backdrop-filter: blur(18px);
}

.topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topbar-title h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip {
  display: grid;
  gap: 1px;
  min-height: 44px;
  padding: 6px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
  line-height: 1.15;
  box-shadow: 0 10px 24px rgb(15 23 42 / 0.04);
}

.user-chip span {
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
}

.user-chip small {
  color: var(--muted);
  font-size: 11px;
}

.content {
  width: min(100% - 88px, 1480px);
  margin: 0 auto;
  padding: 40px 0 72px;
}

.content.is-loading {
  opacity: 0.58;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.kicker::before {
  content: none;
}

.page-title {
  margin: 0;
  max-width: 900px;
  font-size: 44px;
  line-height: 1.08;
  letter-spacing: 0;
  font-weight: 750;
}

.page-copy {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.page-copy svg {
  width: 16px;
  height: 16px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

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

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 16px 40px rgb(15 23 42 / 0.05);
}

.card.pad {
  padding: 20px;
}

.metric {
  min-height: 112px;
}

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

.metric strong {
  display: block;
  margin-top: 12px;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 750;
}

.subtle {
  color: var(--muted);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dim {
  color: var(--dim);
}

.accent {
  color: var(--amber);
}

.button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 10px 24px rgb(15 23 42 / 0.04);
}

.button-primary {
  border-color: rgb(109 93 252 / 0.38);
  background: linear-gradient(135deg, #7c6cff, #6d5dfc);
  color: #fff;
}

.button-warning {
  border-color: rgb(251 146 60 / 0.34);
  background: linear-gradient(135deg, #ffb36b, #fb923c);
  color: #fff;
}

.button-vk {
  border-color: rgb(0 119 255 / 0.36);
  background: rgb(0 119 255 / 0.1);
  color: var(--text);
}

.button-vk:hover {
  background: rgb(0 119 255 / 0.16);
}

.vk-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 22px;
  border-radius: 8px;
  background: #0077ff;
  color: white;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
}

.button-secondary:hover,
.icon-button:hover {
  background: #f8f9fd;
}

.button-danger {
  border-color: rgb(239 68 68 / 0.28);
  color: var(--red);
}

.icon-button {
  width: 42px;
  padding: 0;
}

.icon-button svg,
.button svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.pill,
.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #f8f9fd;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.status.good,
.pill.good {
  border-color: rgb(34 197 94 / 0.2);
  color: var(--green);
  background: #ecfdf3;
}

.status.warn,
.pill.warn {
  border-color: rgb(245 158 11 / 0.22);
  color: var(--amber);
  background: #fff7ed;
}

.status.bad,
.pill.bad {
  border-color: rgb(239 68 68 / 0.22);
  color: var(--red);
  background: #fef2f2;
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
}

.admin-content {
  width: min(100% - 48px, 1480px);
}

.admin-page-head .page-title {
  max-width: 980px;
}

.admin-kpis {
  margin-bottom: 16px;
}

.admin-metric {
  min-height: 112px;
}

.admin-metric strong {
  font-size: 32px;
}

.admin-metric small {
  display: block;
  margin-top: 10px;
}

.admin-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) repeat(4, minmax(130px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 16px;
}

.admin-table table {
  min-width: 1040px;
}

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

.admin-table strong {
  font-weight: 560;
}

.admin-directory-card {
  overflow: hidden;
}

.admin-directory {
  display: grid;
  gap: 18px;
  margin-top: 16px;
}

.admin-directory-section {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-muted);
}

.admin-directory-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-directory-heading h4 {
  margin: 3px 0 0;
  font-size: 20px;
  line-height: 1.05;
  letter-spacing: 0;
  font-weight: 560;
}

.admin-node-caption {
  display: block;
  color: var(--amber);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.admin-staff-list,
.admin-owner-grid,
.admin-client-stack {
  display: grid;
  gap: 10px;
}

.admin-staff-node,
.admin-owner-card,
.admin-client-node {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 10px 24px rgb(15 23 42 / 0.04);
}

.admin-staff-node {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
}

.admin-staff-node strong,
.admin-owner-title strong,
.admin-client-title strong {
  display: block;
  color: var(--text);
  font-weight: 560;
}

.admin-staff-node .subtle,
.admin-staff-node .dim,
.admin-owner-title .subtle,
.admin-owner-title .dim,
.admin-client-main .subtle,
.admin-client-main .dim {
  display: block;
}

.admin-staff-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.admin-avatar {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-muted);
  color: var(--text);
  font-size: 13px;
  font-weight: 560;
  letter-spacing: 0.02em;
}

.admin-avatar-accent {
  border-color: rgb(69 196 134 / 0.24);
  background: rgb(69 196 134 / 0.08);
  color: var(--green);
}

.admin-owner-card {
  display: grid;
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
}

.admin-owner-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.admin-owner-title {
  min-width: 0;
}

.admin-owner-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.admin-owner-stats span {
  display: grid;
  gap: 3px;
  padding: 10px 11px;
  border-radius: 14px;
  background: var(--panel-muted);
}

.admin-owner-stats strong {
  color: var(--text);
  font-size: 17px;
  line-height: 1;
  font-weight: 560;
}

.admin-owner-stats small {
  color: var(--muted);
  font-size: 11px;
}

.admin-client-node {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(260px, 1fr) minmax(240px, 0.78fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 12px;
  border-radius: 15px;
}

.admin-client-line {
  position: relative;
  align-self: stretch;
  min-height: 48px;
}

.admin-client-line::before,
.admin-client-line::after {
  content: "";
  position: absolute;
  background: rgb(69 196 134 / 0.42);
}

.admin-client-line::before {
  left: 9px;
  top: -14px;
  bottom: 50%;
  width: 1px;
}

.admin-client-line::after {
  left: 9px;
  top: 50%;
  width: 16px;
  height: 1px;
}

.admin-client-main,
.admin-client-facts {
  min-width: 0;
}

.admin-client-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 2px;
}

.admin-client-facts {
  display: grid;
  gap: 3px;
  color: var(--text-soft);
}

.admin-unassigned {
  border-color: rgb(239 172 61 / 0.2);
  background: #fff7ed;
}

.admin-avitologist-list {
  gap: 16px;
}

.admin-avitologist-card {
  border-color: rgb(69 196 134 / 0.16);
  background: #f0fdf4;
}

.admin-avitologist-card .admin-owner-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-unassigned .admin-client-line::before,
.admin-unassigned .admin-client-line::after {
  background: rgb(239 172 61 / 0.48);
}

.admin-empty-state {
  display: grid;
  gap: 4px;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: var(--panel-muted);
}

.admin-empty-state.compact {
  padding: 13px;
}

.admin-section {
  margin-top: 16px;
}

.admin-detail-grid {
  margin-top: 16px;
}

.admin-form {
  margin-top: 14px;
}

.admin-list-row {
  display: grid;
  gap: 7px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

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

.admin-json {
  display: block;
  max-width: 420px;
  overflow: hidden;
  color: var(--dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-form {
  display: inline-grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 520;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.sortable-th {
  padding: 0;
}

.sortable-th.is-active {
  color: var(--text);
}

.table-sort-form {
  display: block;
  margin: 0;
}

.table-sort-button {
  display: flex;
  width: 100%;
  min-height: 44px;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 13px 14px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  text-align: left;
  text-transform: inherit;
}

.table-sort-button:hover,
.table-sort-button:focus-visible {
  color: var(--text);
  background: var(--panel-muted);
  outline: 0;
}

.table-sort-button.is-active {
  color: var(--text);
}

.sort-arrow {
  color: var(--violet);
  font-size: 13px;
  line-height: 1;
}

td {
  color: var(--text-soft);
}

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

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

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

.checkline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.checkline input {
  margin-top: 3px;
  accent-color: var(--amber);
}

.field label,
.field > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  outline: none;
}

.textarea {
  min-height: 140px;
  padding: 12px 13px;
  resize: vertical;
}

.upload {
  display: grid;
  place-items: center;
  min-height: 190px;
  padding: 24px;
  border: 1px dashed rgb(109 93 252 / 0.3);
  border-radius: var(--radius);
  background: #f4f1ff;
  text-align: center;
}

.upload input {
  max-width: 260px;
}

.code {
  max-height: 520px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0f172a;
  color: #e2e8f0;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.tab.is-active {
  color: var(--text);
  border-color: rgb(109 93 252 / 0.28);
  background: #f4f1ff;
}

.state-form {
  display: inline-flex;
  margin: 0;
}

.chart-bars {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 54px;
  gap: 12px;
  align-items: center;
  color: var(--muted);
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), #9b8cff);
}

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

.stat-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1.7fr) minmax(120px, 0.6fr) auto;
  gap: 12px;
  align-items: end;
  flex: 1;
}

.stat-sync-form {
  display: flex;
  align-items: end;
}

.stat-account-card {
  margin-bottom: 16px;
}

.stat-account-grid,
.stat-mini-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.stat-account-grid {
  grid-template-columns: minmax(160px, 0.7fr) minmax(180px, 0.8fr) minmax(260px, 1.4fr);
}

.stat-account-grid span,
.stat-mini-grid span {
  display: grid;
  gap: 3px;
  padding: 12px;
  border-radius: 15px;
  background: var(--panel-muted);
  min-width: 0;
}

.stat-account-grid strong,
.stat-mini-grid strong {
  color: var(--text);
  font-weight: 540;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-account-grid small,
.stat-mini-grid small {
  color: var(--muted);
  font-size: 11px;
}

.stat-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 16px;
  margin: 16px 0;
}

.stat-chart-card {
  overflow: hidden;
}

.stat-chart-total {
  color: var(--violet);
  font-size: 36px;
  line-height: 1;
  letter-spacing: 0;
  font-weight: 540;
  white-space: nowrap;
}

.stat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 12px;
}

.stat-tab {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.stat-tab.is-active {
  color: var(--text);
  border-color: rgb(109 93 252 / 0.28);
  background: #f4f1ff;
}

.stat-chart {
  width: 100%;
  height: auto;
  display: block;
}

.stat-chart rect {
  fill: #eef2f7;
}

.stat-gridline {
  stroke: #e5eaf3;
  stroke-width: 1;
}

.stat-line {
  display: none;
  fill: none;
  stroke: var(--violet);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 12px rgb(109 93 252 / 0.16));
}

.stat-line.is-active {
  display: block;
}

.stat-labels {
  fill: var(--dim);
  font-size: 11px;
}

.stat-side-panel {
  align-self: stretch;
}

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

.stat-search {
  min-width: 260px;
}

.stat-table-wrap td strong,
.stat-table-wrap td .subtle {
  display: block;
}

.accounts-dashboard {
  display: grid;
  gap: 16px;
}

.accounts-head {
  align-items: center;
  margin-bottom: 0;
}

.accounts-head .accounts-title-row,
.accounts-head .accounts-head-actions {
  grid-area: auto;
}

.accounts-head .accounts-title-row {
  justify-self: start;
}

.accounts-head .accounts-head-actions {
  justify-self: end;
}

.accounts-dashboard .button-primary {
  border-color: var(--violet);
  background: linear-gradient(135deg, #7c3aed 0%, var(--violet) 100%);
  box-shadow: 0 16px 30px rgb(109 93 252 / 0.24);
}

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

.account-kpi {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 118px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgb(15 23 42 / 0.06);
}

.account-kpi-icon {
  display: inline-grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 14px;
}

.account-kpi-icon svg {
  width: 25px;
  height: 25px;
  stroke-width: 2;
}

.account-kpi-icon.violet {
  color: var(--violet);
  background: #eeeaff;
}

.account-kpi-icon.green {
  color: var(--green);
  background: #dcfce7;
}

.account-kpi-icon.orange {
  color: var(--orange);
  background: #ffedd5;
}

.account-kpi span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.account-kpi strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  font-weight: 750;
  letter-spacing: 0;
}

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

.account-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgb(15 23 42 / 0.06);
}

.account-card-head,
.account-title,
.account-actions,
.account-meta p,
.account-alert {
  display: flex;
  align-items: center;
}

.account-card-head {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.account-title {
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.account-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
}

.account-dot.warn,
.account-dot.tariff {
  background: var(--orange);
}

.account-dot.bad {
  background: var(--red);
}

.account-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.account-badge.good {
  color: #15803d;
  background: #dcfce7;
}

.account-badge.warn,
.account-badge.tariff {
  color: #c2410c;
  background: #ffedd5;
}

.account-badge.bad {
  color: #b91c1c;
  background: #fee2e2;
}

.account-card h3 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.16;
  font-weight: 750;
}

.account-id {
  margin: 4px 0 14px;
  color: var(--muted);
  font-weight: 600;
}

.account-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.account-fact {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 14px 18px;
  border-right: 1px solid var(--line-soft);
}

.account-fact:last-child {
  border-right: 0;
}

.account-fact span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.account-fact strong {
  overflow: hidden;
  color: var(--text);
  font-size: 20px;
  line-height: 1.1;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-alert {
  align-items: flex-start;
  gap: 12px;
  margin: 10px 0 12px;
  padding: 12px 14px;
  border: 1px solid rgb(245 158 11 / 0.22);
  border-radius: 12px;
  background: #fff7ed;
  color: #9a3412;
}

.account-alert svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 2px;
}

.account-alert p {
  margin: 0;
  font-weight: 600;
}

.account-alert small {
  display: block;
  margin-top: 5px;
  color: #9a3412;
  line-height: 1.35;
}

.account-meta {
  display: grid;
  gap: 7px;
  min-height: 54px;
}

.account-meta p {
  gap: 9px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.account-meta svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.9;
}

.account-actions {
  gap: 12px;
  margin-top: 16px;
}

.account-actions .button {
  flex: 1 1 0;
  min-width: 0;
}

.accounts-empty {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  max-width: 760px;
}

.accounts-empty-icon {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  color: var(--violet);
  background: #eeeaff;
}

.accounts-empty-icon svg {
  width: 30px;
  height: 30px;
}

.settings-dashboard {
  display: grid;
  gap: 16px;
}

.settings-dashboard > .page-head {
  margin-bottom: 0;
}

.settings-dashboard .button-primary {
  border-color: var(--violet);
  background: linear-gradient(135deg, #7c3aed 0%, var(--violet) 100%);
  box-shadow: 0 16px 30px rgb(109 93 252 / 0.24);
}

.avitologist-home {
  display: grid;
  gap: 16px;
}

.avitologist-page-head {
  margin-bottom: 0;
}

.avitologist-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 176px;
  padding: 28px;
  overflow: hidden;
  border: 1px solid rgb(109 93 252 / 0.18);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgb(109 93 252 / 0.12), rgb(14 165 233 / 0.08) 44%, rgb(255 255 255 / 0.92) 100%),
    radial-gradient(circle at 82% 16%, rgb(34 197 94 / 0.12), transparent 28%),
    #fff;
  box-shadow: 0 22px 58px rgb(15 23 42 / 0.07);
}

.avitologist-hero.empty {
  min-height: 236px;
}

.avitologist-hero.bad {
  border-color: rgb(239 68 68 / 0.18);
  background:
    linear-gradient(135deg, rgb(254 226 226 / 0.74), rgb(109 93 252 / 0.09) 48%, rgb(255 255 255 / 0.94) 100%),
    radial-gradient(circle at 82% 16%, rgb(239 68 68 / 0.1), transparent 28%),
    #fff;
}

.avitologist-hero.warn {
  border-color: rgb(251 146 60 / 0.2);
  background:
    linear-gradient(135deg, rgb(255 237 213 / 0.72), rgb(109 93 252 / 0.09) 48%, rgb(255 255 255 / 0.94) 100%),
    radial-gradient(circle at 82% 16%, rgb(251 146 60 / 0.1), transparent 28%),
    #fff;
}

.avitologist-hero.good {
  border-color: rgb(34 197 94 / 0.18);
}

.avitologist-hero h3 {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--text);
  font-size: 34px;
  line-height: 1.05;
  font-weight: 780;
  letter-spacing: 0;
}

.avitologist-hero p {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 560;
}

.avitologist-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.avitologist-hero-status {
  display: grid;
  align-content: center;
  gap: 8px;
  width: 260px;
  min-height: 142px;
  padding: 22px;
  border: 1px solid rgb(109 93 252 / 0.18);
  border-radius: 18px;
  background: rgb(255 255 255 / 0.72);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9), 0 16px 32px rgb(15 23 42 / 0.06);
}

.avitologist-hero-status strong {
  color: var(--text);
  font-size: 17px;
  line-height: 1.2;
  font-weight: 780;
}

.avitologist-hero-status span {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 620;
}

.avitologist-hero-counter {
  display: grid;
  place-items: center;
  align-content: center;
  width: 132px;
  height: 132px;
  border-radius: 18px;
  border: 1px solid rgb(109 93 252 / 0.18);
  background: rgb(255 255 255 / 0.72);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.9), 0 16px 32px rgb(15 23 42 / 0.06);
}

.avitologist-hero-counter.warn {
  color: var(--orange);
}

.avitologist-hero-counter.good {
  color: var(--green);
}

.avitologist-hero-counter strong {
  color: inherit;
  font-size: 44px;
  line-height: 1;
  font-weight: 820;
}

.avitologist-hero-counter span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.avitologist-hero-counter small {
  max-width: 108px;
  margin-top: 6px;
  color: var(--text-soft);
  font-size: 11px;
  line-height: 1.25;
  text-align: center;
  font-weight: 700;
}

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

.avitologist-stat-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 12px;
  min-height: 132px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 16px 38px rgb(15 23 42 / 0.055);
}

.avitologist-stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.avitologist-stat-card strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.avitologist-stat-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--violet);
  background: #eeeaff;
}

.avitologist-stat-card.red .avitologist-stat-icon {
  color: var(--red);
  background: #fee2e2;
}

.avitologist-stat-card.orange .avitologist-stat-icon {
  color: var(--orange);
  background: #ffedd5;
}

.avitologist-stat-card.green .avitologist-stat-icon {
  color: var(--green);
  background: #dcfce7;
}

.avitologist-stat-grid.is-placeholder .avitologist-stat-card {
  min-height: 142px;
  background: linear-gradient(180deg, #fff, #fbfcff);
  box-shadow: 0 12px 30px rgb(15 23 42 / 0.035);
}

.avitologist-stat-card.placeholder strong {
  color: var(--text-soft);
}

.avitologist-stat-card.placeholder small {
  display: block;
  max-width: 132px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 650;
}

.avitologist-stat-card.placeholder .avitologist-stat-icon {
  color: var(--muted);
  background: #f1f5f9;
}

.avitologist-stat-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.avitologist-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
  gap: 16px;
  align-items: start;
}

.avitologist-fire-card,
.avitologist-actions-card {
  padding: 24px;
}

.avitologist-fire-card h3,
.avitologist-actions-card h3 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 760;
}

.avitologist-fire-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.avitologist-fire-grid.without-critical {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.avitologist-critical-ok {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin-top: 16px;
  padding: 7px 12px;
  border: 1px solid rgb(34 197 94 / 0.18);
  border-radius: 999px;
  background: rgb(240 253 244 / 0.86);
  color: #15803d;
  font-size: 13px;
  line-height: 1;
  font-weight: 760;
}

.avitologist-critical-ok svg {
  width: 16px;
  height: 16px;
}

.avitologist-fire-list {
  min-height: 216px;
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel-muted);
}

.avitologist-fire-list.critical {
  border-color: rgb(239 68 68 / 0.16);
  background: linear-gradient(135deg, rgb(254 226 226 / 0.86), rgb(255 255 255 / 0.92));
}

.avitologist-fire-list.check {
  border-color: rgb(251 146 60 / 0.18);
  background: linear-gradient(135deg, rgb(255 237 213 / 0.82), rgb(255 255 255 / 0.92));
}

.avitologist-fire-list.recommend {
  border-color: rgb(109 93 252 / 0.16);
  background: linear-gradient(135deg, rgb(238 234 255 / 0.86), rgb(255 255 255 / 0.92));
}

.avitologist-fire-title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
}

.avitologist-fire-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--red);
}

.avitologist-fire-list.check .avitologist-fire-dot {
  background: var(--orange);
}

.avitologist-fire-list.recommend .avitologist-fire-dot {
  background: var(--violet);
}

.avitologist-fire-list ul {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--text-soft);
  font-weight: 620;
}

.avitologist-fire-list li::marker {
  color: var(--red);
}

.avitologist-fire-list.check li::marker {
  color: var(--orange);
}

.avitologist-fire-list p {
  margin: 14px 0 0;
}

.avitologist-signal-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.avitologist-signal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid rgb(255 255 255 / 0.72);
  border-radius: 12px;
  background: rgb(255 255 255 / 0.64);
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 650;
}

.avitologist-signal-row:hover {
  border-color: rgb(109 93 252 / 0.28);
  color: var(--text);
  background: #fff;
}

.avitologist-signal-row strong {
  color: var(--violet);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.avitologist-actions-card {
  display: grid;
  gap: 16px;
}

.avitologist-actions-card p {
  margin: 8px 0 0;
}

.avitologist-actions {
  display: grid;
  gap: 10px;
}

.avitologist-action {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-weight: 720;
  box-shadow: 0 12px 28px rgb(15 23 42 / 0.04);
}

.avitologist-action:hover {
  border-color: rgb(109 93 252 / 0.26);
  color: var(--violet);
  background: #f7f5ff;
}

.avitologist-action.is-disabled {
  color: var(--muted);
  background: #f8fafc;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.78;
}

.avitologist-action span small {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 620;
}

.avitologist-action svg {
  justify-self: center;
  width: 21px;
  height: 21px;
  color: var(--violet);
}

.avitologist-action span small svg {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  color: var(--muted);
}

.avitologist-empty-grid,
.avitologist-control-grid,
.avitologist-lower-grid {
  display: grid;
  gap: 16px;
}

.avitologist-empty-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  align-items: stretch;
}

.avitologist-empty-grid .avitologist-hero {
  min-height: 100%;
}

.avitologist-onboarding-card,
.avitologist-control-card,
.avitologist-account-health-card,
.avitologist-autoload-card,
.avitologist-efficiency-card,
.avitologist-events-card {
  padding: 24px;
}

.avitologist-onboarding-card {
  display: grid;
  gap: 18px;
}

.avitologist-onboarding-card h3 {
  margin: 4px 0 0;
  font-size: 22px;
}

.avitologist-onboarding-steps {
  display: grid;
  gap: 10px;
}

.avitologist-onboarding-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf1f7;
}

.avitologist-onboarding-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--violet);
}

.avitologist-onboarding-steps a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}

.avitologist-onboarding-steps a:hover {
  border-color: rgb(109 93 252 / 0.28);
  background: #f7f5ff;
}

.avitologist-setup-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.avitologist-setup-steps a {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 10px 26px rgb(15 23 42 / 0.035);
}

.avitologist-setup-steps a:hover,
.avitologist-setup-steps a.is-current {
  border-color: rgb(109 93 252 / 0.28);
  background: #f7f5ff;
}

.avitologist-setup-steps a.is-locked {
  color: var(--muted);
  background: #f8fafc;
  box-shadow: none;
  opacity: 0.72;
  pointer-events: none;
}

.avitologist-setup-steps a.is-done {
  border-color: rgb(34 197 94 / 0.18);
  background: #f8fffb;
}

.avitologist-setup-steps span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: var(--violet);
  background: #eeeaff;
  font-size: 13px;
  font-weight: 820;
}

.avitologist-setup-steps a.is-locked span {
  color: var(--muted);
  background: #f1f5f9;
}

.avitologist-setup-steps a.is-done span {
  color: var(--green);
  background: #dcfce7;
}

.avitologist-setup-steps strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 740;
}

.avitologist-onboarding-steps span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--violet);
  background: #eeeaff;
  font-size: 13px;
  font-weight: 820;
}

.avitologist-onboarding-steps strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 740;
}

.avitologist-future-list {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.avitologist-future-list li {
  position: relative;
  padding-left: 18px;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.45;
  font-weight: 650;
}

.avitologist-future-list li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--violet);
}

.avitologist-setup-card {
  min-height: 220px;
}

.avitologist-setup-card.is-compact {
  min-height: 0;
}

.avitologist-setup-card.is-compact .section-head {
  align-items: center;
}

.avitologist-setup-card.is-compact p {
  max-width: 760px;
  margin: 12px 0 0;
}

.avitologist-prereq-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: prereq;
}

.avitologist-prereq-list li {
  counter-increment: prereq;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 680;
}

.avitologist-prereq-list li::before {
  content: counter(prereq);
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: var(--muted);
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 820;
}

.avitologist-prereq-list li.is-current {
  border-color: rgb(109 93 252 / 0.28);
  color: var(--text);
  background: #f7f5ff;
}

.avitologist-prereq-list li.is-current::before {
  color: var(--violet);
  background: #eeeaff;
}

.avitologist-prereq-list li.is-locked {
  color: var(--muted);
  background: #f8fafc;
  opacity: 0.68;
}

.avitologist-prereq-list li.is-locked::before {
  color: var(--muted);
  background: #f1f5f9;
}

.avitologist-prereq-list li.is-done {
  color: var(--text-soft);
  background: #f8fffb;
  border-color: rgb(34 197 94 / 0.18);
}

.avitologist-prereq-list li.is-done::before {
  color: var(--green);
  background: #dcfce7;
}

.avitologist-control-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  align-items: start;
}

.avitologist-client-mini-table table {
  min-width: 920px;
}

.avitologist-client-mini-table th,
.avitologist-client-mini-table td {
  padding: 13px 14px;
}

.avitologist-account-health-card {
  display: grid;
  gap: 16px;
}

.avitologist-account-health-table table {
  min-width: 860px;
}

.avitologist-account-health-table td {
  vertical-align: top;
}

.avitologist-account-health-table td strong,
.avitologist-account-health-table td small {
  display: block;
}

.account-health-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  font-weight: 780;
}

.account-health-badge.ok {
  color: #15803d;
  background: #dcfce7;
}

.account-health-badge.info {
  color: #4f46e5;
  background: #eef2ff;
}

.account-health-badge.warning {
  color: #b45309;
  background: #ffedd5;
}

.account-health-badge.critical {
  color: #b91c1c;
  background: #fee2e2;
}

.avitologist-autoload-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.avitologist-autoload-summary div,
.avitologist-efficiency-metrics div {
  min-height: 92px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.avitologist-autoload-summary span,
.avitologist-efficiency-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.avitologist-autoload-summary strong,
.avitologist-efficiency-metrics strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
  font-weight: 820;
}

.avitologist-campaign-list,
.avitologist-event-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.avitologist-campaign-list a,
.avitologist-event-list a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px;
  column-gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}

.avitologist-campaign-list a {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.avitologist-campaign-list span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.avitologist-campaign-list strong,
.avitologist-event-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 760;
}

.avitologist-event-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4f46e5;
  font-size: 11px;
  line-height: 1;
  font-weight: 820;
  white-space: nowrap;
}

.avitologist-event-kind.access,
.avitologist-event-kind.account,
.avitologist-event-kind.setup {
  background: #eef2ff;
  color: #4f46e5;
}

.avitologist-event-kind.tariff,
.avitologist-event-kind.payment {
  background: #ffedd5;
  color: #b45309;
}

.avitologist-event-kind.autoload {
  background: #dcfce7;
  color: #15803d;
}

.avitologist-event-kind.import {
  background: #e0f2fe;
  color: #0369a1;
}

.avitologist-campaign-list small,
.avitologist-event-list small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.avitologist-event-list small {
  grid-column: 2;
}

.avitologist-campaign-list em {
  justify-self: end;
  padding: 5px 9px;
  border-radius: 999px;
  font-style: normal;
  font-size: 12px;
  font-weight: 760;
}

.avitologist-campaign-list em.good {
  color: #15803d;
  background: #dcfce7;
}

.avitologist-campaign-list em.warn {
  color: #b45309;
  background: #ffedd5;
}

.avitologist-campaign-list em.bad {
  color: #b91c1c;
  background: #fee2e2;
}

.avitologist-autoload-diagnostic {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgb(109 93 252 / 0.16);
  border-radius: 14px;
  background: #f7f5ff;
}

.avitologist-autoload-diagnostic strong {
  color: var(--text);
  font-size: 13px;
}

.avitologist-autoload-diagnostic span {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.35;
}

.avitologist-efficiency-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 16px;
  align-items: stretch;
  margin-top: 16px;
}

.avitologist-home-chart {
  min-height: 300px;
}

.avitologist-home-chart .analytics-chart {
  min-height: 300px;
}

.avitologist-efficiency-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.avitologist-efficiency-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.avitologist-efficiency-notes span {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 690;
}

.avitologist-efficiency-notes strong {
  color: var(--text);
}

.avitologist-lower-grid {
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.28fr);
  align-items: start;
}

.avitologist-clients-page,
.client-detail-page {
  display: grid;
  gap: 16px;
}

.avitologist-client-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.client-pipeline-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgb(255 255 255 / 0.72);
  box-shadow: 0 14px 32px rgb(15 23 42 / 0.035);
}

.client-pipeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.client-pipeline-head span {
  color: var(--text);
  font-size: 14px;
  font-weight: 780;
}

.client-pipeline-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.client-pipeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.client-pipeline article {
  min-height: 56px;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
}

.client-pipeline span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.client-pipeline strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.client-workspace-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.client-search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 520px;
  margin: 0;
}

.client-search-field {
  position: relative;
  flex: 1;
  min-width: 260px;
}

.client-search-field svg {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
  stroke-width: 1.9;
}

.client-search-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 16px 0 45px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-weight: 620;
  outline: none;
  box-shadow: 0 12px 26px rgb(15 23 42 / 0.035);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.client-search-field input:focus {
  border-color: rgb(109 93 252 / 0.52);
  box-shadow: 0 0 0 4px rgb(109 93 252 / 0.1);
}

.client-sort-form {
  margin: 0;
}

.client-sort-form label {
  display: grid;
  gap: 5px;
  min-width: 190px;
}

.client-sort-form span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 740;
}

.client-sort-form select {
  min-height: 46px;
  padding: 0 36px 0 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-weight: 680;
  outline: none;
  box-shadow: 0 12px 26px rgb(15 23 42 / 0.035);
}

.avitologist-client-filters {
  margin: 0;
}

.avitologist-client-filters .state-form {
  display: inline-flex;
  margin: 0;
}

.avitologist-client-filters .tab {
  gap: 8px;
}

.avitologist-client-filters .tab small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgb(15 23 42 / 0.06);
  font-size: 12px;
  font-weight: 760;
}

.avitologist-client-filters .tab.is-active small {
  background: rgb(255 255 255 / 0.22);
}

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

.client-work-card {
  display: grid;
  gap: 14px;
  min-height: 430px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 42px rgb(15 23 42 / 0.055);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.client-work-card:hover {
  border-color: rgb(109 93 252 / 0.32);
  transform: translateY(-2px);
  box-shadow: 0 24px 50px rgb(109 93 252 / 0.12);
}

.client-work-card:focus-visible {
  outline: 3px solid rgb(109 93 252 / 0.28);
  outline-offset: 3px;
}

.client-card-top,
.client-card-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.client-card-top strong {
  display: block;
  color: var(--text);
  font-size: 20px;
  line-height: 1.15;
  font-weight: 820;
}

.client-card-top span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 560;
}

.client-card-top small {
  display: block;
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 680;
}

.client-card-badges {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 8px;
}

.client-badge-group {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.client-badge-group small {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1;
  font-weight: 740;
}

.client-badge-group:not(.primary) .status {
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  box-shadow: none;
  font-size: 11px;
  opacity: 0.86;
}

.client-risk {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 820;
  white-space: nowrap;
}

.client-risk.good {
  color: #15803d;
  border-color: rgb(34 197 94 / 0.22);
  background: rgb(34 197 94 / 0.09);
}

.client-risk.warn {
  color: #c2410c;
  border-color: rgb(251 146 60 / 0.28);
  background: rgb(251 146 60 / 0.1);
}

.client-risk.bad {
  color: #dc2626;
  border-color: rgb(239 68 68 / 0.28);
  background: rgb(239 68 68 / 0.08);
}

.client-action-panel {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 16px 96px 16px 16px;
  border: 1px solid rgb(109 93 252 / 0.18);
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfcff 0%, #f5f3ff 100%);
  overflow: hidden;
}

.client-action-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--violet);
}

.client-action-panel.critical::before {
  background: var(--red);
}

.client-action-panel.risk::before,
.client-action-panel.check::before {
  background: var(--orange);
}

.client-action-panel span,
.client-last-event span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 740;
}

.client-action-panel strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.18;
  font-weight: 820;
}

.client-action-panel em {
  position: absolute;
  right: 14px;
  top: 50%;
  min-width: 74px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--violet);
  color: #fff;
  font-style: normal;
  font-size: 12px;
  font-weight: 780;
  transform: translateY(-50%);
}

.client-action-panel.critical em {
  background: var(--red);
}

.client-action-panel.risk em,
.client-action-panel.check em {
  background: var(--orange);
}

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

.client-card-metrics span {
  min-height: 64px;
  padding: 10px;
  border-radius: 12px;
  background: var(--panel-muted);
}

.client-card-metrics strong,
.client-card-metrics small {
  display: block;
}

.client-card-metrics strong {
  color: var(--text);
  font-size: 21px;
  line-height: 1;
  font-weight: 820;
  font-variant-numeric: tabular-nums;
}

.client-card-metrics small {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.client-next-action {
  display: grid;
  gap: 3px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfcff 0%, #f7f8ff 100%);
}

.client-next-action span,
.client-card-foot span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.client-next-action strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 780;
}

.client-health small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.client-last-event {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-muted);
}

.client-last-event.good {
  border-color: rgb(34 197 94 / 0.18);
  background: rgb(34 197 94 / 0.055);
}

.client-last-event.warn {
  border-color: rgb(251 146 60 / 0.2);
  background: rgb(251 146 60 / 0.07);
}

.client-last-event.bad {
  border-color: rgb(239 68 68 / 0.18);
  background: rgb(239 68 68 / 0.06);
}

.client-last-event strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 780;
}

.client-last-event small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.client-card-foot {
  align-items: center;
  margin-top: auto;
}

.client-card-foot strong {
  color: var(--violet);
  font-size: 13px;
  font-weight: 820;
}

.client-card-foot svg {
  width: 18px;
  height: 18px;
  color: var(--violet);
  stroke-width: 2;
}

.avitologist-clients-table table {
  min-width: 1120px;
}

.avitologist-clients-table th,
.avitologist-clients-table td {
  padding: 14px 16px;
  vertical-align: middle;
}

.client-name-link {
  color: var(--text);
  font-size: 15px;
  font-weight: 780;
}

.client-name-link:hover {
  color: var(--violet);
}

.client-health {
  display: grid;
  gap: 10px;
}

.client-health.compact {
  min-width: 150px;
}

.client-health-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.client-health-top strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  font-weight: 820;
}

.client-health-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line-soft);
}

.client-health-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--violet);
}

.client-health.good .client-health-bar span {
  background: var(--green);
}

.client-health.warn .client-health-bar span {
  background: var(--orange);
}

.client-health.bad .client-health-bar span {
  background: var(--red);
}

.avitologist-empty-card {
  padding: 24px;
}

.avitologist-empty-card h3 {
  margin: 0;
  font-size: 22px;
}

.avitologist-empty-card p {
  margin: 8px 0 0;
}

.client-onboarding-empty {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.8fr);
  gap: 24px;
  align-items: center;
  padding: 30px;
  overflow: hidden;
}

.client-empty-copy h3 {
  margin: 14px 0 0;
  font-size: 30px;
  line-height: 1.05;
  font-weight: 830;
}

.client-empty-copy p {
  max-width: 620px;
  margin: 12px 0 0;
  font-size: 15px;
}

.client-empty-copy ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.client-empty-copy li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text-soft);
  font-weight: 650;
}

.client-empty-copy li svg {
  width: 18px;
  height: 18px;
  padding: 3px;
  border-radius: 999px;
  background: rgb(34 197 94 / 0.12);
  color: var(--green);
  stroke-width: 3;
}

.client-empty-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
}

.client-wait-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  background: #f4f1ff;
  color: var(--violet);
  font-weight: 720;
}

.client-wait-pill svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
}

.client-wait-pill-primary {
  min-height: 46px;
  border: 1px solid rgb(109 93 252 / 0.38);
  background: linear-gradient(135deg, #7c6cff, #6d5dfc);
  color: #fff;
  box-shadow: 0 16px 30px rgb(109 93 252 / 0.2);
}

.client-empty-visual {
  position: relative;
  min-height: 260px;
}

.client-empty-window {
  position: absolute;
  inset: 30px 24px 34px 12px;
  z-index: 2;
  display: grid;
  align-content: center;
  justify-items: center;
  border: 1px solid rgb(109 93 252 / 0.18);
  border-radius: 24px;
  background: linear-gradient(145deg, #ffffff 0%, #f2f0ff 100%);
  box-shadow: 0 22px 48px rgb(109 93 252 / 0.14);
}

.client-empty-window span {
  position: absolute;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgb(109 93 252 / 0.28);
}

.client-empty-window span:nth-child(1) {
  left: 22px;
}

.client-empty-window span:nth-child(2) {
  left: 40px;
}

.client-empty-window span:nth-child(3) {
  left: 58px;
}

.client-empty-window strong {
  color: var(--text);
  font-size: 64px;
  line-height: 1;
  font-weight: 860;
  font-variant-numeric: tabular-nums;
}

.client-empty-window small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.client-empty-stack {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 34px rgb(15 23 42 / 0.05);
}

.client-empty-stack.one {
  inset: 0 52px auto auto;
  width: 140px;
  height: 84px;
}

.client-empty-stack.two {
  left: 0;
  right: 92px;
  bottom: 0;
  height: 88px;
}

.client-detail-tabs {
  margin: 0;
}

.client-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.8fr);
  gap: 16px;
  align-items: stretch;
}

.client-health-card,
.client-accounts-card,
.client-panel {
  padding: 24px;
}

.client-health-card h3,
.client-accounts-card h3,
.client-panel h3 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 760;
}

.client-health-card .client-health {
  margin-top: 22px;
}

.client-health-card .client-health-top strong {
  font-size: 44px;
}

.client-health-card .client-health-bar {
  height: 14px;
}

.client-health-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.client-health-reasons span {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--panel-muted);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.client-account-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.client-account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-muted);
}

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

.client-detail-kpis {
  margin-top: 0;
}

.client-detail-metric {
  min-height: 126px;
}

.analytics-kpi-icon.orange {
  color: var(--orange);
  background: linear-gradient(135deg, #ffedd5 0%, #fff7ed 100%);
}

.analytics-kpi-icon.red {
  color: var(--red);
  background: linear-gradient(135deg, #fee2e2 0%, #fff1f2 100%);
}

.client-problem-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.client-problem-list p {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 0;
  color: var(--text-soft);
  font-weight: 650;
}

.client-problem-list svg {
  width: 18px;
  height: 18px;
  color: var(--orange);
}

.client-action-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.client-action-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-muted);
}

.client-action-item svg {
  width: 18px;
  height: 18px;
  color: var(--violet);
}

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

.client-action-item span,
.client-action-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.client-detail-tabs .tab {
  gap: 8px;
}

.client-detail-tabs .tab small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgb(15 23 42 / 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

.client-detail-tabs .tab.is-active small {
  background: rgb(255 255 255 / 0.24);
  color: #fff;
}

.client-detail-focus-grid,
.client-detail-lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  gap: 16px;
  align-items: stretch;
}

.client-detail-focus,
.client-next-actions-panel,
.client-metric-group {
  padding: 24px;
}

.client-detail-focus {
  display: grid;
  gap: 18px;
  border-color: rgb(109 93 252 / 0.18);
  background:
    radial-gradient(circle at 18% 8%, rgb(109 93 252 / 0.12), transparent 32%),
    linear-gradient(145deg, #fff 0%, #f8f9ff 100%);
}

.client-detail-focus.warn {
  border-color: rgb(251 146 60 / 0.24);
  background:
    radial-gradient(circle at 18% 8%, rgb(251 146 60 / 0.13), transparent 32%),
    linear-gradient(145deg, #fff 0%, #fff9f2 100%);
}

.client-detail-focus.bad {
  border-color: rgb(239 68 68 / 0.2);
  background:
    radial-gradient(circle at 18% 8%, rgb(239 68 68 / 0.11), transparent 32%),
    linear-gradient(145deg, #fff 0%, #fff6f6 100%);
}

.client-focus-top,
.client-focus-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.client-focus-top h3,
.client-next-actions-panel h3,
.client-metric-group h3 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 800;
}

.client-focus-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.client-primary-action {
  display: grid;
  gap: 10px;
  max-width: 620px;
  padding: 20px;
  border: 1px solid rgb(109 93 252 / 0.18);
  border-radius: 18px;
  background: rgb(255 255 255 / 0.78);
  box-shadow: 0 16px 34px rgb(15 23 42 / 0.045);
}

.client-primary-action span,
.client-sync-box span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.client-primary-action strong {
  color: var(--text);
  font-size: 30px;
  line-height: 1.05;
  font-weight: 840;
}

.client-primary-action p {
  margin: -2px 0 4px;
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 650;
}

.client-primary-action .button {
  width: fit-content;
}

.client-detail-focus .client-health {
  min-width: 320px;
  flex: 1 1 auto;
}

.client-detail-focus .client-health-top strong {
  font-size: 34px;
}

.client-detail-focus .client-health-bar {
  height: 12px;
}

.client-sync-box {
  min-width: 180px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: rgb(255 255 255 / 0.72);
}

.client-sync-box strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.client-health-reasons span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.client-health-reasons span.good {
  border-color: rgb(34 197 94 / 0.16);
  background: rgb(34 197 94 / 0.065);
}

.client-health-reasons span.bad {
  border-color: rgb(251 146 60 / 0.22);
  background: rgb(251 146 60 / 0.07);
}

.client-health-reasons svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

.client-health-reasons span.good svg {
  color: var(--green);
}

.client-health-reasons span.bad svg {
  color: var(--orange);
}

.client-next-actions-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.client-next-actions-list {
  display: grid;
  gap: 10px;
}

.client-next-action-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel-muted);
  color: var(--text);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.client-next-action-row:hover {
  transform: translateY(-1px);
  border-color: rgb(109 93 252 / 0.34);
  box-shadow: 0 14px 28px rgb(15 23 42 / 0.055);
}

.client-next-action-row strong,
.client-next-action-row small {
  display: block;
}

.client-next-action-row strong {
  font-size: 14px;
  font-weight: 820;
}

.client-next-action-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.client-action-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #ede9ff;
  color: var(--violet);
  font-size: 13px;
  font-weight: 840;
  font-variant-numeric: tabular-nums;
}

.client-next-action-row.warn .client-action-index {
  background: #ffedd5;
  color: var(--orange);
}

.client-next-action-row.bad .client-action-index {
  background: #fee2e2;
  color: var(--red);
}

.client-next-action-row.good .client-action-index {
  background: rgb(34 197 94 / 0.12);
  color: var(--green);
}

.client-next-action-row > svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.client-account-readiness {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.client-account-readiness span {
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
}

.client-account-readiness strong,
.client-account-readiness small {
  display: block;
}

.client-account-readiness strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  font-weight: 840;
  font-variant-numeric: tabular-nums;
}

.client-account-readiness small {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 720;
}

.client-account-list {
  gap: 12px;
}

.client-account-item {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(150px, 0.78fr) minmax(220px, 1.05fr) minmax(150px, 0.78fr) minmax(260px, 1.1fr);
  gap: 16px;
  align-items: center;
}

.client-account-item.good {
  border-color: rgb(34 197 94 / 0.14);
  background: rgb(34 197 94 / 0.045);
}

.client-account-item.warn {
  border-color: rgb(251 146 60 / 0.2);
  background: rgb(251 146 60 / 0.06);
}

.client-account-item.bad {
  border-color: rgb(239 68 68 / 0.18);
  background: rgb(239 68 68 / 0.055);
}

.client-account-item small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.client-account-column {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.client-account-main strong,
.client-account-blocker strong,
.client-account-owner strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
  font-weight: 800;
}

.client-account-state {
  display: grid;
  justify-items: start;
  gap: 5px;
}

.client-account-state small {
  margin: 0;
}

.client-account-blocker,
.client-account-owner {
  display: grid;
  align-content: start;
  min-width: 0;
}

.client-account-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.client-account-actions .button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
}

.client-account-actions .button-primary {
  box-shadow: 0 10px 22px rgb(109 93 252 / 0.18);
}

.client-metric-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  gap: 16px;
}

.client-metric-group {
  display: grid;
  gap: 16px;
}

.client-metric-group .client-detail-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.client-metric-group .client-detail-kpis.quality {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.client-detail-metric {
  min-height: 112px;
}

.client-detail-lower-grid {
  align-items: start;
}

.client-problem-list.checklist {
  gap: 10px;
}

.client-problem-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel-muted);
  color: var(--text);
}

.client-problem-item:hover {
  border-color: rgb(109 93 252 / 0.3);
}

.client-problem-item svg {
  width: 18px;
  height: 18px;
  color: var(--violet);
}

.client-problem-item.warn svg {
  color: var(--orange);
}

.client-problem-item.bad svg {
  color: var(--red);
}

.client-problem-item.good svg {
  color: var(--green);
}

.client-problem-item strong,
.client-problem-item small {
  display: block;
}

.client-problem-item strong {
  font-size: 14px;
  font-weight: 800;
}

.client-problem-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.client-problem-item em {
  color: var(--violet);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.avitologist-autoload-page,
.autoload-campaign-page {
  display: grid;
  gap: 16px;
}

.autoload-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(132px, 1fr));
  gap: 12px;
}

.autoload-filters .field {
  margin: 0;
  min-width: 0;
}

.avitologist-autoload-table table {
  min-width: 1180px;
}

.avitologist-autoload-table th,
.avitologist-autoload-table td {
  padding: 14px 16px;
  vertical-align: middle;
}

.autoload-campaign-tabs {
  margin: 0;
}

.autoload-campaign-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-color: rgb(109 93 252 / 0.18);
  background:
    linear-gradient(135deg, rgb(109 93 252 / 0.1), rgb(255 255 255 / 0.9) 58%),
    #fff;
}

.autoload-campaign-hero h3 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 780;
}

.autoload-campaign-hero p {
  margin: 8px 0 0;
}

.autoload-geo-card {
  padding: 24px;
}

.autoload-geo-card h3 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 760;
}

.autoload-geo-card p {
  margin: 8px 0 0;
}

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

.autoload-geo-actions .button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

.autoload-city-table {
  margin-top: 18px;
}

.autoload-city-table table {
  min-width: 980px;
}

.autoload-city-table th,
.autoload-city-table td {
  padding: 13px 15px;
}

.generator-page {
  display: grid;
  gap: 16px;
}

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

.generator-entry {
  display: grid;
  gap: 10px;
  min-height: 166px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  cursor: pointer;
  box-shadow: 0 16px 38px rgb(15 23 42 / 0.05);
}

.generator-entry.is-active {
  border-color: rgb(109 93 252 / 0.28);
  background: linear-gradient(135deg, #f4f1ff 0%, #fff 100%);
}

.generator-entry input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.generator-entry-icon {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  color: var(--violet);
  background: #eeeaff;
}

.generator-entry-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.generator-entry strong {
  display: block;
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 780;
}

.generator-entry small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 620;
}

.generator-steps {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.generator-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.generator-step.is-active {
  border-color: var(--violet);
  background: #f4f1ff;
}

.generator-step span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 12px;
  font-weight: 780;
}

.generator-step.is-active span {
  background: var(--violet);
  color: #fff;
}

.generator-step strong {
  min-width: 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 720;
}

.generator-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.82fr);
  gap: 16px;
  align-items: start;
}

.generator-panel {
  padding: 24px;
}

.generator-panel h3 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 760;
}

.generator-title-panel {
  grid-column: 1 / -1;
}

.generator-base-field {
  margin-top: 16px;
}

.generator-variant-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.generator-variant,
.generator-option,
.generator-checkline,
.generator-price-mode {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-muted);
  color: var(--text-soft);
  font-weight: 650;
}

.generator-variant {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
}

.generator-variant small {
  color: var(--muted);
  font-size: 11px;
}

.generator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.generator-description-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.36fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.generator-description-blocks {
  display: grid;
  gap: 8px;
}

.generator-description-text {
  margin: 0;
}

.generator-description-text textarea {
  resize: vertical;
  min-height: 172px;
}

.generator-variable-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.generator-option-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.generator-price-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
  margin-top: 16px;
}

.generator-price-modes {
  display: grid;
  gap: 8px;
}

.generator-price-mode.is-active {
  border-color: rgb(109 93 252 / 0.28);
  color: var(--violet);
  background: #f4f1ff;
}

.generator-price-rules {
  display: grid;
  gap: 10px;
}

.generator-rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-muted);
}

.generator-rule-row strong {
  color: var(--violet);
}

.generator-preview-panel {
  grid-row: span 2;
}

.generator-preview {
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel-muted);
}

.generator-preview-photo {
  display: grid;
  place-items: center;
  min-height: 118px;
  border-radius: 12px;
  color: var(--violet);
  background: linear-gradient(135deg, #eeeaff 0%, #eff6ff 100%);
}

.generator-preview-photo svg {
  width: 34px;
  height: 34px;
}

.generator-preview h4 {
  margin: 0;
  color: var(--text);
  font-size: 19px;
  line-height: 1.2;
}

.generator-preview p {
  margin: 8px 0 12px;
  color: var(--text-soft);
  font-weight: 560;
}

.generator-preview strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
}

.templates-page {
  display: grid;
  gap: 16px;
}

.templates-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
  border-color: rgb(109 93 252 / 0.18);
  background:
    radial-gradient(circle at 90% 14%, rgb(109 93 252 / 0.14), transparent 28%),
    linear-gradient(135deg, rgb(244 241 255 / 0.94), rgb(255 255 255 / 0.98) 62%),
    #fff;
}

.templates-hero h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1.12;
  font-weight: 780;
}

.templates-hero p {
  max-width: 780px;
  margin: 10px 0 0;
}

.templates-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

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

.template-type-card {
  min-height: 190px;
  padding: 16px;
}

.template-type-icon,
.template-card-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  color: var(--violet);
  background: #eeeaff;
}

.template-type-icon svg,
.template-card-icon svg {
  width: 21px;
  height: 21px;
}

.template-type-card span,
.template-type-card strong,
.template-type-card p {
  display: block;
}

.template-type-card span {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 720;
}

.template-type-card strong {
  margin-top: 8px;
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  font-weight: 800;
}

.template-type-card p {
  margin: 10px 0 0;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 560;
}

.template-builder {
  padding: 24px;
}

.template-builder-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 18px;
}

.template-builder-grid .field {
  margin: 0;
}

.template-builder-grid .select:disabled,
.template-builder-grid .button:disabled,
.template-card-actions .button:disabled,
.templates-hero-actions .button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.template-library-section {
  display: grid;
  gap: 14px;
}

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

.template-library-card {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.template-card-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.template-card-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 21px;
  line-height: 1.16;
  font-weight: 780;
}

.template-card-head p {
  margin: 6px 0 0;
}

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

.template-card-stats span {
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-muted);
}

.template-card-stats strong,
.template-card-stats small {
  display: block;
}

.template-card-stats strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.15;
  font-weight: 760;
}

.template-card-stats small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.template-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-card-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--violet);
  background: #f4f1ff;
  font-size: 12px;
  font-weight: 720;
}

.template-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tasks-page {
  display: grid;
  gap: 16px;
}

.tasks-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  padding: 26px;
  border-color: rgb(109 93 252 / 0.18);
  background:
    radial-gradient(circle at 88% 12%, rgb(109 93 252 / 0.14), transparent 28%),
    linear-gradient(135deg, rgb(109 93 252 / 0.1), rgb(255 255 255 / 0.94) 58%),
    #fff;
}

.tasks-hero h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1.12;
  font-weight: 780;
}

.tasks-hero p {
  max-width: 720px;
  margin: 10px 0 0;
}

.tasks-hero-count {
  display: grid;
  place-items: center;
  min-width: 132px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid rgb(109 93 252 / 0.2);
  border-radius: 18px;
  background: #f4f1ff;
  color: var(--violet);
  text-align: center;
}

.tasks-hero-count strong,
.tasks-hero-count span {
  display: block;
}

.tasks-hero-count strong {
  color: var(--text);
  font-size: 38px;
  line-height: 1;
  font-weight: 820;
}

.tasks-hero-count span {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 720;
}

.tasks-mass-fix {
  padding: 24px;
}

.mass-fix-body {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) 170px minmax(220px, 0.8fr) auto;
  gap: 12px;
  align-items: end;
  margin-top: 18px;
}

.mass-fix-fact {
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel-muted);
}

.mass-fix-fact span,
.mass-fix-fact strong {
  display: block;
}

.mass-fix-fact span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.mass-fix-fact strong {
  margin-top: 6px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.3;
  font-weight: 760;
}

.mass-fix-field {
  margin: 0;
}

.tasks-mass-fix .button:disabled,
.mass-fix-field .select:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

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

.task-group-card {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 236px;
  padding: 22px;
}

.task-group-card.critical {
  border-color: rgb(239 68 68 / 0.18);
}

.task-group-card.warning {
  border-color: rgb(245 158 11 / 0.18);
}

.task-group-head {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.task-group-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.16;
  font-weight: 780;
}

.task-group-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  color: var(--violet);
  background: #eeeaff;
}

.task-group-card.critical .task-group-icon {
  color: #ef4444;
  background: #fff1f2;
}

.task-group-card.warning .task-group-icon {
  color: #f59e0b;
  background: #fff7ed;
}

.task-group-icon svg {
  width: 21px;
  height: 21px;
  stroke-width: 2;
}

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

.task-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel-muted);
  color: var(--text);
  text-decoration: none;
}

.task-row:hover {
  border-color: rgb(109 93 252 / 0.28);
  background: #fff;
  box-shadow: 0 16px 32px rgb(15 23 42 / 0.06);
}

.task-row-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  color: var(--violet);
  background: #eeeaff;
}

.task-row.is-critical .task-row-icon {
  color: #ef4444;
  background: #fff1f2;
}

.task-row.is-warning .task-row-icon {
  color: #f59e0b;
  background: #fff7ed;
}

.task-row-icon svg {
  width: 18px;
  height: 18px;
}

.task-row-body {
  min-width: 0;
}

.task-row-body strong,
.task-row-body small {
  display: block;
}

.task-row-body strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 760;
}

.task-row-body small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 620;
}

.task-empty {
  min-height: 92px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.avitologist-analytics-page {
  display: grid;
  gap: 16px;
}

.avitologist-analytics-head {
  margin-bottom: 0;
}

.avitologist-analytics-filters {
  grid-template-columns: minmax(180px, 240px);
}

.avitologist-analytics-hero {
  margin-top: 0;
}

.avitologist-analytics-kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.avitologist-analytics-kpi {
  min-height: 138px;
  padding-top: 22px;
}

.avitologist-analytics-kpi > strong {
  font-size: 25px;
}

.avitologist-analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.avitologist-analytics-panel {
  min-width: 0;
}

.avitologist-analytics-panel h3 {
  margin: 0;
}

.avitologist-analytics-table {
  margin-top: 12px;
}

.avitologist-analytics-table table {
  min-width: 980px;
}

.avitologist-analytics-table th,
.avitologist-analytics-table td {
  padding: 13px 15px;
  vertical-align: middle;
}

.avitologist-analytics-table .status {
  white-space: nowrap;
}

.profile-dashboard {
  display: grid;
  gap: 18px;
}

.profile-head {
  margin-bottom: 0;
}

.overview-head {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
  align-items: center;
}

.overview-head .overview-title-row {
  grid-area: auto;
  justify-self: start;
}

.overview-head .overview-filters {
  grid-area: auto;
  justify-self: end;
}

.overview-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  align-items: end;
  gap: 12px;
  width: min(100%, 520px);
}

.overview-filters .field {
  margin: 0;
}

.overview-dashboard .overview-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.overview-kpi-card {
  min-height: 154px;
}

.overview-attention {
  padding: 24px;
  border-radius: 18px;
}

.overview-issue-list,
.overview-account-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.overview-issue,
.overview-account-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 38px;
  color: var(--text-soft);
  font-weight: 600;
}

.overview-issue svg {
  width: 16px;
  height: 16px;
  color: var(--orange);
}

.overview-account-row {
  grid-template-columns: 10px minmax(120px, 1fr) auto;
  border-bottom: 1px solid var(--line-soft);
}

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

.overview-account-row strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-account-row span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.analytics-page-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(520px, 760px);
  grid-template-areas:
    "title filters"
    "tabs filters";
  align-items: end;
  gap: 18px;
  margin-bottom: 14px;
}

.analytics-page-title-row {
  grid-area: title;
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 0 0 auto;
  min-width: 0;
}

.analytics-page-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border: 1px solid rgb(109 93 252 / 0.2);
  border-radius: 12px;
  background: linear-gradient(135deg, #f6f1ff 0%, #eef4ff 100%);
  color: var(--violet);
  box-shadow: 0 16px 36px rgb(109 93 252 / 0.12);
}

.analytics-page-icon svg {
  width: 32px;
  height: 32px;
  stroke-width: 1.8;
}

.analytics-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(132px, 1fr));
  align-items: end;
  gap: 12px;
  margin: 0;
}

.analytics-page-head .analytics-section-tabs {
  grid-area: tabs;
  margin: 0;
}

.analytics-page-head .analytics-filters {
  grid-area: filters;
  width: 100%;
  max-width: 760px;
  justify-self: end;
}

.analytics-filters-compact {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgb(255 255 255 / 0.82);
  box-shadow: 0 18px 46px rgb(15 23 42 / 0.05);
}

.analytics-filters .field {
  min-width: 0;
  margin: 0;
}

.analytics-filters-compact .field {
  gap: 6px;
}

.analytics-filters-compact .select {
  min-height: 44px;
}

.analytics-filters-compact .button {
  min-height: 44px;
  white-space: nowrap;
}

.analytics-kpi-block {
  margin-top: 14px;
}

.analytics-kpi-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.analytics-kpi-head h3 {
  margin: 0;
  font-size: 18px;
}

.analytics-secondary-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.analytics-secondary-metric {
  position: relative;
  min-height: 122px;
  padding: 18px 62px 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 16px 38px rgb(15 23 42 / 0.04);
}

.analytics-secondary-metric > span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.analytics-secondary-metric strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.06;
  font-weight: 750;
}

.analytics-secondary-metric small {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  line-height: 1;
}

.analytics-secondary-metric small .status {
  min-width: 74px;
  min-height: 30px;
  padding: 0 12px;
}

.analytics-secondary-metric small .subtle {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
}

.analytics-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.analytics-kpi-card {
  position: relative;
  min-height: 154px;
  padding: 24px 74px 18px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgb(15 23 42 / 0.06);
}

.analytics-kpi-card > span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.analytics-kpi-card > strong {
  display: block;
  margin-top: 14px;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
  font-weight: 780;
}

.analytics-kpi-card > small {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  line-height: 1;
}

.analytics-kpi-card > small .status {
  min-height: 30px;
  padding: 0 12px;
}

.analytics-kpi-card > small .subtle {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
}

.analytics-kpi-icon,
.analytics-secondary-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 13px;
}

.analytics-secondary-icon {
  width: 44px;
  height: 44px;
}

.analytics-kpi-icon svg,
.analytics-secondary-icon svg {
  width: 23px;
  height: 23px;
  stroke-width: 1.9;
}

.analytics-kpi-icon.violet,
.analytics-secondary-icon.violet {
  color: var(--violet);
  background: linear-gradient(135deg, #efe9ff 0%, #f7f2ff 100%);
}

.analytics-kpi-icon.green,
.analytics-secondary-icon.green {
  color: #16a34a;
  background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
}

.analytics-kpi-icon.blue,
.analytics-secondary-icon.blue {
  color: #2563eb;
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
}

.analytics-kpi-icon.pink,
.analytics-secondary-icon.pink {
  color: #ec4899;
  background: linear-gradient(135deg, #fce7f3 0%, #fff1f8 100%);
}

.analytics-insight {
  margin-top: 14px;
}

.analytics-hero {
  position: relative;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 24px;
  min-height: 250px;
  padding: 32px;
  overflow: hidden;
  border: 1px solid rgb(109 93 252 / 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgb(245 239 255 / 0.98) 0%, rgb(238 244 255 / 0.96) 55%, #ffffff 100%);
  box-shadow: 0 24px 70px rgb(109 93 252 / 0.13);
}

.analytics-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 62%, rgb(255 255 255 / 0.5) 62% 72%, transparent 72%),
    linear-gradient(150deg, transparent 0 70%, rgb(109 93 252 / 0.08) 70% 100%);
  pointer-events: none;
}

.analytics-expense-insight {
  border-color: rgb(249 115 22 / 0.16);
  background:
    linear-gradient(135deg, rgb(255 250 245 / 0.98) 0%, rgb(246 242 255 / 0.96) 56%, #ffffff 100%);
  box-shadow: 0 24px 70px rgb(109 93 252 / 0.11);
}

.analytics-expense-insight::after {
  background:
    linear-gradient(120deg, transparent 0 58%, rgb(255 255 255 / 0.58) 58% 67%, transparent 67%),
    repeating-linear-gradient(135deg, rgb(249 115 22 / 0.07) 0 1px, transparent 1px 28px),
    linear-gradient(150deg, transparent 0 72%, rgb(109 93 252 / 0.07) 72% 100%);
}

.analytics-hero-content,
.analytics-hero-visual {
  position: relative;
  z-index: 1;
}

.analytics-hero-content {
  align-self: center;
}

.analytics-hero h3 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1.18;
  font-weight: 780;
}

.analytics-hero p {
  max-width: 860px;
  margin: 18px 0 0;
  color: var(--text-soft);
  font-weight: 550;
}

.analytics-hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 18px;
}

.analytics-hero-metric {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
}

.analytics-hero-metric svg {
  width: 17px;
  height: 17px;
  color: var(--violet);
}

.analytics-hero-metric strong {
  color: var(--text);
}

.analytics-hero-visual {
  display: grid;
  place-items: center;
  min-height: 180px;
  perspective: 800px;
}

.analytics-hero-image {
  display: block;
  width: min(220px, 100%);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 24px 34px rgb(109 93 252 / 0.18));
}

.analytics-hero-board {
  position: relative;
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
  border: 1px solid rgb(109 93 252 / 0.22);
  border-radius: 20px;
  background: linear-gradient(145deg, #ffffff 0%, #eee8ff 100%);
  color: var(--violet);
  box-shadow: 0 28px 44px rgb(109 93 252 / 0.24);
  transform: rotateY(-20deg) rotateX(10deg);
}

.analytics-hero-board svg {
  width: 64px;
  height: 64px;
  stroke-width: 1.55;
}

.analytics-hero-board .hero-line {
  position: absolute;
  left: 24px;
  right: 24px;
  height: 7px;
  border-radius: 999px;
  background: rgb(109 93 252 / 0.12);
}

.hero-line-one {
  top: 22px;
}

.hero-line-two {
  bottom: 30px;
}

.hero-line-three {
  bottom: 48px;
  right: 54px;
}

.analytics-hero-cube {
  position: absolute;
  border: 1px solid rgb(109 93 252 / 0.18);
  border-radius: 14px;
  background: linear-gradient(145deg, #7c6dfd 0%, #d8ceff 100%);
  box-shadow: 0 18px 32px rgb(109 93 252 / 0.22);
}

.cube-large {
  width: 78px;
  height: 78px;
  left: 16px;
  bottom: 22px;
  transform: rotate(-8deg);
}

.cube-small {
  width: 46px;
  height: 46px;
  right: 26px;
  bottom: 42px;
  background: linear-gradient(145deg, #60a5fa 0%, #ddd6fe 100%);
}

.analytics-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0 14px;
}

.analytics-section-tabs .tab {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  font-weight: 650;
}

.analytics-section-tabs .tab.is-active {
  color: #fff;
  border-color: var(--violet);
  background: linear-gradient(135deg, #7c3aed 0%, var(--violet) 100%);
  box-shadow: 0 16px 30px rgb(109 93 252 / 0.24);
}

.analytics-attention {
  margin-top: 14px;
  border-radius: 18px;
}

.analytics-attention-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.analytics-attention-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.analytics-attention-grid > div {
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--panel-muted);
}

.analytics-attention-card.critical {
  border-color: rgb(239 68 68 / 0.08);
  background: linear-gradient(135deg, #fff1f4 0%, #fff8fb 100%);
}

.analytics-attention-card.check {
  border-color: rgb(245 158 11 / 0.1);
  background: linear-gradient(135deg, #fff8ed 0%, #fffaf5 100%);
}

.analytics-attention-card.recommend {
  border-color: rgb(109 93 252 / 0.12);
  background: linear-gradient(135deg, #f7f2ff 0%, #fbf9ff 100%);
}

.analytics-attention-grid h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--text);
  font-size: 14px;
}

.analytics-attention-grid h4 svg {
  width: 16px;
  height: 16px;
}

.analytics-attention-card.critical h4 svg {
  color: var(--red);
}

.analytics-attention-card.check h4 svg {
  color: var(--amber);
}

.analytics-attention-card.recommend h4 svg {
  color: var(--violet);
}

.analytics-attention-grid ul,
.analytics-attention-grid ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
}

.analytics-chart-card {
  margin-top: 14px;
  border-radius: 18px;
}

.analytics-chart-shell {
  width: 100%;
  min-width: 0;
  margin-top: 16px;
  overflow-x: auto;
  overflow-y: hidden;
}

.analytics-chart {
  display: block;
  width: 100%;
  min-width: 0;
  height: clamp(240px, 22vw, 360px);
  max-height: none;
}

.analytics-chart-card .tabs {
  margin-top: 18px;
  margin-bottom: 0;
}

.analytics-chart-card .tab {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
}

.analytics-chart-card .tab.is-active {
  color: var(--violet);
  border-color: rgb(109 93 252 / 0.34);
  background: #f4f1ff;
}

.analytics-expenses {
  display: grid;
  gap: 16px;
}

.analytics-expenses > .analytics-insight:first-child {
  margin-top: 0;
}

.analytics-expense-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.analytics-expense-kpi {
  position: relative;
  min-height: 154px;
  padding: 24px 74px 18px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 18px 44px rgb(15 23 42 / 0.06);
}

.analytics-expense-kpi-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 13px;
}

.analytics-expense-kpi-icon svg {
  width: 23px;
  height: 23px;
  stroke-width: 1.9;
}

.analytics-expense-kpi-icon.violet {
  color: var(--violet);
  background: linear-gradient(135deg, #efe9ff 0%, #f7f2ff 100%);
}

.analytics-expense-kpi-icon.green {
  color: #16a34a;
  background: linear-gradient(135deg, #dcfce7 0%, #f0fdf4 100%);
}

.analytics-expense-kpi > span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.analytics-expense-kpi strong {
  display: block;
  margin-top: 14px;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
  font-weight: 780;
}

.analytics-expense-kpi small {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
  line-height: 1;
}

.analytics-expense-kpi small .status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  line-height: 1;
}

.analytics-expense-kpi small .subtle {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
}

.analytics-expense-notes {
  display: grid;
  margin-top: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
}

.analytics-expense-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: 0;
  padding: 18px;
  color: var(--text-soft);
}

.analytics-expense-note + .analytics-expense-note {
  border-top: 1px solid var(--line-soft);
}

.analytics-expense-note-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
}

.analytics-expense-note-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.analytics-expense-note.good .analytics-expense-note-icon {
  color: #16a34a;
  background: #dcfce7;
}

.analytics-expense-note.warn .analytics-expense-note-icon {
  color: var(--amber);
  background: #fff7ed;
}

.analytics-expense-notes strong {
  display: block;
  color: var(--text);
}

.analytics-expense-notes small {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.4;
}

.analytics-expense-table-card {
  margin-top: 0;
}

.analytics-expense-day {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.analytics-expense-day svg {
  width: 17px;
  height: 17px;
  color: var(--violet);
  stroke-width: 1.9;
}

.analytics-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 16px;
  margin-top: 16px;
}

.analytics-workbench-single {
  grid-template-columns: minmax(0, 1fr);
}

.analytics-table-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.analytics-items-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  gap: 14px;
  align-items: end;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-muted);
}

.analytics-items-search {
  margin: 0;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.analytics-item-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-empty-message {
  padding: 14px;
  border-top: 1px solid var(--line-soft);
}

.analytics-city-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.analytics-city-summary > div {
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-muted);
}

.analytics-city-summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.analytics-city-summary strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  line-height: 1.35;
}

.analytics-city-empty-group {
  margin-top: 16px;
  border: 1px solid rgb(109 93 252 / 0.18);
  border-radius: 12px;
  background: rgb(109 93 252 / 0.035);
  box-shadow: 0 12px 28px rgb(15 23 42 / 0.035);
}

.analytics-city-empty-group > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 72px;
  padding: 14px 16px;
  color: var(--text-soft);
  cursor: pointer;
  list-style: none;
  transition:
    background 0.16s ease,
    border-color 0.16s ease;
}

.analytics-city-empty-group > summary:hover {
  background: rgb(109 93 252 / 0.055);
}

.analytics-city-empty-group > summary:focus-visible {
  outline: 3px solid rgb(109 93 252 / 0.2);
  outline-offset: 3px;
}

.analytics-city-empty-group > summary::-webkit-details-marker {
  display: none;
}

.city-empty-copy {
  display: grid;
  gap: 4px;
}

.city-empty-copy strong {
  color: var(--text);
  font-weight: 700;
}

.city-empty-copy small {
  color: var(--muted);
  font-size: 13px;
}

.city-empty-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgb(109 93 252 / 0.22);
  border-radius: 8px;
  background: var(--panel);
  color: var(--violet);
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgb(109 93 252 / 0.08);
}

.city-empty-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgb(109 93 252 / 0.1);
  font-size: 12px;
}

.city-empty-action svg {
  width: 16px;
  height: 16px;
  transition: transform 0.16s ease;
}

.city-empty-action .when-open {
  display: none;
}

.analytics-city-empty-group[open] .city-empty-action .when-open {
  display: inline;
}

.analytics-city-empty-group[open] .city-empty-action .when-closed {
  display: none;
}

.analytics-city-empty-group[open] .city-empty-action svg {
  transform: rotate(180deg);
}

.analytics-city-empty-group .table-wrap {
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0 0 12px 12px;
}

.analytics-problem-groups {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.problem-group {
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel-muted);
}

.problem-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
}

.problem-group summary::-webkit-details-marker {
  display: none;
}

.problem-group strong {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.problem-group-list {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}

.problem-item {
  display: grid;
  gap: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.problem-item span {
  color: var(--text);
  font-weight: 600;
}

.problem-item small {
  color: var(--muted);
}

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

.profile-kpi {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 112px;
  padding: 22px 26px;
  border-radius: 10px;
}

.profile-kpi-icon {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: var(--violet);
  background: #eeeaff;
}

.profile-kpi-icon svg {
  width: 26px;
  height: 26px;
  stroke-width: 2;
}

.profile-kpi span,
.profile-info-row small,
.profile-listing-row span,
.profile-period span,
.profile-efficiency-tile span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.profile-kpi strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  font-weight: 760;
}

.profile-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 16px;
}

.profile-panel,
.profile-efficiency,
.profile-tech {
  padding: 24px;
  border-radius: 10px;
}

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

.profile-panel-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.2;
  font-weight: 750;
}

.profile-client-body {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  margin-top: 26px;
}

.profile-avatar {
  display: inline-grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  border: 1px solid rgb(109 93 252 / 0.14);
  color: var(--violet);
  background: #eeeaff;
}

.profile-avatar svg {
  width: 44px;
  height: 44px;
  stroke-width: 1.9;
}

.profile-client-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.profile-client-title h3 {
  margin: 0;
  color: var(--text);
  font-size: 24px;
  line-height: 1.1;
  font-weight: 760;
}

.profile-info-list {
  display: grid;
  gap: 13px;
}

.profile-info-row {
  display: grid;
  grid-template-columns: 18px 84px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.profile-info-row svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.profile-info-row span,
.profile-info-row a {
  overflow: hidden;
  color: var(--text-soft);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-info-row a {
  color: var(--violet);
}

.profile-listings {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
  align-items: center;
  margin-top: 22px;
}

.profile-donut {
  display: grid;
  place-items: center;
  width: 150px;
  aspect-ratio: 1;
  border-radius: 999px;
  background:
    radial-gradient(circle, #fff 0 54%, transparent 55%),
    conic-gradient(var(--violet) var(--profile-progress), #d8ccff 0 74%, #efeafe 0);
}

.profile-donut > div {
  display: grid;
  place-items: center;
  gap: 2px;
}

.profile-donut strong {
  color: var(--text);
  font-size: 34px;
  line-height: 1;
  font-weight: 760;
}

.profile-donut span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.profile-listing-stats {
  display: grid;
  gap: 2px;
}

.profile-listing-row,
.profile-period {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border-bottom: 1px solid var(--line-soft);
}

.profile-listing-row span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.profile-listing-row i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--violet);
}

.profile-listing-row i.violet-soft {
  opacity: 0.72;
}

.profile-listing-row i.violet-faint {
  opacity: 0.38;
}

.profile-listing-row strong,
.profile-period strong {
  color: var(--text);
  font-size: 19px;
  font-weight: 760;
}

.profile-period {
  grid-template-columns: auto minmax(0, 1fr) auto;
  border-bottom: 0;
}

.profile-period strong {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.profile-period svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.profile-efficiency {
  display: grid;
  gap: 18px;
}

.profile-efficiency .tabs {
  margin: 0;
}

.profile-efficiency-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.95fr);
  gap: 22px;
  align-items: stretch;
}

.profile-chart-wrap {
  display: grid;
  align-content: space-between;
  gap: 14px;
  min-width: 0;
}

.profile-chart {
  display: block;
  width: 100%;
  height: auto;
}

.profile-chart-grid line {
  stroke: var(--line-soft);
  stroke-width: 1;
}

.profile-chart-area {
  fill: url(#profileChartFill);
}

.profile-chart-line {
  fill: none;
  stroke: var(--violet);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.profile-chart-points {
  fill: var(--violet);
}

.profile-chart-labels {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.profile-chart-empty {
  display: grid;
  place-items: center;
  min-height: 210px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--panel-muted);
  color: var(--muted);
  text-align: center;
}

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

.profile-efficiency-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 12px;
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.profile-efficiency-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  color: var(--violet);
  background: #eeeaff;
}

.profile-efficiency-icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.profile-efficiency-tile strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  font-weight: 760;
}

.profile-efficiency-tile small {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.profile-tech {
  margin-top: 0;
}

.profile-tech > summary {
  cursor: pointer;
  list-style: none;
}

.profile-tech > summary::-webkit-details-marker {
  display: none;
}

.mobile-menu-button {
  display: none;
}

@media (max-width: 1280px) {
  .analytics-page-head {
    grid-template-columns: 1fr;
    grid-template-areas:
      "title"
      "filters"
      "tabs";
  }

  .analytics-page-head .analytics-section-tabs,
  .analytics-page-head .analytics-filters {
    width: 100%;
    max-width: none;
    justify-self: stretch;
  }

  .analytics-filters {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

  .overview-filters {
    width: 100%;
  }

  .analytics-filters-compact .button {
    width: 100%;
  }

  .analytics-secondary-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .avitologist-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .avitologist-fire-grid,
  .avitologist-setup-steps,
  .avitologist-control-grid,
  .avitologist-efficiency-layout,
  .avitologist-lower-grid {
    grid-template-columns: 1fr;
  }

  .avitologist-empty-grid {
    grid-template-columns: minmax(0, 1fr);
  }

}

.flash {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgb(109 93 252 / 0.2);
  background: #f4f1ff;
  color: var(--text-soft);
}

.impersonation-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid rgb(234 179 8 / 0.35);
  border-radius: 8px;
  background: #fffbeb;
  color: #713f12;
}

.impersonation-banner div {
  display: grid;
  gap: 2px;
}

.impersonation-banner strong {
  color: #713f12;
}

.admin-tester-grid {
  align-items: start;
}

.admin-tester-card {
  display: grid;
  gap: 16px;
}

.admin-tester-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-tester-card-head h3 {
  margin: 4px 0 6px;
  font-size: 20px;
  line-height: 1.2;
}

.admin-tester-checks,
.admin-tester-actions,
.admin-tester-user-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-tester-users {
  display: grid;
  gap: 10px;
}

.admin-tester-user-row {
  align-items: center;
}

.admin-tester-user-actions {
  justify-content: flex-end;
}

.category-tool {
  display: grid;
  gap: 18px;
}

.category-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}

.category-form,
.category-result-card {
  min-height: 520px;
}

.category-form {
  display: grid;
  gap: 14px;
}

.category-form-head h3,
.category-empty h3,
.category-result h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.12;
  letter-spacing: 0;
  font-weight: 720;
}

.category-form-head p,
.category-empty p,
.category-result p {
  margin: 6px 0 0;
}

.category-query {
  min-height: 50px;
  font-size: 16px;
  font-weight: 560;
}

.category-description {
  min-height: 150px;
}

.category-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-button {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--panel-muted);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.chip-button:hover {
  border-color: rgb(109 93 252 / 0.24);
  color: var(--violet);
  background: #eeeaff;
}

.category-submit {
  width: 100%;
  min-height: 48px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.category-empty {
  min-height: 472px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  text-align: center;
}

.category-empty-icon,
.category-result-icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: var(--violet);
  background: #eeeaff;
}

.category-empty-icon svg,
.category-result-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.category-empty-icon.is-spinning svg,
.category-submit.is-loading svg {
  animation: cat-spin 1s linear infinite;
}

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

.category-result {
  display: grid;
  gap: 16px;
}

.category-result-top {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.category-result h3 {
  font-size: 28px;
}

.category-confidence {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--panel-muted);
  border: 1px solid var(--line-soft);
}

.category-confidence span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, #7c6cff, #6d5dfc);
}

.category-confidence-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-confidence-row strong {
  font-size: 26px;
  line-height: 1;
  font-weight: 760;
}

.category-path {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-path span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgb(109 93 252 / 0.14);
  border-radius: 999px;
  background: #f4f1ff;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 650;
}

.category-copy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.category-reasons span {
  min-height: 26px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--panel-muted);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.category-alts {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.category-alts h4 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 720;
}

.category-alt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-muted);
}

.category-alt strong {
  display: block;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.35;
  font-weight: 650;
}

.category-alt small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 68px 18px auto;
    height: auto;
    z-index: 60;
    border: 1px solid var(--line);
    border-radius: 20px;
    display: none;
  }

  .sidebar.is-open {
    display: block;
  }

  .brand {
    display: none;
  }

  .topbar {
    padding: 0 20px;
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .content {
    width: min(100% - 32px, 760px);
    padding-top: 24px;
  }

  .page-head,
  .section-head,
  .admin-directory-heading,
  .auth-name-grid,
  .admin-filters,
  .stat-toolbar-card,
  .stat-toolbar,
  .stat-main-grid,
  .stat-account-grid,
  .admin-staff-node,
  .admin-owner-head,
  .admin-owner-stats,
  .admin-avitologist-card .admin-owner-stats,
  .admin-client-node,
  .category-grid,
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 {
    display: grid;
    grid-template-columns: 1fr;
  }

  .accounts-kpis,
  .accounts-grid,
  .avitologist-stat-grid,
	  .avitologist-empty-grid,
	  .avitologist-client-summary,
	  .client-pipeline,
	  .avitologist-client-cards,
		  .client-onboarding-empty,
		  .client-detail-focus-grid,
		  .client-detail-lower-grid,
		  .client-metric-groups,
		  .avitologist-workbench,
	  .avitologist-fire-grid,
  .avitologist-setup-steps,
  .avitologist-control-grid,
  .avitologist-lower-grid,
  .avitologist-efficiency-layout,
  .avitologist-autoload-summary,
  .avitologist-efficiency-metrics,
  .client-detail-grid,
  .autoload-filters,
  .generator-entry-grid,
  .generator-steps,
  .generator-main-grid,
  .generator-variant-list,
  .generator-description-grid,
  .generator-price-grid,
  .template-type-grid,
  .template-builder-grid,
  .template-library-grid,
  .template-card-stats,
  .tasks-grid,
  .mass-fix-body,
  .avitologist-analytics-kpis,
  .avitologist-analytics-summary-grid,
  .analytics-filters,
  .analytics-hero,
  .analytics-kpi-grid,
  .account-facts,
  .accounts-empty,
  .overview-dashboard .profile-kpis,
  .profile-kpis,
  .profile-main-grid,
  .profile-client-body,
  .profile-listings,
  .analytics-items-toolbar,
  .analytics-city-summary,
  .analytics-attention-grid,
  .analytics-expense-kpis,
  .analytics-secondary-metrics,
  .analytics-workbench,
  .profile-efficiency-layout,
	  .profile-efficiency-grid {
	    grid-template-columns: 1fr;
	  }

  .analytics-filters-compact .field,
  .analytics-filters-compact .button,
  .analytics-table-actions,
  .analytics-attention-actions,
  .analytics-attention-actions .button {
    width: 100%;
  }

  .analytics-page-title-row {
    align-items: flex-start;
  }

  .overview-filters {
    grid-template-columns: 1fr;
  }

  .avitologist-hero,
  .avitologist-hero.empty {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .avitologist-hero-status,
  .avitologist-hero-counter {
    width: 100%;
  }

  .avitologist-campaign-list a {
    grid-template-columns: 1fr;
  }

  .avitologist-campaign-list em {
    justify-self: start;
  }

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

  .tasks-hero {
    flex-direction: column;
  }

  .templates-hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .templates-hero-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .templates-hero-actions .button,
  .template-builder-grid .button {
    width: 100%;
  }

  .template-card-head {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .template-card-head .status {
    grid-column: 2;
    justify-self: start;
  }

  .tasks-hero-count {
    width: 100%;
    min-height: 96px;
  }

  .task-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .task-row .status {
    grid-column: 2;
    justify-self: start;
  }

  .avitologist-hero-counter {
    width: 100%;
    height: auto;
    min-height: 104px;
  }

  .generator-preview-panel,
  .generator-title-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .generator-preview {
    grid-template-columns: 1fr;
  }

  .analytics-page-icon {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }

  .analytics-page-icon svg {
    width: 26px;
    height: 26px;
  }

  .analytics-hero {
    padding: 22px;
  }

  .analytics-hero-visual {
    min-height: 150px;
    order: -1;
  }

  .analytics-hero h3 {
    font-size: 24px;
  }

  .analytics-kpi-card,
  .analytics-expense-kpi,
  .analytics-secondary-metric {
    min-height: 124px;
  }

  .analytics-expense-note {
    align-items: flex-start;
  }

  .analytics-city-empty-group > summary {
    align-items: stretch;
    flex-direction: column;
  }

  .city-empty-action {
    width: 100%;
  }

  .account-fact {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .account-fact:last-child {
    border-bottom: 0;
  }

  .account-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .client-workspace-controls,
  .client-search-form,
  .client-empty-actions,
  .client-sort-form,
  .client-sort-form label {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .client-search-field {
    min-width: 0;
  }

  .client-card-metrics,
  .client-empty-copy ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-action-panel {
    padding-right: 16px;
  }

  .client-action-panel em {
    position: static;
    justify-self: start;
    margin-top: 6px;
    transform: none;
  }

  .client-onboarding-empty {
    padding: 22px;
  }

  .client-focus-top,
  .client-focus-bottom,
  .client-focus-badges {
    display: grid;
    justify-content: stretch;
  }

  .client-detail-focus .client-health,
  .client-sync-box {
    min-width: 0;
  }

  .client-primary-action strong {
    font-size: 24px;
  }

  .client-account-readiness,
  .client-account-item,
  .client-metric-group .client-detail-kpis,
  .client-metric-group .client-detail-kpis.quality {
    grid-template-columns: 1fr;
  }

  .client-account-item .button,
  .client-primary-action .button {
    width: 100%;
  }

  .client-account-actions {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .client-empty-visual {
    min-height: 210px;
    order: -1;
  }

  .page-title {
    font-size: 34px;
  }

  .profile-info-row {
    grid-template-columns: 18px minmax(0, 1fr);
  }

  .profile-info-row small {
    display: none;
  }

  .profile-donut {
    width: min(180px, 100%);
  }

  .admin-staff-meta {
    justify-content: flex-start;
  }

  .admin-client-line {
    display: none;
  }

  .topbar-actions .user-chip,
  .topbar-actions .status {
    display: none;
  }
}
