/* BinOpt ecommerce workbench 鈥?visual theme only.
   Keeps the compiled Vue behavior, API calls and multi-carton results untouched. */

:root {
  color-scheme: dark;
  --side-panel-width: clamp(25rem, 27vw, 29rem);
  --side-panel-width-right: clamp(27rem, 30vw, 32rem);
  --ec-bg: #07111f;
  --ec-panel: #0c1929;
  --ec-panel-2: #0f2033;
  --ec-line: #1d3047;
  --ec-line-hot: #2c5774;
  --ec-text: #eaf2ff;
  --ec-body: #b9c8d8;
  --ec-muted: #7f93aa;
  --ec-cyan: #42d7ff;
  --ec-cyan-2: #18bde8;
  --ec-violet: #9b87ff;
  --ec-green: #45daa3;
  --ec-warn: #fbbf24;
}

html,
body,
#app,
.app-layout {
  background: var(--ec-bg) !important;
  color: var(--ec-text) !important;
}

body {
  font-family: "DM Sans", "Noto Sans SC", "Segoe UI", system-ui, sans-serif !important;
  background:
    radial-gradient(circle at 80% -12%, #122f52 0, transparent 34%),
    var(--ec-bg) !important;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #2b4862 transparent;
}

*::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

*::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #2b4862;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

/* Left configuration rail */
.config-panel {
  width: var(--side-panel-width) !important;
  min-width: var(--side-panel-width) !important;
  max-width: var(--side-panel-width) !important;
  padding: 1.2rem 1.25rem !important;
  gap: 0.8rem !important;
  color: var(--ec-body) !important;
  background:
    linear-gradient(180deg, rgba(13, 29, 47, 0.98), rgba(8, 21, 34, 0.99)) !important;
  border-right: 1px solid var(--ec-line) !important;
  box-shadow: 16px 0 40px -36px rgba(66, 215, 255, 0.35);
}

.panel-header {
  padding: 0.2rem 0 0.95rem;
  border-bottom: 1px solid var(--ec-line);
}

.panel-header h1 {
  position: relative;
  padding-left: 2.8rem;
  font-size: 1.35rem !important;
  line-height: 2.15rem;
  letter-spacing: -0.02em;
  color: var(--ec-text) !important;
}

.panel-header h1::before {
  content: "B";
  position: absolute;
  left: 0;
  top: 0;
  width: 2.15rem;
  height: 2.15rem;
  display: grid;
  place-items: center;
  border-radius: 0.3rem;
  background: var(--ec-cyan);
  color: #06121e;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 10px 26px -12px rgba(66, 215, 255, 0.85);
}

.subtitle {
  margin-top: 0.15rem !important;
  padding-left: 2.8rem;
  color: var(--ec-muted) !important;
  font-size: 0.82rem !important;
  letter-spacing: 0.04em;
}

.section {
  padding-top: 0.2rem;
}

.section h2,
.section-title-row h2 {
  margin-bottom: 0.45rem !important;
  color: #69829b !important;
  font-size: 0.72rem !important;
  line-height: 1.3;
  letter-spacing: 0.14em !important;
  font-weight: 700;
}

.hint,
.excel-hint,
.option-hint,
.edition-hint,
.unit-hint,
.excel-file-name {
  color: var(--ec-muted) !important;
  font-size: 0.74rem !important;
}

.checkbox-row,
.field,
.option-row,
.option-label,
.choice {
  color: var(--ec-body) !important;
  font-size: 0.86rem !important;
}

input,
select,
textarea,
.select,
.search-input,
.label-input,
.count-input,
.field-inline input,
.rect-table input {
  color: var(--ec-text) !important;
  background: #0a1727 !important;
  border: 1px solid #284058 !important;
  border-radius: 0.35rem !important;
  box-shadow: none !important;
}

input::placeholder,
textarea::placeholder {
  color: #647a91 !important;
}

input:focus,
select:focus,
textarea:focus,
.search-input:focus {
  outline: none !important;
  border-color: var(--ec-cyan) !important;
  box-shadow: 0 0 0 2px rgba(66, 215, 255, 0.12) !important;
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: var(--ec-cyan);
}

.select {
  padding: 0.48rem 0.65rem !important;
  font-size: 0.9rem !important;
}

.search-icon {
  color: var(--ec-cyan) !important;
}

.search-input {
  padding: 0.48rem 1.8rem 0.48rem 1.85rem !important;
  font-size: 0.8rem !important;
}

.search-status {
  color: var(--ec-muted) !important;
  font-size: 0.72rem !important;
}

.search-dropdown {
  color: var(--ec-body) !important;
  background: #0d1c2d !important;
  border-color: var(--ec-line) !important;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.38) !important;
}

