/*
 * Warm modern admin visual layer.
 * This file intentionally changes presentation only. It is loaded last so one
 * theme owns the final layout instead of several legacy layers competing.
 */
:root {
  --admin-primary: #1b1d18;
  --admin-primary-hover: #32362e;
  --admin-primary-soft: #f3d7e6;
  --admin-bg: #f3efe5;
  --admin-surface: #fffdf8;
  --admin-text: #1b1c18;
  --admin-text-secondary: #5d5b54;
  --admin-text-muted: #8a857a;
  --admin-border: #d9d1c3;
  --admin-border-light: #ebe4d8;
  --admin-danger: #b74d47;
  --admin-success: #39734e;
  --admin-warning: #9a6b08;
  --admin-sidebar: #171915;
  --admin-sidebar-hover: #2b2e28;
  --admin-radius: 16px;
  --admin-control-height: 40px;
  --admin-sidebar-width: 232px;
  --warm-canvas: #f3efe5;
  --warm-surface: #fffdf8;
  --warm-surface-soft: #f9f5ec;
  --warm-ink: #1b1c18;
  --warm-line: #d9d1c3;
  --pastel-pink: #f2d2e3;
  --pastel-blue: #d8e8fb;
  --pastel-green: #dbe8c8;
  --pastel-yellow: #f5df7e;
  --pastel-orange: #f1cfaa;
}

html,
body {
  color: var(--warm-ink) !important;
  background: var(--warm-canvas) !important;
}

body {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif !important;
}

.shell,
.app-shell,
.main {
  background: var(--warm-canvas) !important;
}

.sidebar {
  color: #eeeee7 !important;
  background: var(--admin-sidebar) !important;
  border-right: 0 !important;
  box-shadow: 7px 0 24px rgba(30, 29, 24, 0.08) !important;
}

.brand,
.sidebar .brand-panel {
  min-height: 76px;
  padding: 16px 18px !important;
  background: var(--admin-sidebar) !important;
  border-bottom-color: rgba(255, 255, 255, 0.09) !important;
}

.brand h1,
.sidebar .brand-title {
  color: #fffdf7 !important;
  font-size: 19px !important;
  font-weight: 750 !important;
}

.brand-subtitle,
.sidebar .brand-copy {
  color: rgba(255, 255, 255, 0.58) !important;
}

.nav {
  padding: 14px 10px !important;
}

.nav-section {
  margin-bottom: 10px !important;
}

.nav-section-title {
  margin: 12px 0 5px !important;
  padding: 0 10px !important;
  color: rgba(255, 255, 255, 0.4) !important;
  font-size: 11px !important;
  letter-spacing: 0.03em !important;
}

.nav-link {
  min-height: 42px !important;
  padding: 0 12px !important;
  gap: 11px !important;
  color: rgba(255, 255, 255, 0.78) !important;
  border-radius: 10px !important;
  line-height: 42px !important;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.nav-link:hover:not(.active) {
  color: #ffffff !important;
  background: var(--admin-sidebar-hover) !important;
}

.nav-link.active,
.nav-link[aria-current="page"] {
  color: #1a1c18 !important;
  background: var(--pastel-pink) !important;
  box-shadow: inset 3px 0 0 #c76d9f !important;
}

.sidebar-collapse-button {
  color: rgba(255, 255, 255, 0.76) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.11) !important;
  border-radius: 10px !important;
}

.sidebar-collapse-button:hover {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.11) !important;
}

.main {
  padding: 0 28px 38px !important;
}

.topbar {
  min-height: 68px !important;
  margin: 0 -28px 24px !important;
  padding: 9px 28px !important;
  background: rgba(255, 253, 248, 0.96) !important;
  border-bottom: 1px solid var(--warm-line) !important;
  box-shadow: 0 5px 22px rgba(53, 48, 38, 0.06) !important;
  backdrop-filter: blur(12px) !important;
}

.topbar h2 {
  color: var(--warm-ink) !important;
  font-size: 22px !important;
  font-weight: 750 !important;
}

.enterprise-breadcrumb {
  color: var(--admin-text-muted) !important;
}

.topbar-user-avatar {
  color: #1d1e1a !important;
  background: var(--pastel-yellow) !important;
}

