:root {
  color-scheme: light;
  --bg: #f7f6f2;
  --panel: #ffffff;
  --ink: #1e2930;
  --muted: #66727d;
  --line: #dfe5e4;
  --accent: #1f7a6b;
  --accent-dark: #145e55;
  --warn: #b84a35;
  --soft: #edf5f2;
  --shadow: 0 18px 45px rgba(27, 42, 45, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

.language-toggle {
  border: 1px solid rgba(31, 122, 107, 0.28);
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  padding: 10px 14px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(27, 42, 45, 0.08);
  white-space: nowrap;
}

.language-toggle:hover {
  border-color: rgba(31, 122, 107, 0.5);
  background: var(--soft);
}

.language-toggle:focus-visible {
  outline: 3px solid rgba(31, 122, 107, 0.24);
  outline-offset: 2px;
}

.app-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

body[data-page="admin"] .app-shell {
  width: min(1760px, calc(100% - 48px));
}

.topbar,
.control-panel,
.chart-section,
.table-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(26px, 4vw, 40px);
  line-height: 1.15;
}

h2 {
  font-size: 20px;
}

.subtext {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.control-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  align-items: end;
  gap: 16px;
  margin-top: 18px;
  padding: 18px;
}

.admin-panel {
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto auto;
}

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

.product-filter {
  max-width: 480px;
  margin-bottom: 16px;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  padding: 0 12px;
}

input:focus,
select:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(31, 122, 107, 0.14);
}

.primary-button,
.ghost-button,
.small-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.primary-button {
  padding: 0 18px;
  background: var(--accent);
  color: #ffffff;
}

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

.ghost-button {
  padding: 0 14px;
  background: var(--soft);
  color: var(--accent-dark);
  border-color: #c6ddd8;
}

.small-button {
  min-height: 34px;
  padding: 0 12px;
  background: var(--soft);
  color: var(--accent-dark);
  border-color: #c6ddd8;
}

.danger-button {
  background: #fff0ed;
  border-color: #f1c7bd;
  color: var(--warn);
}

.status-message {
  margin: 14px 0;
  color: var(--muted);
  font-size: 14px;
}

.status-message.error {
  color: var(--warn);
  font-weight: 700;
}

.data-meta,
.notice {
  margin: 14px 0;
  padding: 12px 14px;
  border: 1px solid #cfe1dc;
  border-radius: 8px;
  background: #f1faf7;
  color: var(--accent-dark);
  font-size: 14px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.metric-card {
  min-height: 116px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin-top: 14px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
}

.metric-card.urgent strong,
.danger-text {
  color: var(--warn);
  font-weight: 700;
}

.chart-section,
.table-section {
  padding: 20px;
}

.table-section {
  margin-top: 18px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.row-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.empty-state {
  display: grid;
  min-height: 240px;
  place-items: center;
  border: 1px dashed #c8d2d0;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}

.chart-wrap {
  overflow-x: auto;
  padding-bottom: 8px;
}

#barChart {
  display: block;
  min-width: 860px;
  width: 100%;
  height: 430px;
}

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

.axis-line {
  stroke: #8ea09c;
  stroke-width: 1.2;
}

.tick-label,
.date-label,
.axis-label {
  fill: #66727d;
  font-size: 12px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 12px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  background: #ffffff;
}

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f5f4;
  color: #425058;
  font-size: 12px;
  text-transform: uppercase;
}

td:nth-child(4),
td:nth-child(5),
td:nth-child(6),
td:nth-child(7) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table-empty {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 860px) {
  .control-panel,
  .admin-panel {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1280px);
    padding-top: 16px;
  }

  .topbar,
  .control-panel,
  .chart-section,
  .table-section {
    padding: 16px;
  }

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

  h1 {
    font-size: 28px;
  }
}

/* 隐藏图表空状态大白框 */
.empty-state {
  display: none !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

/* 点击日期后的当日横向明细表 */
.selected-date-section {
  margin-top: 18px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.selected-date-section .section-heading {
  margin-bottom: 14px;
}

.small-clear-button {
  min-height: 36px !important;
  padding: 0 12px !important;
  font-size: 13px !important;
}

.compact-table table {
  min-width: 980px;
}

.compact-table th {
  background: #eef5f3;
}

.compact-table td,
.compact-table th {
  padding: 11px 14px;
}

.compact-table tr:hover td {
  background: #f8fbfa;
}

/* 让可点击柱子有更明确的交互感 */
.chart-bar {
  cursor: pointer;
}

.chart-bar:hover {
  opacity: 0.9;
  filter: drop-shadow(0 6px 10px rgba(15, 23, 42, 0.28));
}

/* 点击日期展开表格后的性能优化 */
.selected-date-section {
  margin-top: 18px;
  contain: layout paint;
}

.selected-date-section .table-scroll {
  max-height: 420px;
  overflow: auto;
}

.selected-date-section table {
  min-width: 980px;
}

.selected-date-section tr:hover td {
  background: #f6faf9;
}

/* 避免 hover 阴影造成 SVG 大量重绘 */
.chart-bar,
.chart-bar:hover,
.stacked-segment,
.stacked-segment:hover {
  filter: none !important;
}

.chart-tooltip {
  pointer-events: none !important;
  will-change: transform;
}

/* Shared SVG chart label baseline. Keep customer and admin chart numbers compact. */
.chart-section .latest-label,
.admin-daily-chart-section .latest-label {
  fill: #145e55;
  font-size: 12px;
  font-weight: 900;
}

.chart-section .stack-total-label,
.admin-daily-chart-section .stack-total-label {
  fill: #1e2930;
  font-size: 13px;
  font-weight: 900;
}

.chart-section .date-label,
.admin-daily-chart-section .date-label {
  fill: #52616b;
  font-size: 12px;
  font-weight: 800;
}

.chart-section .tick-label,
.chart-section .axis-label,
.admin-daily-chart-section .tick-label,
.admin-daily-chart-section .axis-label {
  fill: #66727d;
  font-size: 12px;
  font-weight: 800;
}

.chart-section .stacked-segment,
.admin-daily-chart-section .stacked-segment {
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 1;
}

/* =========================
   Mobile Optimization
   ========================= */

@media (max-width: 760px) {
  body {
    overflow-x: hidden;
  }

  .app-shell {
    width: calc(100% - 20px) !important;
    padding: 12px 0 32px !important;
  }

  .topbar {
    padding: 18px 16px !important;
    border-radius: 12px !important;
  }

  .topbar h1 {
    font-size: 30px !important;
    line-height: 1.12 !important;
  }

  .topbar .subtext {
    font-size: 13px !important;
    line-height: 1.5 !important;
  }

  .eyebrow {
    font-size: 11px !important;
  }

  .control-panel,
  .customer-panel,
  .admin-panel {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    padding: 16px !important;
    border-radius: 12px !important;
  }

  label {
    font-size: 13px !important;
  }

  input,
  select {
    min-height: 48px !important;
    font-size: 16px !important;
    border-radius: 10px !important;
  }

  .primary-button,
  .ghost-button {
    width: 100% !important;
    min-height: 48px !important;
    font-size: 16px !important;
    border-radius: 10px !important;
  }

  .status-message {
    font-size: 13px !important;
    margin: 10px 2px !important;
  }

  .data-meta {
    font-size: 13px !important;
    padding: 12px !important;
    line-height: 1.5 !important;
    border-radius: 10px !important;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    margin: 14px 0 !important;
  }

  .metric-card {
    min-height: 96px !important;
    padding: 14px !important;
    border-radius: 12px !important;
  }

  .metric-card span {
    font-size: 12px !important;
  }

  .metric-card strong {
    margin-top: 10px !important;
    font-size: 30px !important;
  }

  .chart-section,
  .table-section,
  .selected-date-section {
    padding: 16px !important;
    border-radius: 12px !important;
  }

  .section-heading {
    align-items: flex-start !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
  }

  .section-heading h2 {
    font-size: 19px !important;
    line-height: 1.25 !important;
  }

  .row-count {
    font-size: 12px !important;
    white-space: nowrap;
  }

  .product-filter {
    max-width: 100% !important;
    margin-bottom: 10px !important;
  }

  .chart-wrap {
    border-radius: 12px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    padding: 6px 0 8px !important;
  }

  #barChart {
    height: 460px !important;
    min-width: 980px !important;
  }

  .stack-total-label {
    font-size: 12px !important;
  }

  .date-label {
    font-size: 12px !important;
  }

  .tick-label,
  .axis-label {
    font-size: 11px !important;
  }

  .legend {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    gap: 8px !important;
    padding-bottom: 6px !important;
  }

  .legend-item {
    flex: 0 0 auto !important;
    font-size: 11px !important;
    padding: 6px 9px !important;
    white-space: nowrap !important;
  }

  .legend-swatch {
    width: 11px !important;
    height: 11px !important;
  }

  .selected-date-section .table-scroll,
  .table-section .table-scroll {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px !important;
  }

  .selected-date-section .table-scroll {
    max-height: 360px !important;
  }

  table {
    min-width: 880px !important;
  }

  th,
  td {
    padding: 10px 11px !important;
    font-size: 13px !important;
  }

  th {
    font-size: 11px !important;
  }

  .small-clear-button {
    width: auto !important;
    min-height: 36px !important;
    font-size: 13px !important;
    padding: 0 12px !important;
  }

  .chart-tooltip {
    max-width: 280px !important;
    font-size: 12px !important;
  }
}

@media (max-width: 430px) {
  .app-shell {
    width: calc(100% - 14px) !important;
  }

  .topbar h1 {
    font-size: 26px !important;
  }

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

  .metric-card {
    min-height: 88px !important;
    padding: 12px !important;
  }

  .metric-card strong {
    font-size: 26px !important;
  }

  #barChart {
    height: 430px !important;
    min-width: 920px !important;
  }

  .chart-section,
  .table-section,
  .selected-date-section {
    padding: 14px !important;
  }

  th,
  td {
    padding: 9px 10px !important;
    font-size: 12px !important;
  }
}