.dropdown-item:hover,
.dropdown-item.active {
  background: #102a40 !important;
}

.item-label {
  color: var(--ec-text) !important;
  font-size: 0.82rem !important;
}

.item-meta,
.dropdown-empty {
  color: var(--ec-muted) !important;
  font-size: 0.72rem !important;
}

.cargo-card {
  padding: 0.58rem !important;
  border-radius: 0.45rem !important;
  border-color: var(--ec-line) !important;
  background: rgba(255, 255, 255, 0.025) !important;
}

.cargo-card-focus {
  border-color: #307898 !important;
  box-shadow: 0 0 0 1px rgba(66, 215, 255, 0.18) !important;
}

.cargo-card-placeholder {
  border-color: #2b435a !important;
}

.field-inline,
.rect-table th {
  color: var(--ec-muted) !important;
  font-size: 0.78rem !important;
}

.field-inline input,
.label-input,
.count-input,
.rect-table input {
  font-size: 0.82rem !important;
}

.section-excel {
  border-color: var(--ec-line) !important;
}

.btn-text {
  color: var(--ec-cyan) !important;
  font-size: 0.8rem !important;
}

.btn-icon {
  color: var(--ec-muted) !important;
}

.actions {
  gap: 0.55rem !important;
  padding-top: 0.6rem !important;
}

.btn-primary,
.btn-secondary,
.btn-add,
.btn-file,
.btn-excel-action {
  min-height: 2.45rem;
  border-radius: 0.35rem !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
}

