/* TMS v9.9.8 - 运输执行与同类页面排版统一 */

:root {
  --tms-primary: #173a79;
  --tms-text: #1f2937;
  --tms-line: #e5e7eb;
  --tms-bg: #f5f7fa;
  --tms-success: #14866d;
  --tms-warning: #d97706;
  --tms-danger: #d92d20;
  --tms-flow: #246bfd;
  --tms-transition: #7a45ba;
  --tms-neutral: #667085;
  --tms-info-strip: #f1f3f6;
  --tms-table-head: #f7f8fa;
}

html[data-tms-theme="light"],
html[data-tms-theme="navy"],
html[data-tms-theme="orange-purple"] {
  --tms-text: #1f2937;
  --tms-line: #e5e7eb;
  --tms-bg: #f5f7fa;
  --tms-info-strip: #f1f3f6;
  --tms-table-head: #f7f8fa;
}

html[data-tms-theme="indigo"],
html[data-tms-theme="graphite"] {
  --tms-text: #eef2f8;
  --tms-line: #343b58;
  --tms-bg: #0f1022;
  --tms-info-strip: #20243a;
  --tms-table-head: #20243a;
}

/* 220px 固定侧栏 */
.app > aside {
  position: sticky !important;
  top: 0 !important;
  width: 220px !important;
  min-width: 220px !important;
  height: 100vh !important;
  align-self: flex-start !important;
}

/* 品牌区只保留一处深蓝品牌色 */
html[data-tms-theme] .app > aside > h3 {
  min-height: 64px !important;
  padding: 12px 14px !important;
  display: flex !important;
  align-items: center !important;
  background: var(--tms-primary) !important;
  color: #fff !important;
  border-bottom: 1px solid rgba(255, 255, 255, .12) !important;
  box-shadow: none !important;
}

html[data-tms-theme] .app > aside > h3 .brand-shell {
  width: 100% !important;
}

html[data-tms-theme] .app > aside > h3 .brand-cn {
  color: #fff !important;
}

html[data-tms-theme] .app > aside > h3 .brand-en {
  color: rgba(255, 255, 255, .66) !important;
}

html[data-tms-theme] .app > aside > h3 .brand-logo {
  background: #2f7df1 !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14) !important;
}

html[data-tms-theme="light"] .app > aside,
html[data-tms-theme="navy"] .app > aside,
html[data-tms-theme="orange-purple"] .app > aside {
  background: #fff !important;
}

html[data-tms-theme="light"] #n .nav-items button,
html[data-tms-theme="navy"] #n .nav-items button,
html[data-tms-theme="orange-purple"] #n .nav-items button {
  background: #fff !important;
  color: #374151 !important;
  border-left-color: transparent !important;
  box-shadow: none !important;
}

html[data-tms-theme="light"] #n .nav-items button:hover,
html[data-tms-theme="navy"] #n .nav-items button:hover,
html[data-tms-theme="orange-purple"] #n .nav-items button:hover {
  background: #f2f4f7 !important;
  color: #1f2937 !important;
}

html[data-tms-theme] #n .nav-items button.active,
html[data-tms-theme] #n .nav-items button[aria-current="page"],
html[data-tms-theme] #n .nav-items button.active:hover,
html[data-tms-theme] #n .nav-items button[aria-current="page"]:hover {
  background: var(--tms-primary) !important;
  color: #fff !important;
  border-left-color: var(--tms-primary) !important;
  box-shadow: none !important;
  font-weight: 800 !important;
}

html[data-tms-theme] #n .nav-items button.active::before,
html[data-tms-theme] #n .nav-items button[aria-current="page"]::before {
  background: #fff !important;
  opacity: .82 !important;
}

/* 页面标题仅保留 main > h1；右侧品牌文案改为固定演示更新时间 */
html[data-tms-theme] main > h1 {
  min-height: 64px !important;
  margin-bottom: 16px !important;
  color: var(--tms-text) !important;
}