/* 管理员页：查看客户履单按钮 */
.open-customer-cell {
  white-space: nowrap;
  text-align: right;
}

th[data-open-customer-head] {
  text-align: right;
}

.open-customer-button {
  appearance: none;
  border: 1px solid rgba(31, 122, 107, 0.2);
  background: rgba(31, 122, 107, 0.08);
  color: #075f53;
  border-radius: 10px;
  padding: 9px 16px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.15s ease;
}

.open-customer-button:hover {
  background: rgba(31, 122, 107, 0.14);
  transform: translateY(-1px);
}

.open-customer-button:active {
  transform: translateY(0);
}

.visibility-button {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(31, 122, 107, 0.2);
  border-radius: 9px;
  background: rgba(31, 122, 107, 0.06);
  color: #075f53;
  cursor: pointer;
  transition: 0.15s ease;
}

.visibility-button:hover {
  background: rgba(31, 122, 107, 0.12);
  transform: translateY(-1px);
}

.visibility-button:active {
  transform: translateY(0);
}

.visibility-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.visibility-button.is-hidden {
  color: #8a3c31;
  background: rgba(190, 70, 48, 0.08);
  border-color: rgba(190, 70, 48, 0.22);
}

.is-customer-hidden td {
  color: var(--muted);
  background: rgba(15, 23, 42, 0.015);
}

/* 管理员页：总体客户履单状态 */
.admin-overview-section {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  padding: 24px;
  margin: 24px 0;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.admin-overview-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-overview-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.admin-overview-title-row h2 {
  margin: 0;
  line-height: 1.2;
}

.admin-overview-status {
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.admin-analysis-panel {
  margin-bottom: 24px;
  padding: 22px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfc 100%);
}

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

.admin-analysis-panel-head h3 {
  margin: 0;
  color: #1e2930;
  font-size: 22px;
  line-height: 1.2;
}

.admin-analysis-panel-head > span {
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-overview-cards {
  display: grid;
  grid-template-columns: repeat(14, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
  margin-bottom: 20px;
}

.admin-analysis-panel .admin-overview-cards {
  margin-bottom: 0;
}

.admin-overview-card {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  min-height: 112px;
  padding: 18px 16px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.admin-overview-card span {
  display: block;
  color: #64748b;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.2;
  min-height: 32px;
  margin-bottom: 10px;
}

.admin-overview-card .metric-label b,
.admin-overview-card .metric-label small {
  display: block;
}

.admin-overview-card .metric-label b {
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
}

.admin-overview-card .metric-label small {
  margin-top: 3px;
  color: #7b8794;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}

.admin-overview-card strong {
  display: flex;
  align-items: baseline;
  gap: 7px;
  color: #111827;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0.02em;
}

.admin-overview-card.metric-card {
  grid-column: span 2;
}

.admin-overview-card.compact-card {
  min-height: 0;
  padding: 12px 14px;
  border-radius: 14px;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-overview-compact-stack {
  grid-column: span 2;
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
}

.admin-overview-card.compact-card span {
  min-height: auto;
  margin: 0;
}

.admin-overview-card.compact-card strong {
  font-size: 24px;
}

.order-delta-card strong em {
  font-style: normal;
  font-size: 24px;
  line-height: 1;
}

.order-delta-card.is-up strong {
  color: #13855f;
}

.order-delta-card.is-down strong {
  color: #b14536;
}

.order-delta-card.is-flat strong {
  color: #64748b;
}

.admin-overview-card.danger strong,
.danger-text {
  color: #b14536 !important;
}

.admin-overview-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 18px;
}

.admin-overview-panel {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.admin-overview-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  background: #f8fafc;
}

.admin-overview-panel-head h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.admin-overview-panel-head span {
  color: #64748b;
  font-weight: 800;
  font-size: 13px;
}

.admin-overview-table th,
.admin-overview-table td {
  white-space: nowrap;
}

.admin-overview-table tbody tr:hover {
  background: rgba(31, 122, 107, 0.04);
}

.product-name-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.open-customer-button.compact {
  padding: 7px 12px;
  border-radius: 9px;
}

.open-customer-button.compact:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 1100px) {
  .admin-overview-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-overview-card.metric-card,
  .admin-overview-card.compact-card,
  .admin-overview-compact-stack {
    grid-column: span 1;
  }

  .admin-overview-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .admin-overview-section {
    padding: 16px;
    border-radius: 14px;
  }

  .admin-analysis-panel {
    padding: 12px;
    border-radius: 14px;
  }

  .admin-overview-heading {
    flex-direction: column;
  }

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

  .admin-overview-card strong {
    font-size: 24px;
  }
}

/* 管理员总体看板：客户排行和产品排行改为上下两个模块 */
.admin-overview-grid {
  grid-template-columns: 1fr !important;
  gap: 22px !important;
}

.admin-overview-panel {
  width: 100% !important;
}

.admin-overview-panel .table-scroll {
  width: 100% !important;
  overflow-x: auto !important;
}

.admin-overview-table {
  width: 100% !important;
  min-width: 900px;
}

.product-name-cell {
  max-width: 520px !important;
}

/* 合并客户密码到客户未发货排行后，隐藏原客户查询密码模块 */
.admin-customer-rank-table {
  min-width: 1100px !important;
}

.query-password-text {
  letter-spacing: 0.04em;
  font-weight: 900;
}

.copy-customer-button {
  appearance: none;
  border: 1px solid rgba(31, 122, 107, 0.2);
  background: rgba(31, 122, 107, 0.08);
  color: #075f53;
  border-radius: 9px;
  padding: 7px 12px;
  font-weight: 800;
  cursor: pointer;
  transition: 0.15s ease;
}

.copy-customer-button:hover {
  background: rgba(31, 122, 107, 0.14);
}

.copy-customer-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 客户未发货排行：固定列宽，避免表头视觉错位 */
.admin-customer-rank-table {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 1200px !important;
}

.admin-customer-rank-table th,
.admin-customer-rank-table td {
  vertical-align: middle !important;
}

/* 查看履单 */
.admin-customer-rank-table th:nth-child(1),
.admin-customer-rank-table td:nth-child(1) {
  width: 120px !important;
  text-align: center !important;
}

/* 客户编号 */
.admin-customer-rank-table th:nth-child(2),
.admin-customer-rank-table td:nth-child(2) {
  width: 160px !important;
  text-align: center !important;
}

/* 订单总数 */
.admin-customer-rank-table th:nth-child(3),
.admin-customer-rank-table td:nth-child(3) {
  width: 150px !important;
  text-align: center !important;
}

/* 已发货数 */
.admin-customer-rank-table th:nth-child(4),
.admin-customer-rank-table td:nth-child(4) {
  width: 150px !important;
  text-align: center !important;
}

/* 未发货数 */
.admin-customer-rank-table th:nth-child(5),
.admin-customer-rank-table td:nth-child(5) {
  width: 140px !important;
  text-align: center !important;
}

/* 发货率 */
.admin-customer-rank-table th:nth-child(6),
.admin-customer-rank-table td:nth-child(6) {
  width: 120px !important;
  text-align: center !important;
}

/* 查询密码 */
.admin-customer-rank-table th:nth-child(7),
.admin-customer-rank-table td:nth-child(7) {
  width: 210px !important;
  text-align: center !important;
}

.admin-customer-rank-table .query-password-text {
  display: inline-block;
  min-width: 120px;
  text-align: center;
}

/* 客户未发货排行：强制表头和内容完全对齐 */
.admin-customer-rank-table {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 1090px !important;
  border-collapse: collapse !important;
}

.admin-customer-rank-table th,
.admin-customer-rank-table td {
  box-sizing: border-box !important;
  text-align: center !important;
  vertical-align: middle !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  white-space: nowrap !important;
}

/* 客户编号和查询密码加粗但不影响列宽 */
.admin-customer-rank-table td strong {
  display: inline-block !important;
  max-width: 100% !important;
}

.admin-customer-rank-table .query-password-text {
  letter-spacing: 0.04em !important;
  text-align: center !important;
}

/* 避免旧的 nth-child 宽度影响 */
.admin-customer-rank-table th:nth-child(n),
.admin-customer-rank-table td:nth-child(n) {
  width: auto !important;
}

/* 产品未发货排行：固定列宽，避免表头和内容错位 */
.admin-product-rank-table {
  table-layout: fixed !important;
  width: 100% !important;
  min-width: 1140px !important;
  border-collapse: collapse !important;
}

.admin-product-rank-table th,
.admin-product-rank-table td {
  box-sizing: border-box !important;
  vertical-align: middle !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
  white-space: nowrap !important;
}

/* 产品 SKU */
.admin-product-rank-table th:nth-child(1),
.admin-product-rank-table td:nth-child(1) {
  text-align: left !important;
}

/* 产品名称 */
.admin-product-rank-table th:nth-child(2),
.admin-product-rank-table td:nth-child(2) {
  text-align: left !important;
}

/* 未发货数、订单总数、涉及客户数 */
.admin-product-rank-table th:nth-child(3),
.admin-product-rank-table td:nth-child(3),
.admin-product-rank-table th:nth-child(4),
.admin-product-rank-table td:nth-child(4),
.admin-product-rank-table th:nth-child(5),
.admin-product-rank-table td:nth-child(5) {
  text-align: center !important;
}

.admin-product-rank-table .product-name-cell {
  max-width: 500px !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Unfulfilled view: simplified ranking cards */
.admin-customer-rank-table {
  min-width: 880px !important;
}

.admin-customer-rank-table th,
.admin-customer-rank-table td {
  text-align: center !important;
}

.admin-product-rank-bars {
  display: grid;
  gap: 12px;
  padding: 16px;
  max-height: none;
  overflow: visible;
}

.admin-product-rank-header,
.admin-product-rank-bar {
  display: grid;
  grid-template-columns: 42px minmax(390px, 1fr) 112px 90px;
  gap: 18px;
}

.admin-product-rank-header {
  grid-template-columns: 42px minmax(390px, 1fr) 112px 90px;
  align-items: center;
  min-height: 30px;
  padding: 0 16px;
  margin: 0 0 -2px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.admin-product-rank-header span:nth-child(1) {
  overflow: visible;
  text-align: center;
  white-space: nowrap;
  transform: translateX(-5px);
}

.admin-product-rank-header span:nth-child(2) {
  padding-left: 0;
  text-align: left;
  white-space: nowrap;
}

.admin-product-rank-header span:nth-child(3) {
  text-align: center;
  white-space: nowrap;
}

.admin-product-rank-header span:nth-child(4) {
  text-align: right;
  white-space: nowrap;
}

.admin-product-rank-bar {
  align-items: center;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 12px;
  background: #ffffff;
}

.admin-product-rank-index {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(31, 122, 107, 0.08);
  color: #075f53;
  font-size: 12px;
  font-weight: 900;
}

.admin-product-rank-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.admin-product-rank-text {
  display: grid;
  grid-template-columns: minmax(130px, auto) minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  min-width: 0;
}

.admin-product-rank-text strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-product-rank-text span {
  overflow: hidden;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-product-rank-track {
  position: relative;
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.055);
}

.admin-product-rank-track i {
  display: block;
  width: var(--rank-width);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--rank-color) 88%, white),
    var(--rank-color) 58%,
    color-mix(in srgb, var(--rank-color) 88%, black)
  );
}

.admin-product-rank-customer {
  display: inline-grid;
  place-items: center;
  align-self: end;
  min-height: 28px;
  margin-bottom: -1px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--rank-color) 10%, white);
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}

.admin-product-rank-value {
  align-self: end;
  margin-bottom: 3px;
  color: #b14536;
  font-size: 15px;
  font-weight: 900;
  text-align: right;
}

.admin-product-rank-empty {
  padding: 20px;
  color: #64748b;
  font-weight: 800;
  text-align: center;
}

.selected-date-title {
  color: #0f7f72;
  font-weight: 950;
}

.admin-overview-panel-head h3 .selected-date-title {
  display: inline;
  color: #0f7f72 !important;
  font-size: inherit !important;
  font-weight: 950 !important;
  line-height: inherit !important;
}

.admin-daily-chart-section .is-muted-date {
  opacity: 0.22;
}

.admin-daily-chart-section .is-selected-date {
  opacity: 1;
}

.admin-daily-chart-section .date-label,
.admin-daily-chart-section .stack-total-label,
.admin-daily-chart-section .latest-label {
  pointer-events: none;
}

.admin-daily-chart-section .chart-bar,
.admin-daily-chart-section .date-label,
.admin-daily-chart-section .stack-total-label,
.admin-daily-chart-section .latest-label,
.admin-daily-chart-section .latest-bg,
.admin-daily-chart-section .date-hit-zone {
  transition: opacity 0.16s ease, fill 0.16s ease;
}

.admin-daily-chart-section .date-label.is-selected-date,
.admin-daily-chart-section .stack-total-label.is-selected-date,
.admin-daily-chart-section .latest-label.is-selected-date {
  font-weight: 950;
}

.admin-overview-grid.is-selected-date-analysis .admin-customer-rank-table {
  min-width: 0 !important;
  width: 100% !important;
  table-layout: fixed !important;
}

.admin-overview-grid.is-selected-date-analysis .admin-overview-panel:first-child .table-scroll {
  overflow-x: hidden !important;
}

.admin-overview-grid.is-selected-date-analysis .admin-customer-rank-table th,
.admin-overview-grid.is-selected-date-analysis .admin-customer-rank-table td {
  height: 44px !important;
  padding: 9px 8px !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
}

.admin-overview-grid.is-selected-date-analysis .admin-customer-rank-table th:nth-child(1),
.admin-overview-grid.is-selected-date-analysis .admin-customer-rank-table td:nth-child(1) {
  width: 18% !important;
}

.admin-overview-grid.is-selected-date-analysis .admin-customer-rank-table th:nth-child(2),
.admin-overview-grid.is-selected-date-analysis .admin-customer-rank-table td:nth-child(2),
.admin-overview-grid.is-selected-date-analysis .admin-customer-rank-table th:nth-child(3),
.admin-overview-grid.is-selected-date-analysis .admin-customer-rank-table td:nth-child(3),
.admin-overview-grid.is-selected-date-analysis .admin-customer-rank-table th:nth-child(4),
.admin-overview-grid.is-selected-date-analysis .admin-customer-rank-table td:nth-child(4) {
  width: 17% !important;
}

.admin-overview-grid.is-selected-date-analysis .admin-customer-rank-table th:nth-child(5),
.admin-overview-grid.is-selected-date-analysis .admin-customer-rank-table td:nth-child(5) {
  width: 15% !important;
}

.admin-overview-grid.is-selected-date-analysis .admin-customer-rank-table th:nth-child(6),
.admin-overview-grid.is-selected-date-analysis .admin-customer-rank-table td:nth-child(6) {
  width: 16% !important;
}

/* 管理员页：刷新总体状态按钮，统一成标题旁的绿色操作按钮 */
#refreshAdminOverviewButton {
  appearance: none !important;
  border: 1px solid var(--accent) !important;
  background: var(--accent) !important;
  color: #ffffff !important;
  border-radius: 10px !important;
  min-height: 38px !important;
  padding: 0 18px !important;
  font-weight: 800 !important;
  font-size: 15px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: 0.15s ease !important;
  box-shadow: none !important;
}