.btn-primary {
  color: #04131d !important;
  background: linear-gradient(135deg, var(--ec-cyan), #36bffa) !important;
  box-shadow: 0 12px 28px -14px rgba(66, 215, 255, 0.75);
}

.btn-primary:hover {
  background: #6be1ff !important;
}

.btn-secondary,
.btn-file,
.btn-excel-action {
  color: var(--ec-body) !important;
  background: #102033 !important;
  border: 1px solid var(--ec-line) !important;
}

.btn-secondary:hover,
.btn-file:hover,
.btn-excel-action:hover {
  color: #fff !important;
  background: #162b41 !important;
}

.error {
  color: #fb7185 !important;
}

.success {
  color: var(--ec-green) !important;
}

/* Central 3D/result workspace */
.main-area {
  position: relative;
  padding: 1rem 1.15rem 0.9rem !important;
  color: var(--ec-body) !important;
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    radial-gradient(circle at 55% 30%, rgba(20, 76, 112, 0.19), transparent 40%),
    var(--ec-bg) !important;
  background-size: 44px 44px, 44px 44px, auto, auto !important;
}

.main-area::before {
  content: "BINOPT 路 E-COMMERCE PACKING";
  position: absolute;
  left: 1.25rem;
  top: 1rem;
  z-index: 2;
  color: #57738d;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  pointer-events: none;
}

.multi-viewer {
  gap: 0.65rem !important;
  padding-top: 1.55rem;
}

.placeholder {
  color: var(--ec-muted) !important;
}

.placeholder::before {
  content: "3D";
  position: absolute;
  right: 4vw;
  top: 8vh;
  color: transparent;
  font-size: clamp(10rem, 22vw, 24rem);
  line-height: 1;
  font-weight: 800;
  -webkit-text-stroke: 1px rgba(66, 215, 255, 0.08);
  pointer-events: none;
}

.placeholder-title {
  position: relative;
  z-index: 1;
  color: var(--ec-text) !important;
  font-size: 1.18rem !important;
  font-weight: 700;
}

.scheme-tabs {
  gap: 0.5rem !important;
}

.scheme-tab {
  color: var(--ec-body) !important;
  background: #0c1929 !important;
  border-color: var(--ec-line) !important;
  border-radius: 0.4rem !important;
  font-size: 0.82rem !important;
}

.scheme-tab:hover {
  color: #fff !important;
  border-color: var(--ec-line-hot) !important;
}

.scheme-tab.active {
  color: #dffaff !important;
  background: #0d2b40 !important;
  border-color: var(--ec-cyan) !important;
}

.global-summary {
  padding: 0.75rem 0.9rem !important;
  border-color: var(--ec-line) !important;
  border-radius: 0.45rem !important;
  background: rgba(12, 25, 41, 0.92) !important;
}

.global-summary .stat {
  color: var(--ec-body) !important;
  font-size: 0.82rem !important;
}

.global-summary .label {
  color: var(--ec-muted) !important;
}

.global-summary .value {
  color: var(--ec-text) !important;
}

.global-summary .value.mode {
  color: var(--ec-cyan) !important;
}

.carton-grid.multi {
  gap: 0.65rem !important;
}

.carton-card {
  padding: 0.58rem !important;
  gap: 0.5rem !important;
  border-radius: 0.55rem !important;
  color: var(--ec-body) !important;
  background: rgba(12, 25, 41, 0.94) !important;
  border-color: var(--ec-line) !important;
}

.carton-card-ok {
  border-color: rgba(69, 218, 163, 0.45) !important;
  background:
    linear-gradient(180deg, rgba(69, 218, 163, 0.1), rgba(12, 25, 41, 0.95) 3.5rem) !important;
}

.carton-card-leftover {
  border-color: #3a4c60 !important;
  background:
    linear-gradient(180deg, rgba(127, 147, 170, 0.08), rgba(12, 25, 41, 0.95) 3.5rem) !important;
}

.carton-card-header h3 {
  color: var(--ec-text) !important;
  font-size: 0.9rem !important;
}

.qualify-mark {
  color: #041b13 !important;
  background: var(--ec-green) !important;
}

.carton-meta,
.carton-stats,
.stat-line,
.ratio {
  color: var(--ec-muted) !important;
}

.carton-meta-ok {
  color: var(--ec-green) !important;
}

.stat-line strong {
  color: var(--ec-text) !important;
}

.carton-viewer {
  min-height: 24rem !important;
  color: var(--ec-body) !important;
  background:
    radial-gradient(circle at 50% 42%, rgba(22, 64, 92, 0.35), transparent 55%),
    #08131f !important;
  border-color: var(--ec-line) !important;
  border-radius: 0.4rem !important;
}

.carton-viewer.compact {
  min-height: 22rem !important;
  height: 22rem !important;
}

.viewer-overlay {
  color: var(--ec-muted) !important;
  background: rgba(7, 17, 31, 0.88) !important;
}

.box-tooltip {
  color: var(--ec-body) !important;
  background: #0f2033 !important;
  border-color: var(--ec-line) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4) !important;
}

.tooltip-label {
  color: var(--ec-text) !important;
}

.tooltip-line {
  color: var(--ec-muted) !important;
}

.loading-overlay {
  color: var(--ec-body) !important;
  background: rgba(7, 17, 31, 0.82) !important;
  backdrop-filter: blur(8px);
}

.loading-panel {
  color: var(--ec-body) !important;
  background: #0c1929 !important;
  border-color: var(--ec-line) !important;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.45) !important;
}

.loading-title {
  color: var(--ec-text) !important;
}

.loading-detail,
.loading-elapsed,
.loading-sub,
.loading-hint {
  color: var(--ec-muted) !important;
}

.progress-track {
  background: #15283c !important;
}

.progress-fill {
  background: linear-gradient(90deg, var(--ec-cyan), var(--ec-violet)) !important;
}