#app {
  max-width: 1760px !important;
}

.page-grid,
.page-shell {
  gap: 20px !important;
}

.card,
.panel,
.tech-panel,
.dashboard-section,
.metric-card,
.metric-card-link,
.quick-link-card,
.management-toolbar-panel,
.filter-panel,
.collapsible-form-panel,
.compact-list-panel,
.management-record,
.list-item,
.timeline-item,
.alert-item,
.activity-item,
.owner-item,
.empty-panel,
.drawer-subpanel,
.evidence-record-card,
.record-stat,
.table-wrap,
.page-header,
.reply-card {
  color: var(--warm-ink) !important;
  background: var(--warm-surface) !important;
  border: 1px solid var(--warm-line) !important;
  border-radius: 16px !important;
  box-shadow: 0 8px 22px rgba(53, 48, 38, 0.045) !important;
}

.card,
.panel,
.tech-panel,
.dashboard-section,
.management-toolbar-panel,
.filter-panel,
.collapsible-form-panel,
.compact-list-panel,
.page-header {
  padding: 22px 24px !important;
}

.page-header,
.management-toolbar-panel {
  background: var(--warm-surface) !important;
}

.management-toolbar h2,
.page-header h3,
.section-heading h3,
.kicker-row h3 {
  color: var(--warm-ink) !important;
  font-weight: 750 !important;
}

.eyebrow,
.section-kicker,
.kicker {
  color: #8b7f6d !important;
  font-weight: 560 !important;
}

.muted,
.record-meta {
  color: var(--admin-text-secondary) !important;
}

.section-heading {
  border-bottom-color: var(--admin-border-light) !important;
}

button,
.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
a.primary-button,
a.secondary-button,
a.ghost-button,
.file-action {
  min-height: var(--admin-control-height) !important;
  padding: 0 15px !important;
  border-radius: 10px !important;
  font-weight: 650 !important;
  line-height: 38px !important;
  white-space: nowrap;
}

.primary-button,
a.primary-button {
  color: #fffdf8 !important;
  background: var(--admin-primary) !important;
  border-color: var(--admin-primary) !important;
}

.primary-button:hover,
a.primary-button:hover {
  background: var(--admin-primary-hover) !important;
  border-color: var(--admin-primary-hover) !important;
}

.secondary-button,
.ghost-button,
a.secondary-button,
a.ghost-button,
.file-action {
  color: var(--warm-ink) !important;
  background: #fffaf1 !important;
  border-color: #cec5b7 !important;
}

.secondary-button:hover,
.ghost-button:hover,
a.secondary-button:hover,
a.ghost-button:hover,
.file-action:hover {
  color: #1b1c18 !important;
  background: #f5eee2 !important;
  border-color: #8f8678 !important;
}

.danger-button,
.secondary-button.danger-button {
  color: #9d3936 !important;
  background: #fff6f3 !important;
  border-color: #deb1aa !important;
}

.tag,
.subtle-tag,
.view-filter-chip {
  min-height: 26px !important;
  padding: 2px 9px !important;
  color: #58564f !important;
  background: #f5f0e6 !important;
  border-color: #d9d0c3 !important;
  border-radius: 8px !important;
  font-weight: 600 !important;
  line-height: 20px !important;
  white-space: nowrap;
}

.tag.success {
  color: #346746 !important;
  background: #e5f0d7 !important;
  border-color: #b9d29a !important;
}

.tag.warning {
  color: #835d08 !important;
  background: #fff0ad !important;
  border-color: #e6c75f !important;
}

.tag.danger,
.tag.risk {
  color: #913f3b !important;
  background: #fae1dd !important;
  border-color: #dfa7a0 !important;
}

.tag.info,
.view-filter-chip.is-active,
.tag.active {
  color: #315978 !important;
  background: var(--pastel-blue) !important;
  border-color: #abcbe9 !important;
}

input,
select,
textarea {
  color: var(--warm-ink) !important;
  background: #fffdf8 !important;
  border-color: #cfc6b8 !important;
  border-radius: 10px !important;
}

input,
select {
  height: var(--admin-control-height) !important;
  min-height: var(--admin-control-height) !important;
  padding: 6px 11px !important;
}

