body {
  font-family: "Inter", "Segoe UI", Roboto, sans-serif;
  margin: 0;
  padding: 30px;
  background: url("/static/images/bg.png") no-repeat center center fixed;
  background-size: cover;
  color: #000;
}

.container {
  max-width: 1200px;
  margin: auto;
}

.card {
  border-radius: 8px;
  padding: 25px 30px;
  margin-bottom: 25px;
  border: 1px solid #d1d5db;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

.warehouse-command {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 22px;
}

.warehouse-command-copy,
.warehouse-preview-shell {
  border: 1px solid rgba(148, 163, 184, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

.warehouse-command-copy {
  padding: 24px;
}

.warehouse-kicker {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 6px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.warehouse-command h2 {
  margin: 14px 0 8px;
  color: #0f172a;
  font-size: 30px;
  line-height: 1.15;
}

.warehouse-command p {
  margin: 0;
  color: #475569;
  line-height: 1.55;
}

.warehouse-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.warehouse-stat {
  min-height: 78px;
  padding: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
}

.warehouse-stat span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.warehouse-stat strong {
  display: block;
  margin-top: 8px;
  color: #0f172a;
  font-size: 24px;
}

.integration-strip,
.integration-health {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #78350f;
}

.integration-strip.is-on,
.integration-health.is-on {
  border-color: #99f6e4;
  background: #ecfdf5;
  color: #134e4a;
}

.integration-dot {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.18);
}

.is-on .integration-dot {
  background: #14b8a6;
  box-shadow: 0 0 0 5px rgba(20, 184, 166, 0.18);
}

.integration-strip strong,
.integration-health strong {
  display: block;
  font-size: 13px;
}

.integration-strip small,
.integration-health small {
  display: block;
  margin-top: 2px;
  color: currentColor;
  opacity: 0.8;
}

.warehouse-preview-shell {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(280px, 1fr);
  min-height: 360px;
}

.warehouse-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.28);
}

.warehouse-preview-head span {
  display: block;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.warehouse-preview-head strong {
  display: block;
  margin-top: 2px;
  color: #111827;
}

.preview-link {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.warehouse-3d-preview {
  position: relative;
  min-height: 300px;
  background:
    linear-gradient(180deg, rgba(219, 234, 254, 0.88), rgba(241, 245, 249, 0.96) 56%, rgba(226, 232, 240, 0.92));
}

.warehouse-3d-preview canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.preview-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #334155;
  font-weight: 800;
}

.config-section-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(12px);
}

.config-section-nav button,
.section-toggle {
  border: 0;
  border-radius: 6px;
  background: #e2e8f0;
  color: #0f172a;
  cursor: pointer;
  font-weight: 800;
}

.config-section-nav button {
  padding: 7px 10px;
  font-size: 12px;
}

.section-toggle {
  margin-left: 0;
  min-width: 34px;
  min-height: 30px;
  font-size: 18px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.section-action-btn {
  min-height: 30px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  background: #0f172a;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.section-action-link {
  background: #0f766e;
}

.section-action-btn:hover {
  filter: brightness(1.06);
}

.section-concept-preview {
  display: grid;
  grid-template-columns: minmax(160px, 260px) 1fr;
  gap: 16px;
  align-items: center;
  margin: -2px 0 18px;
  padding: 14px;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fafc, #eef6f8);
}

.section-mini-scene {
  position: relative;
  min-height: 92px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(rgba(15, 23, 42, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.08) 1px, transparent 1px),
    #e8eef5;
  background-size: 18px 18px;
  box-shadow: inset 0 0 24px rgba(15, 23, 42, 0.08);
}

.section-mini-scene span,
.section-mini-scene b,
.section-mini-scene i {
  position: absolute;
  display: block;
  border-radius: 4px;
  transform: skewY(-9deg);
}

.preview-zone span {
  inset: 22px 36px 18px 36px;
  background: rgba(20, 184, 166, 0.38);
  border: 2px solid #0f766e;
}

.preview-zone b {
  width: 52px;
  height: 12px;
  left: 52px;
  top: 48px;
  background: #0f172a;
}

.preview-zone i {
  width: 22px;
  height: 22px;
  right: 54px;
  top: 38px;
  background: #f59e0b;
}

.preview-integration span,
.preview-integration b,
.preview-integration i {
  width: 52px;
  height: 34px;
  top: 29px;
  background: #ffffff;
  border: 2px solid #2563eb;
}

.preview-integration span { left: 18px; }
.preview-integration b { left: calc(50% - 26px); border-color: #0f766e; }
.preview-integration i { right: 18px; border-color: #7c3aed; }

.preview-equipment span {
  width: 86px;
  height: 28px;
  left: 28px;
  bottom: 22px;
  background: #f59e0b;
}

.preview-equipment b {
  width: 46px;
  height: 46px;
  right: 46px;
  bottom: 20px;
  background: #ef4444;
}

.preview-equipment i {
  width: 64px;
  height: 7px;
  right: 14px;
  bottom: 19px;
  background: #0f172a;
}

.preview-rack span,
.preview-rack b,
.preview-rack i,
.preview-layout span,
.preview-layout b,
.preview-layout i,
.preview-storage span,
.preview-storage b,
.preview-storage i {
  width: 18px;
  height: 68px;
  bottom: 14px;
  background: repeating-linear-gradient(to bottom, #0f766e 0 6px, #dbeafe 6px 14px);
  box-shadow: 22px 0 0 #d1d5db, 44px 0 0 #0f766e;
}

.preview-rack span,
.preview-layout span,
.preview-storage span { left: 32px; }
.preview-rack b,
.preview-layout b,
.preview-storage b { left: 104px; }
.preview-rack i,
.preview-layout i,
.preview-storage i { left: 176px; }

.preview-lanes span,
.preview-lanes b,
.preview-lanes i {
  width: 30px;
  height: 82px;
  top: 5px;
  background: rgba(239, 68, 68, 0.24);
}

.preview-lanes span { left: 42px; }
.preview-lanes b { left: 112px; background: rgba(20, 184, 166, 0.24); }
.preview-lanes i { left: 182px; }

.preview-bin span {
  width: 76px;
  height: 46px;
  left: 50%;
  top: 50%;
  background: #14b8a6;
  transform: translate(-50%, -50%) skewY(-9deg);
  box-shadow: 14px 10px 0 rgba(15, 23, 42, 0.18);
}

.preview-bin b,
.preview-bin i {
  width: 52px;
  height: 8px;
  left: calc(50% - 26px);
  background: #92400e;
}
.preview-bin b { top: 22px; }
.preview-bin i { bottom: 20px; }

.preview-floor span {
  width: 180px;
  height: 18px;
  left: 30px;
  bottom: 18px;
  background: #94a3b8;
}

.preview-floor b {
  width: 150px;
  height: 16px;
  left: 48px;
  bottom: 48px;
  background: #cbd5e1;
}

.preview-floor i {
  width: 90px;
  height: 42px;
  left: 84px;
  bottom: 20px;
  background: rgba(37, 99, 235, 0.28);
}

.preview-abc span,
.preview-abc b,
.preview-abc i {
  width: 42px;
  bottom: 18px;
  border-radius: 5px 5px 0 0;
}

.preview-abc span { height: 64px; left: 54px; background: #16a34a; }
.preview-abc b { height: 44px; left: 112px; background: #f59e0b; }
.preview-abc i { height: 26px; left: 170px; background: #ef4444; }

.section-preview-copy strong {
  display: block;
  color: #0f172a;
  font-size: 15px;
  margin-bottom: 4px;
}

.section-preview-copy small {
  display: block;
  color: #475569;
  font-weight: 700;
  line-height: 1.4;
}

.card.is-collapsed {
  padding-bottom: 16px;
}

.card.is-collapsed > :not(.section-title) {
  display: none !important;
}

i.fa-solid.fa-check {
  padding: 5px;
  background: orange;
  border: 2px solid white;
  border-radius: 8px;
  color: white;
}

.field-tile label i.fa-solid {
  min-width: 16px;
  padding: 5px;
  border: 2px solid white;
  border-radius: 8px;
  background: #0f766e;
  color: white;
  text-align: center;
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.section-title i {
  color: #3b82f6;
}

.form-table {
  width: 100%;
  border-collapse: collapse;
}

.form-table td {
  padding: 10px;
  border-bottom: 1px solid #e5e7eb;
}

.form-table td.label {
  width: 220px;
  font-weight: 600;
  color: #374151;
}

.form-table input,
.form-table select {
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  width: min(320px, 100%);
}

.form-table tr:last-child td {
  border-bottom: none;
}

.save-btn {
  background: #2563eb;
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  color: white;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.save-btn:hover {
  background: #1e40af;
}

.footer-actions {
  text-align: right;
  margin-top: 20px;
}

.storage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}

.storage-card {
  position: relative;
}

.storage-card input[type="checkbox"] {
  display: none;
}

.storage-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: white;
  cursor: pointer;
  text-align: center;
  height: 120px;
}

.storage-label i {
  font-size: 22px;
  margin-bottom: 8px;
  color: #3b82f6;
}

.storage-card input[type="checkbox"]:checked + .storage-label {
  border-color: #2563eb;
  background: #eff6ff;
}

.row-selector {
  display: none;
  margin-top: 10px;
  padding: 10px;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #d1d5db;
}

.row-selector.is-visible {
  display: block;
}

.row-title {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.config-brand {
  display: flex;
  gap: 14px;
  align-items: center;
}

.config-logo {
  width: 72px;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  margin: 0;
  color: #111827;
}

.page-subtitle {
  margin-top: 4px;
  color: #4b5563;
  font-size: 14px;
}

.config-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field-tile {
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.integration-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.integration-copy {
  padding: 16px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
}

.integration-copy h3 {
  margin: 12px 0 8px;
  color: #0f172a;
  font-size: 18px;
  line-height: 1.3;
}

.integration-copy p {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
}

.integration-pill {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 6px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 11px;
  font-weight: 900;
}

.integration-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-tile label {
  font-weight: 700;
  color: #374151;
  font-size: 13px;
}

.field-tile input,
.field-tile select {
  width: 100%;
  padding: 9px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.field-tile-check .checkbox-control {
  display: flex;
  align-items: center;
  min-height: 38px;
}

.field-tile-check input[type="checkbox"] {
  width: 22px;
  height: 22px;
  padding: 0;
  accent-color: #0f766e;
}

.floor-layout-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.floor-layout-card {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 14px;
}

.floor-layout-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.floor-enable {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #0f766e;
}

.floor-enable input {
  width: 18px;
  height: 18px;
  accent-color: #0f766e;
}

.floor-layout-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.floor-layout-fields label {
  display: grid;
  gap: 5px;
  color: #374151;
  font-size: 12px;
  font-weight: 700;
}

.floor-layout-fields input,
.floor-layout-fields select {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
}

.subsection-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 12px;
  color: #111827;
}

.subsection-head span {
  display: block;
  margin-top: 3px;
  color: #6b7280;
  font-size: 12px;
}

.trolley-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.trolley-config-card {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.trolley-config-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #0f172a;
}

.trolley-color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.18);
}

.trolley-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-hint {
  grid-column: 2;
  color: #6b7280;
  font-size: 12px;
  margin-top: -6px;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.message {
  padding: 10px 12px;
  border-radius: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-weight: 650;
}

.message.success {
  background: #ecfdf5;
  border-color: #bbf7d0;
  color: #166534;
}

.message.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.message.warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.field-error {
  grid-column: 2;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
  margin-top: -4px;
  padding: 7px 9px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fef2f2;
}

.field-note {
  margin-top: 7px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.4;
}

.error-summary {
  margin: 6px 0 0 18px;
  padding: 0;
}

.field-tile:has(.field-error),
.form-table tr:has(.field-error),
.form-table tr.has-error {
  border-color: #fca5a5;
  background: #fff7f7;
}

.field-tile:has(.field-error) label,
.form-table tr:has(.field-error) .label,
.form-table tr.has-error .label {
  color: #991b1b;
}

.field-tile:has(.field-error) input,
.field-tile:has(.field-error) select,
.form-table tr:has(.field-error) input,
.form-table tr:has(.field-error) select,
.form-table tr.has-error input,
.form-table tr.has-error select {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}

.quick-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.quick-links .secondary-link {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.link-dark {
  background: #111827;
}

.link-teal {
  background: #0f766e;
}

.link-green {
  background: #16a34a;
}

.color-input-lg {
  width: 60px;
  height: 30px;
  border: none;
}

.storage-color-input {
  margin-bottom: 8px;
  width: 28px;
  height: 28px;
  border: none;
}

.storage-zone-note {
  color: #6b7280;
}

.row-range-selects {
  display: flex;
  gap: 10px;
}

@media (max-width: 900px) {
  body {
    padding: 16px;
  }

  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .warehouse-command,
  .integration-layout {
    grid-template-columns: 1fr;
  }

  .warehouse-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .config-grid {
    grid-template-columns: 1fr;
  }

  .field-tile {
    grid-template-columns: 1fr;
  }

  .field-hint {
    grid-column: 1;
  }

  .field-error {
    grid-column: 1;
  }

  .section-title {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .section-actions {
    order: 2;
    width: 100%;
    margin-left: 0;
  }

  .section-toggle {
    margin-left: auto;
  }

  .section-concept-preview {
    grid-template-columns: 1fr;
  }

  .section-action-btn {
    flex: 1;
    justify-content: center;
  }
}