.unplaceable-panel {
  color: #fed7aa !important;
  background: rgba(124, 45, 18, 0.18) !important;
  border-color: rgba(251, 146, 60, 0.45) !important;
}

.unplaceable-title,
.unplaceable-list,
.unplaceable-list strong {
  color: #fdba74 !important;
}

.dialog-backdrop {
  background: rgba(2, 8, 18, 0.7) !important;
  backdrop-filter: blur(8px);
}

.dialog-card {
  color: var(--ec-body) !important;
  background: #0d1c2d !important;
  border: 1px solid var(--ec-line) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48) !important;
}

.dialog-title {
  color: var(--ec-text) !important;
}

/* Keep multi-carton layout exactly multi-card, only restyle it. */
@media (max-width: 1400px) {
  :root {
    --side-panel-width: 24rem;
  }
}

@media (max-width: 900px) {
  body {
    overflow: auto !important;
  }

  .app-layout {
    flex-direction: column;
  }

  .config-panel {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--ec-line) !important;
  }

  .main-area {
    min-height: 75vh !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
}

/* Industrial-packing alignment: light enterprise workbench.
   This final layer intentionally overrides the dark draft above. */
:root {
  color-scheme: light;
  --side-panel-width: clamp(27rem, 28vw, 30rem);
  --side-panel-width-right: clamp(27rem, 30vw, 32rem);
  --ec-bg: #f4f7fb;
  --ec-panel: #ffffff;
  --ec-panel-2: #f8fbff;
  --ec-line: #e2e8f0;
  --ec-line-hot: #93b4f8;
  --ec-text: #162033;
  --ec-body: #4f6077;
  --ec-muted: #8997aa;
  --ec-cyan: #2864ed;
  --ec-cyan-2: #1d4ed8;
  --ec-violet: #7558e8;
  --ec-green: #16a36a;
  --ec-warn: #d97706;
}

html,
body,
#app,
.app-layout {
  background: var(--ec-bg) !important;
  color: var(--ec-text) !important;
}

body {
  background: #f4f7fb !important;
}

* {
  scrollbar-color: #c3cfdd transparent;
}

*::-webkit-scrollbar-thumb {
  background: #c3cfdd;
}

.config-panel {
  color: var(--ec-body) !important;
  background: #fff !important;
  border-right-color: #e4eaf2 !important;
  box-shadow: 8px 0 30px -28px rgba(15, 23, 42, 0.24);
}

.panel-header {
  border-bottom-color: #e8edf4;
}

.panel-header h1 {
  color: var(--ec-text) !important;
}

.panel-header h1::before {
  color: #fff;
  background: #2864ed;
  box-shadow: 0 8px 18px -10px rgba(40, 100, 237, 0.7);
}

.subtitle,
.hint,
.excel-hint,
.option-hint,
.unit-hint,
.excel-file-name,
.item-meta,
.dropdown-empty,
.field-inline,
.rect-table th {
  color: var(--ec-muted) !important;
}

.section h2,
.section-title-row h2 {
  color: #708096 !important;
}

.checkbox-row,
.field,
.option-row,
.option-label,
.choice {
  color: #475569 !important;
}

input,
select,
textarea,
.select,
.search-input,
.label-input,
.count-input,
.field-inline input,
.rect-table input {
  color: #162033 !important;
  background: #fff !important;
  border-color: #d7e0ec !important;
}

input::placeholder,
textarea::placeholder {
  color: #9aa8b9 !important;
}

input:focus,
select:focus,
textarea:focus,
.search-input:focus {
  border-color: #6d98f5 !important;
  box-shadow: 0 0 0 3px rgba(40, 100, 237, 0.1) !important;
  background: #fff !important;
}

input[type="radio"],
input[type="checkbox"] {
  accent-color: #2864ed;
}

.search-icon,
.btn-text,
.edition-hint {
  color: #2864ed !important;
}

.search-dropdown,
.dialog-card {
  color: #475569 !important;
  background: #fff !important;
  border-color: #dfe6ef !important;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.14) !important;
}