textarea {
  padding: 10px 12px !important;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #9f9689 !important;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #403e37 !important;
  box-shadow: 0 0 0 3px rgba(242, 210, 227, 0.7) !important;
}

input:disabled,
select:disabled,
textarea:disabled,
input[readonly] {
  background: #f3eee5 !important;
}

.filter-grid,
.script-filter-grid,
.filters {
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)) !important;
  gap: 14px 16px !important;
}

.choice-field,
.enterprise-form-section {
  border-color: var(--admin-border-light) !important;
}

.choice-field {
  background: var(--warm-surface-soft) !important;
  border-radius: 12px !important;
}

.enterprise-form-section {
  padding: 12px 14px !important;
  color: var(--warm-ink) !important;
  background: #f7f1e6 !important;
  border: 1px solid #e4dacb !important;
  border-left: 4px solid #d4a5bf !important;
  border-radius: 10px !important;
}

.form-actions,
.detail-drawer-footer,
.collapsible-form-panel .form-grid > .action-row.full {
  background: rgba(255, 253, 248, 0.97) !important;
  border-top-color: var(--warm-line) !important;
}

.table-wrap {
  width: 100%;
  overflow: auto !important;
  isolation: isolate;
  scrollbar-color: #b8ad9c #f4eee4;
  scrollbar-width: thin;
}

.table-wrap::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

.table-wrap::-webkit-scrollbar-track {
  background: #f4eee4;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #b8ad9c;
  border: 2px solid #f4eee4;
  border-radius: 99px;
}

.table {
  min-width: 1080px;
  table-layout: auto;
}

.table th,
.table td {
  min-height: 52px;
  padding: 15px 16px !important;
  color: #4d4b45 !important;
  background: #fffdf8 !important;
  border-bottom-color: #ebe4d9 !important;
  font-size: 13px;
  line-height: 1.65;
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

.table th {
  color: #292a25 !important;
  background: #f4eee3 !important;
  font-weight: 720 !important;
}

.table tbody tr:nth-child(even) td {
  background: #fdfaf4 !important;
}

.table tbody tr:hover td {
  background: #f9f2e4 !important;
}

.table td:last-child,
.table th:last-child {
  position: static !important;
  right: auto !important;
  z-index: auto !important;
  box-shadow: none !important;
}

.table td .muted {
  max-width: none;
  overflow: visible;
  display: block;
  -webkit-line-clamp: unset;
  white-space: nowrap;
}

.management-record {
  padding: 18px 20px !important;
  border-bottom-color: #ebe4d9 !important;
}

.management-record:hover {
  background: #faf4e8 !important;
}

.record-stat-grid {
  border-color: #e6ded1 !important;
  border-radius: 12px !important;
  overflow: hidden;
}

.record-stat {
  background: #f8f3e9 !important;
  border-right-color: #e6ded1 !important;
}

.metric-grid,
.tech-metric-grid {
  gap: 14px !important;
}

.metric-card,
.metric-card-link {
  min-height: 108px !important;
  padding: 17px 18px !important;
  border-radius: 15px !important;
}

.metric-grid > :nth-child(4n + 1),
.tech-metric-grid > :nth-child(4n + 1) {
  background: #f8e1ec !important;
}

.metric-grid > :nth-child(4n + 2),
.tech-metric-grid > :nth-child(4n + 2) {
  background: #e3edf9 !important;
}

.metric-grid > :nth-child(4n + 3),
.tech-metric-grid > :nth-child(4n + 3) {
  background: #f8e7a4 !important;
}

.metric-grid > :nth-child(4n),
.tech-metric-grid > :nth-child(4n) {
  background: #e5eed5 !important;
}

.metric-card strong,
.metric-card-link strong {
  color: var(--warm-ink) !important;
  font-size: 26px !important;
  font-weight: 760 !important;
}

.quick-link-card,
.tech-link-card {
  border-radius: 14px !important;
}

.detail-drawer,
.modal-panel,
.dialog-panel {
  background: var(--warm-surface) !important;
  border-color: var(--warm-line) !important;
  border-radius: 18px !important;
}

.drawer-close-button,
.section-close-button {
  color: #292a25 !important;
  background: #fffaf1 !important;
  border-color: #cfc6b8 !important;
  border-radius: 10px !important;
}

/* Aftersales: explicit widths prevent Chinese copy from collapsing vertically. */
.refund-list-card,
.aftersales-workspace .table-wrap {
  padding: 0 !important;
}

.refund-list-card > .kicker-row,
.aftersales-workspace .table-wrap > .kicker-row {
  position: sticky;
  left: 0;
  z-index: 3;
  width: min(100%, calc(100vw - var(--admin-sidebar-width) - 56px));
  min-width: 880px;
  padding: 22px 24px;
  background: var(--warm-surface);
  border-bottom: 1px solid var(--admin-border-light);
}

.refund-case-table {
  width: 100%;
  min-width: 1860px !important;
  table-layout: fixed !important;
}

.refund-case-table .refund-col-case { width: 220px; }
.refund-case-table .refund-col-time { width: 132px; }
.refund-case-table .refund-col-grade { width: 100px; }
.refund-case-table .refund-col-owner { width: 160px; }
.refund-case-table .refund-col-request { width: 92px; }
.refund-case-table .refund-col-risk { width: 150px; }
.refund-case-table .refund-col-days { width: 100px; }
.refund-case-table .refund-col-money { width: 245px; }
.refund-case-table .refund-col-status { width: 132px; }
.refund-case-table .refund-col-followup { width: 152px; }
.refund-case-table .refund-col-actions { width: 377px; }

.refund-case-table th,
.refund-case-table td {
  vertical-align: top;
}

.refund-case-table td:first-child,
.refund-case-table .refund-money-cell,
.refund-case-table td:last-child {
  white-space: normal;
}

.refund-case-table .sticky-action-column {
  position: static !important;
  right: auto !important;
  z-index: auto !important;
  background: inherit !important;
  box-shadow: none !important;
}

.aftersales-list-actions {
  display: grid;
  width: 100%;
  min-width: 0 !important;
  gap: 10px;
}

.aftersales-status-actions {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(max-content, 1fr));
  gap: 7px !important;
}

