/* Epicor Sales Dashboard — layout aligned with the xhtml sales dashboard. */
.xsd {
  --xsd-purple: #452b90;
  --xsd-purple-2: #6a4bb8;
  --xsd-green: #27a143;
  --xsd-ink: #1f2937;
  --xsd-muted: #6b7280;
  --xsd-line: #e6e1d8;
  --xsd-card: #ffffff;
  --xsd-bg: transparent;
  background: transparent;
  border-radius: 0;
  padding: 0;
  color: var(--xsd-ink);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

[data-theme="dark"] .xsd {
  --xsd-ink: #e8eaf2;
  --xsd-muted: #a3acc0;
  --xsd-line: #2c3348;
  --xsd-card: #1a2033;
  --xsd-bg: transparent;
  --xsd-purple: #a78bfa;
}

.xsd-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
  align-items: start;
}

.xsd-main,
.xsd-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.xsd-side {
  position: sticky;
  top: 12px;
  align-self: start;
}

.xsd-kpi-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 12px;
  align-items: stretch;
}

.xsd-kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.xsd-card {
  background: var(--xsd-card);
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(31, 41, 55, 0.06);
  border: 1px solid rgba(69, 43, 144, 0.06);
  min-width: 0;
}

[data-theme="dark"] .xsd-card {
  box-shadow: none;
}

.xsd-kpi {
  padding: 14px 14px 6px;
  min-height: 168px;
  display: flex;
  flex-direction: column;
}

.xsd-kpi-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.xsd-kpi h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--xsd-muted);
}

.xsd-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--xsd-purple);
  color: #fff;
  display: grid;
  place-items: center;
  flex: none;
}

.xsd-metric {
  margin-top: 6px;
}

.xsd-metric small {
  display: block;
  font-size: 11px;
  font-weight: 650;
}

.xsd-metric b {
  display: block;
  font-size: 18px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
  color: var(--xsd-ink);
}