html[data-tms-theme] main > h1::after {
  content: "数据更新于 17:34" !important;
  margin-left: auto !important;
  color: var(--tms-text-muted, #98a2b3) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
}

/* 顶部重复 Hero 统一降级为约 40px 的说明信息条 */
html[data-tms-theme] #c > .v2-hero:first-child,
html[data-tms-theme] #c > .bill-hero:first-child,
html[data-tms-theme] #c > .saas-hero:first-child,
html[data-tms-theme] #c > [class$="-page"] > .v2-hero:first-child {
  position: relative !important;
  top: auto !important;
  z-index: 1 !important;
  min-height: 40px !important;
  margin: 0 0 12px !important;
  padding: 4px 7px 4px 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  border: 1px solid var(--tms-line) !important;
  border-radius: 8px !important;
  background: var(--tms-info-strip) !important;
  color: var(--tms-text) !important;
  box-shadow: none !important;
}

html[data-tms-theme] #c > .v2-hero:first-child > div:first-child,
html[data-tms-theme] #c > .bill-hero:first-child > div:first-child,
html[data-tms-theme] #c > .saas-hero:first-child > div:first-child,
html[data-tms-theme] #c > [class$="-page"] > .v2-hero:first-child > div:first-child {
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
}

html[data-tms-theme] #c > .v2-hero:first-child h2,
html[data-tms-theme] #c > .bill-hero:first-child h2,
html[data-tms-theme] #c > .saas-hero:first-child h2,
html[data-tms-theme] #c > [class$="-page"] > .v2-hero:first-child h2 {
  display: none !important;
}

html[data-tms-theme] #c > .v2-hero:first-child .sub,
html[data-tms-theme] #c > .bill-hero:first-child .sub,
html[data-tms-theme] #c > .saas-hero:first-child .sub,
html[data-tms-theme] #c > [class$="-page"] > .v2-hero:first-child .sub {
  min-width: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  color: var(--tms-text-secondary, #596579) !important;
  opacity: 1 !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
}

html[data-tms-theme] #c > .v2-hero:first-child .sub::before,
html[data-tms-theme] #c > .bill-hero:first-child .sub::before,
html[data-tms-theme] #c > .saas-hero:first-child .sub::before,
html[data-tms-theme] #c > [class$="-page"] > .v2-hero:first-child .sub::before {
  content: "ⓘ";
  flex: 0 0 auto;
  margin-right: 7px;
  color: var(--tms-text-muted, #7d8796);
  font-size: 13px;
}