#refreshAdminOverviewButton:hover {
  background: var(--accent-dark) !important;
  border-color: var(--accent-dark) !important;
  transform: translateY(-1px);
}

#refreshAdminOverviewButton:active {
  transform: translateY(0);
}

/* English file input replacement */
.native-file-hidden {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

.english-file-picker {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.english-file-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  background: #ffffff;
  color: #111827;
  border-radius: 8px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.english-file-button:hover {
  background: #f8fafc;
}

.english-file-name {
  color: #334155;
  font-weight: 600;
}

/* Top-right Today's Orders widget */
.today-orders-host {
  position: relative !important;
  padding-right: 340px !important;
}

.today-orders-widget {
  position: absolute;
  right: 34px;
  top: 30px;
  width: 260px;
  border: 1px solid rgba(31, 122, 107, 0.18);
  background: rgba(31, 122, 107, 0.055);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
}

.today-orders-label {
  color: #075f53;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.today-orders-value {
  color: #111827;
  font-weight: 950;
  font-size: 38px;
  line-height: 1;
  letter-spacing: 0.03em;
}

.today-orders-date {
  color: #64748b;
  font-weight: 700;
  font-size: 12px;
  margin-top: 8px;
}

.admin-customer-rank-table {
  min-width: 1280px !important;
}

@media (max-width: 900px) {
  .today-orders-host {
    padding-right: 24px !important;
  }

  .today-orders-widget {
    position: static;
    width: auto;
    margin-top: 18px;
  }
}

/* Move Today's Orders card upward on desktop */
@media (min-width: 901px) {
  .today-orders-host {
    position: relative !important;
    padding-right: 360px !important;
  }

  .today-orders-widget {
    top: 16px !important;
    right: 34px !important;
    width: 260px !important;
  }
}

/* Product search next to Product Filter */
.product-filter {
  display: grid !important;
  grid-template-columns: minmax(280px, 520px) minmax(360px, 1fr) !important;
  gap: 12px 16px !important;
  align-items: start !important;
}

.product-filter > label {
  grid-column: 1 / -1 !important;
}

.product-filter select {
  width: 100% !important;
}

.product-search-box {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.product-search-input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  padding: 0 15px;
  font-size: 15px;
  color: #111827;
  background: #fff;
  outline: none;
}

.product-search-input:focus {
  border-color: rgba(31, 122, 107, 0.5);
  box-shadow: 0 0 0 3px rgba(31, 122, 107, 0.08);
}

.product-search-button,
.product-search-clear-button {
  appearance: none;
  min-height: 48px;
  border-radius: 12px;
  padding: 0 18px;
  font-weight: 900;
  cursor: pointer;
  transition: 0.15s ease;
}

.product-search-button {
  border: 1px solid #0f766e;
  background: #0f766e;
  color: #fff;
}

.product-search-clear-button {
  border: 1px solid rgba(31, 122, 107, 0.22);
  background: rgba(31, 122, 107, 0.08);
  color: #075f53;
}

.product-search-button:hover,
.product-search-clear-button:hover {
  transform: translateY(-1px);
}

.product-search-hint {
  grid-column: 1 / -1;
  min-height: 18px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.product-search-hint.is-error {
  color: #b14536;
}

@media (max-width: 760px) {
  .product-filter {
    grid-template-columns: 1fr !important;
  }

  .product-search-box {
    grid-template-columns: 1fr;
  }

  .product-search-button,
  .product-search-clear-button {
    width: 100%;
  }
}

/* Admin Daily Unfulfilled Qty chart */
.admin-daily-chart-section {
  margin-top: 24px !important;
}

.admin-product-filter {
  margin-top: 14px;
  margin-bottom: 16px;
}

.admin-product-filter label {
  display: block;
  color: #64748b;
  font-weight: 900;
  font-size: 13px;
  margin-bottom: 8px;
}

.admin-product-filter-row {
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(260px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
}

.admin-product-filter-row select {
  width: 100%;
  min-height: 48px;
}

@media (max-width: 760px) {
  .admin-product-filter-row {
    grid-template-columns: 1fr;
  }

  .admin-product-filter-row button {
    width: 100%;
  }
}

/* Fix Admin Daily Chart overflow */
#adminOverviewSection,
#adminOverviewContent,
.admin-overview-grid,
.admin-daily-chart-section,
.admin-daily-chart-section .chart-wrap {
  min-width: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.admin-daily-chart-section {
  grid-column: 1 / -1 !important;
  overflow: hidden !important;
}

.admin-daily-chart-section .chart-wrap {
  display: flex !important;
  align-items: flex-start !important;
  position: relative !important;
  min-height: 664px !important;
  padding: 14px 14px 8px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch;
}

.admin-daily-chart-section .chart-wrap.is-fit-range {
  overflow-x: hidden !important;
}

.admin-sticky-axis {
  position: sticky !important;
  left: -18px !important;
  z-index: 4 !important;
  flex: 0 0 var(--sticky-axis-width, 66px) !important;
  margin-right: var(--sticky-axis-offset, -82px) !important;
  pointer-events: none !important;
  background: transparent !important;
  box-shadow: none !important;
}

body:not(.admin-show-unfulfilled-ranking) #adminOverviewContent .admin-overview-grid {
  display: none !important;
}

#adminOverviewContent .admin-overview-grid[hidden] {
  display: none !important;
}

#adminBarChart {
  display: block !important;
  width: auto !important;
  max-width: none !important;
  flex: 0 0 auto !important;
}

.admin-daily-chart-section .legend {
  max-width: 100% !important;
  overflow-x: auto !important;
  flex-wrap: nowrap !important;
  gap: 12px !important;
  padding: 4px 0 !important;
  -webkit-overflow-scrolling: touch;
}

.admin-daily-chart-section .legend-item {
  flex: 0 0 auto !important;
}

.admin-daily-chart-section .customer-legend-item {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #ffffff;
  color: #334155;
  border-radius: 999px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.admin-daily-chart-section .customer-legend-item:hover,
.admin-daily-chart-section .customer-legend-item.is-selected {
  border-color: rgba(31, 122, 107, 0.34);
  background: rgba(31, 122, 107, 0.06);
}

.admin-daily-chart-section .customer-legend-item.is-muted {
  opacity: 0.36;
}

.admin-daily-chart-section .customer-legend-item .legend-name {
  min-width: 34px;
  text-align: left;
}

.admin-daily-chart-section .customer-legend-item em {
  color: #64748b;
  font-style: normal;
  font-weight: 900;
}

.admin-daily-chart-section .customer-bar-total-label {
  font-size: 12px;
}

.admin-sku-trend-section {
  margin: 20px 0 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.admin-sku-trend-section[hidden] {
  display: none !important;
}

.admin-sku-trend-table-wrap {
  max-height: calc(42px + 15 * 41px);
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: #ffffff;
  -webkit-overflow-scrolling: touch;
}

.admin-sku-trend-table {
  --fixed-left-width: 376px;
  --date-column-width: 73px;
  --table-min-width: 100%;
  width: 100%;
  min-width: var(--table-min-width);
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.admin-sku-trend-table th,
.admin-sku-trend-table td {
  min-width: 73px;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.07);
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.admin-sku-trend-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fbfa;
  color: #075f53;
  font-size: 12px;
  font-weight: 900;
}

.admin-sku-trend-table th:nth-child(1),
.admin-sku-trend-table td:nth-child(1),
.admin-sku-trend-table th:nth-child(2),
.admin-sku-trend-table td:nth-child(2) {
  text-align: left;
}

.admin-sku-trend-table th:nth-child(1),
.admin-sku-trend-table td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 112px;
  min-width: 112px;
  max-width: 112px;
  background: #ffffff;
}

.admin-sku-trend-table th:nth-child(2),
.admin-sku-trend-table td:nth-child(2) {
  position: sticky;
  left: 112px;
  z-index: 3;
  width: 264px;
  min-width: 264px;
  max-width: 264px;
  background: #ffffff;
  box-shadow: 10px 0 18px rgba(15, 23, 42, 0.06);
}

.admin-sku-trend-table th:nth-child(n + 3):not(:last-child),
.admin-sku-trend-table td:nth-child(n + 3):not(:last-child) {
  width: var(--date-column-width);
  min-width: 73px;
  max-width: var(--date-column-width);
}

.admin-sku-trend-table th:nth-child(1),
.admin-sku-trend-table th:nth-child(2) {
  z-index: 5;
  background: #f8fbfa;
}

.admin-sku-product-cell {
  vertical-align: middle;
}

.admin-sku-product-stack {
  display: grid;
  gap: 3px;
  align-content: center;
  min-height: 26px;
}

.admin-sku-product-stack strong {
  display: block;
  overflow: hidden;
  color: #334155;
  font-size: clamp(11px, 0.72vw, 13px);
  font-weight: 900;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-sku-product-stack span {
  display: block;
  overflow: hidden;
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-sku-customer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  min-height: 20px;
  padding: 2px 9px;
  border: 2px solid var(--customer-color, #0f7f72);
  border-radius: 999px;
  background: color-mix(in srgb, var(--customer-color, #0f7f72) 9%, #ffffff);
  color: #1f2937;
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
}

.admin-sku-trend-table td.is-empty {
  color: #cbd5e1;
}

.admin-sku-trend-table td.has-orders,
.admin-sku-trend-table .admin-sku-trend-total {
  color: #0f172a;
}

.admin-sku-trend-value {
  display: block;
  line-height: 1;
  text-align: right;
}

.admin-sku-trend-table td.is-growth-level-1 .admin-sku-trend-value {
  color: #f59e0b;
  font-weight: 950;
}

.admin-sku-trend-table td.is-growth-level-2 .admin-sku-trend-value {
  color: #dc2626;
  font-weight: 950;
}

.admin-sku-trend-table.is-date-selected th.is-muted-date-column,
.admin-sku-trend-table.is-date-selected td.is-muted-date-column {
  opacity: 0.28;
}

.admin-sku-trend-table.is-date-selected th.is-selected-date-column,
.admin-sku-trend-table.is-date-selected td.is-selected-date-column {
  background: rgba(31, 122, 107, 0.1);
  color: #075f53;
  opacity: 1;
}

.admin-sku-trend-table.is-date-selected td.is-selected-date-column {
  box-shadow: inset 0 0 0 1px rgba(31, 122, 107, 0.12);
  font-weight: 950;
}

.admin-sku-trend-table .admin-sku-trend-total {
  background: rgba(31, 122, 107, 0.05);
}

.admin-sku-trend-table th:last-child,
.admin-sku-trend-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 3;
  width: var(--date-column-width);
  min-width: 73px;
  max-width: var(--date-column-width);
  box-shadow: -10px 0 18px rgba(15, 23, 42, 0.08);
}

.admin-sku-trend-table th:last-child {
  z-index: 5;
  background: #edf7f4;
}

.admin-sku-trend-table td:last-child {
  background: #f7fbfa;
}

/* Admin selected date details */
.admin-selected-date-section {
  margin-top: 22px !important;
}

.admin-selected-date-section .compact-table {
  max-height: 460px;
  overflow: auto;
}

.admin-selected-date-section table {
  min-width: 980px;
}

.admin-selected-date-section th,
.admin-selected-date-section td {
  white-space: nowrap;
}

/* Admin selected date: Clear Selection button style */
#adminClearSelectedDateButton {
  appearance: none !important;
  border: 1px solid rgba(31, 122, 107, 0.22) !important;
  background: rgba(31, 122, 107, 0.08) !important;
  color: #075f53 !important;
  border-radius: 10px !important;
  padding: 11px 18px !important;
  font-weight: 900 !important;
  font-size: 14px !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: 0.15s ease !important;
  box-shadow: none !important;
}

#adminClearSelectedDateButton:hover {
  background: rgba(31, 122, 107, 0.14) !important;
  transform: translateY(-1px);
}

#adminClearSelectedDateButton:active {
  transform: translateY(0);
}

/* Add spacing between Admin Daily Chart and Customer Ranking */
.admin-daily-chart-section {
  margin-bottom: 32px !important;
}

.admin-daily-chart-section .legend {
  margin-bottom: 18px !important;
}

.admin-total-insights {
  margin: 16px 0 30px;
  padding: 22px;
  border: 1px solid #dfe5e4;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfc 100%);
}

.admin-analysis-panel .admin-total-insights {
  margin: 18px 0 0;
  padding: 20px 0 0;
  border: 0;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 0;
  background: transparent;
}

.admin-total-insights[hidden] {
  display: none !important;
}

.admin-total-insights-head,
.admin-top-sku-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.admin-total-insights-head h3,
.admin-top-sku-head h3 {
  margin: 0;
  color: #1e2930;
  font-size: 22px;
  line-height: 1.2;
}

.admin-total-insights-head > span,
.admin-top-sku-head > span {
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.admin-total-insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 14px;
  row-gap: 10px;
}

.admin-insight-card {
  min-height: 180px;
  padding: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
}

.admin-trend-card {
  grid-column: 1 / -1;
  min-height: 310px;
  overflow: hidden;
}

.admin-insight-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 26px;
  margin-bottom: 12px;
}

.admin-insight-card-head span {
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
}

.admin-insight-card-head small {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 800;
}

.admin-insight-card > strong {
  display: block;
  margin-top: 16px;
  color: #0f172a;
  font-size: 38px;
  line-height: 1;
}

.admin-insight-card > strong.is-up {
  color: #16854b;
}

.admin-insight-card > strong.is-down {
  color: #b14536;
}

.admin-insight-card > strong.is-flat {
  color: #0f7f72;
}

.admin-delta-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.2;
  text-align: right;
}

.admin-delta-badge.is-up {
  color: #16854b;
}

.admin-delta-badge.is-down {
  color: #b14536;
}

.admin-delta-badge.is-flat {
  color: #64748b;
}

.admin-mini-compare {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.admin-trend-svg {
  display: block;
  width: 100%;
  height: 250px;
}

.admin-insight-grid {
  stroke: #e4e9e8;
  stroke-width: 1;
}

.admin-insight-axis,
.admin-insight-date {
  fill: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.admin-trend-area {
  fill: rgba(31, 122, 107, 0.1);
}

.admin-trend-line {
  fill: none;
  stroke: #0f7f72;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-trend-point {
  fill: #ffffff;
  stroke: #0f7f72;
  stroke-width: 3;
}

.admin-trend-point.is-peak {
  fill: #dc2626;
  stroke: #ffffff;
  stroke-width: 3;
}

.admin-trend-peak-label {
  fill: #dc2626;
  font-size: 12px;
  font-weight: 900;
}

.admin-trend-average-label {
  fill: #2563eb;
  font-size: 12px;
  font-weight: 900;
}

.admin-trend-average-line {
  stroke: rgba(37, 99, 235, 0.64);
  stroke-width: 2;
  stroke-dasharray: 8 7;
}

.admin-window-summary-card,
.admin-customer-share-card {
  grid-column: 1 / -1;
  padding: 14px 16px;
}

.admin-window-summary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
}

.admin-window-subcard {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfc 100%);
}

.admin-window-subhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-window-summary-grid h4,
.admin-customer-share-window h4 {
  margin: 0 0 10px;
  color: #64748b;
  font-size: 13px;
  font-weight: 900;
}

.admin-customer-share-windows {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 46px;
}

.admin-customer-share-window {
  position: relative;
  min-width: 0;
}

.admin-customer-share-window + .admin-customer-share-window {
  padding-left: 0;
}

.admin-customer-share-window + .admin-customer-share-window::before {
  position: absolute;
  top: 30px;
  bottom: 10px;
  left: -23px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.16), transparent);
  content: "";
}