.xsd-metric.is-ok small { color: #1f9d55; }
.xsd-metric.is-bad small { color: #dc3545; }
.xsd-metric.is-sum small { color: var(--xsd-purple); }

.xsd-spark {
  margin-top: auto;
  height: 52px;
}

.xsd-server {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100%;
}

.xsd-server-gauge {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 4px auto 8px;
}

.xsd-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: conic-gradient(var(--ring, #28a745) calc(var(--p, 100) * 1%), #e9ecef 0);
  display: grid;
  place-items: center;
}

.xsd-ring span {
  width: 102px;
  height: 102px;
  border-radius: 50%;
  background: var(--xsd-card);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 22px;
  color: var(--ring, #28a745);
}

.xsd-server-badge {
  position: absolute;
  left: 8px;
  bottom: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f8b940;
  color: #222b40;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.18);
}

.xsd-server-meta {
  width: 100%;
  text-align: center;
}

.xsd-server-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.xsd-server h4 {
  margin: 0;
  color: #1e293b;
  font-size: 16px;
  font-weight: 750;
}

.xsd-server-refresh {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid #c7d2fe;
  background: #fff;
  color: #452b90;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.xsd-server-refresh:hover { background: #eef2ff; }

.xsd-server-desc {
  margin: 0 0 10px;
  font-size: 14px;
  color: #1f2937;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  text-align: start;
  line-height: 1.35;
}

.xsd-server-desc i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex: none;
  display: inline-block;
}

.xsd-server-desc i.is-ok { background: #059669; }
.xsd-server-desc i.is-bad { background: #dc2626; }
.xsd-server-desc small { color: #64748b; font-size: 12px; }

.xsd-server-bar {
  height: 10px;
  border-radius: 999px;
  background: #e9ecef;
  overflow: hidden;
  margin-bottom: 10px;
}

.xsd-server-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #28a745;
  transition: width 0.25s ease;
}

.xsd-server.is-bad .xsd-server-bar span { background: #dc3545; }

.xsd-server-foot {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: #28a745;
}

.xsd-server.is-bad .xsd-server-foot { color: #dc3545; }

[data-theme="dark"] .xsd-server h4 { color: var(--xsd-ink); }
[data-theme="dark"] .xsd-server-refresh { background: #182237; border-color: #334155; color: #a78bfa; }
[data-theme="dark"] .xsd-server-desc { color: #e2e8f0; }
[data-theme="dark"] .xsd-server-bar { background: #243044; }

.xsd-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.xsd-section-head h5,
.xsd-card-title {
  margin: 0;
  color: var(--xsd-purple);
  font-size: 16px;
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.xsd-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.xsd-tools input,
.xsd-search {
  height: 32px;
  border: 1px solid var(--xsd-line);
  background: var(--xsd-card);
  color: var(--xsd-ink);
  border-radius: 8px;
  padding: 0 10px;
  font-size: 13px;
  min-width: 0;
  width: 180px;
}

.xsd-btn {
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--xsd-line);
  background: var(--xsd-card);
  color: var(--xsd-ink);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.xsd-btn:hover { border-color: var(--xsd-purple); color: var(--xsd-purple); }
.xsd-btn:disabled { opacity: 0.45; cursor: default; }

.xsd-btn-green {
  background: #27a143;
  color: #fff;
  border: 0;
  height: 44px;
  width: 100%;
  border-radius: 12px;
  font-weight: 750;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 18px rgba(39, 161, 67, 0.25);
  cursor: pointer;
}

.xsd-btn-green:hover { color: #fff; background: #1e8a36; }

.xsd-ni-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.xsd-ni {
  min-width: 190px;
  flex: 1 0 190px;
  padding: 12px 14px;
}

.xsd-ni h6 {
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.xsd-ni b {
  display: block;
  font-size: 18px;
  margin: 0 0 6px;
}

.xsd-flag {
  width: 22px;
  height: 16px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}

.xsd-flag-fallback {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 16px;
  padding: 0 3px;
  border-radius: 2px;
  background: #e5e7eb;
  color: #374151;
  font-size: 9px;
  font-weight: 800;
}

.xsd-daily {
  overflow: hidden;
  --ds-accent: #452b90;
  --ds-range: #e8f4ff;
  --ds-start: #52c41a;
}

.xsd-daily-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #eef2f6;
  background: #fff;
}

.xsd-daily-body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 320px;
}

.xsd-cal {
  padding: 12px 10px 14px;
  border-inline-end: 1px solid var(--xsd-line);
  user-select: none;
}

.xsd-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 8px;
}

.xsd-cal-btns {
  display: inline-flex;
  gap: 4px;
}

.xsd-cal-label {
  color: #1e293b;
  font-size: 13px;
  font-weight: 700;
  min-width: 7rem;
  text-align: center;
}

.xsd-cal-nav button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 0;
  background: #f1f5f9;
  cursor: pointer;
  color: #334155;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
  z-index: 2;
  position: relative;
}

.xsd-cal-nav button:hover { background: #e2e8f0; }

.xsd-page button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--xsd-line);
  background: var(--xsd-card);
  cursor: pointer;
  color: var(--xsd-ink);
}

.xsd-week,
.xsd-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  text-align: center;
}

.xsd-week span {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 700;
  padding: 2px 0;
}

.xsd-day {
  height: 28px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #334155;
  cursor: pointer;
  font-size: 12px;
  position: relative;
  line-height: 1;
  padding: 0;
}

.xsd-day.is-out {
  color: #cbd5e1;
  cursor: default;
}

.xsd-day.is-in:not(.is-out) {
  background: var(--ds-range);
  border-radius: 0;
}

.xsd-day.is-edge:not(.is-out),
.xsd-day.is-single:not(.is-out) {
  background: var(--ds-start);
  color: #fff;
  font-weight: 700;
  border-radius: 4px;
  z-index: 1;
}

.xsd-day.is-edge.is-in:not(.is-single):first-of-type,
.xsd-day.is-edge.is-in:not(.is-single) {
  border-radius: 4px;
}

.xsd-day.is-today:not(.is-edge):not(.is-out) {
  box-shadow: inset 0 0 0 1px #94a3b8;
}

.xsd-range {
  margin-top: 8px;
  font-size: 11px;
  color: #64748b;
  text-align: center;
  line-height: 1.3;
}

.xsd-ds-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.xsd-ds-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
}

.xsd-ds-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.xsd-ds-chip {
  background: #f1f5f9;
  color: #334155;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
}

.xsd-ds-chip.is-ok { background: #e8f8ec; color: #15803d; }
.xsd-ds-chip.is-warn { background: #fff4e5; color: #c2410c; }

.xsd-btn.is-excel {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.xsd-btn.is-print {
  background: #452b90;
  border-color: #452b90;
  color: #fff;
}

.xsd-btn.is-refresh {
  background: #ea580c;
  border-color: #ea580c;
  color: #fff;
}

.xsd-btn.is-excel:hover,
.xsd-btn.is-print:hover,
.xsd-btn.is-refresh:hover {
  color: #fff;
  filter: brightness(1.05);
}

.xsd-status-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.xsd-status-pill.is-ok {
  background: #e8f8ec;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.xsd-status-pill.is-warn {
  background: #fff4e5;
  color: #c2410c;
  border: 1px solid #fdba74;
}

.xsd-cell-customer { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xsd-cell-desc { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xsd-cell-part { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.xsd-table-wrap { overflow: auto; max-height: 420px; }
.xsd-daily .xsd-table-wrap {
  max-height: 360px;
  cursor: grab;
}
.xsd-daily .xsd-table-wrap.is-drag {
  cursor: grabbing;
  user-select: none;
}

.xsd-daily .xsd-foot {
  background: #eef6ff;
  color: #1e3a5f;
}

[data-theme="dark"] .xsd-daily-head { background: var(--xsd-card); border-bottom-color: var(--xsd-line); }
[data-theme="dark"] .xsd-cal-label { color: var(--xsd-ink); }
[data-theme="dark"] .xsd-cal-nav button { background: #243044; color: #e2e8f0; }
[data-theme="dark"] .xsd-cal-nav button:hover { background: #334155; }
[data-theme="dark"] .xsd-day { color: #e2e8f0; }
[data-theme="dark"] .xsd-day.is-out { color: #475569; }
[data-theme="dark"] .xsd-day.is-in:not(.is-out) { background: rgba(82, 196, 26, 0.18); }
[data-theme="dark"] .xsd-daily .xsd-foot { background: #1a2740; color: #bfdbfe; }

.xsd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.xsd-table th {
  position: sticky;
  top: 0;
  background: #6c757d;
  color: #fff;
  text-align: start;
  padding: 8px 10px;
  font-weight: 700;
  white-space: nowrap;
  z-index: 1;
}

.xsd-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--xsd-line);
  vertical-align: middle;
}

.xsd-table tbody tr:hover td { background: rgba(69, 43, 144, 0.05); }
.xsd-table tfoot td {
  background: #1f2937;
  color: #fff;
  font-weight: 750;
}

.xsd-table .num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.xsd-link { color: var(--xsd-purple); font-weight: 700; text-decoration: none; }
.xsd-link:hover { text-decoration: underline; }

.xsd-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 140px;
}

.xsd-bar i {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: #ece7f8;
  overflow: hidden;
}

.xsd-bar i span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #452b90, #7c5cbf);
}

.xsd-card-pad { padding: 12px 12px 4px; }

.xsd-pages {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding: 8px;
  flex-wrap: wrap;
}

.xsd-page-btn {
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--xsd-line);
  background: var(--xsd-card);
  color: var(--xsd-ink);
  cursor: pointer;
  font-size: 12px;
}

.xsd-page-btn.is-on {
  background: var(--xsd-purple);
  color: #fff;
  border-color: var(--xsd-purple);
}

.xsd-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.xsd-split.is-flip { grid-template-columns: 300px minmax(0, 1fr); }

.xsd-pie {
  padding: 12px;
  min-height: 280px;
}

.xsd-pie-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.xsd-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 140px;
  overflow: auto;
  font-size: 11px;
}

.xsd-legend div {
  display: flex;
  gap: 6px;
  align-items: center;
}

.xsd-legend i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.xsd-legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.xsd-legend b { margin-inline-start: auto; font-variant-numeric: tabular-nums; }

.xsd-filter {
  overflow: hidden;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 150px);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.xsd-filter-head {
  background: linear-gradient(90deg, #27a143, #1e8a36);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex: none;
}

.xsd-filter-head b {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.xsd-filter-head button {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  height: 32px;
  padding: 0 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}

.xsd-filter-head button:hover { background: rgba(255, 255, 255, 0.24); }

.xsd-filter-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  min-height: 0;
  background: var(--xsd-card);
}

.xsd-filter-foot {
  padding: 12px 16px 16px;
  flex: none;
  background: var(--xsd-card);
  border-top: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.xsd-btn-green.is-dirty { box-shadow: 0 0 0 3px rgba(39, 161, 67, 0.28); }

.xsd-field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
}

.xsd-field-label span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.xsd-field-label span svg { color: #27a143; }

.xsd-field-label em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: #27a143;
  background: #e8f8ec;
  border: 1px solid #c6ebd0;
  border-radius: 999px;
  padding: 2px 8px;
}

.xsd-list-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
}

.xsd-panel-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}

.xsd-flink {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: #27a143;
}

.xsd-flink.is-muted { color: #94a3b8; }
.xsd-flink.is-muted:hover { color: #64748b; }

.xsd-search-wrap {
  position: relative;
  margin-bottom: 8px;
}

.xsd-search-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.xsd-search-wrap input {
  width: 100%;
  height: 34px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  color: var(--xsd-ink);
  padding: 0 10px 0 30px;
  font-size: 12px;
  outline: none;
}

.xsd-search-wrap input:focus { border-color: #27a143; }

.xsd-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.xsd-chip-wrap.is-countries {
  max-height: 220px;
  overflow: auto;
}

.xsd-chip-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  line-height: 1.2;
}

.xsd-chip-opt:hover { border-color: #a8dfb5; }

.xsd-chip-mark {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  display: inline-grid;
  place-items: center;
  flex: none;
  color: #fff;
}

.xsd-chip-opt.is-on {
  background: #27a143;
  border-color: #27a143;
  color: #fff;
  box-shadow: 0 6px 14px rgba(39, 161, 67, 0.22);
}

.xsd-chip-opt.is-on .xsd-chip-mark {
  border-color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.18);
}

.xsd-chip-opt.is-soft.is-on {
  background: #e8f8ec;
  border-color: #27a143;
  color: #166534;
  box-shadow: none;
}

.xsd-chip-opt.is-soft.is-on .xsd-chip-mark {
  border-color: #27a143;
  background: #27a143;
  color: #fff;
}

.xsd-chip-opt.is-off {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.xsd-chip-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.xsd-tags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.xsd-tags-empty {
  font-size: 12px;
  color: #94a3b8;
  font-style: italic;
}
.xsd-tag {
  display: inline-flex;
  align-items: center;
  background: #e8f8ec;
  color: #1e8a36;
  border: 1px solid #c6ebd0;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
}

[data-theme="dark"] .xsd-list-box { background: #121a2b; border-color: #243450; }
[data-theme="dark"] .xsd-panel-actions { border-bottom-color: #243450; }
[data-theme="dark"] .xsd-search-wrap input { background: #182237; border-color: #334155; }
[data-theme="dark"] .xsd-chip-opt { background: #182237; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .xsd-chip-opt.is-on { background: #27a143; border-color: #27a143; color: #fff; }
[data-theme="dark"] .xsd-chip-opt.is-soft.is-on { background: rgba(39, 161, 67, 0.18); color: #86efac; }
[data-theme="dark"] .xsd-field-label { color: #94a3b8; }
[data-theme="dark"] .xsd-filter-foot { border-top-color: #243450; }
[data-theme="dark"] .xsd-tag { background: rgba(39, 161, 67, 0.16); color: #86efac; border-color: rgba(39, 161, 67, 0.35); }

.xsd-compare { padding: 14px; text-align: center; }
.xsd-compare p { margin: 8px 0 0; color: var(--xsd-muted); font-size: 12px; }

.xsd-banner {
  background: #fff4f4;
  color: #9f1239;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
}

.xsd-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 180px;
  color: var(--xsd-purple);
  font-weight: 700;
}

.xsd-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.xsd-chip {
  background: #ece7f8;
  color: var(--xsd-purple);
  border-radius: 99px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
}

.xsd-status-ok { color: #15803d; font-weight: 750; }
.xsd-status-no { color: #b91c1c; font-weight: 750; }

.xsd-modal-back {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 16px;
}

.xsd-modal {
  width: min(560px, 100%);
  background: var(--xsd-card);
  color: var(--xsd-ink);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.xsd-modal h3 { margin: 0 0 12px; color: var(--xsd-purple); }
.xsd-modal-row { display: flex; gap: 10px; margin-bottom: 12px; }
.xsd-modal-row label { flex: 1; font-size: 12px; font-weight: 700; display: flex; flex-direction: column; gap: 4px; }
.xsd-modal-row select, .xsd-modal select {
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--xsd-line);
  background: var(--xsd-card);
  color: var(--xsd-ink);
  padding: 0 8px;
}

.xsd-foot {
  padding: 8px 12px;
  border-top: 1px solid var(--xsd-line);
  font-size: 12px;
  font-weight: 700;
  color: var(--xsd-purple);
}

/* Compare Data modal */
.xsd-cmp-back {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 12px;
}

.xsd-cmp-modal {
  width: min(96vw, 1680px);
  max-height: calc(100vh - 24px);
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.xsd-cmp-header {
  background: linear-gradient(135deg, #452b90, #6a4c93);
  color: #fff;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.xsd-cmp-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 4px;
}

.xsd-cmp-header h3 { margin: 0; font-size: 16px; font-weight: 700; }
.xsd-cmp-x {
  border: 0;
  background: rgba(255,255,255,0.14);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.xsd-cmp-body {
  padding: 14px 16px;
  overflow: auto;
  background: #fff;
  min-height: 0;
}

.xsd-cmp-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.xsd-cmp-toolbar p {
  margin: 0;
  max-width: 720px;
  color: #64748b;
  font-size: 13px;
}

.xsd-cmp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.xsd-cmp-run {
  background: linear-gradient(135deg, #452b90, #6a4c93);
  color: #fff;
  border: 0;
  border-radius: 12px;
  height: 40px;
  padding: 0 16px;
  font-weight: 750;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.xsd-cmp-periods {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: start;
  margin-bottom: 14px;
}

.xsd-cmp-vs {
  align-self: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f1f5f9;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
}

.xsd-cmp-period {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

.xsd-cmp-period.is-b { border-color: #86efac; }

.xsd-cmp-period-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.xsd-cmp-period-head strong { display: block; font-size: 14px; }
.xsd-cmp-period-head small { color: #94a3b8; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }

.xsd-cmp-badge {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #452b90;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  flex: none;
}

.xsd-cmp-badge.is-b { background: #16a34a; }

.xsd-cmp-block { margin-bottom: 10px; }
.xsd-cmp-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.xsd-cmp-bar > div { display: flex; gap: 8px; }
.xsd-cmp-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.xsd-cmp-chip {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.xsd-cmp-chip.is-on {
  background: #452b90;
  border-color: #452b90;
  color: #fff;
}

.xsd-cmp-chip.is-b.is-on {
  background: #16a34a;
  border-color: #16a34a;
}

.xsd-cmp-countries {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
}

.xsd-cmp-check {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #e8edf5;
  background: #f8fafc;
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  text-align: start;
  color: #334155;
}

.xsd-cmp-check.is-on {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #312e81;
}

.xsd-cmp-check.is-b.is-on {
  background: #e8f8ec;
  border-color: #86efac;
  color: #166534;
}

.xsd-cmp-box {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.5px solid #cbd5e1;
  display: inline-grid;
  place-items: center;
  flex: none;
  background: #fff;
  color: #fff;
}

.xsd-cmp-check.is-on .xsd-cmp-box {
  background: #452b90;
  border-color: #452b90;
}

.xsd-cmp-check.is-b.is-on .xsd-cmp-box {
  background: #16a34a;
  border-color: #16a34a;
}

.xsd-cmp-empty {
  text-align: center;
  color: #94a3b8;
  padding: 28px 12px;
  font-size: 13px;
}

.xsd-cmp-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 650;
}

.xsd-cmp-summary > div {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.xsd-cmp-title {
  margin: 16px 0 8px;
  color: #452b90;
  font-size: 14px;
  font-weight: 800;
}

.xsd-cmp-hint {
  margin: -2px 0 8px;
  color: #94a3b8;
  font-size: 12px;
}

.xsd-cmp-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.xsd-cmp-kpi {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.xsd-cmp-kpi h6 {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.xsd-cmp-kpi-ab {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.xsd-cmp-kpi-ab span { display: block; font-size: 10px; color: #94a3b8; font-weight: 700; }
.xsd-cmp-kpi-ab strong { font-size: 14px; }

.xsd-cmp-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 750;
}

.xsd-cmp-delta.is-up { background: #e8f8ec; color: #15803d; }
.xsd-cmp-delta.is-down { background: #fee2e2; color: #b91c1c; }
.xsd-cmp-delta.is-flat { background: #f1f5f9; color: #64748b; }
.xsd-cmp-delta small { font-weight: 650; opacity: 0.9; }

.xsd-cmp-scroll {
  overflow: auto;
  max-width: 100%;
  margin-bottom: 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: grab;
}

.xsd-cmp-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.xsd-cmp-table th {
  background: #1d1b41;
  color: #fff;
  padding: 8px 10px;
  text-align: start;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

.xsd-cmp-table th.num,
.xsd-cmp-table td.num { text-align: end; }
.xsd-cmp-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #eef2f6;
  white-space: nowrap;
  background: #fff;
}

.xsd-cmp-flagcell { display: inline-flex; align-items: center; gap: 6px; }
.xsd-cmp-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.xsd-cmp-tab {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.xsd-cmp-tab.is-on {
  background: #452b90;
  border-color: #452b90;
  color: #fff;
}

.xsd-cmp-footer {
  border-top: 1px solid #eef2f6;
  padding: 10px 16px;
  display: flex;
  justify-content: flex-end;
  background: #fff;
}

@media (max-width: 1180px) {
  .xsd-top,
  .xsd-split,
  .xsd-split.is-flip,
  .xsd-kpi-row,
  .xsd-daily-body,
  .xsd-cmp-periods,
  .xsd-cmp-kpis,
  .xsd-cmp-summary {
    grid-template-columns: 1fr;
  }
  .xsd-cmp-vs { justify-self: center; }
  .xsd-cal { border-inline-end: 0; border-bottom: 1px solid var(--xsd-line); }
  .xsd-server { min-height: 0; }
}

/* ── Sales Customers master–detail ── */
.scust-toolbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.scust-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 4px 4px 4px 40px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--dt-border, #e5e7eb) 100%, transparent);
  background: var(--dt-card, #fff);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.scust-search-ico {
  position: absolute;
  inset-inline-start: 14px;
  width: 18px;
  height: 18px;
  color: var(--dt-text-3, #9ca3af);
  pointer-events: none;
}
.scust-search-input {
  width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  height: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--dt-text, #111827);
}
.scust-search-input::placeholder { color: var(--dt-text-3, #9ca3af); }
.scust-search-clear {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--dt-text-3, #9ca3af);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.scust-search-clear:hover { background: var(--dt-tint, #f3f4f6); color: var(--dt-text, #111827); }
.scust-search-go {
  flex: 0 0 auto;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: #714b67;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.scust-search-go:hover { background: #5d3d55; }
.scust-dash-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--dt-border, #e5e7eb) 100%, transparent);
  background: var(--dt-card, #fff);
  color: var(--dt-text, #111827);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.scust-dash-link:hover {
  border-color: color-mix(in srgb, #714b67 35%, var(--dt-border, #e5e7eb));
  color: #714b67;
}

.scust-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(0, 1.45fr);
  gap: 16px;
  align-items: stretch;
  min-height: min(68vh, 720px);
}
.scust-list-card,
.scust-detail-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--dt-border, #e5e7eb) 90%, transparent);
  background: var(--dt-card, #fff);
  box-shadow: 0 10px 28px -22px rgba(15, 23, 42, 0.35);
  overflow: hidden;
}
.scust-list-head,
.scust-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--dt-border, #e5e7eb) 80%, transparent);
}
.scust-list-head h2,
.scust-detail-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--dt-text, #111827);
}
.scust-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, #714b67 12%, transparent);
  color: #714b67;
  font-size: 12px;
  font-weight: 700;
}
.scust-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 8px;
}
.scust-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  margin-bottom: 4px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  text-align: start;
  cursor: pointer;
  transition: background 140ms ease;
}
.scust-row:hover { background: color-mix(in srgb, #714b67 6%, transparent); }
.scust-row.is-active {
  background: color-mix(in srgb, #714b67 12%, transparent);
  box-shadow: inset 3px 0 0 #714b67;
}
[dir='rtl'] .scust-row.is-active { box-shadow: inset -3px 0 0 #714b67; }
.scust-avatar {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(145deg, #8f6a86, #714b67);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.scust-avatar.is-lg {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  font-size: 14px;
}
.scust-row-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.scust-row-name {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--dt-text, #111827);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scust-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--dt-text-3, #6b7280);
}
.scust-dot { opacity: 0.55; }
.scust-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.scust-badge.is-warn {
  background: color-mix(in srgb, #dc2626 12%, transparent);
  color: #b91c1c;
}
.scust-badge.is-ok {
  background: color-mix(in srgb, #16a34a 12%, transparent);
  color: #15803d;
}
.scust-toggle {
  cursor: pointer;
  user-select: none;
  gap: 10px;
}
.scust-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #714b67;
}
.scust-row-amt {
  flex: 0 0 auto;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--dt-text, #111827);
  white-space: nowrap;
}
.scust-lines-block {
  padding: 0 18px 8px;
}
.scust-lines-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.scust-lines-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}
.scust-line-row {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 0.6fr 0.8fr;
  gap: 8px;
  margin-bottom: 8px;
}
.scust-comment {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--dt-tint, #f8fafc) 100%, transparent);
  border: 1px solid color-mix(in srgb, var(--dt-border, #e5e7eb) 70%, transparent);
  font-size: 13px;
  color: var(--dt-text, #111827);
}
.scust-edit-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, #714b67 18%, var(--dt-border, #e5e7eb));
  background: color-mix(in srgb, #714b67 5%, transparent);
}
.scust-section-title {
  margin: 18px 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--dt-text, #111827);
}
.so-line-row {
  grid-template-columns: 1.3fr 0.6fr 0.5fr 0.7fr 0.6fr;
}
.scust-line-row-rma {
  grid-template-columns: 1.2fr 0.55fr 0.45fr 1.1fr 0.55fr 0.45fr;
}

/* Cash receipts apply panel */
.scash-layout {
  grid-template-columns: minmax(300px, 1.2fr) minmax(280px, 0.9fr);
}
.scash-apply {
  align-self: start;
}
.scash-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 18px;
}
.scash-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--dt-text-3, #6b7280);
}
.scash-field.is-full { grid-column: 1 / -1; }
.scash-field input {
  height: 44px;
  width: 100%;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--dt-border, #e5e7eb) 100%, transparent);
  background: var(--dt-card, #fff);
  color: var(--dt-text, #111827);
  font-size: 14px;
  font-weight: 550;
  outline: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
.scash-field input:focus {
  border-color: color-mix(in srgb, #714b67 45%, var(--dt-border, #e5e7eb));
  box-shadow: 0 0 0 3px color-mix(in srgb, #714b67 14%, transparent);
}
.scash-field input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}
.scash-field input[type='number']::-webkit-outer-spin-button,
.scash-field input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.scash-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  padding-top: 4px;
}
.scash-save {
  height: 44px;
  min-width: 120px;
  padding: 0 20px;
  border: 0;
  border-radius: 12px;
  background: #714b67;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.scash-save:hover { background: #5d3d55; }
.scash-save:disabled { opacity: 0.6; cursor: wait; }

@media (max-width: 1024px) {
  .scash-layout { grid-template-columns: 1fr; }
  .scash-form { grid-template-columns: 1fr; }
}
.scust-empty,
.scust-empty-cell {
  padding: 28px 16px;
  text-align: center;
  color: var(--dt-text-3, #9ca3af);
  font-size: 13px;
}
.scust-pager {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px 12px;
  border-top: 1px solid color-mix(in srgb, var(--dt-border, #e5e7eb) 80%, transparent);
  background: color-mix(in srgb, var(--dt-tint, #f8fafc) 70%, transparent);
}
.scust-pager-tab {
  flex: 0 0 auto;
  height: 32px;
  min-width: 64px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--dt-border, #e5e7eb) 100%, transparent);
  border-radius: 999px;
  background: var(--dt-card, #fff);
  color: var(--dt-text-3, #6b7280);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.scust-pager-tab:hover {
  color: #714b67;
  border-color: color-mix(in srgb, #714b67 35%, var(--dt-border, #e5e7eb));
}
.scust-pager-tab.is-active {
  background: #714b67;
  border-color: #714b67;
  color: #fff;
}

.scust-detail-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 220px;
}
.scust-detail-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--dt-text-3, #6b7280);
}
.scust-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-inline-start: auto;
}
.scust-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  border-radius: 10px;
  font-size: 13px;
}
.scust-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 14px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--dt-border, #e5e7eb) 80%, transparent);
  overflow-x: auto;
}
.scust-tab {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 14px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--dt-text-3, #6b7280);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
.scust-tab:hover { color: var(--dt-text, #111827); }
.scust-tab.is-active {
  color: #714b67;
  border-bottom-color: #714b67;
}
.scust-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 16px 18px 20px;
}
.scust-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.scust-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 72px;
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--dt-tint, #f8fafc) 100%, transparent);
  border: 1px solid color-mix(in srgb, var(--dt-border, #e5e7eb) 70%, transparent);
}
.scust-field-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dt-text-3, #6b7280);
}
.scust-field-value {
  font-size: 14px;
  font-weight: 650;
  color: var(--dt-text, #111827);
  word-break: break-word;
}
.scust-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 24px;
  text-align: center;
  color: var(--dt-text-3, #6b7280);
}
.scust-placeholder-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
  border-radius: 18px;
  background: color-mix(in srgb, #714b67 10%, transparent);
  color: #714b67;
}
.scust-placeholder h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--dt-text, #111827);
}
.scust-placeholder p { margin: 0; font-size: 13px; max-width: 280px; }

.scust-table-wrap { overflow: auto; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--dt-border, #e5e7eb) 80%, transparent); }
.scust-table-wrap.is-scroll { max-height: 42vh; }
.scust-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.scust-table th {
  padding: 10px 12px;
  text-align: start;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dt-text-3, #6b7280);
  background: color-mix(in srgb, var(--dt-tint, #f8fafc) 100%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--dt-border, #e5e7eb) 80%, transparent);
}
.scust-table td {
  padding: 11px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--dt-border, #e5e7eb) 55%, transparent);
  color: var(--dt-text, #111827);
  vertical-align: top;
}
.scust-table tr:last-child td { border-bottom: 0; }
.scust-table .text-end { text-align: end; }
.scust-link {
  color: #017e84;
  font-weight: 650;
  text-decoration: none;
}
.scust-link:hover { text-decoration: underline; }

.scust-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.scust-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, #714b67 8%, transparent);
  border: 1px solid color-mix(in srgb, #714b67 14%, transparent);
}
.scust-kpi span {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dt-text-3, #6b7280);
}
.scust-kpi strong {
  font-size: 18px;
  font-weight: 750;
  color: var(--dt-text, #111827);
}

.scust-form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.scust-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 18px;
}
.scust-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 650;
  color: var(--dt-text-3, #6b7280);
}
.scust-form-field .input {
  height: 40px;
  border-radius: 10px;
  font-weight: 500;
  color: var(--dt-text, #111827);
}
.scust-check {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / -1;
  font-size: 13px;
  font-weight: 600;
  color: var(--dt-text, #111827);
}
.scust-form-actions {
  display: flex;
  gap: 8px;
  padding: 0 18px 18px;
}

@media (max-width: 1024px) {
  .scust-toolbar { flex-wrap: wrap; }
  .scust-dash-link { width: 100%; justify-content: center; }
  .scust-layout { grid-template-columns: 1fr; min-height: 0; }
  .scust-list-card { max-height: 48vh; }
  .scust-fields,
  .scust-form-grid,
  .scust-kpi-row,
  .scust-line-row,
  .scust-line-row-rma { grid-template-columns: 1fr; }
}