.dropdown-item:hover,
.dropdown-item.active {
  background: #f0f5ff !important;
}

.item-label,
.dialog-title {
  color: #162033 !important;
}

.cargo-card {
  background: #f9fbfe !important;
  border-color: #e1e8f1 !important;
}

.cargo-card-focus {
  border-color: #8fb0f8 !important;
  box-shadow: 0 0 0 2px rgba(40, 100, 237, 0.1) !important;
}

.cargo-card-placeholder {
  border-color: #cbd6e4 !important;
}

.section-excel {
  border-color: #e5ebf3 !important;
}

.btn-icon {
  color: #8492a6 !important;
}

.btn-primary {
  color: #fff !important;
  background: #2864ed !important;
  box-shadow: 0 8px 20px -10px rgba(40, 100, 237, 0.65);
}

.btn-primary:hover {
  background: #1f55d5 !important;
}

.btn-secondary,
.btn-file,
.btn-excel-action {
  color: #41516a !important;
  background: #f3f6fa !important;
  border-color: #e1e7ef !important;
}

.btn-secondary:hover,
.btn-file:hover,
.btn-excel-action:hover {
  color: #1f2c40 !important;
  background: #e9eef5 !important;
}

.main-area {
  color: #4f6077 !important;
  background:
    linear-gradient(rgba(40, 100, 237, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(40, 100, 237, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 55% 36%, rgba(40, 100, 237, 0.06), transparent 38%),
    #f4f7fb !important;
  background-size: 44px 44px, 44px 44px, auto, auto !important;
}

.main-area::before {
  color: #8ca0b8;
}

.placeholder {
  color: #8898ad !important;
}

.placeholder::before {
  -webkit-text-stroke-color: rgba(40, 100, 237, 0.08);
}

.placeholder-title {
  color: #223047 !important;
}

.scheme-tab {
  color: #53637a !important;
  background: #fff !important;
  border-color: #d8e1ec !important;
}

.scheme-tab:hover {
  color: #1e293b !important;
  border-color: #99b5ee !important;
}

.scheme-tab.active {
  color: #1746aa !important;
  background: #eef4ff !important;
  border-color: #6e98f3 !important;
}

.global-summary {
  color: #4f6077 !important;
  background: #fff !important;
  border-color: #dfe6ef !important;
  box-shadow: 0 5px 18px rgba(15, 23, 42, 0.04);
}

.global-summary .stat,
.global-summary .label {
  color: #738197 !important;
}

.global-summary .value {
  color: #172238 !important;
}

.global-summary .value.mode {
  color: #2864ed !important;
}

.carton-card {
  color: #4f6077 !important;
  background: #fff !important;
  border-color: #dfe6ef !important;
  box-shadow: 0 5px 18px rgba(15, 23, 42, 0.04);
}

.carton-card-ok {
  border-color: #9adbbf !important;
  background: linear-gradient(180deg, #effbf5, #fff 3.5rem) !important;
}

.carton-card-leftover {
  border-color: #bdc9d8 !important;
  background: linear-gradient(180deg, #f5f7fa, #fff 3.5rem) !important;
}

.carton-card-header h3 {
  color: #172238 !important;
}

.qualify-mark {
  color: #fff !important;
  background: #16a36a !important;
}

.carton-meta,
.carton-stats,
.stat-line,
.ratio {
  color: #77869a !important;
}

.carton-meta-ok {
  color: #148858 !important;
}

.stat-line strong {
  color: #1e293b !important;
}

.carton-viewer {
  color: #4f6077 !important;
  background:
    radial-gradient(circle at 50% 42%, rgba(40, 100, 237, 0.08), transparent 55%),
    #f9fbfe !important;
  border-color: #e0e7f0 !important;
}

.viewer-overlay {
  color: #7c8ba0 !important;
  background: rgba(249, 251, 254, 0.88) !important;
}

.box-tooltip {
  color: #4f6077 !important;
  background: #fff !important;
  border-color: #dfe6ef !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14) !important;
}

.tooltip-label,
.loading-title {
  color: #172238 !important;
}

.tooltip-line,
.loading-detail,
.loading-elapsed,
.loading-sub,
.loading-hint {
  color: #77869a !important;
}

.loading-overlay {
  color: #4f6077 !important;
  background: rgba(244, 247, 251, 0.82) !important;
}

.loading-panel {
  color: #4f6077 !important;
  background: #fff !important;
  border-color: #dfe6ef !important;
  box-shadow: 0 20px 55px rgba(15, 23, 42, 0.16) !important;
}

.progress-track {
  background: #e1e8f1 !important;
}

.progress-fill {
  background: linear-gradient(90deg, #2864ed, #42b9f5) !important;
}

.dialog-backdrop {
  background: rgba(15, 23, 42, 0.42) !important;
}

.dialog-card {
  color-scheme: light;
}

/* Left panel: four clear steps. */
.config-panel {
  counter-reset: ec-step;
  gap: 0.7rem !important;
}

.section-cargo .cargo-title-row,
.config-panel > section.section:not(.section-cargo):not(.section-excel):not(.rules-cont) > h2 {
  margin-bottom: 0.55rem !important;
}

.section-cargo .cargo-title-row h2,
.config-panel > section.section:not(.section-cargo):not(.section-excel):not(.rules-section) > h2,
.rules-section:not(.rules-cont) > h2 {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 !important;
  color: #172238 !important;
  font-size: 1.02rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  line-height: 1.5rem;
}

.config-panel > section.section:not(.section-cargo):not(.section-excel):not(.rules-section) > h2,
.rules-section:not(.rules-cont) > h2 {
  margin-bottom: 0.55rem !important;
}

.section-cargo .cargo-title-row h2::before,
.config-panel > section.section:not(.section-cargo):not(.section-excel):not(.rules-section) > h2::before,
.rules-section:not(.rules-cont) > h2::before {
  counter-increment: ec-step;
  content: counter(ec-step);
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(135deg, #2f6ff2, #1d4fd0);
  box-shadow: 0 6px 14px -8px rgba(40, 100, 237, 0.9);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
}

.section-cargo .unit-hint {
  font-size: 0.72rem !important;
}

.section-excel {
  padding: 0.5rem 0.7rem 0.6rem !important;
  border: 1px dashed #cfdbea !important;
  border-radius: 8px;
  background: #f8fbff;
}

.section-excel h2 {
  margin-bottom: 0.2rem !important;
  color: #4b5c73 !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.04em !important;
}

.section-excel .excel-hint {
  margin-bottom: 0.4rem !important;
}

.config-panel > section.section:not(.section-cargo):not(.section-excel):not(.rules-section) {
  flex-shrink: 0;
  padding-top: 0.75rem;
  border-top: 1px solid #e8edf4;
}

.rules-section {
  flex-shrink: 0;
  padding: 0.75rem 0 0.1rem !important;
  border-top: 1px solid #e8edf4;
}

.rules-section.rules-cont {
  margin-top: -0.7rem !important;
  padding: 0 0 0.2rem !important;
  border-top: 0;
}

.rules-section .option-row {
  margin-bottom: 0.3rem !important;
  padding: 0.38rem 0.65rem !important;
  border: 1px solid #e7edf5;
  border-radius: 7px;
  background: #f9fbfe;
}

.actions {
  flex-shrink: 0;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 0.35rem !important;
  padding-top: 0.85rem !important;
  border-top: 1px solid #e8edf4;
}

.actions .btn-primary {
  order: -1;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex: 0 0 auto !important;
  width: 78% !important;
  min-height: 2.9rem;
  border-radius: 10px !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.12em !important;
}

.actions .btn-primary::before {
  content: "4";
  display: inline-grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  color: #2864ed;
  background: #fff;
  font-size: 0.8rem;
  letter-spacing: 0;
}

.actions .btn-secondary {
  flex: 0 0 auto !important;
  width: auto !important;
  min-height: 0 !important;
  padding: 0.2rem 0.6rem !important;
  color: #7a889c !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  font-size: 0.75rem !important;
}

.actions .btn-secondary:hover {
  color: #2864ed !important;
  background: transparent !important;
}


/* Cargo list: one-row table cards and wider sidebar. */
@media (min-width: 901px) {
  :root {
    --side-panel-width: clamp(30rem, 31vw, 34rem);
  }
}

.cargo-total {
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  color: #1d4fd0 !important;
  background: #edf3ff;
  font-size: 0.74rem !important;
  font-weight: 700;
}

.cargo-head,
.cargo-card {
  display: grid !important;
  grid-template-columns: 1.5rem minmax(0, 1fr) repeat(3, 3.1rem) 3.3rem 3.1rem;
  column-gap: 0.3rem;
  align-items: center;
}

.cargo-head {
  flex-shrink: 0;
  padding: 0.3rem 0.95rem 0.3rem 0.45rem;
  margin-bottom: 0.3rem;
  border-radius: 6px;
  color: #6b7a90;
  background: #f1f5fa;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
}

.cargo-head span:nth-child(2) {
  text-align: left;
  padding-left: 0.35rem;
}

.cargo-list {
  counter-reset: ec-sku;
  gap: 0.28rem !important;
}

.cargo-card {
  padding: 0.28rem 0.45rem !important;
  border-radius: 7px !important;
  background: #fff !important;
}

.cargo-card:nth-child(even) {
  background: #f9fbfe !important;
}

.cargo-card::before {
  counter-increment: ec-sku;
  content: counter(ec-sku);
  color: #94a3b8;
  font-size: 0.7rem;
  font-weight: 700;
  text-align: center;
}

.cargo-card .cargo-row {
  display: contents !important;
}

.cargo-card .field-inline {
  display: block !important;
  min-width: 0;
}

.cargo-card .field-inline > span {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.cargo-card .field-label { order: 1; }
.cargo-card .cargo-row-dims .field-inline:nth-child(1) { order: 2; }
.cargo-card .cargo-row-dims .field-inline:nth-child(2) { order: 3; }
.cargo-card .cargo-row-dims .field-inline:nth-child(3) { order: 4; }
.cargo-card .field-weight { order: 5; }
.cargo-card .field-count { order: 6; }

.cargo-card .field-inline input {
  width: 100% !important;
  min-width: 0 !important;
  height: 1.85rem !important;
  padding: 0 0.3rem !important;
  border-radius: 5px !important;
  font-size: 0.8rem !important;
  text-align: center;
}

.cargo-card .field-label input {
  padding: 0 0.45rem !important;
  text-align: left;
  font-weight: 600;
}

.cargo-card .field-count input {
  color: #1d4fd0 !important;
  font-weight: 700;
}


/* Compact lower steps so the cargo table keeps more height. */
.section-excel {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.5rem;
  row-gap: 0.35rem;
}

.section-excel h2 {
  grid-column: 1;
  margin: 0 !important;
}

.section-excel .excel-hint {
  grid-column: 2 / 4;
  margin: 0 !important;
  overflow: hidden;
  font-size: 0.68rem !important;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.section-excel .excel-upload-row {
  grid-column: 1 / 3;
  margin: 0 !important;
  min-width: 0;
}

.section-excel .btn-file,
.section-excel .btn-excel-action {
  min-height: 1.95rem !important;
  padding: 0.25rem 0.7rem !important;
  font-size: 0.76rem !important;
}

.section-excel .btn-excel-action {
  grid-column: 3;
  width: auto !important;
  margin: 0 !important;
  white-space: nowrap;
}

.rules-section {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 0.4rem;
}

.rules-section > h2,
.rules-section > .option-hint,
.rules-section > .edition-hint {
  grid-column: 1 / -1;
}

.rules-section .option-row {
  margin-bottom: 0.35rem !important;
  padding: 0.32rem 0.55rem !important;
  gap: 0.3rem;
}

.rules-section .option-label {
  font-size: 0.78rem !important;
  white-space: nowrap;
}

.rules-section .option-choices {
  gap: 0.45rem !important;
}

.rules-section .choice {
  font-size: 0.76rem !important;
}