.aftersales-status-button {
  min-height: 38px !important;
  padding: 0 11px !important;
  border-radius: 9px !important;
  font-weight: 650 !important;
  line-height: 36px !important;
  white-space: nowrap;
}

.aftersales-status-button.status-following {
  color: #355e80 !important;
  background: #e0edf9 !important;
  border-color: #aecce6 !important;
}

.aftersales-status-button.status-completed {
  color: #356849 !important;
  background: #e6f0d9 !important;
  border-color: #bdd59f !important;
}

.aftersales-status-button.status-reopened {
  color: #8b592c !important;
  background: #f8e3ca !important;
  border-color: #e4bb8d !important;
}

.aftersales-latest-result {
  display: grid !important;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  gap: 8px !important;
  white-space: normal;
}

.complaint-case-table {
  min-width: 1680px !important;
  table-layout: fixed !important;
}

.complaint-case-table .complaint-col-case { width: 190px; }
.complaint-case-table .complaint-col-customer { width: 190px; }
.complaint-case-table .complaint-col-grade { width: 175px; }
.complaint-case-table .complaint-col-feedback { width: 175px; }
.complaint-case-table .complaint-col-issue { width: 130px; }
.complaint-case-table .complaint-col-status { width: 135px; }
.complaint-case-table .complaint-col-owner { width: 125px; }
.complaint-case-table .complaint-col-updated { width: 145px; }
.complaint-case-table .complaint-col-actions { width: 415px; }

.complaint-case-table td:first-child,
.complaint-case-table td:nth-child(2),
.complaint-case-table td:nth-child(3),
.complaint-case-table td:last-child {
  white-space: normal;
}

.aftersales-tabs {
  margin: 18px -24px 0 !important;
  padding: 0 24px !important;
  background: #f7f1e7 !important;
  border-top-color: #e5dccf !important;
}

.aftersales-tabs a {
  color: #746d62 !important;
}

.aftersales-tabs a.is-active {
  color: #1c1d19 !important;
}

.aftersales-tabs a.is-active::after {
  background: #c76d9f !important;
}

.record-more-actions > summary {
  white-space: nowrap;
}