.admin-customer-share-row {
  display: grid;
  grid-template-columns: 42px 138px 44px 52px;
  justify-content: start;
  gap: 8px;
  align-items: center;
  min-height: 26px;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.admin-customer-share-row span {
  color: color-mix(in srgb, var(--share-color, #0f7f72) 82%, black);
}

.admin-customer-share-row strong,
.admin-customer-share-row small {
  color: #0f172a;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.admin-customer-share-row small {
  color: #64748b;
}

.admin-customer-share-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
}

.admin-customer-share-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--share-color, #0f7f72);
}

.admin-average-list {
  display: grid;
  gap: 11px;
  margin-top: 10px;
}

.admin-average-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 62px;
  gap: 10px;
  align-items: center;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.admin-average-row span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-average-arrow {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.admin-average-arrow.is-up {
  background: rgba(22, 133, 75, 0.12);
  color: #16854b;
}

.admin-average-arrow.is-down {
  background: rgba(177, 69, 54, 0.12);
  color: #b14536;
}

.admin-average-row strong {
  color: #0f172a;
  text-align: right;
}

.admin-average-track,
.admin-period-compare i,
.admin-top-sku-bar {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(31, 122, 107, 0.08);
}

.admin-average-track i,
.admin-period-compare i::before,
.admin-top-sku-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #0f7f72;
  content: "";
}

.admin-period-compare {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.admin-period-compare div {
  display: grid;
  grid-template-columns: 78px 76px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
}

.admin-period-compare strong {
  color: #0f172a;
  text-align: right;
}

.admin-period-compare i {
  height: 14px;
}

.admin-period-compare i::before {
  width: 100%;
}

.admin-top-sku-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.admin-top-sku-list {
  display: grid;
  gap: 8px;
}

.admin-top-sku-item {
  display: grid;
  grid-template-columns: 34px minmax(260px, 1fr) 72px 96px 92px;
  gap: 14px;
  align-items: center;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 12px;
  background: #ffffff;
}

.admin-top-sku-rank {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(31, 122, 107, 0.08);
  color: #075f53;
  font-size: 12px;
  font-weight: 900;
}

.admin-top-sku-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.admin-top-sku-title {
  display: grid;
  grid-template-columns: minmax(90px, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  min-width: 0;
}

.admin-top-sku-title strong {
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
}

.admin-top-sku-title span {
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-top-sku-bar {
  height: 9px;
}

.admin-top-sku-bar i {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--sku-color, #0f7f72) 88%, white),
    var(--sku-color, #0f7f72)
  );
}

.admin-top-sku-customer,
.admin-top-sku-total,
.admin-top-sku-average {
  color: #334155;
  font-size: 13px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.admin-top-sku-customer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--sku-color, #0f7f72) 26%, white);
  border-radius: 999px;
  background: color-mix(in srgb, var(--sku-color, #0f7f72) 10%, white);
  color: color-mix(in srgb, var(--sku-color, #0f7f72) 78%, black);
  text-align: center;
}

.admin-top-sku-empty {
  padding: 18px;
  border: 1px dashed #d8e2e0;
  border-radius: 12px;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
}

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

  .admin-trend-card {
    grid-column: 1 / -1;
  }

  .admin-customer-share-windows {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .admin-customer-share-window + .admin-customer-share-window {
    padding-left: 0;
    padding-top: 18px;
  }

  .admin-customer-share-window + .admin-customer-share-window::before {
    top: 0;
    bottom: auto;
    width: 72px;
    height: 1px;
    background: rgba(15, 23, 42, 0.16);
  }

  .admin-top-sku-item {
    grid-template-columns: 34px minmax(220px, 1fr) 64px 84px 84px;
  }
}

@media (max-width: 760px) {
  .admin-total-insights {
    padding: 16px;
  }

  .admin-analysis-panel .admin-total-insights {
    padding: 16px 0 0;
  }

  .admin-total-insights-head,
  .admin-top-sku-head {
    display: grid;
    gap: 8px;
  }

  .admin-total-insights-grid {
    grid-template-columns: 1fr;
  }

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

  .admin-trend-card {
    grid-column: auto;
  }

  .admin-top-sku-list {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .admin-top-sku-item {
    min-width: 760px;
  }
}

#adminDailyChartSection + .admin-overview-grid,
.admin-daily-chart-section + .admin-overview-grid {
  margin-top: 26px !important;
}

/* Hide only the injected today-orders widget, not the hero section that hosts it. */
.today-orders-widget {
  display: none !important;
}

.customer-access-panel {
  margin: 24px 0 !important;
  padding: 0 !important;
  overflow: hidden;
}

.customer-access-panel[open] {
  padding-bottom: 18px !important;
}

.customer-access-summary {
  list-style: none;
  cursor: pointer;
  padding: 20px 24px;
  margin: 0 !important;
  user-select: none;
}

.customer-access-summary::-webkit-details-marker {
  display: none;
}

.customer-access-summary::after {
  content: "Collapse";
  border: 1px solid rgba(31, 122, 107, 0.22);
  background: rgba(31, 122, 107, 0.08);
  color: #075f53;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 900;
}

.customer-access-panel:not([open]) .customer-access-summary::after {
  content: "Expand";
}

.customer-access-panel .notice,
.customer-access-panel .table-scroll {
  margin-left: 24px;
  margin-right: 24px;
}

.customer-access-panel .notice {
  margin-top: 0;
}

.admin-chart-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin: 16px 0 20px;
}

.admin-chart-tab {
  appearance: none;
  border: 1px solid rgba(31, 122, 107, 0.2);
  background: rgba(31, 122, 107, 0.06);
  color: #075f53;
  border-radius: 12px;
  min-height: 54px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  transition: 0.15s ease;
  width: 100%;
}

.admin-chart-tab:hover {
  background: rgba(31, 122, 107, 0.12);
}

.admin-chart-tab.is-active {
  background: #137f6d;
  border-color: #137f6d;
  color: #fff;
}

.admin-date-range-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  margin: -4px 0 18px;
}

.admin-date-range-tab {
  appearance: none;
  border: 1px solid rgba(31, 122, 107, 0.18);
  background: #ffffff;
  color: #075f53;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  transition: 0.15s ease;
  width: 100%;
}

.admin-date-range-tab:hover {
  background: rgba(31, 122, 107, 0.06);
}

.admin-date-range-tab.is-active {
  background: rgba(31, 122, 107, 0.12);
  border-color: rgba(31, 122, 107, 0.34);
  color: #075f53;
}

.admin-product-filter[hidden] {
  display: none !important;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.admin-sidebar {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 8px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.admin-sidebar .eyebrow {
  margin-bottom: 4px;
}

.admin-nav-button {
  width: 100%;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  text-align: left;
  padding: 0 12px;
}

.admin-nav-button:hover {
  background: rgba(31, 122, 107, 0.07);
  color: var(--accent-dark);
}

.admin-nav-button.is-active {
  background: var(--soft);
  border-color: #c6ddd8;
  color: var(--accent-dark);
}

.admin-page[hidden] {
  display: none !important;
}

.admin-command-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 24px;
}

.admin-command-card .topbar,
.admin-command-card .control-panel,
.admin-command-card .table-section {
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.admin-command-card .topbar {
  padding: 0 0 22px !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

.admin-command-card .admin-panel {
  margin-top: 22px !important;
  padding: 0 !important;
}

.admin-command-card .topbar > div:first-child {
  min-width: 0;
}

.admin-login-panel {
  display: grid;
  grid-template-columns: minmax(240px, 360px) auto;
  align-items: end;
  align-self: flex-end;
  gap: 10px;
  flex: 0 1 500px;
}

.admin-login-panel .ghost-button {
  min-height: 42px;
  white-space: nowrap;
}

.admin-login-panel #loadCustomersButton {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.admin-login-panel #loadCustomersButton:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.admin-login-panel .status-message {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.admin-login-panel .status-message.error {
  color: var(--warn);
}

.admin-command-card .upload-panel {
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 0.8fr) auto minmax(240px, auto) !important;
  align-items: end;
  justify-content: start;
}

.admin-command-card .upload-panel .field-group {
  grid-column: 1;
  grid-row: 1;
  gap: 10px;
}

.admin-command-card .upload-panel #uploadButton {
  grid-column: 3;
  grid-row: 1;
}

.admin-command-card .data-meta {
  grid-column: 4;
  grid-row: 1;
  margin: 0 !important;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  width: auto;
  box-shadow: none;
}

.upload-status {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.upload-status.error {
  color: var(--warn);
}

.upload-status:empty {
  display: none;
}

.admin-command-card .customer-access-panel {
  margin: 20px 0 0 !important;
  border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
  padding-top: 18px !important;
}

.admin-command-card .customer-access-panel[open] {
  padding-bottom: 0 !important;
}

.admin-command-card .customer-access-summary {
  display: grid !important;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  align-items: start !important;
  column-gap: 12px;
  row-gap: 10px;
  padding: 0 !important;
}

.admin-command-card .customer-access-summary > .customer-access-title {
  grid-column: 1;
  grid-row: 1;
}

.admin-command-card .customer-access-summary::after {
  display: none !important;
}

.customer-access-title-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.customer-access-toggle {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(31, 122, 107, 0.22);
  background: rgba(31, 122, 107, 0.08);
  color: #075f53;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  font-weight: 900;
}

.customer-access-toggle::before {
  content: "−";
}

.customer-access-panel:not([open]) .customer-access-toggle::before {
  content: "+";
}

.admin-command-card .customer-access-summary #customerCount {
  grid-column: 3;
  grid-row: 2;
  align-self: start;
  justify-self: end;
  margin-top: 0;
  line-height: 1.35;
}

.admin-command-card .customer-access-panel:not(.is-loaded) #customerCount {
  display: none !important;
}

.customer-access-status {
  grid-column: 1;
  grid-row: 2;
  align-self: start;
  justify-self: start;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.customer-access-status.error {
  color: var(--warn);
}

.customer-access-status:empty {
  display: none;
}

.admin-command-card .customer-access-panel .table-scroll {
  margin-top: 18px;
  margin-left: 0;
  margin-right: 0;
}

.admin-command-card .customer-access-panel:not(.is-loaded) .table-scroll {
  display: none !important;
}

.customer-access-table {
  min-width: 1160px;
  table-layout: fixed;
}

.customer-access-table .customer-name-col {
  width: 14%;
}

.customer-access-table .customer-id-col {
  width: 18%;
}

.customer-access-table .customer-password-col {
  width: 22%;
}

.customer-access-table .customer-copy-col {
  width: 12%;
}

.customer-access-table .customer-data-col {
  width: 10%;
}

.customer-access-table .customer-fulfillment-col {
  width: 24%;
}

.customer-access-table th,
.customer-access-table td {
  height: 58px;
  padding: 12px 16px;
  text-align: center !important;
  vertical-align: middle;
}

.customer-access-table th {
  letter-spacing: 0;
}

.customer-access-table td {
  font-size: 15px;
}

.customer-access-table td strong {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
}

.customer-access-table .small-button,
.customer-access-table .visibility-button,
.customer-access-table .open-customer-button {
  margin-inline: auto;
}

.customer-access-table .small-button {
  min-width: 70px;
  background: rgba(31, 122, 107, 0.045);
  border-color: rgba(31, 122, 107, 0.14);
  color: #075f53;
}

.customer-access-table .small-button:hover {
  background: rgba(31, 122, 107, 0.08);
}

.customer-access-table .open-customer-cell {
  text-align: center !important;
}

.customer-access-table th[data-open-customer-head] {
  text-align: center !important;
}

.customer-access-table .open-customer-button {
  display: inline-flex;
  align-items: center;
  min-width: 210px;
  justify-content: center;
}

.automation-panel {
  margin-top: 18px;
}

.automation-heading {
  margin-bottom: 12px;
  align-items: flex-start;
}

.automation-summary-grid {
  display: grid;
  grid-template-columns: minmax(140px, 0.7fr) minmax(160px, 0.8fr) minmax(320px, 1.7fr);
  gap: 12px;
  margin: 14px 0 18px;
}

.automation-summary-grid > div {
  min-height: 82px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfcfb 0%, #f8fbfa 100%);
  padding: 14px;
}

.automation-summary-grid span,
.muted-cell {
  color: var(--muted);
  font-size: 12px;
}

.automation-summary-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 16px;
  line-height: 1.35;
}

.automation-config-form {
  display: grid;
  gap: 14px;
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  box-shadow: 0 10px 28px rgba(16, 58, 51, 0.04);
}

.automation-config-section {
  display: grid;
  gap: 10px;
  padding: 0 0 14px;
  border-bottom: 1px solid #e8efed;
}

.automation-config-section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.automation-config-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 24px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.automation-config-title span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 22px;
  border-radius: 999px;
  background: #edf7f4;
  color: var(--accent-dark);
}

.automation-config-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.automation-execution-grid {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
}

.automation-config-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.automation-config-form input,
.automation-config-form select,
.automation-config-form textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 10px;
}

.automation-config-form textarea {
  min-height: 78px;
  resize: vertical;
  line-height: 1.45;
}

.automation-config-customers {
  width: 100%;
}

.automation-config-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.automation-config-actions p {
  margin: 0;
}

.automation-customer-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.automation-customer-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 0;
}

.automation-customer-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  padding: 0 12px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.automation-customer-chip:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.automation-customer-chip strong {
  color: var(--ink);
}

.automation-customer-chip span {
  color: var(--muted);
}

.automation-customer-chip.is-selected {
  border-color: var(--line-strong);
  background: #edf7f4;
  color: var(--accent-dark);
}

.automation-customer-chip.is-selected strong,
.automation-customer-chip.is-selected span {
  color: var(--accent-dark);
}

.automation-runs-table {
  min-width: 900px;
}

.automation-runs-table td {
  vertical-align: top;
}

.automation-run-row {
  cursor: default;
}

.automation-run-row.is-selected-run td {
  background: #fbfdfa;
  box-shadow: inset 3px 0 0 var(--accent);
}

.automation-date-row td {
  padding: 0;
  background: #f6faf8;
}

.automation-date-toggle {
  display: grid;
  grid-template-columns: auto auto 1fr repeat(5, auto);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 12px 14px;
}

.automation-date-toggle span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.automation-date-toggle strong {
  color: var(--accent-dark);
}

.automation-date-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #edf7f4;
  color: var(--accent-dark) !important;
}

.automation-run-row td:first-child {
  padding-left: 22px;
}

.automation-runs-table tr.is-ignored-run td {
  background: #f8faf9;
  color: #7a8790;
}

.automation-state {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.automation-state-running {
  background: #fff8e6;
  color: #8a5a00;
}

.automation-state-success {
  background: #eaf7f0;
  color: #16704a;
}

.automation-state-failed {
  background: #fff0ed;
  color: var(--warn);
}

.automation-state-skipped {
  background: #eef2f6;
  color: #536172;
}

.automation-state-aborted {
  background: #eef2f6;
  color: #536172;
}

.automation-state-ignored {
  margin-left: 6px;
  background: #eef2f6;
  color: #536172;
}

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

.automation-progress {
  display: grid;
  gap: 8px;
  min-width: 260px;
}

.automation-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.automation-progress-meta strong {
  color: var(--ink);
}

.automation-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8efed;
}

.automation-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.25s ease;
}

.automation-day-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.automation-day-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  background: #eef2f6;
  color: #536172;
  font-size: 11px;
  font-weight: 800;
}

