/* Modern operations UI for Coolmatt supply-chain workflows. */
:root {
  --cm-bg: #f4f7fb;
  --cm-surface: #ffffff;
  --cm-surface-2: #eef3f8;
  --cm-border: #d7e0ea;
  --cm-text: #17202a;
  --cm-muted: #637083;
  --cm-primary: #0f766e;
  --cm-primary-strong: #115e59;
  --cm-accent: #2563eb;
  --cm-warning: #b45309;
  --cm-shadow: 0 12px 30px rgba(20, 35, 55, 0.10);
  --cm-glow: 0 0 0 1px rgba(20, 184, 166, 0.14), 0 18px 42px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
  letter-spacing: 0 !important;
}

html {
  background: var(--cm-bg);
}

body {
  margin: 0 !important;
  min-height: 100vh;
  color: var(--cm-text) !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(20, 184, 166, 0.16), transparent 32%),
    radial-gradient(circle at 88% 4%, rgba(37, 99, 235, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), rgba(37, 99, 235, 0.04) 280px, transparent 520px),
    var(--cm-bg) !important;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif !important;
  font-size: 14px !important;
}

body::before {
  content: "Coolmatt 跨境电商供应链中台";
  display: block;
  max-width: 1760px;
  margin: 18px auto 8px;
  padding: 0 18px;
  color: var(--cm-muted);
  font-size: 13px;
  font-weight: 700;
}

a {
  color: var(--cm-primary-strong) !important;
  text-decoration: none !important;
}

a:hover {
  color: var(--cm-accent) !important;
}

.toubu {
  width: min(1760px, calc(100vw - 32px)) !important;
  height: auto !important;
  min-height: 58px;
  margin: 0 auto 14px !important;
  padding: 0 16px !important;
  background: rgba(255, 255, 255, 0.90) !important;
  border: 1px solid var(--cm-border);
  border-radius: 8px;
  box-shadow: var(--cm-glow);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 10px;
  z-index: 20;
}

.nav {
  display: flex !important;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 58px;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible;
  justify-content: space-between;
}

.nav li,
.dropdown {
  float: none !important;
  line-height: normal !important;
  position: relative;
}

.nav a,
.dropdown .dropbtn {
  display: inline-flex !important;
  align-items: center;
  min-height: 38px;
  padding: 8px 18px !important;
  border-radius: 6px;
  color: var(--cm-text) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  white-space: nowrap;
  background: transparent !important;
}

.nav > li:first-child a {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.14), rgba(37, 99, 235, 0.10)) !important;
  color: var(--cm-primary-strong) !important;
}

.nav a:hover,
.dropdown:hover .dropbtn {
  background: var(--cm-surface-2) !important;
  color: var(--cm-primary-strong) !important;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 210px !important;
  padding: 8px !important;
  background: var(--cm-surface) !important;
  border: 1px solid var(--cm-border);
  border-radius: 8px;
  box-shadow: var(--cm-shadow) !important;
}

.dropdown:hover .dropdown-content,
.dropdown:focus-within .dropdown-content {
  display: block !important;
}

.dropdown-content a {
  display: flex !important;
  width: 100%;
  padding: 9px 10px !important;
  color: var(--cm-text) !important;
  border-radius: 6px;
  text-align: left !important;
}

.dropdown-content a:hover {
  background: rgba(15, 118, 110, 0.10) !important;
}

.chaxun,
.sjk,
form[method],
body > form,
body > div:not(.dropdown-content) {
  width: min(1760px, calc(100vw - 32px)) !important;
  max-width: 1760px !important;
}

form[method],
body > form {
  display: block;
  margin-left: auto !important;
  margin-right: auto !important;
}

.chaxun {
  height: auto !important;
  min-height: 0 !important;
  margin: 0 auto 14px !important;
  padding: 16px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid var(--cm-border);
  border-radius: 8px;
  box-shadow: var(--cm-glow);
  backdrop-filter: blur(14px);
  overflow: visible;
}

.sjk {
  height: auto !important;
  margin: 0 auto 28px !important;
  padding: 0 !important;
  background: var(--cm-surface) !important;
  border: 1px solid var(--cm-border);
  border-radius: 8px;
  box-shadow: var(--cm-glow);
  overflow: auto;
}

.sjk > table,
.chaxun > table,
.chaxun form > table,
form > .sjk > table {
  margin-left: auto !important;
  margin-right: auto !important;
}

#myTable {
  min-width: 1180px;
}

.bootstrap-table,
.fixed-table-container,
.fixed-table-body,
.fixed-table-toolbar,
.columns,
.export,
.keep-open,
.bs-bars,
.search {
  margin-left: auto !important;
  margin-right: auto !important;
}

.fixed-table-toolbar {
  width: min(1760px, calc(100vw - 32px)) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px !important;
}

.fixed-table-toolbar .columns,
.fixed-table-toolbar .export,
.fixed-table-toolbar .search,
.fixed-table-toolbar .bs-bars {
  float: none !important;
}

table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  background: transparent !important;
}

th,
td {
  border: 0 !important;
  border-bottom: 1px solid var(--cm-border) !important;
  padding: 10px 12px !important;
  color: var(--cm-text) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  vertical-align: middle !important;
  text-align: left !important;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #eef7fa, #e8f0f6) !important;
  color: #263446 !important;
  font-weight: 800 !important;
  white-space: nowrap;
}

