:root {
  --bg: #f3f6f5;
  --surface: #ffffff;
  --surface-soft: #f7faf9;
  --ink: #182422;
  --muted: #66736f;
  --line: #dbe4e1;
  --line-strong: #c6d3cf;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --primary-soft: #e5f4f1;
  --accent: #c76d13;
  --accent-soft: #fff3e5;
  --success: #18794e;
  --success-soft: #e7f6ed;
  --warning: #a75b09;
  --warning-soft: #fff4df;
  --danger: #b42318;
  --danger-soft: #feecea;
  --info: #2563eb;
  --info-soft: #eaf1ff;
  --sidebar: #14342f;
  --sidebar-muted: #a8c3bc;
  --shadow: 0 1px 2px rgba(18, 41, 36, 0.05), 0 8px 24px rgba(18, 41, 36, 0.04);
  --radius: 8px;
  --radius-sm: 6px;
  --sidebar-width: 232px;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 20px 14px 16px;
  color: #f4fbf8;
  background: var(--sidebar);
}

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

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  color: #12332d;
  background: #d6f3ea;
  font-size: 18px;
  font-weight: 800;
}

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

.brand strong {
  font-size: 15px;
  font-weight: 700;
}

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

.side-nav {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.nav-item {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--sidebar-muted);
  background: transparent;
  text-align: left;
}

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

.nav-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.08);
}

.nav-item .nav-label {
  font-size: 13px;
  font-weight: 600;
}

.nav-badge {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  margin-left: auto;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: #c76d13;
  font-size: 10px;
  font-weight: 750;
}