.automation-day-success {
  background: #eaf7f0;
  color: #16704a;
}

.automation-day-running {
  background: #fff8e6;
  color: #8a5a00;
}

.automation-day-oms_done {
  background: #edf7f4;
  color: var(--accent-dark);
}

.automation-day-failed {
  background: #fff0ed;
  color: var(--warn);
}

.automation-day-aborted {
  background: #eef2f6;
  color: #536172;
}

.ignored-note {
  margin-top: 6px;
}

.automation-detail-panel {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
  overflow: hidden;
}

.automation-detail-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 18px;
}

.automation-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: #f6faf8;
}

.automation-detail-header h3 {
  margin: 3px 0 0;
  font-size: 22px;
  line-height: 1.15;
}

.automation-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.automation-detail-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0 9px;
}

.automation-detail-status {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.automation-detail-status strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.automation-detail-progress {
  padding: 14px 18px 0;
}

.automation-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
  padding: 14px 18px;
}

.automation-detail-metrics > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.automation-detail-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.automation-detail-metrics strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 16px;
}

.automation-detail-message {
  margin: 0 18px 14px;
  border-radius: 8px;
  background: #fff8e6;
  color: #8a5a00;
  font-size: 12px;
  font-weight: 800;
  padding: 10px 12px;
}

.automation-detail-days {
  display: grid;
  gap: 10px;
  padding: 0 18px 18px;
}