.record-more-menu {
  z-index: 20 !important;
  background: #fffdf8 !important;
  border-color: var(--warm-line) !important;
  border-radius: 10px !important;
  box-shadow: 0 16px 38px rgba(43, 39, 31, 0.16) !important;
}

/* Dense record lists: menus expand inside their own row so adjacent records
   and scroll containers can never clip the available actions. */
.management-card-list .management-record:has(.record-more-actions[open]) {
  z-index: 50;
  overflow: visible !important;
}

.management-card-list .record-more-actions[open],
.aftersales-workspace .record-more-actions[open] {
  display: grid;
  align-self: flex-start;
  gap: 8px;
}

.management-card-list .record-more-menu,
.aftersales-workspace .record-more-menu {
  position: static !important;
  right: auto !important;
  top: auto !important;
  min-width: 156px;
  margin-top: 8px;
}

/* Aftersales: keep status, handler and update time in their own columns. */
.complaint-case-table {
  min-width: 1780px !important;
}

.complaint-case-table .complaint-col-status { width: 190px; }
.complaint-case-table .complaint-col-owner { width: 145px; }
.complaint-case-table .complaint-col-updated { width: 160px; }
.complaint-case-table .complaint-col-actions { width: 380px; }

.complaint-case-table th,
.complaint-case-table td {
  min-width: 0;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.complaint-case-table td:nth-child(6),
.complaint-case-table td:nth-child(7),
.complaint-case-table td:nth-child(8) {
  overflow: hidden;
}

.complaint-case-table td:nth-child(6) .muted,
.complaint-case-table td:nth-child(7) .muted,
.complaint-case-table td:nth-child(8) .muted {
  display: block;
  max-width: 100%;
  margin-top: 6px;
  overflow: visible;
  white-space: normal !important;
}

/* 工作台只承载经营总览；具体任务统一进入“我的待办”。 */
.workbench-sales-performance {
  position: relative;
  overflow: hidden;
  padding: 28px !important;
  background:
    radial-gradient(circle at 92% 4%, rgba(199, 109, 159, 0.14), transparent 32%),
    linear-gradient(145deg, #fffdf8 0%, #fbf7ef 100%) !important;
  border-color: #e2d7c8 !important;
}

.workbench-sales-performance::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  content: "";
  background: linear-gradient(90deg, #c76d9f, #e7b35d 58%, #8fba9b);
}

.workbench-sales-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
}

.workbench-sales-heading h3 {
  margin: 4px 0 6px;
  color: #1d2e42;
  font-size: clamp(22px, 2vw, 28px);
}

.workbench-sales-heading .muted {
  margin: 0;
}

.workbench-sales-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

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

.workbench-sales-kpi {
  display: flex;
  min-width: 0;
  min-height: 112px;
  flex-direction: column;
  justify-content: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid #e5dbce;
  border-radius: 14px;
  box-shadow: 0 9px 24px rgba(73, 58, 39, 0.05);
}

.workbench-sales-kpi span,
.workbench-sales-kpi small {
  overflow: hidden;
  color: #827769;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workbench-sales-kpi strong {
  margin: 7px 0 5px;
  color: #172b40;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.workbench-sales-amount {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  text-overflow: clip;
  white-space: nowrap;
}

.workbench-sales-amount.is-compact {
  font-size: clamp(17px, 1.2vw, 20px) !important;
  letter-spacing: -0.055em;
}

.workbench-sales-amount.is-extra-compact {
  font-size: clamp(14px, 0.95vw, 16px) !important;
  letter-spacing: -0.06em;
}

.workbench-sales-amount.is-micro {
  font-size: clamp(12px, 0.8vw, 14px) !important;
  letter-spacing: -0.065em;
}

.workbench-sales-chart-wrap {
  min-width: 0;
  padding: 18px 20px 10px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid #e5dbce;
  border-radius: 16px;
}

.workbench-sales-chart-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #7b7062;
  font-size: 13px;
}

.workbench-sales-chart-meta span:first-child {
  color: #25384c;
  font-size: 15px;
  font-weight: 750;
}

.workbench-sales-chart {
  display: block;
  width: 100%;
  min-height: 250px;
  margin-top: 8px;
}

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

.sales-chart-axis-label {
  fill: #8b8175;
  font-size: 12px;
}