.sidebar-foot {
  display: grid;
  gap: 12px;
  margin-top: auto;
  padding: 14px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.scope-hint {
  color: var(--sidebar-muted);
  font-size: 12px;
  line-height: 1.6;
}

.text-button {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 0;
  border: 0;
  color: var(--primary);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
}

.text-button:hover {
  color: var(--primary-dark);
}

.text-button.light {
  color: #cce5df;
}

.text-button.light:hover {
  color: #ffffff;
}

.main {
  min-width: 0;
  padding: 22px 26px 40px;
}

.topbar {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
  max-width: 1500px;
  margin: 0 auto 20px;
}

.page-heading {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

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

h1 {
  margin-bottom: 3px;
  font-size: 24px;
  line-height: 1.25;
}

h2 {
  margin-bottom: 4px;
  font-size: 16px;
  line-height: 1.35;
}

h3 {
  margin-bottom: 4px;
  font-size: 14px;
}

.page-heading > p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.top-actions {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-shrink: 0;
}

.account-switcher {
  display: grid;
  gap: 4px;
  min-width: 190px;
  color: var(--muted);
  font-size: 11px;
}

select,
input,
textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

textarea {
  min-height: 82px;
  resize: vertical;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.button {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink);
  background: var(--surface);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.button:hover {
  border-color: #9fb3ad;
  background: #fbfdfc;
}

.button.primary {
  border-color: var(--primary);
  color: #ffffff;
  background: var(--primary);
}

.button.primary:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
}

.button.danger {
  border-color: #e6b9b4;
  color: var(--danger);
  background: #fffafa;
}

.button.subtle {
  border-color: transparent;
  color: var(--muted);
  background: transparent;
}

.button.small {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 12px;
}

.icon-button {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
}

.icon-button:hover {
  color: var(--ink);
  border-color: var(--line-strong);
  background: var(--surface-soft);
}

.icon {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}

.icon svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.view {
  max-width: 1500px;
  margin: 0 auto;
}

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

.section {
  display: grid;
  gap: 12px;
}

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

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel.pad {
  padding: 16px;
}

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

.panel-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-body {
  padding: 16px;
}

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

.metric-grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

.metric {
  min-height: 112px;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.metric-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  color: var(--primary);
  background: var(--primary-soft);
}

.metric-value {
  margin: 12px 0 4px;
  font-size: 24px;
  font-weight: 750;
  line-height: 1.1;
}

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

.metric-foot strong {
  color: var(--success);
}

.metric.compact {
  min-height: 98px;
}

.metric.compact .metric-value {
  font-size: 21px;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.75fr);
  gap: 16px;
}

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

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

.conversion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

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

.conversion-item .label {
  color: var(--muted);
  font-size: 12px;
}

.conversion-item .rate {
  margin: 7px 0 3px;
  color: var(--primary);
  font-size: 23px;
  font-weight: 750;
}

.conversion-item .detail {
  color: var(--muted);
  font-size: 11px;
}

.conversion-item.clickable {
  width: 100%;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.conversion-item.clickable:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.conversion-item.clickable .label,
.conversion-item.clickable .rate,
.conversion-item.clickable .detail {
  display: block;
}

.abc-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 13px 14px;
}

.abc-chip {
  display: grid;
  gap: 3px;
  min-width: 116px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  text-align: left;
}

.abc-chip:hover {
  border-color: var(--primary);
  background: var(--surface-soft);
}

.abc-chip.active {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.abc-chip strong,
.abc-chip span {
  display: block;
}

.abc-chip strong {
  font-size: 12px;
}

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

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: flex-end;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
}

.toolbar .field {
  min-width: 130px;
}

.toolbar .field.search {
  flex: 1 1 220px;
  min-width: 200px;
}

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

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

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

.search-wrap {
  position: relative;
}

.search-wrap .icon {
  position: absolute;
  top: 50%;
  left: 9px;
  width: 15px;
  height: 15px;
  color: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.search-wrap input {
  padding-left: 30px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #f8fbfa;
  font-size: 11px;
  font-weight: 700;
}

tbody tr:hover {
  background: #fbfdfc;
}

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

td.strong {
  font-weight: 700;
}

td.num {
  font-variant-numeric: tabular-nums;
}

.customer-cell {
  display: grid;
  gap: 1px;
}

.customer-cell strong {
  font-size: 13px;
}

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

.badge {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-height: 23px;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--muted);
  background: #eef3f1;
  font-size: 11px;
  font-weight: 650;
}

.badge.source-douyin {
  color: #1e293b;
  background: #edf1f5;
}

.badge.source-wechat {
  color: #1d6b3a;
  background: var(--success-soft);
}

.badge.source-redbook {
  color: #a23636;
  background: #fdecec;
}

.badge.intent-a {
  color: var(--success);
  background: var(--success-soft);
}

.badge.intent-b {
  color: var(--warning);
  background: var(--warning-soft);
}

.badge.intent-c {
  color: var(--muted);
  background: #eef3f1;
}

.badge.status-new {
  color: var(--info);
  background: var(--info-soft);
}

.badge.status-following {
  color: var(--warning);
  background: var(--warning-soft);
}

.badge.status-deal {
  color: var(--success);
  background: var(--success-soft);
}

.badge.status-lost {
  color: var(--danger);
  background: var(--danger-soft);
}

.badge.status-pending {
  color: var(--warning);
  background: var(--warning-soft);
}

.badge.status-completed {
  color: var(--success);
  background: var(--success-soft);
}

.badge.status-rejected {
  color: var(--danger);
  background: var(--danger-soft);
}

.badge.status-withdrawn {
  color: var(--muted);
  background: #eef3f1;
}

.action-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.link-button {
  padding: 2px 0;
  border: 0;
  color: var(--primary);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}

.link-button:hover {
  color: var(--primary-dark);
}

.link-button.muted {
  color: var(--muted);
}

.link-button.danger {
  color: var(--danger);
}

.empty {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 170px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.empty .icon {
  width: 28px;
  height: 28px;
  color: var(--line-strong);
}

.chart {
  width: 100%;
  min-height: 230px;
}

.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart text {
  fill: var(--muted);
  font-size: 10px;
}

.chart .grid-line {
  stroke: #e8efec;
  stroke-width: 1;
}

.chart .bar {
  fill: #9bd8cc;
}

.chart .bar.recent {
  fill: var(--primary);
}

.chart .amount-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
}

.chart .amount-dot {
  fill: var(--accent);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 11px;
}

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

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--primary);
}

.legend-dot.amount {
  background: var(--accent);
}

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

.bar-item {
  display: grid;
  gap: 6px;
}

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

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

.bar-item-head span {
  color: var(--muted);
  font-size: 11px;
}

.bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf3f1;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.bar-fill.orange {
  background: var(--accent);
}

.bar-fill.blue {
  background: var(--info);
}

.bar-fill.red {
  background: #c2413b;
}

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

.info-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

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

.info-row .label {
  color: var(--muted);
  font-size: 12px;
}

.info-row .value {
  text-align: right;
  font-weight: 650;
}

.note {
  padding: 11px 12px;
  border: 1px solid #d6e9e4;
  border-radius: var(--radius-sm);
  color: #315d55;
  background: #f1f9f7;
  font-size: 12px;
  line-height: 1.7;
}

.note.warning {
  border-color: #efd7ad;
  color: #765019;
  background: #fffaf0;
}

.note.compact {
  align-self: end;
  min-height: 36px;
  padding: 8px 10px;
  font-size: 11px;
}

.muted-text {
  color: var(--muted);
  font-size: 12px;
}

.form-section-title {
  padding-top: 2px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 750;
}

.core-field-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

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

.custom-field-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.custom-field-row strong,
.custom-field-row span {
  display: block;
}

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

.custom-field-row span {
  color: var(--muted);
  font-size: 11px;
}