.automation-day-detail {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.automation-day-detail-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.automation-day-detail-main strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
}

.automation-day-detail-main span:not(.automation-state) {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.automation-day-detail-progress {
  display: grid;
  gap: 7px;
}

.automation-day-detail-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.automation-day-detail-metrics span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: #eef2f6;
  color: #536172;
  font-size: 11px;
  font-weight: 800;
  padding: 0 8px;
}

.automation-day-detail-error {
  border-radius: 8px;
  background: #fff0ed;
  color: var(--warn);
  font-size: 12px;
  font-weight: 800;
  padding: 9px 10px;
}

@media (max-width: 760px) {
  .admin-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .admin-sidebar {
    position: static;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 10px;
    -webkit-overflow-scrolling: touch;
  }

  .admin-sidebar .eyebrow {
    flex: 0 0 auto;
    margin: 0 4px 0 0;
  }

  .admin-nav-button {
    flex: 0 0 auto;
    width: auto;
    text-align: center;
    padding: 0 14px;
  }

  .admin-command-card {
    padding: 16px;
  }

  .admin-command-card .topbar,
  .admin-login-panel,
  .admin-command-card .upload-panel {
    grid-template-columns: 1fr !important;
  }

  .admin-login-panel {
    width: 100%;
    flex-basis: auto;
  }

  .admin-command-card .upload-panel .field-group,
  .admin-command-card .upload-panel #uploadButton,
  .admin-command-card .data-meta,
  .upload-status {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  .admin-command-card .customer-access-summary {
    grid-template-columns: 1fr auto;
  }

  .admin-command-card .customer-access-summary > .customer-access-title {
    grid-column: 1;
  }

  .admin-command-card .customer-access-summary #customerCount {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 8px;
    line-height: 1.4;
  }

  .customer-access-status {
    grid-column: 1 / -1;
    grid-row: auto;
    margin-top: 8px;
    line-height: 1.4;
  }
}

