/* =============================================================================
   Sales Table — period bar, summary cards and toolbar (release faadumo36)
   Same visual system as available-accounts.css / reports-analytics.css.
   Rules are scoped to .st-root (summary) and .st-table-card (toolbar), so the
   sales table itself is untouched. Light/dark follow the .dark class.
   ============================================================================= */

.st-root, .st-table-card {
  --st-surface: #ffffff;
  --st-canvas: #f8fafc;
  --st-ink: #0f172a;
  --st-text: #1e293b;
  --st-muted: #64748b;
  --st-faint: #94a3b8;
  --st-line: #e2e8f0;
  --st-line-soft: #f1f5f9;
  --st-brand: #dc2626;
  --st-brand-deep: #b91c1c;
  --st-brand-soft: #fef2f2;
  --st-spend: #cbd5e1;
  --st-gain: #10b981;
  --st-gain-ink: #047857;
  --st-gain-soft: #d1fae5;
  --st-warn: #b45309;
  --st-warn-bar: #f59e0b;
  --st-warn-soft: #fef3c7;
  --st-warn-tint: #fffbeb;
  --st-alert: #dc2626;
  --st-alert-soft: #fee2e2;
}
.dark .st-root, .dark .st-table-card {
  --st-surface: #0f172a;
  --st-canvas: #111c33;
  --st-ink: #f8fafc;
  --st-text: #e2e8f0;
  --st-muted: #94a3b8;
  --st-faint: #64748b;
  --st-line: #1e293b;
  --st-line-soft: #16213a;
  --st-brand: #ef4444;
  --st-brand-deep: #dc2626;
  --st-brand-soft: rgba(239, 68, 68, 0.12);
  --st-spend: #475569;
  --st-gain: #34d399;
  --st-gain-ink: #6ee7b7;
  --st-gain-soft: rgba(52, 211, 153, 0.16);
  --st-warn: #fbbf24;
  --st-warn-bar: #fbbf24;
  --st-warn-soft: rgba(251, 191, 36, 0.14);
  --st-warn-tint: rgba(251, 191, 36, 0.06);
  --st-alert: #f87171;
  --st-alert-soft: rgba(248, 113, 113, 0.14);
}

.st-root { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; color: var(--st-text); font-feature-settings: "tnum" 1, "cv11" 1; }
.st-root *, .st-root *::before, .st-root *::after { box-sizing: border-box; }
.st-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.st-ico-sm { width: 16px; height: 16px; flex: none; }
.st-ico-xs { width: 12px; height: 12px; flex: none; }
.st-root :is(button, input, select):focus-visible { outline: 2px solid var(--st-brand); outline-offset: 2px; }