.custom-field-form {
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.checkbox-cell {
  width: 38px;
  text-align: center;
}

.checkbox-cell input {
  width: 16px;
  min-height: 16px;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.request-reason {
  max-width: 280px;
  white-space: normal;
}

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

.team-panel {
  overflow: hidden;
}

.team-panel .panel-head {
  align-items: center;
}

.team-title {
  display: flex;
  gap: 9px;
  align-items: center;
}

.team-title .icon {
  color: var(--primary);
}

.team-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.team-summary > div {
  padding: 11px 13px;
  border-right: 1px solid var(--line);
}

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

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

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

.team-summary strong {
  margin-top: 3px;
  font-size: 15px;
}

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

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

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

.segmented-control {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.segmented-control label {
  display: inline-flex;
  flex: 1 1 180px;
  gap: 7px;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.segmented-control label:has(input:checked) {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-soft);
}

.segmented-control input {
  width: 16px;
  min-height: 16px;
}

.checkbox-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}

.checkbox-row input {
  width: 16px;
  min-height: 16px;
  margin-top: 2px;
}

.checkbox-row span {
  color: var(--muted);
  font-size: 12px;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(12, 26, 23, 0.42);
}

.modal {
  width: min(680px, 100%);
  max-height: min(860px, calc(100vh - 36px));
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(10, 28, 24, 0.24);
}

.modal.wide {
  width: min(820px, 100%);
}

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

.modal-head h2 {
  margin-bottom: 2px;
  font-size: 17px;
}

.modal-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 12px;
}

.modal-body {
  padding: 17px 18px;
}

.modal-foot {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: flex-end;
  padding: 13px 18px 17px;
  border-top: 1px solid var(--line);
}

.modal-foot .left {
  margin-right: auto;
}

.toast-stack {
  position: fixed;
  z-index: 200;
  right: 18px;
  bottom: 18px;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 36px));
  pointer-events: none;
}

.toast {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 7px;
  background: #ffffff;
  box-shadow: 0 14px 34px rgba(17, 42, 36, 0.15);
  animation: toast-in 180ms ease-out both;
}

.toast.error {
  border-left-color: var(--danger);
}

.toast .icon {
  margin-top: 1px;
  color: var(--primary);
}

.toast.error .icon {
  color: var(--danger);
}

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

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

.toast span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

.mobile-nav {
  display: none;
}

.timeline {
  display: grid;
  gap: 0;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  padding-bottom: 14px;
}

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

.timeline-item::before {
  position: absolute;
  top: 17px;
  bottom: -1px;
  left: 6px;
  width: 1px;
  content: "";
  background: var(--line);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 13px;
  height: 13px;
  margin-top: 3px;
  border: 3px solid var(--primary-soft);
  border-radius: 50%;
  background: var(--primary);
}

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

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

.timeline-item span {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

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

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

  .metric-grid.five,
  .metric-grid.six,
  .conversion-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 16px 14px 88px;
  }

  .topbar {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
  }

  .top-actions {
    align-items: end;
  }

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

  .mobile-nav {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    gap: 2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    scrollbar-width: none;
  }

  .mobile-nav .nav-item {
    display: grid;
    flex: 1 0 68px;
    gap: 2px;
    justify-items: center;
    min-height: 48px;
    padding: 4px 1px;
    color: var(--muted);
  }

  .mobile-nav .nav-item.active {
    color: var(--primary);
    background: var(--primary-soft);
  }

  .mobile-nav .nav-label {
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
  }

  .three-grid,
  .two-grid,
  .team-grid,
  .config-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  h1 {
    font-size: 21px;
  }

  .metric-grid,
  .metric-grid.five,
  .metric-grid.six,
  .conversion-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric {
    min-height: 102px;
    padding: 12px;
  }

  .metric-value {
    font-size: 21px;
  }

  .panel-head {
    display: grid;
  }

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

  .toolbar {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .toolbar .field,
  .toolbar .field.search {
    min-width: 0;
  }

  .toolbar .field.search {
    grid-column: 1 / -1;
  }

  .top-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  #newCustomerButton {
    padding-right: 10px;
    padding-left: 10px;
  }

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

  .modal,
  .modal.wide {
    width: 100%;
    max-height: 94vh;
    border-radius: 12px 12px 0 0;
  }

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

  .team-summary > div:nth-child(2) {
    border-right: 0;
  }

  .team-summary > div:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 420px) {
  .main {
    padding-right: 10px;
    padding-left: 10px;
  }

  .metric-grid,
  .metric-grid.five,
  .metric-grid.six,
  .conversion-grid {
    grid-template-columns: 1fr 1fr;
  }

  .metric-value {
    font-size: 19px;
  }

  .top-actions {
    grid-template-columns: 1fr;
  }

  #newCustomerButton {
    width: 100%;
  }
}