.order-details-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
  margin: 16px 0;
}

.order-details-filters label {
  display: grid;
  gap: 6px;
  min-width: 220px;
  color: #50606a;
  font-weight: 700;
  font-size: 13px;
}

.order-details-filters input,
.order-details-filters select {
  height: 42px;
  border: 1px solid #d8e2e0;
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  background: #fff;
}

.order-details-filters button {
  height: 42px;
  border: 1px solid #b9d6d0;
  border-radius: 8px;
  padding: 0 18px;
  background: #eef7f5;
  color: #00645d;
  font-weight: 700;
  cursor: pointer;
}

.order-details-filters-inline {
  margin: 14px 0 16px;
  padding: 0;
  box-shadow: none;
  border: 0;
  background: transparent;
}

.order-details-filters-inline label {
  min-width: 230px;
}

.order-details-filters-inline label:nth-child(2) {
  min-width: 320px;
}

.order-details-filters .detail-search-button {
  background: #0f7f72 !important;
  border-color: #0f7f72 !important;
  color: #ffffff !important;
}

.order-details-filters .detail-search-button:hover {
  background: #0b675d !important;
  border-color: #0b675d !important;
}

/* Final stable latest-15 chart view */
.chart-wrap {
  overflow-x: hidden !important;
  overflow-y: visible !important;
  max-width: 100% !important;
}

#barChart {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.earlier-table-box {
  stroke: #fed7aa;
  stroke-width: 1;
}

.earlier-table-title {
  font-size: 12px;
  font-weight: 800;
  fill: #9a3412;
}

.earlier-table-date,
.earlier-table-total {
  font-size: 12px;
  fill: #7c2d12;
}

.earlier-table-total {
  font-weight: 800;
}

/* Chart side legend panel */
.chart-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 260px) !important;
  gap: 18px !important;
  align-items: start !important;
  margin-top: 16px !important;
}

.chart-layout .chart-wrap {
  margin-top: 0 !important;
}

.chart-layout .legend {
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  margin-top: 0 !important;
  max-height: 550px !important;
  overflow: auto !important;
  padding: 2px 4px 2px 0 !important;
}

.chart-layout .legend-item {
  appearance: none !important;
  display: grid !important;
  grid-template-columns: 14px minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  min-height: 34px !important;
  padding: 7px 10px !important;
  border: 1px solid #d8e2e0 !important;
  border-radius: 999px !important;
  background: #ffffff !important;
  color: #50606a !important;
  font: inherit !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  text-align: left !important;
  cursor: pointer !important;
  white-space: nowrap !important;
}

.chart-layout .legend-item:hover,
.chart-layout .legend-item.is-active {
  border-color: #0f7f72 !important;
  background: #eef7f5 !important;
  color: #004d47 !important;
}

.chart-layout .legend-item em {
  margin-left: auto !important;
  color: #66727d !important;
  font-style: normal !important;
  font-weight: 800 !important;
}

.chart-layout .legend-swatch {
  width: 13px !important;
  height: 13px !important;
  border-radius: 4px !important;
}

.earlier-table-box {
  stroke: #b9d6d0 !important;
  stroke-width: 1 !important;
}

.earlier-table-title {
  fill: #00645d !important;
}

.earlier-table-date,
.earlier-table-total {
  fill: #0f766e !important;
}

@media (max-width: 980px) {
  .chart-layout {
    grid-template-columns: 1fr !important;
  }

  .chart-layout .legend {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .chart-layout .legend-item {
    width: auto !important;
  }
}

/* Restored Fulfillment Details filters */
.table-section .order-details-filters-inline {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 12px !important;
  align-items: end !important;
  margin: 14px 0 18px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.table-section .order-details-filters-inline label {
  display: grid !important;
  gap: 6px !important;
  min-width: 230px !important;
  color: #50606a !important;
  font-size: 13px !important;
  font-weight: 800 !important;
}

.table-section .order-details-filters-inline label:nth-child(2) {
  min-width: 320px !important;
}

.table-section .order-details-filters-inline select {
  height: 42px !important;
  border: 1px solid #d8e2e0 !important;
  border-radius: 8px !important;
  padding: 0 12px !important;
  background: #fff !important;
  color: #0f172a !important;
  font: inherit !important;
  font-weight: 700 !important;
}

.table-section .order-details-filters-inline button {
  height: 42px !important;
  border-radius: 8px !important;
  padding: 0 20px !important;
  font: inherit !important;
  font-weight: 800 !important;
  cursor: pointer !important;
}

.table-section .order-details-filters-inline .detail-search-button {
  border: 1px solid #0f7f72 !important;
  background: #0f7f72 !important;
  color: #fff !important;
}

.table-section .order-details-filters-inline #detailClearButton {
  border: 1px solid #b9d6d0 !important;
  background: #eef7f5 !important;
  color: #00645d !important;
}

@media (max-width: 760px) {
  .table-section .order-details-filters-inline,
  .table-section .order-details-filters-inline label,
  .table-section .order-details-filters-inline button {
    width: 100% !important;
    min-width: 0 !important;
  }
}

/* Taller daily chart preview */
#barChart {
  height: 620px !important;
}