/* ---------- Period bar ---------- */
.st-period {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 12px 12px 16px;
  background: var(--st-surface); border: 1px solid var(--st-line); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.dark .st-period { box-shadow: none; }
.st-period-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.st-period-icon {
  display: grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: 11px; background: var(--st-brand-soft); color: var(--st-brand);
}
.st-period-text { display: flex; flex-direction: column; min-width: 0; }
.st-period-text strong { font-size: 14px; font-weight: 800; letter-spacing: -0.01em; color: var(--st-ink); }
.st-period-text span { font-size: 12px; color: var(--st-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-cat-chip {
  display: inline-flex; align-items: center; gap: 5px; max-width: 200px; height: 26px; padding: 0 10px;
  border-radius: 999px; background: var(--st-brand-soft); color: var(--st-brand);
  font-size: 12px; font-weight: 700;
}
.st-cat-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.st-seg {
  display: flex; align-items: center; gap: 2px; padding: 4px;
  border-radius: 14px; background: var(--st-line-soft);
  overflow-x: auto; max-width: 100%; scrollbar-width: none;
}
.st-seg::-webkit-scrollbar { display: none; }
.st-seg-btn {
  height: 32px; padding: 0 13px; border: 0; border-radius: 10px; background: transparent;
  color: var(--st-muted); font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.st-seg-btn:hover { color: var(--st-ink); }
.st-seg-btn.is-on, .st-seg-field.is-on {
  background: var(--st-surface); color: var(--st-ink);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14), inset 0 -2px 0 var(--st-brand);
}
.dark .st-seg-btn.is-on, .dark .st-seg-field.is-on { background: #1e293b; }
.st-seg-field {
  position: relative; display: flex; align-items: center; height: 32px; border-radius: 10px;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.st-seg-field input, .st-seg-field select {
  height: 100%; border: 0; background: transparent;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--st-text); cursor: pointer;
}
.st-seg-field input { padding: 0 8px 0 10px; color-scheme: light; }
.dark .st-seg-field input { color-scheme: dark; }
.st-seg-field input:focus-visible, .st-seg-field select:focus-visible { outline: none; }
.st-seg-field:focus-within { box-shadow: 0 0 0 2px var(--st-brand); }
.st-seg-select select { appearance: none; -webkit-appearance: none; padding: 0 26px 0 12px; }
.st-seg-select .st-caret { position: absolute; right: 9px; color: var(--st-faint); pointer-events: none; }
.dark .st-seg-field select option { background: #0f172a; }

/* ---------- Summary cards ---------- */
.st-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.st-card {
  display: flex; flex-direction: column; min-width: 0;
  padding: 16px 16px 14px;
  background: var(--st-surface); border: 1px solid var(--st-line); border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  cursor: pointer; user-select: none;
}
.dark .st-card { box-shadow: none; }
.st-card:hover { border-color: var(--st-faint); }
.st-card.is-selected { border-color: var(--st-ink); box-shadow: inset 0 0 0 1px var(--st-ink); }
.st-tone-warn { background: var(--st-warn-tint); border-color: rgba(245, 158, 11, 0.45); }
.st-tone-warn:hover { border-color: var(--st-warn-bar); }
.st-tone-alert { border-color: rgba(220, 38, 38, 0.35); }

.st-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 26px; }
.st-card-label { font-size: 12.5px; font-weight: 600; color: var(--st-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tone-warn .st-card-label { color: var(--st-warn); }
.st-tone-alert .st-card-label { color: var(--st-alert); }
.st-card-icon {
  display: grid; place-items: center; width: 28px; height: 28px; flex: none;
  border-radius: 9px; background: var(--st-line-soft); color: var(--st-muted);
}
.st-tone-gain .st-card-icon { background: var(--st-gain-soft); color: var(--st-gain-ink); }
.st-tone-warn .st-card-icon { background: var(--st-warn-soft); color: var(--st-warn); }
.st-card-pick {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px;
  border-radius: 999px; border: 1px solid var(--st-line);
  font-size: 11.5px; font-weight: 700; color: var(--st-muted); flex: none;
}
.st-card.is-selected .st-card-pick { background: var(--st-ink); border-color: var(--st-ink); color: var(--st-surface); }

.st-card-mid { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; }
.st-card-value {
  font-size: 26px; line-height: 1.05; font-weight: 800; letter-spacing: -0.035em; color: var(--st-ink);
  white-space: nowrap;
}
.st-tone-gain .st-card-value { color: var(--st-gain-ink); }
.st-card-value.is-loss { color: var(--st-alert); }
.st-tone-warn .st-card-value { color: var(--st-warn); }
.st-card-value.is-alert { color: var(--st-alert); }

.st-chip {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px;
  background: var(--st-line-soft); color: var(--st-muted); font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.st-chip-gain { background: var(--st-gain-soft); color: var(--st-gain-ink); }
.st-chip-alert { background: var(--st-alert-soft); color: var(--st-alert); }

.st-bar { display: flex; height: 6px; margin-top: 12px; border-radius: 999px; overflow: hidden; background: var(--st-line-soft); }
.st-bar span { height: 100%; transition: width 0.35s ease; }
.st-bar-paid, .st-bar-gain { background: var(--st-gain); }
.st-bar-owed { background: var(--st-warn-bar); }
.st-bar-spend { background: var(--st-spend); }

.st-card-foot {
  display: block;
  margin-top: auto; padding-top: 10px;
  font-size: 12px; line-height: 1.35; color: var(--st-muted);
}
.st-card-foot > * { margin-right: 6px; }
.st-foot-strong { font-weight: 700; color: var(--st-text); }
.st-tone-warn .st-foot-strong { color: var(--st-warn); }
.st-dot { display: inline-block; vertical-align: 1px; width: 7px; height: 7px; border-radius: 50%; background: var(--st-faint); }
.st-dot.is-live { background: var(--st-alert); box-shadow: 0 0 0 3px var(--st-alert-soft); }

/* Keep the existing zoom-on-click, but in the new colours. */
.st-card.card-zoomable.card-zoomed { border-color: var(--st-ink) !important; box-shadow: 0 14px 30px -10px rgba(15, 23, 42, 0.28) !important; }
.dark .st-card.card-zoomable.card-zoomed { border-color: #cbd5e1 !important; box-shadow: 0 14px 30px -10px rgba(0, 0, 0, 0.6) !important; }
.st-card.card-zoomable:focus-visible { outline: 2px solid var(--st-brand); }

@media (max-width: 1279px) { .st-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .st-period { padding: 12px; }
  .st-seg { width: 100%; flex-wrap: wrap; overflow: visible; }
  .st-seg-btn, .st-seg-field { flex: 1 1 auto; justify-content: center; }
  .st-card-label { white-space: normal; line-height: 1.25; }
  .st-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .st-card { padding: 14px 13px 12px; border-radius: 16px; }
  .st-card-value { font-size: 22px; }
  .st-card-pick { padding: 0 7px; }
}

/* ---------- Toolbar above the sales table ---------- */
.st-table-card { border-radius: 20px !important; border-color: var(--st-line) !important; }
.st-table-card .st-toolbar {
  gap: 10px !important; padding: 14px 16px !important;
  background: var(--st-surface) !important; border-bottom-color: var(--st-line) !important;
}
.st-table-card .st-search { width: 220px !important; max-width: 100%; }
@media (max-width: 639px) { .st-table-card .st-search { width: 100% !important; } }
.st-table-card .st-search input {
  height: 38px; padding-top: 0 !important; padding-bottom: 0 !important;
  border-radius: 12px !important; border-color: var(--st-line) !important;
  background: var(--st-canvas) !important; font-size: 13px !important;
}
.st-table-card .st-search input:focus { background: var(--st-surface) !important; border-color: var(--st-faint) !important; box-shadow: none !important; outline: 2px solid var(--st-brand); outline-offset: 1px; }
.st-table-card .st-search > svg { top: 11px !important; }
.st-table-card .st-search > button { top: 10px !important; }
.st-table-card .st-cat select {
  width: 170px !important;
  height: 38px; padding-top: 0 !important; padding-bottom: 0 !important;
  border-radius: 12px !important; border-color: var(--st-line) !important;
  font-size: 13px !important; font-weight: 600 !important;
}
.st-table-card .st-addcat {
  height: 38px; padding: 0 12px !important; border-radius: 12px !important;
  background: var(--st-surface) !important; border-color: var(--st-line) !important;
  font-size: 13px !important; font-weight: 700 !important;
}
.st-table-card .st-addcat:hover { background: var(--st-canvas) !important; }

.st-table-card .st-pills {
  gap: 2px !important; padding: 4px !important;
  border-radius: 13px; background: var(--st-line-soft);
}
.st-table-card .st-pill {
  height: 30px; padding: 0 8px !important;
  border: 0 !important; border-radius: 9px !important;
  background: transparent !important; color: var(--st-muted) !important;
  font-size: 12px !important; font-weight: 600 !important; box-shadow: none !important;
}
.st-table-card .st-pill:hover { color: var(--st-ink) !important; }
.st-table-card .st-pill.is-on {
  background: var(--st-brand) !important; color: #fff !important;
  box-shadow: 0 4px 10px -6px rgba(220, 38, 38, 0.8) !important;
}

.st-table-card .st-actions { gap: 6px !important; }
.st-table-card .st-export, .st-table-card .st-trash {
  height: 38px; padding: 0 12px !important; border-radius: 12px !important;
  background: var(--st-surface) !important; border-color: var(--st-line) !important;
  color: var(--st-text) !important; font-size: 13px !important; font-weight: 600 !important; box-shadow: none !important;
}
.st-table-card .st-export:hover { background: var(--st-canvas) !important; }
.st-table-card .st-trash:hover { background: var(--st-alert-soft) !important; color: var(--st-alert) !important; border-color: transparent !important; }
.st-table-card .st-trash .st-badge { margin-left: 2px; padding: 1px 7px !important; font-size: 11px !important; }
.st-table-card .st-add {
  height: 38px; padding: 0 16px !important; border-radius: 12px !important;
  font-size: 13px !important; font-weight: 700 !important;
  box-shadow: 0 6px 14px -8px rgba(220, 38, 38, 0.9) !important;
}

@media (max-width: 639px) {
  .st-table-card .st-cat { flex: 1 1 auto; }
  .st-table-card .st-cat select { width: 100% !important; }
}

@media (prefers-reduced-motion: reduce) {
  .st-root *, .st-table-card .st-toolbar * { transition: none !important; }
}

/* =============================================================================
   Sales table (rows) — release faadumo37
   Visual only. Columns, sorting, selection, Actions menu, debt buttons, copy
   buttons, highlighted rows and Blur keep working exactly as before.
   Columns (tr.st-row > td): 1 select, 2 #, 3 name, 4 email, 5 phone,
   6 service, 7 sale date, 8 days, 9 expiry, 10 remaining, 11 status,
   12 sale, 13 cost, 14 profit, 15 debt, 16 actions.
   ============================================================================= */

.st-table-card .sales-grid { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; font-feature-settings: "tnum" 1, "cv11" 1; font-size: 12.5px !important; }

/* ---- Header ---- */
.st-table-card .sales-grid thead tr.st-head,
.st-table-card .sales-grid thead tr.st-head > th {
  background-color: var(--st-surface) !important;
  border-top: 0 !important;
  border-bottom: 1px solid var(--st-line) !important;
  border-left: 0 !important;
  border-right: 0 !important;
  box-shadow: none !important;
}
.st-table-card .sales-grid thead tr.st-head > th {
  padding: 12px 6px !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: var(--st-muted) !important;
}
.st-table-card .sales-grid thead tr.st-head > th span { color: inherit !important; text-transform: none !important; letter-spacing: 0 !important; }
.st-table-card .sales-grid thead tr.st-head > th svg { color: var(--st-brand) !important; }
.st-table-card .sales-grid thead tr.st-head > th:hover { color: var(--st-ink) !important; }
.st-table-card .sales-grid thead tr.st-head > th:nth-child(14) { background-color: var(--st-gain-soft) !important; color: var(--st-gain-ink) !important; }
.st-table-card .sales-grid thead tr.st-head > th:nth-child(15) { background-color: var(--st-warn-soft) !important; color: var(--st-warn) !important; }
.st-table-card .sales-grid thead tr.st-head > th:nth-child(3) { box-shadow: 1px 0 0 var(--st-line) !important; }
.st-table-card .sales-grid thead tr.st-head > th:nth-child(16) { box-shadow: -1px 0 0 var(--st-line) !important; }

/* ---- Rows ---- */
.st-table-card .sales-grid tbody tr.st-row > td {
  padding: 10px 6px !important;
  border-top: 0 !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-bottom: 1px solid var(--st-line-soft) !important;
  box-shadow: none !important;
  vertical-align: middle;
}
.st-table-card .sales-grid tbody { border-top: 0 !important; }
.st-table-card .sales-grid tbody > tr { border-top-width: 0 !important; }

/* Sticky columns stay opaque and keep a thin edge */
.st-table-card .sales-grid tbody tr.st-row > td:is(:nth-child(1), :nth-child(2), :nth-child(3), :nth-child(16)) { background-color: var(--st-surface) !important; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(3) { box-shadow: 1px 0 0 var(--st-line) !important; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(16) { box-shadow: -1px 0 0 var(--st-line) !important; }

/* Column tints (not on the highlighted row, which keeps its own colour) */
.st-table-card .sales-grid tbody tr.st-row:not(.sales-row-highlighted) > td:nth-child(14) { background-color: rgba(16, 185, 129, 0.06) !important; }
.st-table-card .sales-grid tbody tr.st-row:not(.sales-row-highlighted) > td:nth-child(15) { background-color: rgba(245, 158, 11, 0.07) !important; }

/* Hover and picked rows: one colour across the whole row, sticky cells included */
.st-table-card .sales-grid tbody tr.st-row:not(.sales-row-highlighted):hover > td { background-color: var(--st-canvas) !important; }
.st-table-card .sales-grid tbody tr.st-row.is-picked:not(.sales-row-highlighted) > td { background-color: var(--st-brand-soft) !important; }
.st-table-card .sales-grid tbody tr.st-row:not(.sales-row-highlighted):hover { background-color: transparent !important; }

/* ---- Cell content ---- */
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(2) { font-family: inherit !important; font-size: 11.5px !important; color: var(--st-faint) !important; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(3) button { font-size: 12.5px !important; font-weight: 700; color: var(--st-ink); line-height: 1.3; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(3) svg { color: var(--st-faint); }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(4),
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(4) button[data-email-trigger] { font-size: 12.5px !important; color: var(--st-muted) !important; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(4) [data-email-popover] { color: var(--st-text); }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(5) { font-family: inherit !important; font-size: 11.5px !important; line-height: 1.35; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(5) a { color: var(--st-gain-ink) !important; font-weight: 600; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(5) > div > svg { color: var(--st-faint) !important; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(6) { font-family: inherit !important; font-size: 12px !important; font-weight: 600 !important; color: var(--st-text) !important; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(6) span[title] { font-size: 12px !important; line-height: 1.3; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(6) small { padding: 1px 7px !important; border-radius: 999px; background: var(--st-brand-soft) !important; color: var(--st-brand) !important; font-size: 10.5px !important; font-weight: 800 !important; }
.st-table-card .sales-grid tbody tr.st-row > td:is(:nth-child(7), :nth-child(9)) {
  font-family: inherit !important; font-size: 12.5px !important; font-weight: 500 !important;
  letter-spacing: 0 !important; color: var(--st-text) !important;
}
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(8) { font-family: inherit !important; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(8) span {
  padding: 2px 8px !important; border-radius: 999px !important;
  background: var(--st-line-soft) !important; color: var(--st-muted) !important;
  font-family: inherit !important; font-size: 11.5px !important; font-weight: 700 !important;
}
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(10) { font-family: inherit !important; font-size: 12px !important; font-weight: 500 !important; color: var(--st-muted) !important; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(10) span { font-family: inherit !important; font-size: 12px !important; font-weight: 500 !important; color: var(--st-muted) !important; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(10) span.bg-red-100 {
  padding: 2px 8px !important; border: 0 !important;
  background: var(--st-alert-soft) !important; color: var(--st-alert) !important; font-weight: 700 !important;
}
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(10) span.text-red-600 { color: var(--st-alert) !important; font-weight: 700 !important; }

.st-table-card .sales-grid .st-status {
  gap: 6px !important; height: 24px; padding: 0 10px !important;
  border: 0 !important; border-radius: 999px !important;
  font-size: 11.5px !important; font-weight: 700 !important;
  letter-spacing: 0 !important; text-transform: none !important;
}
.st-table-card .sales-grid .st-status.is-active { background: var(--st-gain-soft) !important; color: var(--st-gain-ink) !important; }
.st-table-card .sales-grid .st-status.is-active > span { width: 6px !important; height: 6px !important; background: var(--st-gain) !important; animation: none !important; }
.st-table-card .sales-grid .st-status.is-expired { background: var(--st-alert-soft) !important; color: var(--st-alert) !important; }
.st-table-card .sales-grid .st-status.is-expired::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.st-table-card .sales-grid tbody tr.st-row > td:is(:nth-child(12), :nth-child(13), :nth-child(14), :nth-child(15)) {
  font-family: inherit !important; font-size: 13px !important; letter-spacing: -0.01em !important;
}
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(11) { font-family: inherit !important; font-size: 12px !important; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(12) { font-weight: 700 !important; color: var(--st-ink) !important; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(13) { font-weight: 500 !important; color: var(--st-muted) !important; }
.st-table-card .sales-grid tbody tr.st-row > td.profit-cell { color: var(--st-gain-ink) !important; font-weight: 800 !important; border-inline: 0 !important; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(15) { font-weight: 700 !important; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(15) > span { color: var(--st-faint) !important; font-weight: 500 !important; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(15) button.font-mono { font-family: inherit !important; font-size: 13px !important; color: var(--st-warn) !important; }

.st-table-card .sales-grid .st-actbtn {
  height: 30px; padding: 0 11px !important; border-radius: 9px !important;
  background: var(--st-surface) !important; border: 1px solid var(--st-line) !important;
  color: var(--st-text) !important; font-size: 12px !important; font-weight: 700 !important;
}
.st-table-card .sales-grid .st-actbtn:hover, .st-table-card .sales-grid .st-actbtn[aria-expanded="true"] { background: var(--st-ink) !important; border-color: var(--st-ink) !important; color: var(--st-surface) !important; }

/* ---- Totals row ---- */
.st-table-card .sales-grid tfoot tr.st-foot > td {
  padding-top: 12px !important; padding-bottom: 12px !important;
  background-color: var(--st-canvas) !important;
  border-top: 1px solid var(--st-line) !important;
  font-family: inherit !important; font-size: 13px !important;
}
.st-table-card .sales-grid tfoot tr.st-foot > td:nth-child(2) { font-size: 11.5px !important; color: var(--st-faint) !important; }
.st-table-card .sales-grid tfoot tr.st-foot > td:nth-child(3) { text-transform: none !important; letter-spacing: 0 !important; font-size: 13px !important; color: var(--st-ink) !important; }
.st-table-card .sales-grid tfoot tr.st-foot > td.total-profit-cell { background-color: var(--st-gain-soft) !important; color: var(--st-gain-ink) !important; }
.st-table-card .sales-grid tfoot tr.st-foot > td:nth-child(14) { background-color: var(--st-warn-soft) !important; color: var(--st-warn) !important; }

/* Phone and service: wrap only between words, and let the copy buttons take
   no room until the cell is hovered or focused. */
.st-table-card .sales-grid tbody tr.st-row > td:is(:nth-child(5), :nth-child(6)) { word-break: keep-all !important; overflow-wrap: normal !important; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(5) a,
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(5) span { white-space: normal; text-align: center; }
.st-table-card .sales-grid tbody tr.st-row .alpha-inline-copy { width: 0 !important; padding: 0 !important; overflow: hidden; transition: opacity 150ms, width 150ms; }
.st-table-card .sales-grid tbody tr.st-row td:is(:hover, :focus-within) .alpha-inline-copy { width: 16px !important; padding: 2px !important; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(15) :is(span, button):not(.font-mono) { font-size: 10.5px !important; letter-spacing: 0 !important; line-height: 1.3; }
.st-table-card .sales-grid tbody tr.st-row > td:nth-child(15) span.text-emerald-700 { color: var(--st-gain-ink) !important; font-weight: 600; }