.sales-chart-area {
  fill: url(#workbenchSalesArea);
}

.sales-chart-line {
  fill: none;
  stroke: #c76d9f;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 5px 8px rgba(199, 109, 159, 0.18));
}

.sales-chart-point {
  fill: #fffdf8;
  stroke: #c76d9f;
  stroke-width: 3;
}

@media (max-width: 1180px) {
  :root {
    --admin-sidebar-width: 210px;
  }

  .main {
    padding-right: 20px !important;
    padding-left: 20px !important;
  }

  .topbar {
    margin-right: -20px !important;
    margin-left: -20px !important;
    padding-right: 20px !important;
    padding-left: 20px !important;
  }

  .form-grid,
  .script-editor-grid,
  .two-column-fields,
  .ai-link-form {
    grid-template-columns: minmax(0, 1fr) !important;
  }

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

  .workbench-sales-layout {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 760px) {
  .card,
  .panel,
  .tech-panel,
  .dashboard-section,
  .management-toolbar-panel,
  .filter-panel,
  .collapsible-form-panel,
  .compact-list-panel,
  .page-header {
    padding: 18px !important;
  }

  .metric-grid,
  .tech-metric-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .workbench-sales-performance {
    padding: 20px !important;
  }

  .workbench-sales-heading,
  .workbench-sales-chart-meta {
    align-items: stretch;
    flex-direction: column;
  }

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

  .workbench-sales-chart-wrap {
    overflow-x: auto;
    padding-right: 10px;
    padding-left: 10px;
  }

  .workbench-sales-chart {
    min-width: 640px;
  }

  .kicker-row,
  .section-heading,
  .management-toolbar {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .refund-list-card > .kicker-row,
  .aftersales-workspace .table-wrap > .kicker-row {
    width: 100%;
    min-width: 0;
    padding: 18px;
  }
}

/* 线索通过率：八项指标保持同一网格、图标与文字基线。 */
.lead-pass-rate-page .stats-metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  grid-auto-rows: 142px;
  align-items: stretch;
}

.lead-pass-rate-page .stats-metric-grid .metric-card {
  display: grid !important;
  min-width: 0;
  min-height: 142px !important;
  height: 100%;
  grid-template-columns: 44px minmax(0, 1fr);
  grid-template-rows: 1fr;
  align-items: start;
  gap: 14px !important;
  padding: 20px !important;
}

.lead-pass-rate-page .stats-metric-grid .metric-icon {
  width: 44px;
  height: 44px;
  flex-basis: 44px;
  align-self: start;
}

.lead-pass-rate-page .stats-metric-grid .metric-copy {
  display: flex;
  min-width: 0;
  height: 100%;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding-top: 2px;
}

.lead-pass-rate-page .stats-metric-grid .metric-copy strong,
.lead-pass-rate-page .stats-metric-grid .metric-copy span,
.lead-pass-rate-page .stats-metric-grid .metric-helper {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.lead-pass-rate-page .stats-metric-grid .metric-helper {
  margin-top: auto;
  padding-top: 8px;
}

@media (max-width: 1180px) {
  .lead-pass-rate-page .stats-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 640px) {
  .lead-pass-rate-page .stats-metric-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* Operations cards: keep period information and actions in separate rows. */
.operations-card-list .management-record.operation-contract-record {
  grid-template-columns: minmax(0, 1fr) !important;
}

.operations-card-list .operation-contract-record > .record-main {
  width: 100%;
  min-width: 0;
}

.operations-card-list .operation-contract-record > .record-side {
  display: flex !important;
  width: 100%;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid #ebe4d9;
}

.operations-card-list .operation-contract-record .record-status-stack,
.operations-card-list .operation-contract-record .record-actions {
  min-width: 0;
}

.operations-card-list .operation-contract-record .record-actions {
  flex: 1 1 auto;
  justify-content: flex-end;
}

.operations-card-list .operation-contract-record .operation-monthly-cycle-summary {
  width: 100%;
  min-width: 0;
}

@media (max-width: 900px) {
  .operations-card-list .operation-contract-record > .record-side {
    flex-direction: column;
    align-items: stretch;
  }

  .operations-card-list .operation-contract-record .record-actions {
    justify-content: flex-start;
  }
}