.chart-layout .legend {
  max-height: 620px !important;
}

@media (max-width: 760px) {
  #barChart {
    height: 500px !important;
  }
}

/* Chart legend framed panel */
.chart-layout .legend {
  height: 620px !important;
  max-height: 620px !important;
  box-sizing: border-box !important;
  border: 1px solid #dfe5e4 !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfc 100%) !important;
  padding: 10px !important;
}

@media (max-width: 980px) {
  .chart-layout .legend {
    height: auto !important;
    max-height: none !important;
  }
}

/* Compact chart controls and product-name legend */
.chart-section .product-filter {
  margin-bottom: 4px !important;
}

.chart-layout {
  margin-top: 4px !important;
  align-items: stretch !important;
}

.chart-layout .chart-wrap,
.chart-layout .legend {
  height: 620px !important;
  max-height: 620px !important;
  box-sizing: border-box !important;
}

.chart-layout .chart-wrap {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

.chart-layout #barChart {
  height: 100% !important;
}

.chart-layout .legend {
  padding: 10px !important;
}

.chart-layout .legend-item {
  grid-template-columns: 14px minmax(0, 1fr) auto !important;
  min-height: 48px !important;
  border-radius: 14px !important;
  align-items: center !important;
  white-space: normal !important;
}

.chart-layout .legend-text {
  display: grid !important;
  gap: 2px !important;
  min-width: 0 !important;
  line-height: 1.15 !important;
}

.chart-layout .legend-text strong {
  display: block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: #0f172a !important;
  font-size: 12px !important;
  font-weight: 900 !important;
}

.chart-layout .legend-text small {
  display: block !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  color: #64748b !important;
  font-size: 11px !important;
  font-weight: 800 !important;
}

@media (max-width: 980px) {
  .chart-layout .chart-wrap,
  .chart-layout .legend {
    height: auto !important;
    max-height: none !important;
  }

  .chart-layout #barChart {
    height: 500px !important;
  }
}

/* Final chart panel alignment and compact filter spacing */
.chart-section {
  --daily-chart-panel-height: 620px;
}

.chart-section .product-search-hint:empty {
  display: none !important;
  min-height: 0 !important;
  height: 0 !important;
  margin: 0 !important;
}

.chart-section .product-filter {
  margin-bottom: 0 !important;
}

.chart-section .product-search-box {
  row-gap: 0 !important;
}

.chart-layout {
  margin-top: 2px !important;
  align-items: stretch !important;
}

.chart-layout .chart-wrap,
.chart-layout .legend {
  height: var(--daily-chart-panel-height) !important;
  min-height: var(--daily-chart-panel-height) !important;
  max-height: var(--daily-chart-panel-height) !important;
  box-sizing: border-box !important;
  align-self: stretch !important;
}

.chart-layout .chart-wrap {
  padding: 0 !important;
  overflow: hidden !important;
}

.chart-layout #barChart {
  height: 100% !important;
  min-height: 100% !important;
  max-height: 100% !important;
}

.chart-layout .legend {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

@media (max-width: 980px) {
  .chart-layout .chart-wrap,
  .chart-layout .legend {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  .chart-layout #barChart {
    height: 500px !important;
    min-height: 500px !important;
    max-height: 500px !important;
  }
}

/* 2026-05-29 final: compact chart controls, larger legend swatches, disable duplicate drilldown card */
.chart-section .product-filter {
  display: grid !important;
  grid-template-columns: minmax(360px, 480px) minmax(520px, 760px) !important;
  gap: 8px 16px !important;
  align-items: end !important;
  margin-bottom: 0 !important;
}

.chart-section .product-filter > label {
  grid-column: 1 / -1 !important;
  margin: 0 !important;
}

.chart-section #productFilter,
.chart-section .product-search-input,
.chart-section .product-sku-copy-button,
.chart-section .product-search-button,
.chart-section .product-search-clear-button {
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  border-radius: 8px !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
}

.chart-section #productFilter,
.chart-section .product-search-input {
  min-width: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.chart-section .product-search-button,
.chart-section .product-sku-copy-button,
.chart-section .product-search-clear-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.chart-section .product-search-button,
.chart-section .product-search-clear-button {
  padding: 0 18px !important;
}

.chart-section .product-sku-copy-button {
  width: 42px !important;
  padding: 0 !important;
  border: 1px solid #b9d6d0 !important;
  background: #eef7f5 !important;
  color: #00645d !important;
  cursor: pointer !important;
}

.chart-section .product-sku-copy-button:hover,
.chart-section .product-sku-copy-button.is-copied {
  border-color: #0f7f72 !important;
  background: #dff1ed !important;
}

.chart-section .product-sku-copy-icon {
  position: relative !important;
  width: 16px !important;
  height: 18px !important;
  display: inline-block !important;
}

.chart-section .product-sku-copy-icon::before,
.chart-section .product-sku-copy-icon::after {
  content: "" !important;
  position: absolute !important;
  width: 11px !important;
  height: 13px !important;
  border: 2px solid currentColor !important;
  border-radius: 3px !important;
  background: #eef7f5 !important;
}

.chart-section .product-sku-copy-icon::before {
  left: 0 !important;
  top: 4px !important;
}

.chart-section .product-sku-copy-icon::after {
  right: 0 !important;
  top: 0 !important;
}

.chart-section .product-search-box {
  display: grid !important;
  grid-template-columns: minmax(360px, 1fr) auto auto auto !important;
  gap: 10px !important;
  align-items: end !important;
  min-width: 0 !important;
}

.chart-section .product-search-hint {
  display: none !important;
}

.chart-layout {
  margin-top: 8px !important;
  align-items: stretch !important;
}

.chart-layout .chart-wrap,
.chart-layout .legend {
  height: var(--daily-chart-panel-height) !important;
  min-height: var(--daily-chart-panel-height) !important;
  max-height: var(--daily-chart-panel-height) !important;
  align-self: stretch !important;
}

.chart-layout .legend-item {
  grid-template-columns: 28px minmax(0, 1fr) auto !important;
  min-height: 58px !important;
  padding: 8px 12px !important;
  gap: 10px !important;
}

.chart-layout .legend-swatch {
  width: 22px !important;
  height: 22px !important;
  border-radius: 7px !important;
}

.chart-layout .legend-item.is-muted {
  opacity: 0.38 !important;
}

.chart-layout .legend-item.is-muted:hover {
  opacity: 0.78 !important;
}

.chart-layout .legend-text strong {
  white-space: normal !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.selected-date-section {
  display: none !important;
}

.product-capacity-section {
  margin-top: 18px !important;
  padding: 20px !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  background: var(--panel) !important;
  box-shadow: var(--shadow) !important;
}

.capacity-summary {
  display: grid !important;
  grid-template-columns: minmax(280px, 1.4fr) repeat(2, minmax(180px, 0.6fr)) !important;
  gap: 14px !important;
  margin-bottom: 16px !important;
}

.capacity-summary > div {
  min-height: 86px !important;
  padding: 16px !important;
  border: 1px solid #dfe5e4 !important;
  border-radius: 10px !important;
  background: #fbfcfc !important;
}

.capacity-summary span {
  display: block !important;
  margin-bottom: 10px !important;
  color: #66727d !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  text-transform: uppercase !important;
}

.capacity-summary strong {
  display: block !important;
  color: #0f172a !important;
  font-size: 24px !important;
  line-height: 1.2 !important;
  font-weight: 950 !important;
  overflow-wrap: anywhere !important;
}

.product-capacity-section table {
  min-width: 1040px !important;
}

.product-capacity-section td:nth-child(2),
.product-capacity-section td:nth-child(3),
.product-capacity-section td:nth-child(4),
.product-capacity-section td:nth-child(5),
.product-capacity-section td:nth-child(6) {
  text-align: right !important;
  font-variant-numeric: tabular-nums !important;
}

.capacity-positive {
  color: #0f7f72 !important;
  font-weight: 950 !important;
}

.capacity-negative {
  color: #b84a35 !important;
  font-weight: 950 !important;
}

.chart-section .date-hit-zone,
.chart-section .date-label,
.chart-section .stack-total-label,
.chart-section .latest-label,
.chart-section .chart-bar {
  cursor: pointer !important;
}

.chart-section .date-label,
.chart-section .stack-total-label,
.chart-section .latest-label {
  pointer-events: auto !important;
}

.chart-section .date-hit-zone {
  transition: opacity 0.16s ease, fill 0.16s ease !important;
}

.chart-section .is-muted-date {
  opacity: 0.22 !important;
}

.chart-section .is-selected-date {
  opacity: 1 !important;
}

.chart-section .date-label.is-selected-date,
.chart-section .stack-total-label.is-selected-date,
.chart-section .latest-label.is-selected-date {
  fill: #0f7f72 !important;
  font-weight: 950 !important;
}

@media (max-width: 980px) {
  .capacity-summary {
    grid-template-columns: 1fr !important;
  }

  .chart-section .product-filter,
  .chart-section .product-search-box {
    grid-template-columns: 1fr !important;
  }

  .chart-section #productFilter,
  .chart-section .product-search-input,
  .chart-section .product-sku-copy-button,
  .chart-section .product-search-button,
  .chart-section .product-search-clear-button {
    width: 100% !important;
  }
}