tr:nth-child(odd),
tr:nth-child(even) {
  background: transparent !important;
}

tbody tr:hover {
  background: rgba(15, 118, 110, 0.06) !important;
}

input,
select,
textarea,
.form-control,
.form-select {
  width: 100% !important;
  max-width: 100%;
  min-height: 36px;
  padding: 7px 10px !important;
  color: var(--cm-text) !important;
  background: #fff !important;
  border: 1px solid #cbd6e2 !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  outline: none !important;
}

input[type="file"] {
  min-width: 180px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cm-primary) !important;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16) !important;
}

label,
.form-label {
  display: block;
  margin-bottom: 5px;
  color: var(--cm-muted) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

button,
.btn,
input[type="submit"],
input[type="button"] {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 14px !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: var(--cm-primary) !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  cursor: pointer;
}

button:hover,
.btn:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  background: var(--cm-primary-strong) !important;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-check input {
  width: auto !important;
  min-height: auto;
}

form table td,
.chaxun td {
  float: none !important;
  min-width: 160px;
}

.chaxun table,
.chaxun tbody,
.chaxun tr {
  max-width: 100%;
}

.chaxun tr {
  display: table-row;
}

.chaxun td {
  min-width: 180px;
  max-width: none;
}

.sjk td {
  white-space: normal;
}

.workflow-card {
  position: relative;
  margin: 18px;
  padding: 22px 12px 12px;
  border: 2px solid #cbd6e2;
  border-radius: 8px;
}

.workflow-label {
  position: absolute;
  top: -12px;
  left: 16px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #fff;
  color: #4b5563;
  font-size: 11px !important;
  font-weight: 800;
}

.workflow-card-0 {
  border-color: #7aa7c7;
  background: #f3f9fd;
}

.workflow-card-1 {
  border-color: #8fbf9f;
  background: #f4fbf5;
}

.workflow-card-2 {
  border-color: #d4aa6a;
  background: #fff8ed;
}

.workflow-card-3 {
  border-color: #b59bd6;
  background: #f8f4fd;
}

.workflow-card-4 {
  border-color: #d38f8f;
  background: #fff5f5;
}

.workflow-card-5 {
  border-color: #7db9b2;
  background: #f0fbf9;
}

.ops-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.ops-hero h1 {
  margin: 0 0 8px;
  color: var(--cm-text);
  font-size: 24px;
  line-height: 1.2;
}

.ops-hero p {
  margin: 0;
  color: var(--cm-muted);
  font-size: 14px;
}

.ops-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--cm-primary);
  color: #fff !important;
  font-weight: 800;
  white-space: nowrap;
}

.ops-hero-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ops-home-secondary {
  background: var(--cm-accent);
}

.ops-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  padding: 16px;
}

.ops-card {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--cm-border);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(239,247,248,0.86));
}

.ops-card h2 {
  margin: 0 0 10px;
  font-size: 18px;
  color: var(--cm-primary-strong);
}

.ops-card p {
  margin: 0 0 16px;
  color: var(--cm-muted);
  line-height: 1.7;
}

.ops-card-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 6px;
  background: var(--cm-primary);
  color: #fff !important;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.ops-card-action:hover {
  background: var(--cm-primary-strong);
}

.ops-card span {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.10);
  color: var(--cm-accent);
  font-size: 12px;
  font-weight: 800;
}

@media (max-width: 900px) {
  body::before,
  .toubu,
  .chaxun,
  .sjk,
  form[method],
  body > form,
  body > div:not(.dropdown-content) {
    width: calc(100vw - 20px) !important;
  }

  .toubu {
    top: 6px;
  }

  th,
  td {
    padding: 8px 10px !important;
  }

  .nav {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: visible;
  }

  .chaxun {
    padding: 12px !important;
  }

  .chaxun td {
    min-width: 190px;
  }

  .ops-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .ops-hero-actions {
    justify-content: flex-start;
  }

  input,
  select,
  textarea,
  .form-control,
  .form-select {
    min-height: 40px;
  }
}

/* Legacy edit forms such as inboundedit are real table-based workflows.
   Keep their row/column structure stable, centered, and scrollable. */
.chaxun {
  overflow-x: auto;
}

.chaxun > .form-group,
.chaxun form,
form .chaxun {
  width: 100%;
}

.chaxun table {
  table-layout: fixed !important;
  min-width: 1120px;
}

.chaxun td {
  width: 16.666%;
  text-align: left !important;
}

.chaxun tr:has(td:only-child) td,
.chaxun td[colspan] {
  text-align: center !important;
  color: var(--cm-primary-strong) !important;
  font-size: 18px !important;
  font-weight: 800 !important;
}

.chaxun td:empty {
  padding: 0 !important;
  border-bottom: 0 !important;
}

.chaxun .mb-3,
.chaxun .col-md-4,
.chaxun .col-md-6,
.chaxun .form-group {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
}

.chaxun input[type="radio"] {
  width: auto !important;
  margin-right: 6px;
}

@media (max-width: 900px) {
  .chaxun table {
    min-width: 980px;
  }
}

@media (min-width: 1500px) {
  .toubu,
  .chaxun,
  .sjk,
  .fixed-table-toolbar {
    max-width: 1680px !important;
  }
}