/* 信息条右侧操作统一为次级按钮 */
html[data-tms-theme] #c > .v2-hero:first-child button,
html[data-tms-theme] #c > .bill-hero:first-child button,
html[data-tms-theme] #c > .saas-hero:first-child button,
html[data-tms-theme] #c > [class$="-page"] > .v2-hero:first-child button {
  min-height: 30px !important;
  height: 30px !important;
  padding: 0 10px !important;
  border: 1px solid color-mix(in srgb, var(--tms-line) 72%, #98a2b3) !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: var(--tms-text-secondary, #596579) !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

html[data-tms-theme] #c > .v2-hero:first-child button:hover,
html[data-tms-theme] #c > .bill-hero:first-child button:hover,
html[data-tms-theme] #c > .saas-hero:first-child button:hover,
html[data-tms-theme] #c > [class$="-page"] > .v2-hero:first-child button:hover,
html[data-tms-theme] #c > .v2-hero:first-child button.active-view {
  border-color: color-mix(in srgb, var(--tms-line) 48%, #667085) !important;
  background: color-mix(in srgb, var(--tms-bg-panel, #fff) 70%, transparent) !important;
  color: var(--tms-text) !important;
}

/* 运输执行：状态与日期合并一行，中间使用 1px 分隔线 */
html[data-tms-theme] .v996-exec-toolbar {
  position: relative !important;
  top: auto !important;
  z-index: 2 !important;
  min-height: 56px !important;
  margin: 0 !important;
  padding: 12px 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 16px !important;
  background: transparent !important;
}

html[data-tms-theme] .v996-exec-toolbar .exec-tabs {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}

html[data-tms-theme] .v996-exec-toolbar .tms-date-filter {
  min-height: 28px !important;
  margin-left: 0 !important;
  padding-left: 16px !important;
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  border-left: 1px solid var(--tms-line) !important;
}

/* 状态 chips：统一 32px / 999px / 12px，并收敛为灰蓝紫红四色 */
html[data-tms-theme] #v2ExecTabs .exec-tab {
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-width: 1px !important;
  border-style: solid !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 30px !important;
  white-space: nowrap !important;
}

html[data-tms-theme] #v2ExecTabs .exec-tab:nth-child(1),
html[data-tms-theme] #v2ExecTabs .exec-tab:nth-child(7) {
  border-color: color-mix(in srgb, var(--tms-neutral) 28%, var(--tms-line)) !important;
  background: color-mix(in srgb, var(--tms-neutral) 10%, var(--tms-bg-panel, #fff)) !important;
  color: var(--tms-neutral) !important;
}

html[data-tms-theme] #v2ExecTabs .exec-tab:nth-child(2),
html[data-tms-theme] #v2ExecTabs .exec-tab:nth-child(3),
html[data-tms-theme] #v2ExecTabs .exec-tab:nth-child(5) {
  border-color: color-mix(in srgb, var(--tms-flow) 28%, var(--tms-line)) !important;
  background: color-mix(in srgb, var(--tms-flow) 10%, var(--tms-bg-panel, #fff)) !important;
  color: var(--tms-flow) !important;
}

html[data-tms-theme] #v2ExecTabs .exec-tab:nth-child(4) {
  border-color: color-mix(in srgb, var(--tms-transition) 30%, var(--tms-line)) !important;
  background: color-mix(in srgb, var(--tms-transition) 11%, var(--tms-bg-panel, #fff)) !important;
  color: var(--tms-transition) !important;
}

html[data-tms-theme] #v2ExecTabs .exec-tab:nth-child(6) {
  border-color: color-mix(in srgb, var(--tms-danger) 30%, var(--tms-line)) !important;
  background: color-mix(in srgb, var(--tms-danger) 10%, var(--tms-bg-panel, #fff)) !important;
  color: var(--tms-danger) !important;
}

html[data-tms-theme] #v2ExecTabs .exec-tab:nth-child(1).active,
html[data-tms-theme] #v2ExecTabs .exec-tab:nth-child(7).active {
  border-color: var(--tms-neutral) !important;
  background: var(--tms-neutral) !important;
  color: #fff !important;
}

html[data-tms-theme] #v2ExecTabs .exec-tab:nth-child(2).active,
html[data-tms-theme] #v2ExecTabs .exec-tab:nth-child(3).active,
html[data-tms-theme] #v2ExecTabs .exec-tab:nth-child(5).active {
  border-color: var(--tms-flow) !important;
  background: var(--tms-flow) !important;
  color: #fff !important;
}

html[data-tms-theme] #v2ExecTabs .exec-tab:nth-child(4).active {
  border-color: var(--tms-transition) !important;
  background: var(--tms-transition) !important;
  color: #fff !important;
}

html[data-tms-theme] #v2ExecTabs .exec-tab:nth-child(6).active {
  border-color: var(--tms-danger) !important;
  background: var(--tms-danger) !important;
  color: #fff !important;
}

/* 日期按钮与状态区同高、弱化为次级控件 */
html[data-tms-theme] .tms-date-filter__presets {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

html[data-tms-theme] .tms-date-chip {
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 10px !important;
  border: 1px solid var(--tms-line) !important;
  border-radius: 6px !important;
  background: var(--tms-bg-panel, #fff) !important;
  color: var(--tms-text-secondary, #667085) !important;
  box-shadow: none !important;
  font-size: 12px !important;
  line-height: 28px !important;
}

html[data-tms-theme] .tms-date-chip:hover {
  border-color: color-mix(in srgb, var(--tms-line) 52%, #667085) !important;
  background: var(--tms-bg-panel-soft, #f8f9fb) !important;
  color: var(--tms-text) !important;
}

html[data-tms-theme] .tms-date-chip.is-active {
  border-color: color-mix(in srgb, var(--tms-primary) 35%, var(--tms-line)) !important;
  background: color-mix(in srgb, var(--tms-primary) 9%, var(--tms-bg-panel, #fff)) !important;
  color: var(--tms-primary) !important;
  font-weight: 800 !important;
}

/* 项目/搜索筛选卡片 */
html[data-tms-theme] .v993-exec-filter.card {
  margin: 0 0 12px !important;
  padding: 12px 14px !important;
  border: 1px solid var(--tms-line) !important;
  border-radius: 12px !important;
  background: var(--tms-bg-panel, #fff) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04) !important;
}

/* 运输执行表格容器 */
html[data-tms-theme] .v992-exec-table-wrap {
  overflow: auto !important;
  border: 1px solid var(--tms-line) !important;
  border-radius: 12px !important;
  background: var(--tms-bg-panel, #fff) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04) !important;
}

html[data-tms-theme] .v992-exec-table {
  width: 100% !important;
  min-width: 980px !important;
  border-collapse: collapse !important;
  background: var(--tms-bg-panel, #fff) !important;
}

html[data-tms-theme] .v992-exec-table thead th {
  height: 44px !important;
  padding: 0 16px !important;
  border-bottom: 1px solid var(--tms-line) !important;
  background: var(--tms-table-head) !important;
  color: var(--tms-text-secondary, #667085) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  vertical-align: middle !important;
}

html[data-tms-theme] .v992-exec-table tbody td {
  height: 56px !important;
  padding: 0 16px !important;
  border-bottom: 1px solid var(--tms-line) !important;
  background: var(--tms-bg-panel, #fff) !important;
  color: var(--tms-text) !important;
  vertical-align: middle !important;
}

html[data-tms-theme] .v992-exec-table tbody tr:last-child td {
  border-bottom: 0 !important;
}

html[data-tms-theme] .v992-exec-table tbody tr:hover td {
  background: var(--tms-row-hover, rgba(36, 107, 253, .05)) !important;
}

/* 卡片视图沿用同一视觉规范 */
html[data-tms-theme] .exec-card.v992-exec-card {
  min-height: 72px !important;
  margin-bottom: 10px !important;
  padding: 14px 16px !important;
  border: 1px solid var(--tms-line) !important;
  border-radius: 12px !important;
  background: var(--tms-bg-panel, #fff) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04) !important;
}

@media (max-width: 1260px) {
  html[data-tms-theme] .v996-exec-toolbar {
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  html[data-tms-theme] .v996-exec-toolbar .tms-date-filter {
    width: 100% !important;
    padding-top: 10px !important;
    padding-left: 0 !important;
    justify-content: flex-start !important;
    border-top: 1px solid var(--tms-line) !important;
    border-left: 0 !important;
  }
}

@media (max-width: 900px) {
  .app > aside {
    width: 190px !important;
    min-width: 190px !important;
  }

  html[data-tms-theme] main > h1::after {
    display: none !important;
  }
}

@media (max-width: 700px) {
  html[data-tms-theme] #c > .v2-hero:first-child,
  html[data-tms-theme] #c > .bill-hero:first-child,
  html[data-tms-theme] #c > .saas-hero:first-child,
  html[data-tms-theme] #c > [class$="-page"] > .v2-hero:first-child {
    align-items: flex-start !important;
    flex-direction: column !important;
    padding: 9px 10px !important;
  }

  html[data-tms-theme] .v996-exec-toolbar .tms-date-filter {
    align-items: flex-start !important;
  }

  html[data-tms-theme] .tms-date-filter__presets {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
